From d5ea5e8aed304337489a4dbbaf0f00d40bd92fc6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 28 Jun 2025 17:36:04 -0700 Subject: [PATCH] od: fix integer overflow with large pseudos * src/od.c (format_address_label): Diagnose overflow. --- src/od.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.47.3