changeset 111776:921c7579cd1a

Fix bug #7446 with overrunning input buffer in ebrowse. ebrowse.c (yylex): If end of input buffer encountered while searching for a newline after "//", return YYEOF.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 27 Nov 2010 11:29:22 +0200
parents 81cac26277b0
children 68ad8caf0020
files lib-src/ChangeLog lib-src/ebrowse.c
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Fri Nov 26 16:33:21 2010 -0500
+++ b/lib-src/ChangeLog	Sat Nov 27 11:29:22 2010 +0200
@@ -1,3 +1,8 @@
+2010-11-27  Joe Matarazzo  <joe.matarazzo@gmail.com>  (tiny change)
+
+	* ebrowse.c (yylex): If end of input buffer encountered while
+	searching for a newline after "//", return YYEOF.  (Bug#7446)
+
 2010-11-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back
--- a/lib-src/ebrowse.c	Fri Nov 26 16:33:21 2010 -0500
+++ b/lib-src/ebrowse.c	Sat Nov 27 11:29:22 2010 +0200
@@ -1784,6 +1784,11 @@
             case '/':
 	      while (GET (c) && c != '\n')
 		;
+	      /* Don't try to read past the end of the input buffer if
+		 the file ends in a C++ comment without a newline.  */
+	      if (c == 0)
+		return YYEOF;
+
 	      INCREMENT_LINENO;
 	      break;