On Tue, 15 Feb 2022 20:01:52 +0100, Florian Obser wrote: I think you need that to be:
/* MUST delete trailing NUL, per RFC 2132 */
slen = dho_len;
while (slen > 0 && p[slen - 1] == '\0')
slen--;
to avoid underflow if the string happens to consist entirely of NULs.
I'd also add:
if (slen < 1)
goto wrong_length;
- todd
