Skip to content

Commit

Permalink
dict-client: Don't crash if dict-server returns broken reply.
Browse files Browse the repository at this point in the history
Just treat missing <tab>value as empty value.
  • Loading branch information
sirainen authored and GitLab committed Sep 13, 2016
1 parent 3c30113 commit 4598234
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib-dict/dict-client.c
Expand Up @@ -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));
Expand Down

0 comments on commit 4598234

Please sign in to comment.