Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit] [avr] fix a buffer overrun
@ 2003-06-14 20:43 Theodore A. Roth
  0 siblings, 0 replies; only message in thread
From: Theodore A. Roth @ 2003-06-14 20:43 UTC (permalink / raw)
  To: gdb-patches

[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-06-14 20:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-14 20:43 [commit] [avr] fix a buffer overrun Theodore A. Roth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox