Skip to content
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

[release/9.0] Ensure a null PublicKey is supported on assembly refs #108928

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/coreclr/md/compiler/importhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3174,6 +3174,8 @@ ImportHelper::CreateAssemblyRefFromAssembly(
mdAssemblyRef tkAssemRef;
HRESULT hr = S_OK;
StrongNameToken token;
const void *pbToken = NULL;
ULONG cbToken = 0;
ULONG i;

// Set output to Nil.
Expand All @@ -3193,6 +3195,9 @@ ImportHelper::CreateAssemblyRefFromAssembly(
IfFailGo(StrongNameTokenFromPublicKey((BYTE*)pbPublicKey,
cbPublicKey,
&token));

pbToken = &token;
cbToken = StrongNameToken::SIZEOF_TOKEN;
}
else
_ASSERTE(!IsAfPublicKey(dwFlags));
Expand All @@ -3209,8 +3214,8 @@ ImportHelper::CreateAssemblyRefFromAssembly(
continue;

// See if the AssemblyRef already exists in the emit scope.
hr = FindAssemblyRef(pMiniMdEmit, szName, szLocale, &token,
StrongNameToken::SIZEOF_TOKEN, usMajorVersion, usMinorVersion,
hr = FindAssemblyRef(pMiniMdEmit, szName, szLocale, pbToken,
cbToken, usMajorVersion, usMinorVersion,
usBuildNumber, usRevisionNumber, dwFlags,
&tkAssemRef);
if (hr == CLDB_E_RECORD_NOTFOUND)
Expand Down
Loading