From da2b5401e8747adb28558684b48328806bf43e1e Mon Sep 17 00:00:00 2001 From: Joe Matarazzo Date: Sat, 27 Nov 2010 11:29:22 +0200 Subject: [PATCH] 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. --- lib-src/ChangeLog | 5 +++++ lib-src/ebrowse.c | 5 +++++ 2 files changed, 10 insertions(+) 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; -- 2.39.2