This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/10810] gcc-3.3 fails make check: buffer overrun in test_demangle.c
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 May 2003 20:04:02 -0000
- Subject: [Bug other/10810] gcc-3.3 fails make check: buffer overrun in test_demangle.c
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10810
pinskia@physics.uc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dave.anglin@nrc.ca
------- Additional Comments From zack@gcc.gnu.org 2003-05-24 02:14 -------
No. The one-line patch is wrong. Note the comment above the #define that
got changed: "read a single line *of arbitrary length* from standard input."
That LINELEN define is the *initial* buffer size; getline() is supposed to
enlarge its buffer as needed.
It appears that there is a fencepost error, where the buffer will be overflowed
by one character iff the input line is exactly as long as the buffer. The
correct fix, then, would be this change, somewhat below:
- if (count >= alloc)
+ if (count + 1 >= alloc)
I do not have time right now to test that, and I don't see the failure anyway;
could one of you try it and check it in if it works?
------- Additional Comments From pinskia@physics.uc.edu 2003-05-24 20:03 -------
*** Bug 8346 has been marked as a duplicate of this bug. ***
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.