php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1162 serialize misbehaving due to changes in unset
Submitted: 1999-02-19 09:56 UTC Modified: 1999-03-02 06:41 UTC
From: mark dot edwards at wcom dot co dot uk Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.6 OS: Linux RH5.1
Private report: No CVE-ID: None
 [1999-02-19 09:56 UTC] mark dot edwards at wcom dot co dot uk
serialize broken with arrays. Here's a fix. Check 'array_each' and 'unset' for reasons...


--- /tmp/var.c  Fri Feb 19 15:32:47 1999
+++ /usr/local/src/php-3.0.6/functions/var.c    Fri Feb 19 15:47:06 1999
@@ -212,6 +212,10 @@
                                        if (_php3_hash_get_current_data(struc->value.ht, (void **) (&data)) != SUCCESS || !data || (data == struc)) {
                                                continue;
                                        }
+                                       /* ref: basic_functions.c/array_each() - needed because of 'variables.c/unset()'.*/
+                                       if (data->type == IS_STRING && data->value.str.val==undefined_variable_string) {
+                                               continue;
+                                       }
                                        switch (i) {
                                                case HASH_KEY_IS_LONG:
                                                        d.type = IS_LONG;


Mark Edwards

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-03-02 06:41 UTC] sas
fixed in 3.0.7. thanks for the patch
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 19:01:32 2024 UTC