From 733daef127de95d9c8042997913546fe82b7df23 Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Tue, 13 Apr 2021 08:41:12 +0300 Subject: [PATCH] fix access to uninitialized var in checkClientPauseTimeoutAndReturnIfPaused (#8765) server.client_pause_end_time is uninitialized, or actually 0, at startup, which means this method would think the timeout was reached and go look for paused clients. This causes no harm since unpauseClients will not find any paused clients. --- src/networking.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/networking.c b/src/networking.c index fd8f379ec..ace41512f 100644 --- a/src/networking.c +++ b/src/networking.c @@ -3332,6 +3332,8 @@ int areClientsPaused(void) { * if it has. Also returns true if clients are now paused and false * otherwise. */ int checkClientPauseTimeoutAndReturnIfPaused(void) { + if (!areClientsPaused()) + return 0; if (server.client_pause_end_time < server.mstime) { unpauseClients(); }