dbus set attr method crashes inkscape if the obj id is uknown

Bug #707054 reported by joakim@verona.se
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
joakim@verona.se

Bug Description

For example:
    (inkdoc-set-attribute (inkscape-document-dbus-proxy-create "desktop_0") "nonexisting" "id" "lala")

Tags: crash dbusapi

Related branches

Revision history for this message
joakim@verona.se (joakim-verona) wrote :

this seems like a bug in the inkscape core

SPObject *SPDocument::getObjectById(gchar const *id) const
{
    g_return_val_if_fail(id != NULL, NULL);

    GQuark idq = g_quark_from_string(id);
    return (SPObject*)g_hash_table_lookup(priv->iddef, GINT_TO_POINTER(idq));
}

if id is unknown, the spobject cast will fail. the client code assumes that NULL will be returned.

So the cast should be conditional,

Revision history for this message
su_v (suv-lp) wrote :

> this seems like a bug in the inkscape core

Could you attach backtraces from the crashes to your reports, as well as any related console messages?

tags: added: crash
Changed in inkscape:
importance: Undecided → High
Revision history for this message
su_v (suv-lp) wrote :

Also, providing details about OS and Inkscape revision number with each bug report would be helpful for bug triage.

Revision history for this message
joakim@verona.se (joakim-verona) wrote :

Ok my initial assessment was wrong. This is a simple bug in the dbus interface code.

I attach a patch that fixes the issue.

Revision history for this message
joakim@verona.se (joakim-verona) wrote :

~suv: I keep forgetting to add context sorry. is there a way i can describe my setup once, and link to it in the reports?

Revision history for this message
su_v (suv-lp) wrote :

<off-topic>
> is there a way i can describe my setup once, and
> link to it in the reports?

IMHO it would be better to include the information in each report, because Inkscape revisions as well as the build&runtime environment will be different over time. For a bug report however it is important to know with which version/revision/platform it has been produced (and confirmed).

Preferably add two lines to the bug description:
- Inkscape version + revision number
- platform/distribution version
and
- optionally: any external dependencies / libraries which possibly are involved (e..g. after an upgrade)

Another reason to include it into the report itself: support of searching the bug tracker with keywords.
</off-topic>

jazzynico (jazzynico)
Changed in inkscape:
assignee: nobody → joakim@verona.se (joakim-verona)
status: New → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in the trunk, revision 10114.
Thanks Joakim!

Changed in inkscape:
status: In Progress → Fix Released
su_v (suv-lp)
tags: added: dbusapi
removed: dbus
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.