[compiler-rt] [SanitizerCommon] add null check for fopen64 interceptor (PR #68760)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 21:40:24 PDT 2023


MaskRay wrote:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html says "The fopen() function shall open the file whose pathname is the string pointed to by pathname, and associates a stream with it." A null argument cannot be used and the behavior is undefined. I cannot find historical documented precedent for accepting a null  argument in https://www.kernel.org/doc/man-pages/ and elsewhere. I think this patch should be rejected.

https://github.com/llvm/llvm-project/pull/68760


More information about the llvm-commits mailing list