svn commit: r259273 - stable/8/contrib/gcclibs/libcpp
Pedro F. Giffuni
pfg at FreeBSD.org
Thu Dec 12 19:02:43 UTC 2013
Author: pfg
Date: Thu Dec 12 19:02:42 2013
New Revision: 259273
URL: http://svnweb.freebsd.org/changeset/base/259273
Log:
MFC r258712;
libcpp: fix an underflow.
Similar fix seen in Apple's gcc42.
Obtained from: OpenBSD (Rev 1.2)
MFC after: 2 weeks
Modified:
stable/8/contrib/gcclibs/libcpp/charset.c
Directory Properties:
stable/8/ (props changed)
stable/8/contrib/ (props changed)
stable/8/contrib/gcclibs/ (props changed)
Modified: stable/8/contrib/gcclibs/libcpp/charset.c
==============================================================================
--- stable/8/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:02:18 2013 (r259272)
+++ stable/8/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:02:42 2013 (r259273)
@@ -1628,7 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, c
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
issue the "No newline at end of file" diagnostic. */
- if (to.text[to.len - 1] == '\r')
+ if (to.len > 0 && to.text[to.len - 1] == '\r')
to.text[to.len] = '\r';
else
to.text[to.len] = '\n';
More information about the svn-src-stable
mailing list