[PATCH] Re: Segfault on loading of non existent syntax file
Pavel Tsekov
ptsekov at gmx.net
Mon Mar 27 09:08:58 UTC 2006
> On Thu, 2006-02-02 at 20:33 +0100, Leonard den Ottolander wrote:
> > Ran mc from a temporary build dir and copied Syntax to ~/.mc/cedit/ .
> > Tried editing a file and saw a segfault when the non existent syntax
> > file is attempted to be loaded.
> >
> > #0 edit_get_rule (edit=0x92e8dc0, byte_index=-1) at syntax.c:285
> > #1 0x080a4161 in edit_free_syntax_rules (edit=0x92e8dc0) at
> > syntax.c:977
>
> A fix is attached. When edit_load_syntax() fails on Syntax because the
> target syntax file is missing there are no syntax rules to be freed,
> just an uninitialized rules block. That block needs to be (freed and)
> set to NULL or the editor will attempt to load the block as if it were
> valid rules and still crash.
How about the attached fix ?
--
"Feel free" mit GMX FreeMail!
Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: syntax-missing-file-fix.patch
Type: application/octet-stream
Size: 776 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20060327/8931f45a/attachment.obj>
More information about the mc-devel
mailing list