From 3eb2812fa4ea037a921b66bbed42ad6ca5bb36f7 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 24 Sep 2023 08:54:54 +0300 Subject: [PATCH 38/38] Add error handling for missing musicset name See osdn #48698 Signed-off-by: Marko Lindqvist --- client/music.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/music.c b/client/music.c index 863dbe4399..1155bdf6f1 100644 --- a/client/music.c +++ b/client/music.c @@ -153,6 +153,14 @@ struct section_file *musicspec_load(const char *ms_filename) const char *mstr; mstr = secfile_lookup_str(tagfile, "musicspec.name"); + + if (mstr == NULL) { + log_error(_("Musicset from %s has no name defined!"), ms_filename); + secfile_destroy(tagfile); + + return NULL; + } + /* Musicset name found */ sz_strlcpy(current_ms.name, mstr); -- 2.40.1