GNOME Bugzilla – Bug 70126
Incorrect server properties can cause a crash when running a query
Last modified: 2004-12-22 21:47:04 UTC
This is for bonobo-activation, HEAD version, 2002/01/30. Badly written .server files can cause a crash in bonobo-activation-server when running a query. This can happen when server infos have incorrect properties (missing "name" or "type" attributes, or badly named xml nodes). How to reproduce: install a .server file which contains, for example <oaf_info> <oaf_server iid="OAFIID:ExampleServer:20000717" type="exe" location="./bonobo-activation-empty-server"> <oaf_attribute name="test" value="test"/> </oaf_server> <oaf_server iid="OAFIID:ExampleServer:20000718" type="exe" location="./bonobo-activation-empty-server"> <oaf_attribute type="string" value="idonthaveaname"/> </oaf_server> <oaf_server iid="OAFIID:ExampleServer:20000719" type="exe" location="./bonobo-activation-empty-server"> <incorrect_name type="string" value="test"/> <oaf_attribute name="test" type="string" value="test"/> </oaf_server> </oaf_info> Any of the previous three cases causes a crash when running bonobo-activation-run-query. This is because server properties don't get filled in server/object-directory-load.c (od_entry_read_props). Crash occurs in qexp_evaluate_id (file activation-context-query.c, line 859). Attached is a patch which fixes these problems and improves robustness in the function.
Created attachment 6558 [details] [review] Improved robustness when reading server info properties
The patch looks good, but it's important that we use xmlFree, not simply free, to free the result of xmlGetProp. It looks like that was a pre-existing bug, but the patch makes it particularly obvious.
Reassigning bonobo-activation bugs to michael.
Added your stuff as a regression test to HEAD bonobo-activation, but this was already fixed there. Thanks.