]> granicus.if.org Git - php/commitdiff
Fix int/size_t confusion in isValidPharFilename (bug #73580)
authorStanislav Malyshev <stas@php.net>
Fri, 25 Nov 2016 21:42:35 +0000 (13:42 -0800)
committerStanislav Malyshev <stas@php.net>
Fri, 25 Nov 2016 23:31:50 +0000 (15:31 -0800)
ext/phar/phar_object.c

index c57bdef3c67ab5043946b50d87c43c806b589c92..6998a4db91c6806e3408565a9e98d1979a785eea 100644 (file)
@@ -1066,6 +1066,10 @@ PHP_METHOD(Phar, isValidPharFilename)
                return;
        }
 
+       if (ZEND_SIZE_T_INT_OVFL(fname_len)) {
+               RETURN_FALSE;
+       }
+
        is_executable = executable;
        RETVAL_BOOL(phar_detect_phar_fname_ext(fname, fname_len, &ext_str, &ext_len, is_executable, 2, 1) == SUCCESS);
 }