array: Number of items in get_size() is unsigned
Otherwise, array->esize is promoted to int and if array->esize * num results in a value > 0x7fffffff the return value would be incorrect due the implicit sign extension when getting cast to size_t.
This commit is contained in:
@@ -49,7 +49,7 @@ struct array_t {
|
||||
/**
|
||||
* Get the actual size of a number of elements
|
||||
*/
|
||||
static size_t get_size(array_t *array, int num)
|
||||
static size_t get_size(array_t *array, u_int32_t num)
|
||||
{
|
||||
if (array->esize)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user