]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/10810 (gcc-3.3 fails make check: buffer overrun in test_demangle.c)
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Thu, 5 Jun 2003 16:38:22 +0000 (16:38 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 5 Jun 2003 16:38:22 +0000 (16:38 +0000)
PR other/10810
* test-demangle.c (getline): Fix fence-post error.

From-SVN: r67499

libiberty/ChangeLog
libiberty/testsuite/test-demangle.c

index af52033a23dfe35e35732679b3a94d5fc91ce44a..baa15cd6882b2047aae32c6195fe8880a2ba3db0 100644 (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
index 82f263e88af2afcbde787393b30e1e2c95eb79aa..6e5d0b4b9731b160b0efe85d522b2ffa2b4ba230 100644 (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);