Skip to content

Commit

Permalink
bug 626: correctly restore message pointer after decompressing dname
Browse files Browse the repository at this point in the history
  • Loading branch information
dleonard committed Mar 18, 2010
1 parent 801d0fb commit 366a25a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 366a25a

Please sign in to comment.