From da00d719a77607d8873067902f5db5bff02d0e99 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 4 Nov 2011 09:34:53 -0400 Subject: [PATCH] Windows: NPCancelConnection set correct length The RemoteNameLength passed in the IOCTL_AFS_CANCEL_CONNECTION call must not include the trailing NUL. NPGetConnection() returns the size of the buffer used which does include the trailing NUL. Change-Id: Ic5eae51aade91db4a799bea83d898af6fbc37504 Reviewed-on: http://gerrit.openafs.org/5806 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/npdll/AFS_Npdll.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/WINNT/afsrdr/npdll/AFS_Npdll.c b/src/WINNT/afsrdr/npdll/AFS_Npdll.c index 56e9ef1663..9b889bef74 100644 --- a/src/WINNT/afsrdr/npdll/AFS_Npdll.c +++ b/src/WINNT/afsrdr/npdll/AFS_Npdll.c @@ -912,6 +912,11 @@ NPCancelConnection( LPWSTR lpName, #endif try_return( dwStatus = WN_NOT_CONNECTED); } + + // + // NPGetConnection returns the buffer size not the length without NUL + // + dwRemoteNameLength -= sizeof( WCHAR); } else {