Skip to content

Commit 483c9ee

Browse files
committed
don't calculate "end" until we have checked the inputs
1 parent 77d4974 commit 483c9ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/util/dns.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ ssize_t fr_dns_label_from_value_box(size_t *need, uint8_t *buf, size_t buf_len,
637637
fr_value_box_t const *value, fr_dns_labels_t *lb)
638638
{
639639
uint8_t *label;
640-
uint8_t const *end = buf + buf_len;
640+
uint8_t const *end;
641641
uint8_t const *q, *strend, *last;
642642
uint8_t *data;
643643
bool underscore = true;
@@ -647,6 +647,8 @@ ssize_t fr_dns_label_from_value_box(size_t *need, uint8_t *buf, size_t buf_len,
647647
return -1;
648648
}
649649

650+
end = buf + buf_len;
651+
650652
/*
651653
* Don't allow stupidities
652654
*/

0 commit comments

Comments
 (0)