GNU bug report logs - #78880
od Heap-buffer overflow

Previous Next

Package: coreutils;

Reported by: Jaehoon Jang <jaehoon.jang <at> prosys.kaist.ac.kr>

Date: Mon, 23 Jun 2025 19:13:05 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jim Meyering <jim <at> meyering.net>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: 78880 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>
Subject: bug#78880: od Heap-buffer overflow
Date: Sun, 29 Jun 2025 09:30:14 -0700
On Sun, Jun 29, 2025 at 5:18 AM Pádraig Brady <P <at> draigbrady.com> wrote:
> On 29/06/2025 05:25, Paul Eggert wrote:
>
>  > od: omit some duplicate code
>  > On x86-64 (for example) print_long, print_long_long, and
>  > print_intmax all behave identically, so give GCC enough info so
>  > that it generates code for just one of these functions.
>  > * src/od.c (enum size_spec): Arrange for enum values to
>  > be the same if they represent types that behave the same.
>  > (width_bytes, ISPEC_TO_FORMAT, decode_one_format):
>  > Match the enum size_spec changes.
>
> The patch above causes a warning on some systems:
>
>    src/od.c: In function 'decode_one_format':
>    src/od.c:900:28: error: duplicated 'if' condition [-Werror=duplicated-cond]
>      900 |         else if (size_spec == FLOAT_HALF)
>          |                  ~~~~~~~~~~^~~~~~~~~~~~~
>    src/od.c:895:28: note: previously used here
>      895 |         else if (size_spec == FLOAT_SINGLE)
>          |                  ~~~~~~~~~~^~~~~~~~~~~~~~~
>
> If we want the compiler to just apply Dead Code Elimination here,
> then it may be best to push/pop ignoring that warning ?

Thanks. I agree.




This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.