chregu          Wed Dec 10 17:32:37 2003 EDT

  Modified files:              
    /php-src/ext/xsl    php_xsl.c 
  Log:
  fix crashes when you call php:functionString() with a
  non-string handler (by adam)
  
  
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.15 php-src/ext/xsl/php_xsl.c:1.16
--- php-src/ext/xsl/php_xsl.c:1.15      Tue Dec  9 15:12:39 2003
+++ php-src/ext/xsl/php_xsl.c   Wed Dec 10 17:32:36 2003
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xsl.c,v 1.15 2003/12/09 20:12:39 rrichards Exp $ */
+/* $Id: php_xsl.c,v 1.16 2003/12/10 22:32:36 chregu Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -247,6 +247,16 @@
        fci.function_table = EG(function_table);
        
        obj = valuePop(ctxt);
+       if (obj->stringval == NULL) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Handler name must be a 
string");
+               xmlXPathFreeObject(obj);
+               for (i = 0; i < nargs - 1; i++) {
+                       zval_ptr_dtor(&args[i]);
+               }
+               efree(args);
+               efree(fci.params);
+               return; 
+       }
        INIT_PZVAL(&handler);
        ZVAL_STRING(&handler, obj->stringval, 1);
        xmlXPathFreeObject(obj);

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

Reply via email to