mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
od: fix integer overflow with large pseudos
* src/od.c (format_address_label): Diagnose overflow.
This commit is contained in:
1 parent
667be269ed
commit
d5ea5e8aed
1 file changed
+6
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user