Skip to content

Commit 7a79ad9

Browse files
Also protect against session.gc_maxlifetime <= 0
Addresses phpredis#1694
1 parent 3c48a33 commit 7a79ad9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

redis_session.c

+3
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ static int session_gc_maxlifetime() {
127127
if (value > INT_MAX) {
128128
php_error_docref(NULL, E_NOTICE, "session.gc_maxlifetime overflows INT_MAX, truncating.");
129129
return INT_MAX;
130+
} else if (value <= 0) {
131+
php_error_docref(NULL, E_NOTICE, "session.gc_maxlifetime is <= 0, defaulting to 1440 seconds");
132+
return 1440;
130133
}
131134

132135
return value;

0 commit comments

Comments
 (0)