Skip to content

Commit 64d37e2

Browse files
authored
[NFC] Fix potential buffer overflow (KhronosGroup#5715)
Fixing a clusterfuzz finding. If the given binary has debug instruction which contained a badly formatted ANSI escape sequence, the iteration could go beyond the string length. Signed-off-by: Nathan Gauër <[email protected]>
1 parent b9d8114 commit 64d37e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/disassemble.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ uint32_t GetLineLengthWithoutColor(const std::string line) {
605605
if (line[i] == '\x1b') {
606606
do {
607607
++i;
608-
} while (line[i] != 'm');
608+
} while (i < line.size() && line[i] != 'm');
609609
continue;
610610
}
611611

0 commit comments

Comments
 (0)