From f66187fdfeacda6177f7f3949fb737683f873f7f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 23 Mar 2010 15:59:45 +0000 Subject: [PATCH] * dis-buf.c (buffer_read_memory): Give error for reading just before the start of memory. --- opcodes/ChangeLog | 5 +++++ opcodes/dis-buf.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 0f2321f81f1..f2192319724 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2010-03-23 Joseph Myers + + * dis-buf.c (buffer_read_memory): Give error for reading just + before the start of memory. + 2010-03-22 Sebastian Pop Quentin Neill diff --git a/opcodes/dis-buf.c b/opcodes/dis-buf.c index 7e3fd63a88a..372fb96b280 100644 --- a/opcodes/dis-buf.c +++ b/opcodes/dis-buf.c @@ -1,6 +1,6 @@ /* Disassemble from a buffer, for GNU. Copyright 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005, - 2007, 2009 Free Software Foundation, Inc. + 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -38,6 +38,7 @@ buffer_read_memory (bfd_vma memaddr, unsigned int octets = (memaddr - info->buffer_vma) * opb; if (memaddr < info->buffer_vma + || memaddr - info->buffer_vma > max_addr_offset || memaddr - info->buffer_vma + end_addr_offset > max_addr_offset) /* Out of bounds. Use EIO because GDB uses it. */ return EIO; -- 2.30.2