resolve: set error code on failure

Set the error code in case of incorrect name. This prevents continuing
and failing an assert(name) later on.
This commit is contained in:
Stanisław Pitucha
2014-11-27 16:40:11 +01:00
committed by David Herrmann
parent c75dbf9bea
commit 59aa582137
+3 -1
View File
@@ -928,8 +928,10 @@ int dns_packet_read_name(DnsPacket *p, char **_ret,
/* Jumps are limited to a "prior occurence" (RFC-1035 4.1.4) */
jump_barrier = ptr;
p->rindex = ptr;
} else
} else {
r = -EBADMSG;
goto fail;
}
}
if (!GREEDY_REALLOC(ret, allocated, n + 1)) {