diff options
Diffstat (limited to 'lib/malloc')
-rw-r--r-- | lib/malloc/dynarray-skeleton.c | 2 | ||||
-rw-r--r-- | lib/malloc/dynarray.h | 3 | ||||
-rw-r--r-- | lib/malloc/dynarray_at_failure.c | 5 | ||||
-rw-r--r-- | lib/malloc/dynarray_emplace_enlarge.c | 6 | ||||
-rw-r--r-- | lib/malloc/dynarray_finalize.c | 2 | ||||
-rw-r--r-- | lib/malloc/dynarray_resize.c | 6 | ||||
-rw-r--r-- | lib/malloc/dynarray_resize_clear.c | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/lib/malloc/dynarray-skeleton.c b/lib/malloc/dynarray-skeleton.c index 48210e3..580c278 100644 --- a/lib/malloc/dynarray-skeleton.c +++ b/lib/malloc/dynarray-skeleton.c @@ -1,5 +1,5 @@ /* Type-safe arrays which grow dynamically. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/malloc/dynarray.h b/lib/malloc/dynarray.h index 638c33f..a9a3b08 100644 --- a/lib/malloc/dynarray.h +++ b/lib/malloc/dynarray.h @@ -1,5 +1,5 @@ /* Type-safe arrays which grow dynamically. Shared definitions. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -94,7 +94,6 @@ #ifndef _DYNARRAY_H #define _DYNARRAY_H -#include <stdbool.h> #include <stddef.h> #include <string.h> diff --git a/lib/malloc/dynarray_at_failure.c b/lib/malloc/dynarray_at_failure.c index 4f840db..ebc9310 100644 --- a/lib/malloc/dynarray_at_failure.c +++ b/lib/malloc/dynarray_at_failure.c @@ -1,5 +1,5 @@ /* Report an dynamic array index out of bounds condition. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,11 +18,11 @@ #ifndef _LIBC # include <libc-config.h> +# include <stdlib.h> #endif #include <dynarray.h> #include <stdio.h> -#include <stdlib.h> void __libc_dynarray_at_failure (size_t size, size_t index) @@ -32,6 +32,7 @@ __libc_dynarray_at_failure (size_t size, size_t index) __snprintf (buf, sizeof (buf), "Fatal glibc error: " "array index %zu not less than array length %zu\n", index, size); + __libc_fatal (buf); #else abort (); #endif diff --git a/lib/malloc/dynarray_emplace_enlarge.c b/lib/malloc/dynarray_emplace_enlarge.c index 0f8baf9..65aabb1 100644 --- a/lib/malloc/dynarray_emplace_enlarge.c +++ b/lib/malloc/dynarray_emplace_enlarge.c @@ -1,5 +1,5 @@ /* Increase the size of a dynamic array in preparation of an emplace operation. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,7 +22,7 @@ #include <dynarray.h> #include <errno.h> -#include <intprops.h> +#include <stdckdint.h> #include <stdlib.h> #include <string.h> @@ -56,7 +56,7 @@ __libc_dynarray_emplace_enlarge (struct dynarray_header *list, } size_t new_size; - if (INT_MULTIPLY_WRAPV (new_allocated, element_size, &new_size)) + if (ckd_mul (&new_size, new_allocated, element_size)) return false; void *new_array; if (list->array == scratch) diff --git a/lib/malloc/dynarray_finalize.c b/lib/malloc/dynarray_finalize.c index c33da41..673595a 100644 --- a/lib/malloc/dynarray_finalize.c +++ b/lib/malloc/dynarray_finalize.c @@ -1,5 +1,5 @@ /* Copy the dynamically-allocated area to an explicitly-sized heap allocation. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/lib/malloc/dynarray_resize.c b/lib/malloc/dynarray_resize.c index 5a57166..014f98c 100644 --- a/lib/malloc/dynarray_resize.c +++ b/lib/malloc/dynarray_resize.c @@ -1,5 +1,5 @@ /* Increase the size of a dynamic array. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,7 +22,7 @@ #include <dynarray.h> #include <errno.h> -#include <intprops.h> +#include <stdckdint.h> #include <stdlib.h> #include <string.h> @@ -42,7 +42,7 @@ __libc_dynarray_resize (struct dynarray_header *list, size_t size, over-allocation here. */ size_t new_size_bytes; - if (INT_MULTIPLY_WRAPV (size, element_size, &new_size_bytes)) + if (ckd_mul (&new_size_bytes, size, element_size)) { /* Overflow. */ __set_errno (ENOMEM); diff --git a/lib/malloc/dynarray_resize_clear.c b/lib/malloc/dynarray_resize_clear.c index 9c43b00..bb23c52 100644 --- a/lib/malloc/dynarray_resize_clear.c +++ b/lib/malloc/dynarray_resize_clear.c @@ -1,5 +1,5 @@ /* Increase the size of a dynamic array and clear the new part. - Copyright (C) 2017-2021 Free Software Foundation, Inc. + Copyright (C) 2017-2023 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or |