From 759fd72dc6866b2c89eddd8940bb4b2040699f23 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 19 Dec 2024 12:38:42 +0200 Subject: [PATCH] MT#55283 Prevent warning logs when recording-method is pcap If recording-method is pcap, then proc is zero-initialized, so meta_filepath is empty. This shows many logs such as: [core] Failed to open recording metadata file '(null)' for writing: Bad address Prevent them by returning earlier. Closes #1889 Change-Id: Ifeb3038f9a5c0bd6a9b7dd92842dd61783b40263 --- daemon/recording.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/recording.c b/daemon/recording.c index 1bd9ca586..73a6dd8bc 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -847,6 +847,8 @@ static int append_meta_chunk(struct recording *recording, const char *buf, unsig const char *label_fmt, ...) { va_list ap; + if (!recording->proc.meta_filepath) + return -1; va_start(ap, label_fmt); int ret = vappend_meta_chunk(recording, buf, buflen, label_fmt, ap); va_end(ap);