#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 , 11 years ago
Milestone: | 1.10.2 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
r26505 "DGN: use int instead of long (#5252). Code paths not actually triggered by the OGR DGN driver"