canonicalize: use stdckdint.h not intprops.h <stdckdint.h> is standard, so prefer that to the pre-standard intprops.h. * lib/canonicalize.c: Include stdckdint.h, not intprops.h. (canonicalize_filename_mode_stk): Use ckd_add, not INT_ADD_OVERFLOW. * modules/canonicalize (Depends-on): Remove intprops. Add stdckdint-h. Sort. --- ChangeLog | 10 ++++++++++ lib/canonicalize.c | 7 ++++--- modules/canonicalize | 6 +++--- 3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog index d3a0d9b6c8..462da575c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2026-05-10 Paul Eggert <[email protected]> + + canonicalize: use stdckdint.h not intprops.h + <stdckdint.h> is standard, so prefer that to the pre-standard + intprops.h. + * lib/canonicalize.c: Include stdckdint.h, not intprops.h. + (canonicalize_filename_mode_stk): Use ckd_add, not INT_ADD_OVERFLOW. + * modules/canonicalize (Depends-on): Remove intprops. + Add stdckdint-h. Sort. + 2026-05-10 Paul Eggert <[email protected]> canonicalize: pacify -Wmaybe-uninitialized without ignoring diff --git a/lib/canonicalize.c b/lib/canonicalize.c index e2e387b0d4..7da95d920c 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -20,13 +20,13 @@ #include <errno.h> #include <fcntl.h> +#include <stdckdint.h> #include <string.h> #include <sys/stat.h> #include <unistd.h> #include <filename.h> #include <idx.h> -#include <intprops.h> #include <scratch_buffer.h> #include "attribute.h" @@ -373,9 +373,10 @@ canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode, if (0 <= end_extra_offset) end_extra_offset = end - extra_buf; size_t len = strlen (end); - if (INT_ADD_OVERFLOW (len, n)) + size_t newlen; + if (ckd_add (&newlen, len, n)) xalloc_die (); - while (bufs->extra.length <= len + n) + while (bufs->extra.length <= newlen) { if (!scratch_buffer_grow_preserve (&bufs->extra)) xalloc_die (); diff --git a/modules/canonicalize b/modules/canonicalize index 941d2244ab..99a5b7edd9 100644 --- a/modules/canonicalize +++ b/modules/canonicalize @@ -9,6 +9,7 @@ m4/lstat.m4 Depends-on: attribute +bool double-slash-root errno-h extensions @@ -16,17 +17,16 @@ fcntl-h file-set filename getcwd +glibc-internal/scratch_buffer hashcode-named-file idx -intprops memmove mempcpy nocrash rawmemchr readlink -glibc-internal/scratch_buffer stat -bool +stdckdint-h stdlib-h sys_stat-h unistd-h -- 2.54.0
