]> git.alsa-project.org Git - alsa-lib.git/commit
topology: decoder: fix wrong sizeof for enum control allocation in dapm
authorKai Vehmanen <kai.vehmanen@linux.intel.com>
Mon, 23 Mar 2026 15:10:33 +0000 (17:10 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 25 May 2026 08:49:43 +0000 (10:49 +0200)
commiteebca4c0b0a7c2561255aa54b1e66b2e695b7c2b
treeb7d65b58d933184f5f61fc3331d3bfd3ed4f3a2f
parent3592e5c7812bfddad932f176e257e8797d71a51b
topology: decoder: fix wrong sizeof for enum control allocation in dapm

The tplg_calloc() call for enum control in the dapm widget kcontrol
decode loop used sizeof(*mt) (mixer template) instead of sizeof(*et)
(enum template). On 64-bit systems, snd_tplg_mixer_template is 72 bytes
while snd_tplg_enum_template is 80 bytes, causing an 8-byte heap buffer
overflow when the enum fields (texts, values pointers) were written past
the allocated block. This resulted in heap corruption and e.g. glibc
malloc hit an assert.

Closes: https://github.com/alsa-project/alsa-lib/pull/501
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/topology/dapm.c