-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NamedPipeClientStream Connect can use uninitialized _normalizedPipePath #32760
Comments
I also noticed we do not have any I wonder if it's possible to retrieve the path of a named pipe from only a |
I did some digging. The combination of passing a Also if I will add an |
* Check that isConnected in the NamedPipeClientStream constructor is always true. * Added an argument test. Fixes dotnet#32760
* Created a new constructor without the argument. * Marked the old constructor as obsolete. Fixes dotnet#32760
* Check that isConnected in the NamedPipeClientStream constructor is always true. * Added an argument test. Fixes dotnet#32760
* Created a new constructor without the argument. * Marked the old constructor as obsolete. Fixes dotnet#32760
When adding nullable annotations for System.Net.Sockets (#32675), it was discovered that there is a scenario when using
NamedPipeClientStream
can use a null string:When calling
NamedPipeClientStream.Connect
on Unix, it will try using the_normalizedPipePath
string:runtime/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs
Lines 21 to 31 in 032e8db
However, if the
NamedPipeClientStream
object was created with the constructor that takes an existingSafePipeHandle
andisConnected: false
, then_normalizedPipePath
will benull
.runtime/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs
Lines 101 to 103 in 032e8db
Doing some searching, I'm honestly not certain how this scenario (existing
SafePipeHandle
andisConnected: false
) can ever work successfully. It will need apath
to be able to connect to, which it wasn't given. So at best we may be able to throw a better exception than theArgumentNullException
we get:/cc @stephentoub
The text was updated successfully, but these errors were encountered: