Skip to contentSkip to conversation

Memory core integer overflow fix

GIT PULL Avi Kivity 2 participants 2 messages Sep 14, 2011 – Sep 15, 2011

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

Please pull from

git://github.com/avikivity/qemu.git memory/core

to receive a core fix for an integer overflow problem hitting ppc:

David Gibson (1):
Fix subtle integer overflow bug in memory API

 memory.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
memory.c +2 -2
index 57f0fa4..101b67c 100644
@@ -55,8 +55,8 @@ static AddrRange addrrange_shift(AddrRange range, int64_t delta)
 
 static bool addrrange_intersects(AddrRange r1, AddrRange r2)
 {
-    return (r1.start >= r2.start && r1.start < r2.start + r2.size)
-        || (r2.start >= r1.start && r2.start < r1.start + r1.size);
+    return (r1.start >= r2.start && (r1.start - r2.start) < r2.size)
+        || (r2.start >= r1.start && (r2.start - r1.start) < r1.size);
 }
 
 static AddrRange addrrange_intersection(AddrRange r1, AddrRange r2)
Signature · 1 line
error compiling committee.c: too many arguments to function
#1 lore raw
Quoted 8 lines · Avi Kivity

Please pull from

git://github.com/avikivity/qemu.git memory/core

to receive a core fix for an integer overflow problem hitting ppc:

David Gibson (1):
Fix subtle integer overflow bug in memory API

Pulled. Thanks.

Regards,

Anthony Liguori

Quoted 20 lines

memory.c | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
memory.c +2 -2
index 57f0fa4..101b67c 100644
@@ -55,8 +55,8 @@ static AddrRange addrrange_shift(AddrRange range, int64_t delta)
 
 static bool addrrange_intersects(AddrRange r1, AddrRange r2)
 {
- return (r1.start >= r2.start && r1.start < r2.start + r2.size)
- || (r2.start >= r1.start && r2.start < r1.start + r1.size);
+ return (r1.start >= r2.start && (r1.start - r2.start) < r2.size)
+ || (r2.start >= r1.start && (r2.start - r1.start) < r1.size);
 }
 
 static AddrRange addrrange_intersection(AddrRange r1, AddrRange r2)