]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Application/IpsecConfig/PolicyEntryOperation.c
Add check before using it to avoid access violation.
[mirror_edk2.git] / NetworkPkg / Application / IpsecConfig / PolicyEntryOperation.c
index 05df9fa9198ee1e839a4907d017930cec8630f8e..7e04573022a49d7957d3b58216874c2d58eab3f3 100644 (file)
@@ -814,6 +814,7 @@ CreateSadEntry (
   if (ValueStr != NULL) {\r
     (*Data)->AlgoInfo.EspAlgoInfo.AuthKeyLength = AuthKeyLength;\r
     AsciiStr = AllocateZeroPool (AuthKeyLength + 1);\r
+    ASSERT (AsciiStr != NULL);\r
     UnicodeStrToAsciiStr (ValueStr, AsciiStr);\r
     CopyMem ((*Data)->AlgoInfo.EspAlgoInfo.AuthKey, AsciiStr, AuthKeyLength);\r
     FreePool (AsciiStr);\r