linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: btaudio uses memset so should be strlcpy
@ 2003-07-18 14:29 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2003-07-18 14:29 UTC (permalink / raw)
  To: linux-kernel, torvalds


(I've got a patch pending from someone to redo the lot using memset so
its safe from padding suprises)

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.6.0-test1/sound/oss/btaudio.c linux-2.6.0-test1-ac2/sound/oss/btaudio.c
--- linux-2.6.0-test1/sound/oss/btaudio.c	2003-07-14 14:11:57.000000000 +0100
+++ linux-2.6.0-test1-ac2/sound/oss/btaudio.c	2003-07-14 14:27:14.000000000 +0100
@@ -328,8 +328,8 @@
 	if (cmd == SOUND_MIXER_INFO) {
 		mixer_info info;
 		memset(&info,0,sizeof(info));
-                strncpy(info.id,"bt878",sizeof(info.id));
-                strncpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
+                strlcpy(info.id,"bt878",sizeof(info.id));
+                strlcpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
                 info.modify_counter = bta->mixcount;
                 if (copy_to_user((void *)arg, &info, sizeof(info)))
                         return -EFAULT;
@@ -338,8 +338,8 @@
 	if (cmd == SOUND_OLD_MIXER_INFO) {
 		_old_mixer_info info;
 		memset(&info,0,sizeof(info));
-                strncpy(info.id,"bt878",sizeof(info.id)-1);
-                strncpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
+                strlcpy(info.id,"bt878",sizeof(info.id)-1);
+                strlcpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
                 if (copy_to_user((void *)arg, &info, sizeof(info)))
                         return -EFAULT;
 		return 0;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-18 15:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-18 14:29 PATCH: btaudio uses memset so should be strlcpy Alan Cox

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