Open ericonr opened 3 years ago
xbps_fetch_error_string returns null on no error. Most callers use strerror(0) then, but not main
.
There are almost surely paths where xbps_fetch_error_string return uninitialized memory as well.
It's not no error, just non-described error, like unknown http version echo 'HTTP/2 200 OK' | nc -l localhost 8888
.
fetchLastErrString is extent, thus zero-initialized per standard, no problem here.
CI log from: https://github.com/void-linux/void-packages/pull/32340/checks?check_run_id=3265394612
It's officially UB, though musl and glibc will both print
(null)
instead of segfaulting or killing your children; it does make for a poorer user experience though, since it's missing something explaining the error.