Correcting bounds check before someone uses this code

This commit is contained in:
Stefan Esser 2005-02-23 18:26:39 +00:00
parent b9b03a7feb
commit 0ef1f50383
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}