From fed61968a113bd37b196bb86d9f2591d53b15162 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 9 Oct 2021 17:20:06 +0200 Subject: [PATCH 1/1] audiod: Use para_malloc(). If the allocation fails we feed NULL to strncpy(3) which should result in a segfault. With para_malloc() a clear error message will be shown instead. Found by gcc's -fanalyzer option. --- audiod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiod.c b/audiod.c index a5a77437..88599c3f 100644 --- a/audiod.c +++ b/audiod.c @@ -801,7 +801,7 @@ static int parse_stream_command(const char *txt, const char **cmd) return -E_MISSING_COLON; *cmd = p + 1; len = p - txt; - re = malloc(len + 1); + re = para_malloc(len + 1); strncpy(re, txt, len); re[len] = '\0'; ret = get_matching_audio_format_nums(re); -- 2.39.2