Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Dec 2013 19:01:51 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r259271 - stable/10/contrib/gcclibs/libcpp
Message-ID:  <201312121901.rBCJ1pmL039439@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Thu Dec 12 19:01:50 2013
New Revision: 259271
URL: http://svnweb.freebsd.org/changeset/base/259271

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/10/contrib/gcclibs/libcpp/charset.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/gcclibs/libcpp/charset.c
==============================================================================
--- stable/10/contrib/gcclibs/libcpp/charset.c	Thu Dec 12 18:29:36 2013	(r259270)
+++ stable/10/contrib/gcclibs/libcpp/charset.c	Thu Dec 12 19:01:50 2013	(r259271)
@@ -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';



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312121901.rBCJ1pmL039439>