From 9ff16d3668ecca4829de4fd71c56ebe2b02d316e Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 20 Nov 2023 11:24:08 +0100 Subject: irmd: Fix parsing names without args in configfile Config files that had service names without the args option specified would cause the IRMd to segfault. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- CMakeLists.txt | 2 +- src/irmd/configfile.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa134283..aa1b2bc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ include(GNUInstallDirs) set(PACKAGE_VERSION_MAJOR 0) set(PACKAGE_VERSION_MINOR 20) -set(PACKAGE_VERSION_PATCH 1) +set(PACKAGE_VERSION_PATCH 2) set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(PACKAGE_DESCRIPTION "The Ouroboros prototype") diff --git a/src/irmd/configfile.c b/src/irmd/configfile.c index 38a24433..42a8a152 100644 --- a/src/irmd/configfile.c +++ b/src/irmd/configfile.c @@ -564,6 +564,11 @@ static int args_to_argv(const char * args, char * str; int argc = 0; + if (args == NULL) { + *argv = NULL; + return 0; + } + str = (char *) args; tok = strtok(str, " "); -- cgit v1.2.3