From 5b1472286c4d77354ac413605cc93f10c3e5fc18 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 18 Jan 2022 16:07:38 +0200 Subject: [PATCH 46/46] Fix crash with empty startunits See osdn #43651 Signed-off-by: Marko Lindqvist --- server/settings.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/settings.c b/server/settings.c index 81e47a74e4..74f9f5d12f 100644 --- a/server/settings.c +++ b/server/settings.c @@ -973,6 +973,10 @@ static bool startunits_callback(const char *value, Unit_Class_id first_role; bool firstnative = FALSE; + if (len == 0) { + return TRUE; + } + /* We check each character individually to see if it's valid. */ for (i = 0; i < len; i++) { if (strchr("cwxksfdDaA", value[i])) { -- 2.34.1