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

gEDA-bug: [ geda-Patches-1534089 ] libgeda: bugfix for segfault when loading corrupted file



Patches item #1534089, was opened at 2006-08-03 21:57
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=818428&aid=1534089&group_id=161080

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Tomaz Solc (avian1)
Assigned to: Nobody/Anonymous (nobody)
Summary: libgeda: bugfix for segfault when loading corrupted file

Initial Comment:
Gschem will crash with a segmentation fault when user
tries to open a corrupted file that has a '[' character
in a wrong place.

I believe the attached patch fixes this problem and
also makes the file parsing function o_read() in
libgeda more robust.

The crash is caused because the code in o_read()
(starting on line 438) when a "START_EMBEDDED" marker
is read does no check if the preceding object is of
type "complex" or "placeholder". This causes a NULL
pointer dereference in expression
"object_list_save->complex->prim_objs", because objects
of types other than "complex" or "placeholder" do not
have the "complex" field initialized.

How to reproduce the crash: 

Open the following file in Gschem:

v 20060123 1
L 59500 46200 59900 46200 3 0 0 0 -1 -1
[
L 59500 46100 59900 46100 3 0 0 0 -1 -1
L 59500 46300 59900 46300 3 0 0 0 -1 -1
]

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=818428&aid=1534089&group_id=161080


_______________________________________________
geda-bug mailing list
geda-bug@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-bug