[llvm-commits] [llvm-gcc-4.2] r54327 - in /llvm-gcc-4.2/trunk/libcpp: ChangeLog.apple charset.c
Bill Wendling
isanbard at gmail.com
Mon Aug 4 13:05:31 PDT 2008
Author: void
Date: Mon Aug 4 15:05:30 2008
New Revision: 54327
URL: http://llvm.org/viewvc/llvm-project?rev=54327&view=rev
Log:
Make sure we don't read before the buffer.
PR2628
Modified:
llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple
llvm-gcc-4.2/trunk/libcpp/charset.c
Modified: llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple?rev=54327&r1=54326&r2=54327&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/libcpp/ChangeLog.apple Mon Aug 4 15:05:30 2008
@@ -1,3 +1,8 @@
+2008-08-04 Bill Wendling <wendling at apple.com>
+
+ Radar 6121572
+ * charset.c (_cpp_convert_input): Don't read to.text[-1].
+
2008-05-01 Mike Stump <mrs at apple.com>
Radar 5774975
Modified: llvm-gcc-4.2/trunk/libcpp/charset.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/charset.c?rev=54327&r1=54326&r2=54327&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/libcpp/charset.c (original)
+++ llvm-gcc-4.2/trunk/libcpp/charset.c Mon Aug 4 15:05:30 2008
@@ -1692,7 +1692,8 @@
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')
+ /* APPLE LOCAL don't read to.text[-1] radar 6121572 */
+ 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 llvm-commits
mailing list