netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy
@ 2013-01-07  4:42 Chen Gang
  2013-01-07 11:17 ` Stanislaw Gruszka
       [not found] ` <50EA5246.8060206-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Chen Gang @ 2013-01-07  4:42 UTC (permalink / raw)
  To: sgruszka, linville; +Cc: linux-wireless, netdev


  The fields must be null-terminated, or simple_strtoul will cause issue.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 drivers/net/wireless/iwlegacy/3945-mac.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index d604b40..3726cd6 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3273,7 +3273,7 @@ il3945_store_measurement(struct device *d, struct device_attribute *attr,
 
 	if (count) {
 		char *p = buffer;
-		strncpy(buffer, buf, min(sizeof(buffer), count));
+		strlcpy(buffer, buf, sizeof(buffer));
 		channel = simple_strtoul(p, NULL, 0);
 		if (channel)
 			params.channel = channel;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-20 10:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-07  4:42 [PATCH] drivers/net/wireless/iwlegacy: use strlcpy instead of strncpy Chen Gang
2013-01-07 11:17 ` Stanislaw Gruszka
2013-01-10  8:48   ` Chen Gang F T
     [not found] ` <50EA5246.8060206-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org>
2013-01-20  9:31   ` Chen Gang
2013-01-20 10:45     ` Chen Gang F T

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