]> granicus.if.org Git - php/commitdiff
fix condition
authorAnatol Belski <ab@php.net>
Fri, 12 Sep 2014 22:03:42 +0000 (00:03 +0200)
committerAnatol Belski <ab@php.net>
Fri, 12 Sep 2014 22:03:42 +0000 (00:03 +0200)
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.

Zend/zend_API.h

index c045676b4e3555b986da627d273f45c6de1da3cb..657d1d04de622f69e5b1d0fd242ea0b988069245 100644 (file)
@@ -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;
        }