ALSA: oss: underflow in snd_mixer_oss_proc_write()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Oct 2015 07:01:42 +0000 (10:01 +0300)
committerTakashi Iwai <tiwai@suse.de>
Thu, 15 Oct 2015 08:00:29 +0000 (10:00 +0200)
We cap the upper bound of "idx" but not the negative side.  Let's make
it unsigned to fix this.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/oss/mixer_oss.c

index a99f7200ff3f2929dd17bc85a64c296460346e02..7a8c79dd9734039d2e14ae1a7f23763e7d6fc519 100644 (file)
@@ -1177,7 +1177,8 @@ static void snd_mixer_oss_proc_write(struct snd_info_entry *entry,
        struct snd_mixer_oss *mixer = entry->private_data;
        char line[128], str[32], idxstr[16];
        const char *cptr;
-       int ch, idx;
+       unsigned int idx;
+       int ch;
        struct snd_mixer_oss_assign_table *tbl;
        struct slot *slot;