dovecot-2.0: setting_parse_environ(): Don't crash if environ=NULL.

dovecot at dovecot.org dovecot at dovecot.org
Fri Aug 14 21:18:22 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/26a351f8ed07
changeset: 9791:26a351f8ed07
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Aug 14 14:18:15 2009 -0400
description:
setting_parse_environ(): Don't crash if environ=NULL.

diffstat:

1 file changed, 3 insertions(+)
src/lib-settings/settings-parser.c |    3 +++

diffs (13 lines):

diff -r a13837027b29 -r 26a351f8ed07 src/lib-settings/settings-parser.c
--- a/src/lib-settings/settings-parser.c	Fri Aug 14 13:14:25 2009 -0400
+++ b/src/lib-settings/settings-parser.c	Fri Aug 14 14:18:15 2009 -0400
@@ -569,6 +569,9 @@ int settings_parse_environ(struct settin
 	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[] */


More information about the dovecot-cvs mailing list