Subject: bug#7446: closed (Re: bug#7446: Emacs 23.2 [windows] - Buffer overrun bug with ebrowse.exe)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 27 Nov 2010 09:26:02 +0000

Your bug report

#7446: Emacs 23.2 [windows] - Buffer overrun bug with ebrowse.exe

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
7446: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7446
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#7446: Emacs 23.2 [windows] - Buffer overrun bug with ebrowse.exe
From: Eli Zaretskii <[email-masked]>
To: Joe Matarazzo <[email-masked]>
Cc: [email-masked]
Date: Sat, 27 Nov 2010 11:32:03 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Fri, 19 Nov 2010 16:39:49 -0800
> From: Joe Matarazzo <[email-masked]>
> Cc: 
> 
> When the input file ends with a C++ style "//" comment line, without a
> newline at the end, the parser will attempt to read past the end of
> the input buffer. This produces undefined results, among them putting
> the parser in a bogus state that makes all subsequent input files
> parse incorrectly. Here's a possible fix:

Thanks, I applied this patch to the Emacs 23 branch.

Subject: Emacs 23.2 [windows] - Buffer overrun bug with ebrowse.exe
From: Joe Matarazzo <[email-masked]>
To: [email-masked]
Date: Fri, 19 Nov 2010 16:39:49 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

When the input file ends with a C++ style "//" comment line, without a
newline at the end, the parser will attempt to read past the end of
the input buffer. This produces undefined results, among them putting
the parser in a bogus state that makes all subsequent input files
parse incorrectly. Here's a possible fix:

--- old/ebrowse.c  2010-04-03 15:26:07 -0700
+++ new/ebrowse.c    2010-11-19 16:36:13 -0800
@@ -1784,6 +1784,10 @@
             case '/':
              while (GET (c) && c != '\n')
                ;
+
+              if (c == 0)
+                return YYEOF;
+
              INCREMENT_LINENO;
              break;

I'm not subscribed to the list. Please direct any follow up questions
directly to my email.

Thanks,
Joe