config: expand_brackets_string tolerates null values

This commit is contained in:
Nikos Mavrogiannopoulos
2015-02-27 14:00:15 +01:00
parent 01fd48f093
commit c80c8dc15b

View File

@@ -38,6 +38,9 @@ unsigned expand_brackets_string(struct cfg_st *config, const char *str, subcfg_v
unsigned len, len2; unsigned len, len2;
unsigned pos = 0, finish = 0; unsigned pos = 0, finish = 0;
if (str == NULL)
return 0;
p = strchr(str, '['); p = strchr(str, '[');
if (p == NULL) { if (p == NULL) {
return 0; return 0;