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]
Date:	Sun,  3 Aug 2014 01:23:57 +0200
From:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
To:	"James E.J. Bottomley" <JBottomley@...allels.com>,
	Grant Likely <grant.likely@...aro.org>
Cc:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	Rob Herring <robh+dt@...nel.org>,
	Michael Opdenacker <michael.opdenacker@...e-electrons.com>,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
	devicetree@...r.kernel.org
Subject: [PATCH] scsi: ibmvscsi: ibmvstgt.c:  Cleaning up missing null-terminate in conjunction with strncpy

Replacing strncpy with strlcpy to avoid strings that lacks null terminate.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
---
 drivers/scsi/ibmvscsi/ibmvstgt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index 56f8a86..5c16d17 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -340,7 +340,7 @@ int send_adapter_info(struct iu_entry *iue,
 	memset(info, 0, sizeof(*info));
 
 	strcpy(info->srp_version, "16.a");
-	strncpy(info->partition_name, partition_name,
+	strlcpy(info->partition_name, partition_name,
 		sizeof(info->partition_name));
 	info->partition_number = partition_number;
 	info->mad_version = 1;
@@ -938,7 +938,7 @@ static int get_system_info(void)
 
 	name = of_get_property(rootdn, "ibm,partition-name", NULL);
 	if (name)
-		strncpy(partition_name, name, sizeof(partition_name));
+		strlcpy(partition_name, name, sizeof(partition_name));
 
 	num = of_get_property(rootdn, "ibm,partition-no", NULL);
 	if (num)
-- 
1.7.10.4

--
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