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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

SourceForge.net
Bugs item #2642701, was opened at 2009-02-26 20:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: None
Priority: 5
Private: No
Submitted By: Vasil Kolev (krokodilerian)
Assigned to: Nobody/Anonymous (nobody)
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.

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

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

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel