From:             rjc at mit dot edu
Operating system: rh-9
PHP version:      4.3.6
PHP Bug Type:     Compile Warning
Bug description:  improper C type conversion in 
php-4.3.6/ext/standard/var_unserialize.c line 310

Description:
------------
Need a explicit type cast...

original source:
                                if(yych <= '\277')     goto yy15;

patched:
                                if(yych <= (YYCTYPE)'\277')     goto
yy15;


Reproduce code:
---------------
http://barajas.mit.edu/php_bug/test.php.txt


// just the relevant bits here - see url for a working program
<?php if (isSet($_POST["submit"])) print_r($_POST["a"]); ?>

<form method = "post"  action = "">
<input type = "hidden"  name = "a[]"  value = "val1">
<input type = "hidden"  name = "a[]"  value = "val2">
<input type = "hidden"  name = "a[]"  value = "val3">
<input type = "submit" name = "submit" value = "submit">
</form>




Expected result:
----------------
The array $_POST["a"] should have three strings in it after the form is
submitted. Unpatched PHP-4.3.6 would repeat the last two values in
additional two array slots.  Forms submitted via get didn't exhibit this
behavior. Scalars passed via post also did not exhibit this behavior.

After I patched the C code as above, I got three and only three strings
back in $_POST["a], which is what I'd expect.
 

Actual result:
--------------
Array ( [0] => val1 [1] => val2 [2] => val3 [3] => val2 [4] => val3)



-- 
Edit bug report at http://bugs.php.net/?id=28439&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28439&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28439&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28439&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28439&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28439&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28439&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28439&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28439&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28439&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28439&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28439&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28439&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28439&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28439&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28439&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28439&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28439&r=float

Reply via email to