提交 9d043701 编写于 作者: U UnityAlex 提交者: spatil

Attempting to guard against MONO_HANDLE_IS_NULL performing a null deref while...

Attempting to guard against MONO_HANDLE_IS_NULL performing a null deref while checking for null. Sourced from: https://github.com/mono/mono/pull/9188 blindfix for case 1232819
上级 bccf3936
......@@ -365,7 +365,7 @@ void mono_handle_verify (MonoRawHandle handle);
#define MONO_HANDLE_CAST(TYPE, VALUE) (TYPED_HANDLE_NAME(TYPE))( VALUE )
#define MONO_HANDLE_IS_NULL(HANDLE) (MONO_HANDLE_SUPPRESS (MONO_HANDLE_RAW(HANDLE) == NULL))
#define MONO_HANDLE_IS_NULL(HANDLE) (mono_handle_is_null (HANDLE))
/*
......@@ -491,6 +491,13 @@ Init values to it.
*/
extern const MonoObjectHandle mono_null_value_handle;
static inline gboolean
mono_handle_is_null (MonoRawHandle handle)
{
// Double NULL check is required for this to work with NULL_HANDLE.
return !(handle && MONO_HANDLE_SUPPRESS (MONO_HANDLE_RAW((MonoObjectHandle)handle)));
}
static inline void
mono_handle_assign (MonoObjectHandleOut dest, MonoObjectHandle src)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册