mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
size_t is unsigned and can't be negative
This commit is contained in:
@@ -2884,7 +2884,7 @@ SPL_METHOD(SplFileObject, fwrite)
|
||||
|
||||
if (ZEND_NUM_ARGS() > 1) {
|
||||
if (length >= 0) {
|
||||
str_len = MAX(0, MIN((size_t)length, str_len));
|
||||
str_len = MIN((size_t)length, str_len);
|
||||
} else {
|
||||
/* Negative length given, nothing to write */
|
||||
str_len = 0;
|
||||
|
||||
Reference in New Issue
Block a user