...
Third, the function violates INT30-C. Ensure that unsigned integer operations do not wrap when calculating the size of memory to allocate. This could lead to wrapping when 1 is added to pos
or when size
is multiplied by the size of int
.
For a discussion of this programming error in the Common Weakness Enumeration database, see CWE-122, "Heap-based buffer overflow," and CWE-129, "Improper validation of array index."
...