Bill Roberts bill.roberts@foss.arm.com writes:
What's the actual bug here? Looking at FreeBSD it appears to be implemented to only modify the input buffer on success and return the direct "errno" as the functions return value.
I'm also puzzled. I'm not opposed to making changes to Nettle's logic here, as proposed in the original patch, but I would like to understand how things go wrong, to be able to fix it with confidence.
Code: - https://github.com/freebsd/freebsd-src/blob/main/lib/libsys/auxv.c#L276
I actually see one case where buffer is modified also on failure, but that is for the handling of AT_EXECPATH (unrelated to Nettle's usage), if its strlcpy call detects that the provided buffer is too small.
Regards, /Niels