]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 15 Sep 2016 05:58:43 +0000 (08:58 +0300)
Just treat missing <tab>value as empty value.

src/lib-dict/dict-client.c

index 9fa365cd649046c7081cfebc07ccc8f96c953d29..8562b359fa6b6a05aa6276d95d4655ba6e3c11ef 100644 (file)
@@ -893,7 +893,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));