diff options
author | Stanisław Pitucha <viraptor@gmail.com> | 2014-11-18 16:40:18 +1100 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-11-27 16:40:11 +0100 |
commit | 59aa582137cab11ff6aeb9adc56b9e70c4d320ae (patch) | |
tree | 84fe4bd2f05f624affd6c61e83281a5b31a540f9 | |
parent | c75dbf9bea577057c5a6ee3d52db6e13aa6caa57 (diff) |
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.
-rw-r--r-- | src/resolve/resolved-dns-packet.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index 2afb8d05da..c587a56124 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -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)) { |