From: Timo Sirainen Date: Fri, 14 Aug 2009 18:18:15 +0000 (-0400) Subject: setting_parse_environ(): Don't crash if environ=NULL. X-Git-Tag: 2.0.alpha1~261 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5d91745fc7a8fd1a647935b238f4db5ac142b9c;p=thirdparty%2Fdovecot%2Fcore.git setting_parse_environ(): Don't crash if environ=NULL. --HG-- branch : HEAD --- 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[] */