Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5252 closed defect (fixed)

dgnwrite.cpp:2 * bad call to memcpy ?

Reported by: dcb Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 1.10.1
Severity: normal Keywords:
Cc:

Description

I just ran the static analysis tool "cppcheck" over the source code of gdal-1.10.1

It said many things, including

[dgnwrite.cpp:1076]: (error) Buffer is accessed out of bounds: psArc.quat [dgnwrite.cpp:1297]: (error) Buffer is accessed out of bounds: psCone.quat

Source code for the first one is

memcpy( psArc->quat, panQuaternion, sizeof(long)*4 );

I think you'd be better off with something like

memcpy( psArc->quat, panQuaternion, sizeof(panQuaternion[0]) * 4 );

Change History (2)

comment:1 by Even Rouault, 11 years ago

Milestone: 1.10.2
Resolution: fixed
Status: newclosed

r26505 "DGN: use int instead of long (#5252). Code paths not actually triggered by the OGR DGN driver"

comment:2 by Kyle Shannon, 11 years ago

Also fixes Coverity 1074430, 1074453, 1075076, 1075088

Note: See TracTickets for help on using tickets.