Opened 21 years ago
Last modified 21 years ago
#361 closed defect (fixed)
crash reading shape file #2
Reported by: | Owned by: | warmerdam | |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | OGR_SF | Version: | unspecified |
Severity: | critical | Keywords: | |
Cc: |
Description
we trace a crash when reading a shape file to OGRLinearRing constructor in the ogr directory - the crash was to do with memcpy with a null pointer; we put in a null check to fix the problem and a few more for good measure. Here is the fix. /************************************************************************/ /* OGRLinearRing() */ /************************************************************************/ OGRLinearRing::OGRLinearRing( OGRLinearRing * poSrcRing ) { // SPR NULL checks and checks to ensure points in memcopies not zero if (poSrcRing != NULL) { setNumPoints( poSrcRing->getNumPoints() ); if (paoPoints != NULL && poSrcRing->paoPoints != NULL) memcpy( paoPoints, poSrcRing->paoPoints, sizeof(OGRRawPoint) * getNumPoints() ); if ( padfZ != NULL && poSrcRing->padfZ != NULL ) { Make3D(); memcpy( padfZ, poSrcRing->padfZ, sizeof(double) * getNumPoints() ); } } }
Note:
See TracTickets
for help on using tickets.