ID: 41765 Updated by: [EMAIL PROTECTED] Reported By: nexus at smoula dot net -Status: Open +Status: Closed Bug Type: Recode related Operating System: Gentoo Linux PHP Version: 5CVS-2007-06-21 (CVS) New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2007-06-21 14:26:29] nexus at smoula dot net Description: ------------ When using recode extension on amd64 system I've got two states - Crash (SIGSEGV) - zero-length string output from recode_string function. This problem is relevant only on 64bit systems. Here is a little patch which helps. diff -ruN php5/ext/recode/recode.c php5-b/ext/recode/recode.c --- php5/ext/recode/recode.c 2007-01-01 10:36:05.000000000 +0100 +++ php5-b/ext/recode/recode.c 2007-06-21 16:16:31.000000000 +0200 @@ -132,7 +132,7 @@ { RECODE_REQUEST request = NULL; char *r = NULL; - int r_len = 0, r_alen = 0; + size_t r_len = 0, r_alen = 0; int req_len, str_len; char *req, *str; I'm not a C programmer, so please review this patch and consequences It's going to have Reproduce code: --------------- <?php echo recode_string("utf-8..flat","aaaa"); ?> Expected result: ---------------- should return aaaa Actual result: -------------- instead returns zero length string or crashes with sigsegv ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41765&edit=1