|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-07-09 13:45 UTC] apokalyptik at apokalyptik dot com
Description:
------------
because of the type of various numeric values in the source code php5+x86_64 is not recognizing values passed in (seeing them as 0 when they are not)
bi_base_convert(): wrong [base_from]. It can be from 2 to 36 inclusive
bi_from_str(): length of the string must be greater than 0
bi_to_str(): argument number [1] cannot be empty
etc...
Reproduce code:
---------------
var_dump( bi_from_str("abcd", 16) );
var_dump( bi_base_convert("abcd", 16, 10) );
Expected result:
----------------
no errors, non-null return values
Actual result:
--------------
errors, null return values
Patchesfix-types-for-php5-x86_64 (last revision 2013-01-26 14:23 UTC by iliya at automattic dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 00:00:01 2025 UTC |
--- php_big_int.c.orig 2005-05-30 12:08:32.000000000 +0000 +++ php_big_int.c 2009-07-09 07:02:27.000000000 +0000 @@ -675,8 +675,8 @@ ZEND_FUNCTION(bi_from_str) { char *str = NULL; - int str_len; - int base; + long str_len; + long base; big_int_str s; big_int *num = NULL; const char *errstr = NULL; @@ -801,8 +801,8 @@ ZEND_FUNCTION(bi_base_convert) { char *str = NULL; - int str_len; - int base_from, base_to; + long str_len; + long base_from, base_to; big_int_str s, *s_ptr = NULL; const char *errstr = NULL; @@ -2087,7 +2087,7 @@ const char *errstr = NULL; big_int *answer = NULL; char *str; - int str_len; + long str_len; int is_sign; big_int_str s; @@ -2104,7 +2104,7 @@ goto error; } - s.str = str; + s.str = str; s.len = str_len; switch (big_int_unserialize(&s, is_sign, answer)) { case 0: break;