alsa-utils/topology
Yong Zhi 038ed518e9 topology: plugins: fix off by 1 mem allocation error
Fix valgrind memcheck error:

==1337389== Invalid write of size 1
==1337389==    at 0x4A4AFAB: __vsnprintf_internal (vsnprintf.c:117)
==1337389==    by 0x4AECF40: __snprintf_chk (snprintf_chk.c:38)
==1337389==    by 0x484B870: snprintf (stdio2.h:67)
==1337389==    by 0x484B870: print_as_hex_bytes (nhlt-processor.c:112)
==1337389==    by 0x484B870: merge_manifest_data (nhlt-processor.c:154)
==1337389==    by 0x484B870: do_nhlt (nhlt-processor.c:420)
==1337389==    by 0x484B870: _snd_topology_nhlt_process (nhlt-processor.c:484)

The consecutive snprintf overwrites always the previous terminator until
it hits the very last call of:

snprintf(dst, ALSA_BYTE_CHARS + 1, "0x%02x,", *nhlt_buffer);

when the size n given to snprintf is 1 more than allocated.

Fixes: https://github.com/alsa-project/alsa-utils/pull/162
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2022-11-04 22:03:35 +01:00
..
nhlt topology: plugins: fix off by 1 mem allocation error 2022-11-04 22:03:35 +01:00
alsatplg.rst alsatplg: add decode command 2020-02-09 20:52:30 +01:00
Makefile.am topology: add missing pre-process-external.h to Makefile.am 2022-05-03 14:06:13 +02:00
pre-process-class.c alsatplg: use standard include/asoundlib.h instead direct headers 2021-09-03 08:49:03 +02:00
pre-process-dai.c alsatplg: use standard include/asoundlib.h instead direct headers 2021-09-03 08:49:03 +02:00
pre-process-dapm.c topology: pre-processor: Move the call to expand variables 2021-12-19 20:32:38 +01:00
pre-process-external.h topology: add simple topology plugin mechanism 2022-05-03 13:23:36 +02:00
pre-process-object.c topology: pre-process-object: expand variables before validating attributes 2022-01-27 18:32:06 +01:00
pre-processor.c topology: do not pass pre_processor_defs to pre_process_plugins() 2022-05-03 13:24:36 +02:00
pre-processor.h topology: add simple topology plugin mechanism 2022-05-03 13:23:36 +02:00
topology.c topology: fix the comment for improved -D option 2022-01-28 09:29:34 +01:00
topology.h topology: rename function free_pre_preprocessor to free_pre_processor 2022-01-27 15:02:02 +01:00