unsafe cast from char* to SPPattern

Bug #1378595 reported by Liam P. White on 2014-10-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Qantas94Heavy
0.92.x
Medium
Qantas94Heavy

Bug Description

https://bazaar.launchpad.net/~inkscape.dev/inkscape/experimental/view/head:/src/widgets/paint-selector.cpp#L1151

1151| pat = pattern_getroot(SP_PATTERN(patid));

The variable 'patid' is a pointer to char. It has no vtable information. A cast to SPPattern would never work, and will probably crash.
I can't tell what was intended with this, or if it is actually correct.

Same line in trunk:
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/widgets/paint-selector.cpp#L1126

description: updated
Qantas94Heavy (qantas94heavy) wrote :

Still present in 0.92.x and master.

Changed in inkscape:
status: New → Triaged
milestone: none → 0.92.5
importance: Undecided → High
Changed in inkscape:
importance: High → Medium
Changed in inkscape:
assignee: nobody → Qantas94Heavy (qantas94heavy)
Qantas94Heavy (qantas94heavy) wrote :

Hi there, this doesn't seem to be right :)

I've made a pull request to GitLab, which should hopefully fix this issue: https://gitlab.com/inkscape/inkscape/merge_requests/676

Changed in inkscape:
status: Triaged → In Progress
Changed in inkscape:
status: In Progress → Fix Committed
milestone: 0.92.5 → 1.0
Qantas94Heavy (qantas94heavy) wrote :

Merged into master here: https://gitlab.com/inkscape/inkscape/commit/000a056a71115c2ad7a1a01bcfa7aa3b7c18f27d

Awaiting backport to 0.92.x.

(For master:)
Closed by: https://gitlab.com/Qantas94Heavy

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers