id
stringlengths 25
25
| content
stringlengths 649
72.1k
| max_stars_repo_path
stringlengths 91
133
|
|---|---|---|
d2a_code_trace_data_44554
|
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
{
PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
(diff > (0 - (PTRDIFF_T)len)));
return overlapped;
}
crypto/pkcs12/p12_decr.c:51: error: INTEGER_OVERFLOW_L2
(0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`.
Showing all 9 steps of the trace
crypto/pkcs12/p12_decr.c:51:10: Call
49. }
50.
51. if (!EVP_CipherUpdate(ctx, out, &i, in, inlen)) {
^
52. OPENSSL_free(out);
53. out = NULL;
crypto/evp/evp_enc.c:205:1: Parameter `ctx->cipher->block_size`
203. }
204.
205. > int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
206. const unsigned char *in, int inl)
207. {
crypto/evp/evp_enc.c:211:16: Call
209. return EVP_EncryptUpdate(ctx, out, outl, in, inl);
210. else
211. return EVP_DecryptUpdate(ctx, out, outl, in, inl);
^
212. }
213.
crypto/evp/evp_enc.c:416:1: Parameter `ctx->cipher->block_size`
414. }
415.
416. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
417. const unsigned char *in, int inl)
418. {
crypto/evp/evp_enc.c:422:5: Assignment
420. unsigned int b;
421.
422. b = ctx->cipher->block_size;
^
423.
424. if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
crypto/evp/evp_enc.c:452:16: Call
450. /* see comment about PTRDIFF_T comparison above */
451. if (((PTRDIFF_T)out == (PTRDIFF_T)in)
452. || is_partially_overlapping(out, in, b)) {
^
453. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING);
454. return 0;
crypto/evp/evp_enc.c:279:1: <RHS trace>
277. #endif
278.
279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
280. {
281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:279:1: Parameter `len`
277. #endif
278.
279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
280. {
281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:288:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`
286. */
287. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
288. (diff > (0 - (PTRDIFF_T)len)));
^
289.
290. return overlapped;
|
https://github.com/openssl/openssl/blob/b1531d8e6cc95837e38b10d875ae64144c6fdf7a/crypto/evp/evp_enc.c/#L288
|
d2a_code_trace_data_44555
|
static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
X509 *x, X509 *xca, EVP_PKEY *pkey,
STACK_OF(OPENSSL_STRING) *sigopts,
char *serialfile, int create,
int days, int clrext, CONF *conf, char *section,
ASN1_INTEGER *sno, int reqfile)
{
int ret = 0;
ASN1_INTEGER *bs = NULL;
X509_STORE_CTX xsc;
EVP_PKEY *upkey;
upkey = X509_get0_pubkey(xca);
EVP_PKEY_copy_parameters(upkey, pkey);
if (!X509_STORE_CTX_init(&xsc, ctx, x, NULL)) {
BIO_printf(bio_err, "Error initialising X509 store\n");
goto end;
}
if (sno)
bs = sno;
else if ((bs = x509_load_serial(CAfile, serialfile, create)) == NULL)
goto end;
X509_STORE_CTX_set_cert(&xsc, x);
X509_STORE_CTX_set_flags(&xsc, X509_V_FLAG_CHECK_SS_SIGNATURE);
if (!reqfile && X509_verify_cert(&xsc) <= 0)
goto end;
if (!X509_check_private_key(xca, pkey)) {
BIO_printf(bio_err,
"CA certificate and CA private key do not match\n");
goto end;
}
if (!X509_set_issuer_name(x, X509_get_subject_name(xca)))
goto end;
if (!X509_set_serialNumber(x, bs))
goto end;
if (X509_gmtime_adj(X509_get_notBefore(x), 0L) == NULL)
goto end;
if (X509_time_adj_ex(X509_get_notAfter(x), days, 0, NULL) == NULL)
goto end;
if (clrext) {
while (X509_get_ext_count(x) > 0)
X509_delete_ext(x, 0);
}
if (conf) {
X509V3_CTX ctx2;
X509_set_version(x, 2);
X509V3_set_ctx(&ctx2, xca, x, NULL, NULL, 0);
X509V3_set_nconf(&ctx2, conf);
if (!X509V3_EXT_add_nconf(conf, &ctx2, section, x))
goto end;
}
if (!do_X509_sign(x, pkey, digest, sigopts))
goto end;
ret = 1;
end:
X509_STORE_CTX_cleanup(&xsc);
if (!ret)
ERR_print_errors(bio_err);
if (!sno)
ASN1_INTEGER_free(bs);
return ret;
}
apps/x509.c:994: error: NULL_DEREFERENCE
pointer `upkey` last assigned on line 993 could be null and is dereferenced by call to `EVP_PKEY_copy_parameters()` at line 994, column 5.
Showing all 9 steps of the trace
apps/x509.c:981:1: start of procedure x509_certify()
979. }
980.
981. > static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
982. X509 *x, X509 *xca, EVP_PKEY *pkey,
983. STACK_OF(OPENSSL_STRING) *sigopts,
apps/x509.c:988:5:
986. ASN1_INTEGER *sno, int reqfile)
987. {
988. > int ret = 0;
989. ASN1_INTEGER *bs = NULL;
990. X509_STORE_CTX xsc;
apps/x509.c:989:5:
987. {
988. int ret = 0;
989. > ASN1_INTEGER *bs = NULL;
990. X509_STORE_CTX xsc;
991. EVP_PKEY *upkey;
apps/x509.c:993:5:
991. EVP_PKEY *upkey;
992.
993. > upkey = X509_get0_pubkey(xca);
994. EVP_PKEY_copy_parameters(upkey, pkey);
995.
crypto/x509/x509_cmp.c:307:1: start of procedure X509_get0_pubkey()
305. }
306.
307. > EVP_PKEY *X509_get0_pubkey(X509 *x)
308. {
309. if (x == NULL)
crypto/x509/x509_cmp.c:309:9: Taking true branch
307. EVP_PKEY *X509_get0_pubkey(X509 *x)
308. {
309. if (x == NULL)
^
310. return NULL;
311. return X509_PUBKEY_get0(x->cert_info.key);
crypto/x509/x509_cmp.c:310:9:
308. {
309. if (x == NULL)
310. > return NULL;
311. return X509_PUBKEY_get0(x->cert_info.key);
312. }
crypto/x509/x509_cmp.c:312:1: return from a call to X509_get0_pubkey
310. return NULL;
311. return X509_PUBKEY_get0(x->cert_info.key);
312. > }
313.
314. EVP_PKEY *X509_get_pubkey(X509 *x)
apps/x509.c:994:5:
992.
993. upkey = X509_get0_pubkey(xca);
994. > EVP_PKEY_copy_parameters(upkey, pkey);
995.
996. if (!X509_STORE_CTX_init(&xsc, ctx, x, NULL)) {
|
https://github.com/openssl/openssl/blob/6457615ac82d688a965c9b2cce9611e0559635be/apps/x509.c/#L994
|
d2a_code_trace_data_44556
|
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
{
int i, nw, lb, rb;
BN_ULONG *t, *f;
BN_ULONG l;
bn_check_top(r);
bn_check_top(a);
if (n < 0) {
BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
return 0;
}
nw = n / BN_BITS2;
if (bn_wexpand(r, a->top + nw + 1) == NULL)
return 0;
r->neg = a->neg;
lb = n % BN_BITS2;
rb = BN_BITS2 - lb;
f = a->d;
t = r->d;
t[a->top + nw] = 0;
if (lb == 0)
for (i = a->top - 1; i >= 0; i--)
t[nw + i] = f[i];
else
for (i = a->top - 1; i >= 0; i--) {
l = f[i];
t[nw + i + 1] |= (l >> rb) & BN_MASK2;
t[nw + i] = (l << lb) & BN_MASK2;
}
memset(t, 0, sizeof(*t) * nw);
r->top = a->top + nw + 1;
bn_correct_top(r);
bn_check_top(r);
return 1;
}
test/bntest.c:2144: error: BUFFER_OVERRUN_L3
Offset: [1, +oo] Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex`.
Showing all 48 steps of the trace
test/bntest.c:2143:14: Call
2141.
2142. for (trial = 0; trial <= 1; ++trial) {
2143. if (!TEST_true(BN_set_word(r, primes[i]))
^
2144. || !TEST_int_eq(BN_is_prime_fasttest_ex(r, 1, ctx, trial, NULL),
2145. 1))
crypto/bn/bn_lib.c:367:15: Assignment
365. a->neg = 0;
366. a->d[0] = w;
367. a->top = (w ? 1 : 0);
^
368. bn_check_top(a);
369. return 1;
crypto/bn/bn_lib.c:367:5: Assignment
365. a->neg = 0;
366. a->d[0] = w;
367. a->top = (w ? 1 : 0);
^
368. bn_check_top(a);
369. return 1;
test/bntest.c:2144:21: Call
2142. for (trial = 0; trial <= 1; ++trial) {
2143. if (!TEST_true(BN_set_word(r, primes[i]))
2144. || !TEST_int_eq(BN_is_prime_fasttest_ex(r, 1, ctx, trial, NULL),
^
2145. 1))
2146. goto err;
crypto/bn/bn_prime.c:151:1: Parameter `a->top`
149. }
150.
151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
152. int do_trial_division, BN_GENCB *cb)
153. {
crypto/bn/bn_prime.c:161:9: Call
159.
160. /* Take care of the really small primes 2 & 3 */
161. if (BN_is_word(a, 2) || BN_is_word(a, 3))
^
162. return 1;
163.
crypto/bn/bn_lib.c:855:1: Parameter `a->top`
853. }
854.
855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
crypto/bn/bn_lib.c:857:12: Call
855. int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
^
858. }
859.
crypto/bn/bn_lib.c:840:1: Parameter `a->top`
838. }
839.
840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
841. {
842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
crypto/bn/bn_prime.c:161:29: Call
159.
160. /* Take care of the really small primes 2 & 3 */
161. if (BN_is_word(a, 2) || BN_is_word(a, 3))
^
162. return 1;
163.
crypto/bn/bn_lib.c:855:1: Parameter `a->top`
853. }
854.
855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
crypto/bn/bn_lib.c:857:12: Call
855. int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
^
858. }
859.
crypto/bn/bn_lib.c:840:1: Parameter `a->top`
838. }
839.
840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
841. {
842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
crypto/bn/bn_prime.c:165:10: Call
163.
164. /* Check odd and bigger than 1 */
165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0)
^
166. return 0;
167.
crypto/bn/bn_lib.c:860:1: Parameter `a->top`
858. }
859.
860. > int BN_is_odd(const BIGNUM *a)
861. {
862. return (a->top > 0) && (a->d[0] & 1);
crypto/bn/bn_prime.c:165:26: Call
163.
164. /* Check odd and bigger than 1 */
165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0)
^
166. return 0;
167.
crypto/bn/bn_lib.c:542:1: Parameter `a->top`
540. }
541.
542. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
543. {
544. int i;
crypto/bn/bn_prime.c:198:10: Call
196.
197. /* compute A1 := a - 1 */
198. if (!BN_copy(A1, a) || !BN_sub_word(A1, 1))
^
199. goto err;
200. /* compute A3 := a - 3 */
crypto/bn/bn_lib.c:285:1: Parameter `b->top`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_prime.c:201:10: Call
199. goto err;
200. /* compute A3 := a - 3 */
201. if (!BN_copy(A3, a) || !BN_sub_word(A3, 3))
^
202. goto err;
203.
crypto/bn/bn_lib.c:285:1: Parameter `b->top`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_prime.c:215:10: Call
213. if (mont == NULL)
214. goto err;
215. if (!BN_MONT_CTX_set(mont, a, ctx))
^
216. goto err;
217.
crypto/bn/bn_mont.c:238:9: Call
236. BIGNUM *Ri, *R;
237.
238. if (BN_is_zero(mod))
^
239. return 0;
240.
crypto/bn/bn_lib.c:845:1: Parameter `a->top`
843. }
844.
845. > int BN_is_zero(const BIGNUM *a)
846. {
847. return a->top == 0;
crypto/bn/bn_prime.c:223:13: Call
221. goto err;
222.
223. j = witness(check, a, A1, A1_odd, k, ctx, mont);
^
224. if (j == -1)
225. goto err;
crypto/bn/bn_prime.c:245:1: Parameter `a->top`
243. }
244.
245. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,
246. const BIGNUM *a1_odd, int k, BN_CTX *ctx,
247. BN_MONT_CTX *mont)
crypto/bn/bn_prime.c:249:10: Call
247. BN_MONT_CTX *mont)
248. {
249. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
^
250. return -1;
251. if (BN_is_one(w))
crypto/bn/bn_exp.c:296:1: Parameter `m->top`
294. }
295.
296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
298. {
crypto/bn/bn_exp.c:310:16: Call
308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0
309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
^
311. }
312.
crypto/bn/bn_exp.c:596:1: Parameter `m->top`
594. * http://www.daemonology.net/hyperthreading-considered-harmful/)
595. */
596. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
597. const BIGNUM *m, BN_CTX *ctx,
598. BN_MONT_CTX *in_mont)
crypto/bn/bn_exp.c:617:10: Call
615. bn_check_top(m);
616.
617. if (!BN_is_odd(m)) {
^
618. BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
619. return 0;
crypto/bn/bn_lib.c:860:1: Parameter `a->top`
858. }
859.
860. > int BN_is_odd(const BIGNUM *a)
861. {
862. return (a->top > 0) && (a->d[0] & 1);
crypto/bn/bn_exp.c:755:14: Call
753. /* prepare a^1 in Montgomery domain */
754. if (a->neg || BN_ucmp(a, m) >= 0) {
755. if (!BN_nnmod(&am, a, m, ctx))
^
756. goto err;
757. if (!BN_to_montgomery(&am, &am, mont, ctx))
crypto/bn/bn_mod.c:13:1: Parameter `d->top`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c:199:31: Call
197.
198. /* First we normalise the numbers */
199. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
^
200. if (!(BN_lshift(sdiv, divisor, norm_shift)))
201. goto err;
crypto/bn/bn_lib.c:140:9: Assignment
138.
139. if (BN_is_zero(a))
140. return 0;
^
141. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
142. }
crypto/bn/bn_div.c:199:5: Assignment
197.
198. /* First we normalise the numbers */
199. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
^
200. if (!(BN_lshift(sdiv, divisor, norm_shift)))
201. goto err;
crypto/bn/bn_div.c:200:11: Call
198. /* First we normalise the numbers */
199. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
200. if (!(BN_lshift(sdiv, divisor, norm_shift)))
^
201. goto err;
202. sdiv->neg = 0;
crypto/bn/bn_shift.c:83:1: <Offset trace>
81. }
82.
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84. {
85. int i, nw, lb, rb;
crypto/bn/bn_shift.c:83:1: Parameter `n`
81. }
82.
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84. {
85. int i, nw, lb, rb;
crypto/bn/bn_shift.c:97:5: Assignment
95. }
96.
97. nw = n / BN_BITS2;
^
98. if (bn_wexpand(r, a->top + nw + 1) == NULL)
99. return 0;
crypto/bn/bn_shift.c:83:1: <Length trace>
81. }
82.
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84. {
85. int i, nw, lb, rb;
crypto/bn/bn_shift.c:83:1: Parameter `*r->d`
81. }
82.
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84. {
85. int i, nw, lb, rb;
crypto/bn/bn_shift.c:98:9: Call
96.
97. nw = n / BN_BITS2;
98. if (bn_wexpand(r, a->top + nw + 1) == NULL)
^
99. return 0;
100. r->neg = a->neg;
crypto/bn/bn_lib.c:941:1: Parameter `*a->d`
939. }
940.
941. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
942. {
943. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_shift.c:104:5: Assignment
102. rb = BN_BITS2 - lb;
103. f = a->d;
104. t = r->d;
^
105. t[a->top + nw] = 0;
106. if (lb == 0)
crypto/bn/bn_shift.c:112:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex`
110. for (i = a->top - 1; i >= 0; i--) {
111. l = f[i];
112. t[nw + i + 1] |= (l >> rb) & BN_MASK2;
^
113. t[nw + i] = (l << lb) & BN_MASK2;
114. }
|
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_shift.c/#L112
|
d2a_code_trace_data_44557
|
static void imc_calculate_coeffs(IMCContext* q, float* flcoeffs1, float* flcoeffs2, int* bandWidthT,
float* flcoeffs3, float* flcoeffs5)
{
float workT1[BANDS];
float workT2[BANDS];
float workT3[BANDS];
float snr_limit = 1.e-30;
float accum = 0.0;
int i, cnt2;
for(i = 0; i < BANDS; i++) {
flcoeffs5[i] = workT2[i] = 0.0;
if (bandWidthT[i]){
workT1[i] = flcoeffs1[i] * flcoeffs1[i];
flcoeffs3[i] = 2.0 * flcoeffs2[i];
} else {
workT1[i] = 0.0;
flcoeffs3[i] = -30000.0;
}
workT3[i] = bandWidthT[i] * workT1[i] * 0.01;
if (workT3[i] <= snr_limit)
workT3[i] = 0.0;
}
for(i = 0; i < BANDS; i++) {
for(cnt2 = i; cnt2 < cyclTab[i]; cnt2++)
flcoeffs5[cnt2] = flcoeffs5[cnt2] + workT3[i];
workT2[cnt2-1] = workT2[cnt2-1] + workT3[i];
}
for(i = 1; i < BANDS; i++) {
accum = (workT2[i-1] + accum) * imc_weights1[i-1];
flcoeffs5[i] += accum;
}
for(i = 0; i < BANDS; i++)
workT2[i] = 0.0;
for(i = 0; i < BANDS; i++) {
for(cnt2 = i-1; cnt2 > cyclTab2[i]; cnt2--)
flcoeffs5[cnt2] += workT3[i];
workT2[cnt2+1] += workT3[i];
}
accum = 0.0;
for(i = BANDS-2; i >= 0; i--) {
accum = (workT2[i+1] + accum) * imc_weights2[i];
flcoeffs5[i] += accum;
}
}
libavcodec/imc.c:176: error: Buffer Overrun L3
Offset: [-1, +oo] Size: 32.
libavcodec/imc.c:173:9: <Offset trace>
171. }
172.
173. for(i = 0; i < BANDS; i++) {
^
174. for(cnt2 = i; cnt2 < cyclTab[i]; cnt2++)
175. flcoeffs5[cnt2] = flcoeffs5[cnt2] + workT3[i];
libavcodec/imc.c:173:9: Assignment
171. }
172.
173. for(i = 0; i < BANDS; i++) {
^
174. for(cnt2 = i; cnt2 < cyclTab[i]; cnt2++)
175. flcoeffs5[cnt2] = flcoeffs5[cnt2] + workT3[i];
libavcodec/imc.c:174:13: Assignment
172.
173. for(i = 0; i < BANDS; i++) {
174. for(cnt2 = i; cnt2 < cyclTab[i]; cnt2++)
^
175. flcoeffs5[cnt2] = flcoeffs5[cnt2] + workT3[i];
176. workT2[cnt2-1] = workT2[cnt2-1] + workT3[i];
libavcodec/imc.c:149:1: <Length trace>
147. }
148.
149. static void imc_calculate_coeffs(IMCContext* q, float* flcoeffs1, float* flcoeffs2, int* bandWidthT,
^
150. float* flcoeffs3, float* flcoeffs5)
151. {
libavcodec/imc.c:149:1: Array declaration
147. }
148.
149. static void imc_calculate_coeffs(IMCContext* q, float* flcoeffs1, float* flcoeffs2, int* bandWidthT,
^
150. float* flcoeffs3, float* flcoeffs5)
151. {
libavcodec/imc.c:176:9: Array access: Offset: [-1, +oo] Size: 32
174. for(cnt2 = i; cnt2 < cyclTab[i]; cnt2++)
175. flcoeffs5[cnt2] = flcoeffs5[cnt2] + workT3[i];
176. workT2[cnt2-1] = workT2[cnt2-1] + workT3[i];
^
177. }
178.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/imc.c/#L176
|
d2a_code_trace_data_44558
|
static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
{
int err_printed = 0;
while (ac->tags_seen_this_frame[type][elem_id] && elem_id < MAX_ELEM_ID) {
if (ac->output_configured < OC_LOCKED && !err_printed) {
av_log(ac->avccontext, AV_LOG_WARNING, "Duplicate channel tag found, attempting to remap.\n");
err_printed = 1;
}
elem_id++;
}
if (elem_id == MAX_ELEM_ID)
return NULL;
ac->tags_seen_this_frame[type][elem_id] = 1;
if (ac->tag_che_map[type][elem_id]) {
return ac->tag_che_map[type][elem_id];
}
if (ac->tags_mapped >= tags_per_config[ac->m4ac.chan_config]) {
return NULL;
}
switch (ac->m4ac.chan_config) {
case 7:
if (ac->tags_mapped == 3 && type == TYPE_CPE) {
ac->tags_mapped++;
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
}
case 6:
if (ac->tags_mapped == tags_per_config[ac->m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
ac->tags_mapped++;
return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0];
}
case 5:
if (ac->tags_mapped == 2 && type == TYPE_CPE) {
ac->tags_mapped++;
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1];
}
case 4:
if (ac->tags_mapped == 2 && ac->m4ac.chan_config == 4 && type == TYPE_SCE) {
ac->tags_mapped++;
return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
}
case 3:
case 2:
if (ac->tags_mapped == (ac->m4ac.chan_config != 2) && type == TYPE_CPE) {
ac->tags_mapped++;
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][0];
} else if (ac->m4ac.chan_config == 2) {
return NULL;
}
case 1:
if (!ac->tags_mapped && type == TYPE_SCE) {
ac->tags_mapped++;
return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0];
}
default:
return NULL;
}
}
libavcodec/aac.c:130: error: Buffer Overrun L2
Offset: [`elem_id`, max(16, `elem_id`)] Size: 16.
libavcodec/aac.c:114:1: <Offset trace>
112. static const char overread_err[] = "Input buffer exhausted before END element found\n";
113.
114. static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
^
115. {
116. /* Some buggy encoders appear to set all elem_ids to zero and rely on
libavcodec/aac.c:114:1: Parameter `elem_id`
112. static const char overread_err[] = "Input buffer exhausted before END element found\n";
113.
114. static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
^
115. {
116. /* Some buggy encoders appear to set all elem_ids to zero and rely on
libavcodec/aac.c:114:1: <Length trace>
112. static const char overread_err[] = "Input buffer exhausted before END element found\n";
113.
114. static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
^
115. {
116. /* Some buggy encoders appear to set all elem_ids to zero and rely on
libavcodec/aac.c:114:1: Parameter `ac->tags_seen_this_frame[*][*]`
112. static const char overread_err[] = "Input buffer exhausted before END element found\n";
113.
114. static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
^
115. {
116. /* Some buggy encoders appear to set all elem_ids to zero and rely on
libavcodec/aac.c:130:5: Array access: Offset: [elem_id, max(16, elem_id)] Size: 16
128. if (elem_id == MAX_ELEM_ID)
129. return NULL;
130. ac->tags_seen_this_frame[type][elem_id] = 1;
^
131.
132. if (ac->tag_che_map[type][elem_id]) {
|
https://github.com/libav/libav/blob/76561924cf3d9789653dc72d696f119862616891/libavcodec/aac.c/#L130
|
d2a_code_trace_data_44559
|
static int ssl_cipher_process_rulestr(const char *rule_str,
CIPHER_ORDER **head_p,
CIPHER_ORDER **tail_p,
const SSL_CIPHER **ca_list, CERT *c)
{
uint32_t alg_mkey, alg_auth, alg_enc, alg_mac, algo_strength;
int min_tls;
const char *l, *buf;
int j, multi, found, rule, retval, ok, buflen;
uint32_t cipher_id = 0;
char ch;
retval = 1;
l = rule_str;
for ( ; ; ) {
ch = *l;
if (ch == '\0')
break;
if (ch == '-') {
rule = CIPHER_DEL;
l++;
} else if (ch == '+') {
rule = CIPHER_ORD;
l++;
} else if (ch == '!') {
rule = CIPHER_KILL;
l++;
} else if (ch == '@') {
rule = CIPHER_SPECIAL;
l++;
} else {
rule = CIPHER_ADD;
}
if (ITEM_SEP(ch)) {
l++;
continue;
}
alg_mkey = 0;
alg_auth = 0;
alg_enc = 0;
alg_mac = 0;
min_tls = 0;
algo_strength = 0;
for (;;) {
ch = *l;
buf = l;
buflen = 0;
#ifndef CHARSET_EBCDIC
while (((ch >= 'A') && (ch <= 'Z')) ||
((ch >= '0') && (ch <= '9')) ||
((ch >= 'a') && (ch <= 'z')) ||
(ch == '-') || (ch == '.') || (ch == '='))
#else
while (isalnum((unsigned char)ch) || (ch == '-') || (ch == '.')
|| (ch == '='))
#endif
{
ch = *(++l);
buflen++;
}
if (buflen == 0) {
SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR, SSL_R_INVALID_COMMAND);
retval = found = 0;
l++;
break;
}
if (rule == CIPHER_SPECIAL) {
found = 0;
break;
}
if (ch == '+') {
multi = 1;
l++;
} else {
multi = 0;
}
j = found = 0;
cipher_id = 0;
while (ca_list[j]) {
if (strncmp(buf, ca_list[j]->name, buflen) == 0
&& (ca_list[j]->name[buflen] == '\0')) {
found = 1;
break;
} else
j++;
}
if (!found)
break;
if (ca_list[j]->algorithm_mkey) {
if (alg_mkey) {
alg_mkey &= ca_list[j]->algorithm_mkey;
if (!alg_mkey) {
found = 0;
break;
}
} else {
alg_mkey = ca_list[j]->algorithm_mkey;
}
}
if (ca_list[j]->algorithm_auth) {
if (alg_auth) {
alg_auth &= ca_list[j]->algorithm_auth;
if (!alg_auth) {
found = 0;
break;
}
} else {
alg_auth = ca_list[j]->algorithm_auth;
}
}
if (ca_list[j]->algorithm_enc) {
if (alg_enc) {
alg_enc &= ca_list[j]->algorithm_enc;
if (!alg_enc) {
found = 0;
break;
}
} else {
alg_enc = ca_list[j]->algorithm_enc;
}
}
if (ca_list[j]->algorithm_mac) {
if (alg_mac) {
alg_mac &= ca_list[j]->algorithm_mac;
if (!alg_mac) {
found = 0;
break;
}
} else {
alg_mac = ca_list[j]->algorithm_mac;
}
}
if (ca_list[j]->algo_strength & SSL_STRONG_MASK) {
if (algo_strength & SSL_STRONG_MASK) {
algo_strength &=
(ca_list[j]->algo_strength & SSL_STRONG_MASK) |
~SSL_STRONG_MASK;
if (!(algo_strength & SSL_STRONG_MASK)) {
found = 0;
break;
}
} else {
algo_strength = ca_list[j]->algo_strength & SSL_STRONG_MASK;
}
}
if (ca_list[j]->algo_strength & SSL_DEFAULT_MASK) {
if (algo_strength & SSL_DEFAULT_MASK) {
algo_strength &=
(ca_list[j]->algo_strength & SSL_DEFAULT_MASK) |
~SSL_DEFAULT_MASK;
if (!(algo_strength & SSL_DEFAULT_MASK)) {
found = 0;
break;
}
} else {
algo_strength |=
ca_list[j]->algo_strength & SSL_DEFAULT_MASK;
}
}
if (ca_list[j]->valid) {
cipher_id = ca_list[j]->id;
} else {
if (ca_list[j]->min_tls) {
if (min_tls != 0 && min_tls != ca_list[j]->min_tls) {
found = 0;
break;
} else {
min_tls = ca_list[j]->min_tls;
}
}
}
if (!multi)
break;
}
if (rule == CIPHER_SPECIAL) {
ok = 0;
if ((buflen == 8) && strncmp(buf, "STRENGTH", 8) == 0) {
ok = ssl_cipher_strength_sort(head_p, tail_p);
} else if (buflen == 10 && strncmp(buf, "SECLEVEL=", 9) == 0) {
int level = buf[9] - '0';
if (level < 0 || level > 5) {
SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
SSL_R_INVALID_COMMAND);
} else {
c->sec_level = level;
ok = 1;
}
} else {
SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR, SSL_R_INVALID_COMMAND);
}
if (ok == 0)
retval = 0;
while ((*l != '\0') && !ITEM_SEP(*l))
l++;
} else if (found) {
ssl_cipher_apply_rule(cipher_id,
alg_mkey, alg_auth, alg_enc, alg_mac,
min_tls, algo_strength, rule, -1, head_p,
tail_p);
} else {
while ((*l != '\0') && !ITEM_SEP(*l))
l++;
}
if (*l == '\0')
break;
}
return retval;
}
test/clienthellotest.c:102: error: BUFFER_OVERRUN_L1
Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: 1 by call to `SSL_CTX_set_cipher_list`.
Showing all 13 steps of the trace
test/clienthellotest.c:102:14: Call
100. * that is too long for this test we use a restricted ciphersuite list
101. */
102. if (!TEST_false(SSL_CTX_set_cipher_list(ctx, "")))
^
103. goto end;
104. ERR_clear_error();
ssl/ssl_lib.c:2603:1: Parameter `*str`
2601.
2602. /** specify the ciphers to be used by default by the SSL_CTX */
2603. > int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
2604. {
2605. STACK_OF(SSL_CIPHER) *sk;
ssl/ssl_lib.c:2607:10: Call
2605. STACK_OF(SSL_CIPHER) *sk;
2606.
2607. sk = ssl_create_cipher_list(ctx->method, ctx->tls13_ciphersuites,
^
2608. &ctx->cipher_list, &ctx->cipher_list_by_id, str,
2609. ctx->cert);
ssl/ssl_ciph.c:1402:1: Parameter `*rule_str`
1400. }
1401.
1402. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1403. STACK_OF(SSL_CIPHER) *tls13_ciphersuites,
1404. STACK_OF(SSL_CIPHER) **cipher_list,
ssl/ssl_ciph.c:1422:10: Call
1420. return NULL;
1421. #ifndef OPENSSL_NO_EC
1422. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
^
1423. return NULL;
1424. #endif
ssl/ssl_ciph.c:1222:1: Parameter `**prule_str`
1220.
1221. #ifndef OPENSSL_NO_EC
1222. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c,
1223. const char **prule_str)
1224. {
ssl/ssl_ciph.c:1571:5: Assignment
1569. */
1570. ok = 1;
1571. rule_p = rule_str;
^
1572. if (strncmp(rule_str, "DEFAULT", 7) == 0) {
1573. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
ssl/ssl_ciph.c:1581:14: Call
1579.
1580. if (ok && (strlen(rule_p) > 0))
1581. ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c);
^
1582.
1583. OPENSSL_free(ca_list); /* Not needed anymore */
ssl/ssl_ciph.c:957:1: <Length trace>
955. }
956.
957. > static int ssl_cipher_process_rulestr(const char *rule_str,
958. CIPHER_ORDER **head_p,
959. CIPHER_ORDER **tail_p,
ssl/ssl_ciph.c:957:1: Parameter `*rule_str`
955. }
956.
957. > static int ssl_cipher_process_rulestr(const char *rule_str,
958. CIPHER_ORDER **head_p,
959. CIPHER_ORDER **tail_p,
ssl/ssl_ciph.c:970:5: Assignment
968.
969. retval = 1;
970. l = rule_str;
^
971. for ( ; ; ) {
972. ch = *l;
ssl/ssl_ciph.c:1006:13: Assignment
1004. for (;;) {
1005. ch = *l;
1006. buf = l;
^
1007. buflen = 0;
1008. #ifndef CHARSET_EBCDIC
ssl/ssl_ciph.c:1184:29: Array access: Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: 1 by call to `SSL_CTX_set_cipher_list`
1182. ok = ssl_cipher_strength_sort(head_p, tail_p);
1183. } else if (buflen == 10 && strncmp(buf, "SECLEVEL=", 9) == 0) {
1184. int level = buf[9] - '0';
^
1185. if (level < 0 || level > 5) {
1186. SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
|
https://github.com/openssl/openssl/blob/4af5836b55442f31795eff6c8c81ea7a1b8cf94b/ssl/ssl_ciph.c/#L1184
|
d2a_code_trace_data_44560
|
ngx_int_t
ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name,
ngx_open_file_info_t *of, ngx_pool_t *pool)
{
time_t now;
uint32_t hash;
ngx_int_t rc;
ngx_pool_cleanup_t *cln;
ngx_cached_open_file_t *file;
ngx_pool_cleanup_file_t *clnf;
ngx_open_file_cache_cleanup_t *ofcln;
of->fd = NGX_INVALID_FILE;
of->err = 0;
if (cache == NULL) {
cln = ngx_pool_cleanup_add(pool, sizeof(ngx_pool_cleanup_file_t));
if (cln == NULL) {
return NGX_ERROR;
}
rc = ngx_open_and_stat_file(name->data, of, pool->log);
if (rc == NGX_OK && !of->is_dir) {
cln->handler = ngx_pool_cleanup_file;
clnf = cln->data;
clnf->fd = of->fd;
clnf->name = name->data;
clnf->log = pool->log;
}
return rc;
}
cln = ngx_pool_cleanup_add(pool, sizeof(ngx_open_file_cache_cleanup_t));
if (cln == NULL) {
return NGX_ERROR;
}
now = ngx_time();
hash = ngx_crc32_long(name->data, name->len);
file = ngx_open_file_lookup(cache, name, hash);
if (file) {
file->uses++;
ngx_queue_remove(&file->queue);
if (file->fd == NGX_INVALID_FILE && file->err == 0 && !file->is_dir) {
rc = ngx_open_and_stat_file(name->data, of, pool->log);
if (rc != NGX_OK && (of->err == 0 || !of->errors)) {
goto failed;
}
goto add_event;
}
if (file->use_event
|| (file->event == NULL
&& (of->uniq == 0 || of->uniq == file->uniq)
&& now - file->created < of->valid))
{
if (file->err == 0) {
of->fd = file->fd;
of->uniq = file->uniq;
of->mtime = file->mtime;
of->size = file->size;
of->is_dir = file->is_dir;
of->is_file = file->is_file;
of->is_link = file->is_link;
of->is_exec = file->is_exec;
of->is_directio = file->is_directio;
if (!file->is_dir) {
file->count++;
ngx_open_file_add_event(cache, file, of, pool->log);
}
} else {
of->err = file->err;
}
goto found;
}
ngx_log_debug4(NGX_LOG_DEBUG_CORE, pool->log, 0,
"retest open file: %s, fd:%d, c:%d, e:%d",
file->name, file->fd, file->count, file->err);
if (file->is_dir) {
of->test_dir = 1;
}
of->fd = file->fd;
of->uniq = file->uniq;
rc = ngx_open_and_stat_file(name->data, of, pool->log);
if (rc != NGX_OK && (of->err == 0 || !of->errors)) {
goto failed;
}
if (of->is_dir) {
if (file->is_dir || file->err) {
goto update;
}
} else if (of->err == 0) {
if (file->is_dir || file->err) {
goto add_event;
}
if (of->uniq == file->uniq) {
file->count++;
if (file->event) {
file->use_event = 1;
}
goto renew;
}
} else {
if (file->err || file->is_dir) {
goto update;
}
}
if (file->count == 0) {
ngx_open_file_del_event(file);
if (ngx_close_file(file->fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno,
ngx_close_file_n " \"%s\" failed",
name->data);
}
goto add_event;
}
ngx_rbtree_delete(&cache->rbtree, &file->node);
cache->current--;
file->close = 1;
goto create;
}
rc = ngx_open_and_stat_file(name->data, of, pool->log);
if (rc != NGX_OK && (of->err == 0 || !of->errors)) {
goto failed;
}
create:
if (cache->current >= cache->max) {
ngx_expire_old_cached_files(cache, 0, pool->log);
}
file = ngx_alloc(sizeof(ngx_cached_open_file_t), pool->log);
if (file == NULL) {
goto failed;
}
file->name = ngx_alloc(name->len + 1, pool->log);
if (file->name == NULL) {
ngx_free(file);
file = NULL;
goto failed;
}
ngx_cpystrn(file->name, name->data, name->len + 1);
file->node.key = hash;
ngx_rbtree_insert(&cache->rbtree, &file->node);
cache->current++;
file->uses = 1;
file->count = 0;
file->event = NULL;
add_event:
ngx_open_file_add_event(cache, file, of, pool->log);
update:
file->fd = of->fd;
file->err = of->err;
if (of->err == 0) {
file->uniq = of->uniq;
file->mtime = of->mtime;
file->size = of->size;
file->close = 0;
file->is_dir = of->is_dir;
file->is_file = of->is_file;
file->is_link = of->is_link;
file->is_exec = of->is_exec;
file->is_directio = of->is_directio;
if (!of->is_dir) {
file->count++;
}
}
renew:
file->created = now;
found:
file->accessed = now;
ngx_queue_insert_head(&cache->expire_queue, &file->queue);
ngx_log_debug5(NGX_LOG_DEBUG_CORE, pool->log, 0,
"cached open file: %s, fd:%d, c:%d, e:%d, u:%d",
file->name, file->fd, file->count, file->err, file->uses);
if (of->err == 0) {
if (!of->is_dir) {
cln->handler = ngx_open_file_cleanup;
ofcln = cln->data;
ofcln->cache = cache;
ofcln->file = file;
ofcln->min_uses = of->min_uses;
ofcln->log = pool->log;
}
return NGX_OK;
}
return NGX_ERROR;
failed:
if (file) {
ngx_rbtree_delete(&cache->rbtree, &file->node);
cache->current--;
if (file->count == 0) {
if (file->fd != NGX_INVALID_FILE) {
if (ngx_close_file(file->fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno,
ngx_close_file_n " \"%s\" failed",
file->name);
}
}
ngx_free(file->name);
ngx_free(file);
} else {
file->close = 1;
}
}
if (of->fd != NGX_INVALID_FILE) {
if (ngx_close_file(of->fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno,
ngx_close_file_n " \"%s\" failed", name->data);
}
}
return NGX_ERROR;
}
src/http/ngx_http_core_module.c:1175: error: Integer Overflow L2
([0, +oo] - 1):unsigned64 by call to `ngx_open_cached_file`.
src/http/ngx_http_core_module.c:1167:9: Unknown value from: __infer_skip
1165. }
1166.
1167. ngx_memzero(&of, sizeof(ngx_open_file_info_t));
^
1168.
1169. of.directio = clcf->directio;
src/http/ngx_http_core_module.c:1175:13: Call
1173. of.events = clcf->open_file_cache_events;
1174.
1175. if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
^
1176. != NGX_OK)
1177. {
src/core/ngx_open_file_cache.c:126:1: <LHS trace>
124.
125.
126. ngx_int_t
^
127. ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name,
128. ngx_open_file_info_t *of, ngx_pool_t *pool)
src/core/ngx_open_file_cache.c:126:1: Parameter `cache->current`
124.
125.
126. ngx_int_t
^
127. ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name,
128. ngx_open_file_info_t *of, ngx_pool_t *pool)
src/core/ngx_open_file_cache.c:297:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_open_cached_file`
295. ngx_rbtree_delete(&cache->rbtree, &file->node);
296.
297. cache->current--;
^
298.
299. file->close = 1;
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_open_file_cache.c/#L297
|
d2a_code_trace_data_44561
|
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
{
bn_check_top(b);
if (a == b)
return a;
if (bn_wexpand(a, b->top) == NULL)
return NULL;
if (b->top > 0)
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
a->top = b->top;
a->neg = b->neg;
bn_check_top(a);
return a;
}
test/dhtest.c:60: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `DH_check`.
Showing all 20 steps of the trace
test/dhtest.c:56:17: Call
54. BN_GENCB_set(_cb, &cb, NULL);
55. if (!TEST_ptr(a = DH_new())
56. || !TEST_true(DH_generate_parameters_ex(a, 64,
^
57. DH_GENERATOR_5, _cb)))
58. goto err;
crypto/dh/dh_gen.c:23:1: Parameter `ret->p->top`
21. BN_GENCB *cb);
22.
23. > int DH_generate_parameters_ex(DH *ret, int prime_len, int generator,
24. BN_GENCB *cb)
25. {
test/dhtest.c:60:10: Call
58. goto err;
59.
60. if (!DH_check(a, &i))
^
61. goto err;
62. if (!TEST_false(i & DH_CHECK_P_NOT_PRIME)
crypto/dh/dh_check.c:65:1: Parameter `dh->p->top`
63. */
64.
65. > int DH_check(const DH *dh, int *ret)
66. {
67. int ok = 0, r;
crypto/dh/dh_check.c:87:18: Call
85. if (BN_cmp(dh->g, BN_value_one()) <= 0)
86. *ret |= DH_NOT_SUITABLE_GENERATOR;
87. else if (BN_cmp(dh->g, dh->p) >= 0)
^
88. *ret |= DH_NOT_SUITABLE_GENERATOR;
89. else {
crypto/bn/bn_lib.c:577:1: Parameter `a->top`
575. }
576.
577. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
578. {
579. int i;
crypto/dh/dh_check.c:91:18: Call
89. else {
90. /* Check g^q == 1 mod p */
91. if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx))
^
92. goto err;
93. if (!BN_is_one(t1))
crypto/bn/bn_exp.c:91:1: Parameter `m->top`
89. }
90.
91. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
92. BN_CTX *ctx)
93. {
crypto/bn/bn_exp.c:136:9: Call
134.
135. #ifdef MONT_MUL_MOD
136. if (BN_is_odd(m)) {
^
137. # ifdef MONT_EXP_WORD
138. if (a->top == 1 && !a->neg
crypto/bn/bn_lib.c:867:1: Parameter `a->top`
865. }
866.
867. > int BN_is_odd(const BIGNUM *a)
868. {
869. return (a->top > 0) && (a->d[0] & 1);
crypto/bn/bn_exp.c:149:15: Call
147. #ifdef RECP_MUL_MOD
148. {
149. ret = BN_mod_exp_recp(r, a, p, m, ctx);
^
150. }
151. #else
crypto/bn/bn_exp.c:161:1: Parameter `m->top`
159. }
160.
161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
162. const BIGNUM *m, BN_CTX *ctx)
163. {
crypto/bn/bn_exp.c:198:14: Call
196. if (m->neg) {
197. /* ignore sign of 'm' */
198. if (!BN_copy(aa, m))
^
199. goto err;
200. aa->neg = 0;
crypto/bn/bn_lib.c:323:1: <Offset trace>
321. }
322.
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324. {
325. bn_check_top(b);
crypto/bn/bn_lib.c:323:1: Parameter `b->top`
321. }
322.
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324. {
325. bn_check_top(b);
crypto/bn/bn_lib.c:323:1: <Length trace>
321. }
322.
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324. {
325. bn_check_top(b);
crypto/bn/bn_lib.c:323:1: Parameter `*a->d`
321. }
322.
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324. {
325. bn_check_top(b);
crypto/bn/bn_lib.c:329:9: Call
327. if (a == b)
328. return a;
329. if (bn_wexpand(a, b->top) == NULL)
^
330. return NULL;
331.
crypto/bn/bn_lib.c:948:1: Parameter `*a->d`
946. }
947.
948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:333:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `DH_check`
331.
332. if (b->top > 0)
333. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
^
334.
335. a->top = b->top;
|
https://github.com/openssl/openssl/blob/dc99b885ded3cbc586d5ffec779f0e75a269bda3/crypto/bn/bn_lib.c/#L333
|
d2a_code_trace_data_44562
|
YUV2RGBFUNC(yuva2argb_c, uint32_t, 1)
LOADCHROMA(0);
PUTRGBA(dst_1, py_1, pa_1, 0, 0);
PUTRGBA(dst_2, py_2, pa_2, 0, 0);
LOADCHROMA(1);
PUTRGBA(dst_2, py_2, pa_2, 1, 0);
PUTRGBA(dst_1, py_1, pa_1, 1, 0);
LOADCHROMA(2);
PUTRGBA(dst_1, py_1, pa_1, 2, 0);
PUTRGBA(dst_2, py_2, pa_2, 2, 0);
LOADCHROMA(3);
PUTRGBA(dst_2, py_2, pa_2, 3, 0);
PUTRGBA(dst_1, py_1, pa_1, 3, 0);
pa_1 += 8; \
pa_2 += 8; \
ENDYUV2RGBLINE(8)
LOADCHROMA(0);
PUTRGBA(dst_1, py_1, pa_1, 0, 0);
PUTRGBA(dst_2, py_2, pa_2, 0, 0);
LOADCHROMA(1);
PUTRGBA(dst_2, py_2, pa_2, 1, 0);
PUTRGBA(dst_1, py_1, pa_1, 1, 0);
ENDYUV2RGBFUNC()
libswscale/yuv2rgb.c:293: error: Uninitialized Value
The value read from pa_1 was never initialized.
libswscale/yuv2rgb.c:293:5:
291. PUTRGBA(dst_2, py_2, pa_2, 3, 0);
292. PUTRGBA(dst_1, py_1, pa_1, 3, 0);
293. pa_1 += 8; \
^
294. pa_2 += 8; \
295. ENDYUV2RGBLINE(8)
|
https://github.com/libav/libav/blob/0ad522afb3a3b3d22402ecb82dd4609f7655031b/libswscale/yuv2rgb.c/#L293
|
d2a_code_trace_data_44563
|
static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
{
MOVStts *ctts_entries;
uint32_t entries = 0;
uint32_t atom_size;
int i;
ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries));
ctts_entries[0].count = 1;
ctts_entries[0].duration = track->cluster[0].cts;
for (i = 1; i < track->entry; i++) {
if (track->cluster[i].cts == ctts_entries[entries].duration) {
ctts_entries[entries].count++;
} else {
entries++;
ctts_entries[entries].duration = track->cluster[i].cts;
ctts_entries[entries].count = 1;
}
}
entries++;
atom_size = 16 + (entries * 8);
avio_wb32(pb, atom_size);
ffio_wfourcc(pb, "ctts");
avio_wb32(pb, 0);
avio_wb32(pb, entries);
for (i = 0; i < entries; i++) {
avio_wb32(pb, ctts_entries[i].count);
avio_wb32(pb, ctts_entries[i].duration);
}
av_free(ctts_entries);
return atom_size;
}
libavformat/movenc.c:1120: error: Null Dereference
pointer `ctts_entries` last assigned on line 1119 could be null and is dereferenced at line 1120, column 5.
libavformat/movenc.c:1112:1: start of procedure mov_write_ctts_tag()
1110. }
1111.
1112. static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
^
1113. {
1114. MOVStts *ctts_entries;
libavformat/movenc.c:1115:5:
1113. {
1114. MOVStts *ctts_entries;
1115. uint32_t entries = 0;
^
1116. uint32_t atom_size;
1117. int i;
libavformat/movenc.c:1119:5:
1117. int i;
1118.
1119. ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */
^
1120. ctts_entries[0].count = 1;
1121. ctts_entries[0].duration = track->cluster[0].cts;
libavutil/mem.c:61:1: start of procedure av_malloc()
59. * linker will do it automatically. */
60.
61. void *av_malloc(size_t size)
^
62. {
63. void *ptr = NULL;
libavutil/mem.c:63:5:
61. void *av_malloc(size_t size)
62. {
63. void *ptr = NULL;
^
64. #if CONFIG_MEMALIGN_HACK
65. long diff;
libavutil/mem.c:69:9: Taking true branch
67.
68. /* let's disallow possibly ambiguous cases */
69. if (size > (INT_MAX - 32) || !size)
^
70. return NULL;
71.
libavutil/mem.c:70:9:
68. /* let's disallow possibly ambiguous cases */
69. if (size > (INT_MAX - 32) || !size)
70. return NULL;
^
71.
72. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:114:1: return from a call to av_malloc
112. #endif
113. return ptr;
114. }
^
115.
116. void *av_realloc(void *ptr, size_t size)
libavformat/movenc.c:1120:5:
1118.
1119. ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */
1120. ctts_entries[0].count = 1;
^
1121. ctts_entries[0].duration = track->cluster[0].cts;
1122. for (i = 1; i < track->entry; i++) {
|
https://github.com/libav/libav/blob/72072bf9de3241848ea86f68d2297b7a5d6ad49b/libavformat/movenc.c/#L1120
|
d2a_code_trace_data_44564
|
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
enum AVSampleFormat sample_fmt, int align)
{
int line_size;
int sample_size = av_get_bytes_per_sample(sample_fmt);
int planar = av_sample_fmt_is_planar(sample_fmt);
if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
return AVERROR(EINVAL);
if (!align) {
if (nb_samples > INT_MAX - 31)
return AVERROR(EINVAL);
align = 1;
nb_samples = FFALIGN(nb_samples, 32);
}
if (nb_channels > INT_MAX / align ||
(int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)
return AVERROR(EINVAL);
line_size = planar ? FFALIGN(nb_samples * sample_size, align) :
FFALIGN(nb_samples * sample_size * nb_channels, align);
if (linesize)
*linesize = line_size;
return planar ? line_size * nb_channels : line_size;
}
libavresample/utils.c:379: error: Integer Overflow L2
([1, 2147483616] + 32):signed32 by call to `ff_audio_data_copy`.
libavresample/utils.c:367:15: Call
365. if (input) {
366. /* initialize input_buffer with input data */
367. ret = ff_audio_data_init(&input_buffer, input, in_plane_size,
^
368. avr->in_channels, in_samples,
369. avr->in_sample_fmt, 1, "input");
libavresample/audio_data.c:65:1: Parameter `a->nb_samples`
63. }
64.
65. int ff_audio_data_init(AudioData *a, uint8_t **src, int plane_size, int channels,
^
66. int nb_samples, enum AVSampleFormat sample_fmt,
67. int read_only, const char *name)
libavresample/utils.c:379:19: Call
377. directly in the output buffer */
378. av_dlog(avr, "[copy] %s to output\n", current_buffer->name);
379. ret = ff_audio_data_copy(&output_buffer, current_buffer,
^
380. avr->remap_point == REMAP_OUT_COPY ?
381. &avr->ch_map_info : NULL);
libavresample/audio_data.c:216:1: Parameter `src->nb_samples`
214. }
215.
216. int ff_audio_data_copy(AudioData *dst, AudioData *src, ChannelMapInfo *map)
^
217. {
218. int ret, p;
libavresample/audio_data.c:236:11: Call
234.
235. /* reallocate output if necessary */
236. ret = ff_audio_data_realloc(dst, src->nb_samples);
^
237. if (ret < 0)
238. return ret;
libavresample/audio_data.c:153:1: Parameter `nb_samples`
151. }
152.
153. int ff_audio_data_realloc(AudioData *a, int nb_samples)
^
154. {
155. int ret, new_buf_size, plane_size, p;
libavresample/audio_data.c:165:20: Call
163. return AVERROR(EINVAL);
164.
165. new_buf_size = av_samples_get_buffer_size(&plane_size,
^
166. a->allocated_channels, nb_samples,
167. a->sample_fmt, 0);
libavutil/samplefmt.c:108:1: <LHS trace>
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:108:1: Parameter `nb_samples`
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `ff_audio_data_copy`
122. return AVERROR(EINVAL);
123. align = 1;
124. nb_samples = FFALIGN(nb_samples, 32);
^
125. }
126.
|
https://github.com/libav/libav/blob/0e830094ad0dc251613a0aa3234d9c5c397e02e6/libavutil/samplefmt.c/#L124
|
d2a_code_trace_data_44565
|
int
TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
{
TIFFDirectory *td = &tif->tif_dir;
if (x >= td->td_imagewidth) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"%lu: Col out of range, max %lu",
(unsigned long) x,
(unsigned long) (td->td_imagewidth - 1));
return (0);
}
if (y >= td->td_imagelength) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"%lu: Row out of range, max %lu",
(unsigned long) y,
(unsigned long) (td->td_imagelength - 1));
return (0);
}
if (z >= td->td_imagedepth) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"%lu: Depth out of range, max %lu",
(unsigned long) z,
(unsigned long) (td->td_imagedepth - 1));
return (0);
}
if (td->td_planarconfig == PLANARCONFIG_SEPARATE &&
s >= td->td_samplesperpixel) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"%lu: Sample out of range, max %lu",
(unsigned long) s,
(unsigned long) (td->td_samplesperpixel - 1));
return (0);
}
return (1);
}
libtiff/tif_getimage.c:728: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `TIFFReadTile`.
libtiff/tif_getimage.c:722:8: Call
720. for (col = 0; col < w; col += tw)
721. {
722. if (TIFFReadTile(tif, p0, col+img->col_offset,
^
723. row+img->row_offset,0,0)!=(tmsize_t)(-1) && img->stoponerr)
724. {
libtiff/tif_read.c:415:1: Parameter `tif->tif_dir.td_imagewidth`
413. * tile is selected by the (x,y,z,s) coordinates.
414. */
415. tmsize_t
^
416. TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
417. {
libtiff/tif_getimage.c:728:8: Call
726. break;
727. }
728. if (TIFFReadTile(tif, p1, col+img->col_offset,
^
729. row+img->row_offset,0,1)!=(tmsize_t)(-1) && img->stoponerr)
730. {
libtiff/tif_read.c:415:1: Parameter `tif->tif_dir.td_imagewidth`
413. * tile is selected by the (x,y,z,s) coordinates.
414. */
415. tmsize_t
^
416. TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
417. {
libtiff/tif_getimage.c:734:8: Call
732. break;
733. }
734. if (TIFFReadTile(tif, p2, col+img->col_offset,
^
735. row+img->row_offset,0,2)!=(tmsize_t)(-1) && img->stoponerr)
736. {
libtiff/tif_read.c:415:1: Parameter `tif->tif_dir.td_imagewidth`
413. * tile is selected by the (x,y,z,s) coordinates.
414. */
415. tmsize_t
^
416. TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
417. {
libtiff/tif_getimage.c:722:8: Call
720. for (col = 0; col < w; col += tw)
721. {
722. if (TIFFReadTile(tif, p0, col+img->col_offset,
^
723. row+img->row_offset,0,0)!=(tmsize_t)(-1) && img->stoponerr)
724. {
libtiff/tif_read.c:415:1: Parameter `tif->tif_dir.td_imagewidth`
413. * tile is selected by the (x,y,z,s) coordinates.
414. */
415. tmsize_t
^
416. TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
417. {
libtiff/tif_getimage.c:728:8: Call
726. break;
727. }
728. if (TIFFReadTile(tif, p1, col+img->col_offset,
^
729. row+img->row_offset,0,1)!=(tmsize_t)(-1) && img->stoponerr)
730. {
libtiff/tif_read.c:415:1: Parameter `tif->tif_dir.td_imagewidth`
413. * tile is selected by the (x,y,z,s) coordinates.
414. */
415. tmsize_t
^
416. TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
417. {
libtiff/tif_read.c:418:33: Call
416. TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
417. {
418. if (!TIFFCheckRead(tif, 1) || !TIFFCheckTile(tif, x, y, z, s))
^
419. return ((tmsize_t)(-1));
420. return (TIFFReadEncodedTile(tif,
libtiff/tif_tile.c:100:1: <LHS trace>
98. * against the image bounds.
99. */
100. int
^
101. TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
102. {
libtiff/tif_tile.c:100:1: Parameter `x`
98. * against the image bounds.
99. */
100. int
^
101. TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
102. {
libtiff/tif_tile.c:106:3: Binary operation: ([0, +oo] - 1):unsigned32 by call to `TIFFReadTile`
104.
105. if (x >= td->td_imagewidth) {
106. TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
^
107. "%lu: Col out of range, max %lu",
108. (unsigned long) x,
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_tile.c/#L106
|
d2a_code_trace_data_44566
|
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr,
int32_t sb_samples[SBLIMIT])
{
int32_t tmp[32];
register MPA_INT *synth_buf;
register const MPA_INT *w, *w2, *p;
int j, offset, v;
OUT_INT *samples2;
#if FRAC_BITS <= 15
int sum, sum2;
#else
int64_t sum, sum2;
#endif
dct32(tmp, sb_samples);
offset = *synth_buf_offset;
synth_buf = synth_buf_ptr + offset;
for(j=0;j<32;j++) {
v = tmp[j];
#if FRAC_BITS <= 15
v = av_clip_int16(v);
#endif
synth_buf[j] = v;
}
memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT));
samples2 = samples + 31 * incr;
w = window;
w2 = window + 31;
sum = *dither_state;
p = synth_buf + 16;
SUM8(sum, +=, w, p);
p = synth_buf + 48;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
samples += incr;
w++;
for(j=1;j<16;j++) {
sum2 = 0;
p = synth_buf + 16 + j;
SUM8P2(sum, +=, sum2, -=, w, w2, p);
p = synth_buf + 48 - j;
SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
*samples = round_sample(&sum);
samples += incr;
sum += sum2;
*samples2 = round_sample(&sum);
samples2 -= incr;
w++;
w2--;
}
p = synth_buf + 32;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
*dither_state= sum;
offset = (offset - 32) & 511;
*synth_buf_offset = offset;
}
libavcodec/mpc.c:60: error: Buffer Overrun L2
Offset: [240+min(0, `c->synth_buf_offset[*]`), 241+max(511, `c->synth_buf_offset[*]`)] (⇐ [48+min(0, `c->synth_buf_offset[*]`), 49+max(511, `c->synth_buf_offset[*]`)] + 192) Size: 2 by call to `ff_mpa_synth_filter`.
libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]`
49. * Process decoded Musepack data and produce PCM
50. */
51. static void mpc_synth(MPCContext *c, int16_t *out)
^
52. {
53. int dither_state = 0;
libavcodec/mpc.c:60:13: Call
58. samples_ptr = samples + ch;
59. for(i = 0; i < SAMPLES_PER_BAND; i++) {
60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
^
61. mpa_window, &dither_state,
62. samples_ptr, 2,
libavcodec/mpegaudiodec.c:858:1: <Length trace>
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr`
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:877:5: Assignment
875.
876. offset = *synth_buf_offset;
877. synth_buf = synth_buf_ptr + offset;
^
878.
879. for(j=0;j<32;j++) {
libavcodec/mpegaudiodec.c:898:5: Assignment
896. p = synth_buf + 16;
897. SUM8(sum, +=, w, p);
898. p = synth_buf + 48;
^
899. SUM8(sum, -=, w + 32, p);
900. *samples = round_sample(&sum);
libavcodec/mpegaudiodec.c:899:5: Array access: Offset: [240+min(0, c->synth_buf_offset[*]), 241+max(511, c->synth_buf_offset[*])] (⇐ [48+min(0, c->synth_buf_offset[*]), 49+max(511, c->synth_buf_offset[*])] + 192) Size: 2 by call to `ff_mpa_synth_filter`
897. SUM8(sum, +=, w, p);
898. p = synth_buf + 48;
899. SUM8(sum, -=, w + 32, p);
^
900. *samples = round_sample(&sum);
901. samples += incr;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L899
|
d2a_code_trace_data_44567
|
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr,
int32_t sb_samples[SBLIMIT])
{
int32_t tmp[32];
register MPA_INT *synth_buf;
register const MPA_INT *w, *w2, *p;
int j, offset, v;
OUT_INT *samples2;
#if FRAC_BITS <= 15
int sum, sum2;
#else
int64_t sum, sum2;
#endif
dct32(tmp, sb_samples);
offset = *synth_buf_offset;
synth_buf = synth_buf_ptr + offset;
for(j=0;j<32;j++) {
v = tmp[j];
#if FRAC_BITS <= 15
v = av_clip_int16(v);
#endif
synth_buf[j] = v;
}
memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT));
samples2 = samples + 31 * incr;
w = window;
w2 = window + 31;
sum = *dither_state;
p = synth_buf + 16;
SUM8(sum, +=, w, p);
p = synth_buf + 48;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
samples += incr;
w++;
for(j=1;j<16;j++) {
sum2 = 0;
p = synth_buf + 16 + j;
SUM8P2(sum, +=, sum2, -=, w, w2, p);
p = synth_buf + 48 - j;
SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
*samples = round_sample(&sum);
samples += incr;
sum += sum2;
*samples2 = round_sample(&sum);
samples2 -= incr;
w++;
w2--;
}
p = synth_buf + 32;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
*dither_state= sum;
offset = (offset - 32) & 511;
*synth_buf_offset = offset;
}
libavcodec/mpc.c:60: error: Buffer Overrun L2
Offset: [352+min(0, `c->synth_buf_offset[*]`), 353+max(511, `c->synth_buf_offset[*]`)] (⇐ [32+min(0, `c->synth_buf_offset[*]`), 33+max(511, `c->synth_buf_offset[*]`)] + 320) Size: 2 by call to `ff_mpa_synth_filter`.
libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]`
49. * Process decoded Musepack data and produce PCM
50. */
51. static void mpc_synth(MPCContext *c, int16_t *out)
^
52. {
53. int dither_state = 0;
libavcodec/mpc.c:60:13: Call
58. samples_ptr = samples + ch;
59. for(i = 0; i < SAMPLES_PER_BAND; i++) {
60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
^
61. mpa_window, &dither_state,
62. samples_ptr, 2,
libavcodec/mpegaudiodec.c:858:1: <Length trace>
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr`
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:877:5: Assignment
875.
876. offset = *synth_buf_offset;
877. synth_buf = synth_buf_ptr + offset;
^
878.
879. for(j=0;j<32;j++) {
libavcodec/mpegaudiodec.c:922:5: Assignment
920. }
921.
922. p = synth_buf + 32;
^
923. SUM8(sum, -=, w + 32, p);
924. *samples = round_sample(&sum);
libavcodec/mpegaudiodec.c:923:5: Array access: Offset: [352+min(0, c->synth_buf_offset[*]), 353+max(511, c->synth_buf_offset[*])] (⇐ [32+min(0, c->synth_buf_offset[*]), 33+max(511, c->synth_buf_offset[*])] + 320) Size: 2 by call to `ff_mpa_synth_filter`
921.
922. p = synth_buf + 32;
923. SUM8(sum, -=, w + 32, p);
^
924. *samples = round_sample(&sum);
925. *dither_state= sum;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L923
|
d2a_code_trace_data_44568
|
static void print_sdp(OutputFile *output_files, int n)
{
char sdp[2048];
int i;
AVFormatContext **avc = av_malloc(sizeof(*avc) * n);
if (!avc)
exit_program(1);
for (i = 0; i < n; i++)
avc[i] = output_files[i].ctx;
av_sdp_create(avc, n, sdp, sizeof(sdp));
printf("SDP:\n%s\n", sdp);
fflush(stdout);
av_freep(&avc);
}
avconv.c:2153: error: Null Dereference
pointer `avc` last assigned on line 2148 could be null and is dereferenced at line 2153, column 9.
avconv.c:2144:1: start of procedure print_sdp()
2142. }
2143.
2144. static void print_sdp(OutputFile *output_files, int n)
^
2145. {
2146. char sdp[2048];
avconv.c:2148:5:
2146. char sdp[2048];
2147. int i;
2148. AVFormatContext **avc = av_malloc(sizeof(*avc) * n);
^
2149.
2150. if (!avc)
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking true branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:73:9:
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
73. return NULL;
^
74.
75. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
avconv.c:2150:10: Taking true branch
2148. AVFormatContext **avc = av_malloc(sizeof(*avc) * n);
2149.
2150. if (!avc)
^
2151. exit_program(1);
2152. for (i = 0; i < n; i++)
avconv.c:2151:9: Skipping exit_program(): empty list of specs
2149.
2150. if (!avc)
2151. exit_program(1);
^
2152. for (i = 0; i < n; i++)
2153. avc[i] = output_files[i].ctx;
avconv.c:2152:10:
2150. if (!avc)
2151. exit_program(1);
2152. for (i = 0; i < n; i++)
^
2153. avc[i] = output_files[i].ctx;
2154.
avconv.c:2152:17: Loop condition is true. Entering loop body
2150. if (!avc)
2151. exit_program(1);
2152. for (i = 0; i < n; i++)
^
2153. avc[i] = output_files[i].ctx;
2154.
avconv.c:2153:9:
2151. exit_program(1);
2152. for (i = 0; i < n; i++)
2153. avc[i] = output_files[i].ctx;
^
2154.
2155. av_sdp_create(avc, n, sdp, sizeof(sdp));
|
https://github.com/libav/libav/blob/e1e369049e3d2f88eed6ed38eb3dd704681c7f1a/avconv.c/#L2153
|
d2a_code_trace_data_44569
|
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
*allocbytes = (unsigned char *)pkt->buf->data + pkt->curr;
return 1;
}
ssl/t1_reneg.c:60: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `s->s3->previous_client_finished_len` + `pkt->written` + 7]):unsigned64 by call to `WPACKET_memcpy`.
Showing all 12 steps of the trace
ssl/t1_reneg.c:58:17: Call
56. || !WPACKET_start_sub_packet_u16(pkt)
57. || !WPACKET_start_sub_packet_u8(pkt)
58. || !WPACKET_memcpy(pkt, s->s3->previous_client_finished,
^
59. s->s3->previous_client_finished_len)
60. || !WPACKET_memcpy(pkt, s->s3->previous_server_finished,
ssl/packet.c:302:1: Parameter `pkt->buf->length`
300. }
301.
302. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
303. {
304. unsigned char *dest;
ssl/t1_reneg.c:60:17: Call
58. || !WPACKET_memcpy(pkt, s->s3->previous_client_finished,
59. s->s3->previous_client_finished_len)
60. || !WPACKET_memcpy(pkt, s->s3->previous_server_finished,
^
61. s->s3->previous_server_finished_len)
62. || !WPACKET_close(pkt)
ssl/packet.c:302:1: Parameter `pkt->written`
300. }
301.
302. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
303. {
304. unsigned char *dest;
ssl/packet.c:309:10: Call
307. return 1;
308.
309. if (!WPACKET_allocate_bytes(pkt, len, &dest))
^
310. return 0;
311.
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:36:1: <LHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `pkt->buf->length`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: <RHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `len`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, s->s3->previous_client_finished_len + pkt->written + 7]):unsigned64 by call to `WPACKET_memcpy`
44. return 0;
45.
46. if (pkt->buf->length - pkt->written < len) {
^
47. size_t newlen;
48. size_t reflen;
|
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
|
d2a_code_trace_data_44570
|
int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
{
int rv, start_idx, i;
if (x == NULL) {
x = sk_X509_value(sk, 0);
start_idx = 1;
} else
start_idx = 0;
rv = ssl_security_cert(s, NULL, x, vfy, 1);
if (rv != 1)
return rv;
for (i = start_idx; i < sk_X509_num(sk); i++) {
x = sk_X509_value(sk, i);
rv = ssl_security_cert(s, NULL, x, vfy, 0);
if (rv != 1)
return rv;
}
return 1;
}
ssl/t1_lib.c:4189: error: NULL_DEREFERENCE
pointer `null` is dereferenced by call to `ssl_security_cert()` at line 4189, column 10.
Showing all 4 steps of the trace
ssl/t1_lib.c:4180:1: start of procedure ssl_security_cert_chain()
4178. */
4179.
4180. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
4181. {
4182. int rv, start_idx, i;
ssl/t1_lib.c:4183:9: Taking false branch
4181. {
4182. int rv, start_idx, i;
4183. if (x == NULL) {
^
4184. x = sk_X509_value(sk, 0);
4185. start_idx = 1;
ssl/t1_lib.c:4187:9:
4185. start_idx = 1;
4186. } else
4187. > start_idx = 0;
4188.
4189. rv = ssl_security_cert(s, NULL, x, vfy, 1);
ssl/t1_lib.c:4189:5:
4187. start_idx = 0;
4188.
4189. > rv = ssl_security_cert(s, NULL, x, vfy, 1);
4190. if (rv != 1)
4191. return rv;
|
https://github.com/openssl/openssl/blob/2ac7753c107e71bfdcaa08b18eb4e6683292be57/ssl/t1_lib.c/#L4189
|
d2a_code_trace_data_44571
|
static int flv_write_header(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
FLVContext *flv = s->priv_data;
int i, width, height, samplerate, samplesize, channels, audiocodecid, videocodecid;
double framerate = 0.0;
int metadata_size_pos, data_size;
flv->hasAudio = 0;
flv->hasVideo = 0;
for(i=0; i<s->nb_streams; i++){
AVCodecContext *enc = s->streams[i]->codec;
if (enc->codec_type == CODEC_TYPE_VIDEO) {
width = enc->width;
height = enc->height;
if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) {
framerate = av_q2d(s->streams[i]->r_frame_rate);
} else {
framerate = 1/av_q2d(s->streams[i]->codec->time_base);
}
flv->hasVideo=1;
videocodecid = enc->codec_tag;
if(videocodecid == 0) {
av_log(enc, AV_LOG_ERROR, "video codec not compatible with flv\n");
return -1;
}
} else {
flv->hasAudio=1;
samplerate = enc->sample_rate;
channels = enc->channels;
audiocodecid = enc->codec_tag;
samplesize = (enc->codec_id == CODEC_ID_PCM_S8) ? 8 : 16;
if(get_audio_flags(enc)<0)
return -1;
}
av_set_pts_info(s->streams[i], 24, 1, 1000);
}
put_tag(pb,"FLV");
put_byte(pb,1);
put_byte(pb, FLV_HEADER_FLAG_HASAUDIO * flv->hasAudio
+ FLV_HEADER_FLAG_HASVIDEO * flv->hasVideo);
put_be32(pb,9);
put_be32(pb,0);
for(i=0; i<s->nb_streams; i++){
if(s->streams[i]->codec->codec_tag == 5){
put_byte(pb,8);
put_be24(pb,0);
put_be24(pb,0);
put_be32(pb,0);
put_be32(pb,11);
flv->reserved=5;
}
}
put_byte(pb, 18);
metadata_size_pos= url_ftell(pb);
put_be24(pb, 0);
put_be24(pb, 0);
put_be32(pb, 0);
put_byte(pb, AMF_DATA_TYPE_STRING);
put_amf_string(pb, "onMetaData");
put_byte(pb, AMF_DATA_TYPE_MIXEDARRAY);
put_be32(pb, 5*flv->hasVideo + 4*flv->hasAudio + 2);
put_amf_string(pb, "duration");
flv->duration_offset= url_ftell(pb);
put_amf_double(pb, 0);
if(flv->hasVideo){
put_amf_string(pb, "width");
put_amf_double(pb, width);
put_amf_string(pb, "height");
put_amf_double(pb, height);
put_amf_string(pb, "videodatarate");
put_amf_double(pb, s->bit_rate / 1024.0);
put_amf_string(pb, "framerate");
put_amf_double(pb, framerate);
put_amf_string(pb, "videocodecid");
put_amf_double(pb, videocodecid);
}
if(flv->hasAudio){
put_amf_string(pb, "audiosamplerate");
put_amf_double(pb, samplerate);
put_amf_string(pb, "audiosamplesize");
put_amf_double(pb, samplesize);
put_amf_string(pb, "stereo");
put_amf_bool(pb, (channels == 2));
put_amf_string(pb, "audiocodecid");
put_amf_double(pb, audiocodecid);
}
put_amf_string(pb, "filesize");
flv->filesize_offset= url_ftell(pb);
put_amf_double(pb, 0);
put_amf_string(pb, "");
put_byte(pb, AMF_END_OF_OBJECT);
data_size= url_ftell(pb) - metadata_size_pos - 10;
url_fseek(pb, metadata_size_pos, SEEK_SET);
put_be24(pb, data_size);
url_fseek(pb, data_size + 10 - 3, SEEK_CUR);
put_be32(pb, data_size + 11);
return 0;
}
libavformat/flvenc.c:232: error: Uninitialized Value
The value read from channels was never initialized.
libavformat/flvenc.c:232:27:
230.
231. put_amf_string(pb, "stereo");
232. put_amf_bool(pb, (channels == 2));
^
233.
234. put_amf_string(pb, "audiocodecid");
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/flvenc.c/#L232
|
d2a_code_trace_data_44572
|
static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
const int size, const int h, int ref_index, int src_index,
me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
MotionEstContext * const c= &s->me;
const int stride= c->stride;
const int uvstride= c->uvstride;
const int qpel= flags&FLAG_QPEL;
const int chroma= flags&FLAG_CHROMA;
const int dxy= subx + (suby<<(1+qpel));
const int hx= subx + (x<<(1+qpel));
const int hy= suby + (y<<(1+qpel));
uint8_t * const * const ref= c->ref[ref_index];
uint8_t * const * const src= c->src[src_index];
int d;
if(flags&FLAG_DIRECT){
assert(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1));
if(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)){
const int time_pp= s->pp_time;
const int time_pb= s->pb_time;
const int mask= 2*qpel+1;
if(s->mv_type==MV_TYPE_8X8){
int i;
for(i=0; i<4; i++){
int fx = c->direct_basis_mv[i][0] + hx;
int fy = c->direct_basis_mv[i][1] + hy;
int bx = hx ? fx - c->co_located_mv[i][0] : c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(qpel+4));
int by = hy ? fy - c->co_located_mv[i][1] : c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(qpel+4));
int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
uint8_t *dst= c->temp + 8*(i&1) + 8*stride*(i>>1);
if(qpel){
c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride);
c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride);
}else{
c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8);
c->hpel_avg[1][bxy](dst, ref[8] + (bx>>1) + (by>>1)*stride, stride, 8);
}
}
}else{
int fx = c->direct_basis_mv[0][0] + hx;
int fy = c->direct_basis_mv[0][1] + hy;
int bx = hx ? fx - c->co_located_mv[0][0] : (c->co_located_mv[0][0]*(time_pb - time_pp)/time_pp);
int by = hy ? fy - c->co_located_mv[0][1] : (c->co_located_mv[0][1]*(time_pb - time_pp)/time_pp);
int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
if(qpel){
c->qpel_put[1][fxy](c->temp , ref[0] + (fx>>2) + (fy>>2)*stride , stride);
c->qpel_put[1][fxy](c->temp + 8 , ref[0] + (fx>>2) + (fy>>2)*stride + 8 , stride);
c->qpel_put[1][fxy](c->temp + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8*stride, stride);
c->qpel_put[1][fxy](c->temp + 8 + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8 + 8*stride, stride);
c->qpel_avg[1][bxy](c->temp , ref[8] + (bx>>2) + (by>>2)*stride , stride);
c->qpel_avg[1][bxy](c->temp + 8 , ref[8] + (bx>>2) + (by>>2)*stride + 8 , stride);
c->qpel_avg[1][bxy](c->temp + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8*stride, stride);
c->qpel_avg[1][bxy](c->temp + 8 + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8 + 8*stride, stride);
}else{
assert((fx>>1) + 16*s->mb_x >= -16);
assert((fy>>1) + 16*s->mb_y >= -16);
assert((fx>>1) + 16*s->mb_x <= s->width);
assert((fy>>1) + 16*s->mb_y <= s->height);
assert((bx>>1) + 16*s->mb_x >= -16);
assert((by>>1) + 16*s->mb_y >= -16);
assert((bx>>1) + 16*s->mb_x <= s->width);
assert((by>>1) + 16*s->mb_y <= s->height);
c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
}
}
d = cmp_func(s, c->temp, src[0], stride, 16);
}else
d= 256*256*256*32;
}else{
int uvdxy;
if(dxy){
if(qpel){
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride);
if(chroma){
int cx= hx/2;
int cy= hy/2;
cx= (cx>>1)|(cx&1);
cy= (cy>>1)|(cy&1);
uvdxy= (cx&1) + 2*(cy&1);
}
}else{
c->hpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride, h);
if(chroma)
uvdxy= dxy | (x&1) | (2*(y&1));
}
d = cmp_func(s, c->temp, src[0], stride, h);
}else{
d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h);
if(chroma)
uvdxy= (x&1) + 2*(y&1);
}
if(chroma){
uint8_t * const uvtemp= c->temp + 16*stride;
c->hpel_put[size+1][uvdxy](uvtemp , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
d += chroma_cmp_func(s, uvtemp , src[1], uvstride, h>>1);
d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1);
}
}
#if 0
if(full_pel){
const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);
score_map[index]= d;
}
d += (c->mv_penalty[hx - c->pred_x] + c->mv_penalty[hy - c->pred_y])*c->penalty_factor;
#endif
return d;
}
libavcodec/motion_est.c:1890: error: Buffer Overrun L1
Offset: 8 Size: 4 by call to `ff_estimate_motion_b`.
libavcodec/motion_est.c:1890:17: Call
1888. if(type == CANDIDATE_MB_TYPE_FORWARD || type == CANDIDATE_MB_TYPE_BIDIR){
1889. c->skip=0;
1890. ff_estimate_motion_b(s, mb_x, mb_y, s->b_forw_mv_table, 0, s->f_code);
^
1891. }
1892. if(type == CANDIDATE_MB_TYPE_BACKWARD || type == CANDIDATE_MB_TYPE_BIDIR){
libavcodec/motion_est.c:1481:1: Parameter `ref_index`
1479. }
1480.
1481. static int ff_estimate_motion_b(MpegEncContext * s,
^
1482. int mb_x, int mb_y, int16_t (*mv_table)[2], int ref_index, int f_code)
1483. {
libavcodec/motion_est.c:1564:15: Call
1562.
1563. if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip)
1564. dmin= ff_get_mb_score(s, mx, my, 0, ref_index, 0, 16, 1);
^
1565.
1566. //printf("%d %d %d %d//", s->mb_x, s->mb_y, mx, my);
libavcodec/motion_est_template.c:235:1: Parameter `ref_index`
233. }
234.
235. inline int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index,
^
236. int ref_index, int size, int h, int add_rate)
237. {
libavcodec/motion_est_template.c:257:8: Call
255. // assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp);
256.
257. d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
^
258. //FIXME check cbp before adding penalty for (0,0) vector
259. if(add_rate && (mx || my || size>0))
libavcodec/motion_est.c:108:1: <Length trace>
106. against a proposed motion-compensated prediction of that block
107. */
108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
^
109. const int size, const int h, int ref_index, int src_index,
110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
libavcodec/motion_est.c:108:1: Parameter `ref_index`
106. against a proposed motion-compensated prediction of that block
107. */
108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
^
109. const int size, const int h, int ref_index, int src_index,
110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
libavcodec/motion_est.c:119:5: Assignment
117. const int hx= subx + (x<<(1+qpel));
118. const int hy= suby + (y<<(1+qpel));
119. uint8_t * const * const ref= c->ref[ref_index];
^
120. uint8_t * const * const src= c->src[src_index];
121. int d;
libavcodec/motion_est.c:176:50: Array access: Offset: 8 Size: 4 by call to `ff_estimate_motion_b`
174.
175. c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
176. c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
^
177. }
178. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L176
|
d2a_code_trace_data_44573
|
static void unpack_input(const unsigned char *input, unsigned int *output)
{
unsigned int outbuffer[28];
unsigned short inbuffer[10];
unsigned int x;
unsigned int *ptr;
for (x=0;x<20;x+=2)
inbuffer[x/2]=(input[x]<<8)+input[x+1];
ptr=outbuffer;
*(ptr++)=27;
*(ptr++)=(inbuffer[0]>>10)&0x3f;
*(ptr++)=(inbuffer[0]>>5)&0x1f;
*(ptr++)=inbuffer[0]&0x1f;
*(ptr++)=(inbuffer[1]>>12)&0xf;
*(ptr++)=(inbuffer[1]>>8)&0xf;
*(ptr++)=(inbuffer[1]>>5)&7;
*(ptr++)=(inbuffer[1]>>2)&7;
*(ptr++)=((inbuffer[1]<<1)&6)|((inbuffer[2]>>15)&1);
*(ptr++)=(inbuffer[2]>>12)&7;
*(ptr++)=(inbuffer[2]>>10)&3;
*(ptr++)=(inbuffer[2]>>5)&0x1f;
*(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3);
*(ptr++)=(inbuffer[3]>>6)&0xff;
*(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
*(ptr++)=(inbuffer[4]>>8)&0x7f;
*(ptr++)=(inbuffer[4]>>1)&0x7f;
*(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f);
*(ptr++)=(inbuffer[5]>>2)&0x7f;
*(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f);
*(ptr++)=(inbuffer[6]>>4)&0x7f;
*(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf);
*(ptr++)=(inbuffer[7]>>5)&0x7f;
*(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3);
*(ptr++)=(inbuffer[8]>>7)&0x7f;
*(ptr++)=((inbuffer[8]<<1)&0xfe)|((inbuffer[9]>>15)&1);
*(ptr++)=(inbuffer[9]>>8)&0x7f;
*(ptr++)=(inbuffer[9]>>1)&0x7f;
*(output++)=outbuffer[11];
for (x=1;x<11;*(output++)=outbuffer[x++]);
ptr=outbuffer+12;
for (x=0;x<16;x+=4)
{
*(output++)=ptr[x];
*(output++)=ptr[x+2];
*(output++)=ptr[x+3];
*(output++)=ptr[x+1];
}
}
libavcodec/ra144.c:283: error: Uninitialized Value
The value read from inbuffer[_] was never initialized.
libavcodec/ra144.c:283:3:
281. *(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
282. *(ptr++)=(inbuffer[4]>>8)&0x7f;
283. *(ptr++)=(inbuffer[4]>>1)&0x7f;
^
284. *(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f);
285. *(ptr++)=(inbuffer[5]>>2)&0x7f;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L283
|
d2a_code_trace_data_44574
|
ngx_int_t
ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
{
u_char *elts;
size_t len;
u_short *test;
ngx_uint_t i, n, key, size, start, bucket_size;
ngx_hash_elt_t *elt, **buckets;
for (n = 0; n < nelts; n++) {
if (names[n].key.len >= 255) {
ngx_log_error(NGX_LOG_EMERG, hinit->pool->log, 0,
"the \"%V\" value to hash is to long: %uz bytes, "
"the maximum length can be 255 bytes only",
&names[n].key, names[n].key.len);
return NGX_ERROR;
}
if (hinit->bucket_size < NGX_HASH_ELT_SIZE(&names[n]) + sizeof(void *))
{
ngx_log_error(NGX_LOG_EMERG, hinit->pool->log, 0,
"could not build the %s, you should "
"increase %s_bucket_size: %i",
hinit->name, hinit->name, hinit->bucket_size);
return NGX_ERROR;
}
}
test = ngx_alloc(hinit->max_size * sizeof(u_short), hinit->pool->log);
if (test == NULL) {
return NGX_ERROR;
}
bucket_size = hinit->bucket_size - sizeof(void *);
start = nelts / (bucket_size / (2 * sizeof(void *)));
start = start ? start : 1;
if (hinit->max_size > 10000 && hinit->max_size / nelts < 100) {
start = hinit->max_size - 1000;
}
for (size = start; size < hinit->max_size; size++) {
ngx_memzero(test, size * sizeof(u_short));
for (n = 0; n < nelts; n++) {
if (names[n].key.data == NULL) {
continue;
}
key = names[n].key_hash % size;
test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
#if 0
ngx_log_error(NGX_LOG_ALERT, hinit->pool->log, 0,
"%ui: %ui %ui \"%V\"",
size, key, test[key], &names[n].key);
#endif
if (test[key] > (u_short) bucket_size) {
goto next;
}
}
goto found;
next:
continue;
}
ngx_log_error(NGX_LOG_EMERG, hinit->pool->log, 0,
"could not build the %s, you should increase "
"either %s_max_size: %i or %s_bucket_size: %i",
hinit->name, hinit->name, hinit->max_size,
hinit->name, hinit->bucket_size);
ngx_free(test);
return NGX_ERROR;
found:
for (i = 0; i < size; i++) {
test[i] = sizeof(void *);
}
for (n = 0; n < nelts; n++) {
if (names[n].key.data == NULL) {
continue;
}
key = names[n].key_hash % size;
test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
}
len = 0;
for (i = 0; i < size; i++) {
if (test[i] == sizeof(void *)) {
continue;
}
test[i] = (u_short) (ngx_align(test[i], ngx_cacheline_size));
len += test[i];
}
if (hinit->hash == NULL) {
hinit->hash = ngx_pcalloc(hinit->pool, sizeof(ngx_hash_wildcard_t)
+ size * sizeof(ngx_hash_elt_t *));
if (hinit->hash == NULL) {
ngx_free(test);
return NGX_ERROR;
}
buckets = (ngx_hash_elt_t **)
((u_char *) hinit->hash + sizeof(ngx_hash_wildcard_t));
} else {
buckets = ngx_pcalloc(hinit->pool, size * sizeof(ngx_hash_elt_t *));
if (buckets == NULL) {
ngx_free(test);
return NGX_ERROR;
}
}
elts = ngx_palloc(hinit->pool, len + ngx_cacheline_size);
if (elts == NULL) {
ngx_free(test);
return NGX_ERROR;
}
elts = ngx_align_ptr(elts, ngx_cacheline_size);
for (i = 0; i < size; i++) {
if (test[i] == sizeof(void *)) {
continue;
}
buckets[i] = (ngx_hash_elt_t *) elts;
elts += test[i];
}
for (i = 0; i < size; i++) {
test[i] = 0;
}
for (n = 0; n < nelts; n++) {
if (names[n].key.data == NULL) {
continue;
}
key = names[n].key_hash % size;
elt = (ngx_hash_elt_t *) ((u_char *) buckets[key] + test[key]);
elt->value = names[n].value;
elt->len = (u_char) names[n].key.len;
ngx_strlow(elt->name, names[n].key.data, names[n].key.len);
test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
}
for (i = 0; i < size; i++) {
if (buckets[i] == NULL) {
continue;
}
elt = (ngx_hash_elt_t *) ((u_char *) buckets[i] + test[i]);
elt->value = NULL;
}
ngx_free(test);
hinit->hash->buckets = buckets;
hinit->hash->size = size;
#if 0
for (i = 0; i < size; i++) {
ngx_str_t val;
ngx_uint_t key;
elt = buckets[i];
if (elt == NULL) {
ngx_log_error(NGX_LOG_ALERT, hinit->pool->log, 0,
"%ui: NULL", i);
continue;
}
while (elt->value) {
val.len = elt->len;
val.data = &elt->name[0];
key = hinit->key(val.data, val.len);
ngx_log_error(NGX_LOG_ALERT, hinit->pool->log, 0,
"%ui: %p \"%V\" %ui", i, elt, &val, key);
elt = (ngx_hash_elt_t *) ngx_align_ptr(&elt->name[0] + elt->len,
sizeof(void *));
}
}
#endif
return NGX_OK;
}
src/http/ngx_http_upstream.c:4193: error: Buffer Overrun L3
Offset: [0, 534] (⇐ [0, 24] + [0, 510]) Size: [0, +oo] by call to `ngx_hash_init`.
src/http/ngx_http_upstream.c:4187:5: Assignment
4185. hash.hash = &umcf->headers_in_hash;
4186. hash.key = ngx_hash_key_lc;
4187. hash.max_size = 512;
^
4188. hash.bucket_size = ngx_align(64, ngx_cacheline_size);
4189. hash.name = "upstream_headers_in_hash";
src/http/ngx_http_upstream.c:4193:9: Call
4191. hash.temp_pool = NULL;
4192.
4193. if (ngx_hash_init(&hash, headers_in.elts, headers_in.nelts) != NGX_OK) {
^
4194. return NGX_CONF_ERROR;
4195. }
src/core/ngx_hash.c:250:1: <Offset trace>
248. (sizeof(void *) + ngx_align((name)->key.len + 1, sizeof(void *)))
249.
250. ngx_int_t
^
251. ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
252. {
src/core/ngx_hash.c:250:1: Parameter `hinit->max_size`
248. (sizeof(void *) + ngx_align((name)->key.len + 1, sizeof(void *)))
249.
250. ngx_int_t
^
251. ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
252. {
src/core/ngx_hash.c:250:1: <Length trace>
248. (sizeof(void *) + ngx_align((name)->key.len + 1, sizeof(void *)))
249.
250. ngx_int_t
^
251. ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
252. {
src/core/ngx_hash.c:250:1: Parameter `hinit->max_size`
248. (sizeof(void *) + ngx_align((name)->key.len + 1, sizeof(void *)))
249.
250. ngx_int_t
^
251. ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
252. {
src/core/ngx_hash.c:371:19: Call
369.
370. } else {
371. buckets = ngx_pcalloc(hinit->pool, size * sizeof(ngx_hash_elt_t *));
^
372. if (buckets == NULL) {
373. ngx_free(test);
src/core/ngx_palloc.c:283:1: Parameter `size`
281.
282.
283. void *
^
284. ngx_pcalloc(ngx_pool_t *pool, size_t size)
285. {
src/core/ngx_palloc.c:288:9: Call
286. void *p;
287.
288. p = ngx_palloc(pool, size);
^
289. if (p) {
290. ngx_memzero(p, size);
src/core/ngx_palloc.c:125:13: Assignment
123.
124. do {
125. m = ngx_align_ptr(p->d.last, NGX_ALIGNMENT);
^
126.
127. if ((size_t) (p->d.end - m) >= size) {
src/core/ngx_palloc.c:130:17: Assignment
128. p->d.last = m + size;
129.
130. return m;
^
131. }
132.
src/core/ngx_palloc.c:288:5: Assignment
286. void *p;
287.
288. p = ngx_palloc(pool, size);
^
289. if (p) {
290. ngx_memzero(p, size);
src/core/ngx_palloc.c:293:5: Assignment
291. }
292.
293. return p;
^
294. }
295.
src/core/ngx_hash.c:371:9: Assignment
369.
370. } else {
371. buckets = ngx_pcalloc(hinit->pool, size * sizeof(ngx_hash_elt_t *));
^
372. if (buckets == NULL) {
373. ngx_free(test);
src/core/ngx_hash.c:391:9: Array access: Offset: [0, 534] (⇐ [0, 24] + [0, 510]) Size: [0, +oo] by call to `ngx_hash_init`
389. }
390.
391. buckets[i] = (ngx_hash_elt_t *) elts;
^
392. elts += test[i];
393.
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_hash.c/#L391
|
d2a_code_trace_data_44575
|
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
*allocbytes = (unsigned char *)pkt->buf->data + pkt->curr;
pkt->written += len;
pkt->curr += len;
return 1;
}
ssl/t1_reneg.c:56: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 4]):unsigned64 by call to `WPACKET_start_sub_packet_len__`.
Showing all 10 steps of the trace
ssl/t1_reneg.c:55:10: Call
53. int ssl_add_serverhello_renegotiate_ext(SSL *s, WPACKET *pkt)
54. {
55. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
^
56. || !WPACKET_start_sub_packet_u16(pkt)
57. || !WPACKET_start_sub_packet_u8(pkt)
ssl/packet.c:242:1: Parameter `pkt->buf->length`
240. }
241.
242. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
243. {
244. unsigned char *data;
ssl/t1_reneg.c:56:17: Call
54. {
55. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
56. || !WPACKET_start_sub_packet_u16(pkt)
^
57. || !WPACKET_start_sub_packet_u8(pkt)
58. || !WPACKET_memcpy(pkt, s->s3->previous_client_finished,
ssl/packet.c:205:1: Parameter `pkt->written`
203. }
204.
205. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
206. {
207. WPACKET_SUB *sub;
ssl/packet.c:229:10: Call
227. }
228.
229. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
^
230. return 0;
231. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */
ssl/packet.c:15:1: <LHS trace>
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: Parameter `pkt->buf->length`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: <RHS trace>
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: Parameter `len`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:25:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 4]):unsigned64 by call to `WPACKET_start_sub_packet_len__`
23. return 0;
24.
25. if (pkt->buf->length - pkt->written < len) {
^
26. size_t newlen;
27. size_t reflen;
|
https://github.com/openssl/openssl/blob/7507e73d409b8f3046d6efcc3f4c0b6208b59b64/ssl/packet.c/#L25
|
d2a_code_trace_data_44576
|
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr,
int32_t sb_samples[SBLIMIT])
{
int32_t tmp[32];
register MPA_INT *synth_buf;
register const MPA_INT *w, *w2, *p;
int j, offset, v;
OUT_INT *samples2;
#if FRAC_BITS <= 15
int sum, sum2;
#else
int64_t sum, sum2;
#endif
dct32(tmp, sb_samples);
offset = *synth_buf_offset;
synth_buf = synth_buf_ptr + offset;
for(j=0;j<32;j++) {
v = tmp[j];
#if FRAC_BITS <= 15
v = av_clip_int16(v);
#endif
synth_buf[j] = v;
}
memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT));
samples2 = samples + 31 * incr;
w = window;
w2 = window + 31;
sum = *dither_state;
p = synth_buf + 16;
SUM8(sum, +=, w, p);
p = synth_buf + 48;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
samples += incr;
w++;
for(j=1;j<16;j++) {
sum2 = 0;
p = synth_buf + 16 + j;
SUM8P2(sum, +=, sum2, -=, w, w2, p);
p = synth_buf + 48 - j;
SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
*samples = round_sample(&sum);
samples += incr;
sum += sum2;
*samples2 = round_sample(&sum);
samples2 -= incr;
w++;
w2--;
}
p = synth_buf + 32;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
*dither_state= sum;
offset = (offset - 32) & 511;
*synth_buf_offset = offset;
}
libavcodec/mpc.c:60: error: Buffer Overrun L2
Offset: [161+min(0, `c->synth_buf_offset[*]`), 176+max(511, `c->synth_buf_offset[*]`)] (⇐ [33+min(0, `c->synth_buf_offset[*]`), 48+max(511, `c->synth_buf_offset[*]`)] + 128) Size: 2 by call to `ff_mpa_synth_filter`.
libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]`
49. * Process decoded Musepack data and produce PCM
50. */
51. static void mpc_synth(MPCContext *c, int16_t *out)
^
52. {
53. int dither_state = 0;
libavcodec/mpc.c:60:13: Call
58. samples_ptr = samples + ch;
59. for(i = 0; i < SAMPLES_PER_BAND; i++) {
60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
^
61. mpa_window, &dither_state,
62. samples_ptr, 2,
libavcodec/mpegaudiodec.c:906:9: <Length trace>
904. /* we calculate two samples at the same time to avoid one memory
905. access per two sample */
906. for(j=1;j<16;j++) {
^
907. sum2 = 0;
908. p = synth_buf + 16 + j;
libavcodec/mpegaudiodec.c:906:9: Assignment
904. /* we calculate two samples at the same time to avoid one memory
905. access per two sample */
906. for(j=1;j<16;j++) {
^
907. sum2 = 0;
908. p = synth_buf + 16 + j;
libavcodec/mpegaudiodec.c:910:9: Assignment
908. p = synth_buf + 16 + j;
909. SUM8P2(sum, +=, sum2, -=, w, w2, p);
910. p = synth_buf + 48 - j;
^
911. SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
912.
libavcodec/mpegaudiodec.c:911:9: Array access: Offset: [161+min(0, c->synth_buf_offset[*]), 176+max(511, c->synth_buf_offset[*])] (⇐ [33+min(0, c->synth_buf_offset[*]), 48+max(511, c->synth_buf_offset[*])] + 128) Size: 2 by call to `ff_mpa_synth_filter`
909. SUM8P2(sum, +=, sum2, -=, w, w2, p);
910. p = synth_buf + 48 - j;
911. SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
^
912.
913. *samples = round_sample(&sum);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L911
|
d2a_code_trace_data_44577
|
void t2p_read_tiff_size(T2P* t2p, TIFF* input){
uint64* sbc=NULL;
#if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
unsigned char* jpt=NULL;
tstrip_t i=0;
tstrip_t stripcount=0;
#endif
#ifdef OJPEG_SUPPORT
tsize_t k = 0;
#endif
if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
#ifdef CCITT_SUPPORT
if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
t2p->tiff_datasize=(tmsize_t)sbc[0];
return;
}
#endif
#ifdef ZIP_SUPPORT
if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
t2p->tiff_datasize=(tmsize_t)sbc[0];
return;
}
#endif
#ifdef OJPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_OJPEG){
if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
stripcount=TIFFNumberOfStrips(input);
for(i=0;i<stripcount;i++){
k += sbc[i];
}
if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
if(t2p->tiff_dataoffset != 0){
if(TIFFGetField(input, TIFFTAG_JPEGIFBYTECOUNT, &(t2p->tiff_datasize))!=0){
if(t2p->tiff_datasize < k) {
t2p->pdf_ojpegiflength=t2p->tiff_datasize;
t2p->tiff_datasize+=k;
t2p->tiff_datasize+=6;
t2p->tiff_datasize+=2*stripcount;
TIFFWarning(TIFF2PDF_MODULE,
"Input file %s has short JPEG interchange file byte count",
TIFFFileName(input));
return;
}
return;
}else {
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_JPEGIFBYTECOUNT",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
}
}
t2p->tiff_datasize+=k;
t2p->tiff_datasize+=2*stripcount;
t2p->tiff_datasize+=2048;
return;
}
#endif
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_JPEG) {
uint32 count = 0;
if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0 ){
if(count > 4){
t2p->tiff_datasize += count;
t2p->tiff_datasize -= 2;
}
} else {
t2p->tiff_datasize = 2;
}
stripcount=TIFFNumberOfStrips(input);
if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
for(i=0;i<stripcount;i++){
t2p->tiff_datasize += sbc[i];
t2p->tiff_datasize -=4;
}
t2p->tiff_datasize +=2;
return;
}
#endif
(void) 0;
}
t2p->tiff_datasize=TIFFScanlineSize(input) * t2p->tiff_length;
if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){
t2p->tiff_datasize*= t2p->tiff_samplesperpixel;
}
return;
}
tools/tiff2pdf.c:1788: error: Null Dereference
pointer `sbc` last assigned on line 1774 could be null and is dereferenced at line 1788, column 33.
tools/tiff2pdf.c:1772:1: start of procedure t2p_read_tiff_size()
1770. */
1771.
1772. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
^
1773.
1774. uint64* sbc=NULL;
tools/tiff2pdf.c:1774:2:
1772. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
1773.
1774. uint64* sbc=NULL;
^
1775. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1776. unsigned char* jpt=NULL;
tools/tiff2pdf.c:1776:2:
1774. uint64* sbc=NULL;
1775. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1776. unsigned char* jpt=NULL;
^
1777. tstrip_t i=0;
1778. tstrip_t stripcount=0;
tools/tiff2pdf.c:1777:2:
1775. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1776. unsigned char* jpt=NULL;
1777. tstrip_t i=0;
^
1778. tstrip_t stripcount=0;
1779. #endif
tools/tiff2pdf.c:1778:2:
1776. unsigned char* jpt=NULL;
1777. tstrip_t i=0;
1778. tstrip_t stripcount=0;
^
1779. #endif
1780. #ifdef OJPEG_SUPPORT
tools/tiff2pdf.c:1781:9:
1779. #endif
1780. #ifdef OJPEG_SUPPORT
1781. tsize_t k = 0;
^
1782. #endif
1783.
tools/tiff2pdf.c:1784:5: Taking true branch
1782. #endif
1783.
1784. if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
^
1785. #ifdef CCITT_SUPPORT
1786. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
tools/tiff2pdf.c:1786:6: Taking true branch
1784. if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
1785. #ifdef CCITT_SUPPORT
1786. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
^
1787. TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1788. t2p->tiff_datasize=(tmsize_t)sbc[0];
tools/tiff2pdf.c:1787:4:
1785. #ifdef CCITT_SUPPORT
1786. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
1787. TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
^
1788. t2p->tiff_datasize=(tmsize_t)sbc[0];
1789. return;
libtiff/tif_dir.c:1100:1: start of procedure TIFFGetField()
1098. * internal directory structure.
1099. */
1100. int
^
1101. TIFFGetField(TIFF* tif, uint32 tag, ...)
1102. {
libtiff/tif_dir.c:1106:2:
1104. va_list ap;
1105.
1106. va_start(ap, tag);
^
1107. status = TIFFVGetField(tif, tag, ap);
1108. va_end(ap);
libtiff/tif_dir.c:1107:2: Skipping TIFFVGetField(): empty list of specs
1105.
1106. va_start(ap, tag);
1107. status = TIFFVGetField(tif, tag, ap);
^
1108. va_end(ap);
1109. return (status);
libtiff/tif_dir.c:1108:2:
1106. va_start(ap, tag);
1107. status = TIFFVGetField(tif, tag, ap);
1108. va_end(ap);
^
1109. return (status);
1110. }
libtiff/tif_dir.c:1109:2:
1107. status = TIFFVGetField(tif, tag, ap);
1108. va_end(ap);
1109. return (status);
^
1110. }
1111.
libtiff/tif_dir.c:1110:1: return from a call to TIFFGetField
1108. va_end(ap);
1109. return (status);
1110. }
^
1111.
1112. /*
tools/tiff2pdf.c:1788:4:
1786. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
1787. TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1788. t2p->tiff_datasize=(tmsize_t)sbc[0];
^
1789. return;
1790. }
|
https://gitlab.com/libtiff/libtiff/blob/b69a1998bedfabc32cd541408bffdef05bd01e45/tools/tiff2pdf.c/#L1788
|
d2a_code_trace_data_44578
|
IMPLEMENT_new_ctx(cfb8, CFB, 128)
providers/common/ciphers/aes.c:314: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 314 could be null and is dereferenced at line 314, column 1.
Showing all 18 steps of the trace
providers/common/ciphers/aes.c:314:1: start of procedure aes_128_cfb8_newctx()
312. IMPLEMENT_new_ctx(cfb8, CFB, 256)
313. IMPLEMENT_new_ctx(cfb8, CFB, 192)
314. > IMPLEMENT_new_ctx(cfb8, CFB, 128)
315.
316. /* CTR */
crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:5:
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. > void *ret = CRYPTO_malloc(num, file, line);
231.
232. FAILTEST();
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking true branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:210:9:
208. * allocation.
209. */
210. > allow_customize = 0;
211. }
212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE)
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:233:9: Taking false branch
231.
232. FAILTEST();
233. if (ret != NULL)
^
234. memset(ret, 0, num);
235. return ret;
crypto/mem.c:235:5:
233. if (ret != NULL)
234. memset(ret, 0, num);
235. > return ret;
236. }
237.
crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
234. memset(ret, 0, num);
235. return ret;
236. > }
237.
238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
providers/common/ciphers/aes.c:314:1:
312. IMPLEMENT_new_ctx(cfb8, CFB, 256)
313. IMPLEMENT_new_ctx(cfb8, CFB, 192)
314. > IMPLEMENT_new_ctx(cfb8, CFB, 128)
315.
316. /* CTR */
|
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L314
|
d2a_code_trace_data_44579
|
static inline int get_context(FFV1Context *f, int_fast16_t *src, int_fast16_t *last, int_fast16_t *last2){
const int LT= last[-1];
const int T= last[ 0];
const int RT= last[ 1];
const int L = src[-1];
if(f->quant_table[3][127]){
const int TT= last2[0];
const int LL= src[-2];
return f->quant_table[0][(L-LT) & 0xFF] + f->quant_table[1][(LT-T) & 0xFF] + f->quant_table[2][(T-RT) & 0xFF]
+f->quant_table[3][(LL-L) & 0xFF] + f->quant_table[4][(TT-T) & 0xFF];
}else
return f->quant_table[0][(L-LT) & 0xFF] + f->quant_table[1][(LT-T) & 0xFF] + f->quant_table[2][(T-RT) & 0xFF];
}
libavcodec/ffv1.c:787: error: Buffer Overrun L1
Offset: [4, `w` + 4] (⇐ [3, `w` + 3] + 1) Size: 2 by call to `decode_line`.
libavcodec/ffv1.c:768:1: Parameter `w`
766. }
767.
768. static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
^
769. int x, y;
770. int_fast16_t sample_buffer[2][w+6];
libavcodec/ffv1.c:787:9: Call
785.
786. //{START_TIMER
787. decode_line(s, w, sample, plane_index, 8);
^
788. for(x=0; x<w; x++){
789. src[x + stride*y]= sample[1][x];
libavcodec/ffv1.c:711:1: Parameter `w`
709. }
710.
711. static inline void decode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
^
712. PlaneContext * const p= &s->plane[plane_index];
713. RangeCoder * const c= &s->c;
libavcodec/ffv1.c:722:18: Call
720. int diff, context, sign;
721.
722. context= get_context(s, sample[1] + x, sample[0] + x, sample[1] + x);
^
723. if(context < 0){
724. context= -context;
libavcodec/ffv1.c:207:1: <Length trace>
205. }
206.
207. static inline int get_context(FFV1Context *f, int_fast16_t *src, int_fast16_t *last, int_fast16_t *last2){
^
208. const int LT= last[-1];
209. const int T= last[ 0];
libavcodec/ffv1.c:207:1: Parameter `*last`
205. }
206.
207. static inline int get_context(FFV1Context *f, int_fast16_t *src, int_fast16_t *last, int_fast16_t *last2){
^
208. const int LT= last[-1];
209. const int T= last[ 0];
libavcodec/ffv1.c:210:19: Array access: Offset: [4, w + 4] (⇐ [3, w + 3] + 1) Size: 2 by call to `decode_line`
208. const int LT= last[-1];
209. const int T= last[ 0];
210. const int RT= last[ 1];
^
211. const int L = src[-1];
212.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ffv1.c/#L210
|
d2a_code_trace_data_44580
|
void ff_MPV_frame_end(MpegEncContext *s)
{
#if FF_API_XVMC
FF_DISABLE_DEPRECATION_WARNINGS
if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
ff_xvmc_field_end(s);
} else
FF_ENABLE_DEPRECATION_WARNINGS
#endif
if (s->er.error_count &&
!s->avctx->hwaccel &&
s->unrestricted_mv &&
s->current_picture.reference &&
!s->intra_only &&
!(s->flags & CODEC_FLAG_EMU_EDGE)) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
int hshift = desc->log2_chroma_w;
int vshift = desc->log2_chroma_h;
s->dsp.draw_edges(s->current_picture.f.data[0], s->linesize,
s->h_edge_pos, s->v_edge_pos,
EDGE_WIDTH, EDGE_WIDTH,
EDGE_TOP | EDGE_BOTTOM);
s->dsp.draw_edges(s->current_picture.f.data[1], s->uvlinesize,
s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
EDGE_TOP | EDGE_BOTTOM);
s->dsp.draw_edges(s->current_picture.f.data[2], s->uvlinesize,
s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,
EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
EDGE_TOP | EDGE_BOTTOM);
}
emms_c();
if (s->current_picture.reference)
ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0);
}
libavcodec/mpegvideo.c:1842: error: Null Dereference
pointer `desc` last assigned on line 1841 could be null and is dereferenced at line 1842, column 22.
libavcodec/mpegvideo.c:1824:1: start of procedure ff_MPV_frame_end()
1822.
1823. /* called after a frame has been decoded. */
1824. void ff_MPV_frame_end(MpegEncContext *s)
^
1825. {
1826. #if FF_API_XVMC
libavcodec/mpegvideo.c:1830:9: Taking false branch
1828. /* redraw edges for the frame if decoding didn't complete */
1829. // just to make sure that all data is rendered.
1830. if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
^
1831. ff_xvmc_field_end(s);
1832. } else
libavcodec/mpegvideo.c:1835:9: Taking true branch
1833. FF_ENABLE_DEPRECATION_WARNINGS
1834. #endif /* FF_API_XVMC */
1835. if (s->er.error_count &&
^
1836. !s->avctx->hwaccel &&
1837. s->unrestricted_mv &&
libavcodec/mpegvideo.c:1836:10: Taking true branch
1834. #endif /* FF_API_XVMC */
1835. if (s->er.error_count &&
1836. !s->avctx->hwaccel &&
^
1837. s->unrestricted_mv &&
1838. s->current_picture.reference &&
libavcodec/mpegvideo.c:1837:9: Taking true branch
1835. if (s->er.error_count &&
1836. !s->avctx->hwaccel &&
1837. s->unrestricted_mv &&
^
1838. s->current_picture.reference &&
1839. !s->intra_only &&
libavcodec/mpegvideo.c:1838:9: Taking true branch
1836. !s->avctx->hwaccel &&
1837. s->unrestricted_mv &&
1838. s->current_picture.reference &&
^
1839. !s->intra_only &&
1840. !(s->flags & CODEC_FLAG_EMU_EDGE)) {
libavcodec/mpegvideo.c:1839:10: Taking true branch
1837. s->unrestricted_mv &&
1838. s->current_picture.reference &&
1839. !s->intra_only &&
^
1840. !(s->flags & CODEC_FLAG_EMU_EDGE)) {
1841. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
libavcodec/mpegvideo.c:1840:11: Taking true branch
1838. s->current_picture.reference &&
1839. !s->intra_only &&
1840. !(s->flags & CODEC_FLAG_EMU_EDGE)) {
^
1841. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
1842. int hshift = desc->log2_chroma_w;
libavcodec/mpegvideo.c:1841:9:
1839. !s->intra_only &&
1840. !(s->flags & CODEC_FLAG_EMU_EDGE)) {
1841. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
^
1842. int hshift = desc->log2_chroma_w;
1843. int vshift = desc->log2_chroma_h;
libavutil/pixdesc.c:1507:1: start of procedure av_pix_fmt_desc_get()
1505. }
1506.
1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
^
1508. {
1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
libavutil/pixdesc.c:1509:9: Taking false branch
1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1508. {
1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1510. return NULL;
1511. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1509:24: Taking true branch
1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1508. {
1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1510. return NULL;
1511. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1510:9:
1508. {
1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1510. return NULL;
^
1511. return &av_pix_fmt_descriptors[pix_fmt];
1512. }
libavutil/pixdesc.c:1512:1: return from a call to av_pix_fmt_desc_get
1510. return NULL;
1511. return &av_pix_fmt_descriptors[pix_fmt];
1512. }
^
1513.
1514. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
libavcodec/mpegvideo.c:1842:9:
1840. !(s->flags & CODEC_FLAG_EMU_EDGE)) {
1841. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
1842. int hshift = desc->log2_chroma_w;
^
1843. int vshift = desc->log2_chroma_h;
1844. s->dsp.draw_edges(s->current_picture.f.data[0], s->linesize,
|
https://github.com/libav/libav/blob/fffca3d278c2a2422c2f61f21c5a9d5f690d328e/libavcodec/mpegvideo.c/#L1842
|
d2a_code_trace_data_44581
|
static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
{
unsigned char *buf = NULL;
int b, ret = 0, bit, bytes, mask;
if (bits == 0) {
if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
goto toosmall;
BN_zero(rnd);
return 1;
}
if (bits < 0 || (bits == 1 && top > 0))
goto toosmall;
bytes = (bits + 7) / 8;
bit = (bits - 1) % 8;
mask = 0xff << (bit + 1);
buf = OPENSSL_malloc(bytes);
if (buf == NULL) {
BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
goto err;
}
b = flag == NORMAL ? RAND_bytes(buf, bytes) : RAND_priv_bytes(buf, bytes);
if (b <= 0)
goto err;
if (flag == TESTING) {
int i;
unsigned char c;
for (i = 0; i < bytes; i++) {
if (RAND_bytes(&c, 1) <= 0)
goto err;
if (c >= 128 && i > 0)
buf[i] = buf[i - 1];
else if (c < 42)
buf[i] = 0;
else if (c < 84)
buf[i] = 255;
}
}
if (top >= 0) {
if (top) {
if (bit == 0) {
buf[0] = 1;
buf[1] |= 0x80;
} else {
buf[0] |= (3 << (bit - 1));
}
} else {
buf[0] |= (1 << bit);
}
}
buf[0] &= ~mask;
if (bottom)
buf[bytes - 1] |= 1;
if (!BN_bin2bn(buf, bytes, rnd))
goto err;
ret = 1;
err:
OPENSSL_clear_free(buf, bytes);
bn_check_top(rnd);
return ret;
toosmall:
BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL);
return 0;
}
test/ec_internal_test.c:36: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_pseudo_rand`.
Showing all 16 steps of the trace
test/ec_internal_test.c:36:13: Call
34. || !TEST_true(BN_is_one(b))
35. /* (1/a)*a = 1 */
36. || !TEST_true(BN_pseudo_rand(a, BN_num_bits(group->field) - 1,
^
37. BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
38. || !TEST_true(group->meth->field_inv(group, b, a, ctx))
crypto/bn/bn_lib.c:141:9: Assignment
139.
140. if (BN_is_zero(a))
141. return 0;
^
142. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
143. }
test/ec_internal_test.c:36:13: Call
34. || !TEST_true(BN_is_one(b))
35. /* (1/a)*a = 1 */
36. || !TEST_true(BN_pseudo_rand(a, BN_num_bits(group->field) - 1,
^
37. BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))
38. || !TEST_true(group->meth->field_inv(group, b, a, ctx))
crypto/bn/bn_rand.c:187:1: Parameter `bits`
185. }
186.
187. > int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom)
188. {
189. return BN_rand(rnd, bits, top, bottom);
crypto/bn/bn_rand.c:189:12: Call
187. int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom)
188. {
189. return BN_rand(rnd, bits, top, bottom);
^
190. }
191.
crypto/bn/bn_rand.c:97:1: Parameter `bits`
95. }
96.
97. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
98. {
99. return bnrand(NORMAL, rnd, bits, top, bottom);
crypto/bn/bn_rand.c:99:12: Call
97. int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
98. {
99. return bnrand(NORMAL, rnd, bits, top, bottom);
^
100. }
101.
crypto/bn/bn_rand.c:57:14: <Offset trace>
55. unsigned char c;
56.
57. for (i = 0; i < bytes; i++) {
^
58. if (RAND_bytes(&c, 1) <= 0)
59. goto err;
crypto/bn/bn_rand.c:57:14: Assignment
55. unsigned char c;
56.
57. for (i = 0; i < bytes; i++) {
^
58. if (RAND_bytes(&c, 1) <= 0)
59. goto err;
crypto/bn/bn_rand.c:21:1: <Length trace>
19. } BNRAND_FLAG;
20.
21. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
22. {
23. unsigned char *buf = NULL;
crypto/bn/bn_rand.c:21:1: Parameter `bits`
19. } BNRAND_FLAG;
20.
21. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
22. {
23. unsigned char *buf = NULL;
crypto/bn/bn_rand.c:35:5: Assignment
33. goto toosmall;
34.
35. bytes = (bits + 7) / 8;
^
36. bit = (bits - 1) % 8;
37. mask = 0xff << (bit + 1);
crypto/bn/bn_rand.c:39:11: Call
37. mask = 0xff << (bit + 1);
38.
39. buf = OPENSSL_malloc(bytes);
^
40. if (buf == NULL) {
41. BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
crypto/mem.c:201:9: Assignment
199.
200. if (num == 0)
201. return NULL;
^
202.
203. FAILTEST();
crypto/bn/bn_rand.c:39:5: Assignment
37. mask = 0xff << (bit + 1);
38.
39. buf = OPENSSL_malloc(bytes);
^
40. if (buf == NULL) {
41. BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_rand.c:83:9: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_pseudo_rand`
81. buf[0] &= ~mask;
82. if (bottom) /* set bottom bit if requested */
83. buf[bytes - 1] |= 1;
^
84. if (!BN_bin2bn(buf, bytes, rnd))
85. goto err;
|
https://github.com/openssl/openssl/blob/8f58ede09572dcc6a7e6c01280dd348240199568/crypto/bn/bn_rand.c/#L83
|
d2a_code_trace_data_44582
|
static int do_multi(int multi, int size_num)
{
int n;
int fd[2];
int *fds;
static char sep[] = ":";
fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
for (n = 0; n < multi; ++n) {
if (pipe(fd) == -1) {
BIO_printf(bio_err, "pipe failure\n");
exit(1);
}
fflush(stdout);
(void)BIO_flush(bio_err);
if (fork()) {
close(fd[1]);
fds[n] = fd[0];
} else {
close(fd[0]);
close(1);
if (dup(fd[1]) == -1) {
BIO_printf(bio_err, "dup failed\n");
exit(1);
}
close(fd[1]);
mr = 1;
usertime = 0;
OPENSSL_free(fds);
return 0;
}
printf("Forked child %d\n", n);
}
for (n = 0; n < multi; ++n) {
FILE *f;
char buf[1024];
char *p;
f = fdopen(fds[n], "r");
while (fgets(buf, sizeof(buf), f)) {
p = strchr(buf, '\n');
if (p)
*p = '\0';
if (buf[0] != '+') {
BIO_printf(bio_err,
"Don't understand line '%s' from child %d\n", buf,
n);
continue;
}
printf("Got: %s from %d\n", buf, n);
if (strncmp(buf, "+F:", 3) == 0) {
int alg;
int j;
p = buf + 3;
alg = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
for (j = 0; j < size_num; ++j)
results[alg][j] += atof(sstrsep(&p, sep));
} else if (strncmp(buf, "+F2:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
rsa_results[k][0] += d;
d = atof(sstrsep(&p, sep));
rsa_results[k][1] += d;
}
# ifndef OPENSSL_NO_DSA
else if (strncmp(buf, "+F3:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
dsa_results[k][0] += d;
d = atof(sstrsep(&p, sep));
dsa_results[k][1] += d;
}
# endif
# ifndef OPENSSL_NO_EC
else if (strncmp(buf, "+F4:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
ecdsa_results[k][0] += d;
d = atof(sstrsep(&p, sep));
ecdsa_results[k][1] += d;
} else if (strncmp(buf, "+F5:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
ecdh_results[k][0] += d;
} else if (strncmp(buf, "+F6:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
eddsa_results[k][0] += d;
d = atof(sstrsep(&p, sep));
eddsa_results[k][1] += d;
}
# endif
else if (strncmp(buf, "+H:", 3) == 0) {
;
} else
BIO_printf(bio_err, "Unknown type '%s' from child %d\n", buf,
n);
}
fclose(f);
}
OPENSSL_free(fds);
return 1;
}
apps/speed.c:3653: error: NULL_DEREFERENCE
pointer `f` last assigned on line 3652 could be null and is dereferenced by call to `fgets()` at line 3653, column 16.
Showing all 30 steps of the trace
apps/speed.c:3612:1: start of procedure do_multi()
3610. }
3611.
3612. > static int do_multi(int multi, int size_num)
3613. {
3614. int n;
apps/speed.c:3617:5:
3615. int fd[2];
3616. int *fds;
3617. > static char sep[] = ":";
3618.
3619. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
apps/speed.c:3619:5:
3617. static char sep[] = ":";
3618.
3619. > fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3620. for (n = 0; n < multi; ++n) {
3621. if (pipe(fd) == -1) {
test/testutil/apps_mem.c:14:1: start of procedure app_malloc()
12. /* shim that avoids sucking in too much from apps/apps.c */
13.
14. > void* app_malloc(int sz, const char *what)
15. {
16. void *vp = OPENSSL_malloc(sz);
test/testutil/apps_mem.c:16:5:
14. void* app_malloc(int sz, const char *what)
15. {
16. > void *vp = OPENSSL_malloc(sz);
17.
18. return vp;
providers/fips/fipsprov.c:458:1: start of procedure CRYPTO_malloc()
456. }
457.
458. > void *CRYPTO_malloc(size_t num, const char *file, int line)
459. {
460. return c_CRYPTO_malloc(num, file, line);
providers/fips/fipsprov.c:460:5: Skipping __function_pointer__(): unresolved function pointer
458. void *CRYPTO_malloc(size_t num, const char *file, int line)
459. {
460. return c_CRYPTO_malloc(num, file, line);
^
461. }
462.
providers/fips/fipsprov.c:461:1: return from a call to CRYPTO_malloc
459. {
460. return c_CRYPTO_malloc(num, file, line);
461. > }
462.
463. void *CRYPTO_zalloc(size_t num, const char *file, int line)
test/testutil/apps_mem.c:18:5:
16. void *vp = OPENSSL_malloc(sz);
17.
18. > return vp;
19. }
test/testutil/apps_mem.c:19:1: return from a call to app_malloc
17.
18. return vp;
19. > }
apps/speed.c:3620:10:
3618.
3619. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3620. > for (n = 0; n < multi; ++n) {
3621. if (pipe(fd) == -1) {
3622. BIO_printf(bio_err, "pipe failure\n");
apps/speed.c:3620:17: Loop condition is true. Entering loop body
3618.
3619. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3620. for (n = 0; n < multi; ++n) {
^
3621. if (pipe(fd) == -1) {
3622. BIO_printf(bio_err, "pipe failure\n");
apps/speed.c:3621:13: Taking false branch
3619. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3620. for (n = 0; n < multi; ++n) {
3621. if (pipe(fd) == -1) {
^
3622. BIO_printf(bio_err, "pipe failure\n");
3623. exit(1);
apps/speed.c:3625:9:
3623. exit(1);
3624. }
3625. > fflush(stdout);
3626. (void)BIO_flush(bio_err);
3627. if (fork()) {
apps/speed.c:3626:15:
3624. }
3625. fflush(stdout);
3626. > (void)BIO_flush(bio_err);
3627. if (fork()) {
3628. close(fd[1]);
crypto/bio/bio_lib.c:510:1: start of procedure BIO_ctrl()
508. }
509.
510. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
511. {
512. long ret;
crypto/bio/bio_lib.c:514:9: Taking true branch
512. long ret;
513.
514. if (b == NULL)
^
515. return 0;
516.
crypto/bio/bio_lib.c:515:9:
513.
514. if (b == NULL)
515. > return 0;
516.
517. if ((b->method == NULL) || (b->method->ctrl == NULL)) {
crypto/bio/bio_lib.c:535:1: return from a call to BIO_ctrl
533.
534. return ret;
535. > }
536.
537. long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
apps/speed.c:3626:9:
3624. }
3625. fflush(stdout);
3626. > (void)BIO_flush(bio_err);
3627. if (fork()) {
3628. close(fd[1]);
apps/speed.c:3627:13: Taking true branch
3625. fflush(stdout);
3626. (void)BIO_flush(bio_err);
3627. if (fork()) {
^
3628. close(fd[1]);
3629. fds[n] = fd[0];
apps/speed.c:3628:13:
3626. (void)BIO_flush(bio_err);
3627. if (fork()) {
3628. > close(fd[1]);
3629. fds[n] = fd[0];
3630. } else {
apps/speed.c:3629:13:
3627. if (fork()) {
3628. close(fd[1]);
3629. > fds[n] = fd[0];
3630. } else {
3631. close(fd[0]);
apps/speed.c:3643:9:
3641. return 0;
3642. }
3643. > printf("Forked child %d\n", n);
3644. }
3645.
apps/speed.c:3620:28:
3618.
3619. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3620. > for (n = 0; n < multi; ++n) {
3621. if (pipe(fd) == -1) {
3622. BIO_printf(bio_err, "pipe failure\n");
apps/speed.c:3620:17: Loop condition is false. Leaving loop
3618.
3619. fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
3620. for (n = 0; n < multi; ++n) {
^
3621. if (pipe(fd) == -1) {
3622. BIO_printf(bio_err, "pipe failure\n");
apps/speed.c:3647:10:
3645.
3646. /* for now, assume the pipe is long enough to take all the output */
3647. > for (n = 0; n < multi; ++n) {
3648. FILE *f;
3649. char buf[1024];
apps/speed.c:3647:17: Loop condition is true. Entering loop body
3645.
3646. /* for now, assume the pipe is long enough to take all the output */
3647. for (n = 0; n < multi; ++n) {
^
3648. FILE *f;
3649. char buf[1024];
apps/speed.c:3652:9:
3650. char *p;
3651.
3652. > f = fdopen(fds[n], "r");
3653. while (fgets(buf, sizeof(buf), f)) {
3654. p = strchr(buf, '\n');
apps/speed.c:3653:16:
3651.
3652. f = fdopen(fds[n], "r");
3653. > while (fgets(buf, sizeof(buf), f)) {
3654. p = strchr(buf, '\n');
3655. if (p)
|
https://github.com/openssl/openssl/blob/c3612970465d0a13f2fc5b47bc28ca18516a699d/apps/speed.c/#L3653
|
d2a_code_trace_data_44583
|
static int ct_base64_decode(const char *in, unsigned char **out)
{
size_t inlen = strlen(in);
int outlen;
unsigned char *outbuf = NULL;
if (inlen == 0) {
*out = NULL;
return 0;
}
outlen = (inlen / 4) * 3;
outbuf = OPENSSL_malloc(outlen);
if (outbuf == NULL) {
CTerr(CT_F_CT_BASE64_DECODE, ERR_R_MALLOC_FAILURE);
goto err;
}
outlen = EVP_DecodeBlock(outbuf, (unsigned char *)in, inlen);
if (outlen < 0) {
CTerr(CT_F_CT_BASE64_DECODE, CT_R_BASE64_DECODE_ERROR);
goto err;
}
while (in[--inlen] == '=') {
--outlen;
}
*out = outbuf;
return outlen;
err:
OPENSSL_free(outbuf);
return -1;
}
test/ct_test.c:523: error: BUFFER_OVERRUN_L1
Offset: [-oo, -1] Size: 1 by call to `SCT_new_from_base64`.
Showing all 10 steps of the trace
test/ct_test.c:511:1: Array declaration
509. }
510.
511. > static int test_encode_tls_sct()
512. {
513. const char log_id[] = "3xwuwRUAlFJHqWFoMl3cXHlZ6PfG04j8AC4LvT9012Q=";
test/ct_test.c:523:11: Call
521.
522. fixture.sct_list = sk_SCT_new_null();
523. sct = SCT_new_from_base64(SCT_VERSION_V1, log_id,
^
524. CT_LOG_ENTRY_TYPE_X509, timestamp,
525. extensions, signature);
crypto/ct/ct_b64.c:60:1: Parameter `*extensions_base64`
58. }
59.
60. > SCT *SCT_new_from_base64(unsigned char version, const char *logid_base64,
61. ct_log_entry_type_t entry_type, uint64_t timestamp,
62. const char *extensions_base64,
crypto/ct/ct_b64.c:93:14: Call
91. dec = NULL;
92.
93. declen = ct_base64_decode(extensions_base64, &dec);
^
94. if (declen < 0) {
95. CTerr(CT_F_SCT_NEW_FROM_BASE64, X509_R_BASE64_DECODE_ERROR);
crypto/ct/ct_b64.c:24:1: <Offset trace>
22. * the caller. Do not provide a pre-allocated string in |out|.
23. */
24. > static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
crypto/ct/ct_b64.c:24:1: Parameter `in->strlen`
22. * the caller. Do not provide a pre-allocated string in |out|.
23. */
24. > static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
crypto/ct/ct_b64.c:26:5: Assignment
24. static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
^
27. int outlen;
28. unsigned char *outbuf = NULL;
crypto/ct/ct_b64.c:24:1: <Length trace>
22. * the caller. Do not provide a pre-allocated string in |out|.
23. */
24. > static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
crypto/ct/ct_b64.c:24:1: Parameter `*in`
22. * the caller. Do not provide a pre-allocated string in |out|.
23. */
24. > static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
crypto/ct/ct_b64.c:49:12: Array access: Offset: [-oo, -1] Size: 1 by call to `SCT_new_from_base64`
47.
48. /* Subtract padding bytes from |outlen| */
49. while (in[--inlen] == '=') {
^
50. --outlen;
51. }
|
https://github.com/openssl/openssl/blob/2d13250fd695eba777fe7e2af4beb1b7d356bd8f/crypto/ct/ct_b64.c/#L49
|
d2a_code_trace_data_44584
|
static int check_chain_extensions(X509_STORE_CTX *ctx)
{
int i, ok = 0, must_be_ca, plen = 0;
X509 *x;
int (*cb) (int xok, X509_STORE_CTX *xctx);
int proxy_path_length = 0;
int purpose;
int allow_proxy_certs;
cb = ctx->verify_cb;
must_be_ca = -1;
if (ctx->parent) {
allow_proxy_certs = 0;
purpose = X509_PURPOSE_CRL_SIGN;
} else {
allow_proxy_certs =
! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
allow_proxy_certs = 1;
purpose = ctx->param->purpose;
}
for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
int ret;
x = sk_X509_value(ctx->chain, i);
if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
&& (x->ex_flags & EXFLAG_CRITICAL)) {
ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) {
ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
ret = X509_check_ca(x);
switch (must_be_ca) {
case -1:
if ((ctx->param->flags & X509_V_FLAG_X509_STRICT)
&& (ret != 1) && (ret != 0)) {
ret = 0;
ctx->error = X509_V_ERR_INVALID_CA;
} else
ret = 1;
break;
case 0:
if (ret != 0) {
ret = 0;
ctx->error = X509_V_ERR_INVALID_NON_CA;
} else
ret = 1;
break;
default:
if ((ret == 0)
|| ((ctx->param->flags & X509_V_FLAG_X509_STRICT)
&& (ret != 1))) {
ret = 0;
ctx->error = X509_V_ERR_INVALID_CA;
} else
ret = 1;
break;
}
if (ret == 0) {
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
if (ctx->param->purpose > 0) {
ret = X509_check_purpose(x, purpose, must_be_ca > 0);
if ((ret == 0)
|| ((ctx->param->flags & X509_V_FLAG_X509_STRICT)
&& (ret != 1))) {
ctx->error = X509_V_ERR_INVALID_PURPOSE;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
}
if ((i > 1) && !(x->ex_flags & EXFLAG_SI)
&& (x->ex_pathlen != -1)
&& (plen > (x->ex_pathlen + proxy_path_length + 1))) {
ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
if (!(x->ex_flags & EXFLAG_SI))
plen++;
if (x->ex_flags & EXFLAG_PROXY) {
if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) {
ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED;
ctx->error_depth = i;
ctx->current_cert = x;
ok = cb(0, ctx);
if (!ok)
goto end;
}
proxy_path_length++;
must_be_ca = 0;
} else
must_be_ca = 1;
}
ok = 1;
end:
return ok;
}
crypto/x509/x509_vfy.c:398: error: NULL_DEREFERENCE
pointer `x` last assigned on line 380 could be null and is dereferenced by call to `X509_check_ca()` at line 398, column 15.
Showing all 26 steps of the trace
crypto/x509/x509_vfy.c:340:1: start of procedure check_chain_extensions()
338. */
339.
340. > static int check_chain_extensions(X509_STORE_CTX *ctx)
341. {
342. int i, ok = 0, must_be_ca, plen = 0;
crypto/x509/x509_vfy.c:342:5:
340. static int check_chain_extensions(X509_STORE_CTX *ctx)
341. {
342. > int i, ok = 0, must_be_ca, plen = 0;
343. X509 *x;
344. int (*cb) (int xok, X509_STORE_CTX *xctx);
crypto/x509/x509_vfy.c:345:5:
343. X509 *x;
344. int (*cb) (int xok, X509_STORE_CTX *xctx);
345. > int proxy_path_length = 0;
346. int purpose;
347. int allow_proxy_certs;
crypto/x509/x509_vfy.c:348:5:
346. int purpose;
347. int allow_proxy_certs;
348. > cb = ctx->verify_cb;
349.
350. /*-
crypto/x509/x509_vfy.c:359:5:
357. * all certificates in the chain except the leaf certificate.
358. */
359. > must_be_ca = -1;
360.
361. /* CRL path validation */
crypto/x509/x509_vfy.c:362:9: Taking false branch
360.
361. /* CRL path validation */
362. if (ctx->parent) {
^
363. allow_proxy_certs = 0;
364. purpose = X509_PURPOSE_CRL_SIGN;
crypto/x509/x509_vfy.c:367:17: Condition is true
365. } else {
366. allow_proxy_certs =
367. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
^
368. /*
369. * A hack to keep people who don't want to modify their software
crypto/x509/x509_vfy.c:367:13:
365. } else {
366. allow_proxy_certs =
367. > ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
368. /*
369. * A hack to keep people who don't want to modify their software
crypto/x509/x509_vfy.c:366:9:
364. purpose = X509_PURPOSE_CRL_SIGN;
365. } else {
366. > allow_proxy_certs =
367. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
368. /*
crypto/x509/x509_vfy.c:372:13: Taking false branch
370. * happy
371. */
372. if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
^
373. allow_proxy_certs = 1;
374. purpose = ctx->param->purpose;
crypto/x509/x509_vfy.c:374:9:
372. if (getenv("OPENSSL_ALLOW_PROXY_CERTS"))
373. allow_proxy_certs = 1;
374. > purpose = ctx->param->purpose;
375. }
376.
crypto/x509/x509_vfy.c:378:10:
376.
377. /* Check all untrusted certificates */
378. > for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
379. int ret;
380. x = sk_X509_value(ctx->chain, i);
crypto/x509/x509_vfy.c:378:17: Loop condition is true. Entering loop body
376.
377. /* Check all untrusted certificates */
378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
^
379. int ret;
380. x = sk_X509_value(ctx->chain, i);
crypto/x509/x509_vfy.c:380:13: Condition is true
378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
379. int ret;
380. x = sk_X509_value(ctx->chain, i);
^
381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
382. && (x->ex_flags & EXFLAG_CRITICAL)) {
crypto/x509/x509_vfy.c:380:9:
378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) {
379. int ret;
380. > x = sk_X509_value(ctx->chain, i);
381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
382. && (x->ex_flags & EXFLAG_CRITICAL)) {
crypto/stack/stack.c:324:1: start of procedure sk_value()
322. }
323.
324. > void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
crypto/stack/stack.c:326:10: Taking false branch
324. void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
^
327. return NULL;
328. return st->data[i];
crypto/stack/stack.c:326:17: Taking false branch
324. void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
^
327. return NULL;
328. return st->data[i];
crypto/stack/stack.c:326:28: Taking true branch
324. void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
^
327. return NULL;
328. return st->data[i];
crypto/stack/stack.c:327:9:
325. {
326. if (!st || (i < 0) || (i >= st->num))
327. > return NULL;
328. return st->data[i];
329. }
crypto/stack/stack.c:329:1: return from a call to sk_value
327. return NULL;
328. return st->data[i];
329. > }
330.
331. void *sk_set(_STACK *st, int i, void *value)
crypto/x509/x509_vfy.c:381:15: Taking false branch
379. int ret;
380. x = sk_X509_value(ctx->chain, i);
381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL)
^
382. && (x->ex_flags & EXFLAG_CRITICAL)) {
383. ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION;
crypto/x509/x509_vfy.c:390:14: Taking false branch
388. goto end;
389. }
390. if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) {
^
391. ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
392. ctx->error_depth = i;
crypto/x509/x509_vfy.c:398:9:
396. goto end;
397. }
398. > ret = X509_check_ca(x);
399. switch (must_be_ca) {
400. case -1:
crypto/x509v3/v3_purp.c:576:1: start of procedure X509_check_ca()
574. }
575.
576. > int X509_check_ca(X509 *x)
577. {
578. if (!(x->ex_flags & EXFLAG_SET)) {
crypto/x509v3/v3_purp.c:578:11:
576. int X509_check_ca(X509 *x)
577. {
578. > if (!(x->ex_flags & EXFLAG_SET)) {
579. CRYPTO_w_lock(CRYPTO_LOCK_X509);
580. x509v3_cache_extensions(x);
|
https://github.com/openssl/openssl/blob/e29c73c93b88a4b7f492c7c8c7343223e7548612/crypto/x509/x509_vfy.c/#L398
|
d2a_code_trace_data_44585
|
void RAND_seed(const void *buf, int num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth->seed != NULL)
meth->seed(buf, num);
}
crypto/rand/rand_lib.c:786: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 784 could be null and is dereferenced at line 786, column 9.
Showing all 6 steps of the trace
crypto/rand/rand_lib.c:782:1: start of procedure RAND_seed()
780. #endif
781.
782. > void RAND_seed(const void *buf, int num)
783. {
784. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:784:5:
782. void RAND_seed(const void *buf, int num)
783. {
784. > const RAND_METHOD *meth = RAND_get_rand_method();
785.
786. if (meth->seed != NULL)
crypto/rand/rand_lib.c:722:1: start of procedure RAND_get_rand_method()
720. #endif
721.
722. > const RAND_METHOD *RAND_get_rand_method(void)
723. {
724. #ifdef FIPS_MODE
crypto/rand/rand_lib.c:725:5:
723. {
724. #ifdef FIPS_MODE
725. > return NULL;
726. #else
727. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:754:1: return from a call to RAND_get_rand_method
752. return tmp_meth;
753. #endif
754. > }
755.
756. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
crypto/rand/rand_lib.c:786:9:
784. const RAND_METHOD *meth = RAND_get_rand_method();
785.
786. > if (meth->seed != NULL)
787. meth->seed(buf, num);
788. }
|
https://github.com/openssl/openssl/blob/363e941ed43c648adf4d6d0874077ddd80041e1f/crypto/rand/rand_lib.c/#L786
|
d2a_code_trace_data_44586
|
tmsize_t
TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
{
static const char module[] = "TIFFReadEncodedStrip";
TIFFDirectory *td = &tif->tif_dir;
uint32 rowsperstrip;
uint32 stripsperplane;
uint32 stripinplane;
uint16 plane;
uint32 rows;
tmsize_t stripsize;
if (!TIFFCheckRead(tif,0))
return((tmsize_t)(-1));
if (strip>=td->td_nstrips)
{
TIFFErrorExt(tif->tif_clientdata,module,
"%lu: Strip out of range, max %lu",(unsigned long)strip,
(unsigned long)td->td_nstrips);
return((tmsize_t)(-1));
}
rowsperstrip=td->td_rowsperstrip;
if (rowsperstrip>td->td_imagelength)
rowsperstrip=td->td_imagelength;
stripsperplane=((td->td_imagelength+rowsperstrip-1)/rowsperstrip);
stripinplane=(strip%stripsperplane);
plane=(strip/stripsperplane);
rows=td->td_imagelength-stripinplane*rowsperstrip;
if (rows>rowsperstrip)
rows=rowsperstrip;
stripsize=TIFFVStripSize(tif,rows);
if (stripsize==0)
return((tmsize_t)(-1));
if ((size!=(tmsize_t)(-1))&&(size<stripsize))
stripsize=size;
if (!TIFFFillStrip(tif,strip))
return((tmsize_t)(-1));
if ((*tif->tif_decodestrip)(tif,buf,stripsize,plane)<=0)
return((tmsize_t)(-1));
(*tif->tif_postdecode)(tif,buf,stripsize);
return(stripsize);
}
libtiff/tif_getimage.c:840: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `TIFFReadEncodedStrip`.
libtiff/tif_getimage.c:813:37: Call
811. int ret = 1, flip;
812.
813. buf = (unsigned char*) _TIFFmalloc(TIFFStripSize(tif));
^
814. if (buf == 0) {
815. TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "No space for strip buffer");
libtiff/tif_strip.c:235:1: Parameter `tif->tif_dir.td_imagelength`
233. return (TIFFVStripSize64(tif, rps));
234. }
235. tmsize_t
^
236. TIFFStripSize(TIFF* tif)
237. {
libtiff/tif_strip.c:241:4: Call
239. uint64 m;
240. tmsize_t n;
241. m=TIFFStripSize64(tif);
^
242. n=(tmsize_t)m;
243. if ((uint64)n!=m)
libtiff/tif_strip.c:226:1: Parameter `tif->tif_dir.td_imagelength`
224. * to hold the strip.
225. */
226. uint64
^
227. TIFFStripSize64(TIFF* tif)
228. {
libtiff/tif_getimage.c:818:22: Call
816. return (0);
817. }
818. _TIFFmemset(buf, 0, TIFFStripSize(tif));
^
819.
820. flip = setorientation(img);
libtiff/tif_strip.c:235:1: Parameter `tif->tif_dir.td_imagelength`
233. return (TIFFVStripSize64(tif, rps));
234. }
235. tmsize_t
^
236. TIFFStripSize(TIFF* tif)
237. {
libtiff/tif_strip.c:241:4: Call
239. uint64 m;
240. tmsize_t n;
241. m=TIFFStripSize64(tif);
^
242. n=(tmsize_t)m;
243. if ((uint64)n!=m)
libtiff/tif_strip.c:226:1: Parameter `tif->tif_dir.td_imagelength`
224. * to hold the strip.
225. */
226. uint64
^
227. TIFFStripSize64(TIFF* tif)
228. {
libtiff/tif_getimage.c:840:7: Call
838. if ((nrowsub%subsamplingver)!=0)
839. nrowsub+=subsamplingver-nrowsub%subsamplingver;
840. if (TIFFReadEncodedStrip(tif,
^
841. TIFFComputeStrip(tif,row+img->row_offset, 0),
842. buf,
libtiff/tif_read.c:123:1: <LHS trace>
121. * amount into the user-supplied buffer.
122. */
123. tmsize_t
^
124. TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
125. {
libtiff/tif_read.c:123:1: Parameter `tif->tif_dir.td_imagelength`
121. * amount into the user-supplied buffer.
122. */
123. tmsize_t
^
124. TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
125. {
libtiff/tif_read.c:151:2: Binary operation: ([0, +oo] - 1):unsigned32 by call to `TIFFReadEncodedStrip`
149. if (rowsperstrip>td->td_imagelength)
150. rowsperstrip=td->td_imagelength;
151. stripsperplane=((td->td_imagelength+rowsperstrip-1)/rowsperstrip);
^
152. stripinplane=(strip%stripsperplane);
153. plane=(strip/stripsperplane);
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_read.c/#L151
|
d2a_code_trace_data_44587
|
static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
{
const char *codec_string = encoder ? "encoder" : "decoder";
AVCodec *codec;
if(!name)
return CODEC_ID_NONE;
codec = encoder ?
avcodec_find_encoder_by_name(name) :
avcodec_find_decoder_by_name(name);
if(!codec) {
fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
ffmpeg_exit(1);
}
if(codec->type != type) {
fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
ffmpeg_exit(1);
}
if(codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
strict > FF_COMPLIANCE_EXPERIMENTAL) {
fprintf(stderr, "%s '%s' is experimental and might produce bad "
"results.\nAdd '-strict experimental' if you want to use it.\n",
codec_string, codec->name);
codec = encoder ?
avcodec_find_encoder(codec->id) :
avcodec_find_decoder(codec->id);
if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
fprintf(stderr, "Or use the non experimental %s '%s'.\n",
codec_string, codec->name);
ffmpeg_exit(1);
}
return codec->id;
}
ffmpeg.c:3090: error: Null Dereference
pointer `codec` last assigned on line 3083 could be null and is dereferenced at line 3090, column 8.
ffmpeg.c:3076:1: start of procedure find_codec_or_die()
3074. }
3075.
3076. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
^
3077. {
3078. const char *codec_string = encoder ? "encoder" : "decoder";
ffmpeg.c:3078:32: Condition is false
3076. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3077. {
3078. const char *codec_string = encoder ? "encoder" : "decoder";
^
3079. AVCodec *codec;
3080.
ffmpeg.c:3078:5:
3076. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3077. {
3078. const char *codec_string = encoder ? "encoder" : "decoder";
^
3079. AVCodec *codec;
3080.
ffmpeg.c:3081:9: Taking false branch
3079. AVCodec *codec;
3080.
3081. if(!name)
^
3082. return CODEC_ID_NONE;
3083. codec = encoder ?
ffmpeg.c:3083:13: Condition is false
3081. if(!name)
3082. return CODEC_ID_NONE;
3083. codec = encoder ?
^
3084. avcodec_find_encoder_by_name(name) :
3085. avcodec_find_decoder_by_name(name);
ffmpeg.c:3083:5:
3081. if(!name)
3082. return CODEC_ID_NONE;
3083. codec = encoder ?
^
3084. avcodec_find_encoder_by_name(name) :
3085. avcodec_find_decoder_by_name(name);
ffmpeg.c:3086:9: Taking true branch
3084. avcodec_find_encoder_by_name(name) :
3085. avcodec_find_decoder_by_name(name);
3086. if(!codec) {
^
3087. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3088. ffmpeg_exit(1);
ffmpeg.c:3087:9:
3085. avcodec_find_decoder_by_name(name);
3086. if(!codec) {
3087. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
^
3088. ffmpeg_exit(1);
3089. }
ffmpeg.c:3088:9: Skipping ffmpeg_exit(): empty list of specs
3086. if(!codec) {
3087. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3088. ffmpeg_exit(1);
^
3089. }
3090. if(codec->type != type) {
ffmpeg.c:3090:8:
3088. ffmpeg_exit(1);
3089. }
3090. if(codec->type != type) {
^
3091. fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3092. ffmpeg_exit(1);
|
https://github.com/libav/libav/blob/b568d6d94bda607e4ebb35be68181a8c2a9f5c50/ffmpeg.c/#L3090
|
d2a_code_trace_data_44588
|
int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
BN_CTX *ctx)
{
int ret;
if (BN_is_zero(divisor)) {
BNerr(BN_F_BN_DIV, BN_R_DIV_BY_ZERO);
return 0;
}
if (divisor->d[divisor->top - 1] == 0) {
BNerr(BN_F_BN_DIV, BN_R_NOT_INITIALIZED);
return 0;
}
ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
if (ret) {
if (dv != NULL)
bn_correct_top(dv);
if (rm != NULL)
bn_correct_top(rm);
}
return ret;
}
crypto/bn/bn_mont.c:351: error: BUFFER_OVERRUN_L3
Offset: [-1, 0] Size: 2 by call to `BN_mod_inverse`.
Showing all 18 steps of the trace
crypto/bn/bn_mont.c:263:1: Array declaration
261. }
262.
263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
264. {
265. int i, ret = 0;
crypto/bn/bn_mont.c:287:9: Assignment
285.
286. bn_init(&tmod);
287. tmod.d = buf;
^
288. tmod.dmax = 2;
289. tmod.neg = 0;
crypto/bn/bn_mont.c:351:19: Call
349. if (BN_is_one(&tmod))
350. BN_zero(Ri);
351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
^
352. goto err;
353. if (!BN_lshift(Ri, Ri, BN_BITS2))
crypto/bn/bn_gcd.c:124:1: Parameter `*n->d`
122. BN_CTX *ctx);
123.
124. > BIGNUM *BN_mod_inverse(BIGNUM *in,
125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
126. {
crypto/bn/bn_gcd.c:129:10: Call
127. BIGNUM *rv;
128. int noinv;
129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
^
130. if (noinv)
131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);
crypto/bn/bn_gcd.c:135:1: Parameter `*n->d`
133. }
134.
135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
137. int *pnoinv)
crypto/bn/bn_gcd.c:155:16: Call
153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
155. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
156. }
157.
crypto/bn/bn_gcd.c:458:1: Parameter `*n->d`
456. * not contain branches that may leak sensitive information.
457. */
458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
459. const BIGNUM *a, const BIGNUM *n,
460. BN_CTX *ctx)
crypto/bn/bn_gcd.c:609:18: Call
607. goto err;
608. } else {
609. if (!BN_nnmod(R, Y, n, ctx))
^
610. goto err;
611. }
crypto/bn/bn_mod.c:13:1: Parameter `*d->d`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c:209:1: <Offset trace>
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:209:1: Parameter `divisor->top`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:214:9: Call
212. int ret;
213.
214. if (BN_is_zero(divisor)) {
^
215. BNerr(BN_F_BN_DIV, BN_R_DIV_BY_ZERO);
216. return 0;
crypto/bn/bn_lib.c:866:1: Parameter `a->top`
864. }
865.
866. > int BN_is_zero(const BIGNUM *a)
867. {
868. return a->top == 0;
crypto/bn/bn_div.c:209:1: <Length trace>
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:209:1: Parameter `*divisor->d`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:224:9: Array access: Offset: [-1, 0] Size: 2 by call to `BN_mod_inverse`
222. * BN_DEBUG builds)
223. */
224. if (divisor->d[divisor->top - 1] == 0) {
^
225. BNerr(BN_F_BN_DIV, BN_R_NOT_INITIALIZED);
226. return 0;
|
https://github.com/openssl/openssl/blob/8ae173bb57819a23717fd3c8e7c51cb62f4268d0/crypto/bn/bn_div.c/#L224
|
d2a_code_trace_data_44589
|
int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
{
EVP_PKEY *xk = NULL;
int ok = 0;
xk = X509_REQ_get_pubkey(x);
switch (EVP_PKEY_cmp(xk, k)) {
case 1:
ok = 1;
break;
case 0:
X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY,
X509_R_KEY_VALUES_MISMATCH);
break;
case -1:
X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY, X509_R_KEY_TYPE_MISMATCH);
break;
case -2:
#ifndef OPENSSL_NO_EC
if (k->type == EVP_PKEY_EC) {
X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY, ERR_R_EC_LIB);
break;
}
#endif
#ifndef OPENSSL_NO_DH
if (k->type == EVP_PKEY_DH) {
X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY,
X509_R_CANT_CHECK_DH_KEY);
break;
}
#endif
X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY, X509_R_UNKNOWN_KEY_TYPE);
}
EVP_PKEY_free(xk);
return (ok);
}
crypto/x509/x509_req.c:130: error: NULL_DEREFERENCE
pointer `xk` last assigned on line 129 could be null and is dereferenced by call to `EVP_PKEY_cmp()` at line 130, column 13.
Showing all 11 steps of the trace
crypto/x509/x509_req.c:124:1: start of procedure X509_REQ_check_private_key()
122. }
123.
124. > int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
125. {
126. EVP_PKEY *xk = NULL;
crypto/x509/x509_req.c:126:5:
124. int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
125. {
126. > EVP_PKEY *xk = NULL;
127. int ok = 0;
128.
crypto/x509/x509_req.c:127:5:
125. {
126. EVP_PKEY *xk = NULL;
127. > int ok = 0;
128.
129. xk = X509_REQ_get_pubkey(x);
crypto/x509/x509_req.c:129:5:
127. int ok = 0;
128.
129. > xk = X509_REQ_get_pubkey(x);
130. switch (EVP_PKEY_cmp(xk, k)) {
131. case 1:
crypto/x509/x509_req.c:112:1: start of procedure X509_REQ_get_pubkey()
110. }
111.
112. > EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
113. {
114. if (req == NULL)
crypto/x509/x509_req.c:114:9: Taking true branch
112. EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
113. {
114. if (req == NULL)
^
115. return (NULL);
116. return (X509_PUBKEY_get(req->req_info.pubkey));
crypto/x509/x509_req.c:115:9:
113. {
114. if (req == NULL)
115. > return (NULL);
116. return (X509_PUBKEY_get(req->req_info.pubkey));
117. }
crypto/x509/x509_req.c:117:1: return from a call to X509_REQ_get_pubkey
115. return (NULL);
116. return (X509_PUBKEY_get(req->req_info.pubkey));
117. > }
118.
119. X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req)
crypto/x509/x509_req.c:130:5:
128.
129. xk = X509_REQ_get_pubkey(x);
130. > switch (EVP_PKEY_cmp(xk, k)) {
131. case 1:
132. ok = 1;
crypto/evp/p_lib.c:166:1: start of procedure EVP_PKEY_cmp()
164. }
165.
166. > int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
167. {
168. if (a->type != b->type)
crypto/evp/p_lib.c:168:9:
166. int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
167. {
168. > if (a->type != b->type)
169. return -1;
170.
|
https://github.com/openssl/openssl/blob/57ce7b617c602ae8513c22daa2bda31f179edb0f/crypto/x509/x509_req.c/#L130
|
d2a_code_trace_data_44590
|
static void new_audio_stream(AVFormatContext *oc)
{
AVStream *st;
AVCodecContext *audio_enc;
int codec_id, i;
st = av_new_stream(oc, oc->nb_streams);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
exit(1);
}
avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
audio_bitstream_filters= NULL;
if(thread_count>1)
avcodec_thread_init(st->codec, thread_count);
audio_enc = st->codec;
audio_enc->codec_type = CODEC_TYPE_AUDIO;
audio_enc->strict_std_compliance = strict;
if(audio_codec_tag)
audio_enc->codec_tag= audio_codec_tag;
if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
avctx_opts[CODEC_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
}
if (audio_stream_copy) {
st->stream_copy = 1;
audio_enc->channels = audio_channels;
} else {
codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_AUDIO);
for(i=0; i<opt_name_count; i++){
char buf[256];
const AVOption *opt;
const char *str= av_get_string(avctx_opts[CODEC_TYPE_AUDIO], opt_names[i], &opt, buf, sizeof(buf));
if(str && (opt->flags & AV_OPT_FLAG_AUDIO_PARAM) && (opt->flags & AV_OPT_FLAG_ENCODING_PARAM))
av_set_string(audio_enc, opt_names[i], str);
}
if (audio_codec_name)
codec_id = find_codec_or_die(audio_codec_name, CODEC_TYPE_AUDIO, 1);
audio_enc->codec_id = codec_id;
if (audio_qscale > QSCALE_NONE) {
audio_enc->flags |= CODEC_FLAG_QSCALE;
audio_enc->global_quality = st->quality = FF_QP2LAMBDA * audio_qscale;
}
audio_enc->thread_count = thread_count;
audio_enc->channels = audio_channels;
}
audio_enc->sample_rate = audio_sample_rate;
audio_enc->time_base= (AVRational){1, audio_sample_rate};
if (audio_language) {
av_strlcpy(st->language, audio_language, sizeof(st->language));
av_free(audio_language);
audio_language = NULL;
}
audio_disable = 0;
av_freep(&audio_codec_name);
audio_stream_copy = 0;
}
ffmpeg.c:3112: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `new_audio_stream`.
ffmpeg.c:3112:5: Call
3110. }
3111. oc = output_files[nb_output_files - 1];
3112. new_audio_stream(oc);
^
3113. }
3114.
ffmpeg.c:2993:1: <LHS trace>
2991. }
2992.
2993. static void new_audio_stream(AVFormatContext *oc)
^
2994. {
2995. AVStream *st;
ffmpeg.c:2993:1: Parameter `oc->nb_streams`
2991. }
2992.
2993. static void new_audio_stream(AVFormatContext *oc)
^
2994. {
2995. AVStream *st;
ffmpeg.c:2999:10: Call
2997. int codec_id, i;
2998.
2999. st = av_new_stream(oc, oc->nb_streams);
^
3000. if (!st) {
3001. fprintf(stderr, "Could not alloc stream\n");
libavformat/utils.c:2160:1: Parameter `s->nb_streams`
2158. }
2159.
2160. AVStream *av_new_stream(AVFormatContext *s, int id)
^
2161. {
2162. AVStream *st;
ffmpeg.c:3006:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `new_audio_stream`
3004. avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
3005.
3006. bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
^
3007. audio_bitstream_filters= NULL;
3008.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/ffmpeg.c/#L3006
|
d2a_code_trace_data_44591
|
static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
{
tls_curve_info *cinfo;
if (curve[0])
return 1;
if ((curve[1] < 1) || ((size_t)curve[1] >
sizeof(nid_list)/sizeof(nid_list[0])))
return 0;
cinfo = &nid_list[curve[1]-1];
return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve);
}
ssl/t1_lib.c:1276: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: 28 by call to `tls_curve_allowed`.
Showing all 7 steps of the trace
ssl/t1_lib.c:1109:1: Parameter `*s->session->tlsext_ellipticcurvelist`
1107. }
1108.
1109. > unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit, int *al)
1110. {
1111. int extdatalen=0;
ssl/t1_lib.c:1276:8: Call
1274. for (i = 0; i < plistlen; i += 2, plist += 2)
1275. {
1276. if (tls_curve_allowed(s, plist, SSL_SECOP_CURVE_SUPPORTED))
^
1277. {
1278. *etmp++ = plist[0];
ssl/t1_lib.c:429:1: <Offset trace>
427.
428. /* See if curve is allowed by security callback */
429. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
430. {
431. tls_curve_info *cinfo;
ssl/t1_lib.c:429:1: Parameter `*curve`
427.
428. /* See if curve is allowed by security callback */
429. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
430. {
431. tls_curve_info *cinfo;
ssl/t1_lib.c:235:1: <Length trace>
233. #define TLS_CURVE_PRIME 0x0
234.
235. > static tls_curve_info nid_list[] =
236. {
237. {NID_sect163k1, 80, TLS_CURVE_CHAR2},/* sect163k1 (1) */
ssl/t1_lib.c:235:1: Array declaration
233. #define TLS_CURVE_PRIME 0x0
234.
235. > static tls_curve_info nid_list[] =
236. {
237. {NID_sect163k1, 80, TLS_CURVE_CHAR2},/* sect163k1 (1) */
ssl/t1_lib.c:437:2: Array access: Offset: [-1, +oo] Size: 28 by call to `tls_curve_allowed`
435. sizeof(nid_list)/sizeof(nid_list[0])))
436. return 0;
437. cinfo = &nid_list[curve[1]-1];
^
438. return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve);
439. }
|
https://github.com/openssl/openssl/blob/dbb7654dc189992966ecd95ca66f7a3bb011ab9b/ssl/t1_lib.c/#L437
|
d2a_code_trace_data_44592
|
int test_exp(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b, *d, *e, *one;
int i;
a = BN_new();
b = BN_new();
d = BN_new();
e = BN_new();
one = BN_new();
BN_one(one);
for (i = 0; i < num2; i++) {
BN_bntest_rand(a, 20 + i * 5, 0, 0);
BN_bntest_rand(b, 2 + i, 0, 0);
if (BN_exp(d, a, b, ctx) <= 0)
return (0);
if (bp != NULL) {
if (!results) {
BN_print(bp, a);
BIO_puts(bp, " ^ ");
BN_print(bp, b);
BIO_puts(bp, " - ");
}
BN_print(bp, d);
BIO_puts(bp, "\n");
}
BN_one(e);
for (; !BN_is_zero(b); BN_sub(b, b, one))
BN_mul(e, e, a, ctx);
BN_sub(e, e, d);
if (!BN_is_zero(e)) {
fprintf(stderr, "Exponentiation test failed!\n");
return 0;
}
}
BN_free(a);
BN_free(b);
BN_free(d);
BN_free(e);
BN_free(one);
return (1);
}
test/bntest.c:1226: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 1193, column 9 is not reachable after line 1226, column 5.
Showing all 162 steps of the trace
test/bntest.c:1186:1: start of procedure test_exp()
1184. }
1185.
1186. > int test_exp(BIO *bp, BN_CTX *ctx)
1187. {
1188. BIGNUM *a, *b, *d, *e, *one;
test/bntest.c:1191:5:
1189. int i;
1190.
1191. > a = BN_new();
1192. b = BN_new();
1193. d = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1192:5:
1190.
1191. a = BN_new();
1192. > b = BN_new();
1193. d = BN_new();
1194. e = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1193:5:
1191. a = BN_new();
1192. b = BN_new();
1193. > d = BN_new();
1194. e = BN_new();
1195. one = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1194:5:
1192. b = BN_new();
1193. d = BN_new();
1194. > e = BN_new();
1195. one = BN_new();
1196. BN_one(one);
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1195:5:
1193. d = BN_new();
1194. e = BN_new();
1195. > one = BN_new();
1196. BN_one(one);
1197.
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1196:5:
1194. e = BN_new();
1195. one = BN_new();
1196. > BN_one(one);
1197.
1198. for (i = 0; i < num2; i++) {
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is true
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:1198:10:
1196. BN_one(one);
1197.
1198. > for (i = 0; i < num2; i++) {
1199. BN_bntest_rand(a, 20 + i * 5, 0, 0);
1200. BN_bntest_rand(b, 2 + i, 0, 0);
test/bntest.c:1198:17: Loop condition is false. Leaving loop
1196. BN_one(one);
1197.
1198. for (i = 0; i < num2; i++) {
^
1199. BN_bntest_rand(a, 20 + i * 5, 0, 0);
1200. BN_bntest_rand(b, 2 + i, 0, 0);
test/bntest.c:1224:5:
1222. }
1223. }
1224. > BN_free(a);
1225. BN_free(b);
1226. BN_free(d);
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
test/bntest.c:1225:5:
1223. }
1224. BN_free(a);
1225. > BN_free(b);
1226. BN_free(d);
1227. BN_free(e);
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
test/bntest.c:1226:5:
1224. BN_free(a);
1225. BN_free(b);
1226. > BN_free(d);
1227. BN_free(e);
1228. BN_free(one);
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L1226
|
d2a_code_trace_data_44593
|
static int opt_streamid(OptionsContext *o, const char *opt, const char *arg)
{
int idx;
char *p;
char idx_str[16];
av_strlcpy(idx_str, arg, sizeof(idx_str));
p = strchr(idx_str, ':');
if (!p) {
av_log(NULL, AV_LOG_FATAL,
"Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
arg, opt);
exit_program(1);
}
*p++ = '\0';
idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, INT_MAX);
o->streamid_map = grow_array(o->streamid_map, sizeof(*o->streamid_map), &o->nb_streamid_map, idx+1);
o->streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
return 0;
}
avconv.c:3333: error: Null Dereference
pointer `p` last assigned on line 3333 could be null and is dereferenced at line 3333, column 5.
avconv.c:3319:1: start of procedure opt_streamid()
3317.
3318. /* arg format is "output-stream-index:streamid-value". */
3319. static int opt_streamid(OptionsContext *o, const char *opt, const char *arg)
^
3320. {
3321. int idx;
avconv.c:3325:5:
3323. char idx_str[16];
3324.
3325. av_strlcpy(idx_str, arg, sizeof(idx_str));
^
3326. p = strchr(idx_str, ':');
3327. if (!p) {
libavutil/avstring.c:64:1: start of procedure av_strlcpy()
62. }
63.
64. size_t av_strlcpy(char *dst, const char *src, size_t size)
^
65. {
66. size_t len = 0;
libavutil/avstring.c:66:5:
64. size_t av_strlcpy(char *dst, const char *src, size_t size)
65. {
66. size_t len = 0;
^
67. while (++len < size && *src)
68. *dst++ = *src++;
libavutil/avstring.c:67:12: Loop condition is true. Entering loop body
65. {
66. size_t len = 0;
67. while (++len < size && *src)
^
68. *dst++ = *src++;
69. if (len <= size)
libavutil/avstring.c:67:28: Loop condition is false. Leaving loop
65. {
66. size_t len = 0;
67. while (++len < size && *src)
^
68. *dst++ = *src++;
69. if (len <= size)
libavutil/avstring.c:69:9: Taking true branch
67. while (++len < size && *src)
68. *dst++ = *src++;
69. if (len <= size)
^
70. *dst = 0;
71. return len + strlen(src) - 1;
libavutil/avstring.c:70:9:
68. *dst++ = *src++;
69. if (len <= size)
70. *dst = 0;
^
71. return len + strlen(src) - 1;
72. }
libavutil/avstring.c:71:5:
69. if (len <= size)
70. *dst = 0;
71. return len + strlen(src) - 1;
^
72. }
73.
libavutil/avstring.c:72:1: return from a call to av_strlcpy
70. *dst = 0;
71. return len + strlen(src) - 1;
72. }
^
73.
74. size_t av_strlcat(char *dst, const char *src, size_t size)
avconv.c:3326:5:
3324.
3325. av_strlcpy(idx_str, arg, sizeof(idx_str));
3326. p = strchr(idx_str, ':');
^
3327. if (!p) {
3328. av_log(NULL, AV_LOG_FATAL,
avconv.c:3327:10: Taking true branch
3325. av_strlcpy(idx_str, arg, sizeof(idx_str));
3326. p = strchr(idx_str, ':');
3327. if (!p) {
^
3328. av_log(NULL, AV_LOG_FATAL,
3329. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
avconv.c:3328:9: Skipping av_log(): empty list of specs
3326. p = strchr(idx_str, ':');
3327. if (!p) {
3328. av_log(NULL, AV_LOG_FATAL,
^
3329. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3330. arg, opt);
avconv.c:3331:9: Skipping exit_program(): empty list of specs
3329. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3330. arg, opt);
3331. exit_program(1);
^
3332. }
3333. *p++ = '\0';
avconv.c:3333:5:
3331. exit_program(1);
3332. }
3333. *p++ = '\0';
^
3334. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, INT_MAX);
3335. o->streamid_map = grow_array(o->streamid_map, sizeof(*o->streamid_map), &o->nb_streamid_map, idx+1);
|
https://github.com/libav/libav/blob/8664682d0e6b6071ca7b3f6b9e350305d3fbcf76/avconv.c/#L3333
|
d2a_code_trace_data_44594
|
static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
int length= FFMAX(a->length, b->length);
double *coeff= av_malloc(length*sizeof(double));
int i;
SwsVector *vec= av_malloc(sizeof(SwsVector));
vec->coeff= coeff;
vec->length= length;
for (i=0; i<length; i++) coeff[i]= 0.0;
for (i=0; i<a->length; i++) coeff[i + (length-1)/2 - (a->length-1)/2]+= a->coeff[i];
for (i=0; i<b->length; i++) coeff[i + (length-1)/2 - (b->length-1)/2]-= b->coeff[i];
return vec;
}
libswscale/swscale.c:2994: error: Null Dereference
pointer `vec` last assigned on line 2992 could be null and is dereferenced at line 2994, column 5.
libswscale/swscale.c:2988:1: start of procedure sws_diffVec()
2986. }
2987.
2988. static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
^
2989. int length= FFMAX(a->length, b->length);
2990. double *coeff= av_malloc(length*sizeof(double));
libswscale/swscale.c:2989:17: Condition is true
2987.
2988. static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
2989. int length= FFMAX(a->length, b->length);
^
2990. double *coeff= av_malloc(length*sizeof(double));
2991. int i;
libswscale/swscale.c:2989:5:
2987.
2988. static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
2989. int length= FFMAX(a->length, b->length);
^
2990. double *coeff= av_malloc(length*sizeof(double));
2991. int i;
libswscale/swscale.c:2990:5:
2988. static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
2989. int length= FFMAX(a->length, b->length);
2990. double *coeff= av_malloc(length*sizeof(double));
^
2991. int i;
2992. SwsVector *vec= av_malloc(sizeof(SwsVector));
libavutil/mem.c:47:1: start of procedure av_malloc()
45. linker will do it automatically. */
46.
47. void *av_malloc(unsigned int size)
^
48. {
49. void *ptr = NULL;
libavutil/mem.c:49:5:
47. void *av_malloc(unsigned int size)
48. {
49. void *ptr = NULL;
^
50. #if CONFIG_MEMALIGN_HACK
51. long diff;
libavutil/mem.c:55:8: Taking false branch
53.
54. /* let's disallow possible ambiguous cases */
55. if(size > (INT_MAX-16) )
^
56. return NULL;
57.
libavutil/mem.c:66:9: Taking false branch
64. ((char*)ptr)[-1]= diff;
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
^
67. ptr = NULL;
68. #elif HAVE_MEMALIGN
libavutil/mem.c:99:5:
97. ptr = malloc(size);
98. #endif
99. return ptr;
^
100. }
101.
libavutil/mem.c:100:1: return from a call to av_malloc
98. #endif
99. return ptr;
100. }
^
101.
102. void *av_realloc(void *ptr, unsigned int size)
libswscale/swscale.c:2992:5:
2990. double *coeff= av_malloc(length*sizeof(double));
2991. int i;
2992. SwsVector *vec= av_malloc(sizeof(SwsVector));
^
2993.
2994. vec->coeff= coeff;
libavutil/mem.c:47:1: start of procedure av_malloc()
45. linker will do it automatically. */
46.
47. void *av_malloc(unsigned int size)
^
48. {
49. void *ptr = NULL;
libavutil/mem.c:49:5:
47. void *av_malloc(unsigned int size)
48. {
49. void *ptr = NULL;
^
50. #if CONFIG_MEMALIGN_HACK
51. long diff;
libavutil/mem.c:55:8: Taking false branch
53.
54. /* let's disallow possible ambiguous cases */
55. if(size > (INT_MAX-16) )
^
56. return NULL;
57.
libavutil/mem.c:66:9: Taking true branch
64. ((char*)ptr)[-1]= diff;
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
^
67. ptr = NULL;
68. #elif HAVE_MEMALIGN
libavutil/mem.c:67:9:
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
67. ptr = NULL;
^
68. #elif HAVE_MEMALIGN
69. ptr = memalign(16,size);
libavutil/mem.c:99:5:
97. ptr = malloc(size);
98. #endif
99. return ptr;
^
100. }
101.
libavutil/mem.c:100:1: return from a call to av_malloc
98. #endif
99. return ptr;
100. }
^
101.
102. void *av_realloc(void *ptr, unsigned int size)
libswscale/swscale.c:2994:5:
2992. SwsVector *vec= av_malloc(sizeof(SwsVector));
2993.
2994. vec->coeff= coeff;
^
2995. vec->length= length;
2996.
|
https://github.com/libav/libav/blob/184bc53db4fded8857af09cee2adc7197940deb7/libswscale/swscale.c/#L2994
|
d2a_code_trace_data_44595
|
u_char *
ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
{
u_char *p, zero, *last;
int d;
float f, scale;
size_t len, slen;
int64_t i64;
uint64_t ui64;
ngx_msec_t ms;
ngx_uint_t width, sign, hex, max_width, frac_width, i;
ngx_str_t *v;
ngx_variable_value_t *vv;
if (max == 0) {
return buf;
}
last = buf + max;
while (*fmt && buf < last) {
if (*fmt == '%') {
i64 = 0;
ui64 = 0;
zero = (u_char) ((*++fmt == '0') ? '0' : ' ');
width = 0;
sign = 1;
hex = 0;
max_width = 0;
frac_width = 0;
slen = (size_t) -1;
while (*fmt >= '0' && *fmt <= '9') {
width = width * 10 + *fmt++ - '0';
}
for ( ;; ) {
switch (*fmt) {
case 'u':
sign = 0;
fmt++;
continue;
case 'm':
max_width = 1;
fmt++;
continue;
case 'X':
hex = 2;
sign = 0;
fmt++;
continue;
case 'x':
hex = 1;
sign = 0;
fmt++;
continue;
case '.':
fmt++;
while (*fmt >= '0' && *fmt <= '9') {
frac_width = frac_width * 10 + *fmt++ - '0';
}
break;
case '*':
slen = va_arg(args, size_t);
fmt++;
continue;
default:
break;
}
break;
}
switch (*fmt) {
case 'V':
v = va_arg(args, ngx_str_t *);
len = v->len;
len = (buf + len < last) ? len : (size_t) (last - buf);
buf = ngx_cpymem(buf, v->data, len);
fmt++;
continue;
case 'v':
vv = va_arg(args, ngx_variable_value_t *);
len = vv->len;
len = (buf + len < last) ? len : (size_t) (last - buf);
buf = ngx_cpymem(buf, vv->data, len);
fmt++;
continue;
case 's':
p = va_arg(args, u_char *);
if (slen == (size_t) -1) {
while (*p && buf < last) {
*buf++ = *p++;
}
} else {
len = (buf + slen < last) ? slen : (size_t) (last - buf);
buf = ngx_cpymem(buf, p, len);
}
fmt++;
continue;
case 'O':
i64 = (int64_t) va_arg(args, off_t);
sign = 1;
break;
case 'P':
i64 = (int64_t) va_arg(args, ngx_pid_t);
sign = 1;
break;
case 'T':
i64 = (int64_t) va_arg(args, time_t);
sign = 1;
break;
case 'M':
ms = (ngx_msec_t) va_arg(args, ngx_msec_t);
if ((ngx_msec_int_t) ms == -1) {
sign = 1;
i64 = -1;
} else {
sign = 0;
ui64 = (uint64_t) ms;
}
break;
case 'z':
if (sign) {
i64 = (int64_t) va_arg(args, ssize_t);
} else {
ui64 = (uint64_t) va_arg(args, size_t);
}
break;
case 'i':
if (sign) {
i64 = (int64_t) va_arg(args, ngx_int_t);
} else {
ui64 = (uint64_t) va_arg(args, ngx_uint_t);
}
if (max_width) {
width = NGX_INT_T_LEN;
}
break;
case 'd':
if (sign) {
i64 = (int64_t) va_arg(args, int);
} else {
ui64 = (uint64_t) va_arg(args, u_int);
}
break;
case 'l':
if (sign) {
i64 = (int64_t) va_arg(args, long);
} else {
ui64 = (uint64_t) va_arg(args, u_long);
}
break;
case 'D':
if (sign) {
i64 = (int64_t) va_arg(args, int32_t);
} else {
ui64 = (uint64_t) va_arg(args, uint32_t);
}
break;
case 'L':
if (sign) {
i64 = va_arg(args, int64_t);
} else {
ui64 = va_arg(args, uint64_t);
}
break;
case 'A':
if (sign) {
i64 = (int64_t) va_arg(args, ngx_atomic_int_t);
} else {
ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t);
}
if (max_width) {
width = NGX_ATOMIC_T_LEN;
}
break;
case 'f':
f = (float) va_arg(args, double);
if (f < 0) {
*buf++ = '-';
f = -f;
}
ui64 = (int64_t) f;
buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width);
if (frac_width) {
if (buf < last) {
*buf++ = '.';
}
scale = 1.0;
for (i = 0; i < frac_width; i++) {
scale *= 10.0;
}
ui64 = (uint64_t) ((f - (int64_t) ui64) * scale);
buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width);
}
fmt++;
continue;
#if !(NGX_WIN32)
case 'r':
i64 = (int64_t) va_arg(args, rlim_t);
sign = 1;
break;
#endif
case 'p':
ui64 = (uintptr_t) va_arg(args, void *);
hex = 2;
sign = 0;
zero = '0';
width = NGX_PTR_SIZE * 2;
break;
case 'c':
d = va_arg(args, int);
*buf++ = (u_char) (d & 0xff);
fmt++;
continue;
case 'Z':
*buf++ = '\0';
fmt++;
continue;
case 'N':
#if (NGX_WIN32)
*buf++ = CR;
#endif
*buf++ = LF;
fmt++;
continue;
case '%':
*buf++ = '%';
fmt++;
continue;
default:
*buf++ = *fmt++;
continue;
}
if (sign) {
if (i64 < 0) {
*buf++ = '-';
ui64 = (uint64_t) -i64;
} else {
ui64 = (uint64_t) i64;
}
}
buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width);
fmt++;
} else {
*buf++ = *fmt++;
}
}
return buf;
}
src/http/ngx_http_request.c:1427: error: Buffer Overrun L2
Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`.
src/http/ngx_http_request.c:1418:9: Call
1416. ngx_http_process_request_header(ngx_http_request_t *r)
1417. {
1418. if (ngx_http_find_virtual_server(r, r->headers_in.server.data,
^
1419. r->headers_in.server.len)
1420. == NGX_ERROR)
src/http/ngx_http_request.c:1673:21: Unknown value from: __infer_skip
1671. }
1672.
1673. ngx_memcpy(server, buf, len);
^
1674. name.data = server;
1675. }
src/http/ngx_http_request.c:1427:9: Call
1425.
1426. if (r->headers_in.host == NULL && r->http_version > NGX_HTTP_VERSION_10) {
1427. ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
^
1428. "client sent HTTP/1.1 request without \"Host\" header");
1429. ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
src/core/ngx_log.c:67:1: Array declaration
65. #if (NGX_HAVE_VARIADIC_MACROS)
66.
67. void
^
68. ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
69. const char *fmt, ...)
src/core/ngx_log.c:88:5: Assignment
86. }
87.
88. last = errstr + NGX_MAX_ERROR_STR;
^
89.
90. ngx_memcpy(errstr, ngx_cached_err_log_time.data,
src/core/ngx_log.c:133:13: Call
131. ? " (%d: " : " (%Xd: ", err);
132. #else
133. p = ngx_snprintf(p, last - p, " (%d: ", err);
^
134. #endif
135.
src/core/ngx_string.c:109:1: Parameter `max`
107.
108.
109. u_char * ngx_cdecl
^
110. ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...)
111. {
src/core/ngx_string.c:116:9: Call
114.
115. va_start(args, fmt);
116. p = ngx_vsnprintf(buf, max, fmt, args);
^
117. va_end(args);
118.
src/core/ngx_string.c:123:1: <Length trace>
121.
122.
123. u_char *
^
124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
125. {
src/core/ngx_string.c:123:1: Parameter `*buf`
121.
122.
123. u_char *
^
124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
125. {
src/core/ngx_string.c:244:25: Array access: Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`
242. if (slen == (size_t) -1) {
243. while (*p && buf < last) {
244. *buf++ = *p++;
^
245. }
246.
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L244
|
d2a_code_trace_data_44596
|
static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
{
InputStream *ist = s->opaque;
const enum AVPixelFormat *p;
int ret;
for (p = pix_fmts; *p != -1; p++) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
const HWAccel *hwaccel;
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
break;
hwaccel = get_hwaccel(*p);
if (!hwaccel ||
(ist->active_hwaccel_id && ist->active_hwaccel_id != hwaccel->id) ||
(ist->hwaccel_id != HWACCEL_AUTO && ist->hwaccel_id != hwaccel->id))
continue;
ret = hwaccel->init(s);
if (ret < 0) {
if (ist->hwaccel_id == hwaccel->id) {
av_log(NULL, AV_LOG_FATAL,
"%s hwaccel requested for input stream #%d:%d, "
"but cannot be initialized.\n", hwaccel->name,
ist->file_index, ist->st->index);
return AV_PIX_FMT_NONE;
}
continue;
}
if (ist->hw_frames_ctx) {
s->hw_frames_ctx = av_buffer_ref(ist->hw_frames_ctx);
if (!s->hw_frames_ctx)
return AV_PIX_FMT_NONE;
}
ist->active_hwaccel_id = hwaccel->id;
ist->hwaccel_pix_fmt = *p;
break;
}
return *p;
}
avconv.c:1638: error: Null Dereference
pointer `desc` last assigned on line 1635 could be null and is dereferenced at line 1638, column 15.
avconv.c:1628:1: start of procedure get_format()
1626. }
1627.
1628. static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
^
1629. {
1630. InputStream *ist = s->opaque;
avconv.c:1630:5:
1628. static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts)
1629. {
1630. InputStream *ist = s->opaque;
^
1631. const enum AVPixelFormat *p;
1632. int ret;
avconv.c:1634:10:
1632. int ret;
1633.
1634. for (p = pix_fmts; *p != -1; p++) {
^
1635. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
1636. const HWAccel *hwaccel;
avconv.c:1634:24: Loop condition is true. Entering loop body
1632. int ret;
1633.
1634. for (p = pix_fmts; *p != -1; p++) {
^
1635. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
1636. const HWAccel *hwaccel;
avconv.c:1635:9:
1633.
1634. for (p = pix_fmts; *p != -1; p++) {
1635. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
^
1636. const HWAccel *hwaccel;
1637.
libavutil/pixdesc.c:1893:1: start of procedure av_pix_fmt_desc_get()
1891. }
1892.
1893. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
^
1894. {
1895. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
libavutil/pixdesc.c:1895:9: Taking false branch
1893. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1894. {
1895. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1896. return NULL;
1897. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1895:24: Taking true branch
1893. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1894. {
1895. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1896. return NULL;
1897. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1896:9:
1894. {
1895. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1896. return NULL;
^
1897. return &av_pix_fmt_descriptors[pix_fmt];
1898. }
libavutil/pixdesc.c:1898:1: return from a call to av_pix_fmt_desc_get
1896. return NULL;
1897. return &av_pix_fmt_descriptors[pix_fmt];
1898. }
^
1899.
1900. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
avconv.c:1638:15:
1636. const HWAccel *hwaccel;
1637.
1638. if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
^
1639. break;
1640.
|
https://github.com/libav/libav/blob/d0a603a534a0ee4b255e5e72742428a7f7f42b83/avconv.c/#L1638
|
d2a_code_trace_data_44597
|
ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value)
{
BIGNUM *bn = NULL;
ASN1_INTEGER *aint;
int isneg, ishex;
int ret;
if (value == NULL) {
X509V3err(X509V3_F_S2I_ASN1_INTEGER, X509V3_R_INVALID_NULL_VALUE);
return NULL;
}
bn = BN_new();
if (bn == NULL) {
X509V3err(X509V3_F_S2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE);
return NULL;
}
if (value[0] == '-') {
value++;
isneg = 1;
} else
isneg = 0;
if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {
value += 2;
ishex = 1;
} else
ishex = 0;
if (ishex)
ret = BN_hex2bn(&bn, value);
else
ret = BN_dec2bn(&bn, value);
if (!ret || value[ret]) {
BN_free(bn);
X509V3err(X509V3_F_S2I_ASN1_INTEGER, X509V3_R_BN_DEC2BN_ERROR);
return NULL;
}
if (isneg && BN_is_zero(bn))
isneg = 0;
aint = BN_to_ASN1_INTEGER(bn, NULL);
BN_free(bn);
if (!aint) {
X509V3err(X509V3_F_S2I_ASN1_INTEGER,
X509V3_R_BN_TO_ASN1_INTEGER_ERROR);
return NULL;
}
if (isneg)
aint->type |= V_ASN1_NEG;
return aint;
}
crypto/x509v3/v3_utl.c:201: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 183, column 10 is not reachable after line 201, column 15.
Showing all 34 steps of the trace
crypto/x509v3/v3_utl.c:173:1: start of procedure s2i_ASN1_INTEGER()
171. }
172.
173. > ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value)
174. {
175. BIGNUM *bn = NULL;
crypto/x509v3/v3_utl.c:175:5:
173. ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value)
174. {
175. > BIGNUM *bn = NULL;
176. ASN1_INTEGER *aint;
177. int isneg, ishex;
crypto/x509v3/v3_utl.c:179:9: Taking false branch
177. int isneg, ishex;
178. int ret;
179. if (value == NULL) {
^
180. X509V3err(X509V3_F_S2I_ASN1_INTEGER, X509V3_R_INVALID_NULL_VALUE);
181. return NULL;
crypto/x509v3/v3_utl.c:183:5:
181. return NULL;
182. }
183. > bn = BN_new();
184. if (bn == NULL) {
185. X509V3err(X509V3_F_S2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
crypto/x509v3/v3_utl.c:184:9: Taking false branch
182. }
183. bn = BN_new();
184. if (bn == NULL) {
^
185. X509V3err(X509V3_F_S2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE);
186. return NULL;
crypto/x509v3/v3_utl.c:188:9: Taking false branch
186. return NULL;
187. }
188. if (value[0] == '-') {
^
189. value++;
190. isneg = 1;
crypto/x509v3/v3_utl.c:192:9:
190. isneg = 1;
191. } else
192. > isneg = 0;
193.
194. if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {
crypto/x509v3/v3_utl.c:194:9: Taking true branch
192. isneg = 0;
193.
194. if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {
^
195. value += 2;
196. ishex = 1;
crypto/x509v3/v3_utl.c:194:30: Taking true branch
192. isneg = 0;
193.
194. if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {
^
195. value += 2;
196. ishex = 1;
crypto/x509v3/v3_utl.c:195:9:
193.
194. if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {
195. > value += 2;
196. ishex = 1;
197. } else
crypto/x509v3/v3_utl.c:196:9:
194. if (value[0] == '0' && ((value[1] == 'x') || (value[1] == 'X'))) {
195. value += 2;
196. > ishex = 1;
197. } else
198. ishex = 0;
crypto/x509v3/v3_utl.c:200:9: Taking true branch
198. ishex = 0;
199.
200. if (ishex)
^
201. ret = BN_hex2bn(&bn, value);
202. else
crypto/x509v3/v3_utl.c:201:9: Skipping BN_hex2bn(): empty list of specs
199.
200. if (ishex)
201. ret = BN_hex2bn(&bn, value);
^
202. else
203. ret = BN_dec2bn(&bn, value);
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/x509v3/v3_utl.c/#L201
|
d2a_code_trace_data_44598
|
static OSSL_STORE_LOADER_CTX *file_open(const OSSL_STORE_LOADER *loader,
const char *uri,
const UI_METHOD *ui_method,
void *ui_data)
{
OSSL_STORE_LOADER_CTX *ctx = NULL;
struct stat st;
struct {
const char *path;
unsigned int check_absolute:1;
} path_data[2];
size_t path_data_n = 0, i;
const char *path;
path_data[path_data_n].check_absolute = 0;
path_data[path_data_n++].path = uri;
if (strncasecmp(uri, "file:", 5) == 0) {
const char *p = &uri[5];
if (strncmp(&uri[5], "//", 2) == 0) {
path_data_n--;
if (strncasecmp(&uri[7], "localhost/", 10) == 0) {
p = &uri[16];
} else if (uri[7] == '/') {
p = &uri[7];
} else {
OSSL_STOREerr(OSSL_STORE_F_FILE_OPEN,
OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED);
return NULL;
}
}
path_data[path_data_n].check_absolute = 1;
#ifdef _WIN32
if (p[0] == '/' && p[2] == ':' && p[3] == '/') {
char c = tolower(p[1]);
if (c >= 'a' && c <= 'z') {
p++;
path_data[path_data_n].check_absolute = 0;
}
}
#endif
path_data[path_data_n++].path = p;
}
for (i = 0, path = NULL; path == NULL && i < path_data_n; i++) {
if (path_data[i].check_absolute && path_data[i].path[0] != '/') {
OSSL_STOREerr(OSSL_STORE_F_FILE_OPEN,
OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE);
ERR_add_error_data(1, path_data[i].path);
return NULL;
}
if (stat(path_data[i].path, &st) < 0) {
SYSerr(SYS_F_STAT, errno);
ERR_add_error_data(1, path_data[i].path);
} else {
path = path_data[i].path;
}
}
if (path == NULL) {
return NULL;
}
ERR_clear_error();
ctx = OPENSSL_zalloc(sizeof(*ctx));
if (ctx == NULL) {
OSSL_STOREerr(OSSL_STORE_F_FILE_OPEN, ERR_R_MALLOC_FAILURE);
return NULL;
}
if ((st.st_mode & S_IFDIR) == S_IFDIR) {
ctx->_.dir.uri = OPENSSL_strdup(uri);
ctx->type = is_dir;
if (ctx->_.dir.uri == NULL)
goto err;
ctx->_.dir.last_entry = OPENSSL_DIR_read(&ctx->_.dir.ctx, path);
ctx->_.dir.last_errno = errno;
if (ctx->_.dir.last_entry == NULL) {
if (ctx->_.dir.last_errno != 0) {
char errbuf[256];
errno = ctx->_.dir.last_errno;
openssl_strerror_r(errno, errbuf, sizeof(errbuf));
OSSL_STOREerr(OSSL_STORE_F_FILE_OPEN, ERR_R_SYS_LIB);
ERR_add_error_data(1, errbuf);
goto err;
}
ctx->_.dir.end_reached = 1;
}
} else {
BIO *buff = NULL;
char peekbuf[4096];
if ((buff = BIO_new(BIO_f_buffer())) == NULL
|| (ctx->_.file.file = BIO_new_file(path, "rb")) == NULL) {
BIO_free_all(buff);
goto err;
}
ctx->_.file.file = BIO_push(buff, ctx->_.file.file);
if (BIO_buffer_peek(ctx->_.file.file, peekbuf, sizeof(peekbuf)-1) > 0) {
peekbuf[sizeof(peekbuf)-1] = '\0';
if (strstr(peekbuf, "-----BEGIN ") != NULL)
ctx->type = is_pem;
}
}
return ctx;
err:
OSSL_STORE_LOADER_CTX_free(ctx);
return NULL;
}
crypto/store/loader_file.c:831: error: UNINITIALIZED_VALUE
The value read from st.st_mode was never initialized.
Showing all 1 steps of the trace
crypto/store/loader_file.c:831:9:
829. }
830.
831. > if ((st.st_mode & S_IFDIR) == S_IFDIR) {
832. /*
833. * Try to copy everything, even if we know that some of them must be
|
https://github.com/openssl/openssl/blob/74df8c4ce3c7ccb4e2809a44791756356f704b66/crypto/store/loader_file.c/#L831
|
d2a_code_trace_data_44599
|
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
enum AVSampleFormat sample_fmt, int align)
{
int line_size;
int sample_size = av_get_bytes_per_sample(sample_fmt);
int planar = av_sample_fmt_is_planar(sample_fmt);
if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
return AVERROR(EINVAL);
if (!align) {
if (nb_samples > INT_MAX - 31)
return AVERROR(EINVAL);
align = 1;
nb_samples = FFALIGN(nb_samples, 32);
}
if (nb_channels > INT_MAX / align ||
(int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)
return AVERROR(EINVAL);
line_size = planar ? FFALIGN(nb_samples * sample_size, align) :
FFALIGN(nb_samples * sample_size * nb_channels, align);
if (linesize)
*linesize = line_size;
return planar ? line_size * nb_channels : line_size;
}
avconv.c:650: error: Integer Overflow L2
([1, 2147483616] + 32):signed32 by call to `av_buffersink_get_samples`.
avconv.c:650:15: Call
648. if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
649. !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
650. ret = av_buffersink_get_samples(ost->filter->filter, filtered_frame,
^
651. ost->st->codec->frame_size);
652. else
libavfilter/buffersink.c:102:1: Parameter `nb_samples`
100. }
101.
102. int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx,
^
103. AVFrame *frame, int nb_samples)
104. {
libavfilter/buffersink.c:111:31: Call
109. if (!s->audio_fifo) {
110. int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
111. if (!(s->audio_fifo = av_audio_fifo_alloc(link->format, nb_channels, nb_samples)))
^
112. return AVERROR(ENOMEM);
113. }
libavutil/audio_fifo.c:60:1: Parameter `nb_samples`
58. }
59.
60. AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
^
61. int nb_samples)
62. {
libavutil/audio_fifo.c:67:9: Call
65.
66. /* get channel buffer size (also validates parameters) */
67. if (av_samples_get_buffer_size(&buf_size, channels, nb_samples, sample_fmt, 1) < 0)
^
68. return NULL;
69.
libavutil/samplefmt.c:108:1: <LHS trace>
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:108:1: Parameter `nb_samples`
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `av_buffersink_get_samples`
122. return AVERROR(EINVAL);
123. align = 1;
124. nb_samples = FFALIGN(nb_samples, 32);
^
125. }
126.
|
https://github.com/libav/libav/blob/0e830094ad0dc251613a0aa3234d9c5c397e02e6/libavutil/samplefmt.c/#L124
|
d2a_code_trace_data_44600
|
void avformat_free_context(AVFormatContext *s)
{
int i, j;
AVStream *st;
if (!s)
return;
av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data)
av_opt_free(s->priv_data);
for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
for (j = 0; j < st->nb_side_data; j++)
av_freep(&st->side_data[j].data);
av_freep(&st->side_data);
st->nb_side_data = 0;
if (st->parser) {
av_parser_close(st->parser);
}
if (st->attached_pic.data)
av_free_packet(&st->attached_pic);
av_dict_free(&st->metadata);
av_freep(&st->probe_data.buf);
av_free(st->index_entries);
av_free(st->codec->extradata);
av_free(st->codec->subtitle_header);
av_free(st->codec);
av_free(st->priv_data);
av_free(st->info);
av_free(st);
}
for (i = s->nb_programs - 1; i >= 0; i--) {
av_dict_free(&s->programs[i]->metadata);
av_freep(&s->programs[i]->stream_index);
av_freep(&s->programs[i]);
}
av_freep(&s->programs);
av_freep(&s->priv_data);
while (s->nb_chapters--) {
av_dict_free(&s->chapters[s->nb_chapters]->metadata);
av_free(s->chapters[s->nb_chapters]);
}
av_freep(&s->chapters);
av_dict_free(&s->metadata);
av_freep(&s->streams);
av_freep(&s->internal);
av_free(s);
}
libavformat/segment.c:276: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `seg_free_context`.
libavformat/segment.c:220:20: Call
218. "expect issues decoding it.\n");
219.
220. seg->oformat = av_guess_format(seg->format, s->filename, NULL);
^
221.
222. if (!seg->oformat) {
libavformat/format.c:115:16: Unknown value from: av_guess_format
113. av_filename_number_test(filename) &&
114. ff_guess_image2_codec(filename) != AV_CODEC_ID_NONE) {
115. return av_guess_format("image2", NULL, NULL);
^
116. }
117. #endif
libavformat/segment.c:276:9: Call
274. fail:
275. if (ret < 0)
276. seg_free_context(seg);
^
277.
278. return ret;
libavformat/segment.c:187:1: Parameter `seg->avf->nb_programs`
185. }
186.
187. static void seg_free_context(SegmentContext *seg)
^
188. {
189. avio_closep(&seg->pb);
libavformat/segment.c:190:5: Call
188. {
189. avio_closep(&seg->pb);
190. avformat_free_context(seg->avf);
^
191. seg->avf = NULL;
192. }
libavformat/utils.c:2432:1: <LHS trace>
2430. }
2431.
2432. void avformat_free_context(AVFormatContext *s)
^
2433. {
2434. int i, j;
libavformat/utils.c:2432:1: Parameter `s->nb_programs`
2430. }
2431.
2432. void avformat_free_context(AVFormatContext *s)
^
2433. {
2434. int i, j;
libavformat/utils.c:2468:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `seg_free_context`
2466. av_free(st);
2467. }
2468. for (i = s->nb_programs - 1; i >= 0; i--) {
^
2469. av_dict_free(&s->programs[i]->metadata);
2470. av_freep(&s->programs[i]->stream_index);
|
https://github.com/libav/libav/blob/2dbd35b00c6433e587d5f44d5dbc8972ebbaa88e/libavformat/utils.c/#L2468
|
d2a_code_trace_data_44601
|
static inline void refill_32(BitstreamContext *bc)
{
if (bc->ptr >= bc->buffer_end)
return;
#ifdef BITSTREAM_READER_LE
bc->bits = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;
#else
bc->bits = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);
#endif
bc->ptr += 4;
bc->bits_left += 32;
}
libavformat/movenc.c:256: error: Integer Overflow L2
(32 - [0, 64]):unsigned32 by call to `bitstream_read`.
libavformat/movenc.c:255:5: Call
253. ffio_wfourcc(pb, "dac3");
254.
255. bitstream_init(&bc, track->vos_data + 4, (track->vos_len - 4) * 8);
^
256. fscod = bitstream_read(&bc, 2);
257. frmsizecod = bitstream_read(&bc, 6);
libavcodec/bitstream.h:85:9: Assignment
83. bc->buffer =
84. bc->ptr = NULL;
85. bc->bits_left = 0;
^
86. return AVERROR_INVALIDDATA;
87. }
libavformat/movenc.c:256:18: Call
254.
255. bitstream_init(&bc, track->vos_data + 4, (track->vos_len - 4) * 8);
256. fscod = bitstream_read(&bc, 2);
^
257. frmsizecod = bitstream_read(&bc, 6);
258. bsid = bitstream_read(&bc, 5);
libavcodec/bitstream.h:183:1: Parameter `n`
181.
182. /* Return n bits from the buffer. n has to be in the 0-32 range. */
183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)
^
184. {
185. if (!n)
libavcodec/bitstream.h:189:9: Call
187.
188. if (n > bc->bits_left) {
189. refill_32(bc);
^
190. if (bc->bits_left < 32)
191. bc->bits_left = n;
libavcodec/bitstream.h:60:1: <RHS trace>
58. }
59.
60. static inline void refill_32(BitstreamContext *bc)
^
61. {
62. if (bc->ptr >= bc->buffer_end)
libavcodec/bitstream.h:60:1: Parameter `bc->bits_left`
58. }
59.
60. static inline void refill_32(BitstreamContext *bc)
^
61. {
62. if (bc->ptr >= bc->buffer_end)
libavcodec/bitstream.h:68:5: Binary operation: (32 - [0, 64]):unsigned32 by call to `bitstream_read`
66. bc->bits = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits;
67. #else
68. bc->bits = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left);
^
69. #endif
70. bc->ptr += 4;
|
https://github.com/libav/libav/blob/7ff018c1cb43a5fe5ee2049d325cdd785852067a/libavcodec/bitstream.h/#L68
|
d2a_code_trace_data_44602
|
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
if (!ossl_assert(pkt->subs != NULL && len != 0))
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
if (allocbytes != NULL)
*allocbytes = WPACKET_get_curr(pkt);
return 1;
}
ssl/statem/extensions_srvr.c:1244: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `WPACKET_put_bytes__`.
Showing all 12 steps of the trace
ssl/statem/extensions_srvr.c:1243:17: Call
1241.
1242. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk)
1243. || !WPACKET_start_sub_packet_u16(pkt)
^
1244. || !WPACKET_put_bytes_u16(pkt, s->session->ext.tick_identity)
1245. || !WPACKET_close(pkt)) {
ssl/packet.c:270:1: Parameter `pkt->buf->length`
268. }
269.
270. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
271. {
272. WPACKET_SUB *sub;
ssl/statem/extensions_srvr.c:1244:17: Call
1242. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_psk)
1243. || !WPACKET_start_sub_packet_u16(pkt)
1244. || !WPACKET_put_bytes_u16(pkt, s->session->ext.tick_identity)
^
1245. || !WPACKET_close(pkt)) {
1246. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_PSK, ERR_R_INTERNAL_ERROR);
ssl/packet.c:306:1: Parameter `pkt->written`
304. }
305.
306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
307. {
308. unsigned char *data;
ssl/packet.c:312:17: Call
310. /* Internal API, so should not fail */
311. if (!ossl_assert(size <= sizeof(unsigned int))
312. || !WPACKET_allocate_bytes(pkt, size, &data)
^
313. || !put_value(data, val, size))
314. return 0;
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:39:1: <LHS trace>
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: Parameter `pkt->buf->length`
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: <RHS trace>
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: Parameter `len`
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:48:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 6]):unsigned64 by call to `WPACKET_put_bytes__`
46. return 0;
47.
48. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) {
^
49. size_t newlen;
50. size_t reflen;
|
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/ssl/packet.c/#L48
|
d2a_code_trace_data_44603
|
static int mpegps_probe(AVProbeData *p)
{
uint32_t code= -1;
int sys=0, pspack=0, priv1=0, vid=0, audio=0, invalid=0;
int i;
int score=0;
for(i=0; i<p->buf_size; i++){
code = (code<<8) + p->buf[i];
if ((code & 0xffffff00) == 0x100) {
int pes= check_pes(p->buf+i, p->buf+p->buf_size);
if(code == SYSTEM_HEADER_START_CODE) sys++;
else if(code == PRIVATE_STREAM_1) priv1++;
else if(code == PACK_START_CODE) pspack++;
else if((code & 0xf0) == VIDEO_ID && pes) vid++;
else if((code & 0xe0) == AUDIO_ID && pes) audio++;
else if((code & 0xf0) == VIDEO_ID && !pes) invalid++;
else if((code & 0xe0) == AUDIO_ID && !pes) invalid++;
}
}
if(vid+audio > invalid)
score= AVPROBE_SCORE_MAX/4;
if(sys>invalid && sys*9 <= pspack*10)
return AVPROBE_SCORE_MAX/2+2;
if(priv1 + vid + audio > invalid && (priv1+vid+audio)*9 <= pspack*10)
return AVPROBE_SCORE_MAX/2+2;
if((!!vid ^ !!audio) && (audio+vid > 1) && !sys && !pspack && p->buf_size>2048)
return AVPROBE_SCORE_MAX/2+2;
return score;
}
libavformat/mpeg.c:63: error: Integer Overflow L1
([1099511627520, +oo] + `*p->buf`):unsigned32.
libavformat/mpeg.c:57:5: <LHS trace>
55. static int mpegps_probe(AVProbeData *p)
56. {
57. uint32_t code= -1;
^
58. int sys=0, pspack=0, priv1=0, vid=0, audio=0, invalid=0;
59. int i;
libavformat/mpeg.c:57:5: Assignment
55. static int mpegps_probe(AVProbeData *p)
56. {
57. uint32_t code= -1;
^
58. int sys=0, pspack=0, priv1=0, vid=0, audio=0, invalid=0;
59. int i;
libavformat/mpeg.c:55:1: <RHS trace>
53. }
54.
55. static int mpegps_probe(AVProbeData *p)
^
56. {
57. uint32_t code= -1;
libavformat/mpeg.c:55:1: Parameter `*p->buf`
53. }
54.
55. static int mpegps_probe(AVProbeData *p)
^
56. {
57. uint32_t code= -1;
libavformat/mpeg.c:63:9: Binary operation: ([1099511627520, +oo] + *p->buf):unsigned32
61.
62. for(i=0; i<p->buf_size; i++){
63. code = (code<<8) + p->buf[i];
^
64. if ((code & 0xffffff00) == 0x100) {
65. int pes= check_pes(p->buf+i, p->buf+p->buf_size);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/mpeg.c/#L63
|
d2a_code_trace_data_44604
|
static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al)
{
#ifndef OPENSSL_NO_RSA
unsigned char *encdata = NULL;
EVP_PKEY *pkey = NULL;
EVP_PKEY_CTX *pctx = NULL;
size_t enclen;
unsigned char *pms = NULL;
size_t pmslen = 0;
if (s->session->peer == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
return 0;
}
pkey = X509_get0_pubkey(s->session->peer);
if (EVP_PKEY_get0_RSA(pkey) == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
return 0;
}
pmslen = SSL_MAX_MASTER_KEY_LENGTH;
pms = OPENSSL_malloc(pmslen);
if (pms == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE);
*al = SSL_AD_INTERNAL_ERROR;
return 0;
}
pms[0] = s->client_version >> 8;
pms[1] = s->client_version & 0xff;
if (RAND_bytes(pms + 2, (int)(pmslen - 2)) <= 0) {
goto err;
}
if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
goto err;
}
pctx = EVP_PKEY_CTX_new(pkey, NULL);
if (pctx == NULL || EVP_PKEY_encrypt_init(pctx) <= 0
|| EVP_PKEY_encrypt(pctx, NULL, &enclen, pms, pmslen) <= 0) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_EVP_LIB);
goto err;
}
if (!WPACKET_allocate_bytes(pkt, enclen, &encdata)
|| EVP_PKEY_encrypt(pctx, encdata, &enclen, pms, pmslen) <= 0) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT);
goto err;
}
EVP_PKEY_CTX_free(pctx);
pctx = NULL;
if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
goto err;
}
if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen))
goto err;
s->s3->tmp.pms = pms;
s->s3->tmp.pmslen = pmslen;
return 1;
err:
OPENSSL_clear_free(pms, pmslen);
EVP_PKEY_CTX_free(pctx);
return 0;
#else
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
*al = SSL_AD_INTERNAL_ERROR;
return 0;
#endif
}
ssl/statem/statem_clnt.c:2794: error: NULL_DEREFERENCE
pointer `pkey` last assigned on line 2793 could be null and is dereferenced by call to `EVP_PKEY_get0_RSA()` at line 2794, column 9.
Showing all 30 steps of the trace
ssl/statem/statem_clnt.c:2775:1: start of procedure tls_construct_cke_rsa()
2773. }
2774.
2775. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al)
2776. {
2777. #ifndef OPENSSL_NO_RSA
ssl/statem/statem_clnt.c:2778:5:
2776. {
2777. #ifndef OPENSSL_NO_RSA
2778. > unsigned char *encdata = NULL;
2779. EVP_PKEY *pkey = NULL;
2780. EVP_PKEY_CTX *pctx = NULL;
ssl/statem/statem_clnt.c:2779:5:
2777. #ifndef OPENSSL_NO_RSA
2778. unsigned char *encdata = NULL;
2779. > EVP_PKEY *pkey = NULL;
2780. EVP_PKEY_CTX *pctx = NULL;
2781. size_t enclen;
ssl/statem/statem_clnt.c:2780:5:
2778. unsigned char *encdata = NULL;
2779. EVP_PKEY *pkey = NULL;
2780. > EVP_PKEY_CTX *pctx = NULL;
2781. size_t enclen;
2782. unsigned char *pms = NULL;
ssl/statem/statem_clnt.c:2782:5:
2780. EVP_PKEY_CTX *pctx = NULL;
2781. size_t enclen;
2782. > unsigned char *pms = NULL;
2783. size_t pmslen = 0;
2784.
ssl/statem/statem_clnt.c:2783:5:
2781. size_t enclen;
2782. unsigned char *pms = NULL;
2783. > size_t pmslen = 0;
2784.
2785. if (s->session->peer == NULL) {
ssl/statem/statem_clnt.c:2785:9: Taking false branch
2783. size_t pmslen = 0;
2784.
2785. if (s->session->peer == NULL) {
^
2786. /*
2787. * We should always have a server certificate with SSL_kRSA.
ssl/statem/statem_clnt.c:2793:5:
2791. }
2792.
2793. > pkey = X509_get0_pubkey(s->session->peer);
2794. if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2795. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
crypto/x509/x509_cmp.c:265:1: start of procedure X509_get0_pubkey()
263. }
264.
265. > EVP_PKEY *X509_get0_pubkey(const X509 *x)
266. {
267. if (x == NULL)
crypto/x509/x509_cmp.c:267:9: Taking false branch
265. EVP_PKEY *X509_get0_pubkey(const X509 *x)
266. {
267. if (x == NULL)
^
268. return NULL;
269. return X509_PUBKEY_get0(x->cert_info.key);
crypto/x509/x509_cmp.c:269:5:
267. if (x == NULL)
268. return NULL;
269. > return X509_PUBKEY_get0(x->cert_info.key);
270. }
271.
crypto/x509/x_pubkey.c:140:1: start of procedure X509_PUBKEY_get0()
138. }
139.
140. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
141. {
142. EVP_PKEY *ret = NULL;
crypto/x509/x_pubkey.c:142:5:
140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
141. {
142. > EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
crypto/x509/x_pubkey.c:144:9: Taking false branch
142. EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
^
145. return NULL;
146.
crypto/x509/x_pubkey.c:144:24: Taking false branch
142. EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
^
145. return NULL;
146.
crypto/x509/x_pubkey.c:147:9: Taking false branch
145. return NULL;
146.
147. if (key->pkey != NULL)
^
148. return key->pkey;
149.
crypto/x509/x_pubkey.c:158:5:
156. * in the queue.
157. */
158. > x509_pubkey_decode(&ret, key);
159. /* If decode doesn't fail something bad happened */
160. if (ret != NULL) {
crypto/x509/x_pubkey.c:103:1: start of procedure x509_pubkey_decode()
101.
102.
103. > static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key)
104. {
105. EVP_PKEY *pkey = EVP_PKEY_new();
crypto/x509/x_pubkey.c:105:5: Skipping EVP_PKEY_new(): empty list of specs
103. static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key)
104. {
105. EVP_PKEY *pkey = EVP_PKEY_new();
^
106.
107. if (pkey == NULL) {
crypto/x509/x_pubkey.c:107:9: Taking true branch
105. EVP_PKEY *pkey = EVP_PKEY_new();
106.
107. if (pkey == NULL) {
^
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
109. return -1;
crypto/x509/x_pubkey.c:108:9: Skipping ERR_put_error(): empty list of specs
106.
107. if (pkey == NULL) {
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
^
109. return -1;
110. }
crypto/x509/x_pubkey.c:109:9:
107. if (pkey == NULL) {
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
109. > return -1;
110. }
111.
crypto/x509/x_pubkey.c:138:1: return from a call to x509_pubkey_decode
136. EVP_PKEY_free(pkey);
137. return 0;
138. > }
139.
140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
crypto/x509/x_pubkey.c:160:9: Taking false branch
158. x509_pubkey_decode(&ret, key);
159. /* If decode doesn't fail something bad happened */
160. if (ret != NULL) {
^
161. X509err(X509_F_X509_PUBKEY_GET0, ERR_R_INTERNAL_ERROR);
162. EVP_PKEY_free(ret);
crypto/x509/x_pubkey.c:165:5:
163. }
164.
165. > return NULL;
166. }
167.
crypto/x509/x_pubkey.c:166:1: return from a call to X509_PUBKEY_get0
164.
165. return NULL;
166. > }
167.
168. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
crypto/x509/x509_cmp.c:270:1: return from a call to X509_get0_pubkey
268. return NULL;
269. return X509_PUBKEY_get0(x->cert_info.key);
270. > }
271.
272. EVP_PKEY *X509_get_pubkey(X509 *x)
ssl/statem/statem_clnt.c:2794:9:
2792.
2793. pkey = X509_get0_pubkey(s->session->peer);
2794. > if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2795. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
2796. return 0;
crypto/evp/p_lib.c:290:1: start of procedure EVP_PKEY_get0_RSA()
288. }
289.
290. > RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
291. {
292. if (pkey->type != EVP_PKEY_RSA) {
crypto/evp/p_lib.c:292:9:
290. RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
291. {
292. > if (pkey->type != EVP_PKEY_RSA) {
293. EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY);
294. return NULL;
|
https://github.com/openssl/openssl/blob/8ed9a26616a7101ea698c189fbbb663186676075/ssl/statem/statem_clnt.c/#L2794
|
d2a_code_trace_data_44605
|
static int epzs_motion_search4(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int P[10][2],
int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d, dmin;
int map_generation;
const int penalty_factor= c->penalty_factor;
const int size=1;
const int h=8;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
int flags= c->flags;
LOAD_COMMON2
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
map_generation= update_map_generation(c);
dmin = 1000000;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
}else{
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}
if(dmin>64*4){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1166: error: Uninitialized Value
The value read from ymax was never initialized.
libavcodec/motion_est_template.c:1166:9:
1164. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
1165. //FIXME try some early stop
1166. CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
^
1167. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1166
|
d2a_code_trace_data_44606
|
int BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
{
char *ret;
size_t n;
if (str->length >= len)
{
memset(&str->data[len],0,str->length-len);
str->length=len;
return(len);
}
if (str->max >= len)
{
memset(&str->data[str->length],0,len-str->length);
str->length=len;
return(len);
}
if (len > LIMIT_BEFORE_EXPANSION)
{
BUFerr(BUF_F_BUF_MEM_GROW_CLEAN,ERR_R_MALLOC_FAILURE);
return 0;
}
n=(len+3)/3*4;
if (str->data == NULL)
ret=OPENSSL_malloc(n);
else
ret=OPENSSL_realloc_clean(str->data,str->max,n);
if (ret == NULL)
{
BUFerr(BUF_F_BUF_MEM_GROW_CLEAN,ERR_R_MALLOC_FAILURE);
len=0;
}
else
{
str->data=ret;
str->max=n;
memset(&str->data[str->length],0,len-str->length);
str->length=len;
}
return(len);
}
ssl/d1_clnt.c:463: error: INTEGER_OVERFLOW_L2
([0, +oo] - 10):unsigned64 by call to `dtls1_send_client_certificate`.
Showing all 13 steps of the trace
ssl/d1_clnt.c:147:1: Parameter `s->init_buf->length`
145. dtls1_get_client_method)
146.
147. > int dtls1_connect(SSL *s)
148. {
149. BUF_MEM *buf=NULL;
ssl/d1_clnt.c:463:8: Call
461. case SSL3_ST_CW_CERT_D:
462. dtls1_start_timer(s);
463. ret=dtls1_send_client_certificate(s);
^
464. if (ret <= 0) goto end;
465. s->state=SSL3_ST_CW_KEY_EXCH_A;
ssl/d1_clnt.c:1629:1: Parameter `s->init_buf->length`
1627. }
1628.
1629. > int dtls1_send_client_certificate(SSL *s)
1630. {
1631. X509 *x509=NULL;
ssl/d1_clnt.c:1696:5: Call
1694. {
1695. s->state=SSL3_ST_CW_CERT_D;
1696. l=dtls1_output_cert_chain(s,
^
1697. (s->s3->tmp.cert_req == 2)?NULL:s->cert->key);
1698. s->init_num=(int)l;
ssl/d1_both.c:996:1: Parameter `s->init_buf->length`
994. }
995.
996. > unsigned long dtls1_output_cert_chain(SSL *s, CERT_PKEY *cpk)
997. {
998. unsigned char *p;
ssl/d1_both.c:1002:7: Call
1000. BUF_MEM *buf=s->init_buf;
1001.
1002. if (!ssl_add_cert_chain(s, cpk, &l))
^
1003. return 0;
1004.
ssl/ssl_cert.c:1053:1: Parameter `s->init_buf->length`
1051.
1052. /* Add certificate chain to internal SSL BUF_MEM strcuture */
1053. > int ssl_add_cert_chain(SSL *s, CERT_PKEY *cpk, unsigned long *l)
1054. {
1055. BUF_MEM *buf = s->init_buf;
ssl/ssl_cert.c:1087:7: Call
1085.
1086. /* TLSv1 sends a chain with nothing in it, instead of an alert */
1087. if (!BUF_MEM_grow_clean(buf,10))
^
1088. {
1089. SSLerr(SSL_F_SSL_ADD_CERT_CHAIN,ERR_R_BUF_LIB);
crypto/buffer/buffer.c:139:1: <LHS trace>
137. }
138.
139. > int BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
140. {
141. char *ret;
crypto/buffer/buffer.c:139:1: Parameter `len`
137. }
138.
139. > int BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
140. {
141. char *ret;
crypto/buffer/buffer.c:139:1: <RHS trace>
137. }
138.
139. > int BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
140. {
141. char *ret;
crypto/buffer/buffer.c:139:1: Parameter `len`
137. }
138.
139. > int BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
140. {
141. char *ret;
crypto/buffer/buffer.c:146:3: Binary operation: ([0, +oo] - 10):unsigned64 by call to `dtls1_send_client_certificate`
144. if (str->length >= len)
145. {
146. memset(&str->data[len],0,str->length-len);
^
147. str->length=len;
148. return(len);
|
https://github.com/openssl/openssl/blob/80ccc66d7eedb2d06050130c77c482ae1584199a/crypto/buffer/buffer.c/#L146
|
d2a_code_trace_data_44607
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/bn/bn_mod.c:207: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, +oo] by call to `BN_sqr`.
Showing all 19 steps of the trace
crypto/bn/bn_mod.c:204:14: Call
202.
203. BN_CTX_start(ctx);
204. if ((t = BN_CTX_get(ctx)) == NULL)
^
205. goto err;
206. if (a == b) {
crypto/bn/bn_ctx.c:219:5: Call
217. }
218. /* OK, make sure the returned bignum is "zero" */
219. BN_zero(ret);
^
220. /* clear BN_FLG_CONSTTIME if leaked from previous frames */
221. ret->flags &= (~BN_FLG_CONSTTIME);
crypto/bn/bn_lib.c:359:1: Parameter `*a->d`
357. }
358.
359. > int BN_set_word(BIGNUM *a, BN_ULONG w)
360. {
361. bn_check_top(a);
crypto/bn/bn_lib.c:362:9: Call
360. {
361. bn_check_top(a);
362. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
363. return 0;
364. a->neg = 0;
crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
659.
660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
661. {
662. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/bn/bn_mod.c:207:14: Call
205. goto err;
206. if (a == b) {
207. if (!BN_sqr(t, a, ctx))
^
208. goto err;
209. } else {
crypto/bn/bn_sqr.c:17:1: Parameter `*r->d`
15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
16. */
17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int ret = bn_sqr_fixed_top(r, a, ctx);
crypto/bn/bn_sqr.c:19:15: Call
17. int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int ret = bn_sqr_fixed_top(r, a, ctx);
^
20.
21. bn_correct_top(r);
crypto/bn/bn_sqr.c:27:1: Parameter `*r->d`
25. }
26.
27. > int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
28. {
29. int max, al;
crypto/bn/bn_sqr.c:49:9: Call
47.
48. max = 2 * al; /* Non-zero (from above) */
49. if (bn_wexpand(rr, max) == NULL)
^
50. goto err;
51.
crypto/bn/bn_lib.c:960:1: Parameter `*a->d`
958. }
959.
960. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
961. {
962. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:962:37: Call
960. BIGNUM *bn_wexpand(BIGNUM *a, int words)
961. {
962. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
963. }
964.
crypto/bn/bn_lib.c:245:1: Parameter `*b->d`
243. */
244.
245. > BIGNUM *bn_expand2(BIGNUM *b, int words)
246. {
247. if (words > b->dmax) {
crypto/bn/bn_lib.c:248:23: Call
246. {
247. if (words > b->dmax) {
248. BN_ULONG *a = bn_expand_internal(b, words);
^
249. if (!a)
250. return NULL;
crypto/bn/bn_lib.c:209:1: <Offset trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `b->top`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: <Length trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `*b->d`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, +oo] by call to `BN_sqr`
230. assert(b->top <= words);
231. if (b->top > 0)
232. memcpy(a, b->d, sizeof(*a) * b->top);
^
233.
234. return a;
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_44608
|
static ngx_int_t
ngx_http_upstream_get_hash_peer(ngx_peer_connection_t *pc, void *data)
{
ngx_http_upstream_hash_peer_data_t *hp = data;
time_t now;
u_char buf[NGX_INT_T_LEN];
size_t size;
uint32_t hash;
ngx_int_t w;
uintptr_t m;
ngx_uint_t i, n, p;
ngx_http_upstream_rr_peer_t *peer;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
"get hash peer, try: %ui", pc->tries);
if (hp->tries > 20 || hp->rrp.peers->single) {
return hp->get_rr_peer(pc, &hp->rrp);
}
now = ngx_time();
pc->cached = 0;
pc->connection = NULL;
for ( ;; ) {
ngx_crc32_init(hash);
if (hp->rehash > 0) {
size = ngx_sprintf(buf, "%ui", hp->rehash) - buf;
ngx_crc32_update(&hash, buf, size);
}
ngx_crc32_update(&hash, hp->key.data, hp->key.len);
ngx_crc32_final(hash);
hash = (hash >> 16) & 0x7fff;
hp->hash += hash;
hp->rehash++;
if (!hp->rrp.peers->weighted) {
p = hp->hash % hp->rrp.peers->number;
} else {
w = hp->hash % hp->rrp.peers->total_weight;
for (i = 0; i < hp->rrp.peers->number; i++) {
w -= hp->rrp.peers->peer[i].weight;
if (w < 0) {
break;
}
}
p = i;
}
n = p / (8 * sizeof(uintptr_t));
m = (uintptr_t) 1 << p % (8 * sizeof(uintptr_t));
if (hp->rrp.tried[n] & m) {
goto next;
}
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
"get hash peer, value:%uD, peer:%ui", hp->hash, p);
peer = &hp->rrp.peers->peer[p];
if (peer->down) {
goto next;
}
if (peer->max_fails
&& peer->fails >= peer->max_fails
&& now - peer->checked <= peer->fail_timeout)
{
goto next;
}
break;
next:
if (++hp->tries > 20) {
return hp->get_rr_peer(pc, &hp->rrp);
}
}
hp->rrp.current = p;
pc->sockaddr = peer->sockaddr;
pc->socklen = peer->socklen;
pc->name = &peer->name;
if (now - peer->checked > peer->fail_timeout) {
peer->checked = now;
}
hp->rrp.tried[n] |= m;
return NGX_OK;
}
src/http/modules/ngx_http_upstream_hash_module.c:259: error: Uninitialized Value
The value read from p was never initialized.
src/http/modules/ngx_http_upstream_hash_module.c:259:5:
257. }
258.
259. hp->rrp.current = p;
^
260.
261. pc->sockaddr = peer->sockaddr;
|
https://github.com/nginx/nginx/blob/9b5a17b5e23e8e7c94d84eb85044370e38887849/src/http/modules/ngx_http_upstream_hash_module.c/#L259
|
d2a_code_trace_data_44609
|
PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)
{
STACK_OF(PKCS7_RECIP_INFO) *rsk;
PKCS7_RECIP_INFO *ri;
int i;
i = OBJ_obj2nid(p7->type);
if (i != NID_pkcs7_signedAndEnveloped)
return NULL;
if (p7->d.signed_and_enveloped == NULL)
return NULL;
rsk = p7->d.signed_and_enveloped->recipientinfo;
if (rsk == NULL)
return NULL;
if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)
return (NULL);
ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);
return (ri->issuer_and_serial);
}
crypto/pkcs7/pk7_doit.c:1109: error: NULL_DEREFERENCE
pointer `ri` last assigned on line 1108 could be null and is dereferenced at line 1109, column 12.
Showing all 41 steps of the trace
crypto/pkcs7/pk7_doit.c:1092:1: start of procedure PKCS7_get_issuer_and_serial()
1090. }
1091.
1092. > PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx)
1093. {
1094. STACK_OF(PKCS7_RECIP_INFO) *rsk;
crypto/pkcs7/pk7_doit.c:1098:5:
1096. int i;
1097.
1098. > i = OBJ_obj2nid(p7->type);
1099. if (i != NID_pkcs7_signedAndEnveloped)
1100. return NULL;
crypto/objects/obj_dat.c:390:1: start of procedure OBJ_obj2nid()
388. IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, obj);
389.
390. > int OBJ_obj2nid(const ASN1_OBJECT *a)
391. {
392. const unsigned int *op;
crypto/objects/obj_dat.c:395:9: Taking false branch
393. ADDED_OBJ ad, *adp;
394.
395. if (a == NULL)
^
396. return (NID_undef);
397. if (a->nid != 0)
crypto/objects/obj_dat.c:397:9: Taking false branch
395. if (a == NULL)
396. return (NID_undef);
397. if (a->nid != 0)
^
398. return (a->nid);
399.
crypto/objects/obj_dat.c:400:9: Taking false branch
398. return (a->nid);
399.
400. if (a->length == 0)
^
401. return NID_undef;
402.
crypto/objects/obj_dat.c:403:9: Taking true branch
401. return NID_undef;
402.
403. if (added != NULL) {
^
404. ad.type = ADDED_DATA;
405. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
crypto/objects/obj_dat.c:404:9:
402.
403. if (added != NULL) {
404. > ad.type = ADDED_DATA;
405. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
406. adp = lh_ADDED_OBJ_retrieve(added, &ad);
crypto/objects/obj_dat.c:405:9:
403. if (added != NULL) {
404. ad.type = ADDED_DATA;
405. > ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
406. adp = lh_ADDED_OBJ_retrieve(added, &ad);
407. if (adp != NULL)
crypto/objects/obj_dat.c:406:15: Condition is true
404. ad.type = ADDED_DATA;
405. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
406. adp = lh_ADDED_OBJ_retrieve(added, &ad);
^
407. if (adp != NULL)
408. return (adp->obj->nid);
crypto/objects/obj_dat.c:406:15: Condition is true
404. ad.type = ADDED_DATA;
405. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
406. adp = lh_ADDED_OBJ_retrieve(added, &ad);
^
407. if (adp != NULL)
408. return (adp->obj->nid);
crypto/objects/obj_dat.c:406:9:
404. ad.type = ADDED_DATA;
405. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
406. > adp = lh_ADDED_OBJ_retrieve(added, &ad);
407. if (adp != NULL)
408. return (adp->obj->nid);
crypto/lhash/lhash.c:217:1: start of procedure lh_retrieve()
215. }
216.
217. > void *lh_retrieve(_LHASH *lh, const void *data)
218. {
219. unsigned long hash;
crypto/lhash/lhash.c:223:5:
221. void *ret;
222.
223. > lh->error = 0;
224. rn = getrn(lh, data, &hash);
225.
crypto/lhash/lhash.c:224:5: Skipping getrn(): empty list of specs
222.
223. lh->error = 0;
224. rn = getrn(lh, data, &hash);
^
225.
226. if (*rn == NULL) {
crypto/lhash/lhash.c:226:9: Taking false branch
224. rn = getrn(lh, data, &hash);
225.
226. if (*rn == NULL) {
^
227. lh->num_retrieve_miss++;
228. return (NULL);
crypto/lhash/lhash.c:230:9:
228. return (NULL);
229. } else {
230. > ret = (*rn)->data;
231. lh->num_retrieve++;
232. }
crypto/lhash/lhash.c:231:9:
229. } else {
230. ret = (*rn)->data;
231. > lh->num_retrieve++;
232. }
233. return (ret);
crypto/lhash/lhash.c:233:5:
231. lh->num_retrieve++;
232. }
233. > return (ret);
234. }
235.
crypto/lhash/lhash.c:234:1: return from a call to lh_retrieve
232. }
233. return (ret);
234. > }
235.
236. static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
crypto/objects/obj_dat.c:407:13: Taking true branch
405. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */
406. adp = lh_ADDED_OBJ_retrieve(added, &ad);
407. if (adp != NULL)
^
408. return (adp->obj->nid);
409. }
crypto/objects/obj_dat.c:408:13:
406. adp = lh_ADDED_OBJ_retrieve(added, &ad);
407. if (adp != NULL)
408. > return (adp->obj->nid);
409. }
410. op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ);
crypto/objects/obj_dat.c:414:1: return from a call to OBJ_obj2nid
412. return (NID_undef);
413. return (nid_objs[*op].nid);
414. > }
415.
416. /*
crypto/pkcs7/pk7_doit.c:1099:9: Taking false branch
1097.
1098. i = OBJ_obj2nid(p7->type);
1099. if (i != NID_pkcs7_signedAndEnveloped)
^
1100. return NULL;
1101. if (p7->d.signed_and_enveloped == NULL)
crypto/pkcs7/pk7_doit.c:1101:9: Taking false branch
1099. if (i != NID_pkcs7_signedAndEnveloped)
1100. return NULL;
1101. if (p7->d.signed_and_enveloped == NULL)
^
1102. return NULL;
1103. rsk = p7->d.signed_and_enveloped->recipientinfo;
crypto/pkcs7/pk7_doit.c:1103:5:
1101. if (p7->d.signed_and_enveloped == NULL)
1102. return NULL;
1103. > rsk = p7->d.signed_and_enveloped->recipientinfo;
1104. if (rsk == NULL)
1105. return NULL;
crypto/pkcs7/pk7_doit.c:1104:9: Taking false branch
1102. return NULL;
1103. rsk = p7->d.signed_and_enveloped->recipientinfo;
1104. if (rsk == NULL)
^
1105. return NULL;
1106. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)
crypto/pkcs7/pk7_doit.c:1106:9: Condition is true
1104. if (rsk == NULL)
1105. return NULL;
1106. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)
^
1107. return (NULL);
1108. ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);
crypto/stack/stack.c:317:1: start of procedure sk_num()
315. }
316.
317. > int sk_num(const _STACK *st)
318. {
319. if (st == NULL)
crypto/stack/stack.c:319:9: Taking false branch
317. int sk_num(const _STACK *st)
318. {
319. if (st == NULL)
^
320. return -1;
321. return st->num;
crypto/stack/stack.c:321:5:
319. if (st == NULL)
320. return -1;
321. > return st->num;
322. }
323.
crypto/stack/stack.c:322:1: return from a call to sk_num
320. return -1;
321. return st->num;
322. > }
323.
324. void *sk_value(const _STACK *st, int i)
crypto/pkcs7/pk7_doit.c:1106:9: Taking false branch
1104. if (rsk == NULL)
1105. return NULL;
1106. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)
^
1107. return (NULL);
1108. ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);
crypto/pkcs7/pk7_doit.c:1108:10: Condition is true
1106. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)
1107. return (NULL);
1108. ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);
^
1109. return (ri->issuer_and_serial);
1110. }
crypto/pkcs7/pk7_doit.c:1108:5:
1106. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx)
1107. return (NULL);
1108. > ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);
1109. return (ri->issuer_and_serial);
1110. }
crypto/stack/stack.c:324:1: start of procedure sk_value()
322. }
323.
324. > void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
crypto/stack/stack.c:326:10: Taking false branch
324. void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
^
327. return NULL;
328. return st->data[i];
crypto/stack/stack.c:326:17: Taking true branch
324. void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
^
327. return NULL;
328. return st->data[i];
crypto/stack/stack.c:327:9:
325. {
326. if (!st || (i < 0) || (i >= st->num))
327. > return NULL;
328. return st->data[i];
329. }
crypto/stack/stack.c:329:1: return from a call to sk_value
327. return NULL;
328. return st->data[i];
329. > }
330.
331. void *sk_set(_STACK *st, int i, void *value)
crypto/pkcs7/pk7_doit.c:1109:5:
1107. return (NULL);
1108. ri = sk_PKCS7_RECIP_INFO_value(rsk, idx);
1109. > return (ri->issuer_and_serial);
1110. }
1111.
|
https://github.com/openssl/openssl/blob/57ce7b617c602ae8513c22daa2bda31f179edb0f/crypto/pkcs7/pk7_doit.c/#L1109
|
d2a_code_trace_data_44610
|
int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x,
const BIGNUM *p, BN_CTX *ctx)
{
BIGNUM *xinv = NULL;
int ret = 0;
bn_check_top(y);
bn_check_top(x);
bn_check_top(p);
BN_CTX_start(ctx);
xinv = BN_CTX_get(ctx);
if (xinv == NULL)
goto err;
if (!BN_GF2m_mod_inv(xinv, x, p, ctx))
goto err;
if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx))
goto err;
bn_check_top(r);
ret = 1;
err:
BN_CTX_end(ctx);
return ret;
}
crypto/bn/bn_gf2m.c:846: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_CTX_start()` at line 841, column 5 is not reachable after line 846, column 10.
Showing all 57 steps of the trace
crypto/bn/bn_gf2m.c:831:1: start of procedure BN_GF2m_mod_div()
829. * or y, x could equal y.
830. */
831. > int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x,
832. const BIGNUM *p, BN_CTX *ctx)
833. {
crypto/bn/bn_gf2m.c:834:5:
832. const BIGNUM *p, BN_CTX *ctx)
833. {
834. > BIGNUM *xinv = NULL;
835. int ret = 0;
836.
crypto/bn/bn_gf2m.c:835:5:
833. {
834. BIGNUM *xinv = NULL;
835. > int ret = 0;
836.
837. bn_check_top(y);
crypto/bn/bn_gf2m.c:841:5:
839. bn_check_top(p);
840.
841. > BN_CTX_start(ctx);
842. xinv = BN_CTX_get(ctx);
843. if (xinv == NULL)
crypto/bn/bn_ctx.c:236:1: start of procedure BN_CTX_start()
234. }
235.
236. > void BN_CTX_start(BN_CTX *ctx)
237. {
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_ctx.c:240:9: Taking false branch
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
239. /* If we're already overflowing ... */
240. if (ctx->err_stack || ctx->too_many)
^
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
crypto/bn/bn_ctx.c:240:27: Taking false branch
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
239. /* If we're already overflowing ... */
240. if (ctx->err_stack || ctx->too_many)
^
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
crypto/bn/bn_ctx.c:243:15:
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
243. > else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
244. BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
245. ctx->err_stack++;
crypto/bn/bn_ctx.c:307:1: start of procedure BN_STACK_push()
305.
306.
307. > static int BN_STACK_push(BN_STACK *st, unsigned int idx)
308. {
309. if (st->depth == st->size) {
crypto/bn/bn_ctx.c:309:9: Taking true branch
307. static int BN_STACK_push(BN_STACK *st, unsigned int idx)
308. {
309. if (st->depth == st->size) {
^
310. /* Need to expand */
311. unsigned int newsize =
crypto/bn/bn_ctx.c:312:13: Condition is true
310. /* Need to expand */
311. unsigned int newsize =
312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
^
313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize);
314. if (newitems == NULL)
crypto/bn/bn_ctx.c:311:9:
309. if (st->depth == st->size) {
310. /* Need to expand */
311. > unsigned int newsize =
312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize);
crypto/bn/bn_ctx.c:313:9:
311. unsigned int newsize =
312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
313. > unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize);
314. if (newitems == NULL)
315. return 0;
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/bn/bn_ctx.c:314:13: Taking false branch
312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize);
314. if (newitems == NULL)
^
315. return 0;
316. if (st->depth)
crypto/bn/bn_ctx.c:316:13: Taking true branch
314. if (newitems == NULL)
315. return 0;
316. if (st->depth)
^
317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
318. OPENSSL_free(st->indexes);
crypto/bn/bn_ctx.c:317:13:
315. return 0;
316. if (st->depth)
317. > memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
318. OPENSSL_free(st->indexes);
319. st->indexes = newitems;
crypto/bn/bn_ctx.c:318:9:
316. if (st->depth)
317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
318. > OPENSSL_free(st->indexes);
319. st->indexes = newitems;
320. st->size = newsize;
crypto/mem.c:234:1: start of procedure CRYPTO_free()
232. }
233.
234. > void CRYPTO_free(void *str)
235. {
236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:245:5:
243. }
244. #else
245. > free(str);
246. #endif
247. }
crypto/mem.c:247:1: return from a call to CRYPTO_free
245. free(str);
246. #endif
247. > }
248.
249. void CRYPTO_clear_free(void *str, size_t num)
crypto/bn/bn_ctx.c:319:9:
317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
318. OPENSSL_free(st->indexes);
319. > st->indexes = newitems;
320. st->size = newsize;
321. }
crypto/bn/bn_ctx.c:320:9:
318. OPENSSL_free(st->indexes);
319. st->indexes = newitems;
320. > st->size = newsize;
321. }
322. st->indexes[(st->depth)++] = idx;
crypto/bn/bn_ctx.c:322:5:
320. st->size = newsize;
321. }
322. > st->indexes[(st->depth)++] = idx;
323. return 1;
324. }
crypto/bn/bn_ctx.c:323:5:
321. }
322. st->indexes[(st->depth)++] = idx;
323. > return 1;
324. }
325.
crypto/bn/bn_ctx.c:324:1: return from a call to BN_STACK_push
322. st->indexes[(st->depth)++] = idx;
323. return 1;
324. > }
325.
326. static unsigned int BN_STACK_pop(BN_STACK *st)
crypto/bn/bn_ctx.c:243:15: Taking false branch
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
243. else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
^
244. BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
245. ctx->err_stack++;
crypto/bn/bn_ctx.c:240:5:
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
239. /* If we're already overflowing ... */
240. > if (ctx->err_stack || ctx->too_many)
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
crypto/bn/bn_ctx.c:248:1: return from a call to BN_CTX_start
246. }
247. CTXDBG_EXIT(ctx);
248. > }
249.
250. void BN_CTX_end(BN_CTX *ctx)
crypto/bn/bn_gf2m.c:842:5:
840.
841. BN_CTX_start(ctx);
842. > xinv = BN_CTX_get(ctx);
843. if (xinv == NULL)
844. goto err;
crypto/bn/bn_ctx.c:267:1: start of procedure BN_CTX_get()
265. }
266.
267. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
268. {
269. BIGNUM *ret;
crypto/bn/bn_ctx.c:272:9: Taking false branch
270.
271. CTXDBG_ENTRY("BN_CTX_get", ctx);
272. if (ctx->err_stack || ctx->too_many)
^
273. return NULL;
274. if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {
crypto/bn/bn_ctx.c:272:27: Taking false branch
270.
271. CTXDBG_ENTRY("BN_CTX_get", ctx);
272. if (ctx->err_stack || ctx->too_many)
^
273. return NULL;
274. if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {
crypto/bn/bn_ctx.c:274:9: Taking false branch
272. if (ctx->err_stack || ctx->too_many)
273. return NULL;
274. if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {
^
275. /*
276. * Setting too_many prevents repeated "get" attempts from cluttering
crypto/bn/bn_ctx.c:284:5:
282. }
283. /* OK, make sure the returned bignum is "zero" */
284. > BN_zero(ret);
285. ctx->used++;
286. CTXDBG_RET(ctx, ret);
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is false
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
crypto/bn/bn_ctx.c:285:5:
283. /* OK, make sure the returned bignum is "zero" */
284. BN_zero(ret);
285. > ctx->used++;
286. CTXDBG_RET(ctx, ret);
287. return ret;
crypto/bn/bn_ctx.c:287:5:
285. ctx->used++;
286. CTXDBG_RET(ctx, ret);
287. > return ret;
288. }
289.
crypto/bn/bn_ctx.c:288:1: return from a call to BN_CTX_get
286. CTXDBG_RET(ctx, ret);
287. return ret;
288. > }
289.
290. /************/
crypto/bn/bn_gf2m.c:843:9: Taking false branch
841. BN_CTX_start(ctx);
842. xinv = BN_CTX_get(ctx);
843. if (xinv == NULL)
^
844. goto err;
845.
crypto/bn/bn_gf2m.c:846:10: Skipping BN_GF2m_mod_inv(): empty list of specs
844. goto err;
845.
846. if (!BN_GF2m_mod_inv(xinv, x, p, ctx))
^
847. goto err;
848. if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx))
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/bn/bn_gf2m.c/#L846
|
d2a_code_trace_data_44611
|
static void seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size)
{
GetBitContext gb;
int flags, i, j, x, y, op;
unsigned char c[3];
unsigned char *dst;
flags = *data++;
if (flags & 1) {
for (i = 0; i < 256; i++) {
for (j = 0; j < 3; j++, data++)
c[j] = (*data << 2) | (*data >> 4);
seq->palette[i] = AV_RB24(c);
}
memcpy(seq->frame.data[1], seq->palette, sizeof(seq->palette));
seq->frame.palette_has_changed = 1;
}
if (flags & 2) {
init_get_bits(&gb, data, 128 * 8); data += 128;
for (y = 0; y < 128; y += 8)
for (x = 0; x < 256; x += 8) {
dst = &seq->frame.data[0][y * seq->frame.linesize[0] + x];
op = get_bits(&gb, 2);
switch (op) {
case 1:
data = seq_decode_op1(seq, data, dst);
break;
case 2:
data = seq_decode_op2(seq, data, dst);
break;
case 3:
data = seq_decode_op3(seq, data, dst);
break;
}
}
}
}
libavcodec/tiertexseqv.c:149: error: Uninitialized Value
The value read from c[_] was never initialized.
libavcodec/tiertexseqv.c:149:13:
147. for (j = 0; j < 3; j++, data++)
148. c[j] = (*data << 2) | (*data >> 4);
149. seq->palette[i] = AV_RB24(c);
^
150. }
151. memcpy(seq->frame.data[1], seq->palette, sizeof(seq->palette));
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/tiertexseqv.c/#L149
|
d2a_code_trace_data_44612
|
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr,
int32_t sb_samples[SBLIMIT])
{
int32_t tmp[32];
register MPA_INT *synth_buf;
register const MPA_INT *w, *w2, *p;
int j, offset, v;
OUT_INT *samples2;
#if FRAC_BITS <= 15
int sum, sum2;
#else
int64_t sum, sum2;
#endif
dct32(tmp, sb_samples);
offset = *synth_buf_offset;
synth_buf = synth_buf_ptr + offset;
for(j=0;j<32;j++) {
v = tmp[j];
#if FRAC_BITS <= 15
v = av_clip_int16(v);
#endif
synth_buf[j] = v;
}
memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT));
samples2 = samples + 31 * incr;
w = window;
w2 = window + 31;
sum = *dither_state;
p = synth_buf + 16;
SUM8(sum, +=, w, p);
p = synth_buf + 48;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
samples += incr;
w++;
for(j=1;j<16;j++) {
sum2 = 0;
p = synth_buf + 16 + j;
SUM8P2(sum, +=, sum2, -=, w, w2, p);
p = synth_buf + 48 - j;
SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
*samples = round_sample(&sum);
samples += incr;
sum += sum2;
*samples2 = round_sample(&sum);
samples2 -= incr;
w++;
w2--;
}
p = synth_buf + 32;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
*dither_state= sum;
offset = (offset - 32) & 511;
*synth_buf_offset = offset;
}
libavcodec/mpc.c:60: error: Buffer Overrun L2
Offset: [208+min(0, `c->synth_buf_offset[*]`), 209+max(511, `c->synth_buf_offset[*]`)] (⇐ [16+min(0, `c->synth_buf_offset[*]`), 17+max(511, `c->synth_buf_offset[*]`)] + 192) Size: 2 by call to `ff_mpa_synth_filter`.
libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]`
49. * Process decoded Musepack data and produce PCM
50. */
51. static void mpc_synth(MPCContext *c, int16_t *out)
^
52. {
53. int dither_state = 0;
libavcodec/mpc.c:60:13: Call
58. samples_ptr = samples + ch;
59. for(i = 0; i < SAMPLES_PER_BAND; i++) {
60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
^
61. mpa_window, &dither_state,
62. samples_ptr, 2,
libavcodec/mpegaudiodec.c:858:1: <Length trace>
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr`
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:877:5: Assignment
875.
876. offset = *synth_buf_offset;
877. synth_buf = synth_buf_ptr + offset;
^
878.
879. for(j=0;j<32;j++) {
libavcodec/mpegaudiodec.c:896:5: Assignment
894.
895. sum = *dither_state;
896. p = synth_buf + 16;
^
897. SUM8(sum, +=, w, p);
898. p = synth_buf + 48;
libavcodec/mpegaudiodec.c:897:5: Array access: Offset: [208+min(0, c->synth_buf_offset[*]), 209+max(511, c->synth_buf_offset[*])] (⇐ [16+min(0, c->synth_buf_offset[*]), 17+max(511, c->synth_buf_offset[*])] + 192) Size: 2 by call to `ff_mpa_synth_filter`
895. sum = *dither_state;
896. p = synth_buf + 16;
897. SUM8(sum, +=, w, p);
^
898. p = synth_buf + 48;
899. SUM8(sum, -=, w + 32, p);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L897
|
d2a_code_trace_data_44613
|
static ngx_listening_t *
ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
{
ngx_listening_t *ls;
struct sockaddr *sa;
ngx_http_core_loc_conf_t *clcf;
ngx_http_core_srv_conf_t *cscf;
u_char text[NGX_SOCKADDR_STRLEN];
ls = ngx_array_push(&cf->cycle->listening);
if (ls == NULL) {
return NULL;
}
ngx_memzero(ls, sizeof(ngx_listening_t));
sa = ngx_palloc(cf->pool, addr->socklen);
if (sa == NULL) {
return NULL;
}
ngx_memcpy(sa, addr->sockaddr, addr->socklen);
ls->sockaddr = sa;
ls->socklen = addr->socklen;
ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
if (ls->addr_text.data == NULL) {
return NULL;
}
ngx_memcpy(ls->addr_text.data, text, ls->addr_text.len);
ls->fd = (ngx_socket_t) -1;
ls->type = SOCK_STREAM;
switch (ls->sockaddr->sa_family) {
#if (NGX_HAVE_INET6)
case AF_INET6:
ls->addr_text_max_len = NGX_INET6_ADDRSTRLEN;
break;
#endif
case AF_INET:
ls->addr_text_max_len = NGX_INET_ADDRSTRLEN;
break;
default:
ls->addr_text_max_len = NGX_SOCKADDR_STRLEN;
break;
}
ls->addr_ntop = 1;
ls->handler = ngx_http_init_connection;
cscf = addr->core_srv_conf;
ls->pool_size = cscf->connection_pool_size;
ls->post_accept_timeout = cscf->client_header_timeout;
clcf = cscf->ctx->loc_conf[ngx_http_core_module.ctx_index];
ls->log = *clcf->err_log;
ls->log.data = &ls->addr_text;
ls->log.handler = ngx_accept_log_error;
#if (NGX_WIN32)
{
ngx_iocp_conf_t *iocpcf;
iocpcf = ngx_event_get_conf(cf->cycle->conf_ctx, ngx_iocp_module);
if (iocpcf->acceptex_read) {
ls->post_accept_buffer_size = cscf->client_header_buffer_size;
}
}
#endif
ls->backlog = addr->listen_conf->backlog;
ls->rcvbuf = addr->listen_conf->rcvbuf;
ls->sndbuf = addr->listen_conf->sndbuf;
#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
ls->accept_filter = addr->listen_conf->accept_filter;
#endif
#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
ls->deferred_accept = addr->listen_conf->deferred_accept;
#endif
#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
ls->ipv6only = addr->listen_conf->ipv6only;
#endif
return ls;
}
src/http/ngx_http.c:1720: error: Buffer Overrun L3
Offset added: [0, 51] Size: [0, 51].
src/http/ngx_http.c:1713:25: <Offset trace>
1711. ls->socklen = addr->socklen;
1712.
1713. ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
^
1714.
1715. ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
src/http/ngx_http.c:1713:25: Call
1711. ls->socklen = addr->socklen;
1712.
1713. ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
^
1714.
1715. ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
src/core/ngx_inet.c:112:9: Assignment
110.
111. default:
112. return 0;
^
113. }
114. }
src/http/ngx_http.c:1713:5: Assignment
1711. ls->socklen = addr->socklen;
1712.
1713. ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
^
1714.
1715. ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
src/http/ngx_http.c:1713:25: <Length trace>
1711. ls->socklen = addr->socklen;
1712.
1713. ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
^
1714.
1715. ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
src/http/ngx_http.c:1713:25: Call
1711. ls->socklen = addr->socklen;
1712.
1713. ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
^
1714.
1715. ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
src/core/ngx_inet.c:112:9: Assignment
110.
111. default:
112. return 0;
^
113. }
114. }
src/http/ngx_http.c:1713:5: Assignment
1711. ls->socklen = addr->socklen;
1712.
1713. ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
^
1714.
1715. ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
src/http/ngx_http.c:1715:26: Call
1713. ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
1714.
1715. ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
^
1716. if (ls->addr_text.data == NULL) {
1717. return NULL;
src/core/ngx_palloc.c:155:13: Assignment
153.
154. do {
155. m = p->d.last;
^
156.
157. if ((size_t) (p->d.end - m) >= size) {
src/core/ngx_palloc.c:160:17: Assignment
158. p->d.last = m + size;
159.
160. return m;
^
161. }
162.
src/http/ngx_http.c:1715:5: Assignment
1713. ls->addr_text.len = ngx_sock_ntop(sa, text, NGX_SOCKADDR_STRLEN, 1);
1714.
1715. ls->addr_text.data = ngx_pnalloc(cf->pool, ls->addr_text.len);
^
1716. if (ls->addr_text.data == NULL) {
1717. return NULL;
src/http/ngx_http.c:1720:5: Array access: Offset added: [0, 51] Size: [0, 51]
1718. }
1719.
1720. ngx_memcpy(ls->addr_text.data, text, ls->addr_text.len);
^
1721.
1722. ls->fd = (ngx_socket_t) -1;
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/http/ngx_http.c/#L1720
|
d2a_code_trace_data_44614
|
static int opt_metadata(const char *opt, const char *arg)
{
char *mid= strchr(arg, '=');
if(!mid){
fprintf(stderr, "Missing =\n");
ffmpeg_exit(1);
}
*mid++= 0;
av_metadata_set2(&metadata, arg, mid, 0);
return 0;
}
ffmpeg.c:2836: error: Null Dereference
pointer `mid` last assigned on line 2836 could be null and is dereferenced at line 2836, column 5.
ffmpeg.c:2828:1: start of procedure opt_metadata()
2826. }
2827.
2828. static int opt_metadata(const char *opt, const char *arg)
^
2829. {
2830. char *mid= strchr(arg, '=');
ffmpeg.c:2830:5:
2828. static int opt_metadata(const char *opt, const char *arg)
2829. {
2830. char *mid= strchr(arg, '=');
^
2831.
2832. if(!mid){
ffmpeg.c:2832:9: Taking true branch
2830. char *mid= strchr(arg, '=');
2831.
2832. if(!mid){
^
2833. fprintf(stderr, "Missing =\n");
2834. ffmpeg_exit(1);
ffmpeg.c:2833:9:
2831.
2832. if(!mid){
2833. fprintf(stderr, "Missing =\n");
^
2834. ffmpeg_exit(1);
2835. }
ffmpeg.c:2834:9: Skipping ffmpeg_exit(): empty list of specs
2832. if(!mid){
2833. fprintf(stderr, "Missing =\n");
2834. ffmpeg_exit(1);
^
2835. }
2836. *mid++= 0;
ffmpeg.c:2836:5:
2834. ffmpeg_exit(1);
2835. }
2836. *mid++= 0;
^
2837.
2838. av_metadata_set2(&metadata, arg, mid, 0);
|
https://github.com/libav/libav/blob/f4c79d1e0b2e797012304db57903e4091b0c2d7c/ffmpeg.c/#L2836
|
d2a_code_trace_data_44615
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/rsa/rsa_sp800_56b_check.c:179: error: INTEGER_OVERFLOW_L2
([0, 6+max(0, `ctx->stack.depth`)] - 1):unsigned32 by call to `BN_mod_mul`.
Showing all 37 steps of the trace
crypto/rsa/rsa_sp800_56b_check.c:157:1: Parameter `ctx->stack.depth`
155. * (Step 6b) 1 = (d*e) mod LCM(p–1, q–1)
156. */
157. > int rsa_check_private_exponent(const RSA *rsa, int nbits, BN_CTX *ctx)
158. {
159. int ret;
crypto/rsa/rsa_sp800_56b_check.c:166:5: Call
164. return 0;
165.
166. BN_CTX_start(ctx);
^
167. r = BN_CTX_get(ctx);
168. p1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/rsa/rsa_sp800_56b_check.c:167:9: Call
165.
166. BN_CTX_start(ctx);
167. r = BN_CTX_get(ctx);
^
168. p1 = BN_CTX_get(ctx);
169. q1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:168:10: Call
166. BN_CTX_start(ctx);
167. r = BN_CTX_get(ctx);
168. p1 = BN_CTX_get(ctx);
^
169. q1 = BN_CTX_get(ctx);
170. lcm = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:169:10: Call
167. r = BN_CTX_get(ctx);
168. p1 = BN_CTX_get(ctx);
169. q1 = BN_CTX_get(ctx);
^
170. lcm = BN_CTX_get(ctx);
171. p1q1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:170:11: Call
168. p1 = BN_CTX_get(ctx);
169. q1 = BN_CTX_get(ctx);
170. lcm = BN_CTX_get(ctx);
^
171. p1q1 = BN_CTX_get(ctx);
172. gcd = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:171:12: Call
169. q1 = BN_CTX_get(ctx);
170. lcm = BN_CTX_get(ctx);
171. p1q1 = BN_CTX_get(ctx);
^
172. gcd = BN_CTX_get(ctx);
173. ret = (gcd != NULL
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:172:11: Call
170. lcm = BN_CTX_get(ctx);
171. p1q1 = BN_CTX_get(ctx);
172. gcd = BN_CTX_get(ctx);
^
173. ret = (gcd != NULL
174. /* LCM(p - 1, q - 1) */
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:175:15: Call
173. ret = (gcd != NULL
174. /* LCM(p - 1, q - 1) */
175. && (rsa_get_lcm(ctx, rsa->p, rsa->q, lcm, gcd, p1, q1, p1q1) == 1)
^
176. /* (Step 6a) d < LCM(p - 1, q - 1) */
177. && (BN_cmp(rsa->d, lcm) < 0)
crypto/rsa/rsa_sp800_56b_check.c:220:1: Parameter `ctx->stack.depth`
218.
219. /* return LCM(p-1, q-1) */
220. > int rsa_get_lcm(BN_CTX *ctx, const BIGNUM *p, const BIGNUM *q,
221. BIGNUM *lcm, BIGNUM *gcd, BIGNUM *p1, BIGNUM *q1,
222. BIGNUM *p1q1)
crypto/rsa/rsa_sp800_56b_check.c:179:14: Call
177. && (BN_cmp(rsa->d, lcm) < 0)
178. /* (Step 6b) 1 = (e . d) mod LCM(p - 1, q - 1) */
179. && BN_mod_mul(r, rsa->e, rsa->d, lcm, ctx)
^
180. && BN_is_one(r));
181.
crypto/bn/bn_mod.c:193:1: Parameter `ctx->stack.depth`
191.
192. /* slow but works */
193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
194. BN_CTX *ctx)
195. {
crypto/bn/bn_mod.c:203:5: Call
201. bn_check_top(m);
202.
203. BN_CTX_start(ctx);
^
204. if ((t = BN_CTX_get(ctx)) == NULL)
205. goto err;
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_mod.c:204:14: Call
202.
203. BN_CTX_start(ctx);
204. if ((t = BN_CTX_get(ctx)) == NULL)
^
205. goto err;
206. if (a == b) {
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_mod.c:207:14: Call
205. goto err;
206. if (a == b) {
207. if (!BN_sqr(t, a, ctx))
^
208. goto err;
209. } else {
crypto/bn/bn_sqr.c:17:1: Parameter `ctx->stack.depth`
15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
16. */
17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int ret = bn_sqr_fixed_top(r, a, ctx);
crypto/bn/bn_sqr.c:19:15: Call
17. int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int ret = bn_sqr_fixed_top(r, a, ctx);
^
20.
21. bn_correct_top(r);
crypto/bn/bn_sqr.c:27:1: Parameter `ctx->stack.depth`
25. }
26.
27. > int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
28. {
29. int max, al;
crypto/bn/bn_sqr.c:42:5: Call
40. }
41.
42. BN_CTX_start(ctx);
^
43. rr = (a != r) ? r : BN_CTX_get(ctx);
44. tmp = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_sqr.c:44:11: Call
42. BN_CTX_start(ctx);
43. rr = (a != r) ? r : BN_CTX_get(ctx);
44. tmp = BN_CTX_get(ctx);
^
45. if (rr == NULL || tmp == NULL)
46. goto err;
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_sqr.c:104:5: Call
102. bn_check_top(rr);
103. bn_check_top(tmp);
104. BN_CTX_end(ctx);
^
105. return ret;
106. }
crypto/bn/bn_ctx.c:185:1: Parameter `ctx->stack.depth`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/bn/bn_ctx.c:191:27: Call
189. ctx->err_stack--;
190. else {
191. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
192. /* Does this stack frame have anything to release? */
193. if (fp < ctx->used)
crypto/bn/bn_ctx.c:266:1: <LHS trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:268:12: Binary operation: ([0, 6+max(0, ctx->stack.depth)] - 1):unsigned32 by call to `BN_mod_mul`
266. static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
^
269. }
270.
|
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L268
|
d2a_code_trace_data_44616
|
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
{
bn_check_top(b);
if (a == b)
return a;
if (bn_wexpand(a, b->top) == NULL)
return NULL;
if (b->top > 0)
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
a->neg = b->neg;
a->top = b->top;
a->flags |= b->flags & BN_FLG_FIXED_TOP;
bn_check_top(a);
return a;
}
apps/dsaparam.c:235: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `DSA_generate_key`.
Showing all 33 steps of the trace
apps/dsaparam.c:186:15: Call
184.
185. DSA_get0_pqg(dsa, &p, &q, &g);
186. len = BN_num_bytes(p);
^
187. bits_p = BN_num_bits(p);
188.
crypto/bn/bn_lib.c:140:9: Call
138. bn_check_top(a);
139.
140. if (BN_is_zero(a))
^
141. return 0;
142. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
crypto/bn/bn_lib.c:866:1: Parameter `a->top`
864. }
865.
866. > int BN_is_zero(const BIGNUM *a)
867. {
868. return a->top == 0;
apps/dsaparam.c:187:18: Call
185. DSA_get0_pqg(dsa, &p, &q, &g);
186. len = BN_num_bytes(p);
187. bits_p = BN_num_bits(p);
^
188.
189. data = app_malloc(len + 20, "BN space");
crypto/bn/bn_lib.c:140:9: Call
138. bn_check_top(a);
139.
140. if (BN_is_zero(a))
^
141. return 0;
142. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
crypto/bn/bn_lib.c:866:1: Parameter `a->top`
864. }
865.
866. > int BN_is_zero(const BIGNUM *a)
867. {
868. return a->top == 0;
apps/dsaparam.c:192:9: Call
190.
191. BIO_printf(bio_out, "static DSA *get_dsa%d(void)\n{\n", bits_p);
192. print_bignum_var(bio_out, p, "dsap", bits_p, data);
^
193. print_bignum_var(bio_out, q, "dsaq", bits_p, data);
194. print_bignum_var(bio_out, g, "dsag", bits_p, data);
apps/apps.c:1031:9: Call
1029. {
1030. BIO_printf(out, " static unsigned char %s_%d[] = {", var, len);
1031. if (BN_is_zero(in)) {
^
1032. BIO_printf(out, "\n 0x00");
1033. } else {
crypto/bn/bn_lib.c:866:1: Parameter `a->top`
864. }
865.
866. > int BN_is_zero(const BIGNUM *a)
867. {
868. return a->top == 0;
apps/dsaparam.c:193:9: Call
191. BIO_printf(bio_out, "static DSA *get_dsa%d(void)\n{\n", bits_p);
192. print_bignum_var(bio_out, p, "dsap", bits_p, data);
193. print_bignum_var(bio_out, q, "dsaq", bits_p, data);
^
194. print_bignum_var(bio_out, g, "dsag", bits_p, data);
195. BIO_printf(bio_out, " DSA *dsa = DSA_new();\n"
apps/apps.c:1031:9: Call
1029. {
1030. BIO_printf(out, " static unsigned char %s_%d[] = {", var, len);
1031. if (BN_is_zero(in)) {
^
1032. BIO_printf(out, "\n 0x00");
1033. } else {
crypto/bn/bn_lib.c:866:1: Parameter `a->top`
864. }
865.
866. > int BN_is_zero(const BIGNUM *a)
867. {
868. return a->top == 0;
apps/dsaparam.c:194:9: Call
192. print_bignum_var(bio_out, p, "dsap", bits_p, data);
193. print_bignum_var(bio_out, q, "dsaq", bits_p, data);
194. print_bignum_var(bio_out, g, "dsag", bits_p, data);
^
195. BIO_printf(bio_out, " DSA *dsa = DSA_new();\n"
196. " BIGNUM *p, *q, *g;\n"
apps/apps.c:1031:9: Call
1029. {
1030. BIO_printf(out, " static unsigned char %s_%d[] = {", var, len);
1031. if (BN_is_zero(in)) {
^
1032. BIO_printf(out, "\n 0x00");
1033. } else {
crypto/bn/bn_lib.c:866:1: Parameter `a->top`
864. }
865.
866. > int BN_is_zero(const BIGNUM *a)
867. {
868. return a->top == 0;
apps/dsaparam.c:235:14: Call
233. if ((dsakey = DSAparams_dup(dsa)) == NULL)
234. goto end;
235. if (!DSA_generate_key(dsakey)) {
^
236. ERR_print_errors(bio_err);
237. DSA_free(dsakey);
crypto/dsa/dsa_key.c:18:1: Parameter `dsa->p->top`
16. static int dsa_builtin_keygen(DSA *dsa);
17.
18. > int DSA_generate_key(DSA *dsa)
19. {
20. if (dsa->meth->dsa_keygen)
crypto/dsa/dsa_key.c:22:12: Call
20. if (dsa->meth->dsa_keygen)
21. return dsa->meth->dsa_keygen(dsa);
22. return dsa_builtin_keygen(dsa);
^
23. }
24.
crypto/dsa/dsa_key.c:25:1: Parameter `dsa->p->top`
23. }
24.
25. > static int dsa_builtin_keygen(DSA *dsa)
26. {
27. int ok = 0;
crypto/dsa/dsa_key.c:58:14: Call
56. BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME);
57.
58. if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) {
^
59. BN_free(prk);
60. goto err;
crypto/bn/bn_exp.c:89:1: Parameter `m->top`
87. }
88.
89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
90. BN_CTX *ctx)
91. {
crypto/bn/bn_exp.c:134:9: Call
132.
133. #ifdef MONT_MUL_MOD
134. if (BN_is_odd(m)) {
^
135. # ifdef MONT_EXP_WORD
136. if (a->top == 1 && !a->neg
crypto/bn/bn_lib.c:881:1: Parameter `a->top`
879. }
880.
881. > int BN_is_odd(const BIGNUM *a)
882. {
883. return (a->top > 0) && (a->d[0] & 1);
crypto/bn/bn_exp.c:149:15: Call
147. #ifdef RECP_MUL_MOD
148. {
149. ret = BN_mod_exp_recp(r, a, p, m, ctx);
^
150. }
151. #else
crypto/bn/bn_exp.c:161:1: Parameter `m->top`
159. }
160.
161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
162. const BIGNUM *m, BN_CTX *ctx)
163. {
crypto/bn/bn_exp.c:200:14: Call
198. if (m->neg) {
199. /* ignore sign of 'm' */
200. if (!BN_copy(aa, m))
^
201. goto err;
202. aa->neg = 0;
crypto/bn/bn_lib.c:281:1: <Offset trace>
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: Parameter `b->top`
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: <Length trace>
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: Parameter `*a->d`
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:287:9: Call
285. if (a == b)
286. return a;
287. if (bn_wexpand(a, b->top) == NULL)
^
288. return NULL;
289.
crypto/bn/bn_lib.c:962:1: Parameter `*a->d`
960. }
961.
962. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
963. {
964. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:291:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `DSA_generate_key`
289.
290. if (b->top > 0)
291. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
^
292.
293. a->neg = b->neg;
|
https://github.com/openssl/openssl/blob/260a16f33682a819414fcba6161708a5e6bdff50/crypto/bn/bn_lib.c/#L291
|
d2a_code_trace_data_44617
|
static int
doapr_outch(char **sbuffer,
char **buffer, size_t *currlen, size_t *maxlen, int c)
{
OPENSSL_assert(*sbuffer != NULL || buffer != NULL);
OPENSSL_assert(*currlen <= *maxlen);
if (buffer && *currlen == *maxlen) {
if (*maxlen > INT_MAX - BUFFER_INC)
return 0;
*maxlen += BUFFER_INC;
if (*buffer == NULL) {
*buffer = OPENSSL_malloc(*maxlen);
if (*buffer == NULL)
return 0;
if (*currlen > 0) {
OPENSSL_assert(*sbuffer != NULL);
memcpy(*buffer, *sbuffer, *currlen);
}
*sbuffer = NULL;
} else {
char *tmpbuf;
tmpbuf = OPENSSL_realloc(*buffer, *maxlen);
if (tmpbuf == NULL)
return 0;
*buffer = tmpbuf;
}
}
if (*currlen < *maxlen) {
if (*sbuffer)
(*sbuffer)[(*currlen)++] = (char)c;
else
(*buffer)[(*currlen)++] = (char)c;
}
return 1;
}
crypto/bio/b_dump.c:63: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] (⇐ [-1, 285] + [0, +oo]) Size: 289 by call to `BIO_snprintf`.
Showing all 13 steps of the trace
crypto/bio/b_dump.c:29:1: Array declaration
27. }
28.
29. > int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
30. void *u, const char *s, int len, int indent)
31. {
crypto/bio/b_dump.c:63:21: Call
61. } else {
62. ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
63. BIO_snprintf(buf + n, 4, "%02x%c", ch,
^
64. j == 7 ? '-' : ' ');
65. }
crypto/bio/b_print.c:895:1: Parameter `*buf`
893. * function should be renamed, but to what?)
894. */
895. > int BIO_snprintf(char *buf, size_t n, const char *format, ...)
896. {
897. va_list args;
crypto/bio/b_print.c:902:11: Call
900. va_start(args, format);
901.
902. ret = BIO_vsnprintf(buf, n, format, args);
^
903.
904. va_end(args);
crypto/bio/b_print.c:908:1: Parameter `*buf`
906. }
907.
908. > int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
909. {
910. size_t retlen;
crypto/bio/b_print.c:913:9: Call
911. int truncated;
912.
913. if(!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args))
^
914. return -1;
915.
crypto/bio/b_print.c:83:1: Parameter `*maxlen`
81. #define OSSL_MAX(p,q) ((p >= q) ? p : q)
82.
83. > static int
84. _dopr(char **sbuffer,
85. char **buffer,
crypto/bio/b_print.c:114:21: Call
112. state = DP_S_FLAGS;
113. else
114. if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch))
^
115. return 0;
116. ch = *format++;
crypto/bio/b_print.c:804:1: <Offset trace>
802. #define BUFFER_INC 1024
803.
804. > static int
805. doapr_outch(char **sbuffer,
806. char **buffer, size_t *currlen, size_t *maxlen, int c)
crypto/bio/b_print.c:804:1: Parameter `*maxlen`
802. #define BUFFER_INC 1024
803.
804. > static int
805. doapr_outch(char **sbuffer,
806. char **buffer, size_t *currlen, size_t *maxlen, int c)
crypto/bio/b_print.c:804:1: <Length trace>
802. #define BUFFER_INC 1024
803.
804. > static int
805. doapr_outch(char **sbuffer,
806. char **buffer, size_t *currlen, size_t *maxlen, int c)
crypto/bio/b_print.c:804:1: Parameter `**sbuffer`
802. #define BUFFER_INC 1024
803.
804. > static int
805. doapr_outch(char **sbuffer,
806. char **buffer, size_t *currlen, size_t *maxlen, int c)
crypto/bio/b_print.c:839:13: Array access: Offset: [-1, +oo] (⇐ [-1, 285] + [0, +oo]) Size: 289 by call to `BIO_snprintf`
837. if (*currlen < *maxlen) {
838. if (*sbuffer)
839. (*sbuffer)[(*currlen)++] = (char)c;
^
840. else
841. (*buffer)[(*currlen)++] = (char)c;
|
https://github.com/openssl/openssl/blob/de2f409ef9de775df6db2c7de69b7bb0df21e380/crypto/bio/b_print.c/#L839
|
d2a_code_trace_data_44618
|
static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);
bc->bits >>= n;
#else
uint64_t ret = bc->bits >> (64 - n);
bc->bits <<= n;
#endif
bc->bits_left -= n;
return ret;
}
libavcodec/takdec.c:788: error: Integer Overflow L2
([1, +oo] - 3):unsigned32 by call to `bitstream_read`.
libavcodec/takdec.c:788:28: Call
786. }
787.
788. s->dmode = bitstream_read(bc, 3);
^
789. if (ret = decorrelate(s, 0, 1, s->nb_samples - 1))
790. return ret;
libavcodec/bitstream.h:183:1: Parameter `n`
181.
182. /* Return n bits from the buffer. n has to be in the 0-32 range. */
183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)
^
184. {
185. if (!n)
libavcodec/bitstream.h:194:12: Call
192. }
193.
194. return get_val(bc, n);
^
195. }
196.
libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `n`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:139:5: Binary operation: ([1, +oo] - 3):unsigned32 by call to `bitstream_read`
137. bc->bits <<= n;
138. #endif
139. bc->bits_left -= n;
^
140.
141. return ret;
|
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
|
d2a_code_trace_data_44619
|
static int encode_test_run(struct evp_test *t)
{
struct encode_data *edata = t->data;
unsigned char *encode_out = NULL, *decode_out = NULL;
int output_len, chunk_len;
const char *err = "INTERNAL_ERROR";
EVP_ENCODE_CTX *decode_ctx = EVP_ENCODE_CTX_new();
if (decode_ctx == NULL)
goto err;
if (edata->encoding == BASE64_CANONICAL_ENCODING) {
EVP_ENCODE_CTX *encode_ctx = EVP_ENCODE_CTX_new();
if (encode_ctx == NULL)
goto err;
encode_out = OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len));
if (encode_out == NULL)
goto err;
EVP_EncodeInit(encode_ctx);
EVP_EncodeUpdate(encode_ctx, encode_out, &chunk_len,
edata->input, edata->input_len);
output_len = chunk_len;
EVP_EncodeFinal(encode_ctx, encode_out + chunk_len, &chunk_len);
output_len += chunk_len;
EVP_ENCODE_CTX_free(encode_ctx);
if (check_var_length_output(t, edata->output, edata->output_len,
encode_out, output_len)) {
err = "BAD_ENCODING";
goto err;
}
}
decode_out = OPENSSL_malloc(EVP_DECODE_LENGTH(edata->output_len));
if (decode_out == NULL)
goto err;
EVP_DecodeInit(decode_ctx);
if (EVP_DecodeUpdate(decode_ctx, decode_out, &chunk_len, edata->output,
edata->output_len) < 0) {
err = "DECODE_ERROR";
goto err;
}
output_len = chunk_len;
if (EVP_DecodeFinal(decode_ctx, decode_out + chunk_len, &chunk_len) != 1) {
err = "DECODE_ERROR";
goto err;
}
output_len += chunk_len;
if (edata->encoding != BASE64_INVALID_ENCODING &&
check_var_length_output(t, edata->input, edata->input_len,
decode_out, output_len)) {
err = "BAD_DECODING";
goto err;
}
err = NULL;
err:
t->err = err;
OPENSSL_free(encode_out);
OPENSSL_free(decode_out);
EVP_ENCODE_CTX_free(decode_ctx);
return 1;
}
test/evp_test.c:1606: error: MEMORY_LEAK
memory dynamically allocated to `encode_ctx` by call to `EVP_ENCODE_CTX_new()` at line 1602, column 38 is not reachable after line 1606, column 13.
Showing all 56 steps of the trace
test/evp_test.c:1590:1: start of procedure encode_test_run()
1588. }
1589.
1590. > static int encode_test_run(struct evp_test *t)
1591. {
1592. struct encode_data *edata = t->data;
test/evp_test.c:1592:5:
1590. static int encode_test_run(struct evp_test *t)
1591. {
1592. > struct encode_data *edata = t->data;
1593. unsigned char *encode_out = NULL, *decode_out = NULL;
1594. int output_len, chunk_len;
test/evp_test.c:1593:5:
1591. {
1592. struct encode_data *edata = t->data;
1593. > unsigned char *encode_out = NULL, *decode_out = NULL;
1594. int output_len, chunk_len;
1595. const char *err = "INTERNAL_ERROR";
test/evp_test.c:1595:5:
1593. unsigned char *encode_out = NULL, *decode_out = NULL;
1594. int output_len, chunk_len;
1595. > const char *err = "INTERNAL_ERROR";
1596. EVP_ENCODE_CTX *decode_ctx = EVP_ENCODE_CTX_new();
1597.
test/evp_test.c:1596:5:
1594. int output_len, chunk_len;
1595. const char *err = "INTERNAL_ERROR";
1596. > EVP_ENCODE_CTX *decode_ctx = EVP_ENCODE_CTX_new();
1597.
1598. if (decode_ctx == NULL)
crypto/evp/encode.c:144:1: start of procedure EVP_ENCODE_CTX_new()
142. #endif
143.
144. > EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
145. {
146. return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
crypto/evp/encode.c:146:5:
144. EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
145. {
146. > return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
147. }
148.
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/evp/encode.c:147:1: return from a call to EVP_ENCODE_CTX_new
145. {
146. return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
147. > }
148.
149. void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
test/evp_test.c:1598:9: Taking false branch
1596. EVP_ENCODE_CTX *decode_ctx = EVP_ENCODE_CTX_new();
1597.
1598. if (decode_ctx == NULL)
^
1599. goto err;
1600.
test/evp_test.c:1601:9: Taking true branch
1599. goto err;
1600.
1601. if (edata->encoding == BASE64_CANONICAL_ENCODING) {
^
1602. EVP_ENCODE_CTX *encode_ctx = EVP_ENCODE_CTX_new();
1603. if (encode_ctx == NULL)
test/evp_test.c:1602:9:
1600.
1601. if (edata->encoding == BASE64_CANONICAL_ENCODING) {
1602. > EVP_ENCODE_CTX *encode_ctx = EVP_ENCODE_CTX_new();
1603. if (encode_ctx == NULL)
1604. goto err;
crypto/evp/encode.c:144:1: start of procedure EVP_ENCODE_CTX_new()
142. #endif
143.
144. > EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
145. {
146. return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
crypto/evp/encode.c:146:5:
144. EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void)
145. {
146. > return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
147. }
148.
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/evp/encode.c:147:1: return from a call to EVP_ENCODE_CTX_new
145. {
146. return (EVP_ENCODE_CTX *)OPENSSL_zalloc(sizeof(EVP_ENCODE_CTX));
147. > }
148.
149. void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
test/evp_test.c:1603:13: Taking false branch
1601. if (edata->encoding == BASE64_CANONICAL_ENCODING) {
1602. EVP_ENCODE_CTX *encode_ctx = EVP_ENCODE_CTX_new();
1603. if (encode_ctx == NULL)
^
1604. goto err;
1605. encode_out = OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len));
test/evp_test.c:1605:9:
1603. if (encode_ctx == NULL)
1604. goto err;
1605. > encode_out = OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len));
1606. if (encode_out == NULL)
1607. goto err;
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
test/evp_test.c:1606:13: Taking true branch
1604. goto err;
1605. encode_out = OPENSSL_malloc(EVP_ENCODE_LENGTH(edata->input_len));
1606. if (encode_out == NULL)
^
1607. goto err;
1608.
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/evp_test.c/#L1606
|
d2a_code_trace_data_44620
|
static av_always_inline void dnxhd_get_pixels_4x8(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
{
int i;
for (i = 0; i < 4; i++) {
block[0] = pixels[0];
block[1] = pixels[1];
block[2] = pixels[2];
block[3] = pixels[3];
block[4] = pixels[4];
block[5] = pixels[5];
block[6] = pixels[6];
block[7] = pixels[7];
pixels += line_size;
block += 8;
}
memcpy(block , block- 8, sizeof(*block)*8);
memcpy(block+ 8, block-16, sizeof(*block)*8);
memcpy(block+16, block-24, sizeof(*block)*8);
memcpy(block+24, block-32, sizeof(*block)*8);
}
libavcodec/dnxhdenc.c:416: error: Buffer Overrun L1
Offset: [12, +oo] (⇐ [5, +oo] + 7) Size: 8 by call to `dnxhd_get_pixels_4x8`.
libavcodec/dnxhdenc.c:401:1: Parameter `ctx->blocks[*]`
399. }
400.
401. static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, int mb_y)
^
402. {
403. const uint8_t *ptr_y = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize) + (mb_x << 4);
libavcodec/dnxhdenc.c:416:13: Call
414. if (ctx->interlaced) {
415. dnxhd_get_pixels_4x8(ctx->blocks[4], ptr_y + ctx->dct_y_offset , ctx->m.linesize);
416. dnxhd_get_pixels_4x8(ctx->blocks[5], ptr_y + ctx->dct_y_offset + 8, ctx->m.linesize);
^
417. dnxhd_get_pixels_4x8(ctx->blocks[6], ptr_u + ctx->dct_uv_offset , ctx->m.uvlinesize);
418. dnxhd_get_pixels_4x8(ctx->blocks[7], ptr_v + ctx->dct_uv_offset , ctx->m.uvlinesize);
libavcodec/dnxhdenc.c:380:1: <Length trace>
378. }
379.
380. static av_always_inline void dnxhd_get_pixels_4x8(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
^
381. {
382. int i;
libavcodec/dnxhdenc.c:380:1: Parameter `*block`
378. }
379.
380. static av_always_inline void dnxhd_get_pixels_4x8(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
^
381. {
382. int i;
libavcodec/dnxhdenc.c:391:9: Array access: Offset: [12, +oo] (⇐ [5, +oo] + 7) Size: 8 by call to `dnxhd_get_pixels_4x8`
389. block[5] = pixels[5];
390. block[6] = pixels[6];
391. block[7] = pixels[7];
^
392. pixels += line_size;
393. block += 8;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/dnxhdenc.c/#L391
|
d2a_code_trace_data_44621
|
void *lh_delete(LHASH *lh, const void *data)
{
unsigned long hash;
LHASH_NODE *nn,**rn;
void *ret;
lh->error=0;
rn=getrn(lh,data,&hash);
if (*rn == NULL)
{
lh->num_no_delete++;
return(NULL);
}
else
{
nn= *rn;
*rn=nn->next;
ret=nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
contract(lh);
return(ret);
}
ssl/d1_pkt.c:632: error: INTEGER_OVERFLOW_L2
([0, `s->ctx->sessions->num_items`] - 1):unsigned64 by call to `dtls1_process_record`.
Showing all 15 steps of the trace
ssl/d1_pkt.c:493:1: Parameter `s->ctx->sessions->num_items`
491. */
492. /* used only by dtls1_read_bytes */
493. > int dtls1_get_record(SSL *s)
494. {
495. int ssl_major,ssl_minor,al;
ssl/d1_pkt.c:509:9: Call
507. /* The epoch may have changed. If so, process all the
508. * pending records. This is a non-blocking operation. */
509. if ( ! dtls1_process_buffered_records(s))
^
510. return 0;
511.
ssl/d1_pkt.c:254:1: Parameter `s->ctx->sessions->num_items`
252. &((s)->d1->processed_rcds))
253.
254. > static int
255. dtls1_process_buffered_records(SSL *s)
256. {
ssl/d1_pkt.c:632:9: Call
630. }
631.
632. if ( ! dtls1_process_record(s))
^
633. return(0);
634.
ssl/d1_pkt.c:334:1: Parameter `s->ctx->sessions->num_items`
332. #endif
333.
334. > static int
335. dtls1_process_record(SSL *s)
336. {
ssl/d1_pkt.c:478:2: Call
476. SSLerr(SSL_F_DTLS1_PROCESS_RECORD,SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC);
477. f_err:
478. ssl3_send_alert(s,SSL3_AL_FATAL,al);
^
479. err:
480. return(0);
ssl/s3_pkt.c:1258:1: Parameter `s->ctx->sessions->num_items`
1256. }
1257.
1258. > void ssl3_send_alert(SSL *s, int level, int desc)
1259. {
1260. /* Map tls/ssl alert value to correct one */
ssl/s3_pkt.c:1267:3: Call
1265. /* If a fatal one, remove from cache */
1266. if ((level == 2) && (s->session != NULL))
1267. SSL_CTX_remove_session(s->ctx,s->session);
^
1268.
1269. s->s3->alert_dispatch=1;
ssl/ssl_sess.c:486:1: Parameter `ctx->sessions->num_items`
484. }
485.
486. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
487. {
488. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:488:9: Call
486. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
487. {
488. return remove_session_lock(ctx, c, 1);
^
489. }
490.
ssl/ssl_sess.c:491:1: Parameter `ctx->sessions->num_items`
489. }
490.
491. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
492. {
493. SSL_SESSION *r;
ssl/ssl_sess.c:502:21: Call
500. {
501. ret=1;
502. r=(SSL_SESSION *)lh_delete(ctx->sessions,c);
^
503. SSL_SESSION_list_remove(ctx,c);
504. }
crypto/lhash/lhash.c:217:1: <LHS trace>
215. }
216.
217. > void *lh_delete(LHASH *lh, const void *data)
218. {
219. unsigned long hash;
crypto/lhash/lhash.c:217:1: Parameter `lh->num_items`
215. }
216.
217. > void *lh_delete(LHASH *lh, const void *data)
218. {
219. unsigned long hash;
crypto/lhash/lhash.c:240:2: Binary operation: ([0, s->ctx->sessions->num_items] - 1):unsigned64 by call to `dtls1_process_record`
238. }
239.
240. lh->num_items--;
^
241. if ((lh->num_nodes > MIN_NODES) &&
242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
|
https://github.com/openssl/openssl/blob/a761b89d2feac31acb9acf01b4a5c6694c9064db/crypto/lhash/lhash.c/#L240
|
d2a_code_trace_data_44622
|
static int add_session(SSL *ssl, SSL_SESSION *session)
{
simple_ssl_session *sess;
unsigned char *p;
sess = OPENSSL_malloc(sizeof(simple_ssl_session));
sess->idlen = SSL_SESSION_get_id_len(session);
sess->derlen = i2d_SSL_SESSION(session, NULL);
sess->id = BUF_memdup(SSL_SESSION_get0_id(session), sess->idlen);
sess->der = OPENSSL_malloc(sess->derlen);
p = sess->der;
i2d_SSL_SESSION(session, &p);
sess->next = first;
first = sess;
BIO_printf(bio_err, "New session added to external cache\n");
return 0;
}
apps/s_server.c:3005: error: NULL_DEREFERENCE
pointer `sess` last assigned on line 3003 could be null and is dereferenced at line 3005, column 2.
Showing all 19 steps of the trace
apps/s_server.c:2998:1: start of procedure add_session()
2996. static simple_ssl_session *first = NULL;
2997.
2998. > static int add_session(SSL *ssl, SSL_SESSION *session)
2999. {
3000. simple_ssl_session *sess;
apps/s_server.c:3003:2:
3001. unsigned char *p;
3002.
3003. > sess = OPENSSL_malloc(sizeof(simple_ssl_session));
3004.
3005. sess->idlen = SSL_SESSION_get_id_len(session);
crypto/mem.c:297:1: start of procedure CRYPTO_malloc()
295. }
296.
297. > void *CRYPTO_malloc(int num, const char *file, int line)
298. {
299. void *ret = NULL;
crypto/mem.c:299:2:
297. void *CRYPTO_malloc(int num, const char *file, int line)
298. {
299. > void *ret = NULL;
300.
301. if (num <= 0) return NULL;
crypto/mem.c:301:6: Taking false branch
299. void *ret = NULL;
300.
301. if (num <= 0) return NULL;
^
302.
303. allow_customize = 0;
crypto/mem.c:303:2:
301. if (num <= 0) return NULL;
302.
303. > allow_customize = 0;
304. if (malloc_debug_func != NULL)
305. {
crypto/mem.c:304:6: Taking true branch
302.
303. allow_customize = 0;
304. if (malloc_debug_func != NULL)
^
305. {
306. allow_customize_debug = 0;
crypto/mem.c:306:3:
304. if (malloc_debug_func != NULL)
305. {
306. > allow_customize_debug = 0;
307. malloc_debug_func(NULL, num, file, line, 0);
308. }
crypto/mem.c:307:3: Skipping __function_pointer__(): unresolved function pointer
305. {
306. allow_customize_debug = 0;
307. malloc_debug_func(NULL, num, file, line, 0);
^
308. }
309. ret = malloc_ex_func(num,file,line);
crypto/mem.c:309:2: Skipping __function_pointer__(): unresolved function pointer
307. malloc_debug_func(NULL, num, file, line, 0);
308. }
309. ret = malloc_ex_func(num,file,line);
^
310. #ifdef LEVITTE_DEBUG_MEM
311. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
crypto/mem.c:313:6: Taking true branch
311. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
312. #endif
313. if (malloc_debug_func != NULL)
^
314. malloc_debug_func(ret, num, file, line, 1);
315.
crypto/mem.c:314:3: Skipping __function_pointer__(): unresolved function pointer
312. #endif
313. if (malloc_debug_func != NULL)
314. malloc_debug_func(ret, num, file, line, 1);
^
315.
316. #ifndef OPENSSL_CPUID_OBJ
crypto/mem.c:320:12: Taking false branch
318. * sanitisation function can't be optimised out. NB: We only do
319. * this for >2Kb so the overhead doesn't bother us. */
320. if(ret && (num > 2048))
^
321. { extern unsigned char cleanse_ctr;
322. ((unsigned char *)ret)[0] = cleanse_ctr;
crypto/mem.c:326:2:
324. #endif
325.
326. > return ret;
327. }
328. char *CRYPTO_strdup(const char *str, const char *file, int line)
crypto/mem.c:327:2: return from a call to CRYPTO_malloc
325.
326. return ret;
327. }
^
328. char *CRYPTO_strdup(const char *str, const char *file, int line)
329. {
apps/s_server.c:3005:2:
3003. sess = OPENSSL_malloc(sizeof(simple_ssl_session));
3004.
3005. > sess->idlen = SSL_SESSION_get_id_len(session);
3006. sess->derlen = i2d_SSL_SESSION(session, NULL);
3007.
ssl/ssl_sess.c:865:1: start of procedure SSL_SESSION_get_id_len()
863. }
864.
865. > unsigned int SSL_SESSION_get_id_len(SSL_SESSION *s)
866. {
867. return s->session_id_length;
ssl/ssl_sess.c:867:2:
865. unsigned int SSL_SESSION_get_id_len(SSL_SESSION *s)
866. {
867. > return s->session_id_length;
868. }
869.
ssl/ssl_sess.c:868:2: return from a call to SSL_SESSION_get_id_len
866. {
867. return s->session_id_length;
868. }
^
869.
870. const unsigned char *SSL_SESSION_get0_id(SSL_SESSION *s)
|
https://github.com/openssl/openssl/blob/d674bb4bc84e6e8cf510adfe7049cb19a2c29cf8/apps/s_server.c/#L3005
|
d2a_code_trace_data_44623
|
static int opt_streamid(const char *opt, const char *arg)
{
int idx;
char *p;
char idx_str[16];
strncpy(idx_str, arg, sizeof(idx_str));
idx_str[sizeof(idx_str)-1] = '\0';
p = strchr(idx_str, ':');
if (!p) {
fprintf(stderr,
"Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
arg, opt);
ffmpeg_exit(1);
}
*p++ = '\0';
idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
return 0;
}
ffmpeg.c:3541: error: Null Dereference
pointer `p` last assigned on line 3541 could be null and is dereferenced at line 3541, column 5.
ffmpeg.c:3526:1: start of procedure opt_streamid()
3524.
3525. /* arg format is "output-stream-index:streamid-value". */
3526. static int opt_streamid(const char *opt, const char *arg)
^
3527. {
3528. int idx;
ffmpeg.c:3532:5:
3530. char idx_str[16];
3531.
3532. strncpy(idx_str, arg, sizeof(idx_str));
^
3533. idx_str[sizeof(idx_str)-1] = '\0';
3534. p = strchr(idx_str, ':');
ffmpeg.c:3533:5:
3531.
3532. strncpy(idx_str, arg, sizeof(idx_str));
3533. idx_str[sizeof(idx_str)-1] = '\0';
^
3534. p = strchr(idx_str, ':');
3535. if (!p) {
ffmpeg.c:3534:5:
3532. strncpy(idx_str, arg, sizeof(idx_str));
3533. idx_str[sizeof(idx_str)-1] = '\0';
3534. p = strchr(idx_str, ':');
^
3535. if (!p) {
3536. fprintf(stderr,
ffmpeg.c:3535:10: Taking true branch
3533. idx_str[sizeof(idx_str)-1] = '\0';
3534. p = strchr(idx_str, ':');
3535. if (!p) {
^
3536. fprintf(stderr,
3537. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
ffmpeg.c:3536:9:
3534. p = strchr(idx_str, ':');
3535. if (!p) {
3536. fprintf(stderr,
^
3537. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3538. arg, opt);
ffmpeg.c:3539:9: Skipping ffmpeg_exit(): empty list of specs
3537. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3538. arg, opt);
3539. ffmpeg_exit(1);
^
3540. }
3541. *p++ = '\0';
ffmpeg.c:3541:5:
3539. ffmpeg_exit(1);
3540. }
3541. *p++ = '\0';
^
3542. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3543. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
|
https://github.com/libav/libav/blob/eced8fa02ea237abd9c6a6e9287bb7524addb8f4/ffmpeg.c/#L3541
|
d2a_code_trace_data_44624
|
ngx_int_t
ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key, void *value,
ngx_uint_t flags)
{
size_t len;
u_char *p;
ngx_str_t *name;
ngx_uint_t i, k, n, skip, last;
ngx_array_t *keys, *hwc;
ngx_hash_key_t *hk;
last = key->len;
if (flags & NGX_HASH_WILDCARD_KEY) {
n = 0;
for (i = 0; i < key->len; i++) {
if (key->data[i] == '*') {
if (++n > 1) {
return NGX_DECLINED;
}
}
if (key->data[i] == '.' && key->data[i + 1] == '.') {
return NGX_DECLINED;
}
}
if (key->len > 1 && key->data[0] == '.') {
skip = 1;
goto wildcard;
}
if (key->len > 2) {
if (key->data[0] == '*' && key->data[1] == '.') {
skip = 2;
goto wildcard;
}
if (key->data[i - 2] == '.' && key->data[i - 1] == '*') {
skip = 0;
last -= 2;
goto wildcard;
}
}
if (n) {
return NGX_DECLINED;
}
}
k = 0;
for (i = 0; i < last; i++) {
if (!(flags & NGX_HASH_READONLY_KEY)) {
key->data[i] = ngx_tolower(key->data[i]);
}
k = ngx_hash(k, key->data[i]);
}
k %= ha->hsize;
name = ha->keys_hash[k].elts;
if (name) {
for (i = 0; i < ha->keys_hash[k].nelts; i++) {
if (last != name[i].len) {
continue;
}
if (ngx_strncmp(key->data, name[i].data, last) == 0) {
return NGX_BUSY;
}
}
} else {
if (ngx_array_init(&ha->keys_hash[k], ha->temp_pool, 4,
sizeof(ngx_str_t))
!= NGX_OK)
{
return NGX_ERROR;
}
}
name = ngx_array_push(&ha->keys_hash[k]);
if (name == NULL) {
return NGX_ERROR;
}
*name = *key;
hk = ngx_array_push(&ha->keys);
if (hk == NULL) {
return NGX_ERROR;
}
hk->key = *key;
hk->key_hash = ngx_hash_key(key->data, last);
hk->value = value;
return NGX_OK;
wildcard:
k = ngx_hash_strlow(&key->data[skip], &key->data[skip], last - skip);
k %= ha->hsize;
if (skip == 1) {
name = ha->keys_hash[k].elts;
if (name) {
len = last - skip;
for (i = 0; i < ha->keys_hash[k].nelts; i++) {
if (len != name[i].len) {
continue;
}
if (ngx_strncmp(&key->data[1], name[i].data, len) == 0) {
return NGX_BUSY;
}
}
} else {
if (ngx_array_init(&ha->keys_hash[k], ha->temp_pool, 4,
sizeof(ngx_str_t))
!= NGX_OK)
{
return NGX_ERROR;
}
}
name = ngx_array_push(&ha->keys_hash[k]);
if (name == NULL) {
return NGX_ERROR;
}
name->len = last - 1;
name->data = ngx_pnalloc(ha->temp_pool, name->len);
if (name->data == NULL) {
return NGX_ERROR;
}
ngx_memcpy(name->data, &key->data[1], name->len);
}
if (skip) {
p = ngx_pnalloc(ha->temp_pool, last);
if (p == NULL) {
return NGX_ERROR;
}
len = 0;
n = 0;
for (i = last - 1; i; i--) {
if (key->data[i] == '.') {
ngx_memcpy(&p[n], &key->data[i + 1], len);
n += len;
p[n++] = '.';
len = 0;
continue;
}
len++;
}
if (len) {
ngx_memcpy(&p[n], &key->data[1], len);
n += len;
}
p[n] = '\0';
hwc = &ha->dns_wc_head;
keys = &ha->dns_wc_head_hash[k];
} else {
last++;
p = ngx_pnalloc(ha->temp_pool, last);
if (p == NULL) {
return NGX_ERROR;
}
ngx_cpystrn(p, key->data, last);
hwc = &ha->dns_wc_tail;
keys = &ha->dns_wc_tail_hash[k];
}
hk = ngx_array_push(hwc);
if (hk == NULL) {
return NGX_ERROR;
}
hk->key.len = last - 1;
hk->key.data = p;
hk->key_hash = 0;
hk->value = value;
name = keys->elts;
if (name) {
len = last - skip;
for (i = 0; i < keys->nelts; i++) {
if (len != name[i].len) {
continue;
}
if (ngx_strncmp(key->data + skip, name[i].data, len) == 0) {
return NGX_BUSY;
}
}
} else {
if (ngx_array_init(keys, ha->temp_pool, 4, sizeof(ngx_str_t)) != NGX_OK)
{
return NGX_ERROR;
}
}
name = ngx_array_push(keys);
if (name == NULL) {
return NGX_ERROR;
}
name->len = last - skip;
name->data = ngx_pnalloc(ha->temp_pool, name->len);
if (name->data == NULL) {
return NGX_ERROR;
}
ngx_memcpy(name->data, key->data + skip, name->len);
return NGX_OK;
}
src/http/ngx_http_upstream.c:3362: error: Buffer Overrun L3
Offset added: [-3, +oo] (⇐ [0, 2] + [-3, +oo]) Size: [8, +oo] by call to `ngx_http_add_variable`.
src/http/ngx_http_upstream.c:3362:15: Call
3360.
3361. for (v = ngx_http_upstream_vars; v->name.len; v++) {
3362. var = ngx_http_add_variable(cf, &v->name, v->flags);
^
3363. if (var == NULL) {
3364. return NGX_ERROR;
src/http/ngx_http_variables.c:257:1: Parameter `name->len`
255.
256.
257. ngx_http_variable_t *
^
258. ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)
259. {
src/http/ngx_http_upstream.c:3362:15: Call
3360.
3361. for (v = ngx_http_upstream_vars; v->name.len; v++) {
3362. var = ngx_http_add_variable(cf, &v->name, v->flags);
^
3363. if (var == NULL) {
3364. return NGX_ERROR;
src/http/ngx_http_variables.c:257:1: Parameter `name->len`
255.
256.
257. ngx_http_variable_t *
^
258. ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)
259. {
src/http/ngx_http_variables.c:292:5: Assignment
290. }
291.
292. v->name.len = name->len;
^
293. v->name.data = ngx_pnalloc(cf->pool, name->len);
294. if (v->name.data == NULL) {
src/http/ngx_http_variables.c:306:10: Call
304. v->index = 0;
305.
306. rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v, 0);
^
307.
308. if (rc == NGX_ERROR) {
src/core/ngx_hash.c:749:13: <Offset trace>
747.
748. if (key->len > 1 && key->data[0] == '.') {
749. skip = 1;
^
750. goto wildcard;
751. }
src/core/ngx_hash.c:749:13: Assignment
747.
748. if (key->len > 1 && key->data[0] == '.') {
749. skip = 1;
^
750. goto wildcard;
751. }
src/core/ngx_hash.c:974:5: Assignment
972. }
973.
974. name->len = last - skip;
^
975. name->data = ngx_pnalloc(ha->temp_pool, name->len);
976. if (name->data == NULL) {
src/core/ngx_hash.c:713:1: <Length trace>
711.
712.
713. ngx_int_t
^
714. ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key, void *value,
715. ngx_uint_t flags)
src/core/ngx_hash.c:713:1: Parameter `*key->data`
711.
712.
713. ngx_int_t
^
714. ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key, void *value,
715. ngx_uint_t flags)
src/core/ngx_hash.c:980:5: Array access: Offset added: [-3, +oo] (⇐ [0, 2] + [-3, +oo]) Size: [8, +oo] by call to `ngx_http_add_variable`
978. }
979.
980. ngx_memcpy(name->data, key->data + skip, name->len);
^
981.
982. return NGX_OK;
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_hash.c/#L980
|
d2a_code_trace_data_44625
|
static void prime_field_tests(void)
{
BN_CTX *ctx = NULL;
BIGNUM *p, *a, *b;
EC_GROUP *group;
EC_GROUP *P_160 = NULL, *P_192 = NULL, *P_224 = NULL, *P_256 =
NULL, *P_384 = NULL, *P_521 = NULL;
EC_POINT *P, *Q, *R;
BIGNUM *x, *y, *z;
unsigned char buf[100];
size_t i, len;
int k;
ctx = BN_CTX_new();
if (!ctx)
ABORT;
p = BN_new();
a = BN_new();
b = BN_new();
if (!p || !a || !b)
ABORT;
if (!BN_hex2bn(&p, "17"))
ABORT;
if (!BN_hex2bn(&a, "1"))
ABORT;
if (!BN_hex2bn(&b, "1"))
ABORT;
group = EC_GROUP_new(EC_GFp_mont_method());
if (!group)
ABORT;
if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx))
ABORT;
{
EC_GROUP *tmp;
tmp = EC_GROUP_new(EC_GROUP_method_of(group));
if (!tmp)
ABORT;
if (!EC_GROUP_copy(tmp, group))
ABORT;
EC_GROUP_free(group);
group = tmp;
}
if (!EC_GROUP_get_curve_GFp(group, p, a, b, ctx))
ABORT;
fprintf(stdout,
"Curve defined by Weierstrass equation\n y^2 = x^3 + a*x + b (mod 0x");
BN_print_fp(stdout, p);
fprintf(stdout, ")\n a = 0x");
BN_print_fp(stdout, a);
fprintf(stdout, "\n b = 0x");
BN_print_fp(stdout, b);
fprintf(stdout, "\n");
P = EC_POINT_new(group);
Q = EC_POINT_new(group);
R = EC_POINT_new(group);
if (!P || !Q || !R)
ABORT;
if (!EC_POINT_set_to_infinity(group, P))
ABORT;
if (!EC_POINT_is_at_infinity(group, P))
ABORT;
buf[0] = 0;
if (!EC_POINT_oct2point(group, Q, buf, 1, ctx))
ABORT;
if (!EC_POINT_add(group, P, P, Q, ctx))
ABORT;
if (!EC_POINT_is_at_infinity(group, P))
ABORT;
x = BN_new();
y = BN_new();
z = BN_new();
if (!x || !y || !z)
ABORT;
if (!BN_hex2bn(&x, "D"))
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, Q, x, 1, ctx))
ABORT;
if (EC_POINT_is_on_curve(group, Q, ctx) <= 0) {
if (!EC_POINT_get_affine_coordinates_GFp(group, Q, x, y, ctx))
ABORT;
fprintf(stderr, "Point is not on curve: x = 0x");
BN_print_fp(stderr, x);
fprintf(stderr, ", y = 0x");
BN_print_fp(stderr, y);
fprintf(stderr, "\n");
ABORT;
}
fprintf(stdout, "A cyclic subgroup:\n");
k = 100;
do {
if (k-- == 0)
ABORT;
if (EC_POINT_is_at_infinity(group, P))
fprintf(stdout, " point at infinity\n");
else {
if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
fprintf(stdout, " x = 0x");
BN_print_fp(stdout, x);
fprintf(stdout, ", y = 0x");
BN_print_fp(stdout, y);
fprintf(stdout, "\n");
}
if (!EC_POINT_copy(R, P))
ABORT;
if (!EC_POINT_add(group, P, P, Q, ctx))
ABORT;
}
while (!EC_POINT_is_at_infinity(group, P));
if (!EC_POINT_add(group, P, Q, R, ctx))
ABORT;
if (!EC_POINT_is_at_infinity(group, P))
ABORT;
len =
EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf,
sizeof buf, ctx);
if (len == 0)
ABORT;
if (!EC_POINT_oct2point(group, P, buf, len, ctx))
ABORT;
if (0 != EC_POINT_cmp(group, P, Q, ctx))
ABORT;
fprintf(stdout, "Generator as octet string, compressed form:\n ");
for (i = 0; i < len; i++)
fprintf(stdout, "%02X", buf[i]);
len =
EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf,
sizeof buf, ctx);
if (len == 0)
ABORT;
if (!EC_POINT_oct2point(group, P, buf, len, ctx))
ABORT;
if (0 != EC_POINT_cmp(group, P, Q, ctx))
ABORT;
fprintf(stdout, "\nGenerator as octet string, uncompressed form:\n ");
for (i = 0; i < len; i++)
fprintf(stdout, "%02X", buf[i]);
len =
EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf,
ctx);
if (len == 0)
ABORT;
if (!EC_POINT_oct2point(group, P, buf, len, ctx))
ABORT;
if (0 != EC_POINT_cmp(group, P, Q, ctx))
ABORT;
fprintf(stdout, "\nGenerator as octet string, hybrid form:\n ");
for (i = 0; i < len; i++)
fprintf(stdout, "%02X", buf[i]);
if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx))
ABORT;
fprintf(stdout,
"\nA representation of the inverse of that generator in\nJacobian projective coordinates:\n X = 0x");
BN_print_fp(stdout, x);
fprintf(stdout, ", Y = 0x");
BN_print_fp(stdout, y);
fprintf(stdout, ", Z = 0x");
BN_print_fp(stdout, z);
fprintf(stdout, "\n");
if (!EC_POINT_invert(group, P, ctx))
ABORT;
if (0 != EC_POINT_cmp(group, P, R, ctx))
ABORT;
if (!BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"))
ABORT;
if (1 != BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
ABORT;
if (!BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"))
ABORT;
if (!BN_hex2bn(&b, "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"))
ABORT;
if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx))
ABORT;
if (!BN_hex2bn(&x, "4A96B5688EF573284664698968C38BB913CBFC82"))
ABORT;
if (!BN_hex2bn(&y, "23a628553168947d59dcc912042351377ac5fb32"))
ABORT;
if (!EC_POINT_set_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "0100000000000000000001F4C8F927AED3CA752257"))
ABORT;
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nSEC2 curve secp160r1 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
fprintf(stdout, "\n y = 0x");
BN_print_fp(stdout, y);
fprintf(stdout, "\n");
if (!BN_hex2bn(&z, "23a628553168947d59dcc912042351377ac5fb32"))
ABORT;
if (0 != BN_cmp(y, z))
ABORT;
fprintf(stdout, "verify degree ...");
if (EC_GROUP_get_degree(group) != 160)
ABORT;
fprintf(stdout, " ok\n");
group_order_tests(group);
if ((P_160 = EC_GROUP_new(EC_GROUP_method_of(group))) == NULL)
ABORT;
if (!EC_GROUP_copy(P_160, group))
ABORT;
if (!BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"))
ABORT;
if (1 != BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
ABORT;
if (!BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"))
ABORT;
if (!BN_hex2bn(&b, "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"))
ABORT;
if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx))
ABORT;
if (!BN_hex2bn(&x, "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"))
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx))
ABORT;
if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"))
ABORT;
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-192 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
fprintf(stdout, "\n y = 0x");
BN_print_fp(stdout, y);
fprintf(stdout, "\n");
if (!BN_hex2bn(&z, "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811"))
ABORT;
if (0 != BN_cmp(y, z))
ABORT;
fprintf(stdout, "verify degree ...");
if (EC_GROUP_get_degree(group) != 192)
ABORT;
fprintf(stdout, " ok\n");
group_order_tests(group);
if ((P_192 = EC_GROUP_new(EC_GROUP_method_of(group))) == NULL)
ABORT;
if (!EC_GROUP_copy(P_192, group))
ABORT;
if (!BN_hex2bn
(&p, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"))
ABORT;
if (1 != BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
ABORT;
if (!BN_hex2bn
(&a, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"))
ABORT;
if (!BN_hex2bn
(&b, "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"))
ABORT;
if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx))
ABORT;
if (!BN_hex2bn
(&x, "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21"))
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx))
ABORT;
if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn
(&z, "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"))
ABORT;
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-224 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
fprintf(stdout, "\n y = 0x");
BN_print_fp(stdout, y);
fprintf(stdout, "\n");
if (!BN_hex2bn
(&z, "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34"))
ABORT;
if (0 != BN_cmp(y, z))
ABORT;
fprintf(stdout, "verify degree ...");
if (EC_GROUP_get_degree(group) != 224)
ABORT;
fprintf(stdout, " ok\n");
group_order_tests(group);
if ((P_224 = EC_GROUP_new(EC_GROUP_method_of(group))) == NULL)
ABORT;
if (!EC_GROUP_copy(P_224, group))
ABORT;
if (!BN_hex2bn
(&p,
"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"))
ABORT;
if (1 != BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
ABORT;
if (!BN_hex2bn
(&a,
"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"))
ABORT;
if (!BN_hex2bn
(&b,
"5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"))
ABORT;
if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx))
ABORT;
if (!BN_hex2bn
(&x,
"6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"))
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx))
ABORT;
if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E"
"84F3B9CAC2FC632551"))
ABORT;
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-256 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
fprintf(stdout, "\n y = 0x");
BN_print_fp(stdout, y);
fprintf(stdout, "\n");
if (!BN_hex2bn
(&z,
"4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"))
ABORT;
if (0 != BN_cmp(y, z))
ABORT;
fprintf(stdout, "verify degree ...");
if (EC_GROUP_get_degree(group) != 256)
ABORT;
fprintf(stdout, " ok\n");
group_order_tests(group);
if ((P_256 = EC_GROUP_new(EC_GROUP_method_of(group))) == NULL)
ABORT;
if (!EC_GROUP_copy(P_256, group))
ABORT;
if (!BN_hex2bn(&p, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF"))
ABORT;
if (1 != BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
ABORT;
if (!BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC"))
ABORT;
if (!BN_hex2bn(&b, "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141"
"120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF"))
ABORT;
if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx))
ABORT;
if (!BN_hex2bn(&x, "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B"
"9859F741E082542A385502F25DBF55296C3A545E3872760AB7"))
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 1, ctx))
ABORT;
if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973"))
ABORT;
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-384 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
fprintf(stdout, "\n y = 0x");
BN_print_fp(stdout, y);
fprintf(stdout, "\n");
if (!BN_hex2bn(&z, "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A14"
"7CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F"))
ABORT;
if (0 != BN_cmp(y, z))
ABORT;
fprintf(stdout, "verify degree ...");
if (EC_GROUP_get_degree(group) != 384)
ABORT;
fprintf(stdout, " ok\n");
group_order_tests(group);
if ((P_384 = EC_GROUP_new(EC_GROUP_method_of(group))) == NULL)
ABORT;
if (!EC_GROUP_copy(P_384, group))
ABORT;
if (!BN_hex2bn(&p, "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"))
ABORT;
if (1 != BN_is_prime_ex(p, BN_prime_checks, ctx, NULL))
ABORT;
if (!BN_hex2bn(&a, "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFFFFFFFFFFFFFFFFFFFFFFFFFFC"))
ABORT;
if (!BN_hex2bn(&b, "051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B"
"315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573"
"DF883D2C34F1EF451FD46B503F00"))
ABORT;
if (!EC_GROUP_set_curve_GFp(group, p, a, b, ctx))
ABORT;
if (!BN_hex2bn(&x, "C6858E06B70404E9CD9E3ECB662395B4429C648139053F"
"B521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B"
"3C1856A429BF97E7E31C2E5BD66"))
ABORT;
if (!EC_POINT_set_compressed_coordinates_GFp(group, P, x, 0, ctx))
ABORT;
if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!BN_hex2bn(&z, "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
"FFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5"
"C9B8899C47AEBB6FB71E91386409"))
ABORT;
if (!EC_GROUP_set_generator(group, P, z, BN_value_one()))
ABORT;
if (!EC_POINT_get_affine_coordinates_GFp(group, P, x, y, ctx))
ABORT;
fprintf(stdout, "\nNIST curve P-521 -- Generator:\n x = 0x");
BN_print_fp(stdout, x);
fprintf(stdout, "\n y = 0x");
BN_print_fp(stdout, y);
fprintf(stdout, "\n");
if (!BN_hex2bn(&z, "11839296A789A3BC0045C8A5FB42C7D1BD998F54449579"
"B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C"
"7086A272C24088BE94769FD16650"))
ABORT;
if (0 != BN_cmp(y, z))
ABORT;
fprintf(stdout, "verify degree ...");
if (EC_GROUP_get_degree(group) != 521)
ABORT;
fprintf(stdout, " ok\n");
group_order_tests(group);
if ((P_521 = EC_GROUP_new(EC_GROUP_method_of(group))) == NULL)
ABORT;
if (!EC_GROUP_copy(P_521, group))
ABORT;
if (!EC_POINT_copy(Q, P))
ABORT;
if (EC_POINT_is_at_infinity(group, Q))
ABORT;
if (!EC_POINT_dbl(group, P, P, ctx))
ABORT;
if (EC_POINT_is_on_curve(group, P, ctx) <= 0)
ABORT;
if (!EC_POINT_invert(group, Q, ctx))
ABORT;
if (!EC_POINT_add(group, R, P, Q, ctx))
ABORT;
if (!EC_POINT_add(group, R, R, Q, ctx))
ABORT;
if (!EC_POINT_is_at_infinity(group, R))
ABORT;
{
const EC_POINT *points[4];
const BIGNUM *scalars[4];
BIGNUM *scalar3;
if (EC_POINT_is_at_infinity(group, Q))
ABORT;
points[0] = Q;
points[1] = Q;
points[2] = Q;
points[3] = Q;
if (!EC_GROUP_get_order(group, z, ctx))
ABORT;
if (!BN_add(y, z, BN_value_one()))
ABORT;
if (BN_is_odd(y))
ABORT;
if (!BN_rshift1(y, y))
ABORT;
scalars[0] = y;
scalars[1] = y;
fprintf(stdout, "combined multiplication ...");
fflush(stdout);
if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx))
ABORT;
if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx))
ABORT;
if (0 != EC_POINT_cmp(group, P, R, ctx))
ABORT;
if (0 != EC_POINT_cmp(group, R, Q, ctx))
ABORT;
fprintf(stdout, ".");
fflush(stdout);
if (!BN_pseudo_rand(y, BN_num_bits(y), 0, 0))
ABORT;
if (!BN_add(z, z, y))
ABORT;
BN_set_negative(z, 1);
scalars[0] = y;
scalars[1] = z;
if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx))
ABORT;
if (!EC_POINT_is_at_infinity(group, P))
ABORT;
fprintf(stdout, ".");
fflush(stdout);
if (!BN_pseudo_rand(x, BN_num_bits(y) - 1, 0, 0))
ABORT;
if (!BN_add(z, x, y))
ABORT;
BN_set_negative(z, 1);
scalars[0] = x;
scalars[1] = y;
scalars[2] = z;
scalar3 = BN_new();
if (!scalar3)
ABORT;
BN_zero(scalar3);
scalars[3] = scalar3;
if (!EC_POINTs_mul(group, P, NULL, 4, points, scalars, ctx))
ABORT;
if (!EC_POINT_is_at_infinity(group, P))
ABORT;
fprintf(stdout, " ok\n\n");
BN_free(scalar3);
}
BN_CTX_free(ctx);
BN_free(p);
BN_free(a);
BN_free(b);
EC_GROUP_free(group);
EC_POINT_free(P);
EC_POINT_free(Q);
EC_POINT_free(R);
BN_free(x);
BN_free(y);
BN_free(z);
EC_GROUP_free(P_160);
EC_GROUP_free(P_192);
EC_GROUP_free(P_224);
EC_GROUP_free(P_256);
EC_GROUP_free(P_384);
EC_GROUP_free(P_521);
}
test/ectest.c:254: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 247, column 9 is not reachable after line 254, column 10.
Showing all 106 steps of the trace
test/ectest.c:229:1: start of procedure prime_field_tests()
227. }
228.
229. > static void prime_field_tests(void)
230. {
231. BN_CTX *ctx = NULL;
test/ectest.c:231:5:
229. static void prime_field_tests(void)
230. {
231. > BN_CTX *ctx = NULL;
232. BIGNUM *p, *a, *b;
233. EC_GROUP *group;
test/ectest.c:234:5:
232. BIGNUM *p, *a, *b;
233. EC_GROUP *group;
234. > EC_GROUP *P_160 = NULL, *P_192 = NULL, *P_224 = NULL, *P_256 =
235. NULL, *P_384 = NULL, *P_521 = NULL;
236. EC_POINT *P, *Q, *R;
test/ectest.c:242:5:
240. int k;
241.
242. > ctx = BN_CTX_new();
243. if (!ctx)
244. ABORT;
crypto/bn/bn_ctx.c:189:1: start of procedure BN_CTX_new()
187.
188.
189. > BN_CTX *BN_CTX_new(void)
190. {
191. BN_CTX *ret;
crypto/bn/bn_ctx.c:193:9:
191. BN_CTX *ret;
192.
193. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);
195. return NULL;
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_ctx.c:193:9: Taking false branch
191. BN_CTX *ret;
192.
193. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);
195. return NULL;
crypto/bn/bn_ctx.c:198:5:
196. }
197. /* Initialise the structure */
198. > BN_POOL_init(&ret->pool);
199. BN_STACK_init(&ret->stack);
200. return ret;
crypto/bn/bn_ctx.c:335:1: start of procedure BN_POOL_init()
333. /***********/
334.
335. > static void BN_POOL_init(BN_POOL *p)
336. {
337. p->head = p->current = p->tail = NULL;
crypto/bn/bn_ctx.c:337:5:
335. static void BN_POOL_init(BN_POOL *p)
336. {
337. > p->head = p->current = p->tail = NULL;
338. p->used = p->size = 0;
339. }
crypto/bn/bn_ctx.c:338:5:
336. {
337. p->head = p->current = p->tail = NULL;
338. > p->used = p->size = 0;
339. }
340.
crypto/bn/bn_ctx.c:339:1: return from a call to BN_POOL_init
337. p->head = p->current = p->tail = NULL;
338. p->used = p->size = 0;
339. > }
340.
341. static void BN_POOL_finish(BN_POOL *p)
crypto/bn/bn_ctx.c:199:5:
197. /* Initialise the structure */
198. BN_POOL_init(&ret->pool);
199. > BN_STACK_init(&ret->stack);
200. return ret;
201. }
crypto/bn/bn_ctx.c:294:1: start of procedure BN_STACK_init()
292. /************/
293.
294. > static void BN_STACK_init(BN_STACK *st)
295. {
296. st->indexes = NULL;
crypto/bn/bn_ctx.c:296:5:
294. static void BN_STACK_init(BN_STACK *st)
295. {
296. > st->indexes = NULL;
297. st->depth = st->size = 0;
298. }
crypto/bn/bn_ctx.c:297:5:
295. {
296. st->indexes = NULL;
297. > st->depth = st->size = 0;
298. }
299.
crypto/bn/bn_ctx.c:298:1: return from a call to BN_STACK_init
296. st->indexes = NULL;
297. st->depth = st->size = 0;
298. > }
299.
300. static void BN_STACK_finish(BN_STACK *st)
crypto/bn/bn_ctx.c:200:5:
198. BN_POOL_init(&ret->pool);
199. BN_STACK_init(&ret->stack);
200. > return ret;
201. }
202.
crypto/bn/bn_ctx.c:201:1: return from a call to BN_CTX_new
199. BN_STACK_init(&ret->stack);
200. return ret;
201. > }
202.
203. BN_CTX *BN_CTX_secure_new(void)
test/ectest.c:243:10: Taking false branch
241.
242. ctx = BN_CTX_new();
243. if (!ctx)
^
244. ABORT;
245.
test/ectest.c:246:5:
244. ABORT;
245.
246. > p = BN_new();
247. a = BN_new();
248. b = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/ectest.c:247:5:
245.
246. p = BN_new();
247. > a = BN_new();
248. b = BN_new();
249. if (!p || !a || !b)
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/ectest.c:248:5:
246. p = BN_new();
247. a = BN_new();
248. > b = BN_new();
249. if (!p || !a || !b)
250. ABORT;
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/ectest.c:249:10: Taking false branch
247. a = BN_new();
248. b = BN_new();
249. if (!p || !a || !b)
^
250. ABORT;
251.
test/ectest.c:249:16: Taking false branch
247. a = BN_new();
248. b = BN_new();
249. if (!p || !a || !b)
^
250. ABORT;
251.
test/ectest.c:249:22: Taking false branch
247. a = BN_new();
248. b = BN_new();
249. if (!p || !a || !b)
^
250. ABORT;
251.
test/ectest.c:252:10: Taking false branch
250. ABORT;
251.
252. if (!BN_hex2bn(&p, "17"))
^
253. ABORT;
254. if (!BN_hex2bn(&a, "1"))
test/ectest.c:254:10: Skipping BN_hex2bn(): empty list of specs
252. if (!BN_hex2bn(&p, "17"))
253. ABORT;
254. if (!BN_hex2bn(&a, "1"))
^
255. ABORT;
256. if (!BN_hex2bn(&b, "1"))
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/ectest.c/#L254
|
d2a_code_trace_data_44626
|
static void decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) {
const int mb_xy = h->s.mb_x + h->s.mb_y*h->s.mb_stride;
static const int significant_coeff_flag_offset[2][6] = {
{ 105+0, 105+15, 105+29, 105+44, 105+47, 402 },
{ 277+0, 277+15, 277+29, 277+44, 277+47, 436 }
};
static const int last_coeff_flag_offset[2][6] = {
{ 166+0, 166+15, 166+29, 166+44, 166+47, 417 },
{ 338+0, 338+15, 338+29, 338+44, 338+47, 451 }
};
static const int coeff_abs_level_m1_offset[6] = {
227+0, 227+10, 227+20, 227+30, 227+39, 426
};
static const uint8_t significant_coeff_flag_offset_8x8[2][63] = {
{ 0, 1, 2, 3, 4, 5, 5, 4, 4, 3, 3, 4, 4, 4, 5, 5,
4, 4, 4, 4, 3, 3, 6, 7, 7, 7, 8, 9,10, 9, 8, 7,
7, 6,11,12,13,11, 6, 7, 8, 9,14,10, 9, 8, 6,11,
12,13,11, 6, 9,14,10, 9,11,12,13,11,14,10,12 },
{ 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 7, 8, 4, 5,
6, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,11,12,11,
9, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,13,13, 9,
9,10,10, 8,13,13, 9, 9,10,10,14,14,14,14,14 }
};
int index[64];
int av_unused last;
int coeff_count = 0;
int abslevel1 = 1;
int abslevelgt1 = 0;
uint8_t *significant_coeff_ctx_base;
uint8_t *last_coeff_ctx_base;
uint8_t *abs_level_m1_ctx_base;
#ifndef ARCH_X86
#define CABAC_ON_STACK
#endif
#ifdef CABAC_ON_STACK
#define CC &cc
CABACContext cc;
cc.range = h->cabac.range;
cc.low = h->cabac.low;
cc.bytestream= h->cabac.bytestream;
#else
#define CC &h->cabac
#endif
if( cat != 5 ) {
if( get_cabac( CC, &h->cabac_state[85 + get_cabac_cbf_ctx( h, cat, n ) ] ) == 0 ) {
if( cat == 1 || cat == 2 )
h->non_zero_count_cache[scan8[n]] = 0;
else if( cat == 4 )
h->non_zero_count_cache[scan8[16+n]] = 0;
#ifdef CABAC_ON_STACK
h->cabac.range = cc.range ;
h->cabac.low = cc.low ;
h->cabac.bytestream= cc.bytestream;
#endif
return;
}
}
significant_coeff_ctx_base = h->cabac_state
+ significant_coeff_flag_offset[MB_FIELD][cat];
last_coeff_ctx_base = h->cabac_state
+ last_coeff_flag_offset[MB_FIELD][cat];
abs_level_m1_ctx_base = h->cabac_state
+ coeff_abs_level_m1_offset[cat];
if( cat == 5 ) {
#define DECODE_SIGNIFICANCE( coefs, sig_off, last_off ) \
for(last= 0; last < coefs; last++) { \
uint8_t *sig_ctx = significant_coeff_ctx_base + sig_off; \
if( get_cabac( CC, sig_ctx )) { \
uint8_t *last_ctx = last_coeff_ctx_base + last_off; \
index[coeff_count++] = last; \
if( get_cabac( CC, last_ctx ) ) { \
last= max_coeff; \
break; \
} \
} \
}\
if( last == max_coeff -1 ) {\
index[coeff_count++] = last;\
}
const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD];
#if defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS)
coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off);
} else {
coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index);
#else
DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] );
} else {
DECODE_SIGNIFICANCE( max_coeff - 1, last, last );
#endif
}
assert(coeff_count > 0);
if( cat == 0 )
h->cbp_table[mb_xy] |= 0x100;
else if( cat == 1 || cat == 2 )
h->non_zero_count_cache[scan8[n]] = coeff_count;
else if( cat == 3 )
h->cbp_table[mb_xy] |= 0x40 << n;
else if( cat == 4 )
h->non_zero_count_cache[scan8[16+n]] = coeff_count;
else {
assert( cat == 5 );
fill_rectangle(&h->non_zero_count_cache[scan8[n]], 2, 2, 8, coeff_count, 1);
}
for( coeff_count--; coeff_count >= 0; coeff_count-- ) {
uint8_t *ctx = (abslevelgt1 != 0 ? 0 : FFMIN( 4, abslevel1 )) + abs_level_m1_ctx_base;
int j= scantable[index[coeff_count]];
if( get_cabac( CC, ctx ) == 0 ) {
if( !qmul ) {
block[j] = get_cabac_bypass_sign( CC, -1);
}else{
block[j] = (get_cabac_bypass_sign( CC, -qmul[j]) + 32) >> 6;
}
abslevel1++;
} else {
int coeff_abs = 2;
ctx = 5 + FFMIN( 4, abslevelgt1 ) + abs_level_m1_ctx_base;
while( coeff_abs < 15 && get_cabac( CC, ctx ) ) {
coeff_abs++;
}
if( coeff_abs >= 15 ) {
int j = 0;
while( get_cabac_bypass( CC ) ) {
j++;
}
coeff_abs=1;
while( j-- ) {
coeff_abs += coeff_abs + get_cabac_bypass( CC );
}
coeff_abs+= 14;
}
if( !qmul ) {
if( get_cabac_bypass( CC ) ) block[j] = -coeff_abs;
else block[j] = coeff_abs;
}else{
if( get_cabac_bypass( CC ) ) block[j] = (-coeff_abs * qmul[j] + 32) >> 6;
else block[j] = ( coeff_abs * qmul[j] + 32) >> 6;
}
abslevelgt1++;
}
}
#ifdef CABAC_ON_STACK
h->cabac.range = cc.range ;
h->cabac.low = cc.low ;
h->cabac.bytestream= cc.bytestream;
#endif
}
libavcodec/h264.c:5991: error: Buffer Overrun L2
Offset: [min(0, `h->mb_field_decoding_flag`), 62+max(1, `h->mb_field_decoding_flag`)] (⇐ [min(0, `h->mb_field_decoding_flag`), max(1, `h->mb_field_decoding_flag`)] + [0, 62]) Size: 2 by call to `decode_cabac_residual`.
libavcodec/h264.c:5577:1: Parameter `h->mb_field_decoding_flag`
5575. * @returns 0 if ok, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed
5576. */
5577. static int decode_mb_cabac(H264Context *h) {
^
5578. MpegEncContext * const s = &h->s;
5579. const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
libavcodec/h264.c:5625:5: Call
5623. h->prev_mb_skipped = 0;
5624.
5625. compute_mb_neighbors(h);
^
5626. if( ( mb_type = decode_cabac_mb_type( h ) ) < 0 ) {
5627. av_log( h->s.avctx, AV_LOG_ERROR, "decode_cabac_mb_type failed\n" );
libavcodec/h264.c:5545:1: Parameter `h->mb_field_decoding_flag`
5543. }
5544.
5545. static inline void compute_mb_neighbors(H264Context *h)
^
5546. {
5547. MpegEncContext * const s = &h->s;
libavcodec/h264.c:5716:5: Call
5714. }
5715.
5716. fill_caches(h, mb_type, 0);
^
5717.
5718. if( IS_INTRA( mb_type ) ) {
libavcodec/h264.c:79:1: Parameter `h->mb_field_decoding_flag`
77.
78.
79. static void fill_caches(H264Context *h, int mb_type, int for_deblock){
^
80. MpegEncContext * const s = &h->s;
81. const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
libavcodec/h264.c:5991:13: Call
5989. int i;
5990. //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 DC\n" );
5991. decode_cabac_residual( h, h->mb, 0, 0, dc_scan, NULL, 16);
^
5992.
5993. if( cbp&15 ) {
libavcodec/h264.c:5474:9: <Offset trace>
5472. coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index);
5473. #else
5474. DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] );
^
5475. } else {
5476. DECODE_SIGNIFICANCE( max_coeff - 1, last, last );
libavcodec/h264.c:5474:9: Assignment
5472. coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index);
5473. #else
5474. DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] );
^
5475. } else {
5476. DECODE_SIGNIFICANCE( max_coeff - 1, last, last );
libavcodec/h264.c:5371:1: <Length trace>
5369. };
5370.
5371. static void decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) {
^
5372. const int mb_xy = h->s.mb_x + h->s.mb_y*h->s.mb_stride;
5373. static const int significant_coeff_flag_offset[2][6] = {
libavcodec/h264.c:5371:1: Parameter `h->mb_field_decoding_flag`
5369. };
5370.
5371. static void decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) {
^
5372. const int mb_xy = h->s.mb_x + h->s.mb_y*h->s.mb_stride;
5373. static const int significant_coeff_flag_offset[2][6] = {
libavcodec/h264.c:5468:9: Assignment
5466. index[coeff_count++] = last;\
5467. }
5468. const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD];
^
5469. #if defined(ARCH_X86) && defined(HAVE_7REGS) && defined(HAVE_EBX_AVAILABLE) && !defined(BROKEN_RELOCATIONS)
5470. coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off);
libavcodec/h264.c:5474:9: Array access: Offset: [min(0, h->mb_field_decoding_flag), 62+max(1, h->mb_field_decoding_flag)] (⇐ [min(0, h->mb_field_decoding_flag), max(1, h->mb_field_decoding_flag)] + [0, 62]) Size: 2 by call to `decode_cabac_residual`
5472. coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index);
5473. #else
5474. DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] );
^
5475. } else {
5476. DECODE_SIGNIFICANCE( max_coeff - 1, last, last );
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L5474
|
d2a_code_trace_data_44627
|
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
{
unsigned long hash;
OPENSSL_LH_NODE *nn, **rn;
void *ret;
lh->error = 0;
rn = getrn(lh, data, &hash);
if (*rn == NULL) {
lh->num_no_delete++;
return (NULL);
} else {
nn = *rn;
*rn = nn->next;
ret = nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
contract(lh);
return (ret);
}
ssl/record/rec_layer_d1.c:874: error: INTEGER_OVERFLOW_L2
([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`.
Showing all 13 steps of the trace
ssl/record/rec_layer_d1.c:298:1: Parameter `s->initial_ctx->sessions->num_items`
296. * none of our business
297. */
298. > int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf,
299. int len, int peek)
300. {
ssl/record/rec_layer_d1.c:874:5: Call
872.
873. f_err:
874. ssl3_send_alert(s, SSL3_AL_FATAL, al);
^
875. return (-1);
876. }
ssl/s3_msg.c:64:1: Parameter `s->initial_ctx->sessions->num_items`
62. }
63.
64. > int ssl3_send_alert(SSL *s, int level, int desc)
65. {
66. /* Map tls/ssl alert value to correct one */
ssl/s3_msg.c:75:9: Call
73. /* If a fatal one, remove from cache */
74. if ((level == SSL3_AL_FATAL) && (s->session != NULL))
75. SSL_CTX_remove_session(s->session_ctx, s->session);
^
76.
77. s->s3->alert_dispatch = 1;
ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items`
689. }
690.
691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
692. {
693. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:693:12: Call
691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
692. {
693. return remove_session_lock(ctx, c, 1);
^
694. }
695.
ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items`
694. }
695.
696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
697. {
698. SSL_SESSION *r;
ssl/ssl_sess.c:706:17: Call
704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
705. ret = 1;
706. r = lh_SSL_SESSION_delete(ctx->sessions, c);
^
707. SSL_SESSION_list_remove(ctx, c);
708. }
ssl/ssl_locl.h:581:1: Parameter `lh->num_items`
579. };
580.
581. > DEFINE_LHASH_OF(SSL_SESSION);
582. /* Needed in ssl_cert.c */
583. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:581:1: Call
579. };
580.
581. > DEFINE_LHASH_OF(SSL_SESSION);
582. /* Needed in ssl_cert.c */
583. DEFINE_LHASH_OF(X509_NAME);
crypto/lhash/lhash.c:103:1: <LHS trace>
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:103:1: Parameter `lh->num_items`
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_send_alert`
121. }
122.
123. lh->num_items--;
^
124. if ((lh->num_nodes > MIN_NODES) &&
125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
|
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
|
d2a_code_trace_data_44628
|
static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size)
{
GetBitContext gb;
int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
int dts_flag = -1, cts_flag = -1;
int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
init_get_bits(&gb, buf, buf_size*8);
if (sl->use_au_start)
au_start_flag = get_bits1(&gb);
if (sl->use_au_end)
au_end_flag = get_bits1(&gb);
if (!sl->use_au_start && !sl->use_au_end)
au_start_flag = au_end_flag = 1;
if (sl->ocr_len > 0)
ocr_flag = get_bits1(&gb);
if (sl->use_idle)
idle_flag = get_bits1(&gb);
if (sl->use_padding)
padding_flag = get_bits1(&gb);
if (padding_flag)
padding_bits = get_bits(&gb, 3);
if (!idle_flag && (!padding_flag || padding_bits != 0)) {
if (sl->packet_seq_num_len)
skip_bits_long(&gb, sl->packet_seq_num_len);
if (sl->degr_prior_len)
if (get_bits1(&gb))
skip_bits(&gb, sl->degr_prior_len);
if (ocr_flag)
skip_bits_long(&gb, sl->ocr_len);
if (au_start_flag) {
if (sl->use_rand_acc_pt)
get_bits1(&gb);
if (sl->au_seq_num_len > 0)
skip_bits_long(&gb, sl->au_seq_num_len);
if (sl->use_timestamps) {
dts_flag = get_bits1(&gb);
cts_flag = get_bits1(&gb);
}
}
if (sl->inst_bitrate_len)
inst_bitrate_flag = get_bits1(&gb);
if (dts_flag == 1)
dts = get_bits64(&gb, sl->timestamp_len);
if (cts_flag == 1)
cts = get_bits64(&gb, sl->timestamp_len);
if (sl->au_len > 0)
skip_bits_long(&gb, sl->au_len);
if (inst_bitrate_flag)
skip_bits_long(&gb, sl->inst_bitrate_len);
}
if (dts != AV_NOPTS_VALUE)
pes->dts = dts;
if (cts != AV_NOPTS_VALUE)
pes->pts = cts;
if (sl->timestamp_len && sl->timestamp_res)
avpriv_set_pts_info(pes->st, sl->timestamp_len, 1, sl->timestamp_res);
return (get_bits_count(&gb) + 7) >> 3;
}
libavformat/mpegts.c:698: error: Null Dereference
pointer `&gb->buffer` last assigned on line 689 could be null and is dereferenced by call to `get_bits1()` at line 698, column 20.
libavformat/mpegts.c:682:1: start of procedure read_sl_header()
680. }
681.
682. static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size)
^
683. {
684. GetBitContext gb;
libavformat/mpegts.c:685:5:
683. {
684. GetBitContext gb;
685. int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
^
686. int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
687. int dts_flag = -1, cts_flag = -1;
libavformat/mpegts.c:686:5:
684. GetBitContext gb;
685. int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
686. int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
^
687. int dts_flag = -1, cts_flag = -1;
688. int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
libavformat/mpegts.c:687:5:
685. int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
686. int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
687. int dts_flag = -1, cts_flag = -1;
^
688. int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
689. init_get_bits(&gb, buf, buf_size*8);
libavformat/mpegts.c:688:5:
686. int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
687. int dts_flag = -1, cts_flag = -1;
688. int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
^
689. init_get_bits(&gb, buf, buf_size*8);
690.
libavformat/mpegts.c:689:5:
687. int dts_flag = -1, cts_flag = -1;
688. int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE;
689. init_get_bits(&gb, buf, buf_size*8);
^
690.
691. if (sl->use_au_start)
libavcodec/get_bits.h:352:1: start of procedure init_get_bits()
350. * @param bit_size the size of the buffer in bits
351. */
352. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
^
353. int bit_size)
354. {
libavcodec/get_bits.h:355:5:
353. int bit_size)
354. {
355. int buffer_size = (bit_size+7)>>3;
^
356. if (buffer_size < 0 || bit_size < 0) {
357. buffer_size = bit_size = 0;
libavcodec/get_bits.h:356:9: Taking true branch
354. {
355. int buffer_size = (bit_size+7)>>3;
356. if (buffer_size < 0 || bit_size < 0) {
^
357. buffer_size = bit_size = 0;
358. buffer = NULL;
libavcodec/get_bits.h:357:9:
355. int buffer_size = (bit_size+7)>>3;
356. if (buffer_size < 0 || bit_size < 0) {
357. buffer_size = bit_size = 0;
^
358. buffer = NULL;
359. }
libavcodec/get_bits.h:358:9:
356. if (buffer_size < 0 || bit_size < 0) {
357. buffer_size = bit_size = 0;
358. buffer = NULL;
^
359. }
360.
libavcodec/get_bits.h:361:5:
359. }
360.
361. s->buffer = buffer;
^
362. s->size_in_bits = bit_size;
363. #if !UNCHECKED_BITSTREAM_READER
libavcodec/get_bits.h:362:5:
360.
361. s->buffer = buffer;
362. s->size_in_bits = bit_size;
^
363. #if !UNCHECKED_BITSTREAM_READER
364. s->size_in_bits_plus8 = bit_size + 8;
libavcodec/get_bits.h:364:5:
362. s->size_in_bits = bit_size;
363. #if !UNCHECKED_BITSTREAM_READER
364. s->size_in_bits_plus8 = bit_size + 8;
^
365. #endif
366. s->buffer_end = buffer + buffer_size;
libavcodec/get_bits.h:366:5:
364. s->size_in_bits_plus8 = bit_size + 8;
365. #endif
366. s->buffer_end = buffer + buffer_size;
^
367. s->index = 0;
368. }
libavcodec/get_bits.h:367:5:
365. #endif
366. s->buffer_end = buffer + buffer_size;
367. s->index = 0;
^
368. }
369.
libavcodec/get_bits.h:368:1: return from a call to init_get_bits
366. s->buffer_end = buffer + buffer_size;
367. s->index = 0;
368. }
^
369.
370. static inline void align_get_bits(GetBitContext *s)
libavformat/mpegts.c:691:9: Taking false branch
689. init_get_bits(&gb, buf, buf_size*8);
690.
691. if (sl->use_au_start)
^
692. au_start_flag = get_bits1(&gb);
693. if (sl->use_au_end)
libavformat/mpegts.c:693:9: Taking false branch
691. if (sl->use_au_start)
692. au_start_flag = get_bits1(&gb);
693. if (sl->use_au_end)
^
694. au_end_flag = get_bits1(&gb);
695. if (!sl->use_au_start && !sl->use_au_end)
libavformat/mpegts.c:695:10: Taking true branch
693. if (sl->use_au_end)
694. au_end_flag = get_bits1(&gb);
695. if (!sl->use_au_start && !sl->use_au_end)
^
696. au_start_flag = au_end_flag = 1;
697. if (sl->ocr_len > 0)
libavformat/mpegts.c:695:31: Taking true branch
693. if (sl->use_au_end)
694. au_end_flag = get_bits1(&gb);
695. if (!sl->use_au_start && !sl->use_au_end)
^
696. au_start_flag = au_end_flag = 1;
697. if (sl->ocr_len > 0)
libavformat/mpegts.c:696:9:
694. au_end_flag = get_bits1(&gb);
695. if (!sl->use_au_start && !sl->use_au_end)
696. au_start_flag = au_end_flag = 1;
^
697. if (sl->ocr_len > 0)
698. ocr_flag = get_bits1(&gb);
libavformat/mpegts.c:697:9: Taking true branch
695. if (!sl->use_au_start && !sl->use_au_end)
696. au_start_flag = au_end_flag = 1;
697. if (sl->ocr_len > 0)
^
698. ocr_flag = get_bits1(&gb);
699. if (sl->use_idle)
libavformat/mpegts.c:698:9:
696. au_start_flag = au_end_flag = 1;
697. if (sl->ocr_len > 0)
698. ocr_flag = get_bits1(&gb);
^
699. if (sl->use_idle)
700. idle_flag = get_bits1(&gb);
libavcodec/get_bits.h:268:1: start of procedure get_bits1()
266. }
267.
268. static inline unsigned int get_bits1(GetBitContext *s)
^
269. {
270. unsigned int index = s->index;
libavcodec/get_bits.h:270:5:
268. static inline unsigned int get_bits1(GetBitContext *s)
269. {
270. unsigned int index = s->index;
^
271. uint8_t result = s->buffer[index>>3];
272. #ifdef BITSTREAM_READER_LE
libavcodec/get_bits.h:271:5:
269. {
270. unsigned int index = s->index;
271. uint8_t result = s->buffer[index>>3];
^
272. #ifdef BITSTREAM_READER_LE
273. result >>= index & 7;
|
https://github.com/libav/libav/blob/e5356ebf2216918ad6351d4caa8b58c881c4b0ea/libavformat/mpegts.c/#L698
|
d2a_code_trace_data_44629
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/ec/ecdsa_ossl.c:248: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `bn_mod_add_fixed_top`.
Showing all 21 steps of the trace
crypto/ec/ecdsa_ossl.c:212:10: Call
210. if (8 * dgst_len > i)
211. dgst_len = (i + 7) / 8;
212. if (!BN_bin2bn(dgst, dgst_len, m)) {
^
213. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
214. goto err;
crypto/bn/bn_lib.c:372:1: Parameter `ret->top`
370. }
371.
372. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
373. {
374. unsigned int i, m;
crypto/ec/ecdsa_ossl.c:248:14: Call
246. goto err;
247. }
248. if (!bn_mod_add_fixed_top(s, s, m, order)) {
^
249. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
250. goto err;
crypto/bn/bn_mod.c:48:1: Parameter `r->top`
46. * move depending on whether or not subtraction borrowed.
47. */
48. > int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
49. const BIGNUM *m)
50. {
crypto/bn/bn_mod.c:56:9: Call
54. const BN_ULONG *ap, *bp;
55.
56. if (bn_wexpand(r, mtop) == NULL)
^
57. return 0;
58.
crypto/bn/bn_lib.c:948:1: Parameter `a->top`
946. }
947.
948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:950:37: Call
948. BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
951. }
952.
crypto/bn/bn_lib.c:245:1: Parameter `b->top`
243. */
244.
245. > BIGNUM *bn_expand2(BIGNUM *b, int words)
246. {
247. if (words > b->dmax) {
crypto/bn/bn_lib.c:248:23: Call
246. {
247. if (words > b->dmax) {
248. BN_ULONG *a = bn_expand_internal(b, words);
^
249. if (!a)
250. return NULL;
crypto/bn/bn_lib.c:209:1: <Offset trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `b->top`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: <Length trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `words`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:224:13: Call
222. a = OPENSSL_secure_zalloc(words * sizeof(*a));
223. else
224. a = OPENSSL_zalloc(words * sizeof(*a));
^
225. if (a == NULL) {
226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/mem.c:228:1: Parameter `num`
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:17: Call
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
^
231.
232. FAILTEST();
crypto/mem.c:201:9: Assignment
199.
200. if (num == 0)
201. return NULL;
^
202.
203. FAILTEST();
crypto/mem.c:230:5: Assignment
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
^
231.
232. FAILTEST();
crypto/mem.c:235:5: Assignment
233. if (ret != NULL)
234. memset(ret, 0, num);
235. return ret;
^
236. }
237.
crypto/bn/bn_lib.c:224:9: Assignment
222. a = OPENSSL_secure_zalloc(words * sizeof(*a));
223. else
224. a = OPENSSL_zalloc(words * sizeof(*a));
^
225. if (a == NULL) {
226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `bn_mod_add_fixed_top`
230. assert(b->top <= words);
231. if (b->top > 0)
232. memcpy(a, b->d, sizeof(*a) * b->top);
^
233.
234. return a;
|
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_44630
|
int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
{
int rv, start_idx, i;
if (x == NULL) {
x = sk_X509_value(sk, 0);
start_idx = 1;
} else
start_idx = 0;
rv = ssl_security_cert(s, NULL, x, vfy, 1);
if (rv != 1)
return rv;
for (i = start_idx; i < sk_X509_num(sk); i++) {
x = sk_X509_value(sk, i);
rv = ssl_security_cert(s, NULL, x, vfy, 0);
if (rv != 1)
return rv;
}
return 1;
}
ssl/t1_lib.c:2400: error: NULL_DEREFERENCE
pointer `null` is dereferenced by call to `ssl_security_cert()` at line 2400, column 10.
Showing all 11 steps of the trace
ssl/t1_lib.c:2391:1: start of procedure ssl_security_cert_chain()
2389. */
2390.
2391. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
2392. {
2393. int rv, start_idx, i;
ssl/t1_lib.c:2394:9: Taking true branch
2392. {
2393. int rv, start_idx, i;
2394. if (x == NULL) {
^
2395. x = sk_X509_value(sk, 0);
2396. start_idx = 1;
ssl/t1_lib.c:2395:9:
2393. int rv, start_idx, i;
2394. if (x == NULL) {
2395. > x = sk_X509_value(sk, 0);
2396. start_idx = 1;
2397. } else
include/openssl/x509.h:99:1: start of procedure sk_X509_value()
97. typedef struct x509_cinf_st X509_CINF;
98.
99. > DEFINE_STACK_OF(X509)
100.
101. /* This is used for a table of trust checking functions */
crypto/stack/stack.c:385:1: start of procedure OPENSSL_sk_value()
383. }
384.
385. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
386. {
387. if (st == NULL || i < 0 || i >= st->num)
crypto/stack/stack.c:387:9: Taking true branch
385. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
386. {
387. if (st == NULL || i < 0 || i >= st->num)
^
388. return NULL;
389. return (void *)st->data[i];
crypto/stack/stack.c:388:9:
386. {
387. if (st == NULL || i < 0 || i >= st->num)
388. > return NULL;
389. return (void *)st->data[i];
390. }
crypto/stack/stack.c:390:1: return from a call to OPENSSL_sk_value
388. return NULL;
389. return (void *)st->data[i];
390. > }
391.
392. void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data)
include/openssl/x509.h:99:1: return from a call to sk_X509_value
97. typedef struct x509_cinf_st X509_CINF;
98.
99. > DEFINE_STACK_OF(X509)
100.
101. /* This is used for a table of trust checking functions */
ssl/t1_lib.c:2396:9:
2394. if (x == NULL) {
2395. x = sk_X509_value(sk, 0);
2396. > start_idx = 1;
2397. } else
2398. start_idx = 0;
ssl/t1_lib.c:2400:5:
2398. start_idx = 0;
2399.
2400. > rv = ssl_security_cert(s, NULL, x, vfy, 1);
2401. if (rv != 1)
2402. return rv;
|
https://github.com/openssl/openssl/blob/309371d6266877a8f04d0aa7b0f6add6d269d962/ssl/t1_lib.c/#L2400
|
d2a_code_trace_data_44631
|
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
*allocbytes = (unsigned char *)pkt->buf->data + pkt->curr;
return 1;
}
ssl/statem/statem_clnt.c:806: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, `pkt->written` + 70]):unsigned64 by call to `WPACKET_sub_memcpy__`.
Showing all 16 steps of the trace
ssl/statem/statem_clnt.c:696:1: Parameter `pkt->subs->lenbytes`
694. }
695.
696. > int tls_construct_client_hello(SSL *s, WPACKET *pkt)
697. {
698. unsigned char *p;
ssl/statem/statem_clnt.c:798:17: Call
796. || (sess_id_len != 0 && !WPACKET_memcpy(pkt, s->session->session_id,
797. sess_id_len))
798. || !WPACKET_close(pkt)) {
^
799. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);
800. return 0;
ssl/packet.c:192:1: Parameter `pkt->written`
190. }
191.
192. > int WPACKET_close(WPACKET *pkt)
193. {
194. /*
ssl/statem/statem_clnt.c:806:21: Call
804. if (SSL_IS_DTLS(s)) {
805. if (s->d1->cookie_len > sizeof(s->d1->cookie)
806. || !WPACKET_sub_memcpy_u8(pkt, s->d1->cookie,
^
807. s->d1->cookie_len)) {
808. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_HELLO, ERR_R_INTERNAL_ERROR);
ssl/packet.c:320:10: Call
318. size_t lenbytes)
319. {
320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
^
321. || !WPACKET_memcpy(pkt, src, len)
322. || !WPACKET_close(pkt))
ssl/packet.c:224:1: Parameter `pkt->buf->length`
222. }
223.
224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
225. {
226. WPACKET_SUB *sub;
ssl/packet.c:321:17: Call
319. {
320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
321. || !WPACKET_memcpy(pkt, src, len)
^
322. || !WPACKET_close(pkt))
323. return 0;
ssl/packet.c:302:1: Parameter `pkt->written`
300. }
301.
302. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
303. {
304. unsigned char *dest;
ssl/packet.c:309:10: Call
307. return 1;
308.
309. if (!WPACKET_allocate_bytes(pkt, len, &dest))
^
310. return 0;
311.
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:36:1: <LHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `pkt->buf->length`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: <RHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `len`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:46:9: Binary operation: ([0, +oo] - [0, pkt->written + 70]):unsigned64 by call to `WPACKET_sub_memcpy__`
44. return 0;
45.
46. if (pkt->buf->length - pkt->written < len) {
^
47. size_t newlen;
48. size_t reflen;
|
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/packet.c/#L46
|
d2a_code_trace_data_44632
|
int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k)
{
register u32 s0, s1, s2, s3;
k[0] = s0 = GETU32(rawKey);
k[1] = s1 = GETU32(rawKey + 4);
k[2] = s2 = GETU32(rawKey + 8);
k[3] = s3 = GETU32(rawKey + 12);
if (keyBitLength != 128) {
k[8] = s0 = GETU32(rawKey + 16);
k[9] = s1 = GETU32(rawKey + 20);
if (keyBitLength == 192) {
k[10] = s2 = ~s0;
k[11] = s3 = ~s1;
} else {
k[10] = s2 = GETU32(rawKey + 24);
k[11] = s3 = GETU32(rawKey + 28);
}
s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];
}
Camellia_Feistel(s0, s1, s2, s3, SIGMA + 0);
Camellia_Feistel(s2, s3, s0, s1, SIGMA + 2);
s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];
Camellia_Feistel(s0, s1, s2, s3, SIGMA + 4);
Camellia_Feistel(s2, s3, s0, s1, SIGMA + 6);
if (keyBitLength == 128) {
k[4] = s0, k[5] = s1, k[6] = s2, k[7] = s3;
RotLeft128(s0, s1, s2, s3, 15);
k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
RotLeft128(s0, s1, s2, s3, 15);
k[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3;
RotLeft128(s0, s1, s2, s3, 15);
k[24] = s0, k[25] = s1;
RotLeft128(s0, s1, s2, s3, 15);
k[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3;
RotLeft128(s1, s2, s3, s0, 2);
k[40] = s1, k[41] = s2, k[42] = s3, k[43] = s0;
RotLeft128(s1, s2, s3, s0, 17);
k[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0;
s0 = k[0], s1 = k[1], s2 = k[2], s3 = k[3];
RotLeft128(s0, s1, s2, s3, 15);
k[8] = s0, k[9] = s1, k[10] = s2, k[11] = s3;
RotLeft128(s0, s1, s2, s3, 30);
k[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3;
RotLeft128(s0, s1, s2, s3, 15);
k[26] = s2, k[27] = s3;
RotLeft128(s0, s1, s2, s3, 17);
k[32] = s0, k[33] = s1, k[34] = s2, k[35] = s3;
RotLeft128(s0, s1, s2, s3, 17);
k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3;
RotLeft128(s0, s1, s2, s3, 17);
k[44] = s0, k[45] = s1, k[46] = s2, k[47] = s3;
return 3;
} else {
k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
s0 ^= k[8], s1 ^= k[9], s2 ^= k[10], s3 ^= k[11];
Camellia_Feistel(s0, s1, s2, s3, (SIGMA + 8));
Camellia_Feistel(s2, s3, s0, s1, (SIGMA + 10));
k[4] = s0, k[5] = s1, k[6] = s2, k[7] = s3;
RotLeft128(s0, s1, s2, s3, 30);
k[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3;
RotLeft128(s0, s1, s2, s3, 30);
k[40] = s0, k[41] = s1, k[42] = s2, k[43] = s3;
RotLeft128(s1, s2, s3, s0, 19);
k[64] = s1, k[65] = s2, k[66] = s3, k[67] = s0;
s0 = k[8], s1 = k[9], s2 = k[10], s3 = k[11];
RotLeft128(s0, s1, s2, s3, 15);
k[8] = s0, k[9] = s1, k[10] = s2, k[11] = s3;
RotLeft128(s0, s1, s2, s3, 15);
k[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3;
RotLeft128(s0, s1, s2, s3, 30);
k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3;
RotLeft128(s1, s2, s3, s0, 2);
k[52] = s1, k[53] = s2, k[54] = s3, k[55] = s0;
s0 = k[12], s1 = k[13], s2 = k[14], s3 = k[15];
RotLeft128(s0, s1, s2, s3, 15);
k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
RotLeft128(s0, s1, s2, s3, 30);
k[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3;
k[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0;
RotLeft128(s1, s2, s3, s0, 17);
k[56] = s1, k[57] = s2, k[58] = s3, k[59] = s0;
s0 = k[0], s1 = k[1], s2 = k[2], s3 = k[3];
RotLeft128(s1, s2, s3, s0, 13);
k[24] = s1, k[25] = s2, k[26] = s3, k[27] = s0;
RotLeft128(s1, s2, s3, s0, 15);
k[32] = s1, k[33] = s2, k[34] = s3, k[35] = s0;
RotLeft128(s1, s2, s3, s0, 17);
k[44] = s1, k[45] = s2, k[46] = s3, k[47] = s0;
RotLeft128(s2, s3, s0, s1, 2);
k[60] = s2, k[61] = s3, k[62] = s0, k[63] = s1;
return 4;
}
}
apps/speed.c:998: error: BUFFER_OVERRUN_L1
Offset: 31 (⇐ 28 + 3) Size: 16 by call to `Camellia_set_key`.
Showing all 7 steps of the trace
apps/speed.c:629:5: Array declaration
627. CAST_KEY cast_ks;
628. #endif
629. static const unsigned char key16[16] = {
^
630. 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
631. 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12
apps/speed.c:998:5: Call
996. #endif
997. #ifndef OPENSSL_NO_CAMELLIA
998. Camellia_set_key(key16, 128, &camellia_ks1);
^
999. Camellia_set_key(ckey24, 192, &camellia_ks2);
1000. Camellia_set_key(ckey32, 256, &camellia_ks3);
crypto/camellia/cmll_misc.c:56:1: Parameter `*userKey`
54. #include "cmll_locl.h"
55.
56. > int Camellia_set_key(const unsigned char *userKey, const int bits,
57. CAMELLIA_KEY *key)
58. {
crypto/camellia/cmll_misc.c:63:25: Call
61. if (bits != 128 && bits != 192 && bits != 256)
62. return -2;
63. key->grand_rounds = Camellia_Ekeygen(bits, userKey, key->u.rd_key);
^
64. return 0;
65. }
crypto/camellia/camellia.c:363:1: <Length trace>
361. } while (0)
362.
363. > int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k)
364. {
365. register u32 s0, s1, s2, s3;
crypto/camellia/camellia.c:363:1: Parameter `*rawKey`
361. } while (0)
362.
363. > int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k)
364. {
365. register u32 s0, s1, s2, s3;
crypto/camellia/camellia.c:380:26: Array access: Offset: 31 (⇐ 28 + 3) Size: 16 by call to `Camellia_set_key`
378. } else {
379. k[10] = s2 = GETU32(rawKey + 24);
380. k[11] = s3 = GETU32(rawKey + 28);
^
381. }
382. s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];
|
https://github.com/openssl/openssl/blob/1dce6c3f9eef0da2866b82d816dc945883427060/crypto/camellia/camellia.c/#L380
|
d2a_code_trace_data_44633
|
static int client_hello_select_server_ctx(SSL *s, void *arg, int ignore)
{
const char *servername;
const unsigned char *p;
size_t len, remaining;
HANDSHAKE_EX_DATA *ex_data =
(HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,
&remaining) ||
remaining <= 2)
return 0;
len = (*(p++) << 8);
len += *(p++);
if (len + 2 != remaining)
return 0;
remaining = len;
if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
return 0;
remaining--;
if (remaining <= 2)
return 0;
len = (*(p++) << 8);
len += *(p++);
if (len + 2 > remaining)
return 0;
remaining = len;
servername = (const char *)p;
if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
SSL_CTX *new_ctx = arg;
SSL_set_SSL_CTX(s, new_ctx);
SSL_clear_options(s, 0xFFFFFFFFL);
SSL_set_options(s, SSL_CTX_get_options(new_ctx));
ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;
return 1;
} else if (len == strlen("server1") &&
strncmp(servername, "server1", len) == 0) {
ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
return 1;
} else if (ignore) {
ex_data->servername = SSL_TEST_SERVERNAME_SERVER1;
return 1;
}
return 0;
}
test/handshake_helper.c:192: error: NULL_DEREFERENCE
pointer `ex_data` last assigned on line 147 could be null and is dereferenced at line 192, column 9.
Showing all 71 steps of the trace
test/handshake_helper.c:142:1: start of procedure client_hello_select_server_ctx()
140. }
141.
142. > static int client_hello_select_server_ctx(SSL *s, void *arg, int ignore)
143. {
144. const char *servername;
test/handshake_helper.c:147:5:
145. const unsigned char *p;
146. size_t len, remaining;
147. > HANDSHAKE_EX_DATA *ex_data =
148. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
149.
ssl/ssl_lib.c:4014:1: start of procedure SSL_get_ex_data()
4012. }
4013.
4014. > void *SSL_get_ex_data(const SSL *s, int idx)
4015. {
4016. return CRYPTO_get_ex_data(&s->ex_data, idx);
ssl/ssl_lib.c:4016:5:
4014. void *SSL_get_ex_data(const SSL *s, int idx)
4015. {
4016. > return CRYPTO_get_ex_data(&s->ex_data, idx);
4017. }
4018.
crypto/ex_data.c:393:1: start of procedure CRYPTO_get_ex_data()
391. * particular index in the class used by this variable
392. */
393. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
crypto/ex_data.c:395:9: Taking true branch
393. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
^
396. return NULL;
397. return sk_void_value(ad->sk, idx);
crypto/ex_data.c:396:9:
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
396. > return NULL;
397. return sk_void_value(ad->sk, idx);
398. }
crypto/ex_data.c:398:1: return from a call to CRYPTO_get_ex_data
396. return NULL;
397. return sk_void_value(ad->sk, idx);
398. > }
ssl/ssl_lib.c:4017:1: return from a call to SSL_get_ex_data
4015. {
4016. return CRYPTO_get_ex_data(&s->ex_data, idx);
4017. > }
4018.
4019. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)
test/handshake_helper.c:154:10: Taking false branch
152. * was written, so parsing the normal case is a bit complex.
153. */
154. if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,
^
155. &remaining) ||
156. remaining <= 2)
test/handshake_helper.c:156:9: Taking false branch
154. if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p,
155. &remaining) ||
156. remaining <= 2)
^
157. return 0;
158. /* Extract the length of the supplied list of names. */
test/handshake_helper.c:159:5:
157. return 0;
158. /* Extract the length of the supplied list of names. */
159. > len = (*(p++) << 8);
160. len += *(p++);
161. if (len + 2 != remaining)
test/handshake_helper.c:160:5:
158. /* Extract the length of the supplied list of names. */
159. len = (*(p++) << 8);
160. > len += *(p++);
161. if (len + 2 != remaining)
162. return 0;
test/handshake_helper.c:161:9: Taking false branch
159. len = (*(p++) << 8);
160. len += *(p++);
161. if (len + 2 != remaining)
^
162. return 0;
163. remaining = len;
test/handshake_helper.c:163:5:
161. if (len + 2 != remaining)
162. return 0;
163. > remaining = len;
164. /*
165. * The list in practice only has a single element, so we only consider
test/handshake_helper.c:168:9: Taking false branch
166. * the first one.
167. */
168. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
^
169. return 0;
170. remaining--;
test/handshake_helper.c:168:27: Taking false branch
166. * the first one.
167. */
168. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
^
169. return 0;
170. remaining--;
test/handshake_helper.c:170:5:
168. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name)
169. return 0;
170. > remaining--;
171. /* Now we can finally pull out the byte array with the actual hostname. */
172. if (remaining <= 2)
test/handshake_helper.c:172:9: Taking false branch
170. remaining--;
171. /* Now we can finally pull out the byte array with the actual hostname. */
172. if (remaining <= 2)
^
173. return 0;
174. len = (*(p++) << 8);
test/handshake_helper.c:174:5:
172. if (remaining <= 2)
173. return 0;
174. > len = (*(p++) << 8);
175. len += *(p++);
176. if (len + 2 > remaining)
test/handshake_helper.c:175:5:
173. return 0;
174. len = (*(p++) << 8);
175. > len += *(p++);
176. if (len + 2 > remaining)
177. return 0;
test/handshake_helper.c:176:9: Taking false branch
174. len = (*(p++) << 8);
175. len += *(p++);
176. if (len + 2 > remaining)
^
177. return 0;
178. remaining = len;
test/handshake_helper.c:178:5:
176. if (len + 2 > remaining)
177. return 0;
178. > remaining = len;
179. servername = (const char *)p;
180.
test/handshake_helper.c:179:5:
177. return 0;
178. remaining = len;
179. > servername = (const char *)p;
180.
181. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
test/handshake_helper.c:181:9: Taking true branch
179. servername = (const char *)p;
180.
181. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
^
182. SSL_CTX *new_ctx = arg;
183. SSL_set_SSL_CTX(s, new_ctx);
test/handshake_helper.c:181:37: Taking true branch
179. servername = (const char *)p;
180.
181. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
^
182. SSL_CTX *new_ctx = arg;
183. SSL_set_SSL_CTX(s, new_ctx);
test/handshake_helper.c:182:9:
180.
181. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
182. > SSL_CTX *new_ctx = arg;
183. SSL_set_SSL_CTX(s, new_ctx);
184. /*
test/handshake_helper.c:183:9:
181. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) {
182. SSL_CTX *new_ctx = arg;
183. > SSL_set_SSL_CTX(s, new_ctx);
184. /*
185. * Copy over all the SSL_CTX options - reasonable behavior
ssl/ssl_lib.c:3851:1: start of procedure SSL_set_SSL_CTX()
3849. }
3850.
3851. > SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx)
3852. {
3853. CERT *new_cert;
ssl/ssl_lib.c:3854:9: Taking false branch
3852. {
3853. CERT *new_cert;
3854. if (ssl->ctx == ctx)
^
3855. return ssl->ctx;
3856. if (ctx == NULL)
ssl/ssl_lib.c:3856:9: Taking false branch
3854. if (ssl->ctx == ctx)
3855. return ssl->ctx;
3856. if (ctx == NULL)
^
3857. ctx = ssl->session_ctx;
3858. new_cert = ssl_cert_dup(ctx->cert);
ssl/ssl_lib.c:3858:5: Skipping ssl_cert_dup(): empty list of specs
3856. if (ctx == NULL)
3857. ctx = ssl->session_ctx;
3858. new_cert = ssl_cert_dup(ctx->cert);
^
3859. if (new_cert == NULL) {
3860. return NULL;
ssl/ssl_lib.c:3859:9: Taking false branch
3857. ctx = ssl->session_ctx;
3858. new_cert = ssl_cert_dup(ctx->cert);
3859. if (new_cert == NULL) {
^
3860. return NULL;
3861. }
ssl/ssl_lib.c:3863:10: Taking false branch
3861. }
3862.
3863. if (!custom_exts_copy_flags(&new_cert->custext, &ssl->cert->custext)) {
^
3864. ssl_cert_free(new_cert);
3865. return NULL;
ssl/ssl_lib.c:3868:5:
3866. }
3867.
3868. > ssl_cert_free(ssl->cert);
3869. ssl->cert = new_cert;
3870.
ssl/ssl_cert.c:224:1: start of procedure ssl_cert_free()
222. }
223.
224. > void ssl_cert_free(CERT *c)
225. {
226. int i;
ssl/ssl_cert.c:228:9: Taking true branch
226. int i;
227.
228. if (c == NULL)
^
229. return;
230.
ssl/ssl_cert.c:229:9:
227.
228. if (c == NULL)
229. > return;
230.
231. CRYPTO_DOWN_REF(&c->references, &i, c->lock);
ssl/ssl_cert.c:254:1: return from a call to ssl_cert_free
252. CRYPTO_THREAD_lock_free(c->lock);
253. OPENSSL_free(c);
254. > }
255.
256. int ssl_cert_set0_chain(SSL *s, SSL_CTX *ctx, STACK_OF(X509) *chain)
ssl/ssl_lib.c:3869:5:
3867.
3868. ssl_cert_free(ssl->cert);
3869. > ssl->cert = new_cert;
3870.
3871. /*
ssl/ssl_lib.c:3875:10: Condition is true
3873. * so setter APIs must prevent invalid lengths from entering the system.
3874. */
3875. if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)))
^
3876. return NULL;
3877.
ssl/ssl_lib.c:3875:10: Taking false branch
3873. * so setter APIs must prevent invalid lengths from entering the system.
3874. */
3875. if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)))
^
3876. return NULL;
3877.
ssl/ssl_lib.c:3884:10: Taking false branch
3882. * leave it unchanged.
3883. */
3884. if ((ssl->ctx != NULL) &&
^
3885. (ssl->sid_ctx_length == ssl->ctx->sid_ctx_length) &&
3886. (memcmp(ssl->sid_ctx, ssl->ctx->sid_ctx, ssl->sid_ctx_length) == 0)) {
ssl/ssl_lib.c:3891:5:
3889. }
3890.
3891. > SSL_CTX_up_ref(ctx);
3892. SSL_CTX_free(ssl->ctx); /* decrement reference count */
3893. ssl->ctx = ctx;
ssl/ssl_lib.c:3005:1: start of procedure SSL_CTX_up_ref()
3003. }
3004.
3005. > int SSL_CTX_up_ref(SSL_CTX *ctx)
3006. {
3007. int i;
ssl/ssl_lib.c:3009:9:
3007. int i;
3008.
3009. > if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0)
3010. return 0;
3011.
include/internal/refcount.h:32:1: start of procedure CRYPTO_UP_REF()
30. typedef _Atomic int CRYPTO_REF_COUNT;
31.
32. > static ossl_inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock)
33. {
34. *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;
include/internal/refcount.h:34:5:
32. static ossl_inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock)
33. {
34. > *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;
35. return 1;
36. }
include/internal/refcount.h:35:5:
33. {
34. *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;
35. > return 1;
36. }
37.
include/internal/refcount.h:36:1: return from a call to CRYPTO_UP_REF
34. *ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1;
35. return 1;
36. > }
37.
38. static ossl_inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret, void *lock)
ssl/ssl_lib.c:3009:9: Taking false branch
3007. int i;
3008.
3009. if (CRYPTO_UP_REF(&ctx->references, &i, ctx->lock) <= 0)
^
3010. return 0;
3011.
ssl/ssl_lib.c:3014:14: Condition is false
3012. REF_PRINT_COUNT("SSL_CTX", ctx);
3013. REF_ASSERT_ISNT(i < 2);
3014. return ((i > 1) ? 1 : 0);
^
3015. }
3016.
ssl/ssl_lib.c:3014:13:
3012. REF_PRINT_COUNT("SSL_CTX", ctx);
3013. REF_ASSERT_ISNT(i < 2);
3014. > return ((i > 1) ? 1 : 0);
3015. }
3016.
ssl/ssl_lib.c:3014:5:
3012. REF_PRINT_COUNT("SSL_CTX", ctx);
3013. REF_ASSERT_ISNT(i < 2);
3014. > return ((i > 1) ? 1 : 0);
3015. }
3016.
ssl/ssl_lib.c:3015:1: return from a call to SSL_CTX_up_ref
3013. REF_ASSERT_ISNT(i < 2);
3014. return ((i > 1) ? 1 : 0);
3015. > }
3016.
3017. void SSL_CTX_free(SSL_CTX *a)
ssl/ssl_lib.c:3892:5: Skipping SSL_CTX_free(): empty list of specs
3890.
3891. SSL_CTX_up_ref(ctx);
3892. SSL_CTX_free(ssl->ctx); /* decrement reference count */
^
3893. ssl->ctx = ctx;
3894.
ssl/ssl_lib.c:3893:5:
3891. SSL_CTX_up_ref(ctx);
3892. SSL_CTX_free(ssl->ctx); /* decrement reference count */
3893. > ssl->ctx = ctx;
3894.
3895. return ssl->ctx;
ssl/ssl_lib.c:3895:5:
3893. ssl->ctx = ctx;
3894.
3895. > return ssl->ctx;
3896. }
3897.
ssl/ssl_lib.c:3896:1: return from a call to SSL_set_SSL_CTX
3894.
3895. return ssl->ctx;
3896. > }
3897.
3898. int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx)
test/handshake_helper.c:189:9:
187. * contexts differ/conflict
188. */
189. > SSL_clear_options(s, 0xFFFFFFFFL);
190. SSL_set_options(s, SSL_CTX_get_options(new_ctx));
191.
ssl/ssl_lib.c:4438:1: start of procedure SSL_clear_options()
4436. }
4437.
4438. > unsigned long SSL_clear_options(SSL *s, unsigned long op)
4439. {
4440. return s->options &= ~op;
ssl/ssl_lib.c:4440:5:
4438. unsigned long SSL_clear_options(SSL *s, unsigned long op)
4439. {
4440. > return s->options &= ~op;
4441. }
4442.
ssl/ssl_lib.c:4441:1: return from a call to SSL_clear_options
4439. {
4440. return s->options &= ~op;
4441. > }
4442.
4443. STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s)
test/handshake_helper.c:190:9:
188. */
189. SSL_clear_options(s, 0xFFFFFFFFL);
190. > SSL_set_options(s, SSL_CTX_get_options(new_ctx));
191.
192. ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;
ssl/ssl_lib.c:4413:1: start of procedure SSL_CTX_get_options()
4411. * control interface.
4412. */
4413. > unsigned long SSL_CTX_get_options(const SSL_CTX *ctx)
4414. {
4415. return ctx->options;
ssl/ssl_lib.c:4415:5:
4413. unsigned long SSL_CTX_get_options(const SSL_CTX *ctx)
4414. {
4415. > return ctx->options;
4416. }
4417.
ssl/ssl_lib.c:4416:1: return from a call to SSL_CTX_get_options
4414. {
4415. return ctx->options;
4416. > }
4417.
4418. unsigned long SSL_get_options(const SSL *s)
ssl/ssl_lib.c:4428:1: start of procedure SSL_set_options()
4426. }
4427.
4428. > unsigned long SSL_set_options(SSL *s, unsigned long op)
4429. {
4430. return s->options |= op;
ssl/ssl_lib.c:4430:5:
4428. unsigned long SSL_set_options(SSL *s, unsigned long op)
4429. {
4430. > return s->options |= op;
4431. }
4432.
ssl/ssl_lib.c:4431:1: return from a call to SSL_set_options
4429. {
4430. return s->options |= op;
4431. > }
4432.
4433. unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op)
test/handshake_helper.c:192:9:
190. SSL_set_options(s, SSL_CTX_get_options(new_ctx));
191.
192. > ex_data->servername = SSL_TEST_SERVERNAME_SERVER2;
193. return 1;
194. } else if (len == strlen("server1") &&
|
https://github.com/openssl/openssl/blob/e43e6b1951de931ca500c6964496e76651332f5e/test/handshake_helper.c/#L192
|
d2a_code_trace_data_44634
|
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
{
PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
(diff > (0 - (PTRDIFF_T)len)));
return overlapped;
}
ssl/statem/statem_srvr.c:3350: error: INTEGER_OVERFLOW_L2
(0 - [-oo, 65280]):unsigned64 by call to `EVP_EncryptUpdate`.
Showing all 9 steps of the trace
ssl/statem/statem_srvr.c:3242:17: Call
3240.
3241. /* get session encoding length */
3242. slen_full = i2d_SSL_SESSION(s->session, NULL);
^
3243. /*
3244. * Some length values are 16 bits, so forget it if session is too
ssl/ssl_asn1.c:149:9: Assignment
147.
148. if ((in == NULL) || ((in->cipher == NULL) && (in->cipher_id == 0)))
149. return 0;
^
150.
151. memset(&as, 0, sizeof(as));
ssl/statem/statem_srvr.c:3242:5: Assignment
3240.
3241. /* get session encoding length */
3242. slen_full = i2d_SSL_SESSION(s->session, NULL);
^
3243. /*
3244. * Some length values are 16 bits, so forget it if session is too
ssl/statem/statem_srvr.c:3350:17: Call
3348. &encdata1)
3349. /* Encrypt session data */
3350. || !EVP_EncryptUpdate(ctx, encdata1, &len, senc, slen)
^
3351. || !WPACKET_allocate_bytes(pkt, len, &encdata2)
3352. || encdata1 != encdata2
crypto/evp/evp_enc.c:293:1: Parameter `inl`
291. }
292.
293. > int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
294. const unsigned char *in, int inl)
295. {
crypto/evp/evp_enc.c:302:24: Call
300. if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
301. /* If block size > 1 then the cipher will have to do this check */
302. if (bl == 1 && is_partially_overlapping(out, in, inl)) {
^
303. EVPerr(EVP_F_EVP_ENCRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING);
304. return 0;
crypto/evp/evp_enc.c:279:1: <RHS trace>
277. #endif
278.
279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
280. {
281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:279:1: Parameter `len`
277. #endif
278.
279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
280. {
281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:288:50: Binary operation: (0 - [-oo, 65280]):unsigned64 by call to `EVP_EncryptUpdate`
286. */
287. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
288. (diff > (0 - (PTRDIFF_T)len)));
^
289.
290. return overlapped;
|
https://github.com/openssl/openssl/blob/4086b42b2d58773bee8463f69eee4bf8c299b589/crypto/evp/evp_enc.c/#L288
|
d2a_code_trace_data_44635
|
void avformat_close_input(AVFormatContext **ps)
{
AVFormatContext *s = *ps;
AVIOContext *pb = s->pb;
if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
(s->flags & AVFMT_FLAG_CUSTOM_IO))
pb = NULL;
flush_packet_queue(s);
if (s->iformat)
if (s->iformat->read_close)
s->iformat->read_close(s);
avformat_free_context(s);
*ps = NULL;
avio_close(pb);
}
libavformat/utils.c:2506: error: Null Dereference
pointer `pb` last assigned on line 2494 could be null and is dereferenced by call to `avio_close()` at line 2506, column 5.
libavformat/utils.c:2487:1: start of procedure avformat_close_input()
2485. }
2486.
2487. void avformat_close_input(AVFormatContext **ps)
^
2488. {
2489. AVFormatContext *s = *ps;
libavformat/utils.c:2489:5:
2487. void avformat_close_input(AVFormatContext **ps)
2488. {
2489. AVFormatContext *s = *ps;
^
2490. AVIOContext *pb = s->pb;
2491.
libavformat/utils.c:2490:5:
2488. {
2489. AVFormatContext *s = *ps;
2490. AVIOContext *pb = s->pb;
^
2491.
2492. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
libavformat/utils.c:2492:10: Taking true branch
2490. AVIOContext *pb = s->pb;
2491.
2492. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
^
2493. (s->flags & AVFMT_FLAG_CUSTOM_IO))
2494. pb = NULL;
libavformat/utils.c:2492:24: Taking false branch
2490. AVIOContext *pb = s->pb;
2491.
2492. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
^
2493. (s->flags & AVFMT_FLAG_CUSTOM_IO))
2494. pb = NULL;
libavformat/utils.c:2493:10: Taking true branch
2491.
2492. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2493. (s->flags & AVFMT_FLAG_CUSTOM_IO))
^
2494. pb = NULL;
2495.
libavformat/utils.c:2494:9:
2492. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
2493. (s->flags & AVFMT_FLAG_CUSTOM_IO))
2494. pb = NULL;
^
2495.
2496. flush_packet_queue(s);
libavformat/utils.c:2496:5: Skipping flush_packet_queue(): empty list of specs
2494. pb = NULL;
2495.
2496. flush_packet_queue(s);
^
2497.
2498. if (s->iformat)
libavformat/utils.c:2498:9: Taking true branch
2496. flush_packet_queue(s);
2497.
2498. if (s->iformat)
^
2499. if (s->iformat->read_close)
2500. s->iformat->read_close(s);
libavformat/utils.c:2499:13: Taking true branch
2497.
2498. if (s->iformat)
2499. if (s->iformat->read_close)
^
2500. s->iformat->read_close(s);
2501.
libavformat/utils.c:2500:13: Skipping __function_pointer__(): unresolved function pointer
2498. if (s->iformat)
2499. if (s->iformat->read_close)
2500. s->iformat->read_close(s);
^
2501.
2502. avformat_free_context(s);
libavformat/utils.c:2502:5: Skipping avformat_free_context(): empty list of specs
2500. s->iformat->read_close(s);
2501.
2502. avformat_free_context(s);
^
2503.
2504. *ps = NULL;
libavformat/utils.c:2504:5:
2502. avformat_free_context(s);
2503.
2504. *ps = NULL;
^
2505.
2506. avio_close(pb);
libavformat/utils.c:2506:5:
2504. *ps = NULL;
2505.
2506. avio_close(pb);
^
2507. }
2508.
libavformat/aviobuf.c:800:1: start of procedure avio_close()
798. }
799.
800. int avio_close(AVIOContext *s)
^
801. {
802. URLContext *h;
libavformat/aviobuf.c:804:10: Taking false branch
802. URLContext *h;
803.
804. if (!s)
^
805. return 0;
806.
libavformat/aviobuf.c:807:5:
805. return 0;
806.
807. avio_flush(s);
^
808. h = s->opaque;
809. av_freep(&s->buffer);
libavformat/aviobuf.c:180:1: start of procedure avio_flush()
178. }
179.
180. void avio_flush(AVIOContext *s)
^
181. {
182. flush_buffer(s);
libavformat/aviobuf.c:182:5:
180. void avio_flush(AVIOContext *s)
181. {
182. flush_buffer(s);
^
183. s->must_flush = 0;
184. }
libavformat/aviobuf.c:124:1: start of procedure flush_buffer()
122. }
123.
124. static void flush_buffer(AVIOContext *s)
^
125. {
126. if (s->buf_ptr > s->buffer) {
libavformat/aviobuf.c:126:9:
124. static void flush_buffer(AVIOContext *s)
125. {
126. if (s->buf_ptr > s->buffer) {
^
127. if (s->write_packet && !s->error) {
128. int ret = s->write_packet(s->opaque, s->buffer,
|
https://github.com/libav/libav/blob/a0ce85ac7de098d3f9b53b51b77a09bad700a011/libavformat/utils.c/#L2506
|
d2a_code_trace_data_44636
|
int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
const unsigned char *salt, const unsigned char *data,
int datal, int count, unsigned char *key,
unsigned char *iv)
{
EVP_MD_CTX *c;
unsigned char md_buf[EVP_MAX_MD_SIZE];
int niv, nkey, addmd = 0;
unsigned int mds = 0, i;
int rv = 0;
nkey = EVP_CIPHER_key_length(type);
niv = EVP_CIPHER_iv_length(type);
OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);
OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);
if (data == NULL)
return (nkey);
c = EVP_MD_CTX_new();
if (c == NULL)
goto err;
for (;;) {
if (!EVP_DigestInit_ex(c, md, NULL))
goto err;
if (addmd++)
if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
goto err;
if (!EVP_DigestUpdate(c, data, datal))
goto err;
if (salt != NULL)
if (!EVP_DigestUpdate(c, salt, PKCS5_SALT_LEN))
goto err;
if (!EVP_DigestFinal_ex(c, &(md_buf[0]), &mds))
goto err;
for (i = 1; i < (unsigned int)count; i++) {
if (!EVP_DigestInit_ex(c, md, NULL))
goto err;
if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
goto err;
if (!EVP_DigestFinal_ex(c, &(md_buf[0]), &mds))
goto err;
}
i = 0;
if (nkey) {
for (;;) {
if (nkey == 0)
break;
if (i == mds)
break;
if (key != NULL)
*(key++) = md_buf[i];
nkey--;
i++;
}
}
if (niv && (i != mds)) {
for (;;) {
if (niv == 0)
break;
if (i == mds)
break;
if (iv != NULL)
*(iv++) = md_buf[i];
niv--;
i++;
}
}
if ((nkey == 0) && (niv == 0))
break;
}
rv = EVP_CIPHER_key_length(type);
err:
EVP_MD_CTX_free(c);
OPENSSL_cleanse(md_buf, sizeof(md_buf));
return rv;
}
crypto/evp/evp_key.c:147: error: MEMORY_LEAK
memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 92, column 9 is not reachable after line 147, column 5.
Showing all 56 steps of the trace
crypto/evp/evp_key.c:74:1: start of procedure EVP_BytesToKey()
72. }
73.
74. > int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
75. const unsigned char *salt, const unsigned char *data,
76. int datal, int count, unsigned char *key,
crypto/evp/evp_key.c:81:5:
79. EVP_MD_CTX *c;
80. unsigned char md_buf[EVP_MAX_MD_SIZE];
81. > int niv, nkey, addmd = 0;
82. unsigned int mds = 0, i;
83. int rv = 0;
crypto/evp/evp_key.c:82:5:
80. unsigned char md_buf[EVP_MAX_MD_SIZE];
81. int niv, nkey, addmd = 0;
82. > unsigned int mds = 0, i;
83. int rv = 0;
84. nkey = EVP_CIPHER_key_length(type);
crypto/evp/evp_key.c:83:5:
81. int niv, nkey, addmd = 0;
82. unsigned int mds = 0, i;
83. > int rv = 0;
84. nkey = EVP_CIPHER_key_length(type);
85. niv = EVP_CIPHER_iv_length(type);
crypto/evp/evp_key.c:84:5:
82. unsigned int mds = 0, i;
83. int rv = 0;
84. > nkey = EVP_CIPHER_key_length(type);
85. niv = EVP_CIPHER_iv_length(type);
86. OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);
crypto/evp/evp_lib.c:266:1: start of procedure EVP_CIPHER_key_length()
264. }
265.
266. > int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
267. {
268. return cipher->key_len;
crypto/evp/evp_lib.c:268:5:
266. int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
267. {
268. > return cipher->key_len;
269. }
270.
crypto/evp/evp_lib.c:269:1: return from a call to EVP_CIPHER_key_length
267. {
268. return cipher->key_len;
269. > }
270.
271. int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)
crypto/evp/evp_key.c:85:5:
83. int rv = 0;
84. nkey = EVP_CIPHER_key_length(type);
85. > niv = EVP_CIPHER_iv_length(type);
86. OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);
87. OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);
crypto/evp/evp_lib.c:226:1: start of procedure EVP_CIPHER_iv_length()
224. }
225.
226. > int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
227. {
228. return cipher->iv_len;
crypto/evp/evp_lib.c:228:5:
226. int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
227. {
228. > return cipher->iv_len;
229. }
230.
crypto/evp/evp_lib.c:229:1: return from a call to EVP_CIPHER_iv_length
227. {
228. return cipher->iv_len;
229. > }
230.
231. int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
crypto/evp/evp_key.c:86:5: Condition is true
84. nkey = EVP_CIPHER_key_length(type);
85. niv = EVP_CIPHER_iv_length(type);
86. OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);
^
87. OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);
88.
crypto/evp/evp_key.c:87:5: Condition is true
85. niv = EVP_CIPHER_iv_length(type);
86. OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH);
87. OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);
^
88.
89. if (data == NULL)
crypto/evp/evp_key.c:89:9: Taking false branch
87. OPENSSL_assert(niv <= EVP_MAX_IV_LENGTH);
88.
89. if (data == NULL)
^
90. return (nkey);
91.
crypto/evp/evp_key.c:92:5:
90. return (nkey);
91.
92. > c = EVP_MD_CTX_new();
93. if (c == NULL)
94. goto err;
crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new()
42. }
43.
44. > EVP_MD_CTX *EVP_MD_CTX_new(void)
45. {
46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
crypto/evp/digest.c:46:5:
44. EVP_MD_CTX *EVP_MD_CTX_new(void)
45. {
46. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
47. }
48.
crypto/mem.c:197:1: start of procedure CRYPTO_zalloc()
195. }
196.
197. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
198. {
199. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:199:5:
197. void *CRYPTO_zalloc(size_t num, const char *file, int line)
198. {
199. > void *ret = CRYPTO_malloc(num, file, line);
200.
201. FAILTEST();
crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
167. #endif
168.
169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
170. {
171. void *ret = NULL;
crypto/mem.c:171:5:
169. void *CRYPTO_malloc(size_t num, const char *file, int line)
170. {
171. > void *ret = NULL;
172.
173. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:173:9: Taking false branch
171. void *ret = NULL;
172.
173. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
174. return malloc_impl(num, file, line);
175.
crypto/mem.c:176:9: Taking false branch
174. return malloc_impl(num, file, line);
175.
176. if (num == 0)
^
177. return NULL;
178.
crypto/mem.c:180:5:
178.
179. FAILTEST();
180. > allow_customize = 0;
181. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
182. if (call_malloc_debug) {
crypto/mem.c:190:5:
188. }
189. #else
190. > osslargused(file); osslargused(line);
191. ret = malloc(num);
192. #endif
crypto/mem.c:190:24:
188. }
189. #else
190. > osslargused(file); osslargused(line);
191. ret = malloc(num);
192. #endif
crypto/mem.c:191:5:
189. #else
190. osslargused(file); osslargused(line);
191. > ret = malloc(num);
192. #endif
193.
crypto/mem.c:194:5:
192. #endif
193.
194. > return ret;
195. }
196.
crypto/mem.c:195:1: return from a call to CRYPTO_malloc
193.
194. return ret;
195. > }
196.
197. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:202:9: Taking true branch
200.
201. FAILTEST();
202. if (ret != NULL)
^
203. memset(ret, 0, num);
204. return ret;
crypto/mem.c:203:9:
201. FAILTEST();
202. if (ret != NULL)
203. > memset(ret, 0, num);
204. return ret;
205. }
crypto/mem.c:204:5:
202. if (ret != NULL)
203. memset(ret, 0, num);
204. > return ret;
205. }
206.
crypto/mem.c:205:1: return from a call to CRYPTO_zalloc
203. memset(ret, 0, num);
204. return ret;
205. > }
206.
207. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new
45. {
46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
47. > }
48.
49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
crypto/evp/evp_key.c:93:9: Taking false branch
91.
92. c = EVP_MD_CTX_new();
93. if (c == NULL)
^
94. goto err;
95. for (;;) {
crypto/evp/evp_key.c:144:5: Loop condition is true. Entering loop body
142. if ((nkey == 0) && (niv == 0))
143. break;
144. }
^
145. rv = EVP_CIPHER_key_length(type);
146. err:
crypto/evp/evp_key.c:96:14: Taking false branch
94. goto err;
95. for (;;) {
96. if (!EVP_DigestInit_ex(c, md, NULL))
^
97. goto err;
98. if (addmd++)
crypto/evp/evp_key.c:98:13: Taking false branch
96. if (!EVP_DigestInit_ex(c, md, NULL))
97. goto err;
98. if (addmd++)
^
99. if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
100. goto err;
crypto/evp/evp_key.c:101:14:
99. if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
100. goto err;
101. > if (!EVP_DigestUpdate(c, data, datal))
102. goto err;
103. if (salt != NULL)
crypto/evp/digest.c:146:1: start of procedure EVP_DigestUpdate()
144. }
145.
146. > int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
147. {
148. return ctx->update(ctx, data, count);
crypto/evp/digest.c:148:5: Skipping __function_pointer__(): unresolved function pointer
146. int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count)
147. {
148. return ctx->update(ctx, data, count);
^
149. }
150.
crypto/evp/digest.c:149:1: return from a call to EVP_DigestUpdate
147. {
148. return ctx->update(ctx, data, count);
149. > }
150.
151. /* The caller can assume that this removes any secret data from the context */
crypto/evp/evp_key.c:101:14: Taking true branch
99. if (!EVP_DigestUpdate(c, &(md_buf[0]), mds))
100. goto err;
101. if (!EVP_DigestUpdate(c, data, datal))
^
102. goto err;
103. if (salt != NULL)
crypto/evp/evp_key.c:146:2:
144. }
145. rv = EVP_CIPHER_key_length(type);
146. > err:
147. EVP_MD_CTX_free(c);
148. OPENSSL_cleanse(md_buf, sizeof(md_buf));
crypto/evp/evp_key.c:147:5:
145. rv = EVP_CIPHER_key_length(type);
146. err:
147. > EVP_MD_CTX_free(c);
148. OPENSSL_cleanse(md_buf, sizeof(md_buf));
149. return rv;
crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free()
47. }
48.
49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
50. {
51. EVP_MD_CTX_reset(ctx);
crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs
49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
50. {
51. EVP_MD_CTX_reset(ctx);
^
52. OPENSSL_free(ctx);
53. }
crypto/evp/digest.c:52:5:
50. {
51. EVP_MD_CTX_reset(ctx);
52. > OPENSSL_free(ctx);
53. }
54.
crypto/mem.c:264:1: start of procedure CRYPTO_free()
262. }
263.
264. > void CRYPTO_free(void *str, const char *file, int line)
265. {
266. if (free_impl != NULL && free_impl != &CRYPTO_free) {
crypto/mem.c:266:9: Taking true branch
264. void CRYPTO_free(void *str, const char *file, int line)
265. {
266. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
267. free_impl(str, file, line);
268. return;
crypto/mem.c:266:30: Taking true branch
264. void CRYPTO_free(void *str, const char *file, int line)
265. {
266. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
267. free_impl(str, file, line);
268. return;
crypto/mem.c:267:9: Skipping __function_pointer__(): unresolved function pointer
265. {
266. if (free_impl != NULL && free_impl != &CRYPTO_free) {
267. free_impl(str, file, line);
^
268. return;
269. }
crypto/mem.c:268:9:
266. if (free_impl != NULL && free_impl != &CRYPTO_free) {
267. free_impl(str, file, line);
268. > return;
269. }
270.
crypto/mem.c:282:1: return from a call to CRYPTO_free
280. free(str);
281. #endif
282. > }
283.
284. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free
51. EVP_MD_CTX_reset(ctx);
52. OPENSSL_free(ctx);
53. > }
54.
55. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
|
https://github.com/openssl/openssl/blob/810ef917070902f729e3913f1656371c9b0855f8/crypto/evp/evp_key.c/#L147
|
d2a_code_trace_data_44637
|
int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
{
int i;
BN_ULONG aa, bb;
aa = a[n - 1];
bb = b[n - 1];
if (aa != bb)
return ((aa > bb) ? 1 : -1);
for (i = n - 2; i >= 0; i--) {
aa = a[i];
bb = b[i];
if (aa != bb)
return ((aa > bb) ? 1 : -1);
}
return (0);
}
test/bntest.c:1795: error: BUFFER_OVERRUN_L3
Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mul`.
Showing all 17 steps of the trace
test/bntest.c:1791:10: Call
1789.
1790. /* Test that BN_mul never gives negative zero. */
1791. if (!TEST_true(BN_set_word(a, 1)))
^
1792. goto err;
1793. BN_set_negative(a, 1);
crypto/bn/bn_lib.c:395:1: Parameter `*a->d`
393. }
394.
395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
396. {
397. bn_check_top(a);
crypto/bn/bn_lib.c:398:9: Call
396. {
397. bn_check_top(a);
398. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
399. return (0);
400. a->neg = 0;
crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
659.
660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
661. {
662. if (bits > (INT_MAX - BN_BITS2 + 1))
test/bntest.c:1795:10: Call
1793. BN_set_negative(a, 1);
1794. BN_zero(b);
1795. if (!TEST_true(BN_mul(c, a, b, ctx)))
^
1796. goto err;
1797. if (!TEST_BN_eq_zero(c)
crypto/bn/bn_mul.c:495:1: Parameter `*b->d`
493. #endif /* BN_RECURSION */
494.
495. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
496. {
497. int ret = 0;
crypto/bn/bn_mul.c:575:17: Call
573. if (bn_wexpand(rr, k * 4) == NULL)
574. goto err;
575. bn_mul_part_recursive(rr->d, a->d, b->d,
^
576. j, al - j, bl - j, t->d);
577. } else { /* al <= j || bl <= j */
crypto/bn/bn_mul.c:320:1: Parameter `n`
318. */
319. /* tnX may not be negative but less than n */
320. > void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
321. int tna, int tnb, BN_ULONG *t)
322. {
crypto/bn/bn_mul.c:334:10: Call
332. /* r=(a[0]-a[1])*(b[1]-b[0]) */
333. c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna);
334. c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n);
^
335. neg = 0;
336. switch (c1 * 3 + c2) {
crypto/bn/bn_lib.c:735:1: Parameter `cl`
733. */
734.
735. > int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl)
736. {
737. int n, i;
crypto/bn/bn_lib.c:752:12: Call
750. }
751. }
752. return bn_cmp_words(a, b, cl);
^
753. }
754.
crypto/bn/bn_lib.c:708:1: <Offset trace>
706. }
707.
708. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
709. {
710. int i;
crypto/bn/bn_lib.c:708:1: Parameter `n`
706. }
707.
708. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
709. {
710. int i;
crypto/bn/bn_lib.c:717:10: Assignment
715. if (aa != bb)
716. return ((aa > bb) ? 1 : -1);
717. for (i = n - 2; i >= 0; i--) {
^
718. aa = a[i];
719. bb = b[i];
crypto/bn/bn_lib.c:708:1: <Length trace>
706. }
707.
708. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
709. {
710. int i;
crypto/bn/bn_lib.c:708:1: Parameter `*a`
706. }
707.
708. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
709. {
710. int i;
crypto/bn/bn_lib.c:718:14: Array access: Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mul`
716. return ((aa > bb) ? 1 : -1);
717. for (i = n - 2; i >= 0; i--) {
718. aa = a[i];
^
719. bb = b[i];
720. if (aa != bb)
|
https://github.com/openssl/openssl/blob/3f97052392cb10fca5309212bf720685262ad4a6/crypto/bn/bn_lib.c/#L718
|
d2a_code_trace_data_44638
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/dh/dh_check.c:125: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`.
Showing all 33 steps of the trace
crypto/dh/dh_check.c:112:5: Call
110. if (ctx == NULL)
111. goto err;
112. BN_CTX_start(ctx);
^
113. t1 = BN_CTX_get(ctx);
114. t2 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/dh/dh_check.c:125:18: Call
123. else {
124. /* Check g^q == 1 mod p */
125. if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx))
^
126. goto err;
127. if (!BN_is_one(t1))
crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth`
87. }
88.
89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
90. BN_CTX *ctx)
91. {
crypto/bn/bn_exp.c:149:15: Call
147. #ifdef RECP_MUL_MOD
148. {
149. ret = BN_mod_exp_recp(r, a, p, m, ctx);
^
150. }
151. #else
crypto/bn/bn_exp.c:161:1: Parameter `ctx->stack.depth`
159. }
160.
161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
162. const BIGNUM *m, BN_CTX *ctx)
163. {
crypto/bn/bn_exp.c:191:5: Call
189. }
190.
191. BN_CTX_start(ctx);
^
192. aa = BN_CTX_get(ctx);
193. val[0] = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_exp.c:192:10: Call
190.
191. BN_CTX_start(ctx);
192. aa = BN_CTX_get(ctx);
^
193. val[0] = BN_CTX_get(ctx);
194. if (val[0] == NULL)
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_exp.c:193:14: Call
191. BN_CTX_start(ctx);
192. aa = BN_CTX_get(ctx);
193. val[0] = BN_CTX_get(ctx);
^
194. if (val[0] == NULL)
195. goto err;
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_exp.c:210:10: Call
208. }
209.
210. if (!BN_nnmod(val[0], a, m, ctx))
^
211. goto err; /* 1 */
212. if (BN_is_zero(val[0])) {
crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_exp.c:220:14: Call
218. window = BN_window_bits_for_exponent_size(bits);
219. if (window > 1) {
220. if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx))
^
221. goto err; /* 2 */
222. j = 1 << (window - 1);
crypto/bn/bn_recp.c:55:1: Parameter `ctx->stack.depth`
53. }
54.
55. > int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
56. BN_RECP_CTX *recp, BN_CTX *ctx)
57. {
crypto/bn/bn_recp.c:62:5: Call
60. const BIGNUM *ca;
61.
62. BN_CTX_start(ctx);
^
63. if ((a = BN_CTX_get(ctx)) == NULL)
64. goto err;
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_recp.c:63:14: Call
61.
62. BN_CTX_start(ctx);
63. if ((a = BN_CTX_get(ctx)) == NULL)
^
64. goto err;
65. if (y != NULL) {
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_recp.c:77:11: Call
75. ca = x; /* Just do the mod */
76.
77. ret = BN_div_recp(NULL, r, ca, recp, ctx);
^
78. err:
79. BN_CTX_end(ctx);
crypto/bn/bn_recp.c:90:5: Call
88. BIGNUM *a, *b, *d, *r;
89.
90. BN_CTX_start(ctx);
^
91. d = (dv != NULL) ? dv : BN_CTX_get(ctx);
92. r = (rem != NULL) ? rem : BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_recp.c:101:13: Call
99. BN_zero(d);
100. if (!BN_copy(r, m)) {
101. BN_CTX_end(ctx);
^
102. return 0;
103. }
crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/bn/bn_ctx.c:191:27: Call
189. ctx->err_stack--;
190. else {
191. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
192. /* Does this stack frame have anything to release? */
193. if (fp < ctx->used)
crypto/bn/bn_ctx.c:266:1: <Offset trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: <Length trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`
266. static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
^
269. }
270.
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
|
d2a_code_trace_data_44639
|
static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
const int size, const int h, int ref_index, int src_index,
me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
MotionEstContext * const c= &s->me;
const int stride= c->stride;
const int uvstride= c->uvstride;
const int qpel= flags&FLAG_QPEL;
const int chroma= flags&FLAG_CHROMA;
const int dxy= subx + (suby<<(1+qpel));
const int hx= subx + (x<<(1+qpel));
const int hy= suby + (y<<(1+qpel));
uint8_t * const * const ref= c->ref[ref_index];
uint8_t * const * const src= c->src[src_index];
int d;
if(flags&FLAG_DIRECT){
assert(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1));
if(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)){
const int time_pp= s->pp_time;
const int time_pb= s->pb_time;
const int mask= 2*qpel+1;
if(s->mv_type==MV_TYPE_8X8){
int i;
for(i=0; i<4; i++){
int fx = c->direct_basis_mv[i][0] + hx;
int fy = c->direct_basis_mv[i][1] + hy;
int bx = hx ? fx - c->co_located_mv[i][0] : c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(qpel+4));
int by = hy ? fy - c->co_located_mv[i][1] : c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(qpel+4));
int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
uint8_t *dst= c->temp + 8*(i&1) + 8*stride*(i>>1);
if(qpel){
c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride);
c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride);
}else{
c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8);
c->hpel_avg[1][bxy](dst, ref[8] + (bx>>1) + (by>>1)*stride, stride, 8);
}
}
}else{
int fx = c->direct_basis_mv[0][0] + hx;
int fy = c->direct_basis_mv[0][1] + hy;
int bx = hx ? fx - c->co_located_mv[0][0] : (c->co_located_mv[0][0]*(time_pb - time_pp)/time_pp);
int by = hy ? fy - c->co_located_mv[0][1] : (c->co_located_mv[0][1]*(time_pb - time_pp)/time_pp);
int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
if(qpel){
c->qpel_put[1][fxy](c->temp , ref[0] + (fx>>2) + (fy>>2)*stride , stride);
c->qpel_put[1][fxy](c->temp + 8 , ref[0] + (fx>>2) + (fy>>2)*stride + 8 , stride);
c->qpel_put[1][fxy](c->temp + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8*stride, stride);
c->qpel_put[1][fxy](c->temp + 8 + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8 + 8*stride, stride);
c->qpel_avg[1][bxy](c->temp , ref[8] + (bx>>2) + (by>>2)*stride , stride);
c->qpel_avg[1][bxy](c->temp + 8 , ref[8] + (bx>>2) + (by>>2)*stride + 8 , stride);
c->qpel_avg[1][bxy](c->temp + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8*stride, stride);
c->qpel_avg[1][bxy](c->temp + 8 + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8 + 8*stride, stride);
}else{
assert((fx>>1) + 16*s->mb_x >= -16);
assert((fy>>1) + 16*s->mb_y >= -16);
assert((fx>>1) + 16*s->mb_x <= s->width);
assert((fy>>1) + 16*s->mb_y <= s->height);
assert((bx>>1) + 16*s->mb_x >= -16);
assert((by>>1) + 16*s->mb_y >= -16);
assert((bx>>1) + 16*s->mb_x <= s->width);
assert((by>>1) + 16*s->mb_y <= s->height);
c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
}
}
d = cmp_func(s, c->temp, src[0], stride, 16);
}else
d= 256*256*256*32;
}else{
int uvdxy;
if(dxy){
if(qpel){
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride);
if(chroma){
int cx= hx/2;
int cy= hy/2;
cx= (cx>>1)|(cx&1);
cy= (cy>>1)|(cy&1);
uvdxy= (cx&1) + 2*(cy&1);
}
}else{
c->hpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride, h);
if(chroma)
uvdxy= dxy | (x&1) | (2*(y&1));
}
d = cmp_func(s, c->temp, src[0], stride, h);
}else{
d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h);
if(chroma)
uvdxy= (x&1) + 2*(y&1);
}
if(chroma){
uint8_t * const uvtemp= c->temp + 16*stride;
c->hpel_put[size+1][uvdxy](uvtemp , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
d += chroma_cmp_func(s, uvtemp , src[1], uvstride, h>>1);
d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1);
}
}
#if 0
if(full_pel){
const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);
score_map[index]= d;
}
d += (c->mv_penalty[hx - c->pred_x] + c->mv_penalty[hy - c->pred_y])*c->penalty_factor;
#endif
return d;
}
libavcodec/motion_est.c:1899: error: Buffer Overrun L1
Offset: [8, 9] (⇐ [0, 1] + 8) Size: 4 by call to `interlaced_search`.
libavcodec/motion_est.c:1899:17: Call
1897. c->skip=0;
1898. c->current_mv_penalty= c->mv_penalty[s->f_code] + MAX_MV;
1899. interlaced_search(s, 0,
^
1900. s->b_field_mv_table[0], s->b_field_select_table[0],
1901. s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1], 1);
libavcodec/motion_est.c:893:1: Parameter `ref_index`
891. }
892.
893. static int interlaced_search(MpegEncContext *s, int ref_index,
^
894. int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select)
895. {
libavcodec/motion_est.c:953:20: Call
951. P_MV1[1]= my / 2;
952.
953. dmin = epzs_motion_search2(s, &mx_i, &my_i, P, block, field_select+ref_index, mv_table, (1<<16)>>1);
^
954.
955. dmin= c->sub_motion_search(s, &mx_i, &my_i, dmin, block, field_select+ref_index, size, h);
libavcodec/motion_est_template.c:1191:1: Parameter `ref_index`
1189.
1190. //try to merge with above FIXME (needs PSNR test)
1191. static int epzs_motion_search2(MpegEncContext * s,
^
1192. int *mx_ptr, int *my_ptr, int P[10][2],
1193. int src_index, int ref_index, int16_t (*last_mv)[2],
libavcodec/motion_est_template.c:1219:9: Call
1217. /* first line */
1218. if (s->first_slice_line) {
1219. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
^
1220. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
1221. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
libavcodec/motion_est.c:108:1: <Length trace>
106. against a proposed motion-compensated prediction of that block
107. */
108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
^
109. const int size, const int h, int ref_index, int src_index,
110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
libavcodec/motion_est.c:108:1: Parameter `ref_index`
106. against a proposed motion-compensated prediction of that block
107. */
108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
^
109. const int size, const int h, int ref_index, int src_index,
110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
libavcodec/motion_est.c:119:5: Assignment
117. const int hx= subx + (x<<(1+qpel));
118. const int hy= suby + (y<<(1+qpel));
119. uint8_t * const * const ref= c->ref[ref_index];
^
120. uint8_t * const * const src= c->src[src_index];
121. int d;
libavcodec/motion_est.c:176:50: Array access: Offset: [8, 9] (⇐ [0, 1] + 8) Size: 4 by call to `interlaced_search`
174.
175. c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
176. c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
^
177. }
178. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L176
|
d2a_code_trace_data_44640
|
void RAND_seed(const void *buf, int num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth->seed != NULL)
meth->seed(buf, num);
}
crypto/rand/rand_lib.c:834: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 832 could be null and is dereferenced at line 834, column 9.
Showing all 6 steps of the trace
crypto/rand/rand_lib.c:830:1: start of procedure RAND_seed()
828. #endif
829.
830. > void RAND_seed(const void *buf, int num)
831. {
832. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:832:5:
830. void RAND_seed(const void *buf, int num)
831. {
832. > const RAND_METHOD *meth = RAND_get_rand_method();
833.
834. if (meth->seed != NULL)
crypto/rand/rand_lib.c:770:1: start of procedure RAND_get_rand_method()
768. #endif
769.
770. > const RAND_METHOD *RAND_get_rand_method(void)
771. {
772. #ifdef FIPS_MODE
crypto/rand/rand_lib.c:773:5:
771. {
772. #ifdef FIPS_MODE
773. > return NULL;
774. #else
775. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:802:1: return from a call to RAND_get_rand_method
800. return tmp_meth;
801. #endif
802. > }
803.
804. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
crypto/rand/rand_lib.c:834:9:
832. const RAND_METHOD *meth = RAND_get_rand_method();
833.
834. > if (meth->seed != NULL)
835. meth->seed(buf, num);
836. }
|
https://github.com/openssl/openssl/blob/6b3d0423528b049d04b299a8588a32d5c1224717/crypto/rand/rand_lib.c/#L834
|
d2a_code_trace_data_44641
|
void t2p_read_tiff_size(T2P* t2p, TIFF* input){
uint64* sbc=NULL;
#if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
unsigned char* jpt=NULL;
tstrip_t i=0;
tstrip_t stripcount=0;
#endif
uint64 k = 0;
if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
#ifdef CCITT_SUPPORT
if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
t2p->t2p_error = T2P_ERR_ERROR;
}
t2p->tiff_datasize=(tmsize_t)sbc[0];
return;
}
#endif
#ifdef ZIP_SUPPORT
if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
t2p->t2p_error = T2P_ERR_ERROR;
}
t2p->tiff_datasize=(tmsize_t)sbc[0];
return;
}
#endif
#ifdef OJPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_OJPEG){
if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
stripcount=TIFFNumberOfStrips(input);
for(i=0;i<stripcount;i++){
k = checkAdd64(k, sbc[i], t2p);
}
if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
if(t2p->tiff_dataoffset != 0){
if(TIFFGetField(input, TIFFTAG_JPEGIFBYTECOUNT, &(t2p->tiff_datasize))!=0){
if((uint64)t2p->tiff_datasize < k) {
TIFFWarning(TIFF2PDF_MODULE,
"Input file %s has short JPEG interchange file byte count",
TIFFFileName(input));
t2p->pdf_ojpegiflength=t2p->tiff_datasize;
k = checkAdd64(k, t2p->tiff_datasize, t2p);
k = checkAdd64(k, 6, t2p);
k = checkAdd64(k, stripcount, t2p);
k = checkAdd64(k, stripcount, t2p);
t2p->tiff_datasize = (tsize_t) k;
if ((uint64) t2p->tiff_datasize != k) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
t2p->t2p_error = T2P_ERR_ERROR;
}
return;
}
return;
}else {
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_JPEGIFBYTECOUNT",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
}
}
k = checkAdd64(k, stripcount, t2p);
k = checkAdd64(k, stripcount, t2p);
k = checkAdd64(k, 2048, t2p);
t2p->tiff_datasize = (tsize_t) k;
if ((uint64) t2p->tiff_datasize != k) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
t2p->t2p_error = T2P_ERR_ERROR;
}
return;
}
#endif
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_JPEG) {
uint32 count = 0;
if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0 ){
if(count > 4){
k += count;
k -= 2;
}
} else {
k = 2;
}
stripcount=TIFFNumberOfStrips(input);
if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
for(i=0;i<stripcount;i++){
k = checkAdd64(k, sbc[i], t2p);
k -=2;
k +=2;
}
k = checkAdd64(k, 2, t2p);
k = checkAdd64(k, 6, t2p);
t2p->tiff_datasize = (tsize_t) k;
if ((uint64) t2p->tiff_datasize != k) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
t2p->t2p_error = T2P_ERR_ERROR;
}
return;
}
#endif
(void) 0;
}
k = checkMultiply64(TIFFScanlineSize(input), t2p->tiff_length, t2p);
if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){
k = checkMultiply64(k, t2p->tiff_samplesperpixel, t2p);
}
if (k == 0) {
t2p->t2p_error = T2P_ERR_ERROR;
}
t2p->tiff_datasize = (tsize_t) k;
if ((uint64) t2p->tiff_datasize != k) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
t2p->t2p_error = T2P_ERR_ERROR;
}
return;
}
tools/tiff2pdf.c:1911: error: Null Dereference
pointer `sbc` last assigned on line 1899 could be null and is dereferenced at line 1911, column 17.
tools/tiff2pdf.c:1897:1: start of procedure t2p_read_tiff_size()
1895. */
1896.
1897. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
^
1898.
1899. uint64* sbc=NULL;
tools/tiff2pdf.c:1899:2:
1897. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
1898.
1899. uint64* sbc=NULL;
^
1900. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1901. unsigned char* jpt=NULL;
tools/tiff2pdf.c:1901:2:
1899. uint64* sbc=NULL;
1900. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1901. unsigned char* jpt=NULL;
^
1902. tstrip_t i=0;
1903. tstrip_t stripcount=0;
tools/tiff2pdf.c:1902:2:
1900. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1901. unsigned char* jpt=NULL;
1902. tstrip_t i=0;
^
1903. tstrip_t stripcount=0;
1904. #endif
tools/tiff2pdf.c:1903:2:
1901. unsigned char* jpt=NULL;
1902. tstrip_t i=0;
1903. tstrip_t stripcount=0;
^
1904. #endif
1905. uint64 k = 0;
tools/tiff2pdf.c:1905:9:
1903. tstrip_t stripcount=0;
1904. #endif
1905. uint64 k = 0;
^
1906.
1907. if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
tools/tiff2pdf.c:1907:5: Taking true branch
1905. uint64 k = 0;
1906.
1907. if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
^
1908. #ifdef CCITT_SUPPORT
1909. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
tools/tiff2pdf.c:1909:6: Taking true branch
1907. if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
1908. #ifdef CCITT_SUPPORT
1909. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
^
1910. TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1911. if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
tools/tiff2pdf.c:1910:4:
1908. #ifdef CCITT_SUPPORT
1909. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
1910. TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
^
1911. if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
1912. TIFFError(TIFF2PDF_MODULE, "Integer overflow");
libtiff/tif_dir.c:1213:1: start of procedure TIFFGetField()
1211. * internal directory structure.
1212. */
1213. int
^
1214. TIFFGetField(TIFF* tif, uint32 tag, ...)
1215. {
libtiff/tif_dir.c:1219:2:
1217. va_list ap;
1218.
1219. va_start(ap, tag);
^
1220. status = TIFFVGetField(tif, tag, ap);
1221. va_end(ap);
libtiff/tif_dir.c:1220:2: Skipping TIFFVGetField(): empty list of specs
1218.
1219. va_start(ap, tag);
1220. status = TIFFVGetField(tif, tag, ap);
^
1221. va_end(ap);
1222. return (status);
libtiff/tif_dir.c:1221:2:
1219. va_start(ap, tag);
1220. status = TIFFVGetField(tif, tag, ap);
1221. va_end(ap);
^
1222. return (status);
1223. }
libtiff/tif_dir.c:1222:2:
1220. status = TIFFVGetField(tif, tag, ap);
1221. va_end(ap);
1222. return (status);
^
1223. }
1224.
libtiff/tif_dir.c:1223:1: return from a call to TIFFGetField
1221. va_end(ap);
1222. return (status);
1223. }
^
1224.
1225. /*
tools/tiff2pdf.c:1911:17:
1909. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
1910. TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1911. if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
^
1912. TIFFError(TIFF2PDF_MODULE, "Integer overflow");
1913. t2p->t2p_error = T2P_ERR_ERROR;
|
https://gitlab.com/libtiff/libtiff/blob/6dac309a9701d15ac52d895d566ddae2ed49db9b/tools/tiff2pdf.c/#L1911
|
d2a_code_trace_data_44642
|
static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos)
{
int err;
if (seekhead->max_entries > 0 && seekhead->max_entries <= seekhead->num_entries)
return -1;
if ((err = av_reallocp_array(&seekhead->entries, seekhead->num_entries + 1,
sizeof(*seekhead->entries))) < 0) {
seekhead->num_entries = 0;
return err;
}
seekhead->entries[seekhead->num_entries].elementid = elementid;
seekhead->entries[seekhead->num_entries++].segmentpos = filepos - seekhead->segment_offset;
return 0;
}
libavformat/matroskaenc.c:312: error: Null Dereference
pointer `seekhead->entries` last assigned on line 306 could be null and is dereferenced at line 312, column 5.
libavformat/matroskaenc.c:298:1: start of procedure mkv_add_seekhead_entry()
296. }
297.
298. static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos)
^
299. {
300. int err;
libavformat/matroskaenc.c:303:9: Taking true branch
301.
302. // don't store more elements than we reserved space for
303. if (seekhead->max_entries > 0 && seekhead->max_entries <= seekhead->num_entries)
^
304. return -1;
305.
libavformat/matroskaenc.c:303:38: Taking false branch
301.
302. // don't store more elements than we reserved space for
303. if (seekhead->max_entries > 0 && seekhead->max_entries <= seekhead->num_entries)
^
304. return -1;
305.
libavformat/matroskaenc.c:306:9:
304. return -1;
305.
306. if ((err = av_reallocp_array(&seekhead->entries, seekhead->num_entries + 1,
^
307. sizeof(*seekhead->entries))) < 0) {
308. seekhead->num_entries = 0;
libavutil/mem.c:167:1: start of procedure av_reallocp_array()
165. }
166.
167. int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
^
168. {
169. void **ptrptr = ptr;
libavutil/mem.c:169:5:
167. int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
168. {
169. void **ptrptr = ptr;
^
170. void *ret;
171. if (!size || nmemb >= INT_MAX / size)
libavutil/mem.c:171:10: Taking false branch
169. void **ptrptr = ptr;
170. void *ret;
171. if (!size || nmemb >= INT_MAX / size)
^
172. return AVERROR(ENOMEM);
173. if (!nmemb) {
libavutil/mem.c:171:18: Taking false branch
169. void **ptrptr = ptr;
170. void *ret;
171. if (!size || nmemb >= INT_MAX / size)
^
172. return AVERROR(ENOMEM);
173. if (!nmemb) {
libavutil/mem.c:173:10: Taking true branch
171. if (!size || nmemb >= INT_MAX / size)
172. return AVERROR(ENOMEM);
173. if (!nmemb) {
^
174. av_freep(ptr);
175. return 0;
libavutil/mem.c:174:9:
172. return AVERROR(ENOMEM);
173. if (!nmemb) {
174. av_freep(ptr);
^
175. return 0;
176. }
libavutil/mem.c:198:1: start of procedure av_freep()
196. }
197.
198. void av_freep(void *arg)
^
199. {
200. void **ptr = (void **)arg;
libavutil/mem.c:200:5:
198. void av_freep(void *arg)
199. {
200. void **ptr = (void **)arg;
^
201. av_free(*ptr);
202. *ptr = NULL;
libavutil/mem.c:201:5:
199. {
200. void **ptr = (void **)arg;
201. av_free(*ptr);
^
202. *ptr = NULL;
203. }
libavutil/mem.c:186:1: start of procedure av_free()
184. }
185.
186. void av_free(void *ptr)
^
187. {
188. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:194:5:
192. _aligned_free(ptr);
193. #else
194. free(ptr);
^
195. #endif
196. }
libavutil/mem.c:196:1: return from a call to av_free
194. free(ptr);
195. #endif
196. }
^
197.
198. void av_freep(void *arg)
libavutil/mem.c:202:5:
200. void **ptr = (void **)arg;
201. av_free(*ptr);
202. *ptr = NULL;
^
203. }
204.
libavutil/mem.c:203:1: return from a call to av_freep
201. av_free(*ptr);
202. *ptr = NULL;
203. }
^
204.
205. void *av_mallocz(size_t size)
libavutil/mem.c:175:9:
173. if (!nmemb) {
174. av_freep(ptr);
175. return 0;
^
176. }
177. ret = av_realloc(*ptrptr, nmemb * size);
libavutil/mem.c:184:1: return from a call to av_reallocp_array
182. *ptrptr = ret;
183. return 0;
184. }
^
185.
186. void av_free(void *ptr)
libavformat/matroskaenc.c:306:9: Taking false branch
304. return -1;
305.
306. if ((err = av_reallocp_array(&seekhead->entries, seekhead->num_entries + 1,
^
307. sizeof(*seekhead->entries))) < 0) {
308. seekhead->num_entries = 0;
libavformat/matroskaenc.c:312:5:
310. }
311.
312. seekhead->entries[seekhead->num_entries].elementid = elementid;
^
313. seekhead->entries[seekhead->num_entries++].segmentpos = filepos - seekhead->segment_offset;
314.
|
https://github.com/libav/libav/blob/558b20d729bc296d8e6a69f03cd509ad26a4827d/libavformat/matroskaenc.c/#L312
|
d2a_code_trace_data_44643
|
static int check_crl_chain(X509_STORE_CTX *ctx,
STACK_OF(X509) *cert_path,
STACK_OF(X509) *crl_path)
{
X509 *cert_ta, *crl_ta;
cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
if (!X509_cmp(cert_ta, crl_ta))
return 1;
return 0;
}
crypto/x509/x509_vfy.c:1201: error: NULL_DEREFERENCE
pointer `cert_ta` last assigned on line 1199 could be null and is dereferenced by call to `X509_cmp()` at line 1201, column 7.
Showing all 32 steps of the trace
crypto/x509/x509_vfy.c:1194:1: start of procedure check_crl_chain()
1192. */
1193.
1194. > static int check_crl_chain(X509_STORE_CTX *ctx,
1195. STACK_OF(X509) *cert_path,
1196. STACK_OF(X509) *crl_path)
crypto/x509/x509_vfy.c:1199:12: Condition is true
1197. {
1198. X509 *cert_ta, *crl_ta;
1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
^
1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201. if (!X509_cmp(cert_ta, crl_ta))
crypto/x509/x509_vfy.c:1199:12: Condition is true
1197. {
1198. X509 *cert_ta, *crl_ta;
1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
^
1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201. if (!X509_cmp(cert_ta, crl_ta))
crypto/x509/x509_vfy.c:1199:2:
1197. {
1198. X509 *cert_ta, *crl_ta;
1199. > cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201. if (!X509_cmp(cert_ta, crl_ta))
crypto/stack/stack.c:294:1: start of procedure sk_num()
292. }
293.
294. > int sk_num(const _STACK *st)
295. {
296. if(st == NULL) return -1;
crypto/stack/stack.c:296:5: Taking false branch
294. int sk_num(const _STACK *st)
295. {
296. if(st == NULL) return -1;
^
297. return st->num;
298. }
crypto/stack/stack.c:297:2:
295. {
296. if(st == NULL) return -1;
297. > return st->num;
298. }
299.
crypto/stack/stack.c:298:1: return from a call to sk_num
296. if(st == NULL) return -1;
297. return st->num;
298. > }
299.
300. void *sk_value(const _STACK *st, int i)
crypto/stack/stack.c:300:1: start of procedure sk_value()
298. }
299.
300. > void *sk_value(const _STACK *st, int i)
301. {
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
crypto/stack/stack.c:302:6: Taking false branch
300. void *sk_value(const _STACK *st, int i)
301. {
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
303. return st->data[i];
304. }
crypto/stack/stack.c:302:13: Taking true branch
300. void *sk_value(const _STACK *st, int i)
301. {
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
303. return st->data[i];
304. }
crypto/stack/stack.c:302:39:
300. void *sk_value(const _STACK *st, int i)
301. {
302. > if(!st || (i < 0) || (i >= st->num)) return NULL;
303. return st->data[i];
304. }
crypto/stack/stack.c:304:1: return from a call to sk_value
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
303. return st->data[i];
304. > }
305.
306. void *sk_set(_STACK *st, int i, void *value)
crypto/x509/x509_vfy.c:1200:11: Condition is true
1198. X509 *cert_ta, *crl_ta;
1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
^
1201. if (!X509_cmp(cert_ta, crl_ta))
1202. return 1;
crypto/x509/x509_vfy.c:1200:11: Condition is true
1198. X509 *cert_ta, *crl_ta;
1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
^
1201. if (!X509_cmp(cert_ta, crl_ta))
1202. return 1;
crypto/x509/x509_vfy.c:1200:2:
1198. X509 *cert_ta, *crl_ta;
1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200. > crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201. if (!X509_cmp(cert_ta, crl_ta))
1202. return 1;
crypto/stack/stack.c:294:1: start of procedure sk_num()
292. }
293.
294. > int sk_num(const _STACK *st)
295. {
296. if(st == NULL) return -1;
crypto/stack/stack.c:296:5: Taking false branch
294. int sk_num(const _STACK *st)
295. {
296. if(st == NULL) return -1;
^
297. return st->num;
298. }
crypto/stack/stack.c:297:2:
295. {
296. if(st == NULL) return -1;
297. > return st->num;
298. }
299.
crypto/stack/stack.c:298:1: return from a call to sk_num
296. if(st == NULL) return -1;
297. return st->num;
298. > }
299.
300. void *sk_value(const _STACK *st, int i)
crypto/stack/stack.c:300:1: start of procedure sk_value()
298. }
299.
300. > void *sk_value(const _STACK *st, int i)
301. {
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
crypto/stack/stack.c:302:6: Taking false branch
300. void *sk_value(const _STACK *st, int i)
301. {
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
303. return st->data[i];
304. }
crypto/stack/stack.c:302:13: Taking false branch
300. void *sk_value(const _STACK *st, int i)
301. {
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
303. return st->data[i];
304. }
crypto/stack/stack.c:302:24: Taking false branch
300. void *sk_value(const _STACK *st, int i)
301. {
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
^
303. return st->data[i];
304. }
crypto/stack/stack.c:303:2:
301. {
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
303. > return st->data[i];
304. }
305.
crypto/stack/stack.c:304:1: return from a call to sk_value
302. if(!st || (i < 0) || (i >= st->num)) return NULL;
303. return st->data[i];
304. > }
305.
306. void *sk_set(_STACK *st, int i, void *value)
crypto/x509/x509_vfy.c:1201:7:
1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1);
1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1);
1201. > if (!X509_cmp(cert_ta, crl_ta))
1202. return 1;
1203. return 0;
crypto/x509/x509_cmp.c:179:1: start of procedure X509_cmp()
177. * with an evil cast.
178. */
179. > int X509_cmp(const X509 *a, const X509 *b)
180. {
181. /* ensure hash is valid */
crypto/x509/x509_cmp.c:182:2: Skipping X509_check_purpose(): empty list of specs
180. {
181. /* ensure hash is valid */
182. X509_check_purpose((X509 *)a, -1, 0);
^
183. X509_check_purpose((X509 *)b, -1, 0);
184.
crypto/x509/x509_cmp.c:183:2: Skipping X509_check_purpose(): empty list of specs
181. /* ensure hash is valid */
182. X509_check_purpose((X509 *)a, -1, 0);
183. X509_check_purpose((X509 *)b, -1, 0);
^
184.
185. return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
crypto/x509/x509_cmp.c:185:2:
183. X509_check_purpose((X509 *)b, -1, 0);
184.
185. > return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
186. }
187. #endif
crypto/x509/x509_cmp.c:186:1: return from a call to X509_cmp
184.
185. return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
186. > }
187. #endif
188.
|
https://github.com/openssl/openssl/blob/bbb19418e672007590c65a12aa24e1b59927b2cc/crypto/x509/x509_vfy.c/#L1201
|
d2a_code_trace_data_44644
|
static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
int i;
init_get_bits(&gb, buf, buf_size * 8);
if (s->theora && get_bits1(&gb))
{
av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
return -1;
}
s->keyframe = !get_bits1(&gb);
if (!s->theora)
skip_bits(&gb, 1);
for (i = 0; i < 3; i++)
s->last_qps[i] = s->qps[i];
s->nqps=0;
do{
s->qps[s->nqps++]= get_bits(&gb, 6);
} while(s->theora >= 0x030200 && s->nqps<3 && get_bits1(&gb));
for (i = s->nqps; i < 3; i++)
s->qps[i] = -1;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n",
s->keyframe?"key":"", avctx->frame_number+1, s->qps[0]);
s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] ||
avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL : AVDISCARD_NONKEY);
if (s->qps[0] != s->last_qps[0])
init_loop_filter(s);
for (i = 0; i < s->nqps; i++)
if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0])
init_dequantizer(s, i);
if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe)
return buf_size;
s->current_frame.reference = 3;
s->current_frame.pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
if (ff_thread_get_buffer(avctx, &s->current_frame) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
goto error;
}
if (!s->edge_emu_buffer)
s->edge_emu_buffer = av_malloc(9*FFABS(s->current_frame.linesize[0]));
if (s->keyframe) {
if (!s->theora)
{
skip_bits(&gb, 4);
skip_bits(&gb, 4);
if (s->version)
{
s->version = get_bits(&gb, 5);
if (avctx->frame_number == 0)
av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version);
}
}
if (s->version || s->theora)
{
if (get_bits1(&gb))
av_log(s->avctx, AV_LOG_ERROR, "Warning, unsupported keyframe coding type?!\n");
skip_bits(&gb, 2);
}
} else {
if (!s->golden_frame.data[0]) {
av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
s->golden_frame.reference = 3;
s->golden_frame.pict_type = AV_PICTURE_TYPE_I;
if (ff_thread_get_buffer(avctx, &s->golden_frame) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
goto error;
}
s->last_frame = s->golden_frame;
s->last_frame.type = FF_BUFFER_TYPE_COPY;
ff_thread_report_progress(&s->last_frame, INT_MAX, 0);
}
}
memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment));
ff_thread_finish_setup(avctx);
if (unpack_superblocks(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n");
goto error;
}
if (unpack_modes(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n");
goto error;
}
if (unpack_vectors(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n");
goto error;
}
if (unpack_block_qpis(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_block_qpis\n");
goto error;
}
if (unpack_dct_coeffs(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n");
goto error;
}
for (i = 0; i < 3; i++) {
int height = s->height >> (i && s->chroma_y_shift);
if (s->flipped_image)
s->data_offset[i] = 0;
else
s->data_offset[i] = (height-1) * s->current_frame.linesize[i];
}
s->last_slice_end = 0;
for (i = 0; i < s->c_superblock_height; i++)
render_slice(s, i);
for (i = 0; i < 3; i++) {
int row = (s->height >> (3+(i && s->chroma_y_shift))) - 1;
apply_loop_filter(s, i, row, row+1);
}
vp3_draw_horiz_band(s, s->avctx->height);
*data_size=sizeof(AVFrame);
*(AVFrame*)data= s->current_frame;
if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME))
update_frames(avctx);
return buf_size;
error:
ff_thread_report_progress(&s->current_frame, INT_MAX, 0);
if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME))
avctx->release_buffer(avctx, &s->current_frame);
return -1;
}
libavcodec/vp3.c:1920: error: Null Dereference
pointer `&gb->buffer` last assigned on line 1918 could be null and is dereferenced by call to `get_bits1()` at line 1920, column 22.
libavcodec/vp3.c:1908:1: start of procedure vp3_decode_frame()
1906. }
1907.
1908. static int vp3_decode_frame(AVCodecContext *avctx,
^
1909. void *data, int *data_size,
1910. AVPacket *avpkt)
libavcodec/vp3.c:1912:5:
1910. AVPacket *avpkt)
1911. {
1912. const uint8_t *buf = avpkt->data;
^
1913. int buf_size = avpkt->size;
1914. Vp3DecodeContext *s = avctx->priv_data;
libavcodec/vp3.c:1913:5:
1911. {
1912. const uint8_t *buf = avpkt->data;
1913. int buf_size = avpkt->size;
^
1914. Vp3DecodeContext *s = avctx->priv_data;
1915. GetBitContext gb;
libavcodec/vp3.c:1914:5:
1912. const uint8_t *buf = avpkt->data;
1913. int buf_size = avpkt->size;
1914. Vp3DecodeContext *s = avctx->priv_data;
^
1915. GetBitContext gb;
1916. int i;
libavcodec/vp3.c:1918:5:
1916. int i;
1917.
1918. init_get_bits(&gb, buf, buf_size * 8);
^
1919.
1920. if (s->theora && get_bits1(&gb))
libavcodec/get_bits.h:339:1: start of procedure init_get_bits()
337. * @param bit_size the size of the buffer in bits
338. */
339. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
^
340. int bit_size)
341. {
libavcodec/get_bits.h:342:5:
340. int bit_size)
341. {
342. int buffer_size = (bit_size+7)>>3;
^
343. if (buffer_size < 0 || bit_size < 0) {
344. buffer_size = bit_size = 0;
libavcodec/get_bits.h:343:9: Taking true branch
341. {
342. int buffer_size = (bit_size+7)>>3;
343. if (buffer_size < 0 || bit_size < 0) {
^
344. buffer_size = bit_size = 0;
345. buffer = NULL;
libavcodec/get_bits.h:344:9:
342. int buffer_size = (bit_size+7)>>3;
343. if (buffer_size < 0 || bit_size < 0) {
344. buffer_size = bit_size = 0;
^
345. buffer = NULL;
346. }
libavcodec/get_bits.h:345:9:
343. if (buffer_size < 0 || bit_size < 0) {
344. buffer_size = bit_size = 0;
345. buffer = NULL;
^
346. }
347.
libavcodec/get_bits.h:348:5:
346. }
347.
348. s->buffer = buffer;
^
349. s->size_in_bits = bit_size;
350. #if !UNCHECKED_BITSTREAM_READER
libavcodec/get_bits.h:349:5:
347.
348. s->buffer = buffer;
349. s->size_in_bits = bit_size;
^
350. #if !UNCHECKED_BITSTREAM_READER
351. s->size_in_bits_plus8 = bit_size + 8;
libavcodec/get_bits.h:351:5:
349. s->size_in_bits = bit_size;
350. #if !UNCHECKED_BITSTREAM_READER
351. s->size_in_bits_plus8 = bit_size + 8;
^
352. #endif
353. s->buffer_end = buffer + buffer_size;
libavcodec/get_bits.h:353:5:
351. s->size_in_bits_plus8 = bit_size + 8;
352. #endif
353. s->buffer_end = buffer + buffer_size;
^
354. s->index = 0;
355. }
libavcodec/get_bits.h:354:5:
352. #endif
353. s->buffer_end = buffer + buffer_size;
354. s->index = 0;
^
355. }
356.
libavcodec/get_bits.h:355:1: return from a call to init_get_bits
353. s->buffer_end = buffer + buffer_size;
354. s->index = 0;
355. }
^
356.
357. static inline void align_get_bits(GetBitContext *s)
libavcodec/vp3.c:1920:9: Taking true branch
1918. init_get_bits(&gb, buf, buf_size * 8);
1919.
1920. if (s->theora && get_bits1(&gb))
^
1921. {
1922. av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
libavcodec/vp3.c:1920:22:
1918. init_get_bits(&gb, buf, buf_size * 8);
1919.
1920. if (s->theora && get_bits1(&gb))
^
1921. {
1922. av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
libavcodec/get_bits.h:255:1: start of procedure get_bits1()
253. }
254.
255. static inline unsigned int get_bits1(GetBitContext *s)
^
256. {
257. unsigned int index = s->index;
libavcodec/get_bits.h:257:5:
255. static inline unsigned int get_bits1(GetBitContext *s)
256. {
257. unsigned int index = s->index;
^
258. uint8_t result = s->buffer[index>>3];
259. #ifdef BITSTREAM_READER_LE
libavcodec/get_bits.h:258:5:
256. {
257. unsigned int index = s->index;
258. uint8_t result = s->buffer[index>>3];
^
259. #ifdef BITSTREAM_READER_LE
260. result >>= index & 7;
|
https://github.com/libav/libav/blob/1c9e340d35351858907f11c45b2691db708f3903/libavcodec/vp3.c/#L1920
|
d2a_code_trace_data_44645
|
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
*allocbytes = (unsigned char *)pkt->buf->data + pkt->curr;
pkt->written += len;
pkt->curr += len;
return 1;
}
ssl/t1_lib.c:1044: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `WPACKET_sub_memcpy__`.
Showing all 12 steps of the trace
ssl/t1_lib.c:1043:21: Call
1041. if (s->renegotiate) {
1042. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
1043. || !WPACKET_start_sub_packet_u16(pkt)
^
1044. || !WPACKET_sub_memcpy_u8(pkt, s->s3->previous_client_finished,
1045. s->s3->previous_client_finished_len)
ssl/packet.c:205:1: Parameter `pkt->buf->length`
203. }
204.
205. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
206. {
207. WPACKET_SUB *sub;
ssl/t1_lib.c:1044:21: Call
1042. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate)
1043. || !WPACKET_start_sub_packet_u16(pkt)
1044. || !WPACKET_sub_memcpy_u8(pkt, s->s3->previous_client_finished,
^
1045. s->s3->previous_client_finished_len)
1046. || !WPACKET_close(pkt)) {
ssl/packet.c:298:1: Parameter `pkt->written`
296. }
297.
298. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len,
299. size_t lenbytes)
300. {
ssl/packet.c:301:10: Call
299. size_t lenbytes)
300. {
301. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
^
302. || !WPACKET_memcpy(pkt, src, len)
303. || !WPACKET_close(pkt))
ssl/packet.c:205:1: Parameter `pkt->written`
203. }
204.
205. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
206. {
207. WPACKET_SUB *sub;
ssl/packet.c:229:10: Call
227. }
228.
229. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
^
230. return 0;
231. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */
ssl/packet.c:15:1: <LHS trace>
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: Parameter `pkt->buf->length`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: <RHS trace>
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: Parameter `len`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:25:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 6]):unsigned64 by call to `WPACKET_sub_memcpy__`
23. return 0;
24.
25. if (pkt->buf->length - pkt->written < len) {
^
26. size_t newlen;
27. size_t reflen;
|
https://github.com/openssl/openssl/blob/a6972f346248fbc37e42056bb943fae0896a2967/ssl/packet.c/#L25
|
d2a_code_trace_data_44646
|
STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
STACK_OF(SSL_CIPHER) *tls13_ciphersuites,
STACK_OF(SSL_CIPHER) **cipher_list,
STACK_OF(SSL_CIPHER) **cipher_list_by_id,
const char *rule_str,
CERT *c)
{
int ok, num_of_ciphers, num_of_alias_max, num_of_group_aliases, i;
uint32_t disabled_mkey, disabled_auth, disabled_enc, disabled_mac;
STACK_OF(SSL_CIPHER) *cipherstack;
const char *rule_p;
CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr;
const SSL_CIPHER **ca_list = NULL;
if (rule_str == NULL || cipher_list == NULL || cipher_list_by_id == NULL)
return NULL;
#ifndef OPENSSL_NO_EC
if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
return NULL;
#endif
disabled_mkey = disabled_mkey_mask;
disabled_auth = disabled_auth_mask;
disabled_enc = disabled_enc_mask;
disabled_mac = disabled_mac_mask;
num_of_ciphers = ssl_method->num_ciphers();
co_list = OPENSSL_malloc(sizeof(*co_list) * num_of_ciphers);
if (co_list == NULL) {
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
return NULL;
}
ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers,
disabled_mkey, disabled_auth, disabled_enc,
disabled_mac, co_list, &head, &tail);
ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD,
-1, &head, &tail);
ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head,
&tail);
ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
&tail);
ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
&head, &tail);
ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
&head, &tail);
ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD,
-1, &head, &tail);
ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail);
ssl_cipher_apply_rule(0, 0, 0, 0, SSL_MD5, 0, 0, CIPHER_ORD, -1, &head,
&tail);
ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
&tail);
ssl_cipher_apply_rule(0, SSL_kRSA, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
&tail);
ssl_cipher_apply_rule(0, SSL_kPSK, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head,
&tail);
ssl_cipher_apply_rule(0, 0, 0, SSL_RC4, 0, 0, 0, CIPHER_ORD, -1, &head,
&tail);
if (!ssl_cipher_strength_sort(&head, &tail)) {
OPENSSL_free(co_list);
return NULL;
}
ssl_cipher_apply_rule(0, 0, 0, 0, 0, TLS1_2_VERSION, 0, CIPHER_BUMP, -1,
&head, &tail);
ssl_cipher_apply_rule(0, 0, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1,
&head, &tail);
ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, 0, 0, 0,
CIPHER_BUMP, -1, &head, &tail);
ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0,
CIPHER_BUMP, -1, &head, &tail);
ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail);
num_of_group_aliases = OSSL_NELEM(cipher_aliases);
num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
ca_list = OPENSSL_malloc(sizeof(*ca_list) * num_of_alias_max);
if (ca_list == NULL) {
OPENSSL_free(co_list);
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
return NULL;
}
ssl_cipher_collect_aliases(ca_list, num_of_group_aliases,
disabled_mkey, disabled_auth, disabled_enc,
disabled_mac, head);
ok = 1;
rule_p = rule_str;
if (strncmp(rule_str, "DEFAULT", 7) == 0) {
ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
&head, &tail, ca_list, c);
rule_p += 7;
if (*rule_p == ':')
rule_p++;
}
if (ok && (strlen(rule_p) > 0))
ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c);
OPENSSL_free(ca_list);
if (!ok) {
OPENSSL_free(co_list);
return NULL;
}
if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL) {
OPENSSL_free(co_list);
return NULL;
}
for (i = 0; i < sk_SSL_CIPHER_num(tls13_ciphersuites); i++) {
if (!sk_SSL_CIPHER_push(cipherstack,
sk_SSL_CIPHER_value(tls13_ciphersuites, i))) {
sk_SSL_CIPHER_free(cipherstack);
return NULL;
}
}
for (curr = head; curr != NULL; curr = curr->next) {
if (curr->active) {
if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher)) {
OPENSSL_free(co_list);
sk_SSL_CIPHER_free(cipherstack);
return NULL;
}
#ifdef CIPHER_DEBUG
fprintf(stderr, "<%s>\n", curr->cipher->name);
#endif
}
}
OPENSSL_free(co_list);
if (!update_cipher_list_by_id(cipher_list_by_id, cipherstack)) {
sk_SSL_CIPHER_free(cipherstack);
return NULL;
}
sk_SSL_CIPHER_free(*cipher_list);
*cipher_list = cipherstack;
return cipherstack;
}
test/clienthellotest.c:102: error: BUFFER_OVERRUN_L1
Offset: 7 Size: 1 by call to `SSL_CTX_set_cipher_list`.
Showing all 10 steps of the trace
test/clienthellotest.c:102:14: Call
100. * that is too long for this test we use a restricted ciphersuite list
101. */
102. if (!TEST_false(SSL_CTX_set_cipher_list(ctx, "")))
^
103. goto end;
104. ERR_clear_error();
ssl/ssl_lib.c:2603:1: Parameter `*str`
2601.
2602. /** specify the ciphers to be used by default by the SSL_CTX */
2603. > int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
2604. {
2605. STACK_OF(SSL_CIPHER) *sk;
ssl/ssl_lib.c:2607:10: Call
2605. STACK_OF(SSL_CIPHER) *sk;
2606.
2607. sk = ssl_create_cipher_list(ctx->method, ctx->tls13_ciphersuites,
^
2608. &ctx->cipher_list, &ctx->cipher_list_by_id, str,
2609. ctx->cert);
ssl/ssl_ciph.c:1402:1: <Length trace>
1400. }
1401.
1402. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1403. STACK_OF(SSL_CIPHER) *tls13_ciphersuites,
1404. STACK_OF(SSL_CIPHER) **cipher_list,
ssl/ssl_ciph.c:1402:1: Parameter `*rule_str`
1400. }
1401.
1402. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1403. STACK_OF(SSL_CIPHER) *tls13_ciphersuites,
1404. STACK_OF(SSL_CIPHER) **cipher_list,
ssl/ssl_ciph.c:1422:10: Call
1420. return NULL;
1421. #ifndef OPENSSL_NO_EC
1422. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
^
1423. return NULL;
1424. #endif
ssl/ssl_ciph.c:1222:1: Parameter `**prule_str`
1220.
1221. #ifndef OPENSSL_NO_EC
1222. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c,
1223. const char **prule_str)
1224. {
ssl/ssl_ciph.c:1571:5: Assignment
1569. */
1570. ok = 1;
1571. rule_p = rule_str;
^
1572. if (strncmp(rule_str, "DEFAULT", 7) == 0) {
1573. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
ssl/ssl_ciph.c:1575:9: Assignment
1573. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
1574. &head, &tail, ca_list, c);
1575. rule_p += 7;
^
1576. if (*rule_p == ':')
1577. rule_p++;
ssl/ssl_ciph.c:1576:13: Array access: Offset: 7 Size: 1 by call to `SSL_CTX_set_cipher_list`
1574. &head, &tail, ca_list, c);
1575. rule_p += 7;
1576. if (*rule_p == ':')
^
1577. rule_p++;
1578. }
|
https://github.com/openssl/openssl/blob/4af5836b55442f31795eff6c8c81ea7a1b8cf94b/ssl/ssl_ciph.c/#L1576
|
d2a_code_trace_data_44647
|
static int decode_header(SnowContext *s){
int plane_index;
uint8_t kstate[32];
memset(kstate, MID_STATE, sizeof(kstate));
s->keyframe= get_rac(&s->c, kstate);
if(s->keyframe || s->always_reset){
reset_contexts(s);
s->spatial_decomposition_type=
s->qlog=
s->qbias=
s->mv_scale=
s->block_max_depth= 0;
}
if(s->keyframe){
s->version= get_symbol(&s->c, s->header_state, 0);
if(s->version>0){
av_log(s->avctx, AV_LOG_ERROR, "version %d not supported", s->version);
return -1;
}
s->always_reset= get_rac(&s->c, s->header_state);
s->temporal_decomposition_type= get_symbol(&s->c, s->header_state, 0);
s->temporal_decomposition_count= get_symbol(&s->c, s->header_state, 0);
s->spatial_decomposition_count= get_symbol(&s->c, s->header_state, 0);
s->colorspace_type= get_symbol(&s->c, s->header_state, 0);
s->chroma_h_shift= get_symbol(&s->c, s->header_state, 0);
s->chroma_v_shift= get_symbol(&s->c, s->header_state, 0);
s->spatial_scalability= get_rac(&s->c, s->header_state);
s->max_ref_frames= get_symbol(&s->c, s->header_state, 0)+1;
decode_qlogs(s);
}
if(!s->keyframe){
if(get_rac(&s->c, s->header_state)){
for(plane_index=0; plane_index<2; plane_index++){
int htaps, i, sum=0;
Plane *p= &s->plane[plane_index];
p->diag_mc= get_rac(&s->c, s->header_state);
htaps= get_symbol(&s->c, s->header_state, 0)*2 + 2;
if((unsigned)htaps > HTAPS_MAX || htaps==0)
return -1;
p->htaps= htaps;
for(i= htaps/2; i; i--){
p->hcoeff[i]= get_symbol(&s->c, s->header_state, 0) * (1-2*(i&1));
sum += p->hcoeff[i];
}
p->hcoeff[0]= 32-sum;
}
s->plane[2].diag_mc= s->plane[1].diag_mc;
s->plane[2].htaps = s->plane[1].htaps;
memcpy(s->plane[2].hcoeff, s->plane[1].hcoeff, sizeof(s->plane[1].hcoeff));
}
if(get_rac(&s->c, s->header_state)){
s->spatial_decomposition_count= get_symbol(&s->c, s->header_state, 0);
decode_qlogs(s);
}
}
s->spatial_decomposition_type+= get_symbol(&s->c, s->header_state, 1);
if(s->spatial_decomposition_type > 1){
av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_type %d not supported", s->spatial_decomposition_type);
return -1;
}
s->qlog += get_symbol(&s->c, s->header_state, 1);
s->mv_scale += get_symbol(&s->c, s->header_state, 1);
s->qbias += get_symbol(&s->c, s->header_state, 1);
s->block_max_depth+= get_symbol(&s->c, s->header_state, 1);
if(s->block_max_depth > 1 || s->block_max_depth < 0){
av_log(s->avctx, AV_LOG_ERROR, "block_max_depth= %d is too large", s->block_max_depth);
s->block_max_depth= 0;
return -1;
}
return 0;
}
libavcodec/snow.c:3599: error: Buffer Overrun L2
Offset: [-oo, 4] Size: 4.
libavcodec/snow.c:3594:24: <Offset trace>
3592. Plane *p= &s->plane[plane_index];
3593. p->diag_mc= get_rac(&s->c, s->header_state);
3594. htaps= get_symbol(&s->c, s->header_state, 0)*2 + 2;
^
3595. if((unsigned)htaps > HTAPS_MAX || htaps==0)
3596. return -1;
libavcodec/snow.c:3594:24: Call
3592. Plane *p= &s->plane[plane_index];
3593. p->diag_mc= get_rac(&s->c, s->header_state);
3594. htaps= get_symbol(&s->c, s->header_state, 0)*2 + 2;
^
3595. if((unsigned)htaps > HTAPS_MAX || htaps==0)
3596. return -1;
libavcodec/snow.c:656:9: Assignment
654. static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
655. if(get_rac(c, state+0))
656. return 0;
^
657. else{
658. int i, e, a;
libavcodec/snow.c:3594:17: Assignment
3592. Plane *p= &s->plane[plane_index];
3593. p->diag_mc= get_rac(&s->c, s->header_state);
3594. htaps= get_symbol(&s->c, s->header_state, 0)*2 + 2;
^
3595. if((unsigned)htaps > HTAPS_MAX || htaps==0)
3596. return -1;
libavcodec/snow.c:3598:21: Assignment
3596. return -1;
3597. p->htaps= htaps;
3598. for(i= htaps/2; i; i--){
^
3599. p->hcoeff[i]= get_symbol(&s->c, s->header_state, 0) * (1-2*(i&1));
3600. sum += p->hcoeff[i];
libavcodec/snow.c:3553:1: <Length trace>
3551. }
3552.
3553. static int decode_header(SnowContext *s){
^
3554. int plane_index;
3555. uint8_t kstate[32];
libavcodec/snow.c:3553:1: Parameter `s->plane[*].hcoeff[*]`
3551. }
3552.
3553. static int decode_header(SnowContext *s){
^
3554. int plane_index;
3555. uint8_t kstate[32];
libavcodec/snow.c:3599:21: Array access: Offset: [-oo, 4] Size: 4
3597. p->htaps= htaps;
3598. for(i= htaps/2; i; i--){
3599. p->hcoeff[i]= get_symbol(&s->c, s->header_state, 0) * (1-2*(i&1));
^
3600. sum += p->hcoeff[i];
3601. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/snow.c/#L3599
|
d2a_code_trace_data_44648
|
static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale, int flags, int size, int h)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d;
int dmin;
int map_generation;
int penalty_factor;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
LOAD_COMMON2
if(c->pre_pass){
penalty_factor= c->pre_penalty_factor;
cmpf= s->dsp.me_pre_cmp[size];
chroma_cmpf= s->dsp.me_pre_cmp[size+1];
}else{
penalty_factor= c->penalty_factor;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
}
map_generation= update_map_generation(c);
assert(cmpf);
dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
map[0]= map_generation;
score_map[0]= dmin;
if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}else{
if(dmin<((h*h*s->avctx->mv0_threshold)>>8)
&& ( P_LEFT[0] |P_LEFT[1]
|P_TOP[0] |P_TOP[1]
|P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){
*mx_ptr= 0;
*my_ptr= 0;
c->skip=1;
return dmin;
}
CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
}
if(dmin>h*h*4){
if(c->pre_pass){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
if(!s->first_slice_line)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}else{
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
}
if(c->avctx->last_predictor_count){
const int count= c->avctx->last_predictor_count;
const int xstart= FFMAX(0, s->mb_x - count);
const int ystart= FFMAX(0, s->mb_y - count);
const int xend= FFMIN(s->mb_width , s->mb_x + count + 1);
const int yend= FFMIN(s->mb_height, s->mb_y + count + 1);
int mb_y;
for(mb_y=ystart; mb_y<yend; mb_y++){
int mb_x;
for(mb_x=xstart; mb_x<xend; mb_x++){
const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride;
int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16;
int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16;
if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue;
CHECK_MV(mx,my)
}
}
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1072: error: Uninitialized Value
The value read from ymax was never initialized.
libavcodec/motion_est_template.c:1072:17:
1070. (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
1071. if(!s->first_slice_line)
1072. CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
^
1073. (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
1074. }else{
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1072
|
d2a_code_trace_data_44649
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/bn/bn_exp2.c:101: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_div`.
Showing all 30 steps of the trace
crypto/bn/bn_exp2.c:16:1: Parameter `ctx->stack.depth`
14. #define TABLE_SIZE 32
15.
16. > int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1,
17. const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,
18. BN_CTX *ctx, BN_MONT_CTX *in_mont)
crypto/bn/bn_exp2.c:48:5: Call
46. bits = (bits1 > bits2) ? bits1 : bits2;
47.
48. BN_CTX_start(ctx);
^
49. d = BN_CTX_get(ctx);
50. r = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_exp2.c:49:9: Call
47.
48. BN_CTX_start(ctx);
49. d = BN_CTX_get(ctx);
^
50. r = BN_CTX_get(ctx);
51. val1[0] = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_exp2.c:50:9: Call
48. BN_CTX_start(ctx);
49. d = BN_CTX_get(ctx);
50. r = BN_CTX_get(ctx);
^
51. val1[0] = BN_CTX_get(ctx);
52. val2[0] = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_exp2.c:51:15: Call
49. d = BN_CTX_get(ctx);
50. r = BN_CTX_get(ctx);
51. val1[0] = BN_CTX_get(ctx);
^
52. val2[0] = BN_CTX_get(ctx);
53. if (val2[0] == NULL)
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_exp2.c:52:15: Call
50. r = BN_CTX_get(ctx);
51. val1[0] = BN_CTX_get(ctx);
52. val2[0] = BN_CTX_get(ctx);
^
53. if (val2[0] == NULL)
54. goto err;
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_exp2.c:83:10: Call
81. }
82.
83. if (!BN_to_montgomery(val1[0], a_mod_m, mont, ctx))
^
84. goto err;
85. if (window1 > 1) {
crypto/bn/bn_lib.c:889:1: Parameter `ctx->stack.depth`
887. }
888.
889. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
890. BN_CTX *ctx)
891. {
crypto/bn/bn_lib.c:892:12: Call
890. BN_CTX *ctx)
891. {
892. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
^
893. }
894.
crypto/bn/bn_mont.c:26:1: Parameter `ctx->stack.depth`
24. #endif
25.
26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
crypto/bn/bn_mont.c:29:15: Call
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
29. int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx);
^
30.
31. bn_correct_top(r);
crypto/bn/bn_mont.c:37:1: Parameter `ctx->stack.depth`
35. }
36.
37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
38. BN_MONT_CTX *mont, BN_CTX *ctx)
39. {
crypto/bn/bn_exp2.c:101:14: Call
99. */
100. if (a2->neg || BN_ucmp(a2, m) >= 0) {
101. if (!BN_mod(val2[0], a2, m, ctx))
^
102. goto err;
103. a_mod_m = val2[0];
crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:229:11: Call
227. }
228.
229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
^
230.
231. if (ret) {
crypto/bn/bn_div.c:280:5: Call
278. bn_check_top(rm);
279.
280. BN_CTX_start(ctx);
^
281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
282. tmp = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_div.c:450:5: Call
448. if (rm != NULL)
449. bn_rshift_fixed_top(rm, snum, norm_shift);
450. BN_CTX_end(ctx);
^
451. return 1;
452. err:
crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/bn/bn_ctx.c:191:27: Call
189. ctx->err_stack--;
190. else {
191. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
192. /* Does this stack frame have anything to release? */
193. if (fp < ctx->used)
crypto/bn/bn_ctx.c:266:1: <Offset trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: <Length trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_div`
266. static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
^
269. }
270.
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
|
d2a_code_trace_data_44650
|
static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr,
int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale, int flags, int size, int h)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d;
int dmin;
int map_generation;
int penalty_factor;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
LOAD_COMMON2
if(c->pre_pass){
penalty_factor= c->pre_penalty_factor;
cmpf= s->dsp.me_pre_cmp[size];
chroma_cmpf= s->dsp.me_pre_cmp[size+1];
}else{
penalty_factor= c->penalty_factor;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
}
map_generation= update_map_generation(c);
assert(cmpf);
dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);
map[0]= map_generation;
score_map[0]= dmin;
if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}else{
if(dmin<((h*h*s->avctx->mv0_threshold)>>8)
&& ( P_LEFT[0] |P_LEFT[1]
|P_TOP[0] |P_TOP[1]
|P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){
*mx_ptr= 0;
*my_ptr= 0;
c->skip=1;
return dmin;
}
CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
}
if(dmin>h*h*4){
if(c->pre_pass){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
if(!s->first_slice_line)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}else{
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
}
if(c->avctx->last_predictor_count){
const int count= c->avctx->last_predictor_count;
const int xstart= FFMAX(0, s->mb_x - count);
const int ystart= FFMAX(0, s->mb_y - count);
const int xend= FFMIN(s->mb_width , s->mb_x + count + 1);
const int yend= FFMIN(s->mb_height, s->mb_y + count + 1);
int mb_y;
for(mb_y=ystart; mb_y<yend; mb_y++){
int mb_x;
for(mb_x=xstart; mb_x<xend; mb_x++){
const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride;
int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16;
int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16;
if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue;
CHECK_MV(mx,my)
}
}
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1058: error: Uninitialized Value
The value read from ymax was never initialized.
libavcodec/motion_est_template.c:1058:9:
1056. CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
1057. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
1058. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
^
1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
1060. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1058
|
d2a_code_trace_data_44651
|
void
TIFFSwabLong8(uint64* lp)
{
register unsigned char* cp = (unsigned char*) lp;
unsigned char t;
assert(sizeof(uint64)==8);
t = cp[7]; cp[7] = cp[0]; cp[0] = t;
t = cp[6]; cp[6] = cp[1]; cp[1] = t;
t = cp[5]; cp[5] = cp[2]; cp[2] = t;
t = cp[4]; cp[4] = cp[3]; cp[3] = t;
}
libtiff/tif_dirread.c:1812: error: Buffer Overrun L3
Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFSwabLong8`.
libtiff/tif_dirread.c:1708:6: Call
1706. return(TIFFReadDirEntryErrType);
1707. }
1708. err=TIFFReadDirEntryArray(tif,direntry,&count,4,&origdata);
^
1709. if ((err!=TIFFReadDirEntryErrOk)||(origdata==0))
1710. {
libtiff/tif_dirread.c:756:1: Parameter `**value`
754. }
755.
756. static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32* count, uint32 desttypesize, void** value)
^
757. {
758. int typesize;
libtiff/tif_dirread.c:1807:5: Assignment
1805. int32* mb;
1806. uint32 n;
1807. ma=(uint64*)origdata;
^
1808. mb=data;
1809. for (n=0; n<count; n++)
libtiff/tif_dirread.c:1812:7: Call
1810. {
1811. if (tif->tif_flags&TIFF_SWAB)
1812. TIFFSwabLong8(ma);
^
1813. err=TIFFReadDirEntryCheckRangeSlongLong8(*ma);
1814. if (err!=TIFFReadDirEntryErrOk)
libtiff/tif_swab.c:58:1: <Length trace>
56.
57. #ifndef TIFFSwabLong8
58. void
^
59. TIFFSwabLong8(uint64* lp)
60. {
libtiff/tif_swab.c:58:1: Parameter `*lp`
56.
57. #ifndef TIFFSwabLong8
58. void
^
59. TIFFSwabLong8(uint64* lp)
60. {
libtiff/tif_swab.c:61:2: Assignment
59. TIFFSwabLong8(uint64* lp)
60. {
61. register unsigned char* cp = (unsigned char*) lp;
^
62. unsigned char t;
63. assert(sizeof(uint64)==8);
libtiff/tif_swab.c:64:6: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFSwabLong8`
62. unsigned char t;
63. assert(sizeof(uint64)==8);
64. t = cp[7]; cp[7] = cp[0]; cp[0] = t;
^
65. t = cp[6]; cp[6] = cp[1]; cp[1] = t;
66. t = cp[5]; cp[5] = cp[2]; cp[2] = t;
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L64
|
d2a_code_trace_data_44652
|
unsigned char *next_protos_parse(size_t *outlen, const char *in)
{
size_t len;
unsigned char *out;
size_t i, start = 0;
len = strlen(in);
if (len >= 65535)
return NULL;
out = app_malloc(strlen(in) + 1, "NPN buffer");
for (i = 0; i <= len; ++i) {
if (i == len || in[i] == ',') {
if (i - start > 255) {
OPENSSL_free(out);
return NULL;
}
out[start] = (unsigned char)(i - start);
start = i + 1;
} else {
out[i + 1] = in[i];
}
}
*outlen = len + 1;
return out;
}
apps/apps.c:1812: error: NULL_DEREFERENCE
pointer `out` last assigned on line 1805 could be null and is dereferenced at line 1812, column 13.
Showing all 25 steps of the trace
apps/apps.c:1795:1: start of procedure next_protos_parse()
1793. * returns: a malloc'd buffer or NULL on failure.
1794. */
1795. > unsigned char *next_protos_parse(size_t *outlen, const char *in)
1796. {
1797. size_t len;
apps/apps.c:1799:5:
1797. size_t len;
1798. unsigned char *out;
1799. > size_t i, start = 0;
1800.
1801. len = strlen(in);
apps/apps.c:1801:5:
1799. size_t i, start = 0;
1800.
1801. > len = strlen(in);
1802. if (len >= 65535)
1803. return NULL;
apps/apps.c:1802:9: Taking false branch
1800.
1801. len = strlen(in);
1802. if (len >= 65535)
^
1803. return NULL;
1804.
apps/apps.c:1805:5:
1803. return NULL;
1804.
1805. > out = app_malloc(strlen(in) + 1, "NPN buffer");
1806. for (i = 0; i <= len; ++i) {
1807. if (i == len || in[i] == ',') {
test/testutil/apps_mem.c:14:1: start of procedure app_malloc()
12. /* shim that avoids sucking in too much from apps/apps.c */
13.
14. > void* app_malloc(int sz, const char *what)
15. {
16. void *vp = OPENSSL_malloc(sz);
test/testutil/apps_mem.c:16:5:
14. void* app_malloc(int sz, const char *what)
15. {
16. > void *vp = OPENSSL_malloc(sz);
17.
18. return vp;
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking false branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
test/testutil/apps_mem.c:18:5:
16. void *vp = OPENSSL_malloc(sz);
17.
18. > return vp;
19. }
test/testutil/apps_mem.c:19:1: return from a call to app_malloc
17.
18. return vp;
19. > }
apps/apps.c:1806:10:
1804.
1805. out = app_malloc(strlen(in) + 1, "NPN buffer");
1806. > for (i = 0; i <= len; ++i) {
1807. if (i == len || in[i] == ',') {
1808. if (i - start > 255) {
apps/apps.c:1806:17: Loop condition is true. Entering loop body
1804.
1805. out = app_malloc(strlen(in) + 1, "NPN buffer");
1806. for (i = 0; i <= len; ++i) {
^
1807. if (i == len || in[i] == ',') {
1808. if (i - start > 255) {
apps/apps.c:1807:13: Taking false branch
1805. out = app_malloc(strlen(in) + 1, "NPN buffer");
1806. for (i = 0; i <= len; ++i) {
1807. if (i == len || in[i] == ',') {
^
1808. if (i - start > 255) {
1809. OPENSSL_free(out);
apps/apps.c:1807:25: Taking true branch
1805. out = app_malloc(strlen(in) + 1, "NPN buffer");
1806. for (i = 0; i <= len; ++i) {
1807. if (i == len || in[i] == ',') {
^
1808. if (i - start > 255) {
1809. OPENSSL_free(out);
apps/apps.c:1808:17: Taking false branch
1806. for (i = 0; i <= len; ++i) {
1807. if (i == len || in[i] == ',') {
1808. if (i - start > 255) {
^
1809. OPENSSL_free(out);
1810. return NULL;
apps/apps.c:1812:13:
1810. return NULL;
1811. }
1812. > out[start] = (unsigned char)(i - start);
1813. start = i + 1;
1814. } else {
|
https://github.com/openssl/openssl/blob/d3620841cc39aaa4a3d75ea32e94ccd110b5bef4/apps/apps.c/#L1812
|
d2a_code_trace_data_44653
|
int ctr_generate(RAND_DRBG *drbg,
unsigned char *out, size_t outlen,
const unsigned char *adin, size_t adinlen)
{
RAND_DRBG_CTR *ctr = &drbg->ctr;
if (adin != NULL && adinlen != 0) {
ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0);
if (drbg->flags & RAND_DRBG_FLAG_CTR_USE_DF) {
adin = NULL;
adinlen = 1;
}
} else {
adinlen = 0;
}
for ( ; ; ) {
inc_128(ctr);
if (outlen < 16) {
AES_encrypt(ctr->V, ctr->K, &ctr->ks);
memcpy(out, ctr->K, outlen);
break;
}
AES_encrypt(ctr->V, out, &ctr->ks);
out += 16;
outlen -= 16;
if (outlen == 0)
break;
}
ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0);
return 1;
}
ssl/statem/statem_clnt.c:1076: error: BUFFER_OVERRUN_L3
Offset added: [1, 15] Size: [0, +oo] by call to `ssl_fill_hello_random`.
Showing all 12 steps of the trace
ssl/statem/statem_clnt.c:1076:14: Call
1074. }
1075.
1076. if (i && ssl_fill_hello_random(s, 0, p, sizeof(s->s3->client_random),
^
1077. DOWNGRADE_NONE) <= 0) {
1078. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CLIENT_HELLO,
ssl/s3_lib.c:4521:1: Parameter `len`
4519. * failure, 1 on success.
4520. */
4521. > int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, size_t len,
4522. DOWNGRADE dgrd)
4523. {
ssl/s3_lib.c:4539:15: Call
4537. ret = ssl_randbytes(s, p, len - 4);
4538. } else {
4539. ret = ssl_randbytes(s, result, len);
^
4540. }
4541. #ifndef OPENSSL_NO_TLS13DOWNGRADE
ssl/ssl_lib.c:5172:1: Parameter `size`
5170. }
5171.
5172. > int ssl_randbytes(SSL *s, unsigned char *rnd, size_t size)
5173. {
5174. if (s->drbg != NULL) {
ssl/ssl_lib.c:5187:17: Call
5185. * here.
5186. */
5187. return RAND_DRBG_generate(s->drbg, rnd, size, 0, NULL, 0);
^
5188. }
5189. return RAND_bytes(rnd, (int)size);
crypto/rand/drbg_lib.c:363:1: Parameter `outlen`
361. *
362. */
363. > int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen,
364. int prediction_resistance,
365. const unsigned char *adin, size_t adinlen)
crypto/rand/drbg_lib.c:409:10: Call
407. }
408.
409. if (!ctr_generate(drbg, out, outlen, adin, adinlen)) {
^
410. drbg->state = DRBG_ERROR;
411. RANDerr(RAND_F_RAND_DRBG_GENERATE, RAND_R_GENERATE_ERROR);
crypto/rand/drbg_rand.c:266:1: <Offset trace>
264. }
265.
266. > int ctr_generate(RAND_DRBG *drbg,
267. unsigned char *out, size_t outlen,
268. const unsigned char *adin, size_t adinlen)
crypto/rand/drbg_rand.c:266:1: Parameter `outlen`
264. }
265.
266. > int ctr_generate(RAND_DRBG *drbg,
267. unsigned char *out, size_t outlen,
268. const unsigned char *adin, size_t adinlen)
crypto/rand/drbg_rand.c:266:1: <Length trace>
264. }
265.
266. > int ctr_generate(RAND_DRBG *drbg,
267. unsigned char *out, size_t outlen,
268. const unsigned char *adin, size_t adinlen)
crypto/rand/drbg_rand.c:266:1: Parameter `drbg->ctr.K[*]`
264. }
265.
266. > int ctr_generate(RAND_DRBG *drbg,
267. unsigned char *out, size_t outlen,
268. const unsigned char *adin, size_t adinlen)
crypto/rand/drbg_rand.c:288:13: Array access: Offset added: [1, 15] Size: [0, +oo] by call to `ssl_fill_hello_random`
286. /* Use K as temp space as it will be updated */
287. AES_encrypt(ctr->V, ctr->K, &ctr->ks);
288. memcpy(out, ctr->K, outlen);
^
289. break;
290. }
|
https://github.com/openssl/openssl/blob/e7d961e994620dd5dee6d80794a07fb9de1bab66/crypto/rand/drbg_rand.c/#L288
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.