From e35c22d4059a70c2d79409adc0b3224d121b66bf Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Thu, 17 Sep 2020 23:47:35 +0300 Subject: [PATCH] Fix a potential single byte overflow --- Core/debugger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/debugger.c b/Core/debugger.c index e013076..002d455 100644 --- a/Core/debugger.c +++ b/Core/debugger.c @@ -132,7 +132,7 @@ static const char *value_to_string(GB_gameboy_t *gb, uint16_t value, bool prefer } /* Avoid overflow */ - if (symbol && strlen(symbol->name) > 240) { + if (symbol && strlen(symbol->name) >= 240) { symbol = NULL; } @@ -172,7 +172,7 @@ static const char *debugger_value_to_string(GB_gameboy_t *gb, value_t value, boo } /* Avoid overflow */ - if (symbol && strlen(symbol->name) > 240) { + if (symbol && strlen(symbol->name) >= 240) { symbol = NULL; }