The calculation of the size of the next increment of list->list is being calculated using uint32_t sized integers, yet it is possible that the calculation can exceed the maximum value of uint32_t. Encountering this case causes the array of list->list to shrink suddenly to the calculated size minus the max uint32_t value, yet list->size still increases to imply that there is more space available then there is. Later, when the next element is attempted to be added, the value of list->i goes beyond the allocated space of list->list and causes the program to segfault.
The calculation of the size of the next increment of
list->list
is being calculated usinguint32_t
sized integers, yet it is possible that the calculation can exceed the maximum value ofuint32_t
. Encountering this case causes the array oflist->list
to shrink suddenly to the calculated size minus the maxuint32_t
value, yetlist->size
still increases to imply that there is more space available then there is. Later, when the next element is attempted to be added, the value oflist->i
goes beyond the allocated space oflist->list
and causes the program to segfault.