From: matt@linuxbox.com Date: Tue, 25 May 2010 00:26:46 +0000 (-0400) Subject: windows handle NONODE case uniformly in cm_BPlusDirDeleteEntry X-Git-Tag: openafs-devel-1_5_75~241 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c8261c63f9e804b62172b48d676d5be03620de2a;p=packages%2Fo%2Fopenafs.git windows handle NONODE case uniformly in cm_BPlusDirDeleteEntry Fix handling of a NONODE case in cm_BPlusDirDeleteEntry. Previously in this case, the routine referenced uninitialized memory. Change-Id: Ic3e3520b4c28ccc52e04486777bdcf0c5e54ef1f Change-Id: Id57a72112caf55b4b84ed64f709b8b73c72b7866 Reviewed-on: http://gerrit.openafs.org/2017 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_btree.c b/src/WINNT/afsd/cm_btree.c index 733793427..a9329a471 100644 --- a/src/WINNT/afsd/cm_btree.c +++ b/src/WINNT/afsd/cm_btree.c @@ -1901,20 +1901,19 @@ int cm_BPlusDirDeleteEntry(cm_dirOp_t * op, clientchar_t *centry) rc = CM_ERROR_INEXACT_MATCH; } else { rc = CM_ERROR_AMBIGUOUS_FILENAME; - } - } - + } - if (rc != CM_ERROR_AMBIGUOUS_FILENAME) { - dfid.vnode = htonl(fid.vnode); - dfid.unique = htonl(fid.unique); - cm_Gen8Dot3NameIntW(centry, &dfid, shortName, NULL); + if (rc != CM_ERROR_AMBIGUOUS_FILENAME) { + dfid.vnode = htonl(fid.vnode); + dfid.unique = htonl(fid.unique); + cm_Gen8Dot3NameIntW(centry, &dfid, shortName, NULL); - /* delete first the long name and then the short name */ - delete(op->scp->dirBplus, key); - key.name = shortName; - delete(op->scp->dirBplus, key); - } + /* delete first the long name and then the short name */ + delete(op->scp->dirBplus, key); + key.name = shortName; + delete(op->scp->dirBplus, key); + } + } /* !NONODE */ } else { clientchar_t * cname = NULL;