From 366a25a504082a3032437c4c9d5e76c176023f7c Mon Sep 17 00:00:00 2001 From: dleonard Date: Thu, 18 Mar 2010 19:29:47 +0000 Subject: [PATCH] bug 626: correctly restore message pointer after decompressing dname --- dns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dns.c b/dns.c index 37aee64..e5a2437 100644 --- a/dns.c +++ b/dns.c @@ -369,9 +369,10 @@ rd_name(struct dns_msg *msg, char *buf, size_t bufsz, int canon_only) rd_error("too much compression"); dns_rd_data_raw(msg, &b2, sizeof b2); offset = ((b << 8) | b2) & 0x3fff; - if (!pos_save) + if (!pos_save) { pos_save = msg->pos; - remain_save = msg->remain[msg->depth]; + remain_save = msg->remain[msg->depth]; + } if (offset < msg->pos) msg->remain[msg->depth] += msg->pos - offset; else if (offset - msg->pos > msg->remain[msg->depth])