From 94284ea9aa328f469a3b3ea5974f0e5a291ae7f5 Mon Sep 17 00:00:00 2001 From: gibbed Date: Fri, 23 Nov 2018 07:50:42 -0600 Subject: [PATCH] [CPU] Fix null termination in HIRBuilder::CommentFormat. --- src/xenia/cpu/hir/hir_builder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xenia/cpu/hir/hir_builder.cc b/src/xenia/cpu/hir/hir_builder.cc index af954ca6c..e461996b5 100644 --- a/src/xenia/cpu/hir/hir_builder.cc +++ b/src/xenia/cpu/hir/hir_builder.cc @@ -764,7 +764,7 @@ void HIRBuilder::CommentFormat(const char* format, ...) { va_start(args, format); size_t chars_written = vsnprintf(p, kMaxCommentSize - 1, format, args); va_end(args); - size_t rewind = kMaxCommentSize - chars_written; + size_t rewind = kMaxCommentSize - chars_written - 1; arena_->Rewind(rewind); Instr* i = AppendInstr(OPCODE_COMMENT_info, 0); i->src1.offset = (uint64_t)p;