|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28439 improper C type conversion in php-4.3.6/ext/standard/var_unserialize.c line 310
Submitted: 2004-05-18 22:36 UTC Modified: 2004-05-30 01:00 UTC
From: rjc at mit dot edu Assigned:
Status: No Feedback Package: Compile Warning
PHP Version: 4.3.6 OS: rh-9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rjc at mit dot edu
New email:
PHP Version: OS:


 [2004-05-18 22:36 UTC] rjc at mit dot edu
Need a explicit type cast...

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

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

Reproduce code:

// 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">

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)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-19 00:50 UTC]
Please make the reproduce script accessible, cannot 
reproduce the problem given existing information. 
 [2004-05-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri May 20 11:05:45 2022 UTC