summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-04-08 08:57:47 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-04-08 22:20:34 +0200
commit3b85cd3aacae63f2372ed713e263843824821881 (patch)
tree3a4f02a038ed00165b1c23828585276bd329d234
parent764430b760549865ab45215990b926594e993e87 (diff)
Fix bugs in truncation of memory map.
* mach-defpager/default_pager.c (pager_truncate): Use new_size instead of old_size in memcpy.
-rw-r--r--mach-defpager/default_pager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index cd0f6e30..3fcf9c7d 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -1113,7 +1113,7 @@ pager_truncate(dpager_t pager, vm_size_t new_size) /* in pages */
{
const dp_map_t old_mapptr = pager->map;
pager->map = (dp_map_t) kalloc (INDIRECT_PAGEMAP_SIZE(new_size));
- memcpy (pager->map, old_mapptr, INDIRECT_PAGEMAP_SIZE(old_size));
+ memcpy (pager->map, old_mapptr, INDIRECT_PAGEMAP_SIZE(new_size));
kfree ((char *) old_mapptr, INDIRECT_PAGEMAP_SIZE (old_size));
}
}
@@ -1139,7 +1139,7 @@ pager_truncate(dpager_t pager, vm_size_t new_size) /* in pages */
{
const dp_map_t old_mapptr = pager->map;
pager->map = (dp_map_t) kalloc (PAGEMAP_SIZE (new_size));
- memcpy (pager->map, old_mapptr, PAGEMAP_SIZE (old_size));
+ memcpy (pager->map, old_mapptr, PAGEMAP_SIZE (new_size));
kfree ((char *) old_mapptr, PAGEMAP_SIZE (old_size));
}
}