Skip to content

Commit

Permalink
Fix parsing of empty labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Sep 10, 2014
1 parent 429e210 commit 459a2d8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,13 @@ rdns_parse_labels (struct rdns_resolver *resolver,
p += *p + 1;
}
}
*(t - 1) = '\0';
if (t > (uint8_t *)*target) {
*(t - 1) = '\0';
}
else {
/* Handle empty labels */
**target = '\0';
}
end:
*remain = new_remain;
*pos = new_pos;
Expand Down

0 comments on commit 459a2d8

Please sign in to comment.