From de666cf0a6b5eb67be0bd518c959a9cf3336dd15 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 12 Feb 2013 10:06:12 +0100 Subject: 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: Geert Uytterhoeven diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c index d0b6257..0e79907 100644 --- a/arch/cris/arch-v10/kernel/kgdb.c +++ b/arch/cris/arch-v10/kernel/kgdb.c @@ -523,7 +523,7 @@ getpacket (char *buffer) xmitcsum = -1; count = 0; /* Read until a # or the end of the buffer is reached */ - while (count < BUFMAX) { + while (count < BUFMAX - 1) { ch = getDebugChar (); if (ch == '#') break; -- cgit v0.10.2