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;
