From: Daniel Jacobowitz <drow@false.org>
To: "Cuthbertson, Reva D." <reva_cuthbertson@hp.com>
Cc: gdb@sources.redhat.com
Subject: Re: Is it possible to overflow baton->size in dwarf_mark_symbols_computed() in dwarf2read.c?
Date: Fri, 13 May 2005 15:25:00 -0000 [thread overview]
Message-ID: <20050513152532.GA8589@nevyn.them.org> (raw)
In-Reply-To: <B6C7F31B85669143825614FC8FE64929040F79D1@cacexc04.americas.cpqcorp.net>
On Fri, May 13, 2005 at 08:18:47AM -0700, Cuthbertson, Reva D. wrote:
> Hello,
>
> I had a question regarding the following assignment in
> dwarf2_mark_symbol_computed() in dwarf2read.c:
>
> baton->size = dwarf2_per_objfile->loc_size - DW_UNSND (attr);
>
> The field "loc_size" in dwarf2_per_objfile is declared to be an unsigned
> integer and attr.u.unsnd (expansion of DW_UNSND (attr)) is declared to
> be an unsigned long but the "size" field in dwarf2_loclist_baton and
> dwarf2_locexpr_baton defined in dwarf2loc.h is defined to be an unsigned
> short. Is it possible to overflow baton->size with the above
> calculation?
Yes, this seems possible. Size is used for overflow checking only at
this point; saturating at USHORT_MAX seems reasonable.
Have you encountered this problem?
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-05-13 15:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-13 15:19 Cuthbertson, Reva D.
2005-05-13 15:25 ` Daniel Jacobowitz [this message]
2005-05-13 15:37 Cuthbertson, Reva D.
2005-05-13 15:40 ` Daniel Jacobowitz
2005-05-16 20:28 ` Jim Blandy
2005-05-13 16:00 Cuthbertson, Reva D.
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=20050513152532.GA8589@nevyn.them.org \
--to=drow@false.org \
--cc=gdb@sources.redhat.com \
--cc=reva_cuthbertson@hp.com \
/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