]> git.alsa-project.org Git - alsa-lib.git/commit
ctl: add dimension validator
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Thu, 7 Jul 2016 21:33:17 +0000 (06:33 +0900)
committerTakashi Iwai <tiwai@suse.de>
Thu, 7 Jul 2016 21:48:41 +0000 (23:48 +0200)
commit025e451b833efeb0b930f9041c827ea244ea4586
treeadcf83983ded1ffcb19c14c846ea649a2d7ffdbd
parent3ef712844f3a93f34f269114e341915ae7efece2
ctl: add dimension validator

Linux 4.7 or former have no validator of dimension information. This can
causes an issue related to user-defined element set. For example, When
calculated total members in multi-dimensional matrix is larger than actual
capacity of snd_ctl_elem_value_t, processes to handle the element can
cause buffer-over-run.

For backward portability of this userspace library, this commit adds a
validator of dimension information. When userspace applications give
invalid dimension information to APIs to add element set, they receive
-EINVAL.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/control/control.c