lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <47CFF148.8050608@tiscali.nl>
Date:	Thu, 06 Mar 2008 14:27:36 +0100
From:	Roel Kluin <12o3l@...cali.nl>
To:	"David S. Miller" <davem@...emloft.net>
CC:	sparclinux@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>
Subject: [PATCH] sparc64: aout32_core_dump(): convert strncpy(x, y, sizeof(x))
 to strlcpy

This patch was not yet tested. Please confirm it's right.
---
strncpy does not append '\0' if the length of the source string equals
the size parameter, strlcpy does.

Signed-off-by: Roel Kluin <12o3l@...cali.nl>
---
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index 9877f2d..0a63d18 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -100,7 +100,7 @@ static int aout32_core_dump(long signr, struct pt_regs *regs, struct file *file,
 	set_fs(KERNEL_DS);
 	has_dumped = 1;
 	current->flags |= PF_DUMPCORE;
-       	strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
+	strlcpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
 	dump.signal = signr;
 	aout_dump_thread(regs, &dump);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ