mirror of git://gcc.gnu.org/git/gcc.git
re PR preprocessor/30001 (out-of-bounds access when processing empty file)
PR preprocessor/30001: * charset.c (_cpp_convert_input): Check that to.len is greater than zero. From-SVN: r120245
This commit is contained in:
parent
c5bfb0451d
commit
30b0edc057
|
|
@ -1,3 +1,9 @@
|
||||||
|
2006-12-28 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
PR preprocessor/30001:
|
||||||
|
* charset.c (_cpp_convert_input): Check that to.len is greater
|
||||||
|
than zero.
|
||||||
|
|
||||||
2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
|
2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
|
||||||
|
|
||||||
* configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
|
* configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/* CPP Library - charsets
|
/* CPP Library - charsets
|
||||||
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
Broken out of c-lex.c Apr 2003, adding valid C99 UCN ranges.
|
Broken out of c-lex.c Apr 2003, adding valid C99 UCN ranges.
|
||||||
|
|
@ -1628,7 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, const char *input_charset,
|
||||||
terminate with another \r, not an \n, so that we do not mistake
|
terminate with another \r, not an \n, so that we do not mistake
|
||||||
the \r\n sequence for a single DOS line ending and erroneously
|
the \r\n sequence for a single DOS line ending and erroneously
|
||||||
issue the "No newline at end of file" diagnostic. */
|
issue the "No newline at end of file" diagnostic. */
|
||||||
if (to.text[to.len - 1] == '\r')
|
if (to.len && to.text[to.len - 1] == '\r')
|
||||||
to.text[to.len] = '\r';
|
to.text[to.len] = '\r';
|
||||||
else
|
else
|
||||||
to.text[to.len] = '\n';
|
to.text[to.len] = '\n';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue