PATCH: fix security leak in maestro.c

Alan Cox (alan@lxorguk.ukuu.org.uk)
Fri, 11 Jul 2003 19:15:41 +0100


diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.75/sound/oss/maestro.c linux-2.5.75-ac1/sound/oss/maestro.c
--- linux-2.5.75/sound/oss/maestro.c 2003-07-10 21:14:10.000000000 +0100
+++ linux-2.5.75-ac1/sound/oss/maestro.c 2003-07-11 16:28:21.000000000 +0100
@@ -2024,8 +2024,8 @@
VALIDATE_CARD(card);
if (cmd == SOUND_MIXER_INFO) {
mixer_info info;
- strlcpy(info.id, card_names[card->card_type], sizeof(info.id));
- strlcpy(info.name, card_names[card->card_type], sizeof(info.name));
+ strncpy(info.id, card_names[card->card_type], sizeof(info.id));
+ strncpy(info.name, card_names[card->card_type], sizeof(info.name));
info.modify_counter = card->mix.modcnt;
if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT;
@@ -2033,8 +2033,8 @@
}
if (cmd == SOUND_OLD_MIXER_INFO) {
_old_mixer_info info;
- strlcpy(info.id, card_names[card->card_type], sizeof(info.id));
- strlcpy(info.name, card_names[card->card_type], sizeof(info.name));
+ strncpy(info.id, card_names[card->card_type], sizeof(info.id));
+ strncpy(info.name, card_names[card->card_type], sizeof(info.name));
if (copy_to_user((void *)arg, &info, sizeof(info)))
return -EFAULT;
return 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/