|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-01-08 21:04 UTC] bobg at cableone dot net
Receive the following error with only 15 consecutive characters entered.
Warning: gzinflate: buffer error in /usr/local/apache/elca_rmg/class.FTemplateExt.php on line 153
What follows is the code updating the SQL files:
$gzsize = strlen($description) + 4; // added 4 more than req'd
$gzcompress = gzdeflate ($description,6);
$gzcompress = addslashes($gzcompress); //Reqd for SQL updates
$query = "UPDATE htmlcontent SET record_nbr = \"$record_nbr\", gzcompress = \"$gzcompress\", gzsize = $gzsize WHERE record_nbr = \"$record_nbr\"";
}
general_update($errno,$errmsg,$rowsaffected, $result, $s_synod_id, $query); // UPDATE the record
*******************************************************
Next I attempt to read the record back and unzip gzcompress
Note that $description consists of 20 'a' characters. Any repetitive char will do and only 15 to 20 are req'd
*******************************************************
$query = "SELECT * FROM htmlcontent WHERE record_nbr = \"$record_nbr\"";
general_read($errno, $errmsg,$numrows, $result_html, $s_synod_id, $query);
if ($numrows > 0) {
if ($row_html = mysql_fetch_array ($result_html)) {
$content = stripslashes($row_html["gzcompress"]);
if (strlen($content) > 0) {
******Error occurs on the following instruction*********
$new = gzinflate($content,$row_html["gzsize"]);
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
Does the attached patch help? --- /home/sr/cvs/php/php4/ext/zlib/zlib.c Thu Mar 7 16:38:26 2002 +++ ext/zlib/zlib.c Thu Mar 7 23:15:48 2002 @@ -967,7 +967,7 @@ if(! s2) { if(s1) efree(s1); RETURN_FALSE; } stream.next_in = (Bytef*) Z_STRVAL_PP(data); - stream.avail_in = (uInt) Z_STRLEN_PP(data); + stream.avail_in = (uInt) Z_STRLEN_PP(data) + 1; /* there is room for \0 */ stream.next_out = s2; stream.avail_out = (uInt) length; (If there are broken line breaks and you can't apply it, change the line stream.avail_in = (uInt) Z_STRLEN_PP(data) to ...(data)+1 in the gzinflate function). Please report if it works (and if it doesn't break other things). This seems to be a rather strange thing in the zlib library ...