From: "Theodore A. Roth" <troth@openavr.org>
To: gdb-patches@sources.redhat.com
Subject: [commit] [avr] fix a buffer overrun
Date: Sat, 14 Jun 2003 20:43:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.44.0306141333140.9723-200000@bozoland.mynet> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 458 bytes --]
Hi,
This patch protects against a buffer overrun in the avr prologue scanner.
The overrun was causing gdb to seg fault.
It's basically a band-aid to allow me to test the rest of the patches I'll
be committing this weekend to frame-ify and remove deprecated interfaces
from avr-tdep.c.
Ted Roth
2003-06-14 Theodore A. Roth <troth@openavr.org>
* avr-tdep.c (avr_scan_prologue): Fix to avoid a buffer over run which
causes gdb to seg fault.
[-- Attachment #2: Type: TEXT/PLAIN, Size: 838 bytes --]
2003-06-14 Theodore A. Roth <troth@openavr.org>
* avr-tdep.c (avr_scan_prologue): Fix to avoid a buffer over run which
causes gdb to seg fault.
Index: avr-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/avr-tdep.c,v
retrieving revision 1.54
diff -u -p -r1.54 avr-tdep.c
--- avr-tdep.c 13 Jun 2003 17:52:28 -0000 1.54
+++ avr-tdep.c 14 Jun 2003 20:26:41 -0000
@@ -486,7 +486,7 @@ avr_scan_prologue (struct frame_info *fi
frame pointer, adjust the stack pointer, and save registers. */
get_frame_extra_info (fi)->framesize = 0;
- prologue_len = prologue_end - prologue_start;
+ prologue_len = min (prologue_end - prologue_start, AVR_MAX_PROLOGUE_SIZE);
read_memory (prologue_start, prologue, prologue_len);
/* Scanning main()'s prologue
reply other threads:[~2003-06-14 20:43 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=Pine.LNX.4.44.0306141333140.9723-200000@bozoland.mynet \
--to=troth@openavr.org \
--cc=gdb-patches@sources.redhat.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