[clang] [clang][StaticAnalyzer] Adding getentropy to CStringChecker. (PR #83675)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 05:53:46 PST 2024


https://github.com/steakhal requested changes to this pull request.

Thanks for the PR!

At first I was hesitant if this checker is the right place for this API.
But actually, it should be fine to have it here.
Maybe the stdlibraryfunctionschecker would be a better place in long term, but I don't think that has DSL for buffer accesses, like we have here. Maybe @balazske has some opinion on this.

Anyways, I'd like to see tests for about any aspects of this API.
 - Under what conditions it writes to the buffer (aka. length > 0).
 - When can the checker issue a diagnostic (null buffer, small buffer)
 - What if `length` is symbolic and constrained to be really large (e.g. `length > 300`)
 - What if the `length` and the `buffer` is symbolic (unconstrained), did we infer that `length <= 256` after the call?
 - etc, could be more cases, but I only named what came in my mind.

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


More information about the cfe-commits mailing list