]> granicus.if.org Git - php/commitdiff
Ensure shift doesn't overflow, closes #2916
authorAnatol Belski <ab@php.net>
Tue, 21 Nov 2017 17:48:37 +0000 (18:48 +0100)
committerAnatol Belski <ab@php.net>
Tue, 21 Nov 2017 17:48:37 +0000 (18:48 +0100)
main/main.c

index 0b86eca20504586fe93ae139c1aec36d35c5995b..3e7f956e24715ae990eebf6d06dcb83e82645839 100644 (file)
@@ -186,7 +186,7 @@ static PHP_INI_MH(OnChangeMemoryLimit)
        if (new_value) {
                PG(memory_limit) = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
        } else {
-               PG(memory_limit) = 1<<30;               /* effectively, no limit */
+               PG(memory_limit) = Z_L(1)<<30;          /* effectively, no limit */
        }
        return zend_set_memory_limit(PG(memory_limit));
 }