Commit 0d988dba authored by Alan Cox's avatar Alan Cox Committed by Steve French

[PATCH] more wrong strlcpy's

parent 572b9ae4
...@@ -1046,8 +1046,8 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg) ...@@ -1046,8 +1046,8 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
VALIDATE_STATE(s); VALIDATE_STATE(s);
if (cmd == SOUND_MIXER_INFO) { if (cmd == SOUND_MIXER_INFO) {
mixer_info info; mixer_info info;
strlcpy(info.id, "SonicVibes", sizeof(info.id)); strncpy(info.id, "SonicVibes", sizeof(info.id));
strlcpy(info.name, "S3 SonicVibes", sizeof(info.name)); strncpy(info.name, "S3 SonicVibes", sizeof(info.name));
info.modify_counter = s->mix.modcnt; info.modify_counter = s->mix.modcnt;
if (copy_to_user((void *)arg, &info, sizeof(info))) if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
...@@ -1055,8 +1055,8 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg) ...@@ -1055,8 +1055,8 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
} }
if (cmd == SOUND_OLD_MIXER_INFO) { if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info; _old_mixer_info info;
strlcpy(info.id, "SonicVibes", sizeof(info.id)); strncpy(info.id, "SonicVibes", sizeof(info.id));
strlcpy(info.name, "S3 SonicVibes", sizeof(info.name)); strncpy(info.name, "S3 SonicVibes", 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;
......
...@@ -289,8 +289,8 @@ static int get_mixer_info(int dev, caddr_t arg) ...@@ -289,8 +289,8 @@ static int get_mixer_info(int dev, caddr_t arg)
{ {
mixer_info info; mixer_info info;
strlcpy(info.id, mixer_devs[dev]->id, sizeof(info.id)); strncpy(info.id, mixer_devs[dev]->id, sizeof(info.id));
strlcpy(info.name, mixer_devs[dev]->name, sizeof(info.name)); strncpy(info.name, mixer_devs[dev]->name, sizeof(info.name));
info.modify_counter = mixer_devs[dev]->modify_counter; info.modify_counter = mixer_devs[dev]->modify_counter;
if (__copy_to_user(arg, &info, sizeof(info))) if (__copy_to_user(arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
...@@ -301,8 +301,8 @@ static int get_old_mixer_info(int dev, caddr_t arg) ...@@ -301,8 +301,8 @@ static int get_old_mixer_info(int dev, caddr_t arg)
{ {
_old_mixer_info info; _old_mixer_info info;
strlcpy(info.id, mixer_devs[dev]->id, sizeof(info.id)); strncpy(info.id, mixer_devs[dev]->id, sizeof(info.id));
strlcpy(info.name, mixer_devs[dev]->name, sizeof(info.name)); strncpy(info.name, mixer_devs[dev]->name, sizeof(info.name));
if (copy_to_user(arg, &info, sizeof(info))) if (copy_to_user(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