Avoid passing null pointer from empty span to CreateSymmetricKey#120392
Avoid passing null pointer from empty span to CreateSymmetricKey#120392xtqqczze wants to merge 1 commit intodotnet:mainfrom
CreateSymmetricKey#120392Conversation
|
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
|
What exactly is this addressing? Is there a missing test? |
|
The code above this should guarantee that the Span is never |
We then call runtime/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs Lines 289 to 295 in d6adddf |
The span length is never zero though. On line 85 and 35 the span is set to |
Yes you are right, in the |
The existing code has an implicit call to
symmetricKeyMaterial.GetPinnableReference(), which returns a null reference for_length == 0.