[SHIMENG] Prevent a nullptr dereference
authorMark Jansen <mark.jansen@reactos.org>
Thu, 3 Jan 2019 21:17:01 +0000 (22:17 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 5 Jan 2019 12:11:35 +0000 (13:11 +0100)
dll/appcompat/apphelp/shimeng.c

index 0351ac3..3520266 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * PROJECT:     ReactOS Application compatibility module
- * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
+ * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
  * PURPOSE:     Shim engine core
- * COPYRIGHT:   Copyright 2015-2018 Mark Jansen (mark.jansen@reactos.org)
+ * COPYRIGHT:   Copyright 2015-2019 Mark Jansen (mark.jansen@reactos.org)
  */
 
 #define WIN32_NO_STATUS
@@ -585,7 +585,8 @@ VOID SeiAddHooks(PHOOKAPIEX hooks, DWORD dwHookCount, PSHIMINFO pShim)
             }
         }
         pHookApi = ARRAY_Append(&HookModuleInfo->HookApis, PHOOKAPIEX);
-        *pHookApi = hook;
+        if (pHookApi)
+            *pHookApi = hook;
     }
 }