Bug 820 - problem with parsing multiple tag data items in find_tag_datas()
problem with parsing multiple tag data items in find_tag_datas()
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
unspecified
x86_64 Linux
: P5 normal
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-23 20:51 CEST by akocmaruk
Modified: 2016-08-24 11:24 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description akocmaruk 2016-08-23 20:51:37 CEST
The problem is that the per-data-item loop may fail to parse a data item in iterations after the first iteration, because the len parameter used when invoking sldns_str2wire_rr_buf() with dual meaning ('available' on input, 'consumed' on output), is not readjusted from one loop iteration to another.

The result is that the tag data item parsing fails, unless the amount of buffer consumed in previous iteration is larger than the amount required in the current iteration.
Comment 1 Ralph Dolmans 2016-08-24 11:24:57 CEST
Good catch. Fixed by setting the len parameter in the loop.

Thanks for reporting!

Regards,
-- Ralph