Commit de666cf0 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven

cris/kgdb: Fix buffer overflow in getpacket()

arch/cris/arch-v10/kernel/kgdb.c: In function 'handle_exception':
arch/cris/arch-v10/kernel/kgdb.c:534:17: warning: array subscript is above array bounds [-Warray-bounds]
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent e42e3980
...@@ -523,7 +523,7 @@ getpacket (char *buffer) ...@@ -523,7 +523,7 @@ getpacket (char *buffer)
xmitcsum = -1; xmitcsum = -1;
count = 0; count = 0;
/* Read until a # or the end of the buffer is reached */ /* Read until a # or the end of the buffer is reached */
while (count < BUFMAX) { while (count < BUFMAX - 1) {
ch = getDebugChar (); ch = getDebugChar ();
if (ch == '#') if (ch == '#')
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment