This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
src/System.IO.Pipes/src/System/IO/Pipes Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,6 @@ private void ValidateRemotePipeIsCurrentUser()
138138 {
139139 SecurityIdentifier currentUserSid = GetCurrentUser ( ) ;
140140 PipeSecurity accessControl = this . GetAccessControl ( ) ;
141-
142141 IdentityReference remoteOwnerSid = accessControl . GetOwner ( typeof ( SecurityIdentifier ) ) ;
143142 if ( remoteOwnerSid != currentUserSid )
144143 {
Original file line number Diff line number Diff line change @@ -425,11 +425,14 @@ internal static unsafe Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(HandleIn
425425 secAttrs . bInheritHandle = Interop . BOOL . TRUE ;
426426 }
427427
428- byte [ ] securityDescriptor = pipeSecurity . GetSecurityDescriptorBinaryForm ( ) ;
429- pinningHandle = GCHandle . Alloc ( securityDescriptor , GCHandleType . Pinned ) ;
430- fixed ( byte * pSecurityDescriptor = securityDescriptor )
428+ if ( pipeSecurity != null )
431429 {
432- secAttrs . lpSecurityDescriptor = ( IntPtr ) pSecurityDescriptor ;
430+ byte [ ] securityDescriptor = pipeSecurity . GetSecurityDescriptorBinaryForm ( ) ;
431+ pinningHandle = GCHandle . Alloc ( securityDescriptor , GCHandleType . Pinned ) ;
432+ fixed ( byte * pSecurityDescriptor = securityDescriptor )
433+ {
434+ secAttrs . lpSecurityDescriptor = ( IntPtr ) pSecurityDescriptor ;
435+ }
433436 }
434437 }
435438
You can’t perform that action at this time.
0 commit comments