]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dns: Fixed handling failed DNS lookups.
authorTimo Sirainen <tss@iki.fi>
Wed, 19 Mar 2014 07:45:15 +0000 (09:45 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 19 Mar 2014 07:45:15 +0000 (09:45 +0200)
src/lib-dns/dns-lookup.c

index 6433c9a432bb26fe340d39e4afb04d535c5beb48..31ee02cdbd8e5d059939b99e349e37d32f052a01 100644 (file)
@@ -100,9 +100,9 @@ static int dns_lookup_input_line(struct dns_lookup *lookup, const char *line)
                        }
                        return 1;
                }
-               /* first line: <ret> <ip count> */
+               /* first line: <ret> [<ip count>] */
                if (sscanf(line, "%d %u", &result->ret,
-                          &result->ips_count) != 2)
+                          &result->ips_count) < 1)
                        return -1;
                if (result->ret != 0) {
                        result->error = net_gethosterror(result->ret);