mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-07-05 05:42:51 +00:00
easylogo: avoid buffer overrun
Building easylogo with `HOST_TOOLS_ALL=y make tools` results in a build warning due to a possible buffer overrun: tools/easylogo/easylogo.c:453:4: note: ‘sprintf’ output between 7 and 262 bytes into a destination of size 256 sprintf (str, "%s, 0x%02x", app, *dataptr++); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Truncate the output to fit into the destination buffer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
071f369dd2
commit
2bdb42f7c0
1 changed files with 2 additions and 1 deletions
|
@ -450,7 +450,8 @@ int image_save_header (image_t * image, char *filename, char *varname)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
strcpy (app, str);
|
strcpy (app, str);
|
||||||
sprintf (str, "%s, 0x%02x", app, *dataptr++);
|
sprintf(str, "%.*s, 0x%02x", (int)sizeof(str) - 7, app,
|
||||||
|
*dataptr++);
|
||||||
col++;
|
col++;
|
||||||
count--;
|
count--;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue