Windows: NPCancelConnection set correct length
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 4 Nov 2011 13:34:53 +0000 (09:34 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 4 Nov 2011 22:39:06 +0000 (15:39 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsrdr/npdll/AFS_Npdll.c

index 56e9ef1..9b889be 100644 (file)
@@ -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
         {