From: Nickolai Zeldovich Date: Mon, 4 Mar 2013 02:14:22 +0000 (-0500) Subject: afscp: Fix check for bare root.cell dirs in dynroot mode X-Git-Tag: upstream/1.8.0_pre1^2~1365 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=fe9f4a93183c972225541b1ebf5ed5b5f484adff;p=packages%2Fo%2Fopenafs.git afscp: Fix check for bare root.cell dirs in dynroot mode A previous fix (git commit fb1d7491fbe2e90300b23284f213cac2bdcd56ac) added a check for '!p' in gettoproot(), but p is always a non-NULL pointer (in part since it's dereferenced just above in the code), so the check is always false. Instead, I suspect the original author intended to check for '!*p', which this patch does. Change-Id: I1c0a2dd1d582a6b5e82275db18474343efa679a2 Reviewed-on: http://gerrit.openafs.org/9337 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/src/libafscp/afscp_dir.c b/src/libafscp/afscp_dir.c index b3d42b1c9..f5470f5bd 100644 --- a/src/libafscp/afscp_dir.c +++ b/src/libafscp/afscp_dir.c @@ -370,7 +370,7 @@ gettoproot(struct afscp_cell *cell, char *p, char **q, r = p; while (*r && *r != '/') r++; - if (!*r && !p) { + if (!*r && !*p) { afscp_errno = ENODEV; return 1; }