* BUG: etags segfaults
@ 2003-03-26 16:52 Daniel Bergström
0 siblings, 0 replies; only message in thread
From: Daniel Bergström @ 2003-03-26 16:52 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 702 bytes --]
Hello!
In Emacs 21.3 the etags utility seg. faults. To recreate the error you
need to do the following steps:
* create a file named t.erl and add the following two lines:
-module(t).
-define().
* Then we execute the etags command:
etags -o TAGS t.erl
This results in a segfault and a core dumped. The reason to the segfault
was that in the routine erlang_attribute() it calculates the length of
the string between ( and ) to be -1. The if statement only checks if the
value isn't 0 to continue working with the string, while it should only
continue if its a possitive value greather then 0.
The patch attached should correct this problem.
Cheers,
Daniel
[-- Attachment #2: emacs-21.3.etags.patch --]
[-- Type: text/plain, Size: 338 bytes --]
--- emacs-21.3/lib-src/etags.c.org Wed Mar 26 17:08:34 2003
+++ emacs-21.3/lib-src/etags.c Wed Mar 26 17:09:43 2003
@@ -4969,7 +4969,7 @@
{
pos = skip_spaces (s + pos) - s;
len = erlang_atom (s, pos);
- if (len != 0)
+ if (len > 0)
pfnote (savenstr (& s[pos], len), TRUE,
s, pos + len, lineno, linecharno);
}
[-- Attachment #3: Type: text/plain, Size: 148 bytes --]
_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-03-26 16:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-26 16:52 BUG: etags segfaults Daniel Bergström
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).