mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
Correcting bounds check before someone uses this code
This commit is contained in:
parent
b9b03a7feb
commit
0ef1f50383
@ -290,7 +290,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
|
||||
|
||||
(*p) += 2;
|
||||
|
||||
if((*p) + datalen >= max) {
|
||||
if(datalen < 0 || (*p) + datalen >= max) {
|
||||
zend_error(E_WARNING, "Unsifficient data for unserializing - %d required, %d present", datalen, max - (*p));
|
||||
return 0;
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
|
||||
|
||||
(*p) += 2;
|
||||
|
||||
if((*p) + datalen >= max) {
|
||||
if(datalen < 0 || (*p) + datalen >= max) {
|
||||
zend_error(E_WARNING, "Unsifficient data for unserializing - %d required, %d present", datalen, max - (*p));
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user