farsightsec / wdns

low-level DNS library
Apache License 2.0
19 stars 5 forks source link

Fix off-by-one error in wdns_str_to_name #52

Closed cmikk closed 1 year ago

cmikk commented 1 year ago

When parsing a name with a trailing '.', finish parsing at the '.' without additionally processing end of input. Fixes a write beyond the end of the resulting name, which can be unallocated memory for names of maximum length.

Add test cases for maximum length names and name overflow.