From: Garrett Wollman Date: Wed, 25 Jul 2012 03:54:56 +0000 (-0400) Subject: kauth: don't call lcstring with a null source argument X-Git-Tag: upstream/1.8.0_pre1^2~2155 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2e7939ea4653ba3634445b1710aed1206f44f7ca;p=packages%2Fo%2Fopenafs.git kauth: don't call lcstring with a null source argument This code was probably never executed, but now that lcstring() has an AFS_NONNULL annotation, the static analyzer indicates the potential null-pointer-dereference. Change-Id: Idb41c2af1cb38bc5c084d4912614e0a553d4aa5a Reviewed-on: http://gerrit.openafs.org/7864 Tested-by: BuildBot Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear --- diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index c3d400ca4..10bef97e2 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -104,8 +104,8 @@ ka_GetServers(char *cell, struct afsconf_cell * cellinfo) char cellname[MAXKTCREALMLEN]; LOCK_GLOBAL_MUTEX; - if (cell && !strlen(cell)) - cell = 0; + if (cell == NULL || strlen(cell) == 0) + cell = NULL; else cell = lcstring(cellname, cell, sizeof(cellname));