chiark / gitweb /
resolve: set error code on failure
authorStanisław Pitucha <viraptor@gmail.com>
Tue, 18 Nov 2014 05:40:18 +0000 (16:40 +1100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 27 Nov 2014 15:40:11 +0000 (16:40 +0100)
Set the error code in case of incorrect name. This prevents continuing
and failing an assert(name) later on.

src/resolve/resolved-dns-packet.c

index 2afb8d0..c587a56 100644 (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)) {