[OpenSIPS-Devel] [ opensips-Bugs-2642701 ] Bug in db_postgres and BLOB handling+patch

SourceForge.net noreply at sourceforge.net
Fri Feb 27 16:31:36 CET 2009


Bugs item #2642701, was opened at 2009-02-26 20:30
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2642701&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: trunk
Status: Open
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Vasil Kolev (krokodilerian)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: Bug in db_postgres and BLOB handling+patch

Initial Comment:
After digging more in the db_postgres driver and problems with XML with appended characters, I looked into PGunescape (which is used on BLOB fields) and turns out it doesn't add NULL termination on the strings. It wouldn't be a problem if some other code didnt't rely on strlen() of such fields...

The NULL termination will always work, as PGunescape allocates one more byte for the field (to work around malloc(0)/realloc(0)).

Patch attached.

----------------------------------------------------------------------

Comment By: Vasil Kolev (krokodilerian)
Date: 2009-02-27 11:37

Message:
Bogdan, yes, it's the second part of the problem. With both patches the
issues with db_postgres should go away.

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2009-02-26 20:38

Message:
Vasil, is this related to 2636665 ?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2642701&group_id=232389



More information about the Devel mailing list