# HG changeset patch # User Eli Zaretskii # Date 1290850162 -7200 # Node ID 921c7579cd1a792b2a18092ed5124f56743af715 # Parent 81cac26277b0bf0e91cd25e387f582366e109dbb 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 -r 81cac26277b0 -r 921c7579cd1a lib-src/ChangeLog --- 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 (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 -r 81cac26277b0 -r 921c7579cd1a lib-src/ebrowse.c --- 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;