re PR other/10810 (gcc-3.3 fails make check: buffer overrun in test_demangle.c)

PR other/10810
	* test-demangle.c (getline): Fix fence-post error.

From-SVN: r67499
This commit is contained in:
John David Anglin 2003-06-05 16:38:22 +00:00 committed by John David Anglin
parent 8f231b5d87
commit 8191fe819a
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-06-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR other/10810
* test-demangle.c (getline): Fix fence-post error.
2003-06-03 Nick Clifton <nickc@redhat.com>
* asprintf.c: Change comment to note that -1 is returned upon

View File

@ -65,7 +65,7 @@ getline(buf)
line: copy this line into the buffer and return. */
while (c != EOF && c != '\n')
{
if (count >= alloc)
if (count + 1 >= alloc)
{
alloc *= 2;
data = xrealloc (data, alloc);