cvs: Zend / zend_compile.c
| From: | Masaki Fujimoto | Date: | Tue, 13 Aug 2002 06:01:40 +0000 |
| Subject: | cvs: Zend / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-306@lists.php.net to get a copy of this message | ||
fujimoto Tue Aug 13 02:01:40 2002 EDT
Modified files:
/Zend zend_compile.c
Log:
fix segfaults
Index: Zend/zend_compile.c
diff -u Zend/zend_compile.c:1.234 Zend/zend_compile.c:1.235
--- Zend/zend_compile.c:1.234 Sun Aug 4 02:39:44 2002
+++ Zend/zend_compile.c Tue Aug 13 02:01:40 2002
@@ -2225,8 +2225,10 @@
zend_multibyte_filter old_input_filter;
convert_to_string(&val->u.constant);
+ if (!val->u.constant.value.str.val) {
+ zend_error(E_COMPILE_ERROR, "Invalid encoding specified (without quotes ?)");
+ }
new_encoding = zend_multibyte_fetch_encoding(val->u.constant.value.str.val);
- efree(val->u.constant.value.str.val);
if (!new_encoding) {
zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]\n",
val->u.constant.value.str.val);
} else {
@@ -2240,6 +2242,7 @@
zend_yyinput_again(old_input_filter, old_encoding TSRMLS_CC);
}
}
+ efree(val->u.constant.value.str.val);
#endif /* ZEND_MULTIBYTE */
}
zval_dtor(&var->u.constant);