From c8261c63f9e804b62172b48d676d5be03620de2a Mon Sep 17 00:00:00 2001 From: "matt@linuxbox.com" Date: Mon, 24 May 2010 20:26:46 -0400 Subject: [PATCH] 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 --- src/WINNT/afsd/cm_btree.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) 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; -- 2.39.5