public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "tromey at sourceware dot org" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug libdw/26773] sleb128 values near INT64_MAX/MIN not correctly read
Date: Thu, 22 Oct 2020 20:07:38 +0000	[thread overview]
Message-ID: <bug-26773-10460-v9ijfy4VB8@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26773-10460@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=26773

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I looked at this a little today.

In addition to this bug, I think the _unchecked variants
have another bug; namely they do:

  const size_t max = len_leb128 (int64_t) - 1;

This limits the number of bytes read-- but it seems like
it maybe ought to read until the first byte without the
high bit set.

FWIW gdb seems to rely on implementation-defined behavior
here.  It does all the sleb work in an unsigned type
and then casts it to signed on return.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2020-10-22 20:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 11:06 [Bug libdw/26773] New: " mark at klomp dot org
2020-10-22 20:07 ` tromey at sourceware dot org [this message]
2020-10-22 23:46 ` [Bug libdw/26773] " jistone at redhat dot com
2020-10-23 15:57 ` mark at klomp dot org
2020-10-23 16:08 ` mark at klomp dot org
2020-10-29 23:07 ` mark at klomp dot org

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=bug-26773-10460-v9ijfy4VB8@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --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).