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  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, 19 Oct 2014 00:17:08 +0200
From:	Rickard Strandqvist <>
To:	Sebastian Reichel <>,
	Dmitry Eremin-Solenikov <>
Cc:	Rickard Strandqvist <>,
	Andi Kleen <>,
	Andrew Morton <>,
	Dan Carpenter <>,
	David Woodhouse <>,
	Grant Likely <>,
	Rob Herring <>,,,
Subject: [PATCH 4/5] power: charger-manager.c:  Cleaning up missing null-terminate by switching from strncpy to strzcpy

Ensures that the string is null-terminate in connection with the
use of strncpy, by switching from strncpy to strzcpy.

Signed-off-by: Rickard Strandqvist <>
 drivers/power/charger-manager.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
index 9e4dab4..18dad9e 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -1764,9 +1764,9 @@ static int charger_manager_probe(struct platform_device *pdev)
 	memcpy(&cm->charger_psy, &psy_default, sizeof(psy_default));
 	if (!desc->psy_name)
-		strncpy(cm->psy_name_buf,, PSY_NAME_MAX);
+		strzcpy(cm->psy_name_buf,, PSY_NAME_MAX);
-		strncpy(cm->psy_name_buf, desc->psy_name, PSY_NAME_MAX);
+		strzcpy(cm->psy_name_buf, desc->psy_name, PSY_NAME_MAX);
 	cm-> = cm->psy_name_buf;
 	/* Allocate for psy properties because they may vary */

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists