[loader] Don't store through a null ptr (#14110)
commit7ba1f77f6da6375bd941b6bac0bbab3bb30ddd6b
authorAleksey Kliger (λgeek) <akliger@gmail.com>
Fri, 19 Apr 2019 19:57:31 +0000 (19 15:57 -0400)
committerGitHub <noreply@github.com>
Fri, 19 Apr 2019 19:57:31 +0000 (19 15:57 -0400)
tree740eb9e5277f070b6d72c1ade4f8f0bd2e19c52f
parent1bdffd21cbd9873a04b6d4f399259a563c8a1e97
[loader] Don't store through a null ptr (#14110)

* [loader] Dont't store through a null ptr

If 'status' is null, don't try to write to it.

Fixes https://github.com/mono/mono/issues/13941

* [metadata] Protect writes to MonoImageOpenStatus* in a few places.

When possible assert that `MonoImageOpenStatus *status` arguments to various
functions in the runtime aren't null.  There are a few places (MONO_API) where
it's possible that callers are passing null.  In that case, use a local
MonoImageOpenStatus, or check for null before doing assignments.
mono/metadata/assembly.c
mono/metadata/image.c