]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOHibernateRestoreKernel.c
xnu-3789.60.24.tar.gz
[apple/xnu.git] / iokit / Kernel / IOHibernateRestoreKernel.c
index 7c2d3931ff8a628a580aea470980b2cdbec19245..017d4d4f87bc9a3a2a59ab9a8008cd2352df16eb 100644 (file)
@@ -402,15 +402,15 @@ store_one_page(uint32_t procFlags, uint32_t * src, uint32_t compressedSize,
        {
                dst = pal_hib_map(DEST_COPY_AREA, dst);
                if (compressedSize != 4) WKdm_decompress_new((WK_word*) src, (WK_word*)(uintptr_t)dst, (WK_word*) &scratch[0], compressedSize);
-               else {
-                       int i;
-                       uint32_t *s, *d;
-                       
-                       s = src;
-                       d = (uint32_t *)(uintptr_t)dst;
+               else
+               {
+                       size_t i;
+                       uint32_t s, *d;
 
-                       for (i = 0; i < (int)(PAGE_SIZE / sizeof(int32_t)); i++)
-                               *d++ = *s;
+                       s = *src;
+                       d = (uint32_t *)(uintptr_t)dst;
+            if (!s) bzero((void *) dst, PAGE_SIZE);
+            else    for (i = 0; i < (PAGE_SIZE / sizeof(int32_t)); i++) *d++ = s;
                }
        }
        else