]> Zhao Yanbai Git Server - minix.git/commitdiff
vfs: coredump fix: write zeroes for missing memory
authorBen Gras <ben@minix3.org>
Sat, 16 Mar 2013 04:13:02 +0000 (04:13 +0000)
committerBen Gras <ben@minix3.org>
Wed, 20 Mar 2013 20:05:31 +0000 (20:05 +0000)
servers/vfs/coredump.c

index 43ccfda4fa4212ff63a7017f7a795952b71cfb85..9b5d24573b78d38ddc3ecd4c765e3c0de900c358 100644 (file)
@@ -310,9 +310,9 @@ static void dump_segments(struct filp *f, Elf_Phdr phdrs[], int phnum)
                        (phys_bytes) CLICK_SIZE);
 
                if(r != OK) {
-                       printf("VFS: vircopy failed for %d @ 0x%lx during coredump\n",
-                               fp->fp_endpoint, p);
-                       break;
+                       /* memory didn't exist; write as zeroes */
+                       memset(buf, 0, sizeof(buf));
+                       continue;
                }
 
                write_buf(f, (char *) buf, (off + CLICK_SIZE <= (off_t) len) ?