From: Paul Eggert Date: Sun, 29 Jun 2025 00:36:04 +0000 (-0700) Subject: od: fix integer overflow with large pseudos X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5ea5e8aed304337489a4dbbaf0f00d40bd92fc6;p=thirdparty%2Fcoreutils.git od: fix integer overflow with large pseudos * src/od.c (format_address_label): Diagnose overflow. --- diff --git a/src/od.c b/src/od.c index b3af4c72f7..c3c76cc866 100644 --- a/src/od.c +++ b/src/od.c @@ -1227,7 +1227,12 @@ static void format_address_label (intmax_t address, char c) { format_address_std (address, ' '); - format_address_paren (address + pseudo_offset, c); + + intmax_t addr; + if (ckd_add (&addr, address, pseudo_offset)) + error (EXIT_FAILURE, 0, _("pseudo address too large for input")); + + format_address_paren (addr, c); } /* Write N_BYTES bytes from CURR_BLOCK to standard output once for each