From 7b5f27f944ad773a45f1d47fa9b8962097999783 Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Thu, 3 Oct 2013 21:42:10 -0400 Subject: [PATCH] auth: prevent uninitialized key list in AFS config _afsconf_OpenInternal() may exit early for a number of reasons before properly initalizing afsconf_dir->listKeys. This leads to a crash when _afsconf_CloseInternal() attempts to clean up listKeys. Prevent this situation by calling afsconf_InitKeys() before any possible exit from _afsconf_OpenInternal(). Change-Id: I6911427817a2518a576c00a7ea56351f9fb4fd19 Reviewed-on: http://gerrit.openafs.org/10323 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Derrick Brashear --- src/auth/cellconfig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 14c03b436..2509ec761 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -632,6 +632,9 @@ afsconf_OpenInternal(struct afsconf_dir *adir, char *cell, cm_enumCellRegistry_t enumCellRegistry = {0, 0}; #endif /* AFS_NT40_ENV */ + /* init the keys queue before any call to afsconf_CloseInternal() */ + _afsconf_InitKeys(adir); + /* figure out the local cell name */ #ifdef AFS_NT40_ENV i = GetCellNT(adir); @@ -667,9 +670,6 @@ afsconf_OpenInternal(struct afsconf_dir *adir, char *cell, return -1; } - /* init the keys queue before any call to afsconf_CloseInternal() */ - _afsconf_InitKeys(adir); - /* The CellServDB file is now open. * The following code parses the contents of the * file and creates a list with the first cell entry -- 2.39.5