ports/devel/simulavr/patches/patch-src_eeprom_c

15 lines
482 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Fix buffer overflow due to incorrect strncat() usage.
http://savannah.nongnu.org/bugs/?29049
--- src/eeprom.c.orig Mon Mar 14 23:22:50 2011
+++ src/eeprom.c Mon Mar 14 23:25:25 2011
@@ -416,7 +416,7 @@ eeprom_dump_core (EEProm *eeprom, FILE * f_core)
line[0] = '\0';
}
snprintf (buf, 80, "%02x ", storage_readb (eeprom->stor, i));
- strncat (line, buf, 80);
+ strncat (line, buf, 80 - strlen(line) - 1);
}
if (dup > 0)
{