Commit e5ab7589 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] btaudio uses memset so should be strlcpy

(I've got a patch pending from someone to redo the lot using memset so
its safe from padding suprises)
parent 5e8f2780
...@@ -328,8 +328,8 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file, ...@@ -328,8 +328,8 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file,
if (cmd == SOUND_MIXER_INFO) { if (cmd == SOUND_MIXER_INFO) {
mixer_info info; mixer_info info;
memset(&info,0,sizeof(info)); memset(&info,0,sizeof(info));
strncpy(info.id,"bt878",sizeof(info.id)); strlcpy(info.id,"bt878",sizeof(info.id));
strncpy(info.name,"Brooktree Bt878 audio",sizeof(info.name)); strlcpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
info.modify_counter = bta->mixcount; info.modify_counter = bta->mixcount;
if (copy_to_user((void *)arg, &info, sizeof(info))) if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
...@@ -338,8 +338,8 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file, ...@@ -338,8 +338,8 @@ static int btaudio_mixer_ioctl(struct inode *inode, struct file *file,
if (cmd == SOUND_OLD_MIXER_INFO) { if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info; _old_mixer_info info;
memset(&info,0,sizeof(info)); memset(&info,0,sizeof(info));
strncpy(info.id,"bt878",sizeof(info.id)-1); strlcpy(info.id,"bt878",sizeof(info.id)-1);
strncpy(info.name,"Brooktree Bt878 audio",sizeof(info.name)); strlcpy(info.name,"Brooktree Bt878 audio",sizeof(info.name));
if (copy_to_user((void *)arg, &info, sizeof(info))) if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment