UNREACHABLE in /inkscape/src/style.cpp

Bug #614232 reported by Vaughn Spurlin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Kris

Bug Description

UNREACHABLE in /inkbugs/inkscape/src/style.cpp (lines 2439-4439)

In sp_style_write_istring(...):
Code block is unreachable because of the syntactic structure of the code (CWE-561).

 3582 if (val->inherit) {
 3583 return g_snprintf(p, len, "%s:inherit;", key);
 3584 } else {
 3585 gchar *val_quoted = css2_escape_quote(val->value);
 3586 if (val_quoted) {
 3587 return g_snprintf(p, len, "%s:%s;", key, val_quoted);
This code cannot be reached: "g_free(val_quoted);".
 3588 g_free (val_quoted);
 3589 }
 3590 }

Tags: coverity
Revision history for this message
Vaughn Spurlin (vspurlin) wrote :

fix suggestion 2010-07-25:
 delete line 3588 g_free (val_quoted);

fix reason:
  if css2_escape_quote(...) returned NULL, then val_quoted does not need to be freed.

Revision history for this message
Jon A. Cruz (jon-joncruz) wrote :

There's more to consider here. The early returns need to be refactored away.

Kris (kris-degussem)
Changed in inkscape:
status: New → In Progress
assignee: nobody → Kris (kris-degussem)
Revision history for this message
Kris (kris-degussem) wrote :

Committed fix in revision 11668.

Changed in inkscape:
status: In Progress → Fix Committed
Kris (kris-degussem)
Changed in inkscape:
milestone: none → 0.49
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
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.