moriyoshi               Sun Jan 19 12:23:49 2003 EDT

  Modified files:              
    /php4/ext/standard  scanf.c 
  Log:
  Improved the patched part to prevent further potential bugs
  
  
Index: php4/ext/standard/scanf.c
diff -u php4/ext/standard/scanf.c:1.22 php4/ext/standard/scanf.c:1.23
--- php4/ext/standard/scanf.c:1.22      Sat Jan 18 14:26:01 2003
+++ php4/ext/standard/scanf.c   Sun Jan 19 12:23:48 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: scanf.c,v 1.22 2003/01/18 19:26:01 moriyoshi Exp $ */
+/* $Id: scanf.c,v 1.23 2003/01/19 17:23:48 moriyoshi Exp $ */
 
 /*
    scanf.c --
@@ -762,9 +762,14 @@
                        case 'n':
                                if (!(flags & SCAN_SUPPRESS)) {
                                        if (numVars) {
+                                               zend_uint refcount;
+
                                                current = args[objIndex++];
+                                               refcount = (*current)->refcount;
                                                zval_dtor( *current );
                                                ZVAL_LONG( *current, (long)(string - 
baseString) );
+                                               (*current)->refcount = refcount;
+                                               (*current)->is_ref = 1;
                                        } else {
                                                add_index_long(*return_value, 
objIndex++, string - baseString);
                                        }
@@ -882,9 +887,14 @@
                                }
                                if (!(flags & SCAN_SUPPRESS)) {
                                        if (numVars) {
+                                               zend_uint refcount;
+
                                                current = args[objIndex++];
+                                               refcount = (*current)->refcount;
                                                zval_dtor( *current );
                                                ZVAL_STRINGL( *current, string, 
end-string, 1);
+                                               (*current)->refcount = refcount;
+                                               (*current)->is_ref = 1;
                                        } else {
                                                add_index_stringl( *return_value, 
objIndex++, string, end-string, 1);
                                        }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to