com php-src: Fix int/size_t confusion in isValidPharFil ename (bug #73580): ext/phar/phar_obj ect.c
| From: | Anatol Belski | Date: | Tue, 06 Dec 2016 08:42:04 +0000 |
| Subject: | com php-src: Fix int/size_t confusion in isValidPharFil ename (bug #73580): ext/phar/phar_obj ect.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96222@lists.php.net to get a copy of this message | ||
Commit: 52f1cabf34f3d36752071a1885f543eea0532484
Author: Stanislav Malyshev <stas@php.net> Fri, 25 Nov 2016 13:42:35 -0800
Committer: Anatol Belski <ab@php.net> Tue, 6 Dec 2016 09:42:04 +0100
Parents: 77e313848a511337ba3954491e362fde277cb265
Branches: PHP-7.0.14
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=52f1cabf34f3d36752071a1885f543eea0532484
Log:
Fix int/size_t confusion in isValidPharFilename (bug #73580)
(cherry picked from commit bcc913fa8be6672e02f850f95857621a30c9d8ff)
Bugs:
https://bugs.php.net/73580
Changed paths:
M ext/phar/phar_object.c
Diff:
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index c57bdef..6998a4d 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -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);
}