From da2b5401e8747adb28558684b48328806bf43e1e Mon Sep 17 00:00:00 2001 From: Joe Matarazzo Date: Sat, 27 Nov 2010 11:29:22 +0200 Subject: 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/ebrowse.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib-src/ebrowse.c') 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; -- cgit v1.2.3