From 295bf0ffc74b3e51101f5b1765dd5f5e2405bd02 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Thu, 30 Mar 2006 16:44:12 +0000 Subject: [PATCH] * i386-stub.c (getpacket): Fix array overflow. * m32r-stub.c (getpacket): Likewise. * m68k-stub.c (getpacket): Likewise. * sh-stub.c (getpacket): Likewise. * sparc-stub.c (getpacket): Likewise. --- gdb/ChangeLog | 8 ++++++++ gdb/i386-stub.c | 2 +- gdb/m32r-stub.c | 2 +- gdb/m68k-stub.c | 2 +- gdb/sh-stub.c | 2 +- gdb/sparc-stub.c | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 87c7974a21..799f737083 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2006-03-30 Adrien Kunysz + + * i386-stub.c (getpacket): Fix array overflow. + * m32r-stub.c (getpacket): Likewise. + * m68k-stub.c (getpacket): Likewise. + * sh-stub.c (getpacket): Likewise. + * sparc-stub.c (getpacket): Likewise. + 2006-03-30 Daniel Jacobowitz * frame.h (set_current_sal_from_frame): New prototype. diff --git a/gdb/i386-stub.c b/gdb/i386-stub.c index 1251567e91..6b91296291 100644 --- a/gdb/i386-stub.c +++ b/gdb/i386-stub.c @@ -474,7 +474,7 @@ getpacket (void) count = 0; /* now, read until a # or end of buffer is found */ - while (count < BUFMAX) + while (count < BUFMAX - 1) { ch = getDebugChar (); if (ch == '$') diff --git a/gdb/m32r-stub.c b/gdb/m32r-stub.c index c7033ea17a..4d54f72d60 100644 --- a/gdb/m32r-stub.c +++ b/gdb/m32r-stub.c @@ -605,7 +605,7 @@ getpacket (void) count = 0; /* now, read until a # or end of buffer is found */ - while (count < BUFMAX) + while (count < BUFMAX - 1) { ch = getDebugChar (); if (ch == '$') diff --git a/gdb/m68k-stub.c b/gdb/m68k-stub.c index 54e06b13cc..4ef4069bc3 100644 --- a/gdb/m68k-stub.c +++ b/gdb/m68k-stub.c @@ -553,7 +553,7 @@ getpacket (void) count = 0; /* now, read until a # or end of buffer is found */ - while (count < BUFMAX) + while (count < BUFMAX - 1) { ch = getDebugChar (); if (ch == '$') diff --git a/gdb/sh-stub.c b/gdb/sh-stub.c index bdd9e501b8..76c98a5e8a 100644 --- a/gdb/sh-stub.c +++ b/gdb/sh-stub.c @@ -403,7 +403,7 @@ retry: count = 0; /* now, read until a # or end of buffer is found */ - while (count < BUFMAX) + while (count < BUFMAX - 1) { ch = getDebugChar (); if (ch == '$') diff --git a/gdb/sparc-stub.c b/gdb/sparc-stub.c index 1e6298a179..c12d4360a4 100644 --- a/gdb/sparc-stub.c +++ b/gdb/sparc-stub.c @@ -306,7 +306,7 @@ retry: count = 0; /* now, read until a # or end of buffer is found */ - while (count < BUFMAX) + while (count < BUFMAX - 1) { ch = getDebugChar (); if (ch == '$')