From: SourceForge.net <no...@so...> - 2004-09-17 00:09:43
|
Patches item #1029580, was opened at 2004-09-16 17:09 Message generated for change (Settings changed) made by jeyk You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=316528&aid=1029580&group_id=16528 Category: None Group: None Status: Open Resolution: None >Priority: 8 Submitted By: Jey Kottalam (jeyk) Assigned to: Nobody/Anonymous (nobody) Summary: serious bug: unQuoteBytea allocates buffer that is too small Initial Comment: In the case where unQuoteBytea is called with a string that has no escaped characters, and unQuoteBytea behaves like strcpy() to simply copy all the bytes in the original string unmodified to the destination string, the buffer is too small by one char. The buffer allocated has the size strlen(sin) when it should have the size strlen(sin)+1 to account for the terminating NUL byte in C strings. I have attached a patch to correct this problem. It caused me a lot of pain with strange, semi-random seeming bugs in my program. :-) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=316528&aid=1029580&group_id=16528 |