Bug Summary

File:out/../deps/openssl/openssl/crypto/asn1/a_object.c
Warning:line 166, column 24
Assigned value is garbage or undefined

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name a_object.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/maurizio/node-v18.6.0/out -resource-dir /usr/local/lib/clang/16.0.0 -D V8_DEPRECATION_WARNINGS -D V8_IMMINENT_DEPRECATION_WARNINGS -D _GLIBCXX_USE_CXX11_ABI=1 -D NODE_OPENSSL_CONF_NAME=nodejs_conf -D NODE_OPENSSL_HAS_QUIC -D __STDC_FORMAT_MACROS -D OPENSSL_NO_PINSHARED -D OPENSSL_THREADS -D OPENSSL_NO_HW -D OPENSSL_API_COMPAT=0x10100001L -D STATIC_LEGACY -D NDEBUG -D OPENSSL_USE_NODELETE -D L_ENDIAN -D OPENSSL_BUILDING_OPENSSL -D AES_ASM -D BSAES_ASM -D CMLL_ASM -D ECP_NISTZ256_ASM -D GHASH_ASM -D KECCAK1600_ASM -D MD5_ASM -D OPENSSL_BN_ASM_GF2m -D OPENSSL_BN_ASM_MONT -D OPENSSL_BN_ASM_MONT5 -D OPENSSL_CPUID_OBJ -D OPENSSL_IA32_SSE2 -D PADLOCK_ASM -D POLY1305_ASM -D SHA1_ASM -D SHA256_ASM -D SHA512_ASM -D VPAES_ASM -D WHIRLPOOL_ASM -D X25519_ASM -D OPENSSL_PIC -D MODULESDIR="/home/maurizio/node-v18.6.0/out/Release/obj.target/deps/openssl/lib/openssl-modules" -D OPENSSLDIR="/home/maurizio/node-v18.6.0/out/Release/obj.target/deps/openssl" -D OPENSSLDIR="/etc/ssl" -D ENGINESDIR="/dev/null" -D TERMIOS -I ../deps/openssl/openssl -I ../deps/openssl/openssl/include -I ../deps/openssl/openssl/crypto -I ../deps/openssl/openssl/crypto/include -I ../deps/openssl/openssl/crypto/modes -I ../deps/openssl/openssl/crypto/ec/curve448 -I ../deps/openssl/openssl/crypto/ec/curve448/arch_32 -I ../deps/openssl/openssl/providers/common/include -I ../deps/openssl/openssl/providers/implementations/include -I ../deps/openssl/config -I ../deps/openssl/config/archs/linux-x86_64/asm -I ../deps/openssl/config/archs/linux-x86_64/asm/include -I ../deps/openssl/config/archs/linux-x86_64/asm/crypto -I ../deps/openssl/config/archs/linux-x86_64/asm/crypto/include/internal -I ../deps/openssl/config/archs/linux-x86_64/asm/providers/common/include -internal-isystem /usr/local/lib/clang/16.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-redhat-linux/8/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wno-unused-parameter -Wno-missing-field-initializers -Wno-old-style-declaration -fdebug-compilation-dir=/home/maurizio/node-v18.6.0/out -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2022-08-22-142216-507842-1 -x c ../deps/openssl/openssl/crypto/asn1/a_object.c
1/*
2 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <stdio.h>
11#include <limits.h>
12#include "crypto/ctype.h"
13#include "internal/cryptlib.h"
14#include <openssl/buffer.h>
15#include <openssl/asn1.h>
16#include <openssl/objects.h>
17#include <openssl/bn.h>
18#include "crypto/asn1.h"
19#include "asn1_local.h"
20
21int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
22{
23 unsigned char *p, *allocated = NULL((void*)0);
24 int objsize;
25
26 if ((a == NULL((void*)0)) || (a->data == NULL((void*)0)))
27 return 0;
28
29 objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT6);
30 if (pp == NULL((void*)0) || objsize == -1)
31 return objsize;
32
33 if (*pp == NULL((void*)0)) {
34 if ((p = allocated = OPENSSL_malloc(objsize)CRYPTO_malloc(objsize, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 34)
) == NULL((void*)0)) {
35 ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,35,__func__), ERR_set_error)((13),((256|((0x1 << 18L)|
(0x2 << 18L)))),((void*)0))
;
36 return 0;
37 }
38 } else {
39 p = *pp;
40 }
41
42 ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT6, V_ASN1_UNIVERSAL0x00);
43 memcpy(p, a->data, a->length);
44
45 /*
46 * If a new buffer was allocated, just return it back.
47 * If not, return the incremented buffer pointer.
48 */
49 *pp = allocated != NULL((void*)0) ? allocated : p + a->length;
50 return objsize;
51}
52
53int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
54{
55 int i, first, len = 0, c, use_bn;
56 char ftmp[24], *tmp = ftmp;
57 int tmpsize = sizeof(ftmp);
58 const char *p;
59 unsigned long l;
60 BIGNUM *bl = NULL((void*)0);
61
62 if (num == 0)
1
Assuming 'num' is not equal to 0
2
Taking false branch
63 return 0;
64 else if (num == -1)
3
Assuming the condition is false
4
Taking false branch
65 num = strlen(buf);
66
67 p = buf;
68 c = *(p++);
69 num--;
70 if ((c >= '0') && (c <= '2')) {
5
Assuming the condition is true
6
Assuming the condition is true
7
Taking true branch
71 first = c - '0';
72 } else {
73 ERR_raise(ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,73,__func__), ERR_set_error)((13),(122),((void*)0))
;
74 goto err;
75 }
76
77 if (num <= 0) {
8
Assuming 'num' is > 0
9
Taking false branch
78 ERR_raise(ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,78,__func__), ERR_set_error)((13),(138),((void*)0))
;
79 goto err;
80 }
81 c = *(p++);
82 num--;
83 for (;;) {
10
Loop condition is true. Entering loop body
84 if (num <= 0)
11
Assuming 'num' is > 0
85 break;
86 if ((c != '.') && (c != ' ')) {
12
Assuming the condition is false
87 ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,87,__func__), ERR_set_error)((13),(131),((void*)0))
;
88 goto err;
89 }
90 l = 0;
91 use_bn = 0;
92 for (;;) {
13
Loop condition is true. Entering loop body
21
Loop condition is true. Entering loop body
37
Loop condition is true. Entering loop body
93 if (num
13.1
'num' is > 0
<= 0
)
14
Taking false branch
22
Assuming 'num' is > 0
23
Taking false branch
38
Assuming 'num' is <= 0
39
Taking true branch
94 break;
95 num--;
96 c = *(p++);
97 if ((c == ' ') || (c == '.'))
15
Assuming the condition is false
16
Assuming the condition is false
17
Taking false branch
24
Assuming the condition is false
25
Assuming the condition is false
26
Taking false branch
98 break;
99 if (!ossl_isdigit(c)) {
18
Assuming the condition is false
27
Assuming the condition is false
100 ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,100,__func__), ERR_set_error)((13),(130),((void*)0))
;
101 goto err;
102 }
103 if (!use_bn
18.1
'use_bn' is 0
27.1
'use_bn' is 0
&& l >= ((ULONG_MAX(9223372036854775807L *2UL+1UL) - 80) / 10L)) {
19
Taking false branch
28
Assuming the condition is true
29
Taking true branch
104 use_bn = 1;
105 if (bl
29.1
'bl' is equal to NULL
== NULL((void*)0))
30
Taking true branch
106 bl = BN_new();
107 if (bl == NULL((void*)0) || !BN_set_word(bl, l))
31
Assuming 'bl' is not equal to NULL
32
Assuming the condition is false
33
Taking false branch
108 goto err;
109 }
110 if (use_bn
19.1
'use_bn' is 0
33.1
'use_bn' is 1
) {
20
Taking false branch
111 if (!BN_mul_word(bl, 10L)
34
Assuming the condition is false
36
Taking false branch
112 || !BN_add_word(bl, c - '0'))
35
Assuming the condition is false
113 goto err;
114 } else
115 l = l * 10L + (long)(c - '0');
116 }
117 if (len
40.1
'len' is equal to 0
== 0) {
40
Execution continues on line 117
118 if ((first < 2) && (l >= 40)) {
41
Assuming 'first' is >= 2
119 ERR_raise(ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,119,__func__), ERR_set_error)((13),(147),((void*)0))
;
120 goto err;
121 }
122 if (use_bn
41.1
'use_bn' is 1
) {
42
Taking true branch
123 if (!BN_add_word(bl, first * 40))
43
Assuming the condition is false
44
Taking false branch
124 goto err;
125 } else
126 l += (long)first *40;
127 }
128 i = 0;
129 if (use_bn
44.1
'use_bn' is 1
) {
45
Taking true branch
130 int blsize;
131 blsize = BN_num_bits(bl);
132 blsize = (blsize + 6) / 7;
133 if (blsize > tmpsize) {
46
Assuming 'blsize' is <= 'tmpsize'
47
Taking false branch
134 if (tmp != ftmp)
135 OPENSSL_free(tmp)CRYPTO_free(tmp, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 135)
;
136 tmpsize = blsize + 32;
137 tmp = OPENSSL_malloc(tmpsize)CRYPTO_malloc(tmpsize, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 137)
;
138 if (tmp == NULL((void*)0)) {
139 ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,139,__func__), ERR_set_error)((13),((256|((0x1 << 18L)
|(0x2 << 18L)))),((void*)0))
;
140 goto err;
141 }
142 }
143 while (blsize--) {
48
Loop condition is false. Execution continues on line 159
144 BN_ULONGunsigned long t = BN_div_word(bl, 0x80L);
145 if (t == (BN_ULONGunsigned long)-1)
146 goto err;
147 tmp[i++] = (unsigned char)t;
148 }
149 } else {
150
151 for (;;) {
152 tmp[i++] = (unsigned char)l & 0x7f;
153 l >>= 7L;
154 if (l == 0L)
155 break;
156 }
157
158 }
159 if (out != NULL((void*)0)) {
49
Assuming 'out' is not equal to NULL
50
Taking true branch
160 if (len + i > olen) {
51
Assuming the condition is false
52
Taking false branch
161 ERR_raise(ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,161,__func__), ERR_set_error)((13),(107),((void*)0))
;
162 goto err;
163 }
164 while (--i > 0)
53
Loop condition is false. Execution continues on line 166
165 out[len++] = tmp[i] | 0x80;
166 out[len++] = tmp[0];
54
Assigned value is garbage or undefined
167 } else
168 len += i;
169 }
170 if (tmp != ftmp)
171 OPENSSL_free(tmp)CRYPTO_free(tmp, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 171)
;
172 BN_free(bl);
173 return len;
174 err:
175 if (tmp != ftmp)
176 OPENSSL_free(tmp)CRYPTO_free(tmp, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 176)
;
177 BN_free(bl);
178 return 0;
179}
180
181int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a)
182{
183 return OBJ_obj2txt(buf, buf_len, a, 0);
184}
185
186int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a)
187{
188 char buf[80], *p = buf;
189 int i;
190
191 if ((a == NULL((void*)0)) || (a->data == NULL((void*)0)))
192 return BIO_write(bp, "NULL", 4);
193 i = i2t_ASN1_OBJECT(buf, sizeof(buf), a);
194 if (i > (int)(sizeof(buf) - 1)) {
195 if (i > INT_MAX2147483647 - 1) { /* catch an integer overflow */
196 ERR_raise(ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,196,__func__), ERR_set_error)((13),(231),((void*)0))
;
197 return -1;
198 }
199 if ((p = OPENSSL_malloc(i + 1)CRYPTO_malloc(i + 1, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 199)
) == NULL((void*)0)) {
200 ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,200,__func__), ERR_set_error)((13),((256|((0x1 << 18L)
|(0x2 << 18L)))),((void*)0))
;
201 return -1;
202 }
203 i2t_ASN1_OBJECT(p, i + 1, a);
204 }
205 if (i <= 0) {
206 i = BIO_write(bp, "<INVALID>", 9);
207 i += BIO_dump(bp, (const char *)a->data, a->length);
208 return i;
209 }
210 BIO_write(bp, p, i);
211 if (p != buf)
212 OPENSSL_free(p)CRYPTO_free(p, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 212)
;
213 return i;
214}
215
216ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
217 long length)
218{
219 const unsigned char *p;
220 long len;
221 int tag, xclass;
222 int inf, i;
223 ASN1_OBJECT *ret = NULL((void*)0);
224 p = *pp;
225 inf = ASN1_get_object(&p, &len, &tag, &xclass, length);
226 if (inf & 0x80) {
227 i = ASN1_R_BAD_OBJECT_HEADER102;
228 goto err;
229 }
230
231 if (tag != V_ASN1_OBJECT6) {
232 i = ASN1_R_EXPECTING_AN_OBJECT116;
233 goto err;
234 }
235 ret = ossl_c2i_ASN1_OBJECT(a, &p, len);
236 if (ret)
237 *pp = p;
238 return ret;
239 err:
240 ERR_raise(ERR_LIB_ASN1, i)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,240,__func__), ERR_set_error)((13),(i),((void*)0))
;
241 return NULL((void*)0);
242}
243
244ASN1_OBJECT *ossl_c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
245 long len)
246{
247 ASN1_OBJECT *ret = NULL((void*)0), tobj;
248 const unsigned char *p;
249 unsigned char *data;
250 int i, length;
251
252 /*
253 * Sanity check OID encoding. Need at least one content octet. MSB must
254 * be clear in the last octet. can't have leading 0x80 in subidentifiers,
255 * see: X.690 8.19.2
256 */
257 if (len <= 0 || len > INT_MAX2147483647 || pp == NULL((void*)0) || (p = *pp) == NULL((void*)0) ||
258 p[len - 1] & 0x80) {
259 ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,259,__func__), ERR_set_error)((13),(216),((void*)0))
;
260 return NULL((void*)0);
261 }
262 /* Now 0 < len <= INT_MAX, so the cast is safe. */
263 length = (int)len;
264 /*
265 * Try to lookup OID in table: these are all valid encodings so if we get
266 * a match we know the OID is valid.
267 */
268 tobj.nid = NID_undef0;
269 tobj.data = p;
270 tobj.length = length;
271 tobj.flags = 0;
272 i = OBJ_obj2nid(&tobj);
273 if (i != NID_undef0) {
274 /*
275 * Return shared registered OID object: this improves efficiency
276 * because we don't have to return a dynamically allocated OID
277 * and NID lookups can use the cached value.
278 */
279 ret = OBJ_nid2obj(i);
280 if (a) {
281 ASN1_OBJECT_free(*a);
282 *a = ret;
283 }
284 *pp += len;
285 return ret;
286 }
287 for (i = 0; i < length; i++, p++) {
288 if (*p == 0x80 && (!i || !(p[-1] & 0x80))) {
289 ERR_raise(ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,289,__func__), ERR_set_error)((13),(216),((void*)0))
;
290 return NULL((void*)0);
291 }
292 }
293
294 if ((a == NULL((void*)0)) || ((*a) == NULL((void*)0)) ||
295 !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC0x01)) {
296 if ((ret = ASN1_OBJECT_new()) == NULL((void*)0))
297 return NULL((void*)0);
298 } else {
299 ret = (*a);
300 }
301
302 p = *pp;
303 /* detach data from object */
304 data = (unsigned char *)ret->data;
305 ret->data = NULL((void*)0);
306 /* once detached we can change it */
307 if ((data == NULL((void*)0)) || (ret->length < length)) {
308 ret->length = 0;
309 OPENSSL_free(data)CRYPTO_free(data, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 309)
;
310 data = OPENSSL_malloc(length)CRYPTO_malloc(length, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 310)
;
311 if (data == NULL((void*)0)) {
312 i = ERR_R_MALLOC_FAILURE(256|((0x1 << 18L)|(0x2 << 18L)));
313 goto err;
314 }
315 ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA0x08;
316 }
317 memcpy(data, p, length);
318 /* If there are dynamic strings, free them here, and clear the flag */
319 if ((ret->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS0x04) != 0) {
320 OPENSSL_free((char *)ret->sn)CRYPTO_free((char *)ret->sn, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 320)
;
321 OPENSSL_free((char *)ret->ln)CRYPTO_free((char *)ret->ln, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 321)
;
322 ret->flags &= ~ASN1_OBJECT_FLAG_DYNAMIC_STRINGS0x04;
323 }
324 /* reattach data to object, after which it remains const */
325 ret->data = data;
326 ret->length = length;
327 ret->sn = NULL((void*)0);
328 ret->ln = NULL((void*)0);
329 /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */
330 p += length;
331
332 if (a != NULL((void*)0))
333 (*a) = ret;
334 *pp = p;
335 return ret;
336 err:
337 ERR_raise(ERR_LIB_ASN1, i)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,337,__func__), ERR_set_error)((13),(i),((void*)0))
;
338 if ((a == NULL((void*)0)) || (*a != ret))
339 ASN1_OBJECT_free(ret);
340 return NULL((void*)0);
341}
342
343ASN1_OBJECT *ASN1_OBJECT_new(void)
344{
345 ASN1_OBJECT *ret;
346
347 ret = OPENSSL_zalloc(sizeof(*ret))CRYPTO_zalloc(sizeof(*ret), "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 347)
;
348 if (ret == NULL((void*)0)) {
349 ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE)(ERR_new(), ERR_set_debug("../deps/openssl/openssl/crypto/asn1/a_object.c"
,349,__func__), ERR_set_error)((13),((256|((0x1 << 18L)
|(0x2 << 18L)))),((void*)0))
;
350 return NULL((void*)0);
351 }
352 ret->flags = ASN1_OBJECT_FLAG_DYNAMIC0x01;
353 return ret;
354}
355
356void ASN1_OBJECT_free(ASN1_OBJECT *a)
357{
358 if (a == NULL((void*)0))
359 return;
360 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS0x04) {
361#ifndef CONST_STRICT
362 /*
363 * Disable purely for compile-time strict const checking. Doing this
364 * on a "real" compile will cause memory leaks
365 */
366 OPENSSL_free((void*)a->sn)CRYPTO_free((void*)a->sn, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 366)
;
367 OPENSSL_free((void*)a->ln)CRYPTO_free((void*)a->ln, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 367)
;
368#endif
369 a->sn = a->ln = NULL((void*)0);
370 }
371 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA0x08) {
372 OPENSSL_free((void*)a->data)CRYPTO_free((void*)a->data, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 372)
;
373 a->data = NULL((void*)0);
374 a->length = 0;
375 }
376 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC0x01)
377 OPENSSL_free(a)CRYPTO_free(a, "../deps/openssl/openssl/crypto/asn1/a_object.c"
, 377)
;
378}
379
380ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
381 const char *sn, const char *ln)
382{
383 ASN1_OBJECT o;
384
385 o.sn = sn;
386 o.ln = ln;
387 o.data = data;
388 o.nid = nid;
389 o.length = len;
390 o.flags = ASN1_OBJECT_FLAG_DYNAMIC0x01 | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS0x04 |
391 ASN1_OBJECT_FLAG_DYNAMIC_DATA0x08;
392 return OBJ_dup(&o);
393}