]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/kern_core.c
xnu-2782.1.97.tar.gz
[apple/xnu.git] / bsd / kern / kern_core.c
index fd832d4c5cd9a35869f486075b88d4fdc634d00d..2bd9de059d460bb414c7a13b14082d4afec284f3 100644 (file)
@@ -241,6 +241,10 @@ coredump(proc_t core_proc, uint32_t reserve_mb, int ignore_ulimit)
        int             is_64 = 0;
        size_t          mach_header_sz = sizeof(struct mach_header);
        size_t          segment_command_sz = sizeof(struct segment_command);
+       
+       if (current_proc() != core_proc) {
+               panic("coredump() called against proc that is not current_proc: %p", core_proc);
+       }
 
        if (do_coredump == 0 ||         /* Not dumping at all */
            ( (sugid_coredump == 0) &&  /* Not dumping SUID/SGID binaries */