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.2.34~200 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85e6b87840d05b71de23061c405ebce9c5014e76;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 327d1495f3..57ba53fa48 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -1872,10 +1872,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) {