Mercurial > emacs
diff lib-src/ebrowse.c @ 111776:921c7579cd1a
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.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 27 Nov 2010 11:29:22 +0200 |
parents | f039ef236594 |
children | 141d3f14d8c3 794f724ca655 |
line wrap: on
line diff
--- 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;