Reduce the nullability bypasses in CryptoPool.Return#55782
Reduce the nullability bypasses in CryptoPool.Return#55782stephentoub merged 2 commits intodotnet:mainfrom
Conversation
This is a walk over src/libraries/.../*.cs to find any calls to CryptoPool.Return which needed a "!" because of nullability flow. A couple of the bypasses were identifying legitimate issues, and were resolved by moving the Rent to the last thing before the try. A couple were because of the use of ArraySegment which can't structurally promise the array is non-null. But those were usually preceded by a call to ZeroMemory, and there is a CryptoPool.Return(ArraySegment) which does that already, so those "!"s were removed by changing to that overload.
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue DetailsThis is a walk over src/libraries/.../*.cs to find any calls to A couple of the bypasses were identifying legitimate issues, A couple were because of the use of ArraySegment which
|
|
This was the followup promised from #54282 (comment). |
Co-authored-by: Stephen Toub <stoub@microsoft.com>
This is a walk over src/libraries/.../*.cs to find any calls to
CryptoPool.Return which needed a "!" because of nullability
flow.
A couple of the bypasses were identifying legitimate issues,
and were resolved by moving the Rent to the last thing before
the try.
A couple were because of the use of ArraySegment which
can't structurally promise the array is non-null. But those
were usually preceded by a call to ZeroMemory, and there
is a CryptoPool.Return(ArraySegment) which does that
already, so those "!"s were removed by changing to that
overload.