From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: msnyder@vmware.com
Cc: gdb-patches@sourceware.org
Subject: Re: [commit] breakpoint.c, breakpoint_adjustment_warning, make safe from overflow
Date: Tue, 01 Mar 2011 09:07:00 -0000 [thread overview]
Message-ID: <201103010907.p2197biT001306@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <4D6C57B4.70807@vmware.com> (message from Michael Snyder on Mon, 28 Feb 2011 18:19:32 -0800)
> Date: Mon, 28 Feb 2011 18:19:32 -0800
> From: Michael Snyder <msnyder@vmware.com>
>
> checked in.
Just wanted to say that there's lots of good stuff in this stream of
patches, especially stuff like this where the reason for magic
constants is also documented.
Thanks Michael!
> 2011-02-28 Michael Snyder <msnyder@vmware.com>
>
> * breakpoint.c (breakpoint_adjustment_warning): Make local char
> buffers a little bigger, to avoid possibility of an overflow.
>
> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.545
> diff -u -p -u -p -r1.545 breakpoint.c
> --- breakpoint.c 28 Feb 2011 18:48:18 -0000 1.545
> +++ breakpoint.c 1 Mar 2011 02:15:05 -0000
> @@ -5504,8 +5504,10 @@ static void
> breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
> int bnum, int have_bnum)
> {
> - char astr1[40];
> - char astr2[40];
> + /* The longest string possibly returned by hex_string_custom
> + is 50 chars. These must be at least that big for safety. */
> + char astr1[64];
> + char astr2[64];
>
> strcpy (astr1, hex_string_custom ((unsigned long) from_addr, 8));
> strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8));
next prev parent reply other threads:[~2011-03-01 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 2:19 Michael Snyder
2011-03-01 9:07 ` Mark Kettenis [this message]
2011-03-01 18:58 ` Michael Snyder
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=201103010907.p2197biT001306@glazunov.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.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