From 2e7939ea4653ba3634445b1710aed1206f44f7ca Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Tue, 24 Jul 2012 23:54:56 -0400 Subject: [PATCH 1/1] 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 --- src/kauth/authclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index c3d400c..10bef97 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)); -- 1.9.4