From: Jeffrey Altman Date: Fri, 4 Nov 2011 13:34:53 +0000 (-0400) Subject: Windows: NPCancelConnection set correct length X-Git-Tag: upstream/1.8.0_pre1^2~3082 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=da00d719a77607d8873067902f5db5bff02d0e99;p=packages%2Fo%2Fopenafs.git 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 --- diff --git a/src/WINNT/afsrdr/npdll/AFS_Npdll.c b/src/WINNT/afsrdr/npdll/AFS_Npdll.c index 56e9ef166..9b889bef7 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 {