Commit 2feac34e authored by drath's avatar drath
Browse files

- fix a off-by-one error in the buffer read/write code that checks for a address wrap


git-svn-id: svn://svn.berlios.de/openocd/trunk@957 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent daa58ab2
......@@ -870,7 +870,7 @@ int target_write_buffer(struct target_s *target, u32 address, u32 size, u8 *buff
return ERROR_FAIL;
}
if (address+size<address)
if ((address + size - 1) < address)
{
/* GDB can request this when e.g. PC is 0xfffffffc*/
LOG_ERROR("address+size wrapped(0x%08x, 0x%08x)", address, size);
......@@ -946,7 +946,7 @@ int target_read_buffer(struct target_s *target, u32 address, u32 size, u8 *buffe
return ERROR_FAIL;
}
if (address+size<address)
if ((address + size - 1) < address)
{
/* GDB can request this when e.g. PC is 0xfffffffc*/
LOG_ERROR("address+size wrapped(0x%08x, 0x%08x)", address, size);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment