Bug #18039: wrong length of output string
| From: | novicky at aarongroup dot cz | Date: | Fri, 28 Jun 2002 07:09:16 +0000 |
| Subject: | Bug #18039: wrong length of output string | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-12341@lists.php.net to get a copy of this message | ||
From: novicky@aarongroup.cz
Operating system: All
PHP version: 4.2.1
PHP Bug Type: ICONV related
Bug description: wrong length of output string
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 bug report at http://bugs.php.net/?id=18039&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18039&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18039&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18039&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18039&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18039&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18039&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18039&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18039&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18039&r=globals