From: Timo Sirainen Date: Mon, 27 Nov 2017 09:58:39 +0000 (+0200) Subject: director: Fix logging of uninitialized PONG buffer size X-Git-Tag: 2.3.0.rc1~347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2117031bf2c3e35f6efad43b78caaecb6ebdad9;p=thirdparty%2Fdovecot%2Fcore.git director: Fix logging of uninitialized PONG buffer size PONG always has 0 or 2 parameters. The easiest fix here is to just not even try to support 1 parameter. --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index 367dbd0a35..9a923c2f7c 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -1874,10 +1874,12 @@ static bool director_cmd_pong(struct director_connection *conn, conn->ping_waiting = FALSE; timeout_remove(&conn->to_pong); - if (args[0] == NULL || str_to_time(args[0], &sent_time) < 0) + if (str_array_length(args) < 2 || + str_to_time(args[0], &sent_time) < 0 || + str_to_uintmax(args[1], &send_buffer_size) < 0) { sent_time = 0; - else if (args[1] == NULL || str_to_uintmax(args[1], &send_buffer_size) < 0) send_buffer_size = (uintmax_t)-1; + } int ping_msecs = timeval_diff_msecs(&ioloop_timeval, &conn->ping_sent_time); if (ping_msecs >= 0) {