From: amosjeffries <> Date: Tue, 23 Oct 2007 05:35:32 +0000 (+0000) Subject: Close several unsafe control paths after fatalf() X-Git-Tag: SQUID_3_0_STABLE1~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ad8d199e67c3cc2d5e6e2b3e13678d4fc3462db;p=thirdparty%2Fsquid.git Close several unsafe control paths after fatalf() Coverity Identified. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index f882665a2b..2c454ebd9b 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.522 2007/10/22 23:33:28 amosjeffries Exp $ + * $Id: cache_cf.cc,v 1.523 2007/10/22 23:35:32 amosjeffries Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -560,7 +560,7 @@ configDoConfigure(void) struct passwd *pwd = getpwnam(Config.effectiveUser); - if (NULL == pwd) + if (NULL == pwd) { /* * Andres Kroonmaa : * Some getpwnam() implementations (Solaris?) require @@ -572,6 +572,8 @@ configDoConfigure(void) */ fatalf("getpwnam failed to find userid for effective user '%s'", Config.effectiveUser); + return; + } Config2.effectiveUserID = pwd->pw_uid; @@ -598,9 +600,11 @@ configDoConfigure(void) struct group *grp = getgrnam(Config.effectiveGroup); - if (NULL == grp) + if (NULL == grp) { fatalf("getgrnam failed to find groupid for effective group '%s'", Config.effectiveGroup); + return; + } Config2.effectiveGroupID = grp->gr_gid; }