]> git.hungrycats.org Git - linux/commitdiff
[PATCH] clean up fs_exec.c
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 22 Apr 2002 06:10:07 +0000 (23:10 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 22 Apr 2002 06:10:07 +0000 (23:10 -0700)
Martin Pool <mbp@samba.org>: trivial kernel patch -- clean up fs_exec.c:

(Included in 2.4)

fs/exec.c

index 0bb1bfc81e471ab6c0d1ecc6dc7dfdc32f868f1d..e7e4da3c3a8da9ce5bbf0edbf7d4819350b4fe8d 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -978,8 +978,7 @@ int do_coredump(long signr, struct pt_regs * regs)
        if (current->rlim[RLIMIT_CORE].rlim_cur < binfmt->min_coredump)
                goto fail;
 
-       memcpy(corename,"core.", 5);
-       corename[4] = '\0';
+       memcpy(corename,"core", 5); /* include trailing \0 */
        if (core_uses_pid || atomic_read(&current->mm->mm_users) != 1)
                sprintf(&corename[4], ".%d", current->pid);
        file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);