mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-21 04:21:33 +02:00
Fixed potential overflow
This commit is contained in:
@@ -44,6 +44,11 @@ static const char *value_to_string(GB_gameboy_t *gb, uint16_t value, bool prefer
|
||||
symbol = NULL;
|
||||
}
|
||||
|
||||
/* Avoid overflow */
|
||||
if (strlen(symbol->name) > 240) {
|
||||
symbol = NULL;
|
||||
}
|
||||
|
||||
if (!symbol) {
|
||||
sprintf(output, "$%04x", value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user