mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2025-01-19 12:30:06 +00:00
[NFC] Fix potential buffer overflow (#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 <brioche@google.com>
This commit is contained in:
parent
b9d8114695
commit
64d37e2811
@ -605,7 +605,7 @@ uint32_t GetLineLengthWithoutColor(const std::string line) {
|
||||
if (line[i] == '\x1b') {
|
||||
do {
|
||||
++i;
|
||||
} while (line[i] != 'm');
|
||||
} while (i < line.size() && line[i] != 'm');
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user