Windows: AFSRetrieveFileAttributes no parent path
[openafs.git] / src / WINNT / afsrdr / kernel / lib / AFSGeneric.cpp
index 2594416..5ad8fe6 100644 (file)
@@ -5778,22 +5778,26 @@ AFSRetrieveFileAttributes( IN AFSDirectoryCB *ParentDirectoryCB,
             RtlZeroMemory( uniFullPathName.Buffer,
                            uniFullPathName.MaximumLength);
 
-            RtlCopyMemory( uniFullPathName.Buffer,
-                           ParentPathName->Buffer,
-                           ParentPathName->Length);
+           if ( ParentPathName->Length > 0)
+           {
 
-            uniFullPathName.Length = ParentPathName->Length;
+               RtlCopyMemory( uniFullPathName.Buffer,
+                              ParentPathName->Buffer,
+                              ParentPathName->Length);
 
-            if( uniFullPathName.Buffer[ (uniFullPathName.Length/sizeof( WCHAR)) - 1] != L'\\' &&
-                DirectoryCB->NameInformation.TargetName.Buffer[ 0] != L'\\')
-            {
+               uniFullPathName.Length = ParentPathName->Length;
+
+               if( uniFullPathName.Buffer[ (uniFullPathName.Length/sizeof( WCHAR)) - 1] != L'\\' &&
+                   DirectoryCB->NameInformation.TargetName.Buffer[ 0] != L'\\')
+               {
 
-                uniFullPathName.Buffer[ uniFullPathName.Length/sizeof( WCHAR)] = L'\\';
+                   uniFullPathName.Buffer[ uniFullPathName.Length/sizeof( WCHAR)] = L'\\';
 
-                uniFullPathName.Length += sizeof( WCHAR);
-            }
+                   uniFullPathName.Length += sizeof( WCHAR);
+               }
+           }
 
-            RtlCopyMemory( &uniFullPathName.Buffer[ uniFullPathName.Length/sizeof( WCHAR)],
+           RtlCopyMemory( &uniFullPathName.Buffer[ uniFullPathName.Length/sizeof( WCHAR)],
                            DirectoryCB->NameInformation.TargetName.Buffer,
                            DirectoryCB->NameInformation.TargetName.Length);