From: Jeffrey Altman Date: Tue, 19 Jul 2005 06:06:59 +0000 (+0000) Subject: STABLE14-windows-explorer-remove-mountpt-fix-20050719 X-Git-Tag: openafs-devel-1_3_86~21 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=20307db49d3e1b2b069299d11bcea44f6d52cfe4;p=packages%2Fo%2Fopenafs.git STABLE14-windows-explorer-remove-mountpt-fix-20050719 FIXES 20137 the gui version of fs rmmount was reading random memory. (cherry picked from commit fb1b339a017936da78e13d4afbeaebcfaa29ef00) --- diff --git a/src/WINNT/client_exp/gui2fs.cpp b/src/WINNT/client_exp/gui2fs.cpp index 64a2d1c26..efc706197 100644 --- a/src/WINNT/client_exp/gui2fs.cpp +++ b/src/WINNT/client_exp/gui2fs.cpp @@ -1236,6 +1236,7 @@ BOOL IsMountPoint(const char * name) char lsbuffer[1024]; register char *tp; char szCurItem[1024]; + strcpy(szCurItem, name); tp = (char *)strrchr(szCurItem, '\\'); @@ -1274,6 +1275,7 @@ BOOL RemoveMount(CStringArray& files) char tbuffer[1024]; char lsbuffer[1024]; register char *tp; + char szCurItem[1024]; BOOL error = FALSE; CStringArray results; CString str; @@ -1291,6 +1293,20 @@ BOOL RemoveMount(CStringArray& files) continue; // don't bother trying } + strcpy(szCurItem, files[i]); + + tp = (char *)strrchr(szCurItem, '\\'); + if (tp) { + strncpy(tbuffer, szCurItem, code = tp - szCurItem + 1); /* the dir name */ + tbuffer[code] = 0; + tp++; /* skip the slash */ + } else { + fs_ExtractDriveLetter(szCurItem, tbuffer); + strcat(tbuffer, "."); + tp = szCurItem; + fs_StripDriveLetter(tp, tp, 0); + } + blob.out_size = 0; blob.in = tp; blob.in_size = strlen(tp)+1;