Re: [PATCH] Re: Segfault on loading of non existent syntax file



> 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

Attachment: syntax-missing-file-fix.patch
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]