[Fwd: [SOLVED] Re: [postgis-users] JDBC-Postgis bug]

David Blasby dblasby at refractions.net
Tue Jul 8 11:42:53 PDT 2003


David Garnier wrote:
> Hello,
> Is this bug fixed in the CVS or are you still looking into it?
> 
> I'm hoping to release WKB4J 1.0 very soon and this is really a
> showstopper for me. 

A modified version of your patch is in CVS now.  The problem is that I 
had originally thought that postgresql text types were null-terminated. 
  Unfortunately, they are sometimes null terminated, and sometimes not...

I thought I had fixed them all, but this one got through.

Sorry for the delay,

dave
ps. more details:

The postgresql text object looks like this:

<4 byte int - total size of this object><actual text>

So, for example 'XDR' looks like this:
00 00 00 07 58 44 52 <junk>
-  -  -  -   X  D  R ...

So, using strcmp() will fail because there is not necessarily a 
null-termination after the 'XDR' characters.  C Strings require
a null termination.




More information about the postgis-users mailing list