Browse Source

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 years ago
parent
commit
d31ae132ad
1 changed files with 2 additions and 0 deletions
  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;