X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=sound%2Fcore%2Fcontrol.c;h=eeb691d1911f5716bb09b8eecacd24215a31564f;hb=130c93fd10c4d150e39d8879420c1351aa207fa9;hp=35324a8e83c867f126256f67b493b5320b9652c7;hpb=65d2918e716afb89359cfa59734d76c1ff8700cb;p=cascardo%2Flinux.git diff --git a/sound/core/control.c b/sound/core/control.c index 35324a8e83c8..eeb691d1911f 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1170,6 +1170,10 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, if (info->count < 1) return -EINVAL; + if (!*info->id.name) + return -EINVAL; + if (strnlen(info->id.name, sizeof(info->id.name)) >= sizeof(info->id.name)) + return -EINVAL; access = info->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : (info->access & (SNDRV_CTL_ELEM_ACCESS_READWRITE| SNDRV_CTL_ELEM_ACCESS_INACTIVE|