summaryrefslogtreecommitdiff
path: root/linux-user/mmap.c
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-27 04:10:43 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-09-27 04:10:43 +0000
commit4118a97030aa9bd1d520d1d06bbe0655d829df04 (patch)
treeb963cf2e91c23b60aad7c70fc5423114f274434b /linux-user/mmap.c
parent526216880d5c4cb2507bdb22d6a5d33016f38104 (diff)
downloadqemu-4118a97030aa9bd1d520d1d06bbe0655d829df04.zip
memset string pages to zero to avoid putting random data on the stack
that may make some program crash at startup. Fix unsigned long / target_ulong confusion (more to do). Fix missing g2h macros. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3249 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/mmap.c')
-rw-r--r--linux-user/mmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 28954f13fa..29f1d9625c 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -224,9 +224,9 @@ abort();
start = HOST_PAGE_ALIGN(real_start);
end = start + HOST_PAGE_ALIGN(len);
if (start > real_start)
- munmap((void *)real_start, start - real_start);
+ munmap((void *)g2h(real_start), start - real_start);
if (end < real_end)
- munmap((void *)end, real_end - end);
+ munmap((void *)g2h(end), real_end - end);
/* use it as a fixed mapping */
flags |= MAP_FIXED;
} else {
@@ -370,7 +370,7 @@ int target_munmap(target_ulong start, target_ulong len)
/* unmap what we can */
if (real_start < real_end) {
- ret = munmap((void *)real_start, real_end - real_start);
+ ret = munmap(g2h(real_start), real_end - real_start);
if (ret != 0)
return ret;
}