From: Joe Matarazzo Date: Sat, 27 Nov 2010 09:29:22 +0000 (+0200) Subject: Fix bug #7446 with overrunning input buffer in ebrowse. X-Git-Tag: emacs-pretest-23.2.91~44^2~4 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=da2b5401e8747adb28558684b48328806bf43e1e;p=emacs.git 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. --- diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index ba98132521d..0f518445a45 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2010-11-27 Joe Matarazzo (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 * emacsclient.c (set_local_socket) [DARWIN_OS]: Add fall-back diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index b51b4aa6965..67c9637daba 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -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;