diff options
| author | Vibhav Pant | 2023-06-06 19:30:27 +0530 |
|---|---|---|
| committer | Vibhav Pant | 2023-06-06 19:30:27 +0530 |
| commit | 49ffcbf86a32a8a217538d4df3736fe069ccf35d (patch) | |
| tree | a5f16157cc20fb19a844473a6fbd2b434f4c8260 /lib/malloc | |
| parent | af569fa3d90a717983b743eb97adbf869c6d1736 (diff) | |
| parent | 7ca1d782f5910d0c3978c6798a45c6854ec668c7 (diff) | |
| download | emacs-49ffcbf86a32a8a217538d4df3736fe069ccf35d.tar.gz emacs-49ffcbf86a32a8a217538d4df3736fe069ccf35d.zip | |
Merge branch 'master' into scratch/comp-static-data
Diffstat (limited to 'lib/malloc')
| -rw-r--r-- | lib/malloc/dynarray_emplace_enlarge.c | 4 | ||||
| -rw-r--r-- | lib/malloc/dynarray_resize.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/malloc/dynarray_emplace_enlarge.c b/lib/malloc/dynarray_emplace_enlarge.c index 7da539316c1..65aabb1e4a5 100644 --- a/lib/malloc/dynarray_emplace_enlarge.c +++ b/lib/malloc/dynarray_emplace_enlarge.c | |||
| @@ -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) |
diff --git a/lib/malloc/dynarray_resize.c b/lib/malloc/dynarray_resize.c index 7ecd4de63b9..014f98c330e 100644 --- a/lib/malloc/dynarray_resize.c +++ b/lib/malloc/dynarray_resize.c | |||
| @@ -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 | ||
| @@ -42,7 +42,7 @@ __libc_dynarray_resize (struct dynarray_header *list, size_t size, | |||
| 42 | over-allocation here. */ | 42 | over-allocation here. */ |
| 43 | 43 | ||
| 44 | size_t new_size_bytes; | 44 | size_t new_size_bytes; |
| 45 | if (INT_MULTIPLY_WRAPV (size, element_size, &new_size_bytes)) | 45 | if (ckd_mul (&new_size_bytes, size, element_size)) |
| 46 | { | 46 | { |
| 47 | /* Overflow. */ | 47 | /* Overflow. */ |
| 48 | __set_errno (ENOMEM); | 48 | __set_errno (ENOMEM); |