public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: exactlywb@ispras.ru
To: elfutils-devel@sourceware.org
Subject: -Werror=array-bounds
Date: Thu, 08 Sep 2022 17:15:44 +0300	[thread overview]
Message-ID: <b2a8baae34dee26012ad1c314e04c0ca@ispras.ru> (raw)

Hi! I've noticed that in 81st line of image-header.c file is suspicious:
header = header_buffer - H_START;

As it's written in ISO/IEC 9899:1999:
- Addition or subtraction of a pointer into, or just beyond, an array 
object and an
integer type produces a result that does not point into, or just beyond, 
the same array
object

So it's kinda like ub. It doesn't look really dangerous, but maybe on 
some architectures it can be crashed.

Thanks,
Frolov Daniil

                 reply	other threads:[~2022-09-08 14:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2a8baae34dee26012ad1c314e04c0ca@ispras.ru \
    --to=exactlywb@ispras.ru \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).