diff options
author | Stanislav Malyshev <stas@php.net> | 2018-04-22 20:27:42 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2018-04-22 20:27:42 -0700 |
commit | ff83c00715f6e036da5e5b627a742d2697871ae1 (patch) | |
tree | 449757998f082cb08ebe64f5c31cfc2dd2896e05 | |
parent | 2ef8809ef3beb5f58b81dcff49bdcde4d2cb8426 (diff) | |
download | php-git-ff83c00715f6e036da5e5b627a742d2697871ae1.tar.gz |
Add a bit of defensive conding for bug #76155
Even though it should not be ever negative, since strlen() is size_t
better to be safe than sorry.
-rw-r--r-- | ext/phar/phar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 898d1dac30..56fa253a6f 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1835,7 +1835,7 @@ static int phar_check_str(const char *fname, const char *ext_str, int ext_len, i char test[51]; const char *pos; - if (ext_len >= 50) { + if (ext_len < 0 || ext_len >= 50) { return FAILURE; } |