Right now the behavior of wdns_reverse_name() when presented with a buffer that is longer than the (proper, expected) preceding sequence of nul byte-terminated labels is to fail without producing an error code, resulting in null-output.
This probably shouldn't happen; expected behavior would see the initial sequence of labels reversed.
Example from unit tests for reproduction:
.input = "\x07" "testing" "\x08" "trailing" "\x04" "data" "\x03" "fsi" "\x02" "io" "\x00" "\x04" "abcd",
.ilen = 1 + 7 + 1 + 8 + 1 + 4 + 1 + 3 + 1 + 2 + 1 + 1 + 4 + 1,
(works as anticipated if the final "1 + 4 + 1" is removed from the length)
Right now the behavior of wdns_reverse_name() when presented with a buffer that is longer than the (proper, expected) preceding sequence of nul byte-terminated labels is to fail without producing an error code, resulting in null-output.
This probably shouldn't happen; expected behavior would see the initial sequence of labels reversed.
Example from unit tests for reproduction:
.input = "\x07" "testing" "\x08" "trailing" "\x04" "data" "\x03" "fsi" "\x02" "io" "\x00" "\x04" "abcd",
.ilen = 1 + 7 + 1 + 8 + 1 + 4 + 1 + 3 + 1 + 2 + 1 + 1 + 4 + 1,
(works as anticipated if the final "1 + 4 + 1" is removed from the length)