summaryrefslogtreecommitdiff
path: root/lib-src/ebrowse.c
diff options
context:
space:
mode:
authorJoe Matarazzo <joe.matarazzo@gmail.com>2010-11-27 11:29:22 +0200
committerEli Zaretskii <eliz@gnu.org>2010-11-27 11:29:22 +0200
commitd6e6f2469eb94088923645e2314304e111c5d0f7 (patch)
tree9a50e2b667dfce43ce50507c2109cb4f49629a1b /lib-src/ebrowse.c
parent3e07a11b7ea6210c35495ab14cbefc70c7baf8ff (diff)
downloademacs-d6e6f2469eb94088923645e2314304e111c5d0f7.tar.gz
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.
Diffstat (limited to 'lib-src/ebrowse.c')
-rw-r--r--lib-src/ebrowse.c5
1 files changed, 5 insertions, 0 deletions
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;