]> git.alsa-project.org Git - alsa-lib.git/commit
Fix TLV dB parser in case of used container
authorArkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
Sat, 31 Aug 2024 18:31:02 +0000 (20:31 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 6 Sep 2024 08:51:06 +0000 (10:51 +0200)
commit9ac93d1252c4ddd0043dbe7b08781320b26ad4c9
tree5e24d6d2bfb0de3a3bc5af2b60722e26d1490269
parentfc58f8fcc39c365feff4261d4923bef384fe5700
Fix TLV dB parser in case of used container

In case when dB information does not appear as the only TLV type in the
stream (it might be wrapped in a container, but the container can not
have any other type), the TLV parser fails to get the dB TLV pointer.

This commit fixes it by distinguishing between TLV parse error and dB
information not being found in a container (-ENOENT), so the parser can iterate
over all elements in the container.

Also, it fixes out-of-bounds read in case of malicious TLV record.

Closes: https://github.com/alsa-project/alsa-lib/pull/409
Signed-off-by: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/control/tlv.c