While working on debugging an issue reported in c-ares, I noticed some test case failures in inet_net_pton().  I haven't evaluated most of them, however one stood out:

../test/ares-test-internal.cc:150: Failure
      Expected: -1
To be equal to: inet_net_pton(24,"12:34::ff",&a6,sizeof(a6) - 1)
      Which is: 128

This test expects inet_net_pton() to fail because the buffer provided was of insufficient size.

I'm not all that familiar with OpenBSD itself, a quick google search turned up this as the possible source:
https://github.com/libressl-portable/openbsd/blob/master/src/lib/libc/net/inet_net_pton.c

The 'size' parameter to inet_net_pton_ipv6() is *never* used:
https://github.com/libressl-portable/openbsd/blob/master/src/lib/libc/net/inet_net_pton.c#L206

I believe this failure ends up later causing other test failures due to memory corruption in the c-ares test cases.


Reply via email to