]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-client: Don't crash if dict-server returns broken reply.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 10 Sep 2016 08:13:58 +0000 (11:13 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 13 Sep 2016 14:51:25 +0000 (17:51 +0300)
Just treat missing <tab>value as empty value.

src/lib-dict/dict-client.c

index ed2c74b7be4f14107d939c3bccfd020e7ee8a4e3..900e4465d482a528dd21edfb37e138e165eacf96 100644 (file)
@@ -892,7 +892,10 @@ client_dict_iter_async_callback(struct client_dict_cmd *cmd, const char *line,
                return;
        }
 
-       key = t_strdup_until(key, value++);
+       if (value != NULL)
+               key = t_strdup_until(key, value++);
+       else
+               value = "";
        result = array_append_space(&ctx->results);
        result->key = p_strdup(ctx->results_pool, t_str_tabunescape(key));
        result->value = p_strdup(ctx->results_pool, t_str_tabunescape(value));