Bug #18039 Updated: wrong length of output string

From: Date: Fri, 28 Jun 2002 07:12:36 +0000
Subject: Bug #18039 Updated: wrong length of output string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-12343@lists.php.net to get a copy of this message
ID: 18039 Updated by: derick@php.net Reported By: novicky@aarongroup.cz -Status: Open +Status: Closed Bug Type: ICONV related Operating System: All PHP Version: 4.2.1 New Comment: This bug has been fixed in CVS. You can grab a snapshot of the CVS version at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-06-28 03:09:16] novicky@aarongroup.cz There is a bug in ext/iconv/iconv.c file on line 234. When you do not use libiconv and the output (translated) string is longer than the input string, you obtain a wrong length of the output string. The problem is that there is an output buffer estimate (input buffer length + 32 bytes): .. out_left = in_len + 32; /* Avoid realloc() most cases */ bsz = out_left; .. but during output buffer realloc there is in_len used instead of bsz: .. out_left = in_len; .. out_size += bsz - out_left; .. The correction should by made on line 234: out_left = in_len; should by: out_left = bsz; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18039&edit=1

« previous php.bugs (#12343) next »