com php-src: fix condition: Zend/zend_API.h
| From: | Anatol Belski | Date: | Fri, 12 Sep 2014 22:03:42 +0000 |
| Subject: | com php-src: fix condition: Zend/zend_API.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81535@lists.php.net to get a copy of this message | ||
Commit: 993d4751260b1e1fbc62dcaeea98fc4988e925b6
Author: Anatol Belski <ab@php.net> Sat, 13 Sep 2014 00:03:42 +0200
Parents: f8d75839aa3e2042c9d158b092b41b4a9d6b79c8
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=993d4751260b1e1fbc62dcaeea98fc4988e925b6
Log:
fix condition
A char array like val[1] would always be valid when checking like
!val. Probably better were to check for ->len, but actually ->val[0]
is fine as the actual zend_string should have been initalized
before.
Changed paths:
M Zend/zend_API.h
Diff:
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index c045676..657d1d0 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -1193,7 +1193,7 @@ static zend_always_inline int _z_param_string(zval *arg, char **dest, size_t
*de
static zend_always_inline int _z_param_path_str(zval *arg, zend_string **dest, int check_null
TSRMLS_DC)
{
if (!_z_param_str(arg, dest, check_null TSRMLS_CC) ||
- (check_null && UNEXPECTED(!(*dest)->val)) ||
+ (check_null && UNEXPECTED(!(*dest)->val[0])) ||
UNEXPECTED(CHECK_NULL_PATH((*dest)->val, (*dest)->len))) {
return 0;
}