* [PATCH] TRIVIAL 2.5.8: clean up fs_exec.c
@ 2002-04-22 3:47 Rusty Russell
2002-04-23 0:06 ` Paul Mackerras
0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2002-04-22 3:47 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
Martin Pool <mbp@samba.org>: trivial kernel patch -- clean up fs_exec.c:
(Included in 2.4)
--- trivial-2.5.8/fs/exec.c.orig Mon Apr 22 13:42:32 2002
+++ trivial-2.5.8/fs/exec.c Mon Apr 22 13:42:32 2002
@@ -978,8 +978,7 @@
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(¤t->mm->mm_users) != 1)
sprintf(&corename[4], ".%d", current->pid);
file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] TRIVIAL 2.5.8: clean up fs_exec.c
2002-04-22 3:47 [PATCH] TRIVIAL 2.5.8: clean up fs_exec.c Rusty Russell
@ 2002-04-23 0:06 ` Paul Mackerras
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mackerras @ 2002-04-23 0:06 UTC (permalink / raw)
To: Rusty Russell; +Cc: linux-kernel
Rusty Russell writes:
> - memcpy(corename,"core.", 5);
> - corename[4] = '\0';
> + memcpy(corename,"core", 5); /* include trailing \0 */
What's wrong with strcpy? gcc3 will even turn it into a memcpy for
you. :)
Paul.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-04-23 8:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-22 3:47 [PATCH] TRIVIAL 2.5.8: clean up fs_exec.c Rusty Russell
2002-04-23 0:06 ` Paul Mackerras
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).