|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-22 00:07 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 12:00:01 2025 UTC |
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