dovecot-2.2: dict-client: Avoid crash if server disconnects duri...
dovecot at dovecot.org
dovecot at dovecot.org
Sun Sep 27 18:50:54 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/e5164f14723f
changeset: 19226:e5164f14723f
user: Timo Sirainen <tss at iki.fi>
date: Sun Sep 27 21:28:25 2015 +0300
description:
dict-client: Avoid crash if server disconnects during transaction commit.
Found by Coverity.
diffstat:
src/lib-dict/dict-client.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diffs (17 lines):
diff -r 038efefc7e70 -r e5164f14723f src/lib-dict/dict-client.c
--- a/src/lib-dict/dict-client.c Sun Sep 27 21:25:59 2015 +0300
+++ b/src/lib-dict/dict-client.c Sun Sep 27 21:28:25 2015 +0300
@@ -797,10 +797,12 @@
default:
i_error("dict-client: Invalid commit reply: %s", line);
client_dict_disconnect(dict);
+ line = NULL;
ret = -1;
break;
}
- if (str_to_uint(line+1, &id) < 0 || ctx->id != id) {
+ if (line != NULL &&
+ (str_to_uint(line+1, &id) < 0 || ctx->id != id)) {
i_error("dict-client: Invalid commit reply, "
"expected id=%u: %s", ctx->id, line);
client_dict_disconnect(dict);
More information about the dovecot-cvs
mailing list