:: commit 17904009add682b470c0f01750e76d3e76a8cf53

mintsuki <mintsuki@protonmail.com> — 2024-04-19 21:42

parents: 72b9fcbb4c

config: Fix missing NULL check in init_config()

diff --git a/common/lib/config.c b/common/lib/config.c
index cb64e871..4e9d86a6 100644
--- a/common/lib/config.c
+++ b/common/lib/config.c
@@ -344,11 +344,13 @@ overflow:
 
     size_t s;
     char *c = config_get_entry(&s, 0);
-    while (*c != ':') {
-        c--;
-    }
-    if (c > config_addr) {
-        c[-1] = 0;
+    if (c != NULL) {
+        while (*c != ':') {
+            c--;
+        }
+        if (c > config_addr) {
+            c[-1] = 0;
+        }
     }
 
     return 0;
tab: 248 wrap: offon