Dxf2svg: Returning pointer to local array variable

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

Bug Description

Cppcheck reports the error "Returning pointer to local array variable" on the extension dxf2svg (trunk revision 11052):

src\extension\dxf2svg\aci2rgb.cpp line 38
src\extension\dxf2svg\entities2elements.cpp line 145, 168, and 249

In these functions a non static variable is created and a pointer is returned. However, after the return statement the memory occupied by the local variables created in these functions is wiped, and hence, immediately after the pointer is returned this memory and variables are invalid and can not be used any more.

Solution: either dropping the pointers, looking for a solution without these pointers or converting to a class?

Kris (kris-degussem)
Changed in inkscape:
importance: Undecided → Low
tags: added: extensions-plugins
Revision history for this message
Kris (kris-degussem) wrote :

the src/extension/dxf2svg code was unused for a long time and bit rotten.
It was therefore deleted from Inkscape's source tree in trunk revision 12075.

Changed in inkscape:
status: New → Fix Committed
milestone: none → 0.49
assignee: nobody → Kris (kris-degussem)
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.