projects
/
platform
/
upstream
/
coreclr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ce4140
)
Improve resiliency of LoadIBCMethodHelper (#23057)
author
Michal Strehovský
<MichalStrehovsky@users.noreply.github.com>
Wed, 6 Mar 2019 18:23:44 +0000
(19:23 +0100)
committer
Jan Kotas
<jkotas@microsoft.com>
Wed, 6 Mar 2019 18:23:44 +0000
(10:23 -0800)
The encoded slot could be bogus and we would end up asserting for this.
src/vm/ceeload.cpp
patch
|
blob
|
history
diff --git
a/src/vm/ceeload.cpp
b/src/vm/ceeload.cpp
index
6d1643b
..
cd46cff
100644
(file)
--- 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.