Skip to content

Commit cb39cf9

Browse files
tobluxgeertu
authored andcommitted
m68k: sun3: Replace vsprintf() with bounded vsnprintf()
vsprintf() performs no bounds checking and can overflow - replace it with the safer vsnprintf(). Also remove the useless '+ 1' that is a leftover of commit 66ed28e ("m68k: sun3: Remove unused vsprintf() return value in prom_printf()"). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://patch.msgid.link/20260117202152.1036278-2-thorsten.blum@linux.dev Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
1 parent f16a957 commit cb39cf9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/m68k/sun3/prom/printf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ prom_printf(char *fmt, ...)
3030

3131
#ifdef CONFIG_KGDB
3232
ppbuf[0] = 'O';
33-
vsprintf(ppbuf + 1, fmt, args) + 1;
33+
vsnprintf(ppbuf + 1, sizeof(ppbuf) - 1, fmt, args);
3434
#else
35-
vsprintf(ppbuf, fmt, args);
35+
vsnprintf(ppbuf, sizeof(ppbuf), fmt, args);
3636
#endif
3737

3838
bptr = ppbuf;

0 commit comments

Comments
 (0)