projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f1412e
)
[mono] Copy image data with AssemblyLoadContext.LoadFromStream (#43592)
author
Ryan Lucia
<rylucia@microsoft.com>
Wed, 21 Oct 2020 15:32:53 +0000
(11:32 -0400)
committer
GitHub
<noreply@github.com>
Wed, 21 Oct 2020 15:32:53 +0000
(11:32 -0400)
We don't actually pin the byte array, so it must be copied or it can be overwritten once we run a GC on the LOH.
Fixes https://github.com/dotnet/runtime/issues/43402
Tested manually that it fixes the issue using the associated repro. This isn't really something that lends itself to a test, so that's the best I can do.
src/mono/mono/metadata/appdomain.c
patch
|
blob
|
history
diff --git
a/src/mono/mono/metadata/appdomain.c
b/src/mono/mono/metadata/appdomain.c
index
397045a
..
a14b98d
100644
(file)
--- a/
src/mono/mono/metadata/appdomain.c
+++ b/
src/mono/mono/metadata/appdomain.c
@@
-2832,7
+2832,7
@@
mono_alc_load_raw_bytes (MonoAssemblyLoadContext *alc, guint8 *assembly_data, gu
{
MonoAssembly *ass = NULL;
MonoImageOpenStatus status;
- MonoImage *image = mono_image_open_from_data_internal (alc, (char*)assembly_data, raw_assembly_len,
FALS
E, NULL, refonly, FALSE, NULL, NULL);
+ MonoImage *image = mono_image_open_from_data_internal (alc, (char*)assembly_data, raw_assembly_len,
TRU
E, NULL, refonly, FALSE, NULL, NULL);
if (!image) {
mono_error_set_bad_image_by_name (error, "In memory assembly", "0x%p", assembly_data);