unsafe cast from char* to SPPattern

Bug #1378595 reported by Liam P. White
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Qantas94Heavy
0.92.x
Won't Fix
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
Revision history for this message
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)
Revision history for this message
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
Revision history for this message
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

tbnorth (terry-n-brown)
tags: added: bug-migration
Max Gaukler (mgmax)
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.