Unverified Commit 67c6ad6f authored by Alejandro Álvarez Ayllón's avatar Alejandro Álvarez Ayllón Committed by GitHub
Browse files

[clang][analyzer] Model allocation behavior or getdelim/geline (#83138)

`getdelim` and `getline` may free, allocate, or re-allocate the input
buffer, ensuring its size is enough to hold the incoming line, the
delimiter, and the null terminator.

`*lineptr` must be a valid argument to `free`, which means it can be
either

1. `NULL`, in which case these functions perform an allocation
equivalent to a call to `malloc` even on failure.
2. A pointer returned by the `malloc` family of functions. Other
pointers are UB (`alloca`, a pointer to a static, to a stack variable, etc.)
parent 6540f163
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment