|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-07-22 10:15 UTC] rasmus
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 06:00:01 2025 UTC |
It seems that the pg_lowrite function was using strlen() to calculate the amount of data to write. This meant that it would not write data correctly if there was a null byte in it. This can be fixed by the following patch which changes it to use the str->value.str.len variable for the amount of data to write. *** pgsql.c.orig Mon Jun 29 13:36:54 1998 --- pgsql.c Wed Jul 22 10:28:10 1998 *************** *** 1311,1316 **** --- 1311,1317 ---- id = pgsql_id->value.lval; convert_to_string(str); buf = str->value.str.val; + buf_len = str->value.str.len; break; default: WRONG_PARAM_COUNT; *************** *** 1323,1329 **** RETURN_FALSE; } - buf_len = strlen(buf); if ((nbytes = lo_write((PGconn *)pgsql->conn, pgsql->lofd, buf, buf_len))==-1) { RETURN_FALSE; } --- 1324,1329 ----