php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18039 wrong length of output string
Submitted: 2002-06-28 03:09 UTC Modified: 2002-06-28 03:12 UTC
From: novicky at aarongroup dot cz Assigned:
Status: Closed Package: ICONV related
PHP Version: 4.2.1 OS: All
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: novicky at aarongroup dot cz
New email:
PHP Version: OS:

 

 [2002-06-28 03:09 UTC] novicky at aarongroup dot 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;



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-28 03:12 UTC] derick@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC