aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2010-03-29 10:54:42 -0700
committerAurelien Jarno <aurelien@aurel32.net>2010-05-06 06:45:12 +0200
commit3e0650a9c95f343ca5da2b89dc4ad1cd67c2c2d7 (patch)
tree23b9c6ee30d90b9c70c2e881f8db0cf0378599e7 /exec.c
parentc581deda322080e8beb88b2e468d4af54454e4b3 (diff)
Fix zero-length write(2).
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 95b92f7f63..cddaf366bf 100644
--- a/exec.c
+++ b/exec.c
@@ -2429,6 +2429,9 @@ int page_check_range(target_ulong start, target_ulong len, int flags)
assert(start < ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS));
#endif
+ if (len == 0) {
+ return 0;
+ }
if (start + len - 1 < start) {
/* We've wrapped around. */
return -1;