瀏覽代碼

Stack: Avoid double free/heap use after free

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14567

Credit to oss-fuzz
Stefan Profanter 5 年之前
父節點
當前提交
d31ae132ad
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      plugins/ua_accesscontrol_default.c

+ 2 - 0
plugins/ua_accesscontrol_default.c

@@ -196,6 +196,8 @@ static void deleteMembers_default(UA_AccessControl *ac) {
     UA_Array_delete((void*)(uintptr_t)ac->userTokenPolicies,
                     ac->userTokenPoliciesSize,
                     &UA_TYPES[UA_TYPES_USERTOKENPOLICY]);
+	ac->userTokenPolicies = NULL;
+	ac->userTokenPoliciesSize = 0;
 
     AccessControlContext *context = (AccessControlContext*)ac->context;