From d5d91745fc7a8fd1a647935b238f4db5ac142b9c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 14 Aug 2009 14:18:15 -0400 Subject: [PATCH] setting_parse_environ(): Don't crash if environ=NULL. --HG-- branch : HEAD --- src/lib-settings/settings-parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib-settings/settings-parser.c b/src/lib-settings/settings-parser.c index 0c9be5eb63..d66b1a8e2e 100644 --- a/src/lib-settings/settings-parser.c +++ b/src/lib-settings/settings-parser.c @@ -569,6 +569,9 @@ int settings_parse_environ(struct setting_parser_context *ctx) unsigned int i, count; int ret = 0; + if (environ == NULL) + return 0; + /* sort the settings first. this is necessary for putenv() implementations (e.g. valgrind) which change the order of strings in environ[] */ -- 2.47.3