From owner-svn-src-head@FreeBSD.ORG Thu Nov 28 16:36:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D72434C; Thu, 28 Nov 2013 16:36:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89C321804; Thu, 28 Nov 2013 16:36:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rASGa3WU012332; Thu, 28 Nov 2013 16:36:03 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rASGa3EG012331; Thu, 28 Nov 2013 16:36:03 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201311281636.rASGa3EG012331@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 28 Nov 2013 16:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258712 - head/contrib/gcclibs/libcpp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2013 16:36:03 -0000 Author: pfg Date: Thu Nov 28 16:36:03 2013 New Revision: 258712 URL: http://svnweb.freebsd.org/changeset/base/258712 Log: libcpp: fix an underflow. Obtained from: OpenBSD (Rev 1.2) MFC after: 2 weeks Modified: head/contrib/gcclibs/libcpp/charset.c Modified: head/contrib/gcclibs/libcpp/charset.c ============================================================================== --- head/contrib/gcclibs/libcpp/charset.c Thu Nov 28 15:28:51 2013 (r258711) +++ head/contrib/gcclibs/libcpp/charset.c Thu Nov 28 16:36:03 2013 (r258712) @@ -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';