Fix bug #7446 with overrunning input buffer in ebrowse.
authorJoe Matarazzo <joe.matarazzo@gmail.com>
Sat, 27 Nov 2010 09:29:22 +0000 (11:29 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 27 Nov 2010 09:29:22 +0000 (11:29 +0200)
 ebrowse.c (yylex): If end of input buffer encountered while
 searching for a newline after "//", return YYEOF.

lib-src/ChangeLog
lib-src/ebrowse.c

index ba98132..0f51844 100644 (file)
@@ -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
index b51b4aa..67c9637 100644 (file)
@@ -1784,6 +1784,11 @@ yylex ()
             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;