]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict: Add extra NULL-check to make static analyzer happier
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 21 Nov 2016 21:43:08 +0000 (23:43 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 22 Nov 2016 09:01:04 +0000 (11:01 +0200)
str_array_length() already checked NULL internally though.

src/lib-dict/dict-client.c

index faf8d9e0f4462c2182c738b734312661f2dc0932..24dd7e5195d21e6d867b9636e6f986d2a1edd9f1 100644 (file)
@@ -873,7 +873,8 @@ dict_warnings_sec(const struct client_dict_cmd *cmd, int msecs,
                str_printfa(str, ", async-id reply %u.%03u secs ago",
                            async_reply_msecs/1000, async_reply_msecs%1000);
        }
-       if (str_array_length(extra_args) >= 4 &&
+       if (extra_args != NULL &&
+           str_array_length(extra_args) >= 4 &&
            str_to_time(extra_args[0], &tv_start.tv_sec) == 0 &&
            str_to_uint(extra_args[1], &tv_start_usec) == 0 &&
            str_to_time(extra_args[2], &tv_end.tv_sec) == 0 &&