From 57bc612204774251fc7371a5fff99e83170814e1 Mon Sep 17 00:00:00 2001 From: "Theodore A. Roth" Date: Sat, 14 Jun 2003 20:33:39 +0000 Subject: [PATCH] * avr-tdep.c (avr_scan_prologue): Fix to avoid a buffer over run which causes gdb to seg fault. --- gdb/ChangeLog | 5 +++++ gdb/avr-tdep.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9dac8f20edb..79578abf231 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-06-14 Theodore A. Roth + + * avr-tdep.c (avr_scan_prologue): Fix to avoid a buffer over run which + causes gdb to seg fault. + 2003-06-14 Daniel Jacobowitz * sparc-nat.c (fetch_inferior_registers): Correct diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index df1ffddcc88..e9d59960751 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -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 -- 2.30.2