diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2019-03-06 19:23:44 +0100 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2019-03-06 10:23:44 -0800 |
commit | 326b25a658e87a122708d5ce1f4d997c1c1730f5 (patch) | |
tree | 2464f0cff7741341a46647595b6bec4b7fab8d6c | |
parent | 5ce4140ca10cdda9af170d5215ff9de295c58a30 (diff) | |
download | coreclr-326b25a658e87a122708d5ce1f4d997c1c1730f5.tar.gz coreclr-326b25a658e87a122708d5ce1f4d997c1c1730f5.tar.bz2 coreclr-326b25a658e87a122708d5ce1f4d997c1c1730f5.zip |
Improve resiliency of LoadIBCMethodHelper (#23057)
The encoded slot could be bogus and we would end up asserting for this.
-rw-r--r-- | src/vm/ceeload.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vm/ceeload.cpp b/src/vm/ceeload.cpp index 6d1643b46e..cd46cffaaa 100644 --- a/src/vm/ceeload.cpp +++ b/src/vm/ceeload.cpp @@ -7442,6 +7442,11 @@ MethodDesc* Module::LoadIBCMethodHelper(DataImage *image, CORBBTPROF_BLOB_PARAM_ DWORD slot; IfFailThrow(p.GetData(&slot)); + if (slot >= pOwnerMT->GetNumVtableSlots()) + { + COMPlusThrow(kTypeLoadException, IDS_IBC_MISSING_EXTERNAL_METHOD); + } + pMethod = pOwnerMT->GetMethodDescForSlot(slot); } else // otherwise we use the normal metadata MethodDef token encoding and we handle ibc tokens. |