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:
1 parent
d7dc4fedd1
commit
116363e5c6
1 file changed
+1
-1
@@ -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