[Gdal-dev] Errors in dgnread.cpp

Frank Warmerdam warmerdam at pobox.com
Sat Sep 20 20:39:38 EDT 2003


Steve Brooks wrote:
> I have found two fatal errors in dgnread.cpp the first one will cause a 
> crash
> when there appears to be attributes on the tcb which inside the 'if'  
> psElement->attr_bytes gets setup as a negative number which causes the
> CPLMalloc to crash.  If you would like a copy of the dgn file let me know.
> My fix was not to go inside the if( psElement->properties & 
> DGNPF_ATTRIBUTES )
> if the element is a tcb.
>  
> The next change was causing OGRLayer::GetFeature
> to not return any features.  When the DGN Index was being built the
> offset was being truncated to an invalid offest by the (unsigned char)
> cast.
>  
> My envionment is Windows XP, Microsoft Visual Studio.Net 2003.

Steve,

I would appreciate a file to demonstrate the first problem.

The second is a very serious bug introduced in a fit of (apparently improper)
type casting fixes, and apparently breaks any random (rather than sequential)
index based element reads.

I have committed the fix for both but would still like to understand the first
issue better.

I am cc:ing the dgnlib list since it mostly effects people there, and I will
issue a new dgnlib within a couple days once I am happy with the fixes.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list