diff options
author | Derick Rethans <derick@php.net> | 2008-08-06 08:09:07 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2008-08-06 08:09:07 +0000 |
commit | eed9061d170a3f2283dc6becaee5e68f8aeea525 (patch) | |
tree | e76eba75a198651af5cd7cb4193e01e6ab51acb4 /ext/standard/php_string.h | |
parent | 57f0b5015874c4e52b4a282dad53afef9373630a (diff) | |
download | php-git-eed9061d170a3f2283dc6becaee5e68f8aeea525.tar.gz |
- MFH (manually): Fixed overflow in memnstr().
Diffstat (limited to 'ext/standard/php_string.h')
-rw-r--r-- | ext/standard/php_string.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index baa5fe8cbe..6a0aab973c 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -137,6 +137,10 @@ php_memnstr(char *haystack, char *needle, int needle_len, char *end) char *p = haystack; char ne = needle[needle_len-1]; + + if (needle_len > end - haystack) { + return NULL; + } end -= needle_len; while (p <= end) { |