Set ASN1_OBJECT_FLAG_DYNAMIC_DATA flag with t2i_ASN1_OBJECT_internal
authorinoguchi <inoguchi@openbsd.org>
Sun, 10 Apr 2022 12:42:33 +0000 (12:42 +0000)
committerinoguchi <inoguchi@openbsd.org>
Sun, 10 Apr 2022 12:42:33 +0000 (12:42 +0000)
'flags' should have ASN1_OBJECT_FLAG_DYNAMIC_DATA bit to free 'data'
by ASN1_OBJECT_free as c2i_ASN1_OBJECT_cbs does.

ok jsing@ tb@

lib/libcrypto/asn1/a_object.c

index 0cf6499..c6e4c77 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: a_object.c,v 1.45 2022/03/26 14:54:58 jsing Exp $ */
+/* $OpenBSD: a_object.c,v 1.46 2022/04/10 12:42:33 inoguchi Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -482,6 +482,7 @@ t2i_ASN1_OBJECT_internal(const char *oid)
 
        aobj->data = data;
        aobj->length = (int)data_len;
+       aobj->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA;
        data = NULL;
 
  err: