data_create_empty with size 0 calls malloc(0) — undefined behavior per C standard #74
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
In line 6, calls :
When is 0, has implementation-defined behavior. Per the C11 standard (7.22.3), may return NULL or a unique pointer. If it returns NULL, the caller treats this as an allocation failure, even though requesting 0 bytes is valid.
Several callers pass 0 to :
Location
Suggested Fix
Use as a safe minimum when is 0:
Severity
Low
Category
Bug