<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>I have found two
fatal errors in dgnread.cpp the first one will cause a crash</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>when there appears
to be attributes on the tcb which inside the 'if' </SPAN></FONT></DIV>
<DIV><FONT><SPAN class=171393917-20092003><FONT face=Arial><FONT
size=2>psElement->attr_bytes<SPAN class=171393917-20092003> gets setup as a
negative number which causes the</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>CPLMalloc to
crash. If you would like a copy of the dgn file let me
know.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>My fix was not to go
inside the if( psElement->properties & DGNPF_ATTRIBUTES
)</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>if the element is a
tcb.</SPAN></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><FONT face=Arial size=2><SPAN
class=171393917-20092003></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT><SPAN class=171393917-20092003><FONT face=Arial size=2>The next
change was causing </FONT><FONT face=Arial><FONT size=2>OGRLayer<SPAN
class=171393917-20092003>::<FONT
size=2>GetFeature</FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>to not return any
features. When the DGN Index was being built the</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>offset was being
truncated to an invalid offest by the (unsigned char)</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=171393917-20092003>cast.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=171393917-20092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>My envionment is
Windows XP, Microsoft Visual Studio.Net 2003.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=171393917-20092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=171393917-20092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=171393917-20092003>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=171393917-20092003>Steve
Brooks</SPAN></FONT></DIV></SPAN></FONT>
<DIV><FONT face=Arial><FONT size=2></SPAN></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=171393917-20092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=171393917-20092003>---------------------------------------------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2>$ diff clean/dgnread.cpp
modified/dgnread.cpp</FONT></DIV>
<DIV><FONT face=Arial size=2>1093c1093</FONT></DIV>
<DIV><FONT face=Arial size=2>< if( psElement->properties &
DGNPF_ATTRIBUTES )</FONT></DIV>
<DIV><FONT face=Arial size=2>---</FONT></DIV>
<DIV><FONT face=Arial size=2>> if( psElement->properties &
DGNPF_ATTRIBUTES && psElement->type != DGNT_TCB )</FONT></DIV>
<DIV><FONT face=Arial size=2>1621c1621</FONT></DIV>
<DIV><FONT face=Arial size=2>< psEI->offset = (unsigned char)
nLastOffset;</FONT></DIV>
<DIV><FONT face=Arial size=2>---</FONT></DIV>
<DIV><FONT face=Arial size=2>> psEI->offset = (long)
nLastOffset;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=171393917-20092003><FONT face=Arial
size=2>-------------------------------------------------------------------------------------------------</FONT></SPAN></DIV></BODY></HTML>