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


Message #43 received at 78880 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 78880 <at> debbugs.gnu.org
Subject: Re: bug#78880: od Heap-buffer overflow
Date: Sun, 29 Jun 2025 13:17:34 +0100
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 ?

cheers,
Padraig




This bug report was last modified 52 days ago.

Previous Next


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