summaryrefslogtreecommitdiffstats
path: root/gl/malloc/dynarray_emplace_enlarge.c
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-11-10 00:06:06 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-11-10 00:06:06 +0100
commit21c39515903c34bc6428a544c88cf1c100786847 (patch)
treec9d0465e24cc3148c84c2fee191f2b1bfc71b841 /gl/malloc/dynarray_emplace_enlarge.c
parented01d534474cc640515f1d5155349f14090aafe9 (diff)
parent5d7d620903a2fb40f8cd3140081bfb7ceaf125d5 (diff)
downloadmonitoring-plugins-21c39515903c34bc6428a544c88cf1c100786847.tar.gz
Merge branch 'master' into check_swap_again
Diffstat (limited to 'gl/malloc/dynarray_emplace_enlarge.c')
-rw-r--r--gl/malloc/dynarray_emplace_enlarge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gl/malloc/dynarray_emplace_enlarge.c b/gl/malloc/dynarray_emplace_enlarge.c
index 7da53931..7bdba159 100644
--- a/gl/malloc/dynarray_emplace_enlarge.c
+++ b/gl/malloc/dynarray_emplace_enlarge.c
@@ -1,5 +1,5 @@
1/* Increase the size of a dynamic array in preparation of an emplace operation. 1/* Increase the size of a dynamic array in preparation of an emplace operation.
2 Copyright (C) 2017-2023 Free Software Foundation, Inc. 2 Copyright (C) 2017-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library. 3 This file is part of the GNU C Library.
4 4
5 The GNU C Library is free software; you can redistribute it and/or 5 The GNU C Library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@
22 22
23#include <dynarray.h> 23#include <dynarray.h>
24#include <errno.h> 24#include <errno.h>
25#include <intprops.h> 25#include <stdckdint.h>
26#include <stdlib.h> 26#include <stdlib.h>
27#include <string.h> 27#include <string.h>
28 28
@@ -56,7 +56,7 @@ __libc_dynarray_emplace_enlarge (struct dynarray_header *list,
56 } 56 }
57 57
58 size_t new_size; 58 size_t new_size;
59 if (INT_MULTIPLY_WRAPV (new_allocated, element_size, &new_size)) 59 if (ckd_mul (&new_size, new_allocated, element_size))
60 return false; 60 return false;
61 void *new_array; 61 void *new_array;
62 if (list->array == scratch) 62 if (list->array == scratch)