id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_42454
void ff_h264_draw_horiz_band(H264Context *h, int y, int height) { AVCodecContext *avctx = h->avctx; Picture *cur = &h->cur_pic; Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); int vshift = desc->log2_chroma_h; const int field_pic = h->picture_structure != PICT_FRAME; if (field_pic) { height <<= 1; y <<= 1; } height = FFMIN(height, avctx->height - y); if (field_pic && h->first_field && !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) return; if (avctx->draw_horiz_band) { AVFrame *src; int offset[AV_NUM_DATA_POINTERS]; int i; if (cur->f.pict_type == AV_PICTURE_TYPE_B || h->low_delay || (avctx->slice_flags & SLICE_FLAG_CODED_ORDER)) src = &cur->f; else if (last) src = &last->f; else return; offset[0] = y * src->linesize[0]; offset[1] = offset[2] = (y >> vshift) * src->linesize[1]; for (i = 3; i < AV_NUM_DATA_POINTERS; i++) offset[i] = 0; emms_c(); avctx->draw_horiz_band(avctx, src, offset, y, h->picture_structure, height); } } libavcodec/h264.c:130: error: Null Dereference pointer `desc` last assigned on line 129 could be null and is dereferenced at line 130, column 18. libavcodec/h264.c:124:1: start of procedure ff_h264_draw_horiz_band() 122. } 123. 124. void ff_h264_draw_horiz_band(H264Context *h, int y, int height) ^ 125. { 126. AVCodecContext *avctx = h->avctx; libavcodec/h264.c:126:5: 124. void ff_h264_draw_horiz_band(H264Context *h, int y, int height) 125. { 126. AVCodecContext *avctx = h->avctx; ^ 127. Picture *cur = &h->cur_pic; 128. Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL; libavcodec/h264.c:127:5: 125. { 126. AVCodecContext *avctx = h->avctx; 127. Picture *cur = &h->cur_pic; ^ 128. Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL; 129. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); libavcodec/h264.c:128:21: Condition is true 126. AVCodecContext *avctx = h->avctx; 127. Picture *cur = &h->cur_pic; 128. Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL; ^ 129. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); 130. int vshift = desc->log2_chroma_h; libavcodec/h264.c:128:5: 126. AVCodecContext *avctx = h->avctx; 127. Picture *cur = &h->cur_pic; 128. Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL; ^ 129. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); 130. int vshift = desc->log2_chroma_h; libavcodec/h264.c:129:5: 127. Picture *cur = &h->cur_pic; 128. Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL; 129. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); ^ 130. int vshift = desc->log2_chroma_h; 131. const int field_pic = h->picture_structure != PICT_FRAME; libavutil/pixdesc.c:1468:1: start of procedure av_pix_fmt_desc_get() 1466. } 1467. 1468. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1469. { 1470. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1470:9: Taking false branch 1468. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1469. { 1470. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1471. return NULL; 1472. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1470:24: Taking true branch 1468. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1469. { 1470. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1471. return NULL; 1472. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1471:9: 1469. { 1470. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1471. return NULL; ^ 1472. return &av_pix_fmt_descriptors[pix_fmt]; 1473. } libavutil/pixdesc.c:1473:1: return from a call to av_pix_fmt_desc_get 1471. return NULL; 1472. return &av_pix_fmt_descriptors[pix_fmt]; 1473. } ^ 1474. 1475. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) libavcodec/h264.c:130:5: 128. Picture *last = h->ref_list[0][0].f.data[0] ? &h->ref_list[0][0] : NULL; 129. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); 130. int vshift = desc->log2_chroma_h; ^ 131. const int field_pic = h->picture_structure != PICT_FRAME; 132. if (field_pic) {
https://github.com/libav/libav/blob/2852740e23f91d6775714d7cc29b9a73e1111ce0/libavcodec/h264.c/#L130
d2a_code_trace_data_42455
int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) { int i, level = 1; ossl_uintmax_t n = posn; void **p; if (sa == NULL) return 0; for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++) if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0) break; for (;sa->levels < level; sa->levels++) { p = alloc_node(); if (p == NULL) return 0; p[0] = sa->nodes; sa->nodes = p; } if (sa->top < posn) sa->top = posn; p = sa->nodes; for (level = sa->levels - 1; level > 0; level--) { i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK; if (p[i] == NULL && (p[i] = alloc_node()) == NULL) return 0; p = p[i]; } p += posn & SA_BLOCK_MASK; if (val == NULL && *p != NULL) sa->nelem--; else if (val != NULL && *p == NULL) sa->nelem++; *p = val; return 1; } test/property_test.c:232: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `ossl_method_store_add`. Showing all 12 steps of the trace test/property_test.c:232:14: Call 230. 231. for (i = 0; i < OSSL_NELEM(impls); i++) 232. if (!TEST_true(ossl_method_store_add(store, impls[i].nid, impls[i].prop, ^ 233. impls[i].impl, NULL))) { 234. TEST_note("iteration %zd", i + 1); crypto/property/property.c:187:1: Parameter `store->algs->nelem` 185. } 186. 187. > int ossl_method_store_add(OSSL_METHOD_STORE *store, 188. int nid, const char *properties, 189. void *method, void (*method_destruct)(void *)) test/property_test.c:232:14: Call 230. 231. for (i = 0; i < OSSL_NELEM(impls); i++) 232. if (!TEST_true(ossl_method_store_add(store, impls[i].nid, impls[i].prop, ^ 233. impls[i].impl, NULL))) { 234. TEST_note("iteration %zd", i + 1); crypto/property/property.c:187:1: Parameter `store->algs->nelem` 185. } 186. 187. > int ossl_method_store_add(OSSL_METHOD_STORE *store, 188. int nid, const char *properties, 189. void *method, void (*method_destruct)(void *)) crypto/property/property.c:228:14: Call 226. goto err; 227. alg->nid = nid; 228. if (!ossl_method_store_insert(store, alg)) ^ 229. goto err; 230. } crypto/property/property.c:182:1: Parameter `store->algs->nelem` 180. } 181. 182. > static int ossl_method_store_insert(OSSL_METHOD_STORE *store, ALGORITHM *alg) 183. { 184. return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg); crypto/property/property.c:184:16: Call 182. static int ossl_method_store_insert(OSSL_METHOD_STORE *store, ALGORITHM *alg) 183. { 184. return ossl_sa_ALGORITHM_set(store->algs, alg->nid, alg); ^ 185. } 186. crypto/property/property.c:65:1: Parameter `sa->nelem` 63. } IMPL_CACHE_FLUSH; 64. 65. > DEFINE_SPARSE_ARRAY_OF(ALGORITHM); 66. 67. static void ossl_method_cache_flush(OSSL_METHOD_STORE *store, int nid); crypto/property/property.c:65:1: Call 63. } IMPL_CACHE_FLUSH; 64. 65. > DEFINE_SPARSE_ARRAY_OF(ALGORITHM); 66. 67. static void ossl_method_cache_flush(OSSL_METHOD_STORE *store, int nid); crypto/sparse_array.c:183:1: <LHS trace> 181. } 182. 183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) 184. { 185. int i, level = 1; crypto/sparse_array.c:183:1: Parameter `sa->nelem` 181. } 182. 183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) 184. { 185. int i, level = 1; crypto/sparse_array.c:215:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ossl_method_store_add` 213. p += posn & SA_BLOCK_MASK; 214. if (val == NULL && *p != NULL) 215. sa->nelem--; ^ 216. else if (val != NULL && *p == NULL) 217. sa->nelem++;
https://github.com/openssl/openssl/blob/8ab53b193a8e95bb2998744bc184146eb1ddcc23/crypto/sparse_array.c/#L215
d2a_code_trace_data_42456
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } test/bntest.c:2144: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex`. Showing all 50 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:745:14: Assignment 743. /* 2^(top*BN_BITS2) - m */ 744. tmp.d[0] = (0 - m->d[0]) & BN_MASK2; 745. for (i = 1; i < top; i++) ^ 746. tmp.d[i] = (~m->d[i]) & BN_MASK2; 747. tmp.top = top; crypto/bn/bn_exp.c:1062:14: Call 1060. bits -= window0; 1061. wvalue = bn_get_bits(p, bits) & wmask; 1062. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue, ^ 1063. window)) 1064. goto err; crypto/bn/bn_exp.c:520:1: Parameter `top` 518. } 519. 520. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, 521. unsigned char *buf, int idx, 522. int window) crypto/bn/bn_exp.c:577:5: Assignment 575. } 576. 577. b->top = top; ^ 578. bn_correct_top(b); 579. return 1; crypto/bn/bn_exp.c:578:5: Call 576. 577. b->top = top; 578. bn_correct_top(b); ^ 579. return 1; 580. } crypto/bn/bn_lib.c:946:1: Parameter `a->top` 944. } 945. 946. > void bn_correct_top(BIGNUM *a) 947. { 948. BN_ULONG *ftl; crypto/bn/bn_exp.c:1075:22: Call 1073. /* Square the result window-size times */ 1074. for (i = 0; i < window; i++) 1075. if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) ^ 1076. goto err; 1077. crypto/bn/bn_mont.c:26:1: Parameter `a->top` 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:53:14: Call 51. bn_check_top(tmp); 52. if (a == b) { 53. if (!BN_sqr(tmp, a, ctx)) ^ 54. goto err; 55. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 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 max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:105:1: <Offset trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `n` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:116:5: Assignment 114. rp[0] = rp[max - 1] = 0; 115. rp++; 116. j = n; ^ 117. 118. if (--j > 0) { crypto/bn/bn_sqr.c:118:9: Assignment 116. j = n; 117. 118. if (--j > 0) { ^ 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:105:1: <Length trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `*r` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:113:5: Assignment 111. max = n * 2; 112. ap = a; 113. rp = r; ^ 114. rp[0] = rp[max - 1] = 0; 115. rp++; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp = r; 114. rp[0] = rp[max - 1] = 0; 115. rp++; ^ 116. j = n; 117. crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex` 118. if (--j > 0) { 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 121. rp += 2; 122. }
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_sqr.c/#L120
d2a_code_trace_data_42457
static void new_subtitle_stream(AVFormatContext *oc, int file_idx) { AVStream *st; AVOutputStream *ost; AVCodec *codec=NULL; AVCodecContext *subtitle_enc; enum CodecID codec_id = CODEC_ID_NONE; st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); if (!st) { fprintf(stderr, "Could not alloc stream\n"); ffmpeg_exit(1); } ost = new_output_stream(oc, file_idx); subtitle_enc = st->codec; output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); if(!subtitle_stream_copy){ if (subtitle_codec_name) { codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1, avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->strict_std_compliance); codec= output_codecs[nb_output_codecs-1] = avcodec_find_encoder_by_name(subtitle_codec_name); } else { codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_SUBTITLE); codec = avcodec_find_encoder(codec_id); } } avcodec_get_context_defaults3(st->codec, codec); ost->bitstream_filters = subtitle_bitstream_filters; subtitle_bitstream_filters= NULL; subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE; if(subtitle_codec_tag) subtitle_enc->codec_tag= subtitle_codec_tag; if (oc->oformat->flags & AVFMT_GLOBALHEADER) { subtitle_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->flags |= CODEC_FLAG_GLOBAL_HEADER; } if (subtitle_stream_copy) { st->stream_copy = 1; } else { subtitle_enc->codec_id = codec_id; set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM, codec); } if (subtitle_language) { av_metadata_set2(&st->metadata, "language", subtitle_language, 0); av_freep(&subtitle_language); } subtitle_disable = 0; av_freep(&subtitle_codec_name); subtitle_stream_copy = 0; } ffmpeg.c:3686: error: Null Dereference pointer `st` last assigned on line 3680 could be null and is dereferenced at line 3686, column 20. ffmpeg.c:3672:1: start of procedure new_subtitle_stream() 3670. } 3671. 3672. static void new_subtitle_stream(AVFormatContext *oc, int file_idx) ^ 3673. { 3674. AVStream *st; ffmpeg.c:3676:5: 3674. AVStream *st; 3675. AVOutputStream *ost; 3676. AVCodec *codec=NULL; ^ 3677. AVCodecContext *subtitle_enc; 3678. enum CodecID codec_id = CODEC_ID_NONE; ffmpeg.c:3678:5: 3676. AVCodec *codec=NULL; 3677. AVCodecContext *subtitle_enc; 3678. enum CodecID codec_id = CODEC_ID_NONE; ^ 3679. 3680. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); ffmpeg.c:3680:28: Condition is true 3678. enum CodecID codec_id = CODEC_ID_NONE; 3679. 3680. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); ^ 3681. if (!st) { 3682. fprintf(stderr, "Could not alloc stream\n"); ffmpeg.c:3680:5: 3678. enum CodecID codec_id = CODEC_ID_NONE; 3679. 3680. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); ^ 3681. if (!st) { 3682. fprintf(stderr, "Could not alloc stream\n"); libavformat/utils.c:2588:1: start of procedure av_new_stream() 2586. } 2587. 2588. AVStream *av_new_stream(AVFormatContext *s, int id) ^ 2589. { 2590. AVStream *st; libavformat/utils.c:2594:9: Taking true branch 2592. AVStream **streams; 2593. 2594. if (s->nb_streams >= INT_MAX/sizeof(*streams)) ^ 2595. return NULL; 2596. streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams)); libavformat/utils.c:2595:9: 2593. 2594. if (s->nb_streams >= INT_MAX/sizeof(*streams)) 2595. return NULL; ^ 2596. streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams)); 2597. if (!streams) libavformat/utils.c:2637:1: return from a call to av_new_stream 2635. s->streams[s->nb_streams++] = st; 2636. return st; 2637. } ^ 2638. 2639. AVProgram *av_new_program(AVFormatContext *ac, int id) ffmpeg.c:3681:10: Taking true branch 3679. 3680. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); 3681. if (!st) { ^ 3682. fprintf(stderr, "Could not alloc stream\n"); 3683. ffmpeg_exit(1); ffmpeg.c:3682:9: 3680. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); 3681. if (!st) { 3682. fprintf(stderr, "Could not alloc stream\n"); ^ 3683. ffmpeg_exit(1); 3684. } ffmpeg.c:3683:9: Skipping ffmpeg_exit(): empty list of specs 3681. if (!st) { 3682. fprintf(stderr, "Could not alloc stream\n"); 3683. ffmpeg_exit(1); ^ 3684. } 3685. ost = new_output_stream(oc, file_idx); ffmpeg.c:3685:5: Skipping new_output_stream(): empty list of specs 3683. ffmpeg_exit(1); 3684. } 3685. ost = new_output_stream(oc, file_idx); ^ 3686. subtitle_enc = st->codec; 3687. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); ffmpeg.c:3686:5: 3684. } 3685. ost = new_output_stream(oc, file_idx); 3686. subtitle_enc = st->codec; ^ 3687. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); 3688. if(!subtitle_stream_copy){
https://github.com/libav/libav/blob/6465c820da7b104150366a8cdd837c00cf364235/ffmpeg.c/#L3686
d2a_code_trace_data_42458
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/alsdec.c:1191: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`. libavcodec/alsdec.c:1183:54: Call 1181. 1182. while (entries < channels && !(current->stop_flag = bitstream_read_bit(bc))) { 1183. current->master_channel = bitstream_read(bc, av_ceil_log2(channels)); ^ 1184. 1185. if (current->master_channel >= channels) { libavutil/common.h:229:12: Unknown value from: __builtin_clz 227. static av_always_inline av_const int av_ceil_log2_c(int x) 228. { 229. return av_log2((x - 1) << 1); ^ 230. } 231. libavutil/common.h:229:5: Assignment 227. static av_always_inline av_const int av_ceil_log2_c(int x) 228. { 229. return av_log2((x - 1) << 1); ^ 230. } 231. libavcodec/alsdec.c:1183:35: Call 1181. 1182. while (entries < channels && !(current->stop_flag = bitstream_read_bit(bc))) { 1183. current->master_channel = bitstream_read(bc, av_ceil_log2(channels)); ^ 1184. 1185. if (current->master_channel >= channels) { libavcodec/bitstream.h:183:1: Parameter `bc->bits_left` 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/alsdec.c:1191:39: Call 1189. 1190. if (current->master_channel != c) { 1191. current->time_diff_flag = bitstream_read_bit(bc); ^ 1192. current->weighting[0] = als_weighting(bc, 1, 16); 1193. current->weighting[1] = als_weighting(bc, 2, 14); libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. 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: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/7ff018c1cb43a5fe5ee2049d325cdd785852067a/libavcodec/bitstream.h/#L139
d2a_code_trace_data_42459
static int cert_status_cb(SSL *s, void *arg) { tlsextstatusctx *srctx = arg; BIO *err = srctx->err; char *host, *port, *path; int use_ssl; unsigned char *rspder = NULL; int rspderlen; STACK_OF(OPENSSL_STRING) *aia = NULL; X509 *x = NULL; X509_STORE_CTX inctx; X509_OBJECT obj; OCSP_REQUEST *req = NULL; OCSP_RESPONSE *resp = NULL; OCSP_CERTID *id = NULL; STACK_OF(X509_EXTENSION) *exts; int ret = SSL_TLSEXT_ERR_NOACK; int i; #if 0 STACK_OF(OCSP_RESPID) *ids; SSL_get_tlsext_status_ids(s, &ids); BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids)); #endif if (srctx->verbose) BIO_puts(err, "cert_status: callback called\n"); x = SSL_get_certificate(s); aia = X509_get1_ocsp(x); if (aia) { if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0), &host, &port, &path, &use_ssl)) { BIO_puts(err, "cert_status: can't parse AIA URL\n"); goto err; } if (srctx->verbose) BIO_printf(err, "cert_status: AIA URL: %s\n", sk_OPENSSL_STRING_value(aia, 0)); } else { if (!srctx->host) { BIO_puts(srctx->err, "cert_status: no AIA and no default responder URL\n"); goto done; } host = srctx->host; path = srctx->path; port = srctx->port; use_ssl = srctx->use_ssl; } if (!X509_STORE_CTX_init(&inctx, SSL_CTX_get_cert_store(SSL_get_SSL_CTX(s)), NULL, NULL)) goto err; if (X509_STORE_get_by_subject(&inctx,X509_LU_X509, X509_get_issuer_name(x),&obj) <= 0) { BIO_puts(err, "cert_status: Can't retrieve issuer certificate.\n"); X509_STORE_CTX_cleanup(&inctx); goto done; } req = OCSP_REQUEST_new(); if (!req) goto err; id = OCSP_cert_to_id(NULL, x, obj.data.x509); X509_free(obj.data.x509); X509_STORE_CTX_cleanup(&inctx); if (!id) goto err; if (!OCSP_request_add0_id(req, id)) goto err; id = NULL; SSL_get_tlsext_status_exts(s, &exts); for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i); if (!OCSP_REQUEST_add_ext(req, ext, -1)) goto err; } resp = process_responder(err, req, host, path, port, use_ssl, NULL, srctx->timeout); if (!resp) { BIO_puts(err, "cert_status: error querying responder\n"); goto done; } rspderlen = i2d_OCSP_RESPONSE(resp, &rspder); if (rspderlen <= 0) goto err; SSL_set_tlsext_status_ocsp_resp(s, rspder, rspderlen); if (srctx->verbose) { BIO_puts(err, "cert_status: ocsp response sent:\n"); OCSP_RESPONSE_print(err, resp, 2); } ret = SSL_TLSEXT_ERR_OK; done: if (ret != SSL_TLSEXT_ERR_OK) ERR_print_errors(err); if (aia) { OPENSSL_free(host); OPENSSL_free(path); OPENSSL_free(port); X509_email_free(aia); } if (id) OCSP_CERTID_free(id); if (req) OCSP_REQUEST_free(req); if (resp) OCSP_RESPONSE_free(resp); return ret; err: ret = SSL_TLSEXT_ERR_ALERT_FATAL; goto done; } apps/s_server.c:807: error: NULL_DEREFERENCE pointer `x` last assigned on line 806 could be null and is dereferenced by call to `X509_get1_ocsp()` at line 807, column 8. Showing all 27 steps of the trace apps/s_server.c:780:1: start of procedure cert_status_cb() 778. */ 779. 780. > static int cert_status_cb(SSL *s, void *arg) 781. { 782. tlsextstatusctx *srctx = arg; apps/s_server.c:782:2: 780. static int cert_status_cb(SSL *s, void *arg) 781. { 782. > tlsextstatusctx *srctx = arg; 783. BIO *err = srctx->err; 784. char *host, *port, *path; apps/s_server.c:783:2: 781. { 782. tlsextstatusctx *srctx = arg; 783. > BIO *err = srctx->err; 784. char *host, *port, *path; 785. int use_ssl; apps/s_server.c:786:2: 784. char *host, *port, *path; 785. int use_ssl; 786. > unsigned char *rspder = NULL; 787. int rspderlen; 788. STACK_OF(OPENSSL_STRING) *aia = NULL; apps/s_server.c:788:2: 786. unsigned char *rspder = NULL; 787. int rspderlen; 788. > STACK_OF(OPENSSL_STRING) *aia = NULL; 789. X509 *x = NULL; 790. X509_STORE_CTX inctx; apps/s_server.c:789:2: 787. int rspderlen; 788. STACK_OF(OPENSSL_STRING) *aia = NULL; 789. > X509 *x = NULL; 790. X509_STORE_CTX inctx; 791. X509_OBJECT obj; apps/s_server.c:792:2: 790. X509_STORE_CTX inctx; 791. X509_OBJECT obj; 792. > OCSP_REQUEST *req = NULL; 793. OCSP_RESPONSE *resp = NULL; 794. OCSP_CERTID *id = NULL; apps/s_server.c:793:2: 791. X509_OBJECT obj; 792. OCSP_REQUEST *req = NULL; 793. > OCSP_RESPONSE *resp = NULL; 794. OCSP_CERTID *id = NULL; 795. STACK_OF(X509_EXTENSION) *exts; apps/s_server.c:794:2: 792. OCSP_REQUEST *req = NULL; 793. OCSP_RESPONSE *resp = NULL; 794. > OCSP_CERTID *id = NULL; 795. STACK_OF(X509_EXTENSION) *exts; 796. int ret = SSL_TLSEXT_ERR_NOACK; apps/s_server.c:796:2: 794. OCSP_CERTID *id = NULL; 795. STACK_OF(X509_EXTENSION) *exts; 796. > int ret = SSL_TLSEXT_ERR_NOACK; 797. int i; 798. #if 0 apps/s_server.c:803:6: Taking true branch 801. BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids)); 802. #endif 803. if (srctx->verbose) ^ 804. BIO_puts(err, "cert_status: callback called\n"); 805. /* Build up OCSP query from server certificate */ apps/s_server.c:804:3: 802. #endif 803. if (srctx->verbose) 804. > BIO_puts(err, "cert_status: callback called\n"); 805. /* Build up OCSP query from server certificate */ 806. x = SSL_get_certificate(s); crypto/bio/bio_lib.c:257:1: start of procedure BIO_puts() 255. } 256. 257. > int BIO_puts(BIO *b, const char *in) 258. { 259. int i; crypto/bio/bio_lib.c:262:7: Taking false branch 260. long (*cb)(BIO *,int,const char *,int,long,long); 261. 262. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) ^ 263. { 264. BIOerr(BIO_F_BIO_PUTS,BIO_R_UNSUPPORTED_METHOD); crypto/bio/bio_lib.c:262:22: Taking false branch 260. long (*cb)(BIO *,int,const char *,int,long,long); 261. 262. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) ^ 263. { 264. BIOerr(BIO_F_BIO_PUTS,BIO_R_UNSUPPORTED_METHOD); crypto/bio/bio_lib.c:262:45: Taking false branch 260. long (*cb)(BIO *,int,const char *,int,long,long); 261. 262. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) ^ 263. { 264. BIOerr(BIO_F_BIO_PUTS,BIO_R_UNSUPPORTED_METHOD); crypto/bio/bio_lib.c:268:2: 266. } 267. 268. > cb=b->callback; 269. 270. if ((cb != NULL) && crypto/bio/bio_lib.c:270:7: Taking true branch 268. cb=b->callback; 269. 270. if ((cb != NULL) && ^ 271. ((i=(int)cb(b,BIO_CB_PUTS,in,0,0L,1L)) <= 0)) 272. return(i); crypto/bio/bio_lib.c:271:4: Taking true branch 269. 270. if ((cb != NULL) && 271. ((i=(int)cb(b,BIO_CB_PUTS,in,0,0L,1L)) <= 0)) ^ 272. return(i); 273. crypto/bio/bio_lib.c:272:4: 270. if ((cb != NULL) && 271. ((i=(int)cb(b,BIO_CB_PUTS,in,0,0L,1L)) <= 0)) 272. > return(i); 273. 274. if (!b->init) crypto/bio/bio_lib.c:288:2: return from a call to BIO_puts 286. 0L,(long)i); 287. return(i); 288. } ^ 289. 290. int BIO_gets(BIO *b, char *in, int inl) apps/s_server.c:806:2: 804. BIO_puts(err, "cert_status: callback called\n"); 805. /* Build up OCSP query from server certificate */ 806. > x = SSL_get_certificate(s); 807. aia = X509_get1_ocsp(x); 808. if (aia) ssl/ssl_lib.c:3054:1: start of procedure SSL_get_certificate() 3052. } 3053. 3054. > X509 *SSL_get_certificate(const SSL *s) 3055. { 3056. if (s->cert != NULL) ssl/ssl_lib.c:3056:6: Taking false branch 3054. X509 *SSL_get_certificate(const SSL *s) 3055. { 3056. if (s->cert != NULL) ^ 3057. return(s->cert->key->x509); 3058. else ssl/ssl_lib.c:3059:3: 3057. return(s->cert->key->x509); 3058. else 3059. > return(NULL); 3060. } 3061. ssl/ssl_lib.c:3060:2: return from a call to SSL_get_certificate 3058. else 3059. return(NULL); 3060. } ^ 3061. 3062. EVP_PKEY *SSL_get_privatekey(const SSL *s) apps/s_server.c:807:2: 805. /* Build up OCSP query from server certificate */ 806. x = SSL_get_certificate(s); 807. > aia = X509_get1_ocsp(x); 808. if (aia) 809. {
https://github.com/openssl/openssl/blob/3881d8106df732fc433d30446625dfa2396da42d/apps/s_server.c/#L807
d2a_code_trace_data_42460
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:1164: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:1164:9: 1162. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) 1163. }else{ 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)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1164
d2a_code_trace_data_42461
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:794: error: Buffer Overrun L1 Offset: [8, 11] (⇐ [0, 3] + 8) Size: 4 by call to `epzs_motion_search4`. libavcodec/motion_est.c:758:9: Assignment 756. init_mv4_ref(c); 757. 758. for(block=0; block<4; block++){ ^ 759. int mx4, my4; 760. int pred_x4, pred_y4; libavcodec/motion_est.c:794:17: Call 792. P_MV1[1]= my; 793. 794. dmin4 = epzs_motion_search4(s, &mx4, &my4, P, block, block, s->p_mv_table, (1<<16)>>shift); ^ 795. 796. dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h); libavcodec/motion_est_template.c:1131:1: Parameter `ref_index` 1129. } 1130. 1131. static int epzs_motion_search4(MpegEncContext * s, ^ 1132. int *mx_ptr, int *my_ptr, int P[10][2], 1133. int src_index, int ref_index, int16_t (*last_mv)[2], libavcodec/motion_est_template.c:1159:9: Call 1157. /* first line */ 1158. if (s->first_slice_line) { 1159. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) ^ 1160. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, 1161. (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:142:50: Array access: Offset: [8, 11] (⇐ [0, 3] + 8) Size: 4 by call to `epzs_motion_search4` 140. if(qpel){ 141. c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride); 142. c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride); ^ 143. }else{ 144. c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L142
d2a_code_trace_data_42462
static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){ PlaneContext * const p= &s->plane[plane_index]; RangeCoder * const c= &s->c; int x; int run_index= s->run_index; int run_count=0; int run_mode=0; if(s->ac){ if(c->bytestream_end - c->bytestream < w*20){ av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); return -1; } }else{ if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < w*4){ av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); return -1; } } for(x=0; x<w; x++){ int diff, context; context= get_context(s, sample[0]+x, sample[1]+x, sample[2]+x); diff= sample[0][x] - predict(sample[0]+x, sample[1]+x); if(context < 0){ context = -context; diff= -diff; } diff= fold(diff, bits); if(s->ac){ put_symbol(c, p->state[context], diff, 1); }else{ if(context == 0) run_mode=1; if(run_mode){ if(diff){ while(run_count >= 1<<log2_run[run_index]){ run_count -= 1<<log2_run[run_index]; run_index++; put_bits(&s->pb, 1, 1); } put_bits(&s->pb, 1 + log2_run[run_index], run_count); if(run_index) run_index--; run_count=0; run_mode=0; if(diff>0) diff--; }else{ run_count++; } } if(run_mode == 0) put_vlc_symbol(&s->pb, &p->vlc_state[context], diff, bits); } } if(run_mode){ while(run_count >= 1<<log2_run[run_index]){ run_count -= 1<<log2_run[run_index]; run_index++; put_bits(&s->pb, 1, 1); } if(run_count) put_bits(&s->pb, 1, 1); } s->run_index= run_index; return 0; } libavcodec/ffv1.c:493: error: Buffer Overrun L2 Offset: [1, 3] (⇐ [0, 2] + 1) Size: 3 by call to `encode_line`. libavcodec/ffv1.c:462:60: Array declaration 460. int x, y, p, i; 461. const int ring_size= s->avctx->context_model ? 3 : 2; 462. int_fast16_t sample_buffer[3][ring_size][w+6], *sample[3][ring_size]; ^ 463. s->run_index=0; 464. libavcodec/ffv1.c:493:13: Call 491. sample[p][0][-1]= sample[p][1][0 ]; 492. sample[p][1][ w]= sample[p][1][w-1]; 493. encode_line(s, w, sample[p], FFMIN(p, 1), 9); ^ 494. } 495. } libavcodec/ffv1.c:358:1: <Length trace> 356. 357. #ifdef CONFIG_ENCODERS 358. static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){ ^ 359. PlaneContext * const p= &s->plane[plane_index]; 360. RangeCoder * const c= &s->c; libavcodec/ffv1.c:358:1: Parameter `*sample` 356. 357. #ifdef CONFIG_ENCODERS 358. static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){ ^ 359. PlaneContext * const p= &s->plane[plane_index]; 360. RangeCoder * const c= &s->c; libavcodec/ffv1.c:382:51: Array access: Offset: [1, 3] (⇐ [0, 2] + 1) Size: 3 by call to `encode_line` 380. 381. context= get_context(s, sample[0]+x, sample[1]+x, sample[2]+x); 382. diff= sample[0][x] - predict(sample[0]+x, sample[1]+x); ^ 383. 384. if(context < 0){
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ffv1.c/#L382
d2a_code_trace_data_42463
static int ctr_BCC_update(RAND_DRBG_CTR *ctr, const unsigned char *in, size_t inlen) { if (in == NULL || inlen == 0) return 1; if (ctr->bltmp_pos) { size_t left = 16 - ctr->bltmp_pos; if (inlen >= left) { memcpy(ctr->bltmp + ctr->bltmp_pos, in, left); if (!ctr_BCC_blocks(ctr, ctr->bltmp)) return 0; ctr->bltmp_pos = 0; inlen -= left; in += left; } } for (; inlen >= 16; in += 16, inlen -= 16) { if (!ctr_BCC_blocks(ctr, in)) return 0; } if (inlen > 0) { memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen); ctr->bltmp_pos += inlen; } return 1; } crypto/rand/drbg_ctr.c:197: error: INTEGER_OVERFLOW_L2 ([1, `in2len`] - [-7, 15]):unsigned64 by call to `ctr_BCC_update`. Showing all 7 steps of the trace crypto/rand/drbg_ctr.c:165:8: Parameter `in2len` 163. } 164. 165. __owur static int ctr_df(RAND_DRBG_CTR *ctr, ^ 166. const unsigned char *in1, size_t in1len, 167. const unsigned char *in2, size_t in2len, crypto/rand/drbg_ctr.c:197:13: Call 195. ctr->bltmp_pos = 8; 196. if (!ctr_BCC_update(ctr, in1, in1len) 197. || !ctr_BCC_update(ctr, in2, in2len) ^ 198. || !ctr_BCC_update(ctr, in3, in3len) 199. || !ctr_BCC_update(ctr, &c80, 1) crypto/rand/drbg_ctr.c:120:8: <LHS trace> 118. * Process several blocks into BCC algorithm, some possibly partial 119. */ 120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr, ^ 121. const unsigned char *in, size_t inlen) 122. { crypto/rand/drbg_ctr.c:120:8: Parameter `inlen` 118. * Process several blocks into BCC algorithm, some possibly partial 119. */ 120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr, ^ 121. const unsigned char *in, size_t inlen) 122. { crypto/rand/drbg_ctr.c:120:8: <RHS trace> 118. * Process several blocks into BCC algorithm, some possibly partial 119. */ 120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr, ^ 121. const unsigned char *in, size_t inlen) 122. { crypto/rand/drbg_ctr.c:120:8: Parameter `inlen` 118. * Process several blocks into BCC algorithm, some possibly partial 119. */ 120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr, ^ 121. const unsigned char *in, size_t inlen) 122. { crypto/rand/drbg_ctr.c:136:13: Binary operation: ([1, in2len] - [-7, 15]):unsigned64 by call to `ctr_BCC_update` 134. return 0; 135. ctr->bltmp_pos = 0; 136. inlen -= left; ^ 137. in += left; 138. }
https://github.com/openssl/openssl/blob/e613b1eff40f21cd99240f9884cd3396b0ab50f1/crypto/rand/drbg_ctr.c/#L136
d2a_code_trace_data_42464
unsigned char *OPENSSL_utf82uni(const char *asc, int asclen, unsigned char **uni, int *unilen) { int ulen, i, j; unsigned char *unitmp, *ret; unsigned long utf32chr = 0; if (asclen == -1) asclen = strlen(asc); for (ulen = 0, i = 0; i < asclen; i += j) { j = UTF8_getc((const unsigned char *)asc+i, asclen-i, &utf32chr); if (j < 0) return OPENSSL_asc2uni(asc, asclen, uni, unilen); if (utf32chr > 0x10FFFF) return NULL; if (utf32chr >= 0x10000) ulen += 2*2; else ulen += 2; } ulen += 2; if ((ret = OPENSSL_malloc(ulen)) == NULL) { PKCS12err(PKCS12_F_OPENSSL_UTF82UNI, ERR_R_MALLOC_FAILURE); return NULL; } for (unitmp = ret, i = 0; i < asclen; i += j) { j = UTF8_getc((const unsigned char *)asc+i, asclen-i, &utf32chr); if (utf32chr >= 0x10000) { unsigned int hi, lo; utf32chr -= 0x10000; hi = 0xD800 + (utf32chr>>10); lo = 0xDC00 + (utf32chr&0x3ff); *unitmp++ = (unsigned char)(hi>>8); *unitmp++ = (unsigned char)(hi); *unitmp++ = (unsigned char)(lo>>8); *unitmp++ = (unsigned char)(lo); } else { *unitmp++ = (unsigned char)(utf32chr>>8); *unitmp++ = (unsigned char)(utf32chr); } } *unitmp++ = 0; *unitmp++ = 0; if (unilen) *unilen = ulen; if (uni) *uni = ret; return ret; } crypto/pkcs12/p12_utl.c:133: error: BUFFER_OVERRUN_L3 Offset: [3, +oo] Size: [2, +oo]. Showing all 11 steps of the trace crypto/pkcs12/p12_utl.c:84:10: <Length trace> 82. asclen = strlen(asc); 83. 84. for (ulen = 0, i = 0; i < asclen; i += j) { ^ 85. j = UTF8_getc((const unsigned char *)asc+i, asclen-i, &utf32chr); 86. crypto/pkcs12/p12_utl.c:84:10: Assignment 82. asclen = strlen(asc); 83. 84. for (ulen = 0, i = 0; i < asclen; i += j) { ^ 85. j = UTF8_getc((const unsigned char *)asc+i, asclen-i, &utf32chr); 86. crypto/pkcs12/p12_utl.c:115:5: Assignment 113. } 114. 115. ulen += 2; /* for trailing UTF16 zero */ ^ 116. 117. if ((ret = OPENSSL_malloc(ulen)) == NULL) { crypto/pkcs12/p12_utl.c:117:16: Call 115. ulen += 2; /* for trailing UTF16 zero */ 116. 117. if ((ret = OPENSSL_malloc(ulen)) == NULL) { ^ 118. PKCS12err(PKCS12_F_OPENSSL_UTF82UNI, ERR_R_MALLOC_FAILURE); 119. return NULL; crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/pkcs12/p12_utl.c:117:10: Assignment 115. ulen += 2; /* for trailing UTF16 zero */ 116. 117. if ((ret = OPENSSL_malloc(ulen)) == NULL) { ^ 118. PKCS12err(PKCS12_F_OPENSSL_UTF82UNI, ERR_R_MALLOC_FAILURE); 119. return NULL; crypto/pkcs12/p12_utl.c:122:10: Assignment 120. } 121. /* re-run the loop writing down UTF-16 characters in big-endian order */ 122. for (unitmp = ret, i = 0; i < asclen; i += j) { ^ 123. j = UTF8_getc((const unsigned char *)asc+i, asclen-i, &utf32chr); 124. if (utf32chr >= 0x10000) { /* pair if UTF-16 characters */ crypto/pkcs12/p12_utl.c:130:14: Assignment 128. hi = 0xD800 + (utf32chr>>10); 129. lo = 0xDC00 + (utf32chr&0x3ff); 130. *unitmp++ = (unsigned char)(hi>>8); ^ 131. *unitmp++ = (unsigned char)(hi); 132. *unitmp++ = (unsigned char)(lo>>8); crypto/pkcs12/p12_utl.c:131:14: Assignment 129. lo = 0xDC00 + (utf32chr&0x3ff); 130. *unitmp++ = (unsigned char)(hi>>8); 131. *unitmp++ = (unsigned char)(hi); ^ 132. *unitmp++ = (unsigned char)(lo>>8); 133. *unitmp++ = (unsigned char)(lo); crypto/pkcs12/p12_utl.c:132:14: Assignment 130. *unitmp++ = (unsigned char)(hi>>8); 131. *unitmp++ = (unsigned char)(hi); 132. *unitmp++ = (unsigned char)(lo>>8); ^ 133. *unitmp++ = (unsigned char)(lo); 134. } else { /* or just one */ crypto/pkcs12/p12_utl.c:133:13: Array access: Offset: [3, +oo] Size: [2, +oo] 131. *unitmp++ = (unsigned char)(hi); 132. *unitmp++ = (unsigned char)(lo>>8); 133. *unitmp++ = (unsigned char)(lo); ^ 134. } else { /* or just one */ 135. *unitmp++ = (unsigned char)(utf32chr>>8);
https://github.com/openssl/openssl/blob/74a8acbdfb2c7f398d1ae2fe914cd32b437f6df4/crypto/pkcs12/p12_utl.c/#L133
d2a_code_trace_data_42465
static int decode_header_trees(SmackVContext *smk) { GetBitContext gb; int mmap_size, mclr_size, full_size, type_size; mmap_size = AV_RL32(smk->avctx->extradata); mclr_size = AV_RL32(smk->avctx->extradata + 4); full_size = AV_RL32(smk->avctx->extradata + 8); type_size = AV_RL32(smk->avctx->extradata + 12); init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); smk->mmap_tbl = av_malloc(sizeof(int) * 2); smk->mmap_tbl[0] = 0; smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n"); smk->mclr_tbl = av_malloc(sizeof(int) * 2); smk->mclr_tbl[0] = 0; smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n"); smk->full_tbl = av_malloc(sizeof(int) * 2); smk->full_tbl[0] = 0; smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n"); smk->type_tbl = av_malloc(sizeof(int) * 2); smk->type_tbl[0] = 0; smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size)) return -1; } return 0; } libavcodec/smacker.c:301: error: Null Dereference pointer `smk->mclr_tbl` last assigned on line 300 could be null and is dereferenced at line 301, column 9. libavcodec/smacker.c:278:1: start of procedure decode_header_trees() 276. } 277. 278. static int decode_header_trees(SmackVContext *smk) { ^ 279. GetBitContext gb; 280. int mmap_size, mclr_size, full_size, type_size; libavcodec/smacker.c:282:5: 280. int mmap_size, mclr_size, full_size, type_size; 281. 282. mmap_size = AV_RL32(smk->avctx->extradata); ^ 283. mclr_size = AV_RL32(smk->avctx->extradata + 4); 284. full_size = AV_RL32(smk->avctx->extradata + 8); libavcodec/smacker.c:283:5: 281. 282. mmap_size = AV_RL32(smk->avctx->extradata); 283. mclr_size = AV_RL32(smk->avctx->extradata + 4); ^ 284. full_size = AV_RL32(smk->avctx->extradata + 8); 285. type_size = AV_RL32(smk->avctx->extradata + 12); libavcodec/smacker.c:284:5: 282. mmap_size = AV_RL32(smk->avctx->extradata); 283. mclr_size = AV_RL32(smk->avctx->extradata + 4); 284. full_size = AV_RL32(smk->avctx->extradata + 8); ^ 285. type_size = AV_RL32(smk->avctx->extradata + 12); 286. libavcodec/smacker.c:285:5: 283. mclr_size = AV_RL32(smk->avctx->extradata + 4); 284. full_size = AV_RL32(smk->avctx->extradata + 8); 285. type_size = AV_RL32(smk->avctx->extradata + 12); ^ 286. 287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); libavcodec/smacker.c:287:5: 285. type_size = AV_RL32(smk->avctx->extradata + 12); 286. 287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); ^ 288. 289. if(!get_bits1(&gb)) { libavcodec/get_bits.h:383:1: start of procedure init_get_bits() 381. * responsible for checking for the buffer end yourself (take advantage of the padding)! 382. */ 383. static inline void init_get_bits(GetBitContext *s, ^ 384. const uint8_t *buffer, int bit_size) 385. { libavcodec/get_bits.h:386:5: 384. const uint8_t *buffer, int bit_size) 385. { 386. int buffer_size = (bit_size+7)>>3; ^ 387. if (buffer_size < 0 || bit_size < 0) { 388. buffer_size = bit_size = 0; libavcodec/get_bits.h:387:9: Taking false branch 385. { 386. int buffer_size = (bit_size+7)>>3; 387. if (buffer_size < 0 || bit_size < 0) { ^ 388. buffer_size = bit_size = 0; 389. buffer = NULL; libavcodec/get_bits.h:387:28: Taking false branch 385. { 386. int buffer_size = (bit_size+7)>>3; 387. if (buffer_size < 0 || bit_size < 0) { ^ 388. buffer_size = bit_size = 0; 389. buffer = NULL; libavcodec/get_bits.h:392:5: 390. } 391. 392. s->buffer = buffer; ^ 393. s->size_in_bits = bit_size; 394. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:393:5: 391. 392. s->buffer = buffer; 393. s->size_in_bits = bit_size; ^ 394. s->buffer_end = buffer + buffer_size; 395. #ifdef ALT_BITSTREAM_READER libavcodec/get_bits.h:394:5: 392. s->buffer = buffer; 393. s->size_in_bits = bit_size; 394. s->buffer_end = buffer + buffer_size; ^ 395. #ifdef ALT_BITSTREAM_READER 396. s->index = 0; libavcodec/get_bits.h:396:5: 394. s->buffer_end = buffer + buffer_size; 395. #ifdef ALT_BITSTREAM_READER 396. s->index = 0; ^ 397. #elif defined A32_BITSTREAM_READER 398. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3); libavcodec/get_bits.h:402:1: return from a call to init_get_bits 400. skip_bits_long(s, 0); 401. #endif 402. } ^ 403. 404. static inline void align_get_bits(GetBitContext *s) libavcodec/smacker.c:289:9: 287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); 288. 289. if(!get_bits1(&gb)) { ^ 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); libavcodec/get_bits.h:303:1: start of procedure get_bits1() 301. } 302. 303. static inline unsigned int get_bits1(GetBitContext *s){ ^ 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; libavcodec/get_bits.h:305:5: 303. static inline unsigned int get_bits1(GetBitContext *s){ 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; ^ 306. uint8_t result = s->buffer[index>>3]; 307. #ifdef ALT_BITSTREAM_READER_LE libavcodec/get_bits.h:306:5: 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; 306. uint8_t result = s->buffer[index>>3]; ^ 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; libavcodec/get_bits.h:308:5: 306. uint8_t result = s->buffer[index>>3]; 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; ^ 309. result &= 1; 310. #else libavcodec/get_bits.h:309:5: 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; 309. result &= 1; ^ 310. #else 311. result <<= index & 7; libavcodec/get_bits.h:314:5: 312. result >>= 8 - 1; 313. #endif 314. index++; ^ 315. s->index = index; 316. libavcodec/get_bits.h:315:5: 313. #endif 314. index++; 315. s->index = index; ^ 316. 317. return result; libavcodec/get_bits.h:317:5: 315. s->index = index; 316. 317. return result; ^ 318. #else 319. return get_bits(s, 1); libavcodec/get_bits.h:321:1: return from a call to get_bits1 319. return get_bits(s, 1); 320. #endif 321. } ^ 322. 323. static inline unsigned int show_bits1(GetBitContext *s){ libavcodec/smacker.c:289:9: Taking true branch 287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); 288. 289. if(!get_bits1(&gb)) { ^ 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); libavcodec/smacker.c:290:9: Skipping av_log(): empty list of specs 288. 289. if(!get_bits1(&gb)) { 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); ^ 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); 292. smk->mmap_tbl[0] = 0; libavcodec/smacker.c:291:9: 289. if(!get_bits1(&gb)) { 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); ^ 292. smk->mmap_tbl[0] = 0; 293. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1; 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 false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking false branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:114:5: 112. ptr = malloc(size); 113. #endif 114. return ptr; ^ 115. } 116. 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) libavcodec/smacker.c:292:9: 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); 292. smk->mmap_tbl[0] = 0; ^ 293. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1; 294. } else { libavcodec/smacker.c:293:9: 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); 292. smk->mmap_tbl[0] = 0; 293. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1; ^ 294. } else { 295. if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size)) libavcodec/smacker.c:298:9: 296. return -1; 297. } 298. if(!get_bits1(&gb)) { ^ 299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n"); 300. smk->mclr_tbl = av_malloc(sizeof(int) * 2); libavcodec/get_bits.h:303:1: start of procedure get_bits1() 301. } 302. 303. static inline unsigned int get_bits1(GetBitContext *s){ ^ 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; libavcodec/get_bits.h:305:5: 303. static inline unsigned int get_bits1(GetBitContext *s){ 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; ^ 306. uint8_t result = s->buffer[index>>3]; 307. #ifdef ALT_BITSTREAM_READER_LE libavcodec/get_bits.h:306:5: 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; 306. uint8_t result = s->buffer[index>>3]; ^ 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; libavcodec/get_bits.h:308:5: 306. uint8_t result = s->buffer[index>>3]; 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; ^ 309. result &= 1; 310. #else libavcodec/get_bits.h:309:5: 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; 309. result &= 1; ^ 310. #else 311. result <<= index & 7; libavcodec/get_bits.h:314:5: 312. result >>= 8 - 1; 313. #endif 314. index++; ^ 315. s->index = index; 316. libavcodec/get_bits.h:315:5: 313. #endif 314. index++; 315. s->index = index; ^ 316. 317. return result; libavcodec/get_bits.h:317:5: 315. s->index = index; 316. 317. return result; ^ 318. #else 319. return get_bits(s, 1); libavcodec/get_bits.h:321:1: return from a call to get_bits1 319. return get_bits(s, 1); 320. #endif 321. } ^ 322. 323. static inline unsigned int show_bits1(GetBitContext *s){ libavcodec/smacker.c:298:9: Taking true branch 296. return -1; 297. } 298. if(!get_bits1(&gb)) { ^ 299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n"); 300. smk->mclr_tbl = av_malloc(sizeof(int) * 2); libavcodec/smacker.c:299:9: Skipping av_log(): empty list of specs 297. } 298. if(!get_bits1(&gb)) { 299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n"); ^ 300. smk->mclr_tbl = av_malloc(sizeof(int) * 2); 301. smk->mclr_tbl[0] = 0; libavcodec/smacker.c:300:9: 298. if(!get_bits1(&gb)) { 299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n"); 300. smk->mclr_tbl = av_malloc(sizeof(int) * 2); ^ 301. smk->mclr_tbl[0] = 0; 302. smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1; 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 false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking true branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:84:9: 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) 84. ptr = NULL; ^ 85. #elif HAVE_MEMALIGN 86. ptr = memalign(32,size); libavutil/mem.c:114:5: 112. ptr = malloc(size); 113. #endif 114. return ptr; ^ 115. } 116. 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) libavcodec/smacker.c:301:9: 299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n"); 300. smk->mclr_tbl = av_malloc(sizeof(int) * 2); 301. smk->mclr_tbl[0] = 0; ^ 302. smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1; 303. } else {
https://github.com/libav/libav/blob/d7d2f0e63c8187d531168256a0ce2aac21d5fce6/libavcodec/smacker.c/#L301
d2a_code_trace_data_42466
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); } apps/s_client.c:1225: error: INTEGER_OVERFLOW_L1 (0 - 1):unsigned64 by call to `SSL_new`. Showing all 27 steps of the trace apps/s_client.c:1178:7: Call 1176. 1177. SSL_CTX_set_verify(ctx,verify,verify_callback); 1178. if (!set_cert_key_stuff(ctx,cert,key, NULL)) ^ 1179. goto end; 1180. apps/s_cb.c:258:6: Call 256. if (cert == NULL) 257. return 1; 258. if (SSL_CTX_use_certificate(ctx,cert) <= 0) ^ 259. { 260. BIO_printf(bio_err,"error setting certificate\n"); ssl/ssl_rsa.c:410:9: Call 408. return(0); 409. } 410. return(ssl_set_cert(ctx->cert, x)); ^ 411. } 412. ssl/ssl_rsa.c:418:7: Call 416. int i; 417. 418. pkey=X509_get_pubkey(x); ^ 419. if (pkey == NULL) 420. { crypto/x509/x509_cmp.c:304:9: Call 302. if ((x == NULL) || (x->cert_info == NULL)) 303. return(NULL); 304. return(X509_PUBKEY_get(x->cert_info->key)); ^ 305. } 306. crypto/asn1/x_pubkey.c:153:7: Call 151. } 152. 153. if (!EVP_PKEY_set_type(ret, OBJ_obj2nid(key->algor->algorithm))) ^ 154. { 155. X509err(X509_F_X509_PUBKEY_GET,X509_R_UNSUPPORTED_ALGORITHM); crypto/evp/p_lib.c:255:9: Call 253. int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) 254. { 255. return pkey_set_type(pkey, type, NULL, -1); ^ 256. } 257. crypto/evp/p_lib.c:232:11: Call 230. ameth = EVP_PKEY_asn1_find_str(&e, str, len); 231. else 232. ameth = EVP_PKEY_asn1_find(&e, type); ^ 233. #ifndef OPENSSL_NO_ENGINE 234. if (!pkey && e) crypto/asn1/ameth_lib.c:194:7: Call 192. ENGINE *e; 193. /* type will contain the final unaliased type */ 194. e = ENGINE_get_pkey_asn1_meth_engine(type); ^ 195. if (e) 196. { crypto/engine/tb_asnmth.c:118:9: Call 116. ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid) 117. { 118. return engine_table_select(&pkey_asn1_meth_table, nid); ^ 119. } 120. crypto/engine/eng_table.c:261:6: Call 259. /* Check again inside the lock otherwise we could race against cleanup 260. * operations. But don't worry about a fprintf(stderr). */ 261. if(!int_table_check(table, 0)) goto end; ^ 262. tmplate.nid = nid; 263. fnd = lh_ENGINE_PILE_retrieve(&(*table)->piles, &tmplate); crypto/engine/eng_table.c:122:11: Call 120. if(*t) return 1; 121. if(!create) return 0; 122. if((lh = lh_ENGINE_PILE_new()) == NULL) ^ 123. return 0; 124. *t = (ENGINE_TABLE *)lh; crypto/lhash/lhash.c:133:2: Assignment 131. ret->up_load=UP_LOAD; 132. ret->down_load=DOWN_LOAD; 133. ret->num_items=0; ^ 134. 135. ret->num_expands=0; apps/s_client.c:1225:6: Call 1223. #endif 1224. 1225. con=SSL_new(ctx); ^ 1226. if (sess_in) 1227. { ssl/ssl_lib.c:275:1: Parameter `ctx->sessions->num_items` 273. } 274. 275. > SSL *SSL_new(SSL_CTX *ctx) 276. { 277. SSL *s; ssl/ssl_lib.c:397:2: Call 395. s->server=(ctx->method->ssl_accept == ssl_undefined_function)?0:1; 396. 397. SSL_clear(s); ^ 398. 399. CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL, s, &s->ex_data); ssl/ssl_lib.c:185:1: Parameter `s->ctx->sessions->num_items` 183. }; 184. 185. > int SSL_clear(SSL *s) 186. { 187. ssl/ssl_lib.c:194:6: Call 192. } 193. 194. if (ssl_clear_bad_session(s)) ^ 195. { 196. SSL_SESSION_free(s->session); ssl/ssl_sess.c:988:1: Parameter `s->ctx->sessions->num_items` 986. } 987. 988. > int ssl_clear_bad_session(SSL *s) 989. { 990. if ( (s->session != NULL) && ssl/ssl_sess.c:994:3: Call 992. !(SSL_in_init(s) || SSL_in_before(s))) 993. { 994. SSL_CTX_remove_session(s->ctx,s->session); ^ 995. return(1); 996. } ssl/ssl_sess.c:672:1: Parameter `ctx->sessions->num_items` 670. } 671. 672. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 673. { 674. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:674:9: Call 672. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 673. { 674. return remove_session_lock(ctx, c, 1); ^ 675. } 676. ssl/ssl_sess.c:677:1: Parameter `ctx->sessions->num_items` 675. } 676. 677. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 678. { 679. SSL_SESSION *r; ssl/ssl_sess.c:688:6: Call 686. { 687. ret=1; 688. r=lh_SSL_SESSION_delete(ctx->sessions,c); ^ 689. SSL_SESSION_list_remove(ctx,c); 690. } 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 - 1):unsigned64 by call to `SSL_new` 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/7a71af86ce75751f3cb2e9e9e3f2e0715b39b101/crypto/lhash/lhash.c/#L240
d2a_code_trace_data_42467
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:792: error: NULL_DEREFERENCE pointer `meth` last assigned on line 790 could be null and is dereferenced at line 792, column 9. Showing all 14 steps of the trace crypto/rand/rand_lib.c:788:1: start of procedure RAND_seed() 786. #endif 787. 788. > void RAND_seed(const void *buf, int num) 789. { 790. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:790:5: 788. void RAND_seed(const void *buf, int num) 789. { 790. > const RAND_METHOD *meth = RAND_get_rand_method(); 791. 792. if (meth->seed != NULL) crypto/rand/rand_lib.c:732:1: start of procedure RAND_get_rand_method() 730. } 731. 732. > const RAND_METHOD *RAND_get_rand_method(void) 733. { 734. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:734:5: 732. const RAND_METHOD *RAND_get_rand_method(void) 733. { 734. > const RAND_METHOD *tmp_meth = NULL; 735. 736. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:736:10: 734. const RAND_METHOD *tmp_meth = NULL; 735. 736. > if (!RUN_ONCE(&rand_init, do_rand_init)) 737. return NULL; 738. crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once() 109. } 110. 111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:113:9: Taking true branch 111. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) ^ 114. return 0; 115. crypto/threads_pthread.c:114:9: 112. { 113. if (pthread_once(once, init) != 0) 114. > return 0; 115. 116. return 1; crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once 115. 116. return 1; 117. > } 118. 119. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/rand/rand_lib.c:736:10: Condition is false 734. const RAND_METHOD *tmp_meth = NULL; 735. 736. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 737. return NULL; 738. crypto/rand/rand_lib.c:736:10: Taking true branch 734. const RAND_METHOD *tmp_meth = NULL; 735. 736. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 737. return NULL; 738. crypto/rand/rand_lib.c:737:9: 735. 736. if (!RUN_ONCE(&rand_init, do_rand_init)) 737. > return NULL; 738. 739. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:760:1: return from a call to RAND_get_rand_method 758. CRYPTO_THREAD_unlock(rand_meth_lock); 759. return tmp_meth; 760. > } 761. 762. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:792:9: 790. const RAND_METHOD *meth = RAND_get_rand_method(); 791. 792. > if (meth->seed != NULL) 793. meth->seed(buf, num); 794. }
https://github.com/openssl/openssl/blob/95658c32436017aeeef3d8598957071baf6769a9/crypto/rand/rand_lib.c/#L792
d2a_code_trace_data_42468
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } apps/ca.c:1404: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `X509_print`. Showing all 16 steps of the trace apps/ca.c:1401:16: Call 1399. int ok = -1, i; 1400. 1401. if ((req = load_cert(infile, FORMAT_PEM, NULL, e, infile)) == NULL) ^ 1402. goto end; 1403. if (verbose) apps/apps.c:684:9: Call 682. 683. if (format == FORMAT_HTTP) { 684. load_cert_crl_http(file, &x, NULL); ^ 685. return x; 686. } apps/apps.c:630:1: Parameter `**pcrl` 628. } 629. 630. > int load_cert_crl_http(const char *url, X509 **pcert, X509_CRL **pcrl) 631. { 632. char *host = NULL, *port = NULL, *path = NULL; apps/ca.c:1404:9: Call 1402. goto end; 1403. if (verbose) 1404. X509_print(bio_err, req); ^ 1405. 1406. BIO_printf(bio_err, "Check that the request matches the signature\n"); crypto/x509/t_x509.c:92:1: Parameter `*x->cert_info.validity.notAfter->data` 90. #endif 91. 92. > int X509_print(BIO *bp, X509 *x) 93. { 94. return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); crypto/x509/t_x509.c:94:12: Call 92. int X509_print(BIO *bp, X509 *x) 93. { 94. return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); ^ 95. } 96. crypto/x509/t_x509.c:97:1: Parameter `*x->cert_info.validity.notAfter->data` 95. } 96. 97. > int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, 98. unsigned long cflag) 99. { crypto/x509/t_x509.c:187:14: Call 185. if (BIO_write(bp, "\n Not After : ", 25) <= 0) 186. goto err; 187. if (!ASN1_TIME_print(bp, X509_get_notAfter(x))) ^ 188. goto err; 189. if (BIO_write(bp, "\n", 1) <= 0) crypto/asn1/a_time.c:202:1: Parameter `*tm->data` 200. } 201. 202. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) 203. { 204. if (tm->type == V_ASN1_UTCTIME) crypto/asn1/a_time.c:207:16: Call 205. return ASN1_UTCTIME_print(bp, tm); 206. if (tm->type == V_ASN1_GENERALIZEDTIME) 207. return ASN1_GENERALIZEDTIME_print(bp, tm); ^ 208. BIO_write(bp, "Bad time value", 14); 209. return (0); crypto/asn1/a_gentm.c:266:1: <Offset trace> 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:266:1: Parameter `*tm->data` 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:287:5: Assignment 285. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 286. + (v[2] - '0') * 10 + (v[3] - '0'); 287. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 288. if ((M > 12) || (M < 1)) 289. goto err; crypto/asn1/a_gentm.c:261:1: <Length trace> 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:261:1: Array declaration 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:308:20: Array access: Offset: [-529, +oo] Size: 12 by call to `X509_print` 306. 307. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 308. _asn1_mon[M - 1], d, h, m, s, f_len, f, y, ^ 309. (gmt) ? " GMT" : "") <= 0) 310. return (0);
https://github.com/openssl/openssl/blob/01b7851aa27aa144372f5484da916be042d9aa4f/crypto/asn1/a_gentm.c/#L308
d2a_code_trace_data_42469
static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count) { int16_t weight[8][64]; DCTELEM orig[8][64]; const int mb_x= s->mb_x; const int mb_y= s->mb_y; int i; int skip_dct[8]; int dct_offset = s->linesize*8; uint8_t *ptr_y, *ptr_cb, *ptr_cr; int wrap_y, wrap_c; for(i=0; i<mb_block_count; i++) skip_dct[i]=s->skipdct; if(s->adaptive_quant){ const int last_qp= s->qscale; const int mb_xy= mb_x + mb_y*s->mb_stride; s->lambda= s->lambda_table[mb_xy]; update_qscale(s); if(!(s->flags&CODEC_FLAG_QP_RD)){ s->qscale= s->current_picture_ptr->qscale_table[mb_xy]; s->dquant= s->qscale - last_qp; if(s->out_format==FMT_H263){ s->dquant= av_clip(s->dquant, -2, 2); if(s->codec_id==CODEC_ID_MPEG4){ if(!s->mb_intra){ if(s->pict_type == FF_B_TYPE){ if(s->dquant&1 || s->mv_dir&MV_DIRECT) s->dquant= 0; } if(s->mv_type==MV_TYPE_8X8) s->dquant=0; } } } } ff_set_qscale(s, last_qp + s->dquant); }else if(s->flags&CODEC_FLAG_QP_RD) ff_set_qscale(s, s->qscale + s->dquant); wrap_y = s->linesize; wrap_c = s->uvlinesize; ptr_y = s->new_picture.data[0] + (mb_y * 16 * wrap_y) + mb_x * 16; ptr_cb = s->new_picture.data[1] + (mb_y * mb_block_height * wrap_c) + mb_x * 8; ptr_cr = s->new_picture.data[2] + (mb_y * mb_block_height * wrap_c) + mb_x * 8; if(mb_x*16+16 > s->width || mb_y*16+16 > s->height){ uint8_t *ebuf= s->edge_emu_buffer + 32; ff_emulated_edge_mc(ebuf , ptr_y , wrap_y,16,16,mb_x*16,mb_y*16, s->width , s->height); ptr_y= ebuf; ff_emulated_edge_mc(ebuf+18*wrap_y , ptr_cb, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1); ptr_cb= ebuf+18*wrap_y; ff_emulated_edge_mc(ebuf+18*wrap_y+8, ptr_cr, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1); ptr_cr= ebuf+18*wrap_y+8; } if (s->mb_intra) { if(s->flags&CODEC_FLAG_INTERLACED_DCT){ int progressive_score, interlaced_score; s->interlaced_dct=0; progressive_score= s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y, 8) +s->dsp.ildct_cmp[4](s, ptr_y + wrap_y*8, NULL, wrap_y, 8) - 400; if(progressive_score > 0){ interlaced_score = s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y*2, 8) +s->dsp.ildct_cmp[4](s, ptr_y + wrap_y , NULL, wrap_y*2, 8); if(progressive_score > interlaced_score){ s->interlaced_dct=1; dct_offset= wrap_y; wrap_y<<=1; if (s->chroma_format == CHROMA_422) wrap_c<<=1; } } } s->dsp.get_pixels(s->block[0], ptr_y , wrap_y); s->dsp.get_pixels(s->block[1], ptr_y + 8, wrap_y); s->dsp.get_pixels(s->block[2], ptr_y + dct_offset , wrap_y); s->dsp.get_pixels(s->block[3], ptr_y + dct_offset + 8, wrap_y); if(s->flags&CODEC_FLAG_GRAY){ skip_dct[4]= 1; skip_dct[5]= 1; }else{ s->dsp.get_pixels(s->block[4], ptr_cb, wrap_c); s->dsp.get_pixels(s->block[5], ptr_cr, wrap_c); if(!s->chroma_y_shift){ s->dsp.get_pixels(s->block[6], ptr_cb + (dct_offset>>1), wrap_c); s->dsp.get_pixels(s->block[7], ptr_cr + (dct_offset>>1), wrap_c); } } }else{ op_pixels_func (*op_pix)[4]; qpel_mc_func (*op_qpix)[16]; uint8_t *dest_y, *dest_cb, *dest_cr; dest_y = s->dest[0]; dest_cb = s->dest[1]; dest_cr = s->dest[2]; if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){ op_pix = s->dsp.put_pixels_tab; op_qpix= s->dsp.put_qpel_pixels_tab; }else{ op_pix = s->dsp.put_no_rnd_pixels_tab; op_qpix= s->dsp.put_no_rnd_qpel_pixels_tab; } if (s->mv_dir & MV_DIR_FORWARD) { MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix); op_pix = s->dsp.avg_pixels_tab; op_qpix= s->dsp.avg_qpel_pixels_tab; } if (s->mv_dir & MV_DIR_BACKWARD) { MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix); } if(s->flags&CODEC_FLAG_INTERLACED_DCT){ int progressive_score, interlaced_score; s->interlaced_dct=0; progressive_score= s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y, 8) +s->dsp.ildct_cmp[0](s, dest_y + wrap_y*8, ptr_y + wrap_y*8, wrap_y, 8) - 400; if(s->avctx->ildct_cmp == FF_CMP_VSSE) progressive_score -= 400; if(progressive_score>0){ interlaced_score = s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y*2, 8) +s->dsp.ildct_cmp[0](s, dest_y + wrap_y , ptr_y + wrap_y , wrap_y*2, 8); if(progressive_score > interlaced_score){ s->interlaced_dct=1; dct_offset= wrap_y; wrap_y<<=1; if (s->chroma_format == CHROMA_422) wrap_c<<=1; } } } s->dsp.diff_pixels(s->block[0], ptr_y , dest_y , wrap_y); s->dsp.diff_pixels(s->block[1], ptr_y + 8, dest_y + 8, wrap_y); s->dsp.diff_pixels(s->block[2], ptr_y + dct_offset , dest_y + dct_offset , wrap_y); s->dsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8, dest_y + dct_offset + 8, wrap_y); if(s->flags&CODEC_FLAG_GRAY){ skip_dct[4]= 1; skip_dct[5]= 1; }else{ s->dsp.diff_pixels(s->block[4], ptr_cb, dest_cb, wrap_c); s->dsp.diff_pixels(s->block[5], ptr_cr, dest_cr, wrap_c); if(!s->chroma_y_shift){ s->dsp.diff_pixels(s->block[6], ptr_cb + (dct_offset>>1), dest_cb + (dct_offset>>1), wrap_c); s->dsp.diff_pixels(s->block[7], ptr_cr + (dct_offset>>1), dest_cr + (dct_offset>>1), wrap_c); } } if(s->current_picture.mc_mb_var[s->mb_stride*mb_y+ mb_x]<2*s->qscale*s->qscale){ if(s->dsp.sad[1](NULL, ptr_y , dest_y , wrap_y, 8) < 20*s->qscale) skip_dct[0]= 1; if(s->dsp.sad[1](NULL, ptr_y + 8, dest_y + 8, wrap_y, 8) < 20*s->qscale) skip_dct[1]= 1; if(s->dsp.sad[1](NULL, ptr_y +dct_offset , dest_y +dct_offset , wrap_y, 8) < 20*s->qscale) skip_dct[2]= 1; if(s->dsp.sad[1](NULL, ptr_y +dct_offset+ 8, dest_y +dct_offset+ 8, wrap_y, 8) < 20*s->qscale) skip_dct[3]= 1; if(s->dsp.sad[1](NULL, ptr_cb , dest_cb , wrap_c, 8) < 20*s->qscale) skip_dct[4]= 1; if(s->dsp.sad[1](NULL, ptr_cr , dest_cr , wrap_c, 8) < 20*s->qscale) skip_dct[5]= 1; if(!s->chroma_y_shift){ if(s->dsp.sad[1](NULL, ptr_cb +(dct_offset>>1), dest_cb +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[6]= 1; if(s->dsp.sad[1](NULL, ptr_cr +(dct_offset>>1), dest_cr +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[7]= 1; } } } if(s->avctx->quantizer_noise_shaping){ if(!skip_dct[0]) get_visual_weight(weight[0], ptr_y , wrap_y); if(!skip_dct[1]) get_visual_weight(weight[1], ptr_y + 8, wrap_y); if(!skip_dct[2]) get_visual_weight(weight[2], ptr_y + dct_offset , wrap_y); if(!skip_dct[3]) get_visual_weight(weight[3], ptr_y + dct_offset + 8, wrap_y); if(!skip_dct[4]) get_visual_weight(weight[4], ptr_cb , wrap_c); if(!skip_dct[5]) get_visual_weight(weight[5], ptr_cr , wrap_c); if(!s->chroma_y_shift){ if(!skip_dct[6]) get_visual_weight(weight[6], ptr_cb + (dct_offset>>1), wrap_c); if(!skip_dct[7]) get_visual_weight(weight[7], ptr_cr + (dct_offset>>1), wrap_c); } memcpy(orig[0], s->block[0], sizeof(DCTELEM)*64*mb_block_count); } assert(s->out_format!=FMT_MJPEG || s->qscale==8); { for(i=0;i<mb_block_count;i++) { if(!skip_dct[i]){ int overflow; s->block_last_index[i] = s->dct_quantize(s, s->block[i], i, s->qscale, &overflow); if (overflow) clip_coeffs(s, s->block[i], s->block_last_index[i]); }else s->block_last_index[i]= -1; } if(s->avctx->quantizer_noise_shaping){ for(i=0;i<mb_block_count;i++) { if(!skip_dct[i]){ s->block_last_index[i] = dct_quantize_refine(s, s->block[i], weight[i], orig[i], i, s->qscale); } } } if(s->luma_elim_threshold && !s->mb_intra) for(i=0; i<4; i++) dct_single_coeff_elimination(s, i, s->luma_elim_threshold); if(s->chroma_elim_threshold && !s->mb_intra) for(i=4; i<mb_block_count; i++) dct_single_coeff_elimination(s, i, s->chroma_elim_threshold); if(s->flags & CODEC_FLAG_CBP_RD){ for(i=0;i<mb_block_count;i++) { if(s->block_last_index[i] == -1) s->coded_score[i]= INT_MAX/256; } } } if((s->flags&CODEC_FLAG_GRAY) && s->mb_intra){ s->block_last_index[4]= s->block_last_index[5]= 0; s->block[4][0]= s->block[5][0]= (1024 + s->c_dc_scale/2)/ s->c_dc_scale; } if(s->alternate_scan && s->dct_quantize != dct_quantize_c){ for(i=0; i<mb_block_count; i++){ int j; if(s->block_last_index[i]>0){ for(j=63; j>0; j--){ if(s->block[i][ s->intra_scantable.permutated[j] ]) break; } s->block_last_index[i]= j; } } } switch(s->codec_id){ case CODEC_ID_MPEG1VIDEO: case CODEC_ID_MPEG2VIDEO: if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) mpeg1_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MPEG4: if (ENABLE_MPEG4_ENCODER) mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MSMPEG4V2: case CODEC_ID_MSMPEG4V3: case CODEC_ID_WMV1: if (ENABLE_MSMPEG4_ENCODER) msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_WMV2: if (ENABLE_WMV2_ENCODER) ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_H261: if (ENABLE_H261_ENCODER) ff_h261_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_H263: case CODEC_ID_H263P: case CODEC_ID_FLV1: case CODEC_ID_RV10: case CODEC_ID_RV20: if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER || ENABLE_FLV_ENCODER || ENABLE_RV10_ENCODER || ENABLE_RV20_ENCODER) h263_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MJPEG: if (ENABLE_MJPEG_ENCODER) ff_mjpeg_encode_mb(s, s->block); break; default: assert(0); } } libavcodec/mpegvideo_enc.c:1638: error: Uninitialized Value The value read from skip_dct[_] was never initialized. libavcodec/mpegvideo_enc.c:1638:13: 1636. 1637. if(s->avctx->quantizer_noise_shaping){ 1638. if(!skip_dct[0]) get_visual_weight(weight[0], ptr_y , wrap_y); ^ 1639. if(!skip_dct[1]) get_visual_weight(weight[1], ptr_y + 8, wrap_y); 1640. if(!skip_dct[2]) get_visual_weight(weight[2], ptr_y + dct_offset , wrap_y);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L1638
d2a_code_trace_data_42470
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_prime.c:387: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_priv_rand`. Showing all 24 steps of the trace crypto/bn/bn_prime.c:378:1: Parameter `rnd->top` 376. } 377. 378. > static int probable_prime(BIGNUM *rnd, int bits, prime_t *mods) 379. { 380. int i; crypto/bn/bn_prime.c:387:10: Call 385. again: 386. /* TODO: Not all primes are private */ 387. if (!BN_priv_rand(rnd, bits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ODD)) ^ 388. return 0; 389. /* we now have a random number 'rnd' to test. */ crypto/bn/bn_rand.c:121:1: Parameter `rnd->top` 119. } 120. 121. > int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom) 122. { 123. return bnrand(PRIVATE, rnd, bits, top, bottom, NULL); crypto/bn/bn_rand.c:123:12: Call 121. int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom) 122. { 123. return bnrand(PRIVATE, rnd, bits, top, bottom, NULL); ^ 124. } 125. crypto/bn/bn_rand.c:23:1: Parameter `rnd->top` 21. } BNRAND_FLAG; 22. 23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom, 24. BN_CTX *ctx) 25. { crypto/bn/bn_rand.c:33:9: Call 31. if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY) 32. goto toosmall; 33. BN_zero(rnd); ^ 34. return 1; 35. } crypto/bn/bn_lib.c:361:1: Parameter `a->top` 359. } 360. 361. > int BN_set_word(BIGNUM *a, BN_ULONG w) 362. { 363. bn_check_top(a); crypto/bn/bn_lib.c:364:9: Call 362. { 363. bn_check_top(a); 364. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 365. return 0; 366. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `a->top` 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_lcl.h:668:12: Call 666. return a; 667. 668. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 669. } 670. 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_priv_rand` 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/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_42471
static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) { RTSPState *rt = s->priv_data; AVStream *st = NULL; if (rtsp_st->stream_index >= 0) st = s->streams[rtsp_st->stream_index]; if (!st) s->ctx_flags |= AVFMTCTX_NOHEADER; if (s->oformat) { rtsp_st->transport_priv = rtsp_rtp_mux_open(s, st, rtsp_st->rtp_handle); rtsp_st->rtp_handle = NULL; } else if (rt->transport == RTSP_TRANSPORT_RDT) rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index, rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_handler); else rtsp_st->transport_priv = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type); if (!rtsp_st->transport_priv) { return AVERROR(ENOMEM); } else if (rt->transport != RTSP_TRANSPORT_RDT) { if (rtsp_st->dynamic_handler) { rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv, rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_handler); } } return 0; } libavformat/rtsp.c:578: error: Null Dereference pointer `st` last assigned on line 565 could be null and is dereferenced at line 578, column 56. libavformat/rtsp.c:562:1: start of procedure rtsp_open_transport_ctx() 560. } 561. 562. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) ^ 563. { 564. RTSPState *rt = s->priv_data; libavformat/rtsp.c:564:5: 562. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) 563. { 564. RTSPState *rt = s->priv_data; ^ 565. AVStream *st = NULL; 566. libavformat/rtsp.c:565:5: 563. { 564. RTSPState *rt = s->priv_data; 565. AVStream *st = NULL; ^ 566. 567. /* open the RTP context */ libavformat/rtsp.c:568:9: Taking false branch 566. 567. /* open the RTP context */ 568. if (rtsp_st->stream_index >= 0) ^ 569. st = s->streams[rtsp_st->stream_index]; 570. if (!st) libavformat/rtsp.c:570:10: Taking true branch 568. if (rtsp_st->stream_index >= 0) 569. st = s->streams[rtsp_st->stream_index]; 570. if (!st) ^ 571. s->ctx_flags |= AVFMTCTX_NOHEADER; 572. libavformat/rtsp.c:571:9: 569. st = s->streams[rtsp_st->stream_index]; 570. if (!st) 571. s->ctx_flags |= AVFMTCTX_NOHEADER; ^ 572. 573. if (s->oformat) { libavformat/rtsp.c:573:9: Taking false branch 571. s->ctx_flags |= AVFMTCTX_NOHEADER; 572. 573. if (s->oformat) { ^ 574. rtsp_st->transport_priv = rtsp_rtp_mux_open(s, st, rtsp_st->rtp_handle); 575. /* Ownership of rtp_handle is passed to the rtp mux context */ libavformat/rtsp.c:577:16: Taking true branch 575. /* Ownership of rtp_handle is passed to the rtp mux context */ 576. rtsp_st->rtp_handle = NULL; 577. } else if (rt->transport == RTSP_TRANSPORT_RDT) ^ 578. rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index, 579. rtsp_st->dynamic_protocol_context, libavformat/rtsp.c:578:9: 576. rtsp_st->rtp_handle = NULL; 577. } else if (rt->transport == RTSP_TRANSPORT_RDT) 578. rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index, ^ 579. rtsp_st->dynamic_protocol_context, 580. rtsp_st->dynamic_handler);
https://github.com/libav/libav/blob/f41237c9dbe9751ef025812edebdec762797e57d/libavformat/rtsp.c/#L578
d2a_code_trace_data_42472
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } apps/crl.c:320: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`. Showing all 12 steps of the trace apps/crl.c:310:28: Call 308. if (hash == i) { 309. BIO_printf(bio_out, "%08lx\n", 310. X509_NAME_hash(X509_CRL_get_issuer(x))); ^ 311. } 312. #ifndef OPENSSL_NO_MD5 crypto/x509/x509_cmp.c:233:10: Call 231. /* Make sure X509_NAME structure contains valid cached encoding */ 232. i2d_X509_NAME(x, NULL); 233. if (!EVP_Digest(x->canon_enc, x->canon_enclen, md, NULL, EVP_sha1(), ^ 234. NULL)) 235. return 0; crypto/evp/digest.c:315:1: Parameter `*size` 313. } 314. 315. > int EVP_Digest(const void *data, size_t count, 316. unsigned char *md, unsigned int *size, const EVP_MD *type, 317. ENGINE *impl) apps/crl.c:320:17: Call 318. if (lastupdate == i) { 319. BIO_printf(bio_out, "lastUpdate="); 320. ASN1_TIME_print(bio_out, X509_CRL_get_lastUpdate(x)); ^ 321. BIO_printf(bio_out, "\n"); 322. } crypto/asn1/a_time.c:202:1: Parameter `*tm->data` 200. } 201. 202. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) 203. { 204. if (tm->type == V_ASN1_UTCTIME) crypto/asn1/a_time.c:207:16: Call 205. return ASN1_UTCTIME_print(bp, tm); 206. if (tm->type == V_ASN1_GENERALIZEDTIME) 207. return ASN1_GENERALIZEDTIME_print(bp, tm); ^ 208. BIO_write(bp, "Bad time value", 14); 209. return (0); crypto/asn1/a_gentm.c:266:1: <Offset trace> 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:266:1: Parameter `*tm->data` 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:287:5: Assignment 285. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 286. + (v[2] - '0') * 10 + (v[3] - '0'); 287. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 288. if ((M > 12) || (M < 1)) 289. goto err; crypto/asn1/a_gentm.c:261:1: <Length trace> 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:261:1: Array declaration 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:308:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print` 306. 307. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 308. _asn1_mon[M - 1], d, h, m, s, f_len, f, y, ^ 309. (gmt) ? " GMT" : "") <= 0) 310. return (0);
https://github.com/openssl/openssl/blob/01b7851aa27aa144372f5484da916be042d9aa4f/crypto/asn1/a_gentm.c/#L308
d2a_code_trace_data_42473
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:319: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->ctx->sessions->num_items`)] - 1):unsigned64 by call to `dtls1_process_record`. Showing all 13 steps of the trace ssl/d1_pkt.c:303:1: Parameter `s->ctx->sessions->num_items` 301. &((s)->d1->processed_rcds)) 302. 303. > static int 304. dtls1_process_buffered_records(SSL *s) 305. { ssl/d1_pkt.c:319:20: Call 317. { 318. dtls1_get_unprocessed_record(s); 319. if ( ! dtls1_process_record(s)) ^ 320. return(0); 321. if(dtls1_buffer_record(s, &(s->d1->processed_rcds), ssl/d1_pkt.c:381:1: Parameter `s->ctx->sessions->num_items` 379. #endif 380. 381. > static int 382. dtls1_process_record(SSL *s) 383. { ssl/d1_pkt.c:540:2: Call 538. 539. f_err: 540. ssl3_send_alert(s,SSL3_AL_FATAL,al); ^ 541. err: 542. return(0); ssl/s3_pkt.c:1798:1: Parameter `s->ctx->sessions->num_items` 1796. } 1797. 1798. > int ssl3_send_alert(SSL *s, int level, int desc) 1799. { 1800. /* Map tls/ssl alert value to correct one */ ssl/s3_pkt.c:1807:3: Call 1805. /* If a fatal one, remove from cache */ 1806. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 1807. SSL_CTX_remove_session(s->ctx,s->session); ^ 1808. 1809. s->s3->alert_dispatch=1; ssl/ssl_sess.c:683:1: Parameter `ctx->sessions->num_items` 681. } 682. 683. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 684. { 685. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:685:9: Call 683. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 684. { 685. return remove_session_lock(ctx, c, 1); ^ 686. } 687. ssl/ssl_sess.c:688:1: Parameter `ctx->sessions->num_items` 686. } 687. 688. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 689. { 690. SSL_SESSION *r; ssl/ssl_sess.c:699:6: Call 697. { 698. ret=1; 699. r=lh_SSL_SESSION_delete(ctx->sessions,c); ^ 700. SSL_SESSION_list_remove(ctx,c); 701. } crypto/lhash/lhash.c:218:1: <LHS trace> 216. } 217. 218. > void *lh_delete(_LHASH *lh, const void *data) 219. { 220. unsigned long hash; crypto/lhash/lhash.c:218:1: Parameter `lh->num_items` 216. } 217. 218. > void *lh_delete(_LHASH *lh, const void *data) 219. { 220. unsigned long hash; crypto/lhash/lhash.c:241:2: Binary operation: ([0, max(0, s->ctx->sessions->num_items)] - 1):unsigned64 by call to `dtls1_process_record` 239. } 240. 241. lh->num_items--; ^ 242. if ((lh->num_nodes > MIN_NODES) && 243. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
https://github.com/openssl/openssl/blob/732192a0796c4ecbef3b13ccc8ee8ab23e28f483/crypto/lhash/lhash.c/#L241
d2a_code_trace_data_42474
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_ossl.c:683: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `bn_to_mont_fixed_top`. Showing all 52 steps of the trace crypto/rsa/rsa_ossl.c:591:1: Parameter `ctx->stack.depth` 589. } 590. 591. > static int rsa_ossl_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) 592. { 593. BIGNUM *r1, *m1, *vrfy, *r2, *m[RSA_MAX_PRIME_NUM - 2]; crypto/rsa/rsa_ossl.c:597:5: Call 595. RSA_PRIME_INFO *pinfo; 596. 597. BN_CTX_start(ctx); ^ 598. 599. r1 = 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_ossl.c:599:10: Call 597. BN_CTX_start(ctx); 598. 599. r1 = BN_CTX_get(ctx); ^ 600. r2 = BN_CTX_get(ctx); 601. m1 = 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_ossl.c:600:10: Call 598. 599. r1 = BN_CTX_get(ctx); 600. r2 = BN_CTX_get(ctx); ^ 601. m1 = BN_CTX_get(ctx); 602. vrfy = 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_ossl.c:601:10: Call 599. r1 = BN_CTX_get(ctx); 600. r2 = BN_CTX_get(ctx); 601. m1 = BN_CTX_get(ctx); ^ 602. vrfy = BN_CTX_get(ctx); 603. if (vrfy == 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_ossl.c:602:12: Call 600. r2 = BN_CTX_get(ctx); 601. m1 = BN_CTX_get(ctx); 602. vrfy = BN_CTX_get(ctx); ^ 603. if (vrfy == NULL) 604. 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/rsa/rsa_ossl.c:662:14: Call 660. */ 661. if (/* m1 = I moq q */ 662. !bn_from_mont_fixed_top(m1, I, rsa->_method_mod_q, ctx) ^ 663. || !bn_to_mont_fixed_top(m1, m1, rsa->_method_mod_q, ctx) 664. /* m1 = m1^dmq1 mod q */ crypto/bn/bn_mont.c:174:1: Parameter `ctx->stack.depth` 172. } 173. 174. > int bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, 175. BN_CTX *ctx) 176. { crypto/bn/bn_mont.c:181:5: Call 179. BIGNUM *t; 180. 181. BN_CTX_start(ctx); ^ 182. if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) { 183. retn = bn_from_montgomery_word(ret, t, mont); 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_mont.c:182:14: Call 180. 181. BN_CTX_start(ctx); 182. if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) { ^ 183. retn = bn_from_montgomery_word(ret, t, mont); 184. } 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_mont.c:185:5: Call 183. retn = bn_from_montgomery_word(ret, t, mont); 184. } 185. BN_CTX_end(ctx); ^ 186. #else /* !MONT_WORD */ 187. BIGNUM *t1, *t2; 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/rsa/rsa_ossl.c:663:17: Call 661. if (/* m1 = I moq q */ 662. !bn_from_mont_fixed_top(m1, I, rsa->_method_mod_q, ctx) 663. || !bn_to_mont_fixed_top(m1, m1, rsa->_method_mod_q, ctx) ^ 664. /* m1 = m1^dmq1 mod q */ 665. || !BN_mod_exp_mont_consttime(m1, m1, rsa->dmq1, rsa->q, ctx, crypto/bn/bn_mont.c:222:1: Parameter `ctx->stack.depth` 220. } 221. 222. > int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 223. BN_CTX *ctx) 224. { crypto/bn/bn_mont.c:225:12: Call 223. BN_CTX *ctx) 224. { 225. return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx); ^ 226. } 227. 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/rsa/rsa_ossl.c:665:17: Call 663. || !bn_to_mont_fixed_top(m1, m1, rsa->_method_mod_q, ctx) 664. /* m1 = m1^dmq1 mod q */ 665. || !BN_mod_exp_mont_consttime(m1, m1, rsa->dmq1, rsa->q, ctx, ^ 666. rsa->_method_mod_q) 667. /* r1 = I mod p */ crypto/bn/bn_exp.c:592:1: Parameter `ctx->stack.depth` 590. * http://www.daemonology.net/hyperthreading-considered-harmful/) 591. */ 592. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 593. const BIGNUM *m, BN_CTX *ctx, 594. BN_MONT_CTX *in_mont) crypto/rsa/rsa_ossl.c:668:17: Call 666. rsa->_method_mod_q) 667. /* r1 = I mod p */ 668. || !bn_from_mont_fixed_top(r1, I, rsa->_method_mod_p, ctx) ^ 669. || !bn_to_mont_fixed_top(r1, r1, rsa->_method_mod_p, ctx) 670. /* r1 = r1^dmp1 mod p */ crypto/bn/bn_mont.c:174:1: Parameter `ctx->stack.depth` 172. } 173. 174. > int bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, 175. BN_CTX *ctx) 176. { crypto/bn/bn_mont.c:181:5: Call 179. BIGNUM *t; 180. 181. BN_CTX_start(ctx); ^ 182. if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) { 183. retn = bn_from_montgomery_word(ret, t, mont); 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_mont.c:182:14: Call 180. 181. BN_CTX_start(ctx); 182. if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) { ^ 183. retn = bn_from_montgomery_word(ret, t, mont); 184. } 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_mont.c:185:5: Call 183. retn = bn_from_montgomery_word(ret, t, mont); 184. } 185. BN_CTX_end(ctx); ^ 186. #else /* !MONT_WORD */ 187. BIGNUM *t1, *t2; 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/rsa/rsa_ossl.c:669:17: Call 667. /* r1 = I mod p */ 668. || !bn_from_mont_fixed_top(r1, I, rsa->_method_mod_p, ctx) 669. || !bn_to_mont_fixed_top(r1, r1, rsa->_method_mod_p, ctx) ^ 670. /* r1 = r1^dmp1 mod p */ 671. || !BN_mod_exp_mont_consttime(r1, r1, rsa->dmp1, rsa->p, ctx, crypto/bn/bn_mont.c:222:1: Parameter `ctx->stack.depth` 220. } 221. 222. > int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 223. BN_CTX *ctx) 224. { crypto/bn/bn_mont.c:225:12: Call 223. BN_CTX *ctx) 224. { 225. return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx); ^ 226. } 227. 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/rsa/rsa_ossl.c:671:17: Call 669. || !bn_to_mont_fixed_top(r1, r1, rsa->_method_mod_p, ctx) 670. /* r1 = r1^dmp1 mod p */ 671. || !BN_mod_exp_mont_consttime(r1, r1, rsa->dmp1, rsa->p, ctx, ^ 672. rsa->_method_mod_p) 673. /* r1 = (r1 - m1) mod p */ crypto/bn/bn_exp.c:592:1: Parameter `ctx->stack.depth` 590. * http://www.daemonology.net/hyperthreading-considered-harmful/) 591. */ 592. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 593. const BIGNUM *m, BN_CTX *ctx, 594. BN_MONT_CTX *in_mont) crypto/rsa/rsa_ossl.c:683:17: Call 681. 682. /* r1 = r1 * iqmp mod p */ 683. || !bn_to_mont_fixed_top(r1, r1, rsa->_method_mod_p, ctx) ^ 684. || !bn_mul_mont_fixed_top(r1, r1, rsa->iqmp, rsa->_method_mod_p, 685. ctx) crypto/bn/bn_mont.c:222:1: Parameter `ctx->stack.depth` 220. } 221. 222. > int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 223. BN_CTX *ctx) 224. { crypto/bn/bn_mont.c:225:12: Call 223. BN_CTX *ctx) 224. { 225. return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx); ^ 226. } 227. crypto/bn/bn_mont.c:60:5: Call 58. return 0; 59. 60. BN_CTX_start(ctx); ^ 61. tmp = BN_CTX_get(ctx); 62. if (tmp == NULL) 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_mont.c:83:5: Call 81. ret = 1; 82. err: 83. BN_CTX_end(ctx); ^ 84. return ret; 85. } 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_to_mont_fixed_top` 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_42475
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; if (pkt->buf->length > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = (pkt->buf->length == 0) ? DEFAULT_BUF_SIZE : pkt->buf->length * 2; } 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:1072: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + `s->tlsext_hostname->strlen` + 20]):unsigned64 by call to `WPACKET_put_bytes`. Showing all 9 steps of the trace ssl/t1_lib.c:1016:1: Parameter `pkt->written` 1014. } 1015. 1016. > int ssl_add_clienthello_tlsext(SSL *s, WPACKET *pkt, int *al) 1017. { 1018. #ifndef OPENSSL_NO_EC ssl/t1_lib.c:1072:14: Call 1070. /* Add SRP username if there is one */ 1071. if (s->srp_ctx.login != NULL) { 1072. if (!WPACKET_put_bytes(pkt, TLSEXT_TYPE_srp, 2) ^ 1073. /* Sub-packet for SRP extension */ 1074. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:226:1: Parameter `pkt->written` 224. } 225. 226. > int WPACKET_put_bytes(WPACKET *pkt, unsigned int val, size_t size) 227. { 228. unsigned char *data; ssl/packet.c:234:17: Call 232. 233. if (size > sizeof(unsigned int) 234. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 235. || !put_value(data, val, size)) 236. return 0; 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] - [0, s->s3->previous_client_finished_len + pkt->written + s->tlsext_hostname->strlen + 20]):unsigned64 by call to `WPACKET_put_bytes` 23. return 0; 24. 25. if (pkt->buf->length - pkt->written < len) { ^ 26. size_t newlen; 27.
https://github.com/openssl/openssl/blob/c0f9e23c6b8d1076796987d5a84557d410682d85/ssl/packet.c/#L25
d2a_code_trace_data_42476
static int on2avc_decode_subframe(On2AVCContext *c, const uint8_t *buf, int buf_size, AVFrame *dst, int offset) { GetBitContext gb; int i, ret; init_get_bits(&gb, buf, buf_size * 8); if (get_bits1(&gb)) { av_log(c->avctx, AV_LOG_ERROR, "enh bit set\n"); return AVERROR_INVALIDDATA; } c->prev_window_type = c->window_type; c->window_type = get_bits(&gb, 3); if (c->window_type >= WINDOW_TYPE_EXT4 && c->avctx->channels == 1) { av_log(c->avctx, AV_LOG_ERROR, "stereo mode window for mono audio\n"); return AVERROR_INVALIDDATA; } c->band_start = c->modes[c->window_type].band_start; c->num_windows = c->modes[c->window_type].num_windows; c->num_bands = c->modes[c->window_type].num_bands; c->is_long = (c->window_type != WINDOW_TYPE_8SHORT); c->grouping[0] = 1; for (i = 1; i < c->num_windows; i++) c->grouping[i] = !get_bits1(&gb); on2avc_read_ms_info(c, &gb); for (i = 0; i < c->avctx->channels; i++) if ((ret = on2avc_read_channel_data(c, &gb, i)) < 0) return AVERROR_INVALIDDATA; if (c->avctx->channels == 2 && c->ms_present) on2avc_apply_ms(c); if (c->window_type < WINDOW_TYPE_EXT4) { for (i = 0; i < c->avctx->channels; i++) on2avc_reconstruct_channel(c, i, dst, offset); } else { on2avc_reconstruct_stereo(c, dst, offset); } return 0; } libavcodec/on2avc.c:799: error: Null Dereference pointer `&gb->buffer` last assigned on line 798 could be null and is dereferenced by call to `get_bits1()` at line 799, column 9. libavcodec/on2avc.c:792:1: start of procedure on2avc_decode_subframe() 790. } 791. 792. static int on2avc_decode_subframe(On2AVCContext *c, const uint8_t *buf, ^ 793. int buf_size, AVFrame *dst, int offset) 794. { libavcodec/on2avc.c:798:5: 796. int i, ret; 797. 798. init_get_bits(&gb, buf, buf_size * 8); ^ 799. if (get_bits1(&gb)) { 800. av_log(c->avctx, AV_LOG_ERROR, "enh bit set\n"); libavcodec/get_bits.h:376:1: start of procedure init_get_bits() 374. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. 375. */ 376. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, ^ 377. int bit_size) 378. { libavcodec/get_bits.h:380:5: 378. { 379. int buffer_size; 380. int ret = 0; ^ 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { libavcodec/get_bits.h:382:9: Taking true branch 380. int ret = 0; 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { ^ 383. bit_size = 0; 384. buffer = NULL; libavcodec/get_bits.h:383:9: 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 383. bit_size = 0; ^ 384. buffer = NULL; 385. ret = AVERROR_INVALIDDATA; libavcodec/get_bits.h:384:9: 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 383. bit_size = 0; 384. buffer = NULL; ^ 385. ret = AVERROR_INVALIDDATA; 386. } libavcodec/get_bits.h:385:9: 383. bit_size = 0; 384. buffer = NULL; 385. ret = AVERROR_INVALIDDATA; ^ 386. } 387. libavcodec/get_bits.h:388:5: 386. } 387. 388. buffer_size = (bit_size + 7) >> 3; ^ 389. 390. s->buffer = buffer; libavcodec/get_bits.h:390:5: 388. buffer_size = (bit_size + 7) >> 3; 389. 390. s->buffer = buffer; ^ 391. s->size_in_bits = bit_size; 392. #if !UNCHECKED_BITSTREAM_READER libavcodec/get_bits.h:391:5: 389. 390. s->buffer = buffer; 391. s->size_in_bits = bit_size; ^ 392. #if !UNCHECKED_BITSTREAM_READER 393. s->size_in_bits_plus8 = bit_size + 8; libavcodec/get_bits.h:393:5: 391. s->size_in_bits = bit_size; 392. #if !UNCHECKED_BITSTREAM_READER 393. s->size_in_bits_plus8 = bit_size + 8; ^ 394. #endif 395. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:395:5: 393. s->size_in_bits_plus8 = bit_size + 8; 394. #endif 395. s->buffer_end = buffer + buffer_size; ^ 396. s->index = 0; 397. libavcodec/get_bits.h:396:5: 394. #endif 395. s->buffer_end = buffer + buffer_size; 396. s->index = 0; ^ 397. 398. return ret; libavcodec/get_bits.h:398:5: 396. s->index = 0; 397. 398. return ret; ^ 399. } 400. libavcodec/get_bits.h:399:1: return from a call to init_get_bits 397. 398. return ret; 399. } ^ 400. 401. /** libavcodec/on2avc.c:799:9: 797. 798. init_get_bits(&gb, buf, buf_size * 8); 799. if (get_bits1(&gb)) { ^ 800. av_log(c->avctx, AV_LOG_ERROR, "enh bit set\n"); 801. return AVERROR_INVALIDDATA; libavcodec/get_bits.h:272:1: start of procedure get_bits1() 270. } 271. 272. static inline unsigned int get_bits1(GetBitContext *s) ^ 273. { 274. unsigned int index = s->index; libavcodec/get_bits.h:274:5: 272. static inline unsigned int get_bits1(GetBitContext *s) 273. { 274. unsigned int index = s->index; ^ 275. uint8_t result = s->buffer[index >> 3]; 276. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:275:5: 273. { 274. unsigned int index = s->index; 275. uint8_t result = s->buffer[index >> 3]; ^ 276. #ifdef BITSTREAM_READER_LE 277. result >>= index & 7;
https://github.com/libav/libav/blob/77ab341c0c6cdf2bd437bb48d429e797d1e60da2/libavcodec/on2avc.c/#L799
d2a_code_trace_data_42477
int BN_hex2bn(BIGNUM **bn, const char *a) { BIGNUM *ret = NULL; BN_ULONG l = 0; int neg = 0, h, m, i, j, k, c; int num; if ((a == NULL) || (*a == '\0')) return (0); if (*a == '-') { neg = 1; a++; } for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) continue; if (i == 0 || i > INT_MAX/4) goto err; num = i + neg; if (bn == NULL) return (num); if (*bn == NULL) { if ((ret = BN_new()) == NULL) return (0); } else { ret = *bn; BN_zero(ret); } if (bn_expand(ret, i * 4) == NULL) goto err; j = i; m = 0; h = 0; while (j > 0) { m = ((BN_BYTES * 2) <= j) ? (BN_BYTES * 2) : j; l = 0; for (;;) { c = a[j - m]; k = OPENSSL_hexchar2int(c); if (k < 0) k = 0; l = (l << 4) | k; if (--m <= 0) { ret->d[h++] = l; break; } } j -= (BN_BYTES * 2); } ret->top = h; bn_correct_top(ret); *bn = ret; bn_check_top(ret); if (ret->top != 0) ret->neg = neg; return (num); err: if (*bn == NULL) BN_free(ret); return (0); } test/bntest.c:1677: error: BUFFER_OVERRUN_L2 Offset: [2, 536870915] (⇐ [2, 4] + [0, 536870911]) Size: 7 by call to `BN_asc2bn`. Showing all 9 steps of the trace test/bntest.c:1677:10: Call 1675. goto err; 1676. 1677. if (!TEST_true(BN_asc2bn(&bn, "0x1234")) ^ 1678. || !TEST_BN_eq_word(bn, 0x1234) 1679. || !TEST_BN_ge_zero(bn)) crypto/bn/bn_print.c:267:1: Parameter `*a` 265. } 266. 267. > int BN_asc2bn(BIGNUM **bn, const char *a) 268. { 269. const char *p = a; crypto/bn/bn_print.c:269:5: Assignment 267. int BN_asc2bn(BIGNUM **bn, const char *a) 268. { 269. const char *p = a; ^ 270. 271. if (*p == '-') crypto/bn/bn_print.c:275:14: Call 273. 274. if (p[0] == '0' && (p[1] == 'X' || p[1] == 'x')) { 275. if (!BN_hex2bn(bn, p + 2)) ^ 276. return 0; 277. } else { crypto/bn/bn_print.c:139:10: <Offset trace> 137. } 138. 139. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) ^ 140. continue; 141. crypto/bn/bn_print.c:139:10: Assignment 137. } 138. 139. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) ^ 140. continue; 141. crypto/bn/bn_print.c:124:1: <Length trace> 122. } 123. 124. > int BN_hex2bn(BIGNUM **bn, const char *a) 125. { 126. BIGNUM *ret = NULL; crypto/bn/bn_print.c:124:1: Parameter `*a` 122. } 123. 124. > int BN_hex2bn(BIGNUM **bn, const char *a) 125. { 126. BIGNUM *ret = NULL; crypto/bn/bn_print.c:139:37: Array access: Offset: [2, 536870915] (⇐ [2, 4] + [0, 536870911]) Size: 7 by call to `BN_asc2bn` 137. } 138. 139. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) ^ 140. continue; 141.
https://github.com/openssl/openssl/blob/3f97052392cb10fca5309212bf720685262ad4a6/crypto/bn/bn_print.c/#L139
d2a_code_trace_data_42478
static inline void pred_direct_motion(H264Context * const h, int *mb_type){ MpegEncContext * const s = &h->s; const int mb_xy = s->mb_x + s->mb_y*s->mb_stride; const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride; const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy]; const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy]; const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy]; const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy]; const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy]; const int is_b8x8 = IS_8X8(*mb_type); unsigned int sub_mb_type; int i8, i4; #define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM) if(IS_8X8(mb_type_col) && !h->sps.direct_8x8_inference_flag){ sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1; }else if(!is_b8x8 && (mb_type_col & MB_TYPE_16x16_OR_INTRA)){ sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; }else{ sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1; } if(!is_b8x8) *mb_type |= MB_TYPE_DIRECT2; if(MB_FIELD) *mb_type |= MB_TYPE_INTERLACED; tprintf(s->avctx, "mb_type = %08x, sub_mb_type = %08x, is_b8x8 = %d, mb_type_col = %08x\n", *mb_type, sub_mb_type, is_b8x8, mb_type_col); if(h->direct_spatial_mv_pred){ int ref[2]; int mv[2][2]; int list; for(list=0; list<2; list++){ int refa = h->ref_cache[list][scan8[0] - 1]; int refb = h->ref_cache[list][scan8[0] - 8]; int refc = h->ref_cache[list][scan8[0] - 8 + 4]; if(refc == -2) refc = h->ref_cache[list][scan8[0] - 8 - 1]; ref[list] = refa; if(ref[list] < 0 || (refb < ref[list] && refb >= 0)) ref[list] = refb; if(ref[list] < 0 || (refc < ref[list] && refc >= 0)) ref[list] = refc; if(ref[list] < 0) ref[list] = -1; } if(ref[0] < 0 && ref[1] < 0){ ref[0] = ref[1] = 0; mv[0][0] = mv[0][1] = mv[1][0] = mv[1][1] = 0; }else{ for(list=0; list<2; list++){ if(ref[list] >= 0) pred_motion(h, 0, 4, list, ref[list], &mv[list][0], &mv[list][1]); else mv[list][0] = mv[list][1] = 0; } } if(ref[1] < 0){ if(!is_b8x8) *mb_type &= ~MB_TYPE_L1; sub_mb_type &= ~MB_TYPE_L1; }else if(ref[0] < 0){ if(!is_b8x8) *mb_type &= ~MB_TYPE_L0; sub_mb_type &= ~MB_TYPE_L0; } if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){ int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride; int mb_types_col[2]; int b8_stride = h->b8_stride; int b4_stride = h->b_stride; *mb_type = (*mb_type & ~MB_TYPE_16x16) | MB_TYPE_8x8; if(IS_INTERLACED(*mb_type)){ mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy]; mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; if(s->mb_y&1){ l1ref0 -= 2*b8_stride; l1ref1 -= 2*b8_stride; l1mv0 -= 4*b4_stride; l1mv1 -= 4*b4_stride; } b8_stride *= 3; b4_stride *= 6; }else{ int cur_poc = s->current_picture_ptr->poc; int *col_poc = h->ref_list[1]->field_poc; int col_parity = FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc); int dy = 2*col_parity - (s->mb_y&1); mb_types_col[0] = mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy + col_parity*s->mb_stride]; l1ref0 += dy*b8_stride; l1ref1 += dy*b8_stride; l1mv0 += 2*dy*b4_stride; l1mv1 += 2*dy*b4_stride; b8_stride = 0; } for(i8=0; i8<4; i8++){ int x8 = i8&1; int y8 = i8>>1; int xy8 = x8+y8*b8_stride; int xy4 = 3*x8+y8*b4_stride; int a=0, b=0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_types_col[y8]) && ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1) || (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){ if(ref[0] > 0) a= pack16to32(mv[0][0],mv[0][1]); if(ref[1] > 0) b= pack16to32(mv[1][0],mv[1][1]); }else{ a= pack16to32(mv[0][0],mv[0][1]); b= pack16to32(mv[1][0],mv[1][1]); } fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4); } }else if(IS_16X16(*mb_type)){ int a=0, b=0; fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_type_col) && ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1) || (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1 && (h->x264_build>33 || !h->x264_build)))){ if(ref[0] > 0) a= pack16to32(mv[0][0],mv[0][1]); if(ref[1] > 0) b= pack16to32(mv[1][0],mv[1][1]); }else{ a= pack16to32(mv[0][0],mv[0][1]); b= pack16to32(mv[1][0],mv[1][1]); } fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4); fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4); }else{ for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4); fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0 || (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0 && (h->x264_build>33 || !h->x264_build)))){ const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1; if(IS_SUB_8X8(sub_mb_type)){ const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ if(ref[0] == 0) fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); if(ref[1] == 0) fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); } }else for(i4=0; i4<4; i4++){ const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride]; if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ if(ref[0] == 0) *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0; if(ref[1] == 0) *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0; } } } } } }else{ const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]}; const int *dist_scale_factor = h->dist_scale_factor; if(FRAME_MBAFF){ if(IS_INTERLACED(*mb_type)){ map_col_to_list0[0] = h->map_col_to_list0_field[0]; map_col_to_list0[1] = h->map_col_to_list0_field[1]; dist_scale_factor = h->dist_scale_factor_field; } if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){ const int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride; int mb_types_col[2]; int y_shift; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1 | (is_b8x8 ? 0 : MB_TYPE_DIRECT2) | (*mb_type & MB_TYPE_INTERLACED); sub_mb_type = MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_16x16; if(IS_INTERLACED(*mb_type)){ mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy]; mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; if(s->mb_y&1){ l1ref0 -= 2*h->b8_stride; l1ref1 -= 2*h->b8_stride; l1mv0 -= 4*h->b_stride; l1mv1 -= 4*h->b_stride; } y_shift = 0; if( (mb_types_col[0] & MB_TYPE_16x16_OR_INTRA) && (mb_types_col[1] & MB_TYPE_16x16_OR_INTRA) && !is_b8x8) *mb_type |= MB_TYPE_16x8; else *mb_type |= MB_TYPE_8x8; }else{ int dy = (s->mb_y&1) ? 1 : 2; mb_types_col[0] = mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; l1ref0 += dy*h->b8_stride; l1ref1 += dy*h->b8_stride; l1mv0 += 2*dy*h->b_stride; l1mv1 += 2*dy*h->b_stride; y_shift = 2; if((mb_types_col[0] & (MB_TYPE_16x16_OR_INTRA|MB_TYPE_16x8)) && !is_b8x8) *mb_type |= MB_TYPE_16x16; else *mb_type |= MB_TYPE_8x8; } for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; int ref0, scale; const int16_t (*l1mv)[2]= l1mv0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1); if(IS_INTRA(mb_types_col[y8])){ fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1); fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); continue; } ref0 = l1ref0[x8 + (y8*2>>y_shift)*h->b8_stride]; if(ref0 >= 0) ref0 = map_col_to_list0[0][ref0*2>>y_shift]; else{ ref0 = map_col_to_list0[1][l1ref1[x8 + (y8*2>>y_shift)*h->b8_stride]*2>>y_shift]; l1mv= l1mv1; } scale = dist_scale_factor[ref0]; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); { const int16_t *mv_col = l1mv[x8*3 + (y8*6>>y_shift)*h->b_stride]; int my_col = (mv_col[1]<<y_shift)/2; int mx = (scale * mv_col[0] + 128) >> 8; int my = (scale * my_col + 128) >> 8; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4); } } return; } } if(IS_16X16(*mb_type)){ int ref, mv0, mv1; fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1); if(IS_INTRA(mb_type_col)){ ref=mv0=mv1=0; }else{ const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0]] : map_col_to_list0[1][l1ref1[0]]; const int scale = dist_scale_factor[ref0]; const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0]; int mv_l0[2]; mv_l0[0] = (scale * mv_col[0] + 128) >> 8; mv_l0[1] = (scale * mv_col[1] + 128) >> 8; ref= ref0; mv0= pack16to32(mv_l0[0],mv_l0[1]); mv1= pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); } fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1); fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, mv0, 4); fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, mv1, 4); }else{ for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; int ref0, scale; const int16_t (*l1mv)[2]= l1mv0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1); if(IS_INTRA(mb_type_col)){ fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1); fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); continue; } ref0 = l1ref0[x8 + y8*h->b8_stride]; if(ref0 >= 0) ref0 = map_col_to_list0[0][ref0]; else{ ref0 = map_col_to_list0[1][l1ref1[x8 + y8*h->b8_stride]]; l1mv= l1mv1; } scale = dist_scale_factor[ref0]; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); if(IS_SUB_8X8(sub_mb_type)){ const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; int mx = (scale * mv_col[0] + 128) >> 8; int my = (scale * mv_col[1] + 128) >> 8; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4); }else for(i4=0; i4<4; i4++){ const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride]; int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]]; mv_l0[0] = (scale * mv_col[0] + 128) >> 8; mv_l0[1] = (scale * mv_col[1] + 128) >> 8; *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); } } } } } libavcodec/h264.c:1012: error: Uninitialized Value The value read from ref[_] was never initialized. libavcodec/h264.c:1012:12: 1010. } 1011. 1012. if(ref[0] < 0 && ref[1] < 0){ ^ 1013. ref[0] = ref[1] = 0; 1014. mv[0][0] = mv[0][1] =
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1012
d2a_code_trace_data_42479
static int check_chain_extensions(X509_STORE_CTX *ctx) { #ifdef OPENSSL_NO_CHAIN_VERIFY return 1; #else 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 < ctx->last_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; #endif } crypto/x509/x509_vfy.c:607: error: NULL_DEREFERENCE pointer `x` last assigned on line 589 could be null and is dereferenced by call to `X509_check_ca()` at line 607, column 9. Showing all 26 steps of the trace crypto/x509/x509_vfy.c:545:1: start of procedure check_chain_extensions() 543. */ 544. 545. > static int check_chain_extensions(X509_STORE_CTX *ctx) 546. { 547. #ifdef OPENSSL_NO_CHAIN_VERIFY crypto/x509/x509_vfy.c:550:2: 548. return 1; 549. #else 550. > int i, ok=0, must_be_ca, plen = 0; 551. X509 *x; 552. int (*cb)(int xok,X509_STORE_CTX *xctx); crypto/x509/x509_vfy.c:553:2: 551. X509 *x; 552. int (*cb)(int xok,X509_STORE_CTX *xctx); 553. > int proxy_path_length = 0; 554. int purpose; 555. int allow_proxy_certs; crypto/x509/x509_vfy.c:556:2: 554. int purpose; 555. int allow_proxy_certs; 556. > cb=ctx->verify_cb; 557. 558. /* must_be_ca can have 1 of 3 values: crypto/x509/x509_vfy.c:566:2: 564. all certificates in the chain except the leaf certificate. 565. */ 566. > must_be_ca = -1; 567. 568. /* CRL path validation */ crypto/x509/x509_vfy.c:569:6: Taking false branch 567. 568. /* CRL path validation */ 569. if (ctx->parent) ^ 570. { 571. allow_proxy_certs = 0; crypto/x509/x509_vfy.c:577:7: Condition is true 575. { 576. allow_proxy_certs = 577. !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); ^ 578. /* A hack to keep people who don't want to modify their 579. software happy */ crypto/x509/x509_vfy.c:577:4: 575. { 576. allow_proxy_certs = 577. > !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 578. /* A hack to keep people who don't want to modify their 579. software happy */ crypto/x509/x509_vfy.c:576:3: 574. else 575. { 576. > allow_proxy_certs = 577. !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 578. /* A hack to keep people who don't want to modify their crypto/x509/x509_vfy.c:580:7: Taking false branch 578. /* A hack to keep people who don't want to modify their 579. software happy */ 580. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) ^ 581. allow_proxy_certs = 1; 582. purpose = ctx->param->purpose; crypto/x509/x509_vfy.c:582:3: 580. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) 581. allow_proxy_certs = 1; 582. > purpose = ctx->param->purpose; 583. } 584. crypto/x509/x509_vfy.c:586:7: 584. 585. /* Check all untrusted certificates */ 586. > for (i = 0; i < ctx->last_untrusted; i++) 587. { 588. int ret; crypto/x509/x509_vfy.c:586:14: Loop condition is true. Entering loop body 584. 585. /* Check all untrusted certificates */ 586. for (i = 0; i < ctx->last_untrusted; i++) ^ 587. { 588. int ret; crypto/x509/x509_vfy.c:589:7: Condition is true 587. { 588. int ret; 589. x = sk_X509_value(ctx->chain, i); ^ 590. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 591. && (x->ex_flags & EXFLAG_CRITICAL)) crypto/x509/x509_vfy.c:589:3: 587. { 588. int ret; 589. > x = sk_X509_value(ctx->chain, i); 590. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 591. && (x->ex_flags & EXFLAG_CRITICAL)) crypto/stack/stack.c:337:1: start of procedure sk_value() 335. } 336. 337. > void *sk_value(const _STACK *st, int i) 338. { 339. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:339:6: Taking false branch 337. void *sk_value(const _STACK *st, int i) 338. { 339. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 340. return st->data[i]; 341. } crypto/stack/stack.c:339:13: Taking false branch 337. void *sk_value(const _STACK *st, int i) 338. { 339. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 340. return st->data[i]; 341. } crypto/stack/stack.c:339:24: Taking true branch 337. void *sk_value(const _STACK *st, int i) 338. { 339. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 340. return st->data[i]; 341. } crypto/stack/stack.c:339:39: 337. void *sk_value(const _STACK *st, int i) 338. { 339. > if(!st || (i < 0) || (i >= st->num)) return NULL; 340. return st->data[i]; 341. } crypto/stack/stack.c:341:1: return from a call to sk_value 339. if(!st || (i < 0) || (i >= st->num)) return NULL; 340. return st->data[i]; 341. > } 342. 343. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:590:9: Taking false branch 588. int ret; 589. x = sk_X509_value(ctx->chain, i); 590. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) ^ 591. && (x->ex_flags & EXFLAG_CRITICAL)) 592. { crypto/x509/x509_vfy.c:599:8: Taking false branch 597. if (!ok) goto end; 598. } 599. if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) ^ 600. { 601. ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; crypto/x509/x509_vfy.c:607:3: 605. if (!ok) goto end; 606. } 607. > ret = X509_check_ca(x); 608. switch(must_be_ca) 609. { crypto/x509v3/v3_purp.c:538:1: start of procedure X509_check_ca() 536. } 537. 538. > int X509_check_ca(X509 *x) 539. { 540. if(!(x->ex_flags & EXFLAG_SET)) { crypto/x509v3/v3_purp.c:540:7: 538. int X509_check_ca(X509 *x) 539. { 540. > if(!(x->ex_flags & EXFLAG_SET)) { 541. CRYPTO_w_lock(CRYPTO_LOCK_X509); 542. x509v3_cache_extensions(x);
https://github.com/openssl/openssl/blob/750487899ad2b794078ed998b513a4a14f60f2cc/crypto/x509/x509_vfy.c/#L607
d2a_code_trace_data_42480
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/s3_lib.c:2802: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 4]):unsigned64 by call to `WPACKET_start_sub_packet_len__`. Showing all 12 steps of the trace ssl/s3_lib.c:2801:10: Call 2799. { 2800. /* Set the content type and 3 bytes for the message len */ 2801. if (!WPACKET_put_bytes_u8(pkt, htype) ^ 2802. || !WPACKET_start_sub_packet_u24(pkt)) 2803. return 0; ssl/packet.c:261:1: Parameter `pkt->buf->length` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; ssl/s3_lib.c:2802:17: Call 2800. /* Set the content type and 3 bytes for the message len */ 2801. if (!WPACKET_put_bytes_u8(pkt, htype) 2802. || !WPACKET_start_sub_packet_u24(pkt)) ^ 2803. return 0; 2804. ssl/packet.c:224:1: Parameter `pkt->written` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/packet.c:248:10: Call 246. } 247. 248. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 249. return 0; 250. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */ 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, pkt->written + 4]):unsigned64 by call to `WPACKET_start_sub_packet_len__` 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_42481
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecp_oct.c:258: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`. Showing all 9 steps of the trace crypto/ec/ecp_oct.c:154:1: Parameter `ctx->stack.depth` 152. } 153. 154. > size_t ec_GFp_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, 155. point_conversion_form_t form, 156. unsigned char *buf, size_t len, BN_CTX *ctx) crypto/ec/ecp_oct.c:258:9: Call 256. 257. if (used_ctx) 258. BN_CTX_end(ctx); ^ 259. BN_CTX_free(new_ctx); 260. return ret; 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_CTX_end` 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_42482
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_lib.c:1443: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `s->s3->previous_server_finished_len` + `pkt->written` + 17]):unsigned64 by call to `WPACKET_put_bytes__`. Showing all 12 steps of the trace ssl/t1_lib.c:1410:10: Call 1408. #endif 1409. 1410. if (!WPACKET_start_sub_packet_u16(pkt) ^ 1411. || !WPACKET_set_flags(pkt, WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH)) { 1412. SSLerr(SSL_F_SSL_ADD_SERVERHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); 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/t1_lib.c:1443:14: Call 1441. tls1_get_formatlist(s, &plist, &plistlen); 1442. 1443. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats) ^ 1444. || !WPACKET_start_sub_packet_u16(pkt) 1445. || !WPACKET_sub_memcpy_u8(pkt, plist, plistlen) ssl/packet.c:261:1: Parameter `pkt->written` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; ssl/packet.c:269:17: Call 267. 268. if (size > sizeof(unsigned int) 269. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 270. || !put_value(data, val, size)) 271. 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: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, s->s3->previous_client_finished_len + s->s3->previous_server_finished_len + pkt->written + 17]):unsigned64 by call to `WPACKET_put_bytes__` 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_42483
static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count) { int16_t weight[8][64]; DCTELEM orig[8][64]; const int mb_x= s->mb_x; const int mb_y= s->mb_y; int i; int skip_dct[8]; int dct_offset = s->linesize*8; uint8_t *ptr_y, *ptr_cb, *ptr_cr; int wrap_y, wrap_c; for(i=0; i<mb_block_count; i++) skip_dct[i]=s->skipdct; if(s->adaptive_quant){ const int last_qp= s->qscale; const int mb_xy= mb_x + mb_y*s->mb_stride; s->lambda= s->lambda_table[mb_xy]; update_qscale(s); if(!(s->flags&CODEC_FLAG_QP_RD)){ s->qscale= s->current_picture_ptr->qscale_table[mb_xy]; s->dquant= s->qscale - last_qp; if(s->out_format==FMT_H263){ s->dquant= av_clip(s->dquant, -2, 2); if(s->codec_id==CODEC_ID_MPEG4){ if(!s->mb_intra){ if(s->pict_type == FF_B_TYPE){ if(s->dquant&1 || s->mv_dir&MV_DIRECT) s->dquant= 0; } if(s->mv_type==MV_TYPE_8X8) s->dquant=0; } } } } ff_set_qscale(s, last_qp + s->dquant); }else if(s->flags&CODEC_FLAG_QP_RD) ff_set_qscale(s, s->qscale + s->dquant); wrap_y = s->linesize; wrap_c = s->uvlinesize; ptr_y = s->new_picture.data[0] + (mb_y * 16 * wrap_y) + mb_x * 16; ptr_cb = s->new_picture.data[1] + (mb_y * mb_block_height * wrap_c) + mb_x * 8; ptr_cr = s->new_picture.data[2] + (mb_y * mb_block_height * wrap_c) + mb_x * 8; if(mb_x*16+16 > s->width || mb_y*16+16 > s->height){ uint8_t *ebuf= s->edge_emu_buffer + 32; ff_emulated_edge_mc(ebuf , ptr_y , wrap_y,16,16,mb_x*16,mb_y*16, s->width , s->height); ptr_y= ebuf; ff_emulated_edge_mc(ebuf+18*wrap_y , ptr_cb, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1); ptr_cb= ebuf+18*wrap_y; ff_emulated_edge_mc(ebuf+18*wrap_y+8, ptr_cr, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1); ptr_cr= ebuf+18*wrap_y+8; } if (s->mb_intra) { if(s->flags&CODEC_FLAG_INTERLACED_DCT){ int progressive_score, interlaced_score; s->interlaced_dct=0; progressive_score= s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y, 8) +s->dsp.ildct_cmp[4](s, ptr_y + wrap_y*8, NULL, wrap_y, 8) - 400; if(progressive_score > 0){ interlaced_score = s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y*2, 8) +s->dsp.ildct_cmp[4](s, ptr_y + wrap_y , NULL, wrap_y*2, 8); if(progressive_score > interlaced_score){ s->interlaced_dct=1; dct_offset= wrap_y; wrap_y<<=1; if (s->chroma_format == CHROMA_422) wrap_c<<=1; } } } s->dsp.get_pixels(s->block[0], ptr_y , wrap_y); s->dsp.get_pixels(s->block[1], ptr_y + 8, wrap_y); s->dsp.get_pixels(s->block[2], ptr_y + dct_offset , wrap_y); s->dsp.get_pixels(s->block[3], ptr_y + dct_offset + 8, wrap_y); if(s->flags&CODEC_FLAG_GRAY){ skip_dct[4]= 1; skip_dct[5]= 1; }else{ s->dsp.get_pixels(s->block[4], ptr_cb, wrap_c); s->dsp.get_pixels(s->block[5], ptr_cr, wrap_c); if(!s->chroma_y_shift){ s->dsp.get_pixels(s->block[6], ptr_cb + (dct_offset>>1), wrap_c); s->dsp.get_pixels(s->block[7], ptr_cr + (dct_offset>>1), wrap_c); } } }else{ op_pixels_func (*op_pix)[4]; qpel_mc_func (*op_qpix)[16]; uint8_t *dest_y, *dest_cb, *dest_cr; dest_y = s->dest[0]; dest_cb = s->dest[1]; dest_cr = s->dest[2]; if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){ op_pix = s->dsp.put_pixels_tab; op_qpix= s->dsp.put_qpel_pixels_tab; }else{ op_pix = s->dsp.put_no_rnd_pixels_tab; op_qpix= s->dsp.put_no_rnd_qpel_pixels_tab; } if (s->mv_dir & MV_DIR_FORWARD) { MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix); op_pix = s->dsp.avg_pixels_tab; op_qpix= s->dsp.avg_qpel_pixels_tab; } if (s->mv_dir & MV_DIR_BACKWARD) { MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix); } if(s->flags&CODEC_FLAG_INTERLACED_DCT){ int progressive_score, interlaced_score; s->interlaced_dct=0; progressive_score= s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y, 8) +s->dsp.ildct_cmp[0](s, dest_y + wrap_y*8, ptr_y + wrap_y*8, wrap_y, 8) - 400; if(s->avctx->ildct_cmp == FF_CMP_VSSE) progressive_score -= 400; if(progressive_score>0){ interlaced_score = s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y*2, 8) +s->dsp.ildct_cmp[0](s, dest_y + wrap_y , ptr_y + wrap_y , wrap_y*2, 8); if(progressive_score > interlaced_score){ s->interlaced_dct=1; dct_offset= wrap_y; wrap_y<<=1; if (s->chroma_format == CHROMA_422) wrap_c<<=1; } } } s->dsp.diff_pixels(s->block[0], ptr_y , dest_y , wrap_y); s->dsp.diff_pixels(s->block[1], ptr_y + 8, dest_y + 8, wrap_y); s->dsp.diff_pixels(s->block[2], ptr_y + dct_offset , dest_y + dct_offset , wrap_y); s->dsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8, dest_y + dct_offset + 8, wrap_y); if(s->flags&CODEC_FLAG_GRAY){ skip_dct[4]= 1; skip_dct[5]= 1; }else{ s->dsp.diff_pixels(s->block[4], ptr_cb, dest_cb, wrap_c); s->dsp.diff_pixels(s->block[5], ptr_cr, dest_cr, wrap_c); if(!s->chroma_y_shift){ s->dsp.diff_pixels(s->block[6], ptr_cb + (dct_offset>>1), dest_cb + (dct_offset>>1), wrap_c); s->dsp.diff_pixels(s->block[7], ptr_cr + (dct_offset>>1), dest_cr + (dct_offset>>1), wrap_c); } } if(s->current_picture.mc_mb_var[s->mb_stride*mb_y+ mb_x]<2*s->qscale*s->qscale){ if(s->dsp.sad[1](NULL, ptr_y , dest_y , wrap_y, 8) < 20*s->qscale) skip_dct[0]= 1; if(s->dsp.sad[1](NULL, ptr_y + 8, dest_y + 8, wrap_y, 8) < 20*s->qscale) skip_dct[1]= 1; if(s->dsp.sad[1](NULL, ptr_y +dct_offset , dest_y +dct_offset , wrap_y, 8) < 20*s->qscale) skip_dct[2]= 1; if(s->dsp.sad[1](NULL, ptr_y +dct_offset+ 8, dest_y +dct_offset+ 8, wrap_y, 8) < 20*s->qscale) skip_dct[3]= 1; if(s->dsp.sad[1](NULL, ptr_cb , dest_cb , wrap_c, 8) < 20*s->qscale) skip_dct[4]= 1; if(s->dsp.sad[1](NULL, ptr_cr , dest_cr , wrap_c, 8) < 20*s->qscale) skip_dct[5]= 1; if(!s->chroma_y_shift){ if(s->dsp.sad[1](NULL, ptr_cb +(dct_offset>>1), dest_cb +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[6]= 1; if(s->dsp.sad[1](NULL, ptr_cr +(dct_offset>>1), dest_cr +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[7]= 1; } } } if(s->avctx->quantizer_noise_shaping){ if(!skip_dct[0]) get_visual_weight(weight[0], ptr_y , wrap_y); if(!skip_dct[1]) get_visual_weight(weight[1], ptr_y + 8, wrap_y); if(!skip_dct[2]) get_visual_weight(weight[2], ptr_y + dct_offset , wrap_y); if(!skip_dct[3]) get_visual_weight(weight[3], ptr_y + dct_offset + 8, wrap_y); if(!skip_dct[4]) get_visual_weight(weight[4], ptr_cb , wrap_c); if(!skip_dct[5]) get_visual_weight(weight[5], ptr_cr , wrap_c); if(!s->chroma_y_shift){ if(!skip_dct[6]) get_visual_weight(weight[6], ptr_cb + (dct_offset>>1), wrap_c); if(!skip_dct[7]) get_visual_weight(weight[7], ptr_cr + (dct_offset>>1), wrap_c); } memcpy(orig[0], s->block[0], sizeof(DCTELEM)*64*mb_block_count); } assert(s->out_format!=FMT_MJPEG || s->qscale==8); { for(i=0;i<mb_block_count;i++) { if(!skip_dct[i]){ int overflow; s->block_last_index[i] = s->dct_quantize(s, s->block[i], i, s->qscale, &overflow); if (overflow) clip_coeffs(s, s->block[i], s->block_last_index[i]); }else s->block_last_index[i]= -1; } if(s->avctx->quantizer_noise_shaping){ for(i=0;i<mb_block_count;i++) { if(!skip_dct[i]){ s->block_last_index[i] = dct_quantize_refine(s, s->block[i], weight[i], orig[i], i, s->qscale); } } } if(s->luma_elim_threshold && !s->mb_intra) for(i=0; i<4; i++) dct_single_coeff_elimination(s, i, s->luma_elim_threshold); if(s->chroma_elim_threshold && !s->mb_intra) for(i=4; i<mb_block_count; i++) dct_single_coeff_elimination(s, i, s->chroma_elim_threshold); if(s->flags & CODEC_FLAG_CBP_RD){ for(i=0;i<mb_block_count;i++) { if(s->block_last_index[i] == -1) s->coded_score[i]= INT_MAX/256; } } } if((s->flags&CODEC_FLAG_GRAY) && s->mb_intra){ s->block_last_index[4]= s->block_last_index[5]= 0; s->block[4][0]= s->block[5][0]= (1024 + s->c_dc_scale/2)/ s->c_dc_scale; } if(s->alternate_scan && s->dct_quantize != dct_quantize_c){ for(i=0; i<mb_block_count; i++){ int j; if(s->block_last_index[i]>0){ for(j=63; j>0; j--){ if(s->block[i][ s->intra_scantable.permutated[j] ]) break; } s->block_last_index[i]= j; } } } switch(s->codec_id){ case CODEC_ID_MPEG1VIDEO: case CODEC_ID_MPEG2VIDEO: if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) mpeg1_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MPEG4: if (ENABLE_MPEG4_ENCODER) mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MSMPEG4V2: case CODEC_ID_MSMPEG4V3: case CODEC_ID_WMV1: if (ENABLE_MSMPEG4_ENCODER) msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_WMV2: if (ENABLE_WMV2_ENCODER) ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_H261: if (ENABLE_H261_ENCODER) ff_h261_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_H263: case CODEC_ID_H263P: case CODEC_ID_FLV1: case CODEC_ID_RV10: case CODEC_ID_RV20: if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER || ENABLE_FLV_ENCODER || ENABLE_RV10_ENCODER || ENABLE_RV20_ENCODER) h263_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MJPEG: if (ENABLE_MJPEG_ENCODER) ff_mjpeg_encode_mb(s, s->block); break; default: assert(0); } } libavcodec/mpegvideo_enc.c:1641: error: Uninitialized Value The value read from skip_dct[_] was never initialized. libavcodec/mpegvideo_enc.c:1641:13: 1639. if(!skip_dct[1]) get_visual_weight(weight[1], ptr_y + 8, wrap_y); 1640. if(!skip_dct[2]) get_visual_weight(weight[2], ptr_y + dct_offset , wrap_y); 1641. if(!skip_dct[3]) get_visual_weight(weight[3], ptr_y + dct_offset + 8, wrap_y); ^ 1642. if(!skip_dct[4]) get_visual_weight(weight[4], ptr_cb , wrap_c); 1643. if(!skip_dct[5]) get_visual_weight(weight[5], ptr_cr , wrap_c);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L1641
d2a_code_trace_data_42484
static int mtu_test(SSL_CTX *ctx, const char *cs, int no_etm) { SSL *srvr_ssl = NULL, *clnt_ssl = NULL; BIO *sc_bio = NULL; int i; size_t s; size_t mtus[30]; unsigned char buf[600]; int rv = 0; memset(buf, 0x5a, sizeof(buf)); if (create_ssl_objects(ctx, ctx, &srvr_ssl, &clnt_ssl, NULL, NULL) != 1) goto out; if (no_etm) SSL_set_options(srvr_ssl, SSL_OP_NO_ENCRYPT_THEN_MAC); if (SSL_set_cipher_list(srvr_ssl, cs) != 1 || SSL_set_cipher_list(clnt_ssl, cs) != 1) { ERR_print_errors_fp(stdout); goto out; } sc_bio = SSL_get_rbio(srvr_ssl); if (create_ssl_connection(clnt_ssl, srvr_ssl) != 1) goto out; if (debug) printf("Channel established\n"); for (i = 0; i < 30; i++) { SSL_set_mtu(clnt_ssl, 500 + i); mtus[i] = DTLS_get_data_mtu(clnt_ssl); if (debug) printf("%s%s payload MTU for record mtu %d = %"OSSLzu"\n", cs, no_etm ? "-noEtM":"", 500 + i, mtus[i]); if (mtus[i] == 0) { fprintf(stderr, "payload MTU failed with record MTU %d for %s\n", 500 + i, cs); goto out; } } SSL_set_mtu(clnt_ssl, 1000); for (s = mtus[0]; s <= mtus[29]; s++) { size_t reclen; if (SSL_write(clnt_ssl, buf, s) != (int)s) { ERR_print_errors_fp(stdout); goto out; } reclen = BIO_read(sc_bio, buf, sizeof(buf)); if (debug) printf("record %"OSSLzu" for payload %"OSSLzu"\n", reclen, s); for (i = 0; i < 30; i++) { if (s <= mtus[i] && reclen > (size_t)(500 + i)) { fprintf(stderr, "%s: Payload MTU %"OSSLzu" reported for record MTU %d\n" "but sending a payload of %"OSSLzu" made a record of %"OSSLzu"(too large)\n", cs, mtus[i], 500 + i, s, reclen); goto out; } if (s > mtus[i] && reclen <= (size_t)(500 + i)) { fprintf(stderr, "%s: Payload MTU %"OSSLzu" reported for record MTU %d\n" "but sending a payload of %"OSSLzu" made a record of %"OSSLzu" (too small)\n", cs, mtus[i], 500 + i, s, reclen); goto out; } } } rv = 1; if (SSL_USE_ETM(clnt_ssl)) rv = 2; out: SSL_free(clnt_ssl); SSL_free(srvr_ssl); return rv; } test/dtls_mtu_test.c:127: error: UNINITIALIZED_VALUE The value read from mtus[_] was never initialized. Showing all 1 steps of the trace test/dtls_mtu_test.c:127:17: 125. * fits within the record MTU 500+i, so DTLS_get_data_mtu() 126. * was overly pessimistic. */ 127. > fprintf(stderr, 128. "%s: Payload MTU %"OSSLzu" reported for record MTU %d\n" 129. "but sending a payload of %"OSSLzu" made a record of %"OSSLzu" (too small)\n",
https://github.com/openssl/openssl/blob/8aefa08cfbc7db7cc10765ee9684090e37983f45/test/dtls_mtu_test.c/#L127
d2a_code_trace_data_42485
static int encode_test_init(struct evp_test *t, const char *encoding) { struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata)); if (strcmp(encoding, "canonical") == 0) { edata->encoding = BASE64_CANONICAL_ENCODING; } else if (strcmp(encoding, "valid") == 0) { edata->encoding = BASE64_VALID_ENCODING; } else if (strcmp(encoding, "invalid") == 0) { edata->encoding = BASE64_INVALID_ENCODING; t->expected_err = OPENSSL_strdup("DECODE_ERROR"); if (t->expected_err == NULL) return 0; } else { fprintf(stderr, "Bad encoding: %s. Should be one of " "{canonical, valid, invalid}\n", encoding); return 0; } t->data = edata; return 1; } test/evp_test.c:1554: error: NULL_DEREFERENCE pointer `edata` last assigned on line 1551 could be null and is dereferenced at line 1554, column 9. Showing all 18 steps of the trace test/evp_test.c:1549:1: start of procedure encode_test_init() 1547. }; 1548. 1549. > static int encode_test_init(struct evp_test *t, const char *encoding) 1550. { 1551. struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata)); test/evp_test.c:1551:5: 1549. static int encode_test_init(struct evp_test *t, const char *encoding) 1550. { 1551. > struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata)); 1552. 1553. if (strcmp(encoding, "canonical") == 0) { 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 false 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: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) test/evp_test.c:1553:9: Taking true branch 1551. struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata)); 1552. 1553. if (strcmp(encoding, "canonical") == 0) { ^ 1554. edata->encoding = BASE64_CANONICAL_ENCODING; 1555. } else if (strcmp(encoding, "valid") == 0) { test/evp_test.c:1554:9: 1552. 1553. if (strcmp(encoding, "canonical") == 0) { 1554. > edata->encoding = BASE64_CANONICAL_ENCODING; 1555. } else if (strcmp(encoding, "valid") == 0) { 1556. edata->encoding = BASE64_VALID_ENCODING;
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/evp_test.c/#L1554
d2a_code_trace_data_42486
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_gen.c:97: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_gcd`. Showing all 12 steps of the trace crypto/rsa/rsa_gen.c:59:5: Call 57. if (ctx == NULL) 58. goto err; 59. BN_CTX_start(ctx); ^ 60. r0 = BN_CTX_get(ctx); 61. r1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/rsa/rsa_gen.c:97:14: Call 95. if (!BN_sub(r2, rsa->p, BN_value_one())) 96. goto err; 97. if (!BN_gcd(r1, r2, rsa->e, ctx)) ^ 98. goto err; 99. if (BN_is_one(r1)) crypto/bn/bn_gcd.c:15:1: Parameter `ctx->stack.depth` 13. static BIGNUM *euclid(BIGNUM *a, BIGNUM *b); 14. 15. > int BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) 16. { 17. BIGNUM *a, *b, *t; crypto/bn/bn_gcd.c:23:5: Call 21. bn_check_top(in_b); 22. 23. BN_CTX_start(ctx); ^ 24. a = BN_CTX_get(ctx); 25. b = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:49:5: Call 47. ret = 1; 48. err: 49. BN_CTX_end(ctx); ^ 50. bn_check_top(r); 51. return (ret); crypto/bn/bn_ctx.c:195:1: Parameter `ctx->stack.depth` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <LHS trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_gcd` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/697958313ba48c8ebc832ab8f9f2b845fb7acfd4/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_42487
int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) { int i, j, bits, ret = 0, wstart, wend, window, wvalue; int start = 1; BIGNUM *d, *r; const BIGNUM *aa; BIGNUM *val[TABLE_SIZE]; BN_MONT_CTX *mont = NULL; if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); } bn_check_top(a); bn_check_top(p); bn_check_top(m); if (!BN_is_odd(m)) { BNerr(BN_F_BN_MOD_EXP_MONT, BN_R_CALLED_WITH_EVEN_MODULUS); return (0); } bits = BN_num_bits(p); if (bits == 0) { if (BN_is_one(m)) { ret = 1; BN_zero(rr); } else { ret = BN_one(rr); } return ret; } BN_CTX_start(ctx); d = BN_CTX_get(ctx); r = BN_CTX_get(ctx); val[0] = BN_CTX_get(ctx); if (!d || !r || !val[0]) goto err; if (in_mont != NULL) mont = in_mont; else { if ((mont = BN_MONT_CTX_new()) == NULL) goto err; if (!BN_MONT_CTX_set(mont, m, ctx)) goto err; } if (a->neg || BN_ucmp(a, m) >= 0) { if (!BN_nnmod(val[0], a, m, ctx)) goto err; aa = val[0]; } else aa = a; if (BN_is_zero(aa)) { BN_zero(rr); ret = 1; goto err; } if (!BN_to_montgomery(val[0], aa, mont, ctx)) goto err; window = BN_window_bits_for_exponent_size(bits); if (window > 1) { if (!BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) goto err; j = 1 << (window - 1); for (i = 1; i < j; i++) { if (((val[i] = BN_CTX_get(ctx)) == NULL) || !BN_mod_mul_montgomery(val[i], val[i - 1], d, mont, ctx)) goto err; } } start = 1; wvalue = 0; wstart = bits - 1; wend = 0; #if 1 j = m->top; if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) { if (bn_wexpand(r, j) == NULL) goto err; r->d[0] = (0 - m->d[0]) & BN_MASK2; for (i = 1; i < j; i++) r->d[i] = (~m->d[i]) & BN_MASK2; r->top = j; bn_correct_top(r); } else #endif if (!BN_to_montgomery(r, BN_value_one(), mont, ctx)) goto err; for (;;) { if (BN_is_bit_set(p, wstart) == 0) { if (!start) { if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)) goto err; } if (wstart == 0) break; wstart--; continue; } j = wstart; wvalue = 1; wend = 0; for (i = 1; i < window; i++) { if (wstart - i < 0) break; if (BN_is_bit_set(p, wstart - i)) { wvalue <<= (i - wend); wvalue |= 1; wend = i; } } j = wend + 1; if (!start) for (i = 0; i < j; i++) { if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)) goto err; } if (!BN_mod_mul_montgomery(r, r, val[wvalue >> 1], mont, ctx)) goto err; wstart -= wend + 1; wvalue = 0; start = 0; if (wstart < 0) break; } #if defined(SPARC_T4_MONT) if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) { j = mont->N.top; val[0]->d[0] = 1; for (i = 1; i < j; i++) val[0]->d[i] = 0; val[0]->top = j; if (!BN_mod_mul_montgomery(rr, r, val[0], mont, ctx)) goto err; } else #endif if (!BN_from_montgomery(rr, r, mont, ctx)) goto err; ret = 1; err: if (in_mont == NULL) BN_MONT_CTX_free(mont); BN_CTX_end(ctx); bn_check_top(rr); return (ret); } test/bntest.c:1960: error: INTEGER_OVERFLOW_L2 (0 - [0, 1]):unsigned64 by call to `BN_mod_exp`. Showing all 14 steps of the trace test/bntest.c:1960:33: Call 1958. BN_zero(zero); 1959. 1960. if (!BN_mod_exp(r, a, zero, BN_value_one(), NULL) ^ 1961. || !BN_is_zero(r) 1962. || !BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL) crypto/bn/bn_lib.c:82:5: Assignment 80. const BIGNUM *BN_value_one(void) 81. { 82. static const BN_ULONG data_one = 1L; ^ 83. static const BIGNUM const_one = 84. { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA }; test/bntest.c:1960:10: Call 1958. BN_zero(zero); 1959. 1960. if (!BN_mod_exp(r, a, zero, BN_value_one(), NULL) ^ 1961. || !BN_is_zero(r) 1962. || !BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL) crypto/bn/bn_exp.c:91:1: Parameter `*m->d` 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:143:9: Call 141. /* if ((m->d[m->top-1]&BN_TBIT) && BN_is_odd(m)) */ 142. 143. if (BN_is_odd(m)) { ^ 144. # ifdef MONT_EXP_WORD 145. if (a->top == 1 && !a->neg crypto/bn/bn_lib.c:935:1: Parameter `*a->d` 933. } 934. 935. > int BN_is_odd(const BIGNUM *a) 936. { 937. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_exp.c:151:19: Call 149. } else 150. # endif 151. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 152. } else 153. #endif crypto/bn/bn_exp.c:301:1: <RHS trace> 299. } 300. 301. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 302. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 303. { crypto/bn/bn_exp.c:301:1: Parameter `*m->d` 299. } 300. 301. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 302. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 303. { crypto/bn/bn_exp.c:320:10: Call 318. bn_check_top(m); 319. 320. if (!BN_is_odd(m)) { ^ 321. BNerr(BN_F_BN_MOD_EXP_MONT, BN_R_CALLED_WITH_EVEN_MODULUS); 322. return (0); crypto/bn/bn_lib.c:935:1: Parameter `*a->d` 933. } 934. 935. > int BN_is_odd(const BIGNUM *a) 936. { 937. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_exp.c:356:19: Call 354. } 355. 356. if (a->neg || BN_ucmp(a, m) >= 0) { ^ 357. if (!BN_nnmod(val[0], a, m, ctx)) 358. goto err; crypto/bn/bn_lib.c:623:1: Parameter `*b->d` 621. } 622. 623. > int BN_ucmp(const BIGNUM *a, const BIGNUM *b) 624. { 625. int i; crypto/bn/bn_exp.c:395:9: Binary operation: (0 - [0, 1]):unsigned64 by call to `BN_mod_exp` 393. goto err; 394. /* 2^(top*BN_BITS2) - m */ 395. r->d[0] = (0 - m->d[0]) & BN_MASK2; ^ 396. for (i = 1; i < j; i++) 397. r->d[i] = (~m->d[i]) & BN_MASK2;
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_exp.c/#L395
d2a_code_trace_data_42488
void *sk_value(const _STACK *st, int i) { if (!st || (i < 0) || (i >= st->num)) return NULL; return st->data[i]; } crypto/asn1/asn_mime.c:580: error: USE_AFTER_FREE call to `mime_hdr_find()` eventually accesses memory that was invalidated by call to `free()` on line 576 indirectly during the call to `mime_parse_hdr()`. Showing all 29 steps of the trace crypto/asn1/asn_mime.c:576:20: invalidation part of the trace starts here 574. MIME_HEADER *hdr; 575. 576. if ((headers = mime_parse_hdr(in)) == NULL) { ^ 577. ASN1err(ASN1_F_SMIME_TEXT, ASN1_R_MIME_PARSE_ERROR); 578. return 0; crypto/asn1/asn_mime.c:576:20: when calling `mime_parse_hdr` here 574. MIME_HEADER *hdr; 575. 576. if ((headers = mime_parse_hdr(in)) == NULL) { ^ 577. ASN1err(ASN1_F_SMIME_TEXT, ASN1_R_MIME_PARSE_ERROR); 578. return 0; crypto/asn1/asn_mime.c:677:15: passed as argument to `sk_MIME_HEADER_new` 675. int len, state, save_state = 0; 676. 677. headers = sk_MIME_HEADER_new(mime_hdr_cmp); ^ 678. if (headers == NULL) 679. return NULL; crypto/asn1/asn_mime.c:677:15: return from call to `sk_MIME_HEADER_new` 675. int len, state, save_state = 0; 676. 677. headers = sk_MIME_HEADER_new(mime_hdr_cmp); ^ 678. if (headers == NULL) 679. return NULL; crypto/asn1/asn_mime.c:677:5: assigned 675. int len, state, save_state = 0; 676. 677. headers = sk_MIME_HEADER_new(mime_hdr_cmp); ^ 678. if (headers == NULL) 679. return NULL; crypto/asn1/asn_mime.c:711:21: when calling `sk_MIME_HEADER_push` here 709. *p = 0; 710. mhdr = mime_hdr_new(ntmp, strip_ends(q)); 711. sk_MIME_HEADER_push(headers, mhdr); ^ 712. ntmp = NULL; 713. q = p + 1; crypto/asn1/asn1_locl.h:93:1: parameter `sk` of sk_MIME_HEADER_push 91. DEFINE_STACK_OF(MIME_PARAM) 92. typedef struct mime_header_st MIME_HEADER; 93. > DEFINE_STACK_OF(MIME_HEADER) 94. 95. /* Month values for printing out times */ crypto/asn1/asn1_locl.h:93:1: when calling `sk_push` here 91. DEFINE_STACK_OF(MIME_PARAM) 92. typedef struct mime_header_st MIME_HEADER; 93. > DEFINE_STACK_OF(MIME_HEADER) 94. 95. /* Month values for printing out times */ crypto/stack/stack.c:259:1: parameter `st` of sk_push 257. } 258. 259. > int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); crypto/stack/stack.c:261:13: when calling `sk_insert` here 259. int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); ^ 262. } 263. crypto/stack/stack.c:167:1: parameter `st` of sk_insert 165. } 166. 167. > int sk_insert(_STACK *st, void *data, int loc) 168. { 169. char **s; crypto/stack/stack.c:174:13: when calling `CRYPTO_realloc` here 172. return 0; 173. if (st->num_alloc <= st->num + 1) { 174. s = OPENSSL_realloc((char *)st->data, ^ 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); 176. if (s == NULL) crypto/mem.c:166:1: parameter `str` of CRYPTO_realloc 164. } 165. 166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 167. { 168. if (str == NULL) crypto/mem.c:172:9: when calling `CRYPTO_free` here 170. 171. if (num == 0) { 172. CRYPTO_free(str); ^ 173. return NULL; 174. } crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: was invalidated by call to `free()` 243. } 244. #else 245. free(str); ^ 246. #endif 247. } crypto/asn1/asn_mime.c:576:20: use-after-lifetime part of the trace starts here 574. MIME_HEADER *hdr; 575. 576. if ((headers = mime_parse_hdr(in)) == NULL) { ^ 577. ASN1err(ASN1_F_SMIME_TEXT, ASN1_R_MIME_PARSE_ERROR); 578. return 0; crypto/asn1/asn_mime.c:576:20: passed as argument to `mime_parse_hdr` 574. MIME_HEADER *hdr; 575. 576. if ((headers = mime_parse_hdr(in)) == NULL) { ^ 577. ASN1err(ASN1_F_SMIME_TEXT, ASN1_R_MIME_PARSE_ERROR); 578. return 0; crypto/asn1/asn_mime.c:677:15: passed as argument to `sk_MIME_HEADER_new` 675. int len, state, save_state = 0; 676. 677. headers = sk_MIME_HEADER_new(mime_hdr_cmp); ^ 678. if (headers == NULL) 679. return NULL; crypto/asn1/asn_mime.c:677:15: return from call to `sk_MIME_HEADER_new` 675. int len, state, save_state = 0; 676. 677. headers = sk_MIME_HEADER_new(mime_hdr_cmp); ^ 678. if (headers == NULL) 679. return NULL; crypto/asn1/asn_mime.c:677:5: assigned 675. int len, state, save_state = 0; 676. 677. headers = sk_MIME_HEADER_new(mime_hdr_cmp); ^ 678. if (headers == NULL) 679. return NULL; crypto/asn1/asn_mime.c:576:20: return from call to `mime_parse_hdr` 574. MIME_HEADER *hdr; 575. 576. if ((headers = mime_parse_hdr(in)) == NULL) { ^ 577. ASN1err(ASN1_F_SMIME_TEXT, ASN1_R_MIME_PARSE_ERROR); 578. return 0; crypto/asn1/asn_mime.c:580:16: when calling `mime_hdr_find` here 578. return 0; 579. } 580. if ((hdr = mime_hdr_find(headers, "content-type")) == NULL ^ 581. || hdr->value == NULL) { 582. ASN1err(ASN1_F_SMIME_TEXT, ASN1_R_MIME_NO_CONTENT_TYPE); crypto/asn1/asn_mime.c:922:1: parameter `hdrs` of mime_hdr_find 920. /* Find a header with a given name (if possible) */ 921. 922. > static MIME_HEADER *mime_hdr_find(STACK_OF(MIME_HEADER) *hdrs, char *name) 923. { 924. MIME_HEADER htmp; crypto/asn1/asn_mime.c:930:12: when calling `sk_MIME_HEADER_value` here 928. if (idx < 0) 929. return NULL; 930. return sk_MIME_HEADER_value(hdrs, idx); ^ 931. } 932. crypto/asn1/asn1_locl.h:93:1: parameter `sk` of sk_MIME_HEADER_value 91. DEFINE_STACK_OF(MIME_PARAM) 92. typedef struct mime_header_st MIME_HEADER; 93. > DEFINE_STACK_OF(MIME_HEADER) 94. 95. /* Month values for printing out times */ crypto/asn1/asn1_locl.h:93:1: when calling `sk_value` here 91. DEFINE_STACK_OF(MIME_PARAM) 92. typedef struct mime_header_st MIME_HEADER; 93. > DEFINE_STACK_OF(MIME_HEADER) 94. 95. /* Month values for printing out times */ crypto/stack/stack.c:324:1: parameter `st` of 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:328:12: invalid access occurs here 326. if (!st || (i < 0) || (i >= st->num)) 327. return NULL; 328. return st->data[i]; ^ 329. } 330.
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/stack/stack.c/#L328
d2a_code_trace_data_42489
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:1060: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:1060:9: 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) ) ^ 1061. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, 1062. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1060
d2a_code_trace_data_42490
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1002: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_recp`. Showing all 33 steps of the trace test/bntest.c:1020:14: Call 1018. } 1019. 1020. if (!TEST_int_ge(kronecker = BN_kronecker(a, b, ctx), -1)) ^ 1021. goto err; 1022. /* we actually need BN_kronecker(a, |b|) */ crypto/bn/bn_kron.c:17:1: Parameter `ctx->stack.depth` 15. 16. /* Returns -2 for errors because both -1 and 0 are valid results. */ 17. > int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 18. { 19. int i; crypto/bn/bn_kron.c:35:5: Call 33. bn_check_top(b); 34. 35. BN_CTX_start(ctx); ^ 36. A = BN_CTX_get(ctx); 37. B = 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_kron.c:36:9: Call 34. 35. BN_CTX_start(ctx); 36. A = BN_CTX_get(ctx); ^ 37. B = BN_CTX_get(ctx); 38. if (B == 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_kron.c:37:9: Call 35. BN_CTX_start(ctx); 36. A = BN_CTX_get(ctx); 37. B = BN_CTX_get(ctx); ^ 38. if (B == NULL) 39. goto end; 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_kron.c:135:5: Call 133. } 134. end: 135. BN_CTX_end(ctx); ^ 136. if (err) 137. return -2; 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); test/bntest.c:1002:14: Call 1000. BN_set_negative(b, 0); 1001. 1002. if (!TEST_true(BN_mod_exp_recp(r, a, t, b, ctx))) ^ 1003. goto err; 1004. BN_set_negative(b, 1); 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_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_mod_exp_recp` 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_42491
int ssl_check_clienthello_tlsext_late(SSL *s) { int ret = SSL_TLSEXT_ERR_OK; int al; if ((s->tlsext_status_type != -1) && s->ctx && s->ctx->tlsext_status_cb) { int r; CERT_PKEY *certpkey; certpkey = ssl_get_server_send_pkey(s); if (certpkey == NULL) { s->tlsext_status_expected = 0; return 1; } s->cert->key = certpkey; r = s->ctx->tlsext_status_cb(s, s->ctx->tlsext_status_arg); switch (r) { case SSL_TLSEXT_ERR_NOACK: s->tlsext_status_expected = 0; break; case SSL_TLSEXT_ERR_OK: if (s->tlsext_ocsp_resp) s->tlsext_status_expected = 1; else s->tlsext_status_expected = 0; break; case SSL_TLSEXT_ERR_ALERT_FATAL: ret = SSL_TLSEXT_ERR_ALERT_FATAL; al = SSL_AD_INTERNAL_ERROR; goto err; } } else s->tlsext_status_expected = 0; err: switch (ret) { case SSL_TLSEXT_ERR_ALERT_FATAL: ssl3_send_alert(s,SSL3_AL_FATAL,al); return -1; case SSL_TLSEXT_ERR_ALERT_WARNING: ssl3_send_alert(s,SSL3_AL_WARNING,al); return 1; default: return 1; } } ssl/t1_lib.c:1924: error: UNINITIALIZED_VALUE The value read from al was never initialized. Showing all 1 steps of the trace ssl/t1_lib.c:1924:4: 1922. { 1923. case SSL_TLSEXT_ERR_ALERT_FATAL: 1924. > ssl3_send_alert(s,SSL3_AL_FATAL,al); 1925. return -1; 1926.
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/ssl/t1_lib.c/#L1924
d2a_code_trace_data_42492
int BN_num_bits_word(BN_ULONG l) { BN_ULONG x, mask; int bits = (l != 0); #if BN_BITS2 > 32 x = l >> 32; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 32 & mask; l ^= (x ^ l) & mask; #endif x = l >> 16; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 16 & mask; l ^= (x ^ l) & mask; x = l >> 8; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 8 & mask; l ^= (x ^ l) & mask; x = l >> 4; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 4 & mask; l ^= (x ^ l) & mask; x = l >> 2; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 2 & mask; l ^= (x ^ l) & mask; x = l >> 1; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 1 & mask; return bits; } crypto/dsa/dsa_ossl.c:92: error: INTEGER_OVERFLOW_L2 (0 - [0, max(1, `dsa->p->top`)]):unsigned64 by call to `dsa_sign_setup`. Showing all 22 steps of the trace crypto/dsa/dsa_ossl.c:59:1: Parameter `dsa->p->top` 57. } 58. 59. > static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) 60. { 61. BIGNUM *kinv = NULL; crypto/dsa/dsa_ossl.c:92:10: Call 90. 91. redo: 92. if (!dsa_sign_setup(dsa, ctx, &kinv, &ret->r, dgst, dlen)) ^ 93. goto err; 94. crypto/dsa/dsa_ossl.c:175:1: Parameter `dsa->p->top` 173. } 174. 175. > static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, 176. BIGNUM **kinvp, BIGNUM **rp, 177. const unsigned char *dgst, int dlen) crypto/dsa/dsa_ossl.c:254:18: Call 252. goto err; 253. } else { 254. if (!BN_mod_exp_mont(r, dsa->g, k, dsa->p, ctx, dsa->method_mont_p)) ^ 255. goto err; 256. } 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:745:14: Assignment 743. /* 2^(top*BN_BITS2) - m */ 744. tmp.d[0] = (0 - m->d[0]) & BN_MASK2; 745. for (i = 1; i < top; i++) ^ 746. tmp.d[i] = (~m->d[i]) & BN_MASK2; 747. tmp.top = top; crypto/bn/bn_exp.c:1062:14: Call 1060. bits -= window0; 1061. wvalue = bn_get_bits(p, bits) & wmask; 1062. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue, ^ 1063. window)) 1064. goto err; crypto/bn/bn_exp.c:520:1: Parameter `top` 518. } 519. 520. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, 521. unsigned char *buf, int idx, 522. int window) crypto/bn/bn_exp.c:577:5: Assignment 575. } 576. 577. b->top = top; ^ 578. bn_correct_top(b); 579. return 1; crypto/bn/bn_exp.c:578:5: Call 576. 577. b->top = top; 578. bn_correct_top(b); ^ 579. return 1; 580. } crypto/bn/bn_lib.c:946:1: Parameter `a->top` 944. } 945. 946. > void bn_correct_top(BIGNUM *a) 947. { 948. BN_ULONG *ftl; crypto/bn/bn_exp.c:1098:18: Call 1096. 1097. /* Multiply the result into the intermediate result */ 1098. if (!BN_mod_mul_montgomery(&tmp, &tmp, &am, mont, ctx)) ^ 1099. goto err; 1100. } crypto/bn/bn_mont.c:26:1: Parameter `a->top` 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:56:14: Call 54. goto err; 55. } else { 56. if (!BN_mul(tmp, a, b, ctx)) ^ 57. goto err; 58. } crypto/bn/bn_mul.c:497:1: Parameter `a->top` 495. #endif /* BN_RECURSION */ 496. 497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = 0; crypto/bn/bn_mul.c:514:5: Assignment 512. bn_check_top(r); 513. 514. al = a->top; ^ 515. bl = b->top; 516. crypto/bn/bn_mul.c:561:21: Call 559. */ 560. if (i >= 0) { 561. j = BN_num_bits_word((BN_ULONG)al); ^ 562. } 563. if (i == -1) { crypto/bn/bn_lib.c:89:1: <RHS trace> 87. } 88. 89. > int BN_num_bits_word(BN_ULONG l) 90. { 91. BN_ULONG x, mask; crypto/bn/bn_lib.c:89:1: Parameter `l` 87. } 88. 89. > int BN_num_bits_word(BN_ULONG l) 90. { 91. BN_ULONG x, mask; crypto/bn/bn_lib.c:95:5: Assignment 93. 94. #if BN_BITS2 > 32 95. x = l >> 32; ^ 96. mask = (0 - x) & BN_MASK2; 97. mask = (0 - (mask >> (BN_BITS2 - 1))); crypto/bn/bn_lib.c:96:5: Binary operation: (0 - [0, max(1, dsa->p->top)]):unsigned64 by call to `dsa_sign_setup` 94. #if BN_BITS2 > 32 95. x = l >> 32; 96. mask = (0 - x) & BN_MASK2; ^ 97. mask = (0 - (mask >> (BN_BITS2 - 1))); 98. bits += 32 & mask;
https://github.com/openssl/openssl/blob/a766aab93a282774e63ba918d0bb1c6680a5f292/crypto/bn/bn_lib.c/#L96
d2a_code_trace_data_42493
static int makebwmap(TIFFRGBAImage* img) { TIFFRGBValue* Map = img->Map; int bitspersample = img->bitspersample; int nsamples = 8 / bitspersample; int i; uint32* p; if( nsamples == 0 ) nsamples = 1; img->BWmap = (uint32**) _TIFFmalloc( 256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32))); if (img->BWmap == NULL) { TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No space for B&W mapping table"); return (0); } p = (uint32*)(img->BWmap + 256); for (i = 0; i < 256; i++) { TIFFRGBValue c; img->BWmap[i] = p; switch (bitspersample) { #define GREY(x) c = Map[x]; *p++ = PACK(c,c,c); case 1: GREY(i>>7); GREY((i>>6)&1); GREY((i>>5)&1); GREY((i>>4)&1); GREY((i>>3)&1); GREY((i>>2)&1); GREY((i>>1)&1); GREY(i&1); break; case 2: GREY(i>>6); GREY((i>>4)&3); GREY((i>>2)&3); GREY(i&3); break; case 4: GREY(i>>4); GREY(i&0xf); break; case 8: case 16: GREY(i); break; } #undef GREY } return (1); } libtiff/tif_getimage.c:2205: error: Buffer Overrun L3 Offset: [0, 1] Size: [0, +oo] by call to `makebwmap`. libtiff/tif_getimage.c:2183:9: Assignment 2181. /* treat 16 bit the same as eight bit */ 2182. if( img->bitspersample == 16 ) 2183. range = (int32) 255; ^ 2184. 2185. img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue)); libtiff/tif_getimage.c:2185:32: Call 2183. range = (int32) 255; 2184. 2185. img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue)); ^ 2186. if (img->Map == NULL) { 2187. TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), libtiff/tif_unix.c:253:1: Parameter `s` 251. #endif 252. 253. void* ^ 254. _TIFFmalloc(tmsize_t s) 255. { libtiff/tif_unix.c:256:10: Array declaration 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_unix.c:256:2: Assignment 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_getimage.c:2185:5: Assignment 2183. range = (int32) 255; 2184. 2185. img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue)); ^ 2186. if (img->Map == NULL) { 2187. TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), libtiff/tif_getimage.c:2205:7: Call 2203. * unpacking tables for samples <= 8 bits. 2204. */ 2205. if (!makebwmap(img)) ^ 2206. return (0); 2207. /* no longer need Map, free it */ libtiff/tif_getimage.c:2134:10: <Offset trace> 2132. } 2133. p = (uint32*)(img->BWmap + 256); 2134. for (i = 0; i < 256; i++) { ^ 2135. TIFFRGBValue c; 2136. img->BWmap[i] = p; libtiff/tif_getimage.c:2134:10: Assignment 2132. } 2133. p = (uint32*)(img->BWmap + 256); 2134. for (i = 0; i < 256; i++) { ^ 2135. TIFFRGBValue c; 2136. img->BWmap[i] = p; libtiff/tif_getimage.c:2115:1: <Length trace> 2113. * number. 2114. */ 2115. static int ^ 2116. makebwmap(TIFFRGBAImage* img) 2117. { libtiff/tif_getimage.c:2115:1: Parameter `*img->Map` 2113. * number. 2114. */ 2115. static int ^ 2116. makebwmap(TIFFRGBAImage* img) 2117. { libtiff/tif_getimage.c:2118:5: Assignment 2116. makebwmap(TIFFRGBAImage* img) 2117. { 2118. TIFFRGBValue* Map = img->Map; ^ 2119. int bitspersample = img->bitspersample; 2120. int nsamples = 8 / bitspersample; libtiff/tif_getimage.c:2140:6: Array access: Offset: [0, 1] Size: [0, +oo] by call to `makebwmap` 2138. #define GREY(x) c = Map[x]; *p++ = PACK(c,c,c); 2139. case 1: 2140. GREY(i>>7); ^ 2141. GREY((i>>6)&1); 2142. GREY((i>>5)&1);
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_getimage.c/#L2140
d2a_code_trace_data_42494
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) { ZmbvContext * const c = avctx->priv_data; uint8_t *outptr; int zret = Z_OK; int len = buf_size; int hi_ver, lo_ver; if(c->pic.data[0]) avctx->release_buffer(avctx, &c->pic); c->pic.reference = 1; c->pic.buffer_hints = FF_BUFFER_HINTS_VALID; if(avctx->get_buffer(avctx, &c->pic) < 0){ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } outptr = c->pic.data[0]; c->flags = buf[0]; buf++; len--; if(c->flags & ZMBV_KEYFRAME) { hi_ver = buf[0]; lo_ver = buf[1]; c->comp = buf[2]; c->fmt = buf[3]; c->bw = buf[4]; c->bh = buf[5]; buf += 6; len -= 6; av_log(avctx, AV_LOG_DEBUG, "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh); if(hi_ver != 0 || lo_ver != 1) { av_log(avctx, AV_LOG_ERROR, "Unsupported version %i.%i\n", hi_ver, lo_ver); return -1; } if(c->bw == 0 || c->bh == 0) { av_log(avctx, AV_LOG_ERROR, "Unsupported block size %ix%i\n", c->bw, c->bh); } if(c->comp != 0 && c->comp != 1) { av_log(avctx, AV_LOG_ERROR, "Unsupported compression type %i\n", c->comp); return -1; } switch(c->fmt) { case ZMBV_FMT_8BPP: c->bpp = 8; c->decode_intra = zmbv_decode_intra; c->decode_xor = zmbv_decode_xor_8; break; case ZMBV_FMT_15BPP: case ZMBV_FMT_16BPP: c->bpp = 16; c->decode_intra = zmbv_decode_intra; c->decode_xor = zmbv_decode_xor_16; break; #ifdef ZMBV_ENABLE_24BPP case ZMBV_FMT_24BPP: c->bpp = 24; c->decode_intra = zmbv_decode_intra; c->decode_xor = zmbv_decode_xor_24; break; #endif case ZMBV_FMT_32BPP: c->bpp = 32; c->decode_intra = zmbv_decode_intra; c->decode_xor = zmbv_decode_xor_32; break; default: c->decode_intra = NULL; c->decode_xor = NULL; av_log(avctx, AV_LOG_ERROR, "Unsupported (for now) format %i\n", c->fmt); return -1; } zret = inflateReset(&c->zstream); if (zret != Z_OK) { av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret); return -1; } c->cur = av_realloc(c->cur, avctx->width * avctx->height * (c->bpp / 8)); c->prev = av_realloc(c->prev, avctx->width * avctx->height * (c->bpp / 8)); c->bx = (c->width + c->bw - 1) / c->bw; c->by = (c->height+ c->bh - 1) / c->bh; } if(c->decode_intra == NULL) { av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n"); return -1; } if(c->comp == 0) { memcpy(c->decomp_buf, buf, len); c->decomp_size = 1; } else { c->zstream.total_in = c->zstream.total_out = 0; c->zstream.next_in = buf; c->zstream.avail_in = len; c->zstream.next_out = c->decomp_buf; c->zstream.avail_out = c->decomp_size; inflate(&c->zstream, Z_FINISH); c->decomp_len = c->zstream.total_out; } if(c->flags & ZMBV_KEYFRAME) { c->pic.key_frame = 1; c->pic.pict_type = FF_I_TYPE; c->decode_intra(c); } else { c->pic.key_frame = 0; c->pic.pict_type = FF_P_TYPE; if(c->decomp_len) c->decode_xor(c); } { uint8_t *out, *src; int i, j; out = c->pic.data[0]; src = c->cur; switch(c->fmt) { case ZMBV_FMT_8BPP: for(j = 0; j < c->height; j++) { for(i = 0; i < c->width; i++) { out[i * 3 + 0] = c->pal[(*src) * 3 + 0]; out[i * 3 + 1] = c->pal[(*src) * 3 + 1]; out[i * 3 + 2] = c->pal[(*src) * 3 + 2]; src++; } out += c->pic.linesize[0]; } break; case ZMBV_FMT_15BPP: for(j = 0; j < c->height; j++) { for(i = 0; i < c->width; i++) { uint16_t tmp = AV_RL16(src); src += 2; out[i * 3 + 0] = (tmp & 0x7C00) >> 7; out[i * 3 + 1] = (tmp & 0x03E0) >> 2; out[i * 3 + 2] = (tmp & 0x001F) << 3; } out += c->pic.linesize[0]; } break; case ZMBV_FMT_16BPP: for(j = 0; j < c->height; j++) { for(i = 0; i < c->width; i++) { uint16_t tmp = AV_RL16(src); src += 2; out[i * 3 + 0] = (tmp & 0xF800) >> 8; out[i * 3 + 1] = (tmp & 0x07E0) >> 3; out[i * 3 + 2] = (tmp & 0x001F) << 3; } out += c->pic.linesize[0]; } break; #ifdef ZMBV_ENABLE_24BPP case ZMBV_FMT_24BPP: for(j = 0; j < c->height; j++) { memcpy(out, src, c->width * 3); src += c->width * 3; out += c->pic.linesize[0]; } break; #endif case ZMBV_FMT_32BPP: for(j = 0; j < c->height; j++) { for(i = 0; i < c->width; i++) { uint32_t tmp = AV_RL32(src); src += 4; AV_WB24(out+(i*3), tmp); } out += c->pic.linesize[0]; } break; default: av_log(avctx, AV_LOG_ERROR, "Cannot handle format %i\n", c->fmt); } memcpy(c->prev, c->cur, c->width * c->height * (c->bpp / 8)); } *data_size = sizeof(AVFrame); *(AVFrame*)data = c->pic; return buf_size; } libavcodec/zmbv.c:566: error: Buffer Overrun L3 Offset: 3 Size: [0, 2147483631]. libavcodec/zmbv.c:394:1: <Length trace> 392. } 393. 394. static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) ^ 395. { 396. ZmbvContext * const c = avctx->priv_data; libavcodec/zmbv.c:394:1: Parameter `avctx->priv_data->cur` 392. } 393. 394. static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) ^ 395. { 396. ZmbvContext * const c = avctx->priv_data; libavcodec/zmbv.c:517:9: Assignment 515. 516. out = c->pic.data[0]; 517. src = c->cur; ^ 518. switch(c->fmt) { 519. case ZMBV_FMT_8BPP: libavcodec/zmbv.c:566:36: Array access: Offset: 3 Size: [0, 2147483631] 564. for(j = 0; j < c->height; j++) { 565. for(i = 0; i < c->width; i++) { 566. uint32_t tmp = AV_RL32(src); ^ 567. src += 4; 568. AV_WB24(out+(i*3), tmp);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/zmbv.c/#L566
d2a_code_trace_data_42495
int dtls1_buffer_message(SSL *s, int is_ccs) { pitem *item; hm_fragment *frag; unsigned char seq64be[8]; OPENSSL_assert(s->init_off == 0); frag = dtls1_hm_fragment_new(s->init_num, 0); memcpy(frag->fragment, s->init_buf->data, s->init_num); if ( is_ccs) { OPENSSL_assert(s->d1->w_msg_hdr.msg_len + ((s->version==DTLS1_VERSION)?DTLS1_CCS_HEADER_LENGTH:3) == (unsigned int)s->init_num); } else { OPENSSL_assert(s->d1->w_msg_hdr.msg_len + DTLS1_HM_HEADER_LENGTH == (unsigned int)s->init_num); } frag->msg_header.msg_len = s->d1->w_msg_hdr.msg_len; frag->msg_header.seq = s->d1->w_msg_hdr.seq; frag->msg_header.type = s->d1->w_msg_hdr.type; frag->msg_header.frag_off = 0; frag->msg_header.frag_len = s->d1->w_msg_hdr.msg_len; frag->msg_header.is_ccs = is_ccs; frag->msg_header.saved_retransmit_state.enc_write_ctx = s->enc_write_ctx; frag->msg_header.saved_retransmit_state.write_hash = s->write_hash; frag->msg_header.saved_retransmit_state.compress = s->compress; frag->msg_header.saved_retransmit_state.session = s->session; frag->msg_header.saved_retransmit_state.epoch = s->d1->w_epoch; memset(seq64be,0,sizeof(seq64be)); seq64be[6] = (unsigned char)(dtls1_get_queue_priority(frag->msg_header.seq, frag->msg_header.is_ccs)>>8); seq64be[7] = (unsigned char)(dtls1_get_queue_priority(frag->msg_header.seq, frag->msg_header.is_ccs)); item = pitem_new(seq64be, frag); if ( item == NULL) { dtls1_hm_fragment_free(frag); return 0; } #if 0 fprintf( stderr, "buffered messge: \ttype = %xx\n", msg_buf->type); fprintf( stderr, "\t\t\t\t\tlen = %d\n", msg_buf->len); fprintf( stderr, "\t\t\t\t\tseq_num = %d\n", msg_buf->seq_num); #endif pqueue_insert(s->d1->sent_messages, item); return 1; } ssl/d1_both.c:1035: error: NULL_DEREFERENCE pointer `frag` last assigned on line 1033 could be null and is dereferenced at line 1035, column 9. Showing all 22 steps of the trace ssl/d1_both.c:1022:1: start of procedure dtls1_buffer_message() 1020. } 1021. 1022. > int 1023. dtls1_buffer_message(SSL *s, int is_ccs) 1024. { ssl/d1_both.c:1031:2: Condition is true 1029. /* this function is called immediately after a message has 1030. * been serialized */ 1031. OPENSSL_assert(s->init_off == 0); ^ 1032. 1033. frag = dtls1_hm_fragment_new(s->init_num, 0); ssl/d1_both.c:1033:2: 1031. OPENSSL_assert(s->init_off == 0); 1032. 1033. > frag = dtls1_hm_fragment_new(s->init_num, 0); 1034. 1035. memcpy(frag->fragment, s->init_buf->data, s->init_num); ssl/d1_both.c:172:1: start of procedure dtls1_hm_fragment_new() 170. long max, int *ok); 171. 172. > static hm_fragment * 173. dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) 174. { ssl/d1_both.c:175:2: 173. dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) 174. { 175. > hm_fragment *frag = NULL; 176. unsigned char *buf = NULL; 177. unsigned char *bitmask = NULL; ssl/d1_both.c:176:2: 174. { 175. hm_fragment *frag = NULL; 176. > unsigned char *buf = NULL; 177. unsigned char *bitmask = NULL; 178. ssl/d1_both.c:177:2: 175. hm_fragment *frag = NULL; 176. unsigned char *buf = NULL; 177. > unsigned char *bitmask = NULL; 178. 179. frag = (hm_fragment *)OPENSSL_malloc(sizeof(hm_fragment)); ssl/d1_both.c:179:2: 177. unsigned char *bitmask = NULL; 178. 179. > frag = (hm_fragment *)OPENSSL_malloc(sizeof(hm_fragment)); 180. if ( frag == NULL) 181. return NULL; crypto/mem.c:295:1: start of procedure CRYPTO_malloc() 293. } 294. 295. > void *CRYPTO_malloc(int num, const char *file, int line) 296. { 297. void *ret = NULL; crypto/mem.c:297:2: 295. void *CRYPTO_malloc(int num, const char *file, int line) 296. { 297. > void *ret = NULL; 298. 299. if (num <= 0) return NULL; crypto/mem.c:299:6: Taking false branch 297. void *ret = NULL; 298. 299. if (num <= 0) return NULL; ^ 300. 301. allow_customize = 0; crypto/mem.c:301:2: 299. if (num <= 0) return NULL; 300. 301. > allow_customize = 0; 302. if (malloc_debug_func != NULL) 303. { crypto/mem.c:302:6: Taking false branch 300. 301. allow_customize = 0; 302. if (malloc_debug_func != NULL) ^ 303. { 304. allow_customize_debug = 0; crypto/mem.c:307:2: Skipping __function_pointer__(): unresolved function pointer 305. malloc_debug_func(NULL, num, file, line, 0); 306. } 307. ret = malloc_ex_func(num,file,line); ^ 308. #ifdef LEVITTE_DEBUG_MEM 309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); crypto/mem.c:311:6: Taking false branch 309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); 310. #endif 311. if (malloc_debug_func != NULL) ^ 312. malloc_debug_func(ret, num, file, line, 1); 313. crypto/mem.c:318:12: Taking false branch 316. * sanitisation function can't be optimised out. NB: We only do 317. * this for >2Kb so the overhead doesn't bother us. */ 318. if(ret && (num > 2048)) ^ 319. { extern unsigned char cleanse_ctr; 320. ((unsigned char *)ret)[0] = cleanse_ctr; crypto/mem.c:324:2: 322. #endif 323. 324. > return ret; 325. } 326. char *CRYPTO_strdup(const char *str, const char *file, int line) crypto/mem.c:325:2: return from a call to CRYPTO_malloc 323. 324. return ret; 325. } ^ 326. char *CRYPTO_strdup(const char *str, const char *file, int line) 327. { ssl/d1_both.c:180:7: Taking true branch 178. 179. frag = (hm_fragment *)OPENSSL_malloc(sizeof(hm_fragment)); 180. if ( frag == NULL) ^ 181. return NULL; 182. ssl/d1_both.c:181:3: 179. frag = (hm_fragment *)OPENSSL_malloc(sizeof(hm_fragment)); 180. if ( frag == NULL) 181. > return NULL; 182. 183. if (frag_len) ssl/d1_both.c:212:2: return from a call to dtls1_hm_fragment_new 210. 211. return frag; 212. } ^ 213. 214. static void ssl/d1_both.c:1035:2: 1033. frag = dtls1_hm_fragment_new(s->init_num, 0); 1034. 1035. > memcpy(frag->fragment, s->init_buf->data, s->init_num); 1036. 1037. if ( is_ccs)
https://github.com/openssl/openssl/blob/cbd64894ec687c6f37d8e43c16dff78e63f6be87/ssl/d1_both.c/#L1035
d2a_code_trace_data_42496
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/ecp_smpl.c:884: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_copy`. Showing all 23 steps of the trace crypto/ec/ecp_smpl.c:823:10: Call 821. 822. BN_CTX_start(ctx); 823. n0 = BN_CTX_get(ctx); ^ 824. n1 = BN_CTX_get(ctx); 825. n2 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:366:15: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/bn/bn_lib.c:366:5: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/ec/ecp_smpl.c:884:14: Call 882. /* Z_r */ 883. if (a->Z_is_one) { 884. if (!BN_copy(n0, a->Y)) ^ 885. goto err; 886. } else { crypto/bn/bn_lib.c:281:1: Parameter `a->top` 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: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_copy` 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_42497
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; } test/bntest.c:1997: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_rand_range`. Showing all 26 steps of the trace test/bntest.c:1994:13: Call 1992. || !TEST_ptr(rng = BN_new()) 1993. || !TEST_ptr(val = BN_new()) 1994. || !TEST_true(BN_set_word(rng, range))) ^ 1995. goto err; 1996. for (i = 0; i < iterations; i++) { crypto/bn/bn_lib.c:368:15: Assignment 366. a->neg = 0; 367. a->d[0] = w; 368. a->top = (w ? 1 : 0); ^ 369. a->flags &= ~BN_FLG_FIXED_TOP; 370. bn_check_top(a); crypto/bn/bn_lib.c:368:5: Assignment 366. a->neg = 0; 367. a->d[0] = w; 368. a->top = (w ? 1 : 0); ^ 369. a->flags &= ~BN_FLG_FIXED_TOP; 370. bn_check_top(a); test/bntest.c:1997:14: Call 1995. goto err; 1996. for (i = 0; i < iterations; i++) { 1997. if (!TEST_true(BN_rand_range(val, rng)) ^ 1998. || !TEST_uint_lt(v = (unsigned int)BN_get_word(val), range)) 1999. goto err; crypto/bn/bn_rand.c:198:1: Parameter `r->top` 196. } 197. 198. > int BN_rand_range(BIGNUM *r, const BIGNUM *range) 199. { 200. return bnrand_range(NORMAL, r, range, NULL); crypto/bn/bn_rand.c:200:12: Call 198. int BN_rand_range(BIGNUM *r, const BIGNUM *range) 199. { 200. return bnrand_range(NORMAL, r, range, NULL); ^ 201. } 202. crypto/bn/bn_rand.c:127:1: Parameter `r->top` 125. 126. /* random number r: 0 <= r < range */ 127. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range, 128. BN_CTX *ctx) 129. { crypto/bn/bn_rand.c:143:9: Call 141. 142. if (n == 1) 143. BN_zero(r); ^ 144. else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) { 145. /* crypto/bn/bn_lib.c:361:1: Parameter `a->top` 359. } 360. 361. > int BN_set_word(BIGNUM *a, BN_ULONG w) 362. { 363. bn_check_top(a); crypto/bn/bn_lib.c:364:9: Call 362. { 363. bn_check_top(a); 364. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 365. return 0; 366. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `a->top` 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_lcl.h:668:12: Call 666. return a; 667. 668. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 669. } 670. 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_rand_range` 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/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_42498
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->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_clnt.c:47: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 14]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 22 steps of the trace ssl/statem/extensions_clnt.c:34:1: Parameter `pkt->written` 32. } 33. 34. > int tls_construct_ctos_server_name(SSL *s, WPACKET *pkt, X509 *x, 35. size_t chainidx, int *al) 36. { ssl/statem/extensions_clnt.c:41:10: Call 39. 40. /* Add TLS extension servername to the Client Hello message */ 41. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name) ^ 42. /* Sub-packet for server_name extension */ 43. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:289:1: Parameter `pkt->written` 287. } 288. 289. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 290. { 291. unsigned char *data; ssl/statem/extensions_clnt.c:43:17: Call 41. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name) 42. /* Sub-packet for server_name extension */ 43. || !WPACKET_start_sub_packet_u16(pkt) ^ 44. /* Sub-packet for servername list (always 1 hostname)*/ 45. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:252:1: Parameter `pkt->written` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/statem/extensions_clnt.c:45:17: Call 43. || !WPACKET_start_sub_packet_u16(pkt) 44. /* Sub-packet for servername list (always 1 hostname)*/ 45. || !WPACKET_start_sub_packet_u16(pkt) ^ 46. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) 47. || !WPACKET_sub_memcpy_u16(pkt, s->ext.hostname, ssl/packet.c:252:1: Parameter `pkt->written` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/statem/extensions_clnt.c:46:17: Call 44. /* Sub-packet for servername list (always 1 hostname)*/ 45. || !WPACKET_start_sub_packet_u16(pkt) 46. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) ^ 47. || !WPACKET_sub_memcpy_u16(pkt, s->ext.hostname, 48. strlen(s->ext.hostname)) ssl/packet.c:289:1: Parameter `pkt->written` 287. } 288. 289. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 290. { 291. unsigned char *data; ssl/statem/extensions_clnt.c:47:17: Call 45. || !WPACKET_start_sub_packet_u16(pkt) 46. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) 47. || !WPACKET_sub_memcpy_u16(pkt, s->ext.hostname, ^ 48. strlen(s->ext.hostname)) 49. || !WPACKET_close(pkt) ssl/packet.c:348:10: Call 346. size_t lenbytes) 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 349. || !WPACKET_memcpy(pkt, src, len) 350. || !WPACKET_close(pkt)) ssl/packet.c:252:1: Parameter `pkt->buf->length` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/packet.c:349:17: Call 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) 349. || !WPACKET_memcpy(pkt, src, len) ^ 350. || !WPACKET_close(pkt)) 351. return 0; ssl/packet.c:330:1: Parameter `pkt->written` 328. } 329. 330. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 331. { 332. unsigned char *dest; ssl/packet.c:337:10: Call 335. return 1; 336. 337. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 338. return 0; 339. 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:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 14]):unsigned64 by call to `WPACKET_sub_memcpy__` 47. return 0; 48. 49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 50. size_t newlen; 51. size_t reflen;
https://github.com/openssl/openssl/blob/f61c5ca6ca183bf0a51651857e3efb02a98889ad/ssl/packet.c/#L49
d2a_code_trace_data_42499
static void new_subtitle_stream(AVFormatContext *oc) { AVStream *st; AVCodecContext *subtitle_enc; int 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_SUBTITLE); bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters; subtitle_bitstream_filters= NULL; subtitle_enc = st->codec; subtitle_enc->codec_type = CODEC_TYPE_SUBTITLE; if (subtitle_stream_copy) { st->stream_copy = 1; } else { for(i=0; i<opt_name_count; i++){ char buf[256]; const AVOption *opt; const char *str= av_get_string(avctx_opts[CODEC_TYPE_SUBTITLE], opt_names[i], &opt, buf, sizeof(buf)); if(str && (opt->flags & AV_OPT_FLAG_SUBTITLE_PARAM) && (opt->flags & AV_OPT_FLAG_ENCODING_PARAM)) av_set_string(subtitle_enc, opt_names[i], str); } subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 1); } if (subtitle_language) { av_strlcpy(st->language, subtitle_language, sizeof(st->language)); av_free(subtitle_language); subtitle_language = NULL; } subtitle_disable = 0; av_freep(&subtitle_codec_name); subtitle_stream_copy = 0; } ffmpeg.c:3134: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `new_subtitle_stream`. ffmpeg.c:3134:5: Call 3132. } 3133. oc = output_files[nb_output_files - 1]; 3134. new_subtitle_stream(oc); ^ 3135. } 3136. ffmpeg.c:3062:1: <LHS trace> 3060. } 3061. 3062. static void new_subtitle_stream(AVFormatContext *oc) ^ 3063. { 3064. AVStream *st; ffmpeg.c:3062:1: Parameter `oc->nb_streams` 3060. } 3061. 3062. static void new_subtitle_stream(AVFormatContext *oc) ^ 3063. { 3064. AVStream *st; ffmpeg.c:3068:10: Call 3066. int i; 3067. 3068. st = av_new_stream(oc, oc->nb_streams); ^ 3069. if (!st) { 3070. 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:3075:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `new_subtitle_stream` 3073. avcodec_get_context_defaults2(st->codec, CODEC_TYPE_SUBTITLE); 3074. 3075. bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters; ^ 3076. subtitle_bitstream_filters= NULL; 3077.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/ffmpeg.c/#L3075
d2a_code_trace_data_42500
char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) { const X509_NAME_ENTRY *ne; int i; int n, lold, l, l1, l2, num, j, type; const char *s; char *p; unsigned char *q; BUF_MEM *b = NULL; static const char hex[17] = "0123456789ABCDEF"; int gs_doit[4]; char tmp_buf[80]; #ifdef CHARSET_EBCDIC unsigned char ebcdic_buf[1024]; #endif if (buf == NULL) { if ((b = BUF_MEM_new()) == NULL) goto err; if (!BUF_MEM_grow(b, 200)) goto err; b->data[0] = '\0'; len = 200; } else if (len == 0) { return NULL; } if (a == NULL) { if (b) { buf = b->data; OPENSSL_free(b); } strncpy(buf, "NO X509_NAME", len); buf[len - 1] = '\0'; return buf; } len--; l = 0; for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { ne = sk_X509_NAME_ENTRY_value(a->entries, i); n = OBJ_obj2nid(ne->object); if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) { i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object); s = tmp_buf; } l1 = strlen(s); type = ne->value->type; num = ne->value->length; if (num > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_IA5STRING) { if (num > (int)sizeof(ebcdic_buf)) num = sizeof(ebcdic_buf); ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) { gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0; for (j = 0; j < num; j++) if (q[j] != 0) gs_doit[j & 3] = 1; if (gs_doit[0] | gs_doit[1] | gs_doit[2]) gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; else { gs_doit[0] = gs_doit[1] = gs_doit[2] = 0; gs_doit[3] = 1; } } else gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; for (l2 = j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; l2++; #ifndef CHARSET_EBCDIC if ((q[j] < ' ') || (q[j] > '~')) l2 += 3; #else if ((os_toascii[q[j]] < os_toascii[' ']) || (os_toascii[q[j]] > os_toascii['~'])) l2 += 3; #endif } lold = l; l += 1 + l1 + 1 + l2; if (l > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; p = &(b->data[lold]); } else if (l > len) { break; } else p = &(buf[lold]); *(p++) = '/'; memcpy(p, s, (unsigned int)l1); p += l1; *(p++) = '='; #ifndef CHARSET_EBCDIC q = ne->value->data; #endif for (j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; #ifndef CHARSET_EBCDIC n = q[j]; if ((n < ' ') || (n > '~')) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = n; #else n = os_toascii[q[j]]; if ((n < os_toascii[' ']) || (n > os_toascii['~'])) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = q[j]; #endif } *p = '\0'; } if (b != NULL) { p = b->data; OPENSSL_free(b); } else p = buf; if (i == 0) *p = '\0'; return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); end: BUF_MEM_free(b); return (NULL); } apps/ca.c:2033: error: BUFFER_OVERRUN_L3 Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace apps/ca.c:2033:20: Call 2031. for (i = 0; i < DB_NUMBER; i++) 2032. row[i] = NULL; 2033. row[DB_name] = X509_NAME_oneline(X509_get_subject_name(x509), NULL, 0); ^ 2034. bn = ASN1_INTEGER_to_BN(X509_get_serialNumber(x509), NULL); 2035. if (!bn) crypto/x509/x509_obj.c:25:1: <Offset trace> 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: Parameter `len` 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: <Length trace> 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: Parameter `*buf` 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:57:9: Array access: Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline` 55. } 56. strncpy(buf, "NO X509_NAME", len); 57. buf[len - 1] = '\0'; ^ 58. return buf; 59. }
https://github.com/openssl/openssl/blob/cdb2a60347f988037d29adc7e4415e9c66c8a5a5/crypto/x509/x509_obj.c/#L57
d2a_code_trace_data_42501
mask_t gf_eq(const gf a, const gf b) { gf c; mask_t ret = 0; unsigned int i; gf_sub(c, a, b); gf_strong_reduce(c); for (i = 0; i < NLIMBS; i++) { ret |= c->limb[LIMBPERM(i)]; } return word_is_zero(ret); } crypto/ec/curve448/f_generic.c:166: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `word_is_zero`. Showing all 5 steps of the trace crypto/ec/curve448/f_generic.c:156:5: Assignment 154. { 155. gf c; 156. mask_t ret = 0; ^ 157. unsigned int i; 158. crypto/ec/curve448/f_generic.c:166:12: Call 164. } 165. 166. return word_is_zero(ret); ^ 167. } 168. crypto/ec/curve448/arch_32/arch_intrinsics.h:18:1: <LHS trace> 16. # define ARCH_WORD_BITS 32 17. 18. > static ossl_inline uint32_t word_is_zero(uint32_t a) 19. { 20. /* let's hope the compiler isn't clever enough to optimize this. */ crypto/ec/curve448/arch_32/arch_intrinsics.h:18:1: Parameter `a` 16. # define ARCH_WORD_BITS 32 17. 18. > static ossl_inline uint32_t word_is_zero(uint32_t a) 19. { 20. /* let's hope the compiler isn't clever enough to optimize this. */ crypto/ec/curve448/arch_32/arch_intrinsics.h:21:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `word_is_zero` 19. { 20. /* let's hope the compiler isn't clever enough to optimize this. */ 21. return (((uint64_t)a) - 1) >> 32; ^ 22. } 23.
https://github.com/openssl/openssl/blob/0cdcdacc337005e08a906b2e07d4e44e3ee48138/crypto/ec/curve448/f_generic.c/#L166
d2a_code_trace_data_42502
void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD *rec, size_t md_size) { #if defined(CBC_MAC_ROTATE_IN_PLACE) unsigned char rotated_mac_buf[64 + EVP_MAX_MD_SIZE]; unsigned char *rotated_mac; #else unsigned char rotated_mac[EVP_MAX_MD_SIZE]; #endif size_t mac_end = rec->length; size_t mac_start = mac_end - md_size; size_t scan_start = 0; size_t i, j; size_t div_spoiler; size_t rotate_offset; OPENSSL_assert(rec->orig_len >= md_size); OPENSSL_assert(md_size <= EVP_MAX_MD_SIZE); #if defined(CBC_MAC_ROTATE_IN_PLACE) rotated_mac = rotated_mac_buf + ((0 - (size_t)rotated_mac_buf) & 63); #endif if (rec->orig_len > md_size + 255 + 1) scan_start = rec->orig_len - (md_size + 255 + 1); div_spoiler = md_size >> 1; div_spoiler <<= (sizeof(div_spoiler) - 1) * 8; rotate_offset = (div_spoiler + mac_start - scan_start) % md_size; memset(rotated_mac, 0, md_size); for (i = scan_start, j = 0; i < rec->orig_len; i++) { unsigned char mac_started = constant_time_ge_8_s(i, mac_start); unsigned char mac_ended = constant_time_ge_8_s(i, mac_end); unsigned char b = rec->data[i]; rotated_mac[j++] |= b & mac_started & ~mac_ended; j &= constant_time_lt_s(j, md_size); } #if defined(CBC_MAC_ROTATE_IN_PLACE) j = 0; for (i = 0; i < md_size; i++) { ((volatile unsigned char *)rotated_mac)[rotate_offset ^ 32]; out[j++] = rotated_mac[rotate_offset++]; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #else memset(out, 0, md_size); rotate_offset = md_size - rotate_offset; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); for (i = 0; i < md_size; i++) { for (j = 0; j < md_size; j++) out[j] |= rotated_mac[i] & constant_time_eq_8_s(j, rotate_offset); rotate_offset++; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #endif } ssl/record/ssl3_record.c:476: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [256, 320]):unsigned64 by call to `ssl3_cbc_copy_mac`. Showing all 9 steps of the trace ssl/record/ssl3_record.c:226:29: Call 224. if (!PACKET_get_1(&pkt, &type) 225. || !PACKET_get_net_2(&pkt, &version) 226. || !PACKET_get_net_2_len(&pkt, &thisrr->length)) { ^ 227. al = SSL_AD_INTERNAL_ERROR; 228. SSLerr(SSL_F_SSL3_GET_RECORD, ERR_R_INTERNAL_ERROR); ssl/packet_locl.h:164:8: Parameter `*data` 162. 163. /* Same as PACKET_get_net_2() but for a size_t */ 164. __owur static ossl_inline int PACKET_get_net_2_len(PACKET *pkt, size_t *data) ^ 165. { 166. unsigned int i; ssl/record/ssl3_record.c:364:9: Assignment 362. /* decrypt in place in 'thisrr->input' */ 363. thisrr->data = thisrr->input; 364. thisrr->orig_len = thisrr->length; ^ 365. 366. /* Mark this record as not read by upper layers yet */ ssl/record/ssl3_record.c:476:17: Call 474. */ 475. mac = mac_tmp; 476. ssl3_cbc_copy_mac(mac_tmp, thisrr, mac_size); ^ 477. thisrr->length -= mac_size; 478. } else { ssl/record/ssl3_record.c:1297:1: <LHS trace> 1295. #define CBC_MAC_ROTATE_IN_PLACE 1296. 1297. > void ssl3_cbc_copy_mac(unsigned char *out, 1298. const SSL3_RECORD *rec, size_t md_size) 1299. { ssl/record/ssl3_record.c:1297:1: Parameter `md_size` 1295. #define CBC_MAC_ROTATE_IN_PLACE 1296. 1297. > void ssl3_cbc_copy_mac(unsigned char *out, 1298. const SSL3_RECORD *rec, size_t md_size) 1299. { ssl/record/ssl3_record.c:1297:1: <RHS trace> 1295. #define CBC_MAC_ROTATE_IN_PLACE 1296. 1297. > void ssl3_cbc_copy_mac(unsigned char *out, 1298. const SSL3_RECORD *rec, size_t md_size) 1299. { ssl/record/ssl3_record.c:1297:1: Parameter `md_size` 1295. #define CBC_MAC_ROTATE_IN_PLACE 1296. 1297. > void ssl3_cbc_copy_mac(unsigned char *out, 1298. const SSL3_RECORD *rec, size_t md_size) 1299. { ssl/record/ssl3_record.c:1330:9: Binary operation: ([0, +oo] - [256, 320]):unsigned64 by call to `ssl3_cbc_copy_mac` 1328. /* This information is public so it's safe to branch based on it. */ 1329. if (rec->orig_len > md_size + 255 + 1) 1330. scan_start = rec->orig_len - (md_size + 255 + 1); ^ 1331. /* 1332. * div_spoiler contains a multiple of md_size that is used to cause the
https://github.com/openssl/openssl/blob/829754a62245df76584078011f045185218c60c4/ssl/record/ssl3_record.c/#L1330
d2a_code_trace_data_42503
int BN_hex2bn(BIGNUM **bn, const char *a) { BIGNUM *ret = NULL; BN_ULONG l = 0; int neg = 0, h, m, i, j, k, c; int num; if ((a == NULL) || (*a == '\0')) return (0); if (*a == '-') { neg = 1; a++; } for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) continue; if (i == 0 || i > INT_MAX/4) goto err; num = i + neg; if (bn == NULL) return (num); if (*bn == NULL) { if ((ret = BN_new()) == NULL) return (0); } else { ret = *bn; BN_zero(ret); } if (bn_expand(ret, i * 4) == NULL) goto err; j = i; m = 0; h = 0; while (j > 0) { m = ((BN_BYTES * 2) <= j) ? (BN_BYTES * 2) : j; l = 0; for (;;) { c = a[j - m]; k = OPENSSL_hexchar2int(c); if (k < 0) k = 0; l = (l << 4) | k; if (--m <= 0) { ret->d[h++] = l; break; } } j -= (BN_BYTES * 2); } ret->top = h; bn_correct_top(ret); *bn = ret; bn_check_top(ret); if (ret->top != 0) ret->neg = neg; return (num); err: if (*bn == NULL) BN_free(ret); return (0); } test/bntest.c:720: error: BUFFER_OVERRUN_L2 Offset: [0, 536870912] (⇐ [0, 1] + [0, 536870911]) Size: 65 by call to `BN_hex2bn`. Showing all 6 steps of the trace test/bntest.c:720:5: Call 718. 719. /* Regression test for a BN_sqr overflow bug. */ 720. BN_hex2bn(&a, ^ 721. "80000000000000008000000000000001" 722. "FFFFFFFFFFFFFFFE0000000000000000"); crypto/bn/bn_print.c:141:10: <Offset trace> 139. } 140. 141. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) ^ 142. continue; 143. crypto/bn/bn_print.c:141:10: Assignment 139. } 140. 141. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) ^ 142. continue; 143. crypto/bn/bn_print.c:126:1: <Length trace> 124. } 125. 126. > int BN_hex2bn(BIGNUM **bn, const char *a) 127. { 128. BIGNUM *ret = NULL; crypto/bn/bn_print.c:126:1: Parameter `*a` 124. } 125. 126. > int BN_hex2bn(BIGNUM **bn, const char *a) 127. { 128. BIGNUM *ret = NULL; crypto/bn/bn_print.c:141:37: Array access: Offset: [0, 536870912] (⇐ [0, 1] + [0, 536870911]) Size: 65 by call to `BN_hex2bn` 139. } 140. 141. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) ^ 142. continue; 143.
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_print.c/#L141
d2a_code_trace_data_42504
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ec_mult.c:952: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`. Showing all 9 steps of the trace crypto/ec/ec_mult.c:814:1: Parameter `ctx->stack.depth` 812. * points[2^(w-1)*numblocks] = NULL 813. */ 814. > int ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *ctx) 815. { 816. const EC_POINT *generator; crypto/ec/ec_mult.c:952:9: Call 950. err: 951. if (ctx != NULL) 952. BN_CTX_end(ctx); ^ 953. BN_CTX_free(new_ctx); 954. EC_ec_pre_comp_free(pre_comp); 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_CTX_end` 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_42505
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:285: error: Uninitialized Value The value read from inbuffer[_] was never initialized. libavcodec/ra144.c:285:3: 283. *(ptr++)=(inbuffer[4]>>1)&0x7f; 284. *(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f); 285. *(ptr++)=(inbuffer[5]>>2)&0x7f; ^ 286. *(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f); 287. *(ptr++)=(inbuffer[6]>>4)&0x7f;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L285
d2a_code_trace_data_42506
static int gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, BIGNUM *x1, BIGNUM *z1, BIGNUM *x2, BIGNUM *z2, BN_CTX *ctx) { BIGNUM *t3, *t4, *t5; int ret = 0; if (BN_is_zero(z1)) { BN_zero(x2); BN_zero(z2); return 1; } if (BN_is_zero(z2)) { if (!BN_copy(x2, x)) return 0; if (!BN_GF2m_add(z2, x, y)) return 0; return 2; } BN_CTX_start(ctx); t3 = BN_CTX_get(ctx); t4 = BN_CTX_get(ctx); t5 = BN_CTX_get(ctx); if (t5 == NULL) goto err; if (!BN_one(t5)) goto err; if (!group->meth->field_mul(group, t3, z1, z2, ctx)) goto err; if (!group->meth->field_mul(group, z1, z1, x, ctx)) goto err; if (!BN_GF2m_add(z1, z1, x1)) goto err; if (!group->meth->field_mul(group, z2, z2, x, ctx)) goto err; if (!group->meth->field_mul(group, x1, z2, x1, ctx)) goto err; if (!BN_GF2m_add(z2, z2, x2)) goto err; if (!group->meth->field_mul(group, z2, z2, z1, ctx)) goto err; if (!group->meth->field_sqr(group, t4, x, ctx)) goto err; if (!BN_GF2m_add(t4, t4, y)) goto err; if (!group->meth->field_mul(group, t4, t4, t3, ctx)) goto err; if (!BN_GF2m_add(t4, t4, z2)) goto err; if (!group->meth->field_mul(group, t3, t3, x, ctx)) goto err; if (!group->meth->field_div(group, t3, t5, t3, ctx)) goto err; if (!group->meth->field_mul(group, t4, t3, t4, ctx)) goto err; if (!group->meth->field_mul(group, x2, x1, t3, ctx)) goto err; if (!BN_GF2m_add(z2, x2, x)) goto err; if (!group->meth->field_mul(group, z2, z2, t4, ctx)) goto err; if (!BN_GF2m_add(z2, z2, y)) goto err; ret = 2; err: BN_CTX_end(ctx); return ret; } crypto/ec/ec2_mult.c:206: error: MEMORY_LEAK memory dynamically allocated by call to `BN_CTX_start()` at line 196, column 5 is not reachable after line 206, column 10. Showing all 115 steps of the trace crypto/ec/ec2_mult.c:174:1: start of procedure gf2m_Mxy() 172. * 2 otherwise 173. */ 174. > static int gf2m_Mxy(const EC_GROUP *group, const BIGNUM *x, const BIGNUM *y, 175. BIGNUM *x1, BIGNUM *z1, BIGNUM *x2, BIGNUM *z2, 176. BN_CTX *ctx) crypto/ec/ec2_mult.c:179:5: 177. { 178. BIGNUM *t3, *t4, *t5; 179. > int ret = 0; 180. 181. if (BN_is_zero(z1)) { crypto/ec/ec2_mult.c:181:9: 179. int ret = 0; 180. 181. > if (BN_is_zero(z1)) { 182. BN_zero(x2); 183. BN_zero(z2); crypto/bn/bn_lib.c:899:1: start of procedure BN_is_zero() 897. } 898. 899. > int BN_is_zero(const BIGNUM *a) 900. { 901. return a->top == 0; crypto/bn/bn_lib.c:901:12: Condition is false 899. int BN_is_zero(const BIGNUM *a) 900. { 901. return a->top == 0; ^ 902. } 903. crypto/bn/bn_lib.c:901:5: 899. int BN_is_zero(const BIGNUM *a) 900. { 901. > return a->top == 0; 902. } 903. crypto/bn/bn_lib.c:902:1: return from a call to BN_is_zero 900. { 901. return a->top == 0; 902. > } 903. 904. int BN_is_one(const BIGNUM *a) crypto/ec/ec2_mult.c:181:9: Taking false branch 179. int ret = 0; 180. 181. if (BN_is_zero(z1)) { ^ 182. BN_zero(x2); 183. BN_zero(z2); crypto/ec/ec2_mult.c:187:9: 185. } 186. 187. > if (BN_is_zero(z2)) { 188. if (!BN_copy(x2, x)) 189. return 0; crypto/bn/bn_lib.c:899:1: start of procedure BN_is_zero() 897. } 898. 899. > int BN_is_zero(const BIGNUM *a) 900. { 901. return a->top == 0; crypto/bn/bn_lib.c:901:12: Condition is false 899. int BN_is_zero(const BIGNUM *a) 900. { 901. return a->top == 0; ^ 902. } 903. crypto/bn/bn_lib.c:901:5: 899. int BN_is_zero(const BIGNUM *a) 900. { 901. > return a->top == 0; 902. } 903. crypto/bn/bn_lib.c:902:1: return from a call to BN_is_zero 900. { 901. return a->top == 0; 902. > } 903. 904. int BN_is_one(const BIGNUM *a) crypto/ec/ec2_mult.c:187:9: Taking false branch 185. } 186. 187. if (BN_is_zero(z2)) { ^ 188. if (!BN_copy(x2, x)) 189. return 0; crypto/ec/ec2_mult.c:196:5: 194. 195. /* Since Mxy is static we can guarantee that ctx != NULL. */ 196. > BN_CTX_start(ctx); 197. t3 = BN_CTX_get(ctx); 198. t4 = BN_CTX_get(ctx); 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/ec/ec2_mult.c:197:5: 195. /* Since Mxy is static we can guarantee that ctx != NULL. */ 196. BN_CTX_start(ctx); 197. > t3 = BN_CTX_get(ctx); 198. t4 = BN_CTX_get(ctx); 199. t5 = BN_CTX_get(ctx); 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/ec/ec2_mult.c:198:5: 196. BN_CTX_start(ctx); 197. t3 = BN_CTX_get(ctx); 198. > t4 = BN_CTX_get(ctx); 199. t5 = BN_CTX_get(ctx); 200. if (t5 == NULL) 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/ec/ec2_mult.c:199:5: 197. t3 = BN_CTX_get(ctx); 198. t4 = BN_CTX_get(ctx); 199. > t5 = BN_CTX_get(ctx); 200. if (t5 == NULL) 201. 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/ec/ec2_mult.c:200:9: Taking false branch 198. t4 = BN_CTX_get(ctx); 199. t5 = BN_CTX_get(ctx); 200. if (t5 == NULL) ^ 201. goto err; 202. crypto/ec/ec2_mult.c:203:10: 201. goto err; 202. 203. > if (!BN_one(t5)) 204. goto err; 205. 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) crypto/ec/ec2_mult.c:203:10: Taking false branch 201. goto err; 202. 203. if (!BN_one(t5)) ^ 204. goto err; 205. crypto/ec/ec2_mult.c:206:10: Skipping __function_pointer__(): unresolved function pointer 204. goto err; 205. 206. if (!group->meth->field_mul(group, t3, z1, z2, ctx)) ^ 207. goto err; 208.
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/ec/ec2_mult.c/#L206
d2a_code_trace_data_42507
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); } crypto/rsa/rsa_chk.c:66: error: BUFFER_OVERRUN_L3 Offset: [9, +oo] (⇐ [9, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mul`. Showing all 23 steps of the trace crypto/rsa/rsa_chk.c:60:9: Call 58. 59. /* q prime? */ 60. if (BN_is_prime_ex(key->q, BN_prime_checks, NULL, cb) != 1) { ^ 61. ret = 0; 62. RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_Q_NOT_PRIME); crypto/bn/bn_prime.c:150:12: Call 148. BN_GENCB *cb) 149. { 150. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); ^ 151. } 152. crypto/bn/bn_prime.c:227:13: Call 225. /* now 1 <= check < a */ 226. 227. j = witness(check, a, A1, A1_odd, k, ctx, mont); ^ 228. if (j == -1) 229. goto err; crypto/bn/bn_prime.c:253:10: Call 251. BN_MONT_CTX *mont) 252. { 253. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ ^ 254. return -1; 255. if (BN_is_one(w)) crypto/bn/bn_exp.c:350:14: Call 348. 349. if (a->neg || BN_ucmp(a, m) >= 0) { 350. if (!BN_nnmod(val[0], a, m, ctx)) ^ 351. goto err; 352. aa = val[0]; 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:140:1: Parameter `*dv->d` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/rsa/rsa_chk.c:66:10: Call 64. 65. /* n = p*q? */ 66. if (!BN_mul(i, key->p, key->q, ctx)) { ^ 67. ret = -1; 68. goto err; crypto/bn/bn_mul.c:495:1: Parameter `a->top` 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:512:5: Assignment 510. bn_check_top(r); 511. 512. al = a->top; ^ 513. bl = b->top; 514. 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:380:9: Call 378. } else { 379. p = &(t[n2 * 2]); 380. bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p); ^ 381. bn_mul_recursive(r, a, b, n, 0, 0, p); 382. i = n / 2; crypto/bn/bn_mul.c:173:1: Parameter `*b` 171. */ 172. /* dnX may not be positive, but n2/2+dnX has to be */ 173. > void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, 174. int dna, int dnb, BN_ULONG *t) 175. { crypto/bn/bn_mul.c:207:10: Call 205. /* r=(a[0]-a[1])*(b[1]-b[0]) */ 206. c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna); 207. c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n); ^ 208. zero = neg = 0; 209. 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 `*b` 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:719:14: Array access: Offset: [9, +oo] (⇐ [9, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mul` 717. for (i = n - 2; i >= 0; i--) { 718. aa = a[i]; 719. bb = b[i]; ^ 720. if (aa != bb) 721. return ((aa > bb) ? 1 : -1);
https://github.com/openssl/openssl/blob/757264207ad8650a89ea903d48ad89f61d56ea9c/crypto/bn/bn_lib.c/#L719
d2a_code_trace_data_42508
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:796: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 37]):unsigned64 by call to `WPACKET_memcpy`. Showing all 12 steps of the trace ssl/statem/statem_clnt.c:795:17: Call 793. sess_id_len = s->session->session_id_length; 794. if (sess_id_len > sizeof(s->session->session_id) 795. || !WPACKET_start_sub_packet_u8(pkt) ^ 796. || (sess_id_len != 0 && !WPACKET_memcpy(pkt, s->session->session_id, 797. sess_id_len)) 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/statem/statem_clnt.c:796:38: Call 794. if (sess_id_len > sizeof(s->session->session_id) 795. || !WPACKET_start_sub_packet_u8(pkt) 796. || (sess_id_len != 0 && !WPACKET_memcpy(pkt, s->session->session_id, ^ 797. sess_id_len)) 798. || !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, pkt->written + 37]):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/6438632420cee9821409221ef6717edc5ee408c1/ssl/packet.c/#L46
d2a_code_trace_data_42509
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/dtls_mtu_test.c:162: error: BUFFER_OVERRUN_L1 Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: 4 by call to `SSL_CTX_set_cipher_list`. Showing all 13 steps of the trace test/dtls_mtu_test.c:162:10: Call 160. * only do (non-DH) PSK. 161. */ 162. if (!TEST_true(SSL_CTX_set_cipher_list(ctx, "PSK"))) ^ 163. goto end; 164. ssl/ssl_lib.c:2511:1: Parameter `*str` 2509. 2510. /** specify the ciphers to be used by default by the SSL_CTX */ 2511. > int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) 2512. { 2513. STACK_OF(SSL_CIPHER) *sk; ssl/ssl_lib.c:2515:10: Call 2513. STACK_OF(SSL_CIPHER) *sk; 2514. 2515. sk = ssl_create_cipher_list(ctx->method, ctx->tls13_ciphersuites, ^ 2516. &ctx->cipher_list, &ctx->cipher_list_by_id, str, 2517. ctx->cert); ssl/ssl_ciph.c:1403:1: Parameter `*rule_str` 1401. } 1402. 1403. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, 1404. STACK_OF(SSL_CIPHER) *tls13_ciphersuites, 1405. STACK_OF(SSL_CIPHER) **cipher_list, ssl/ssl_ciph.c:1423:10: Call 1421. return NULL; 1422. #ifndef OPENSSL_NO_EC 1423. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str)) ^ 1424. return NULL; 1425. #endif ssl/ssl_ciph.c:1223:1: Parameter `**prule_str` 1221. 1222. #ifndef OPENSSL_NO_EC 1223. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c, 1224. const char **prule_str) 1225. { ssl/ssl_ciph.c:1572:5: Assignment 1570. */ 1571. ok = 1; 1572. rule_p = rule_str; ^ 1573. if (strncmp(rule_str, "DEFAULT", 7) == 0) { 1574. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, ssl/ssl_ciph.c:1582:14: Call 1580. 1581. if (ok && (strlen(rule_p) > 0)) 1582. ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c); ^ 1583. 1584. OPENSSL_free(ca_list); /* Not needed anymore */ ssl/ssl_ciph.c:958:1: <Length trace> 956. } 957. 958. > static int ssl_cipher_process_rulestr(const char *rule_str, 959. CIPHER_ORDER **head_p, 960. CIPHER_ORDER **tail_p, ssl/ssl_ciph.c:958:1: Parameter `*rule_str` 956. } 957. 958. > static int ssl_cipher_process_rulestr(const char *rule_str, 959. CIPHER_ORDER **head_p, 960. CIPHER_ORDER **tail_p, ssl/ssl_ciph.c:971:5: Assignment 969. 970. retval = 1; 971. l = rule_str; ^ 972. for ( ; ; ) { 973. ch = *l; ssl/ssl_ciph.c:1007:13: Assignment 1005. for (;;) { 1006. ch = *l; 1007. buf = l; ^ 1008. buflen = 0; 1009. #ifndef CHARSET_EBCDIC ssl/ssl_ciph.c:1185:29: Array access: Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: 4 by call to `SSL_CTX_set_cipher_list` 1183. ok = ssl_cipher_strength_sort(head_p, tail_p); 1184. } else if (buflen == 10 && strncmp(buf, "SECLEVEL=", 9) == 0) { 1185. int level = buf[9] - '0'; ^ 1186. if (level < 0 || level > 5) { 1187. SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
https://github.com/openssl/openssl/blob/4845aeba4c49e1bd65259a5014d7e3ab38657d42/ssl/ssl_ciph.c/#L1185
d2a_code_trace_data_42510
char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; int i; int n, lold, l, l1, l2, num, j, type; const char *s; char *p; unsigned char *q; BUF_MEM *b = NULL; static const char hex[17] = "0123456789ABCDEF"; int gs_doit[4]; char tmp_buf[80]; #ifdef CHARSET_EBCDIC unsigned char ebcdic_buf[1024]; #endif if (buf == NULL) { if ((b = BUF_MEM_new()) == NULL) goto err; if (!BUF_MEM_grow(b, 200)) goto err; b->data[0] = '\0'; len = 200; } else if (len == 0) { return NULL; } if (a == NULL) { if (b) { buf = b->data; OPENSSL_free(b); } strncpy(buf, "NO X509_NAME", len); buf[len - 1] = '\0'; return buf; } len--; l = 0; for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { ne = sk_X509_NAME_ENTRY_value(a->entries, i); n = OBJ_obj2nid(ne->object); if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) { i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object); s = tmp_buf; } l1 = strlen(s); type = ne->value->type; num = ne->value->length; if (num > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { ascii2ebcdic(ebcdic_buf, q, (num > (int)sizeof(ebcdic_buf)) ? (int)sizeof(ebcdic_buf) : num); q = ebcdic_buf; } #endif if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) { gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0; for (j = 0; j < num; j++) if (q[j] != 0) gs_doit[j & 3] = 1; if (gs_doit[0] | gs_doit[1] | gs_doit[2]) gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; else { gs_doit[0] = gs_doit[1] = gs_doit[2] = 0; gs_doit[3] = 1; } } else gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; for (l2 = j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; l2++; #ifndef CHARSET_EBCDIC if ((q[j] < ' ') || (q[j] > '~')) l2 += 3; #else if ((os_toascii[q[j]] < os_toascii[' ']) || (os_toascii[q[j]] > os_toascii['~'])) l2 += 3; #endif } lold = l; l += 1 + l1 + 1 + l2; if (l > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; p = &(b->data[lold]); } else if (l > len) { break; } else p = &(buf[lold]); *(p++) = '/'; memcpy(p, s, (unsigned int)l1); p += l1; *(p++) = '='; #ifndef CHARSET_EBCDIC q = ne->value->data; #endif for (j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; #ifndef CHARSET_EBCDIC n = q[j]; if ((n < ' ') || (n > '~')) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = n; #else n = os_toascii[q[j]]; if ((n < os_toascii[' ']) || (n > os_toascii['~'])) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = q[j]; #endif } *p = '\0'; } if (b != NULL) { p = b->data; OPENSSL_free(b); } else p = buf; if (i == 0) *p = '\0'; return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); end: BUF_MEM_free(b); return (NULL); } crypto/x509/t_crl.c:99: error: BUFFER_OVERRUN_L3 Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace crypto/x509/t_crl.c:99:9: Call 97. X509_CRL_get0_signature(&sig, &sig_alg, x); 98. X509_signature_print(out, sig_alg, NULL); 99. p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0); ^ 100. BIO_printf(out, "%8sIssuer: %s\n", "", p); 101. OPENSSL_free(p); crypto/x509/x509_obj.c:73:1: <Offset trace> 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: Parameter `len` 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: <Length trace> 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: Parameter `*buf` 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:105:9: Array access: Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline` 103. } 104. strncpy(buf, "NO X509_NAME", len); 105. buf[len - 1] = '\0'; ^ 106. return buf; 107. }
https://github.com/openssl/openssl/blob/24c2cd3967ed23acc0bd31a3781c4525e2e42a2c/crypto/x509/x509_obj.c/#L105
d2a_code_trace_data_42511
static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g, int16_t *exponents) { const uint8_t *bstab, *pretab; int len, i, j, k, l, v0, shift, gain, gains[3]; int16_t *exp_ptr; exp_ptr = exponents; gain = g->global_gain - 210; shift = g->scalefac_scale + 1; bstab = band_size_long[s->sample_rate_index]; pretab = mpa_pretab[g->preflag]; for(i=0;i<g->long_end;i++) { v0 = gain - ((g->scale_factors[i] + pretab[i]) << shift) + 400; len = bstab[i]; for(j=len;j>0;j--) *exp_ptr++ = v0; } if (g->short_start < 13) { bstab = band_size_short[s->sample_rate_index]; gains[0] = gain - (g->subblock_gain[0] << 3); gains[1] = gain - (g->subblock_gain[1] << 3); gains[2] = gain - (g->subblock_gain[2] << 3); k = g->long_end; for(i=g->short_start;i<13;i++) { len = bstab[i]; for(l=0;l<3;l++) { v0 = gains[l] - (g->scale_factors[k++] << shift) + 400; for(j=len;j>0;j--) *exp_ptr++ = v0; } } } } libavcodec/mpegaudiodec.c:2410: error: Buffer Overrun L2 Offset: [0, 9] Size: 9 by call to `mp_decode_frame`. libavcodec/mpegaudiodec.c:2371:1: Parameter `*buf` 2369. } 2370. 2371. static int decode_frame(AVCodecContext * avctx, ^ 2372. void *data, int *data_size, 2373. const uint8_t * buf, int buf_size) libavcodec/mpegaudiodec.c:2384:5: Assignment 2382. return -1; 2383. 2384. header = AV_RB32(buf); ^ 2385. if(ff_mpa_check_header(header) < 0){ 2386. buf++; libavcodec/mpegaudiodec.c:2392:9: Call 2390. } 2391. 2392. if (ff_mpegaudio_decode_header(s, header) == 1) { ^ 2393. /* free format: prepare to compute frame size */ 2394. s->frame_size = -1; libavcodec/mpegaudiodecheader.c:39:9: Assignment 37. if (header & (1<<20)) { 38. s->lsf = (header & (1<<19)) ? 0 : 1; 39. mpeg25 = 0; ^ 40. } else { 41. s->lsf = 1; libavcodec/mpegaudiodecheader.c:49:5: Assignment 47. sample_rate_index = (header >> 10) & 3; 48. sample_rate = ff_mpa_freq_tab[sample_rate_index] >> (s->lsf + mpeg25); 49. sample_rate_index += 3 * (s->lsf + mpeg25); ^ 50. s->sample_rate_index = sample_rate_index; 51. s->error_protection = ((header >> 16) & 1) ^ 1; libavcodec/mpegaudiodecheader.c:50:5: Assignment 48. sample_rate = ff_mpa_freq_tab[sample_rate_index] >> (s->lsf + mpeg25); 49. sample_rate_index += 3 * (s->lsf + mpeg25); 50. s->sample_rate_index = sample_rate_index; ^ 51. s->error_protection = ((header >> 16) & 1) ^ 1; 52. s->sample_rate = sample_rate; libavcodec/mpegaudiodec.c:2410:16: Call 2408. } 2409. 2410. out_size = mp_decode_frame(s, out_samples, buf, buf_size); ^ 2411. if(out_size>=0){ 2412. *data_size = out_size; libavcodec/mpegaudiodec.c:2289:1: Parameter `s->sample_rate_index` 2287. } 2288. 2289. static int mp_decode_frame(MPADecodeContext *s, ^ 2290. OUT_INT *samples, const uint8_t *buf, int buf_size) 2291. { libavcodec/mpegaudiodec.c:2314:21: Call 2312. s->avctx->frame_size = s->lsf ? 576 : 1152; 2313. default: 2314. nb_frames = mp_decode_layer3(s); ^ 2315. 2316. s->last_buf_size=0; libavcodec/mpegaudiodec.c:2015:1: Parameter `s->sample_rate_index` 2013. 2014. /* main layer3 decoding function */ 2015. static int mp_decode_layer3(MPADecodeContext *s) ^ 2016. { 2017. int nb_granules, main_data_begin, private_bits; libavcodec/mpegaudiodec.c:2255:13: Call 2253. } 2254. 2255. exponents_from_scale_factors(s, g, exponents); ^ 2256. 2257. /* read Huffman coded residue */ libavcodec/mpegaudiodec.c:1419:1: <Offset trace> 1417. } 1418. 1419. static void exponents_from_scale_factors(MPADecodeContext *s, ^ 1420. GranuleDef *g, 1421. int16_t *exponents) libavcodec/mpegaudiodec.c:1419:1: Parameter `s->sample_rate_index` 1417. } 1418. 1419. static void exponents_from_scale_factors(MPADecodeContext *s, ^ 1420. GranuleDef *g, 1421. int16_t *exponents) libavcodec/mpegaudiodectab.h:563:1: <Length trace> 561. 562. /* band size tables */ 563. static const uint8_t band_size_long[9][22] = { ^ 564. { 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10, 565. 12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158, }, /* 44100 */ libavcodec/mpegaudiodectab.h:563:1: Array declaration 561. 562. /* band size tables */ 563. static const uint8_t band_size_long[9][22] = { ^ 564. { 4, 4, 4, 4, 4, 4, 6, 6, 8, 8, 10, 565. 12, 16, 20, 24, 28, 34, 42, 50, 54, 76, 158, }, /* 44100 */ libavcodec/mpegaudiodec.c:1431:5: Array access: Offset: [0, 9] Size: 9 by call to `mp_decode_frame` 1429. shift = g->scalefac_scale + 1; 1430. 1431. bstab = band_size_long[s->sample_rate_index]; ^ 1432. pretab = mpa_pretab[g->preflag]; 1433. for(i=0;i<g->long_end;i++) {
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L1431
d2a_code_trace_data_42512
static void pred8x8l_horizontal_up_c(uint8_t *src, int has_topleft, int has_topright, int stride) { PREDICT_8x8_LOAD_LEFT; SRC(0,0)= (l0 + l1 + 1) >> 1; SRC(1,0)= (l0 + 2*l1 + l2 + 2) >> 2; SRC(0,1)=SRC(2,0)= (l1 + l2 + 1) >> 1; SRC(1,1)=SRC(3,0)= (l1 + 2*l2 + l3 + 2) >> 2; SRC(0,2)=SRC(2,1)=SRC(4,0)= (l2 + l3 + 1) >> 1; SRC(1,2)=SRC(3,1)=SRC(5,0)= (l2 + 2*l3 + l4 + 2) >> 2; SRC(0,3)=SRC(2,2)=SRC(4,1)=SRC(6,0)= (l3 + l4 + 1) >> 1; SRC(1,3)=SRC(3,2)=SRC(5,1)=SRC(7,0)= (l3 + 2*l4 + l5 + 2) >> 2; SRC(0,4)=SRC(2,3)=SRC(4,2)=SRC(6,1)= (l4 + l5 + 1) >> 1; SRC(1,4)=SRC(3,3)=SRC(5,2)=SRC(7,1)= (l4 + 2*l5 + l6 + 2) >> 2; SRC(0,5)=SRC(2,4)=SRC(4,3)=SRC(6,2)= (l5 + l6 + 1) >> 1; SRC(1,5)=SRC(3,4)=SRC(5,3)=SRC(7,2)= (l5 + 2*l6 + l7 + 2) >> 2; SRC(0,6)=SRC(2,5)=SRC(4,4)=SRC(6,3)= (l6 + l7 + 1) >> 1; SRC(1,6)=SRC(3,5)=SRC(5,4)=SRC(7,3)= (l6 + 3*l7 + 2) >> 2; SRC(0,7)=SRC(1,7)=SRC(2,6)=SRC(2,7)=SRC(3,6)= SRC(3,7)=SRC(4,5)=SRC(4,6)=SRC(4,7)=SRC(5,5)= SRC(5,6)=SRC(5,7)=SRC(6,4)=SRC(6,5)=SRC(6,6)= SRC(6,7)=SRC(7,4)=SRC(7,5)=SRC(7,6)=SRC(7,7)= l7; } libavcodec/h264pred.c:971: error: Uninitialized Value The value read from l7 was never initialized. libavcodec/h264pred.c:971:32: 969. SRC(1,4)=SRC(3,3)=SRC(5,2)=SRC(7,1)= (l4 + 2*l5 + l6 + 2) >> 2; 970. SRC(0,5)=SRC(2,4)=SRC(4,3)=SRC(6,2)= (l5 + l6 + 1) >> 1; 971. SRC(1,5)=SRC(3,4)=SRC(5,3)=SRC(7,2)= (l5 + 2*l6 + l7 + 2) >> 2; ^ 972. SRC(0,6)=SRC(2,5)=SRC(4,4)=SRC(6,3)= (l6 + l7 + 1) >> 1; 973. SRC(1,6)=SRC(3,5)=SRC(5,4)=SRC(7,3)= (l6 + 3*l7 + 2) >> 2;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264pred.c/#L971
d2a_code_trace_data_42513
static int opt_vstats(void *optctx, const char *opt, const char *arg) { char filename[40]; time_t today2 = time(NULL); struct tm *today = localtime(&today2); snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, today->tm_sec); return opt_vstats_file(NULL, opt, filename); } avconv_opt.c:1653: error: Null Dereference pointer `today` last assigned on line 1651 could be null and is dereferenced at line 1653, column 69. avconv_opt.c:1647:1: start of procedure opt_vstats() 1645. } 1646. 1647. static int opt_vstats(void *optctx, const char *opt, const char *arg) ^ 1648. { 1649. char filename[40]; avconv_opt.c:1650:5: 1648. { 1649. char filename[40]; 1650. time_t today2 = time(NULL); ^ 1651. struct tm *today = localtime(&today2); 1652. avconv_opt.c:1651:5: 1649. char filename[40]; 1650. time_t today2 = time(NULL); 1651. struct tm *today = localtime(&today2); ^ 1652. 1653. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, avconv_opt.c:1653:5: 1651. struct tm *today = localtime(&today2); 1652. 1653. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 1654. today->tm_sec); 1655. return opt_vstats_file(NULL, opt, filename);
https://github.com/libav/libav/blob/ec36aa69448f20a78d8c4588265022e0b2272ab5/avconv_opt.c/#L1653
d2a_code_trace_data_42514
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:396: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `EC_POINT_mul`. Showing all 29 steps of the trace crypto/ec/ecdsa_ossl.c:387:10: Call 385. } 386. /* u2 = r * w mod q */ 387. if (!BN_mod_mul(u2, sig->r, u2, order, ctx)) { ^ 388. ECerr(EC_F_OSSL_ECDSA_VERIFY_SIG, ERR_R_BN_LIB); 389. goto err; crypto/bn/bn_mod.c:213:10: Call 211. goto err; 212. } 213. if (!BN_nnmod(r, t, m, ctx)) ^ 214. goto err; 215. bn_check_top(r); 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 `dv->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/ec/ecdsa_ossl.c:396:10: Call 394. goto err; 395. } 396. if (!EC_POINT_mul(group, point, u1, pub_key, u2, ctx)) { ^ 397. ECerr(EC_F_OSSL_ECDSA_VERIFY_SIG, ERR_R_EC_LIB); 398. goto err; crypto/ec/ec_lib.c:971:1: Parameter `r->X->top` 969. } 970. 971. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, 972. const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx) 973. { crypto/ec/ec_lib.c:982:12: Call 980. scalars[0] = p_scalar; 981. 982. return EC_POINTs_mul(group, r, g_scalar, ^ 983. (point != NULL 984. && p_scalar != NULL), points, scalars, ctx); crypto/ec/ec_lib.c:933:1: Parameter `r->X->top` 931. */ 932. 933. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 934. size_t num, const EC_POINT *points[], 935. const BIGNUM *scalars[], BN_CTX *ctx) crypto/ec/ec_lib.c:965:15: Call 963. else 964. /* use default */ 965. ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx); ^ 966. 967. BN_CTX_free(new_ctx); crypto/ec/ec_mult.c:410:1: Parameter `r->X->top` 408. * in the addition if scalar != NULL 409. */ 410. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 411. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 412. BN_CTX *ctx) crypto/ec/ec_mult.c:453:20: Call 451. * always call the ladder version. 452. */ 453. return ec_scalar_mul_ladder(group, r, scalar, NULL, ctx); ^ 454. } 455. if ((scalar == NULL) && (num == 1) && (scalars[0] != group->order)) { crypto/ec/ec_mult.c:139:1: Parameter `r->X->top` 137. * Returns 1 on success, 0 otherwise. 138. */ 139. > int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r, 140. const BIGNUM *scalar, const EC_POINT *point, 141. BN_CTX *ctx) crypto/ec/ec_mult.c:253:13: Call 251. || (bn_wexpand(s->Y, group_top) == NULL) 252. || (bn_wexpand(s->Z, group_top) == NULL) 253. || (bn_wexpand(r->X, group_top) == NULL) ^ 254. || (bn_wexpand(r->Y, group_top) == NULL) 255. || (bn_wexpand(r->Z, group_top) == NULL) crypto/bn/bn_lib.c:962:1: Parameter `a->top` 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:964:37: Call 962. BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 965. } 966. 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 `EC_POINT_mul` 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/3051bf2afab7ac8b7b9c64e68755d1addd2fb8ff/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_42515
void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, int dna, int dnb, BN_ULONG *t) { int n = n2 / 2, c1, c2; int tna = n + dna, tnb = n + dnb; unsigned int neg, zero; BN_ULONG ln, lo, *p; # ifdef BN_MUL_COMBA # if 0 if (n2 == 4) { bn_mul_comba4(r, a, b); return; } # endif if (n2 == 8 && dna == 0 && dnb == 0) { bn_mul_comba8(r, a, b); return; } # endif if (n2 < BN_MUL_RECURSIVE_SIZE_NORMAL) { bn_mul_normal(r, a, n2 + dna, b, n2 + dnb); if ((dna + dnb) < 0) memset(&r[2 * n2 + dna + dnb], 0, sizeof(BN_ULONG) * -(dna + dnb)); return; } c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna); c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n); zero = neg = 0; switch (c1 * 3 + c2) { case -4: bn_sub_part_words(t, &(a[n]), a, tna, tna - n); bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); break; case -3: zero = 1; break; case -2: bn_sub_part_words(t, &(a[n]), a, tna, tna - n); bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n); neg = 1; break; case -1: case 0: case 1: zero = 1; break; case 2: bn_sub_part_words(t, a, &(a[n]), tna, n - tna); bn_sub_part_words(&(t[n]), b, &(b[n]), tnb, n - tnb); neg = 1; break; case 3: zero = 1; break; case 4: bn_sub_part_words(t, a, &(a[n]), tna, n - tna); bn_sub_part_words(&(t[n]), &(b[n]), b, tnb, tnb - n); break; } # ifdef BN_MUL_COMBA if (n == 4 && dna == 0 && dnb == 0) { if (!zero) bn_mul_comba4(&(t[n2]), t, &(t[n])); else memset(&t[n2], 0, sizeof(*t) * 8); bn_mul_comba4(r, a, b); bn_mul_comba4(&(r[n2]), &(a[n]), &(b[n])); } else if (n == 8 && dna == 0 && dnb == 0) { if (!zero) bn_mul_comba8(&(t[n2]), t, &(t[n])); else memset(&t[n2], 0, sizeof(*t) * 16); bn_mul_comba8(r, a, b); bn_mul_comba8(&(r[n2]), &(a[n]), &(b[n])); } else # endif { p = &(t[n2 * 2]); if (!zero) bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p); else memset(&t[n2], 0, sizeof(*t) * n2); bn_mul_recursive(r, a, b, n, 0, 0, p); bn_mul_recursive(&(r[n2]), &(a[n]), &(b[n]), n, dna, dnb, p); } c1 = (int)(bn_add_words(t, r, &(r[n2]), n2)); if (neg) { c1 -= (int)(bn_sub_words(&(t[n2]), t, &(t[n2]), n2)); } else { c1 += (int)(bn_add_words(&(t[n2]), &(t[n2]), t, n2)); } c1 += (int)(bn_add_words(&(r[n]), &(r[n]), &(t[n2]), n2)); if (c1) { p = &(r[n + n2]); lo = *p; ln = (lo + c1) & BN_MASK2; *p = ln; if (ln < (BN_ULONG)c1) { do { p++; lo = *p; ln = (lo + 1) & BN_MASK2; *p = ln; } while (ln == 0); } } } crypto/ec/ecdh_ossl.c:136: error: BUFFER_OVERRUN_L3 Offset: [32, +oo] Size: [0, 8388607] by call to `BN_mul`. Showing all 11 steps of the trace crypto/ec/ecdh_ossl.c:135:14: Call 133. 134. if (EC_KEY_get_flags(ecdh) & EC_FLAG_COFACTOR_ECDH) { 135. if (!EC_GROUP_get_cofactor(group, x, NULL) || ^ 136. !BN_mul(x, x, priv_key, ctx)) { 137. ECerr(EC_F_ECDH_SIMPLE_COMPUTE_KEY, ERR_R_MALLOC_FAILURE); crypto/ec/ec_lib.c:380:1: Parameter `cofactor->d` 378. } 379. 380. > int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, 381. BN_CTX *ctx) 382. { crypto/ec/ecdh_ossl.c:136:14: Call 134. if (EC_KEY_get_flags(ecdh) & EC_FLAG_COFACTOR_ECDH) { 135. if (!EC_GROUP_get_cofactor(group, x, NULL) || 136. !BN_mul(x, x, priv_key, ctx)) { ^ 137. ECerr(EC_F_ECDH_SIMPLE_COMPUTE_KEY, ERR_R_MALLOC_FAILURE); 138. goto err; crypto/bn/bn_mul.c:882:1: Parameter `a->top` 880. #endif /* BN_RECURSION */ 881. 882. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 883. { 884. int ret = 0; crypto/bn/bn_mul.c:899:5: Assignment 897. bn_check_top(r); 898. 899. al = a->top; ^ 900. bl = b->top; 901. crypto/bn/bn_mul.c:971:17: Call 969. if (bn_wexpand(rr, k * 2) == NULL) 970. goto err; 971. bn_mul_recursive(rr->d, a->d, b->d, j, al - j, bl - j, t->d); ^ 972. } 973. rr->top = top; crypto/bn/bn_mul.c:386:1: <Offset trace> 384. */ 385. /* dnX may not be positive, but n2/2+dnX has to be */ 386. > void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, 387. int dna, int dnb, BN_ULONG *t) 388. { crypto/bn/bn_mul.c:386:1: Parameter `n2` 384. */ 385. /* dnX may not be positive, but n2/2+dnX has to be */ 386. > void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, 387. int dna, int dnb, BN_ULONG *t) 388. { crypto/bn/bn_mul.c:386:1: <Length trace> 384. */ 385. /* dnX may not be positive, but n2/2+dnX has to be */ 386. > void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, 387. int dna, int dnb, BN_ULONG *t) 388. { crypto/bn/bn_mul.c:386:1: Parameter `*t` 384. */ 385. /* dnX may not be positive, but n2/2+dnX has to be */ 386. > void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, 387. int dna, int dnb, BN_ULONG *t) 388. { crypto/bn/bn_mul.c:477:9: Array access: Offset: [32, +oo] Size: [0, 8388607] by call to `BN_mul` 475. # endif /* BN_MUL_COMBA */ 476. { 477. p = &(t[n2 * 2]); ^ 478. if (!zero) 479. bn_mul_recursive(&(t[n2]), t, &(t[n]), n, 0, 0, p);
https://github.com/openssl/openssl/blob/fdfb8c848679d74fd492e3b306500f2da0570c17/crypto/bn/bn_mul.c/#L477
d2a_code_trace_data_42516
static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr) { register const MPA_INT *w, *w2, *p; int j; OUT_INT *samples2; #if CONFIG_FLOAT float sum, sum2; #elif FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif memcpy(synth_buf + 512, synth_buf, 32 * sizeof(*synth_buf)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(MACS, sum, w, p); p = synth_buf + 48; SUM8(MLSS, 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, MACS, sum2, MLSS, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, MLSS, sum2, MLSS, 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(MLSS, sum, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; } libavcodec/mpc.c:54: error: Buffer Overrun L2 Offset: [81+min(0, `c->synth_buf_offset[*]`), 96+max(511, `c->synth_buf_offset[*]`)] (⇐ [17+min(0, `c->synth_buf_offset[*]`), 32+max(511, `c->synth_buf_offset[*]`)] + 64) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:45:1: Parameter `c->synth_buf[*]` 43. * Process decoded Musepack data and produce PCM 44. */ 45. static void mpc_synth(MPCContext *c, int16_t *out) ^ 46. { 47. int dither_state = 0; libavcodec/mpc.c:54:13: Call 52. samples_ptr = samples + ch; 53. for(i = 0; i < SAMPLES_PER_BAND; i++) { 54. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 55. ff_mpa_synth_window, &dither_state, 56. samples_ptr, 2, libavcodec/mpegaudiodec.c:705:1: Parameter `*synth_buf_ptr` 703. /* XXX: optimize by avoiding ring buffer usage */ 704. #if !CONFIG_FLOAT 705. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 706. MPA_INT *window, int *dither_state, 707. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:718:5: Assignment 716. 717. offset = *synth_buf_offset; 718. synth_buf = synth_buf_ptr + offset; ^ 719. 720. #if FRAC_BITS <= 15 libavcodec/mpegaudiodec.c:731:5: Call 729. #endif 730. 731. apply_window_mp3_c(synth_buf, window, dither_state, samples, incr); ^ 732. 733. offset = (offset - 32) & 511; libavcodec/mpegaudiodec.c:646:1: <Length trace> 644. } 645. 646. static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, ^ 647. int *dither_state, OUT_INT *samples, int incr) 648. { libavcodec/mpegaudiodec.c:646:1: Parameter `*synth_buf` 644. } 645. 646. static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, ^ 647. int *dither_state, OUT_INT *samples, int incr) 648. { libavcodec/mpegaudiodec.c:680:9: Assignment 678. for(j=1;j<16;j++) { 679. sum2 = 0; 680. p = synth_buf + 16 + j; ^ 681. SUM8P2(sum, MACS, sum2, MLSS, w, w2, p); 682. p = synth_buf + 48 - j; libavcodec/mpegaudiodec.c:681:9: Array access: Offset: [81+min(0, c->synth_buf_offset[*]), 96+max(511, c->synth_buf_offset[*])] (⇐ [17+min(0, c->synth_buf_offset[*]), 32+max(511, c->synth_buf_offset[*])] + 64) Size: 2 by call to `ff_mpa_synth_filter` 679. sum2 = 0; 680. p = synth_buf + 16 + j; 681. SUM8P2(sum, MACS, sum2, MLSS, w, w2, p); ^ 682. p = synth_buf + 48 - j; 683. SUM8P2(sum, MLSS, sum2, MLSS, w + 32, w2 + 32, p);
https://github.com/libav/libav/blob/63e8d9760f23a4edf81e9ae58c4f6d3baa6ff4dd/libavcodec/mpegaudiodec.c/#L681
d2a_code_trace_data_42517
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:3699: error: Null Dereference pointer `streamid_map` last assigned on line 3698 could be null and is dereferenced at line 3699, column 5. ffmpeg.c:3681:1: start of procedure opt_streamid() 3679. 3680. /* arg format is "output-stream-index:streamid-value". */ 3681. static int opt_streamid(const char *opt, const char *arg) ^ 3682. { 3683. int idx; ffmpeg.c:3687:5: 3685. char idx_str[16]; 3686. 3687. strncpy(idx_str, arg, sizeof(idx_str)); ^ 3688. idx_str[sizeof(idx_str)-1] = '\0'; 3689. p = strchr(idx_str, ':'); ffmpeg.c:3688:5: 3686. 3687. strncpy(idx_str, arg, sizeof(idx_str)); 3688. idx_str[sizeof(idx_str)-1] = '\0'; ^ 3689. p = strchr(idx_str, ':'); 3690. if (!p) { ffmpeg.c:3689:5: 3687. strncpy(idx_str, arg, sizeof(idx_str)); 3688. idx_str[sizeof(idx_str)-1] = '\0'; 3689. p = strchr(idx_str, ':'); ^ 3690. if (!p) { 3691. fprintf(stderr, ffmpeg.c:3690:10: Taking false branch 3688. idx_str[sizeof(idx_str)-1] = '\0'; 3689. p = strchr(idx_str, ':'); 3690. if (!p) { ^ 3691. fprintf(stderr, 3692. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", ffmpeg.c:3696:5: 3694. ffmpeg_exit(1); 3695. } 3696. *p++ = '\0'; ^ 3697. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); 3698. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); ffmpeg.c:3697:5: Skipping parse_number_or_die(): empty list of specs 3695. } 3696. *p++ = '\0'; 3697. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); ^ 3698. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); 3699. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); ffmpeg.c:3698:5: 3696. *p++ = '\0'; 3697. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); 3698. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); ^ 3699. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); 3700. return 0; ffmpeg.c:576:1: start of procedure grow_array() 574. 575. /* similar to ff_dynarray_add() and av_fast_realloc() */ 576. static void *grow_array(void *array, int elem_size, int *size, int new_size) ^ 577. { 578. if (new_size >= INT_MAX / elem_size) { ffmpeg.c:578:9: Taking false branch 576. static void *grow_array(void *array, int elem_size, int *size, int new_size) 577. { 578. if (new_size >= INT_MAX / elem_size) { ^ 579. fprintf(stderr, "Array too big.\n"); 580. ffmpeg_exit(1); ffmpeg.c:582:9: Taking true branch 580. ffmpeg_exit(1); 581. } 582. if (*size < new_size) { ^ 583. uint8_t *tmp = av_realloc(array, new_size*elem_size); 584. if (!tmp) { ffmpeg.c:583:9: 581. } 582. if (*size < new_size) { 583. uint8_t *tmp = av_realloc(array, new_size*elem_size); ^ 584. if (!tmp) { 585. fprintf(stderr, "Could not alloc buffer.\n"); libavutil/mem.c:119:1: start of procedure av_realloc() 117. } 118. 119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) ^ 120. { 121. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:126:8: Taking true branch 124. 125. /* let's disallow possible ambiguous cases */ 126. if(size > (INT_MAX-16) ) ^ 127. return NULL; 128. libavutil/mem.c:127:9: 125. /* let's disallow possible ambiguous cases */ 126. if(size > (INT_MAX-16) ) 127. return NULL; ^ 128. 129. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:137:1: return from a call to av_realloc 135. return realloc(ptr, size); 136. #endif 137. } ^ 138. 139. void av_free(void *ptr) ffmpeg.c:584:14: Taking true branch 582. if (*size < new_size) { 583. uint8_t *tmp = av_realloc(array, new_size*elem_size); 584. if (!tmp) { ^ 585. fprintf(stderr, "Could not alloc buffer.\n"); 586. ffmpeg_exit(1); ffmpeg.c:585:13: 583. uint8_t *tmp = av_realloc(array, new_size*elem_size); 584. if (!tmp) { 585. fprintf(stderr, "Could not alloc buffer.\n"); ^ 586. ffmpeg_exit(1); 587. } ffmpeg.c:586:13: Skipping ffmpeg_exit(): empty list of specs 584. if (!tmp) { 585. fprintf(stderr, "Could not alloc buffer.\n"); 586. ffmpeg_exit(1); ^ 587. } 588. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); ffmpeg.c:588:9: 586. ffmpeg_exit(1); 587. } 588. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); ^ 589. *size = new_size; 590. return tmp; ffmpeg.c:589:9: 587. } 588. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); 589. *size = new_size; ^ 590. return tmp; 591. } ffmpeg.c:590:9: 588. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); 589. *size = new_size; 590. return tmp; ^ 591. } 592. return array; ffmpeg.c:593:1: return from a call to grow_array 591. } 592. return array; 593. } ^ 594. 595. static void choose_sample_fmt(AVStream *st, AVCodec *codec) ffmpeg.c:3699:5: Skipping parse_number_or_die(): empty list of specs 3697. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); 3698. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); 3699. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); ^ 3700. return 0; 3701. }
https://github.com/libav/libav/blob/87e4d9b252bc6fa3b982f7050013069c9dc3e05b/ffmpeg.c/#L3699
d2a_code_trace_data_42518
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); } apps/s_client.c:1066: error: INTEGER_OVERFLOW_L1 (0 - 1):unsigned64 by call to `SSL_free`. Showing all 15 steps of the trace apps/s_client.c:568:6: Call 566. } 567. 568. ctx=SSL_CTX_new(meth); ^ 569. if (ctx == NULL) 570. { ssl/ssl_lib.c:1403:16: Call 1401. ret->app_verify_cookie_cb=0; 1402. 1403. ret->sessions=lh_new(LHASH_HASH_FN(SSL_SESSION_hash), ^ 1404. LHASH_COMP_FN(SSL_SESSION_cmp)); 1405. if (ret->sessions == NULL) goto err; crypto/lhash/lhash.c:133:2: Assignment 131. ret->up_load=UP_LOAD; 132. ret->down_load=DOWN_LOAD; 133. ret->num_items=0; ^ 134. 135. ret->num_expands=0; apps/s_client.c:1066:19: Call 1064. end: 1065. if(prexit) print_stuff(bio_c_out,con,1); 1066. if (con != NULL) SSL_free(con); ^ 1067. if (con2 != NULL) SSL_free(con2); 1068. if (ctx != NULL) SSL_CTX_free(ctx); ssl/ssl_lib.c:427:1: Parameter `s->ctx->sessions->num_items` 425. } 426. 427. > void SSL_free(SSL *s) 428. { 429. int i; ssl/ssl_lib.c:476:3: Call 474. if (s->session != NULL) 475. { 476. ssl_clear_bad_session(s); ^ 477. SSL_SESSION_free(s->session); 478. } ssl/ssl_sess.c:700:1: Parameter `s->ctx->sessions->num_items` 698. } 699. 700. > int ssl_clear_bad_session(SSL *s) 701. { 702. if ( (s->session != NULL) && ssl/ssl_sess.c:706:3: Call 704. !(SSL_in_init(s) || SSL_in_before(s))) 705. { 706. SSL_CTX_remove_session(s->ctx,s->session); ^ 707. return(1); 708. } 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 - 1):unsigned64 by call to `SSL_free` 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_42519
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:1216: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 1183, column 9 is not reachable after line 1216, column 5. Showing all 162 steps of the trace test/bntest.c:1176:1: start of procedure test_exp() 1174. } 1175. 1176. > int test_exp(BIO *bp, BN_CTX *ctx) 1177. { 1178. BIGNUM *a, *b, *d, *e, *one; test/bntest.c:1181:5: 1179. int i; 1180. 1181. > a = BN_new(); 1182. b = BN_new(); 1183. 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:1182:5: 1180. 1181. a = BN_new(); 1182. > b = BN_new(); 1183. d = BN_new(); 1184. 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:1183:5: 1181. a = BN_new(); 1182. b = BN_new(); 1183. > d = BN_new(); 1184. e = BN_new(); 1185. 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:1184:5: 1182. b = BN_new(); 1183. d = BN_new(); 1184. > e = BN_new(); 1185. one = BN_new(); 1186. 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:1185:5: 1183. d = BN_new(); 1184. e = BN_new(); 1185. > one = BN_new(); 1186. BN_one(one); 1187. 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:1186:5: 1184. e = BN_new(); 1185. one = BN_new(); 1186. > BN_one(one); 1187. 1188. 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:1188:10: 1186. BN_one(one); 1187. 1188. > for (i = 0; i < num2; i++) { 1189. BN_bntest_rand(a, 20 + i * 5, 0, 0); 1190. BN_bntest_rand(b, 2 + i, 0, 0); test/bntest.c:1188:17: Loop condition is false. Leaving loop 1186. BN_one(one); 1187. 1188. for (i = 0; i < num2; i++) { ^ 1189. BN_bntest_rand(a, 20 + i * 5, 0, 0); 1190. BN_bntest_rand(b, 2 + i, 0, 0); test/bntest.c:1214:5: 1212. } 1213. } 1214. > BN_free(a); 1215. BN_free(b); 1216. 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:1215:5: 1213. } 1214. BN_free(a); 1215. > BN_free(b); 1216. BN_free(d); 1217. 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:1216:5: 1214. BN_free(a); 1215. BN_free(b); 1216. > BN_free(d); 1217. BN_free(e); 1218. 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/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L1216
d2a_code_trace_data_42520
static int var_diamond_search(MpegEncContext * s, int *best, int dmin, int src_index, int ref_index, int const penalty_factor, int size, int h, int flags) { MotionEstContext * const c= &s->me; me_cmp_func cmpf, chroma_cmpf; int dia_size; LOAD_COMMON LOAD_COMMON2 int map_generation= c->map_generation; cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; for(dia_size=1; dia_size<=c->dia_size; dia_size++){ int dir, start, end; const int x= best[0]; const int y= best[1]; start= FFMAX(0, y + dia_size - ymax); end = FFMIN(dia_size, xmax - x + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x + dir , y + dia_size - dir); } start= FFMAX(0, x + dia_size - xmax); end = FFMIN(dia_size, y - ymin + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x + dia_size - dir, y - dir ); } start= FFMAX(0, -y + dia_size + ymin ); end = FFMIN(dia_size, x - xmin + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x - dir , y - dia_size + dir); } start= FFMAX(0, -x + dia_size + xmin ); end = FFMIN(dia_size, ymax - y + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x - dia_size + dir, y + dir ); } if(x!=best[0] || y!=best[1]) dia_size=0; #if 0 { int dx, dy, i; static int stats[8*8]; dx= FFABS(x-best[0]); dy= FFABS(y-best[1]); stats[dy*8 + dx] ++; if(256*256*256*64 % (stats[0]+1)==0){ for(i=0; i<64; i++){ if((i&7)==0) printf("\n"); printf("%6d ", stats[i]); } printf("\n"); } } #endif } return dmin; } libavcodec/motion_est_template.c:948: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:948:13: 946. 947. //check(x - dia_size + dir, y + dir,0, a3) 948. CHECK_MV(x - dia_size + dir, y + dir ); ^ 949. } 950.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L948
d2a_code_trace_data_42521
BIGNUM *BN_dup(const BIGNUM *a) { BIGNUM *t; if (a == NULL) return NULL; bn_check_top(a); t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); if (t == NULL) return NULL; if (!BN_copy(t, a)) { BN_free(t); return NULL; } bn_check_top(t); return t; } crypto/bn/bn_lib.c:422: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 418, column 60 is not reachable after line 422, column 9. Showing all 44 steps of the trace crypto/bn/bn_lib.c:410:1: start of procedure BN_dup() 408. } 409. 410. > BIGNUM *BN_dup(const BIGNUM *a) 411. { 412. BIGNUM *t; crypto/bn/bn_lib.c:414:9: Taking false branch 412. BIGNUM *t; 413. 414. if (a == NULL) ^ 415. return NULL; 416. bn_check_top(a); crypto/bn/bn_lib.c:418:9: 416. bn_check_top(a); 417. 418. > t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) 420. return NULL; 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:418:9: Condition is false 416. bn_check_top(a); 417. 418. t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); ^ 419. if (t == NULL) 420. return NULL; 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/bn/bn_lib.c:418:5: 416. bn_check_top(a); 417. 418. > t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:419:9: Taking false branch 417. 418. t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) ^ 420. return NULL; 421. if (!BN_copy(t, a)) { crypto/bn/bn_lib.c:421:10: Taking true branch 419. if (t == NULL) 420. return NULL; 421. if (!BN_copy(t, a)) { ^ 422. BN_free(t); 423. return NULL; crypto/bn/bn_lib.c:422:9: 420. return NULL; 421. if (!BN_copy(t, a)) { 422. > BN_free(t); 423. return NULL; 424. } 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/crypto/bn/bn_lib.c/#L422
d2a_code_trace_data_42522
void ERR_add_error_vdata(int num, va_list args) { int i, n, s; char *str, *p, *a; s = 80; str = OPENSSL_malloc(s + 1); if (str == NULL) return; str[0] = '\0'; n = 0; for (i = 0; i < num; i++) { a = va_arg(args, char *); if (a == NULL) a = "<NULL>"; n += strlen(a); if (n > s) { s = n + 20; p = OPENSSL_realloc(str, s + 1); if (p == NULL) { OPENSSL_free(str); return; } str = p; } OPENSSL_strlcat(str, a, (size_t)s + 1); } ERR_set_error_data(str, ERR_TXT_MALLOCED | ERR_TXT_STRING); } crypto/err/err.c:756: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_malloc()` at line 741, column 11 is not reachable after line 756, column 17. Showing all 38 steps of the trace crypto/err/err.c:735:1: start of procedure ERR_add_error_vdata() 733. } 734. 735. > void ERR_add_error_vdata(int num, va_list args) 736. { 737. int i, n, s; crypto/err/err.c:740:5: 738. char *str, *p, *a; 739. 740. > s = 80; 741. str = OPENSSL_malloc(s + 1); 742. if (str == NULL) crypto/err/err.c:741:5: 739. 740. s = 80; 741. > str = OPENSSL_malloc(s + 1); 742. if (str == NULL) 743. return; 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. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 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/err/err.c:742:9: Taking false branch 740. s = 80; 741. str = OPENSSL_malloc(s + 1); 742. if (str == NULL) ^ 743. return; 744. str[0] = '\0'; crypto/err/err.c:744:5: 742. if (str == NULL) 743. return; 744. > str[0] = '\0'; 745. 746. n = 0; crypto/err/err.c:746:5: 744. str[0] = '\0'; 745. 746. > n = 0; 747. for (i = 0; i < num; i++) { 748. a = va_arg(args, char *); crypto/err/err.c:747:10: 745. 746. n = 0; 747. > for (i = 0; i < num; i++) { 748. a = va_arg(args, char *); 749. if (a == NULL) crypto/err/err.c:747:17: Loop condition is true. Entering loop body 745. 746. n = 0; 747. for (i = 0; i < num; i++) { ^ 748. a = va_arg(args, char *); 749. if (a == NULL) crypto/err/err.c:748:9: 746. n = 0; 747. for (i = 0; i < num; i++) { 748. > a = va_arg(args, char *); 749. if (a == NULL) 750. a = "<NULL>"; crypto/err/err.c:749:13: Taking false branch 747. for (i = 0; i < num; i++) { 748. a = va_arg(args, char *); 749. if (a == NULL) ^ 750. a = "<NULL>"; 751. n += strlen(a); crypto/err/err.c:751:9: 749. if (a == NULL) 750. a = "<NULL>"; 751. > n += strlen(a); 752. if (n > s) { 753. s = n + 20; crypto/err/err.c:752:13: Taking true branch 750. a = "<NULL>"; 751. n += strlen(a); 752. if (n > s) { ^ 753. s = n + 20; 754. p = OPENSSL_realloc(str, s + 1); crypto/err/err.c:753:13: 751. n += strlen(a); 752. if (n > s) { 753. > s = n + 20; 754. p = OPENSSL_realloc(str, s + 1); 755. if (p == NULL) { crypto/err/err.c:754:13: 752. if (n > s) { 753. s = n + 20; 754. > p = OPENSSL_realloc(str, s + 1); 755. if (p == NULL) { 756. OPENSSL_free(str); crypto/mem.c:238:1: start of procedure CRYPTO_realloc() 236. } 237. 238. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 239. { 240. INCREMENT(realloc_count); crypto/mem.c:241:9: Taking true branch 239. { 240. INCREMENT(realloc_count); 241. if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc) ^ 242. return realloc_impl(str, num, file, line); 243. crypto/mem.c:241:33: Taking true branch 239. { 240. INCREMENT(realloc_count); 241. if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc) ^ 242. return realloc_impl(str, num, file, line); 243. crypto/mem.c:242:9: Skipping __function_pointer__(): unresolved function pointer 240. INCREMENT(realloc_count); 241. if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc) 242. return realloc_impl(str, num, file, line); ^ 243. 244. FAILTEST(); crypto/mem.c:266:1: return from a call to CRYPTO_realloc 264. return realloc(str, num); 265. 266. > } 267. 268. void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num, crypto/err/err.c:755:17: Taking true branch 753. s = n + 20; 754. p = OPENSSL_realloc(str, s + 1); 755. if (p == NULL) { ^ 756. OPENSSL_free(str); 757. return; crypto/err/err.c:756:17: 754. p = OPENSSL_realloc(str, s + 1); 755. if (p == NULL) { 756. > OPENSSL_free(str); 757. return; 758. } crypto/mem.c:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:298:30: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); ^ 300. return; 301. } crypto/mem.c:300:9: 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); 300. > return; 301. } 302. crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
https://github.com/openssl/openssl/blob/f770d75b1cac264d6280ec7326277daff6965cbb/crypto/err/err.c/#L756
d2a_code_trace_data_42523
int test_sub(BIO *bp) { BIGNUM *a, *b, *c; int i; a = BN_new(); b = BN_new(); c = BN_new(); for (i = 0; i < num0 + num1; i++) { if (i < num1) { BN_bntest_rand(a, 512, 0, 0); BN_copy(b, a); if (BN_set_bit(a, i) == 0) return (0); BN_add_word(b, i); } else { BN_bntest_rand(b, 400 + i - num1, 0, 0); a->neg = rand_neg(); b->neg = rand_neg(); } BN_sub(c, a, b); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " - "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, c); BIO_puts(bp, "\n"); } BN_add(c, c, b); BN_sub(c, c, a); if (!BN_is_zero(c)) { fprintf(stderr, "Subtract test failed!\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); return (1); } test/bntest.c:434: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 400, column 9 is not reachable after line 434, column 5. Showing all 95 steps of the trace test/bntest.c:394:1: start of procedure test_sub() 392. } 393. 394. > int test_sub(BIO *bp) 395. { 396. BIGNUM *a, *b, *c; test/bntest.c:399:5: 397. int i; 398. 399. > a = BN_new(); 400. b = BN_new(); 401. c = 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:400:5: 398. 399. a = BN_new(); 400. > b = BN_new(); 401. c = BN_new(); 402. 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:401:5: 399. a = BN_new(); 400. b = BN_new(); 401. > c = BN_new(); 402. 403. for (i = 0; i < num0 + num1; i++) { 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:403:10: 401. c = BN_new(); 402. 403. > for (i = 0; i < num0 + num1; i++) { 404. if (i < num1) { 405. BN_bntest_rand(a, 512, 0, 0); test/bntest.c:403:17: Loop condition is false. Leaving loop 401. c = BN_new(); 402. 403. for (i = 0; i < num0 + num1; i++) { ^ 404. if (i < num1) { 405. BN_bntest_rand(a, 512, 0, 0); test/bntest.c:433:5: 431. } 432. } 433. > BN_free(a); 434. BN_free(b); 435. BN_free(c); 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:434:5: 432. } 433. BN_free(a); 434. > BN_free(b); 435. BN_free(c); 436. return (1); 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/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L434
d2a_code_trace_data_42524
void avfilter_unref_buffer(AVFilterBufferRef *ref) { if (!ref) return; if (!(--ref->buf->refcount)) ref->buf->free(ref->buf); if (ref->extended_data != ref->data) av_freep(&ref->extended_data); av_free(ref->video); av_free(ref->audio); av_free(ref); } libavfilter/vf_fps.c:185: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer`. libavfilter/vf_fps.c:185:13: Call 183. av_log(ctx, AV_LOG_WARNING, "Discarding initial frame(s) with no " 184. "timestamp.\n"); 185. avfilter_unref_buffer(buf); ^ 186. s->drop++; 187. } libavfilter/buffer.c:74:1: <LHS trace> 72. } 73. 74. void avfilter_unref_buffer(AVFilterBufferRef *ref) ^ 75. { 76. if (!ref) libavfilter/buffer.c:74:1: Parameter `ref->buf->refcount` 72. } 73. 74. void avfilter_unref_buffer(AVFilterBufferRef *ref) ^ 75. { 76. if (!ref) libavfilter/buffer.c:78:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 76. if (!ref) 77. return; 78. if (!(--ref->buf->refcount)) ^ 79. ref->buf->free(ref->buf); 80. if (ref->extended_data != ref->data)
https://github.com/libav/libav/blob/8ccc1c597534ece9f3710a979b8a3fd6e43220a6/libavfilter/buffer.c/#L78
d2a_code_trace_data_42525
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; } test/servername_test.c:209: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/servername_test.c:191:17: Call 189. TLS1_VERSION, 0, 190. &sctx, &cctx, cert, privkey)) 191. || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, ^ 192. NULL, NULL))) 193. goto end; test/ssltestlib.c:790:15: Call 788. if (*sssl != NULL) 789. serverssl = *sssl; 790. else if (!TEST_ptr(serverssl = SSL_new(serverctx))) ^ 791. goto error; 792. if (*cssl != NULL) ssl/ssl_lib.c:672:1: Parameter `ctx->sessions->num_items` 670. } 671. 672. > SSL *SSL_new(SSL_CTX *ctx) 673. { 674. SSL *s; test/servername_test.c:209:5: Call 207. testresult = 1; 208. end: 209. SSL_free(serverssl); ^ 210. SSL_free(clientssl); 211. SSL_CTX_free(sctx); ssl/ssl_lib.c:1134:1: Parameter `s->session_ctx->sessions->num_items` 1132. } 1133. 1134. > void SSL_free(SSL *s) 1135. { 1136. int i; ssl/ssl_lib.c:1169:9: Call 1167. /* Make the next call work :-) */ 1168. if (s->session != NULL) { 1169. ssl_clear_bad_session(s); ^ 1170. SSL_SESSION_free(s->session); 1171. } ssl/ssl_sess.c:1124:1: Parameter `s->session_ctx->sessions->num_items` 1122. } 1123. 1124. > int ssl_clear_bad_session(SSL *s) 1125. { 1126. if ((s->session != NULL) && ssl/ssl_sess.c:1129:9: Call 1127. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1128. !(SSL_in_init(s) || SSL_in_before(s))) { 1129. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1130. return 1; 1131. } else ssl/ssl_sess.c:742:1: Parameter `ctx->sessions->num_items` 740. } 741. 742. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 743. { 744. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:744:12: Call 742. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 743. { 744. return remove_session_lock(ctx, c, 1); ^ 745. } 746. ssl/ssl_sess.c:747:1: Parameter `ctx->sessions->num_items` 745. } 746. 747. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 748. { 749. SSL_SESSION *r; ssl/ssl_sess.c:757:17: Call 755. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) { 756. ret = 1; 757. r = lh_SSL_SESSION_delete(ctx->sessions, r); ^ 758. SSL_SESSION_list_remove(ctx, r); 759. } ssl/ssl_locl.h:736:1: Parameter `lh->num_items` 734. } TLSEXT_INDEX; 735. 736. > DEFINE_LHASH_OF(SSL_SESSION); 737. /* Needed in ssl_cert.c */ 738. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:736:1: Call 734. } TLSEXT_INDEX; 735. 736. > DEFINE_LHASH_OF(SSL_SESSION); 737. /* Needed in ssl_cert.c */ 738. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:128:1: <LHS trace> 126. } 127. 128. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 129. { 130. unsigned long hash; crypto/lhash/lhash.c:128:1: Parameter `lh->num_items` 126. } 127. 128. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 129. { 130. unsigned long hash; crypto/lhash/lhash.c:148:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free` 146. } 147. 148. lh->num_items--; ^ 149. if ((lh->num_nodes > MIN_NODES) && 150. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/6e94b5aecd619afd25e3dc25902952b1b3194edf/crypto/lhash/lhash.c/#L148
d2a_code_trace_data_42526
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/dsa/dsa_ossl.c:187: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_mul`. Showing all 26 steps of the trace crypto/dsa/dsa_ossl.c:187:7: Call 185. 186. /* Compute s = inv(k) (m + xr) mod q */ 187. if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */ ^ 188. if (!BN_add(s, &xr, &m)) goto err; /* s = m + xr */ 189. if (BN_cmp(s,dsa->q) > 0) crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:198:2: Call 196. ret=1; 197. err: 198. BN_CTX_end(ctx); ^ 199. return(ret); 200. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:191:7: Call 189. if (BN_cmp(s,dsa->q) > 0) 190. if (!BN_sub(s,s,dsa->q)) goto err; 191. if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err; ^ 192. 193. ret=DSA_SIG_new(); crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:198:2: Call 196. ret=1; 197. err: 198. BN_CTX_end(ctx); ^ 199. return(ret); 200. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:187:7: Call 185. 186. /* Compute s = inv(k) (m + xr) mod q */ 187. if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */ ^ 188. if (!BN_add(s, &xr, &m)) goto err; /* s = m + xr */ 189. if (BN_cmp(s,dsa->q) > 0) crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:191:10: Call 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) 191. { if (!BN_sqr(t,a,ctx)) goto err; } ^ 192. else 193. { if (!BN_mul(t,a,b,ctx)) goto err; } crypto/bn/bn_sqr.c:65:1: Parameter `ctx->stack.depth` 63. /* r must not be a */ 64. /* I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 */ 65. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 66. { 67. int max,al; crypto/bn/bn_sqr.c:83:2: Call 81. } 82. 83. BN_CTX_start(ctx); ^ 84. rr=(a != r) ? r : BN_CTX_get(ctx); 85. tmp=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_sqr.c:153:2: Call 151. bn_check_top(rr); 152. bn_check_top(tmp); 153. BN_CTX_end(ctx); ^ 154. return(ret); 155. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:277:21: Call 275. else 276. { 277. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 278. /* Does this stack frame have anything to release? */ 279. if(fp < ctx->used) crypto/bn/bn_ctx.c:351:1: <LHS trace> 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:351:1: Parameter `st->depth` 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_mul` 351. static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; ^ 354. } 355.
https://github.com/openssl/openssl/blob/1588a3cae72e60071f1f8a89dbd1356bc08581fc/crypto/bn/bn_ctx.c/#L353
d2a_code_trace_data_42527
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); } apps/ciphers.c:240: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 16 steps of the trace apps/ciphers.c:180:11: Call 178. } 179. } 180. ssl = SSL_new(ctx); ^ 181. if (ssl == NULL) 182. goto err; ssl/ssl_lib.c:518:1: Parameter `ctx->sessions->num_items` 516. } 517. 518. > SSL *SSL_new(SSL_CTX *ctx) 519. { 520. SSL *s; apps/ciphers.c:240:5: Call 238. sk_SSL_CIPHER_free(sk); 239. SSL_CTX_free(ctx); 240. SSL_free(ssl); ^ 241. return (ret); 242. } ssl/ssl_lib.c:926:1: Parameter `s->initial_ctx->sessions->num_items` 924. } 925. 926. > void SSL_free(SSL *s) 927. { 928. int i; ssl/ssl_lib.c:963:9: Call 961. /* Make the next call work :-) */ 962. if (s->session != NULL) { 963. ssl_clear_bad_session(s); ^ 964. SSL_SESSION_free(s->session); 965. } ssl/ssl_sess.c:986:1: Parameter `s->initial_ctx->sessions->num_items` 984. } 985. 986. > int ssl_clear_bad_session(SSL *s) 987. { 988. if ((s->session != NULL) && ssl/ssl_sess.c:991:9: Call 989. !(s->shutdown & SSL_SENT_SHUTDOWN) && 990. !(SSL_in_init(s) || SSL_in_before(s))) { 991. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 992. return (1); 993. } else ssl/ssl_sess.c:693:1: Parameter `ctx->sessions->num_items` 691. } 692. 693. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 694. { 695. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:695:12: Call 693. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 694. { 695. return remove_session_lock(ctx, c, 1); ^ 696. } 697. ssl/ssl_sess.c:698:1: Parameter `ctx->sessions->num_items` 696. } 697. 698. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 699. { 700. SSL_SESSION *r; ssl/ssl_sess.c:708:17: Call 706. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 707. ret = 1; 708. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 709. SSL_SESSION_list_remove(ctx, c); 710. } 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, +oo] - 1):unsigned64 by call to `SSL_free` 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/2dca984babedf93c560aba54da3f4c9222ee0d12/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_42528
static int def_load_bio(CONF *conf, BIO *in, long *line) { #define CONFBUFSIZE 512 int bufnum = 0, i, ii; BUF_MEM *buff = NULL; char *s, *p, *end; int again; long eline = 0; char btmp[DECIMAL_SIZE(eline) + 1]; CONF_VALUE *v = NULL, *tv; CONF_VALUE *sv = NULL; char *section = NULL, *buf; char *start, *psection, *pname; void *h = (void *)(conf->data); STACK_OF(BIO) *biosk = NULL; #ifndef OPENSSL_NO_POSIX_IO char *dirpath = NULL; OPENSSL_DIR_CTX *dirctx = NULL; #endif if ((buff = BUF_MEM_new()) == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_BUF_LIB); goto err; } section = OPENSSL_strdup("default"); if (section == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } if (_CONF_new_data(conf) == 0) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } sv = _CONF_new_section(conf, section); if (sv == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); goto err; } bufnum = 0; again = 0; for (;;) { if (!BUF_MEM_grow(buff, bufnum + CONFBUFSIZE)) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_BUF_LIB); goto err; } p = &(buff->data[bufnum]); *p = '\0'; read_retry: BIO_gets(in, p, CONFBUFSIZE - 1); p[CONFBUFSIZE - 1] = '\0'; ii = i = strlen(p); if (i == 0 && !again) { BIO *parent; #ifndef OPENSSL_NO_POSIX_IO if (dirctx != NULL) { BIO *next; if ((next = get_next_file(dirpath, &dirctx)) != NULL) { BIO_vfree(in); in = next; goto read_retry; } else { OPENSSL_free(dirpath); dirpath = NULL; } } #endif if ((parent = sk_BIO_pop(biosk)) == NULL) { break; } else { BIO_vfree(in); in = parent; goto read_retry; } } again = 0; while (i > 0) { if ((p[i - 1] != '\r') && (p[i - 1] != '\n')) break; else i--; } if (ii && i == ii) again = 1; else { p[i] = '\0'; eline++; } bufnum += i; v = NULL; if (bufnum >= 1) { p = &(buff->data[bufnum - 1]); if (IS_ESC(conf, p[0]) && ((bufnum <= 1) || !IS_ESC(conf, p[-1]))) { bufnum--; again = 1; } } if (again) continue; bufnum = 0; buf = buff->data; clear_comments(conf, buf); s = eat_ws(conf, buf); if (IS_EOF(conf, *s)) continue; if (*s == '[') { char *ss; s++; start = eat_ws(conf, s); ss = start; again: end = eat_alpha_numeric(conf, ss); p = eat_ws(conf, end); if (*p != ']') { if (*p != '\0' && ss != p) { ss = p; goto again; } CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_MISSING_CLOSE_SQUARE_BRACKET); goto err; } *end = '\0'; if (!str_copy(conf, NULL, &section, start)) goto err; if ((sv = _CONF_get_section(conf, section)) == NULL) sv = _CONF_new_section(conf, section); if (sv == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); goto err; } continue; } else { pname = s; end = eat_alpha_numeric(conf, s); if ((end[0] == ':') && (end[1] == ':')) { *end = '\0'; end += 2; psection = pname; pname = end; end = eat_alpha_numeric(conf, end); } else { psection = section; } p = eat_ws(conf, end); if (strncmp(pname, ".include", 8) == 0 && p != pname + 8) { char *include = NULL; BIO *next; trim_ws(conf, p); if (!str_copy(conf, psection, &include, p)) goto err; #ifndef OPENSSL_NO_POSIX_IO next = process_include(include, &dirctx, &dirpath); if (include != dirpath) { OPENSSL_free(include); } #else next = BIO_new_file(include, "r"); OPENSSL_free(include); #endif if (next != NULL) { if (biosk == NULL) { if ((biosk = sk_BIO_new_null()) == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } } if (!sk_BIO_push(biosk, in)) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } in = next; } continue; } else if (*p != '=') { CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_MISSING_EQUAL_SIGN); goto err; } *end = '\0'; p++; start = eat_ws(conf, p); trim_ws(conf, start); if ((v = OPENSSL_malloc(sizeof(*v))) == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } v->name = OPENSSL_strdup(pname); v->value = NULL; if (v->name == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } if (!str_copy(conf, psection, &(v->value), start)) goto err; if (strcmp(psection, section) != 0) { if ((tv = _CONF_get_section(conf, psection)) == NULL) tv = _CONF_new_section(conf, psection); if (tv == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, CONF_R_UNABLE_TO_CREATE_NEW_SECTION); goto err; } } else tv = sv; if (_CONF_add_string(conf, tv, v) == 0) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } v = NULL; } } BUF_MEM_free(buff); OPENSSL_free(section); sk_BIO_pop_free(biosk, BIO_vfree); return 1; err: BUF_MEM_free(buff); OPENSSL_free(section); sk_BIO_pop_free(biosk, BIO_vfree); #ifndef OPENSSL_NO_POSIX_IO OPENSSL_free(dirpath); if (dirctx != NULL) OPENSSL_DIR_end(&dirctx); #endif if (line != NULL) *line = eline; BIO_snprintf(btmp, sizeof(btmp), "%ld", eline); ERR_add_error_data(2, "line ", btmp); if (h != conf->data) { CONF_free(conf->data); conf->data = NULL; } if (v != NULL) { OPENSSL_free(v->name); OPENSSL_free(v->value); OPENSSL_free(v); } return 0; } crypto/conf/conf_def.c:229: error: BUFFER_OVERRUN_L3 Offset: [511, +oo] (⇐ [0, +oo] + 511) Size: [1, 2147483644]. Showing all 4 steps of the trace crypto/conf/conf_def.c:218:5: <Length trace> 216. } 217. 218. bufnum = 0; ^ 219. again = 0; 220. for (;;) { crypto/conf/conf_def.c:218:5: Assignment 216. } 217. 218. bufnum = 0; ^ 219. again = 0; 220. for (;;) { crypto/conf/conf_def.c:225:9: Assignment 223. goto err; 224. } 225. p = &(buff->data[bufnum]); ^ 226. *p = '\0'; 227. read_retry: crypto/conf/conf_def.c:229:9: Array access: Offset: [511, +oo] (⇐ [0, +oo] + 511) Size: [1, 2147483644] 227. read_retry: 228. BIO_gets(in, p, CONFBUFSIZE - 1); 229. p[CONFBUFSIZE - 1] = '\0'; ^ 230. ii = i = strlen(p); 231. if (i == 0 && !again) {
https://github.com/openssl/openssl/blob/49cd47eaababc8c57871b929080fc1357e2ad7b8/crypto/conf/conf_def.c/#L229
d2a_code_trace_data_42529
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1331: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mul`. Showing all 13 steps of the trace test/bntest.c:1331:10: Call 1329. BN_zero(zero); 1330. 1331. if (!TEST_true(BN_mul(ret, a, b, ctx)) ^ 1332. || !equalBN("A * B", product, ret) 1333. || !TEST_true(BN_div(ret, remainder, product, a, ctx)) crypto/bn/bn_mul.c:497:1: Parameter `ctx->stack.depth` 495. #endif /* BN_RECURSION */ 496. 497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = bn_mul_fixed_top(r, a, b, ctx); crypto/bn/bn_mul.c:499:15: Call 497. int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = bn_mul_fixed_top(r, a, b, ctx); ^ 500. 501. bn_correct_top(r); crypto/bn/bn_mul.c:533:5: Call 531. top = al + bl; 532. 533. BN_CTX_start(ctx); ^ 534. if ((r == a) || (r == b)) { 535. if ((rr = BN_CTX_get(ctx)) == NULL) 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_mul.c:618:5: Call 616. err: 617. bn_check_top(r); 618. BN_CTX_end(ctx); ^ 619. return ret; 620. } 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_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/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_42530
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; bn_check_top(b); 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/sm2/sm2_crypt.c:139: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_priv_rand_range`. Showing all 20 steps of the trace crypto/sm2/sm2_crypt.c:122:9: Call 120. 121. BN_CTX_start(ctx); 122. k = BN_CTX_get(ctx); ^ 123. x1 = BN_CTX_get(ctx); 124. x2 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:364:15: Assignment 362. a->neg = 0; 363. a->d[0] = w; 364. a->top = (w ? 1 : 0); ^ 365. bn_check_top(a); 366. return 1; crypto/bn/bn_lib.c:364:5: Assignment 362. a->neg = 0; 363. a->d[0] = w; 364. a->top = (w ? 1 : 0); ^ 365. bn_check_top(a); 366. return 1; crypto/sm2/sm2_crypt.c:139:5: Call 137. memset(ciphertext_buf, 0, *ciphertext_len); 138. 139. BN_priv_rand_range(k, order); ^ 140. 141. if (EC_POINT_mul(group, kG, k, NULL, NULL, ctx) == 0) crypto/bn/bn_rand.c:182:1: Parameter `*r->d` 180. } 181. 182. > int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) 183. { 184. return bnrand_range(PRIVATE, r, range); crypto/bn/bn_rand.c:184:12: Call 182. int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) 183. { 184. return bnrand_range(PRIVATE, r, range); ^ 185. } 186. crypto/bn/bn_rand.c:113:1: Parameter `*r->d` 111. 112. /* random number r: 0 <= r < range */ 113. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range) 114. { 115. int n; crypto/bn/bn_rand.c:128:9: Call 126. 127. if (n == 1) 128. BN_zero(r); ^ 129. else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) { 130. /* crypto/bn/bn_lib.c:357:1: Parameter `*a->d` 355. } 356. 357. > int BN_set_word(BIGNUM *a, BN_ULONG w) 358. { 359. bn_check_top(a); crypto/bn/bn_lib.c:360:9: Call 358. { 359. bn_check_top(a); 360. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 361. return 0; 362. a->neg = 0; crypto/bn/bn_lcl.h:651:1: Parameter `*a->d` 649. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 650. 651. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 652. { 653. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_lcl.h:659:12: Call 657. return a; 658. 659. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 660. } 661. crypto/bn/bn_lib.c:246:1: Parameter `*b->d` 244. */ 245. 246. > BIGNUM *bn_expand2(BIGNUM *b, int words) 247. { 248. bn_check_top(b); crypto/bn/bn_lib.c:251:23: Call 249. 250. if (words > b->dmax) { 251. BN_ULONG *a = bn_expand_internal(b, words); ^ 252. if (!a) 253. return NULL; crypto/bn/bn_lib.c:208:1: <Offset trace> 206. /* This is used by bn_expand2() */ 207. /* The caller MUST check that words > b->dmax before calling this */ 208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 209. { 210. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:208:1: Parameter `b->top` 206. /* This is used by bn_expand2() */ 207. /* The caller MUST check that words > b->dmax before calling this */ 208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 209. { 210. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:208:1: <Length trace> 206. /* This is used by bn_expand2() */ 207. /* The caller MUST check that words > b->dmax before calling this */ 208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 209. { 210. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:208:1: Parameter `*b->d` 206. /* This is used by bn_expand2() */ 207. /* The caller MUST check that words > b->dmax before calling this */ 208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 209. { 210. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:233:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_priv_rand_range` 231. assert(b->top <= words); 232. if (b->top > 0) 233. memcpy(a, b->d, sizeof(*a) * b->top); ^ 234. 235. return a;
https://github.com/openssl/openssl/blob/440bce8f813fa661437ce52378c3df38e2fd073b/crypto/bn/bn_lib.c/#L233
d2a_code_trace_data_42531
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 (EVP_PKEY_id(k) == EVP_PKEY_EC) { X509err(X509_F_X509_REQ_CHECK_PRIVATE_KEY, ERR_R_EC_LIB); break; } #endif #ifndef OPENSSL_NO_DH if (EVP_PKEY_id(k) == 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:88: error: NULL_DEREFERENCE pointer `xk` last assigned on line 87 could be null and is dereferenced by call to `EVP_PKEY_cmp()` at line 88, column 13. Showing all 22 steps of the trace crypto/x509/x509_req.c:82:1: start of procedure X509_REQ_check_private_key() 80. } 81. 82. > int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) 83. { 84. EVP_PKEY *xk = NULL; crypto/x509/x509_req.c:84:5: 82. int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k) 83. { 84. > EVP_PKEY *xk = NULL; 85. int ok = 0; 86. crypto/x509/x509_req.c:85:5: 83. { 84. EVP_PKEY *xk = NULL; 85. > int ok = 0; 86. 87. xk = X509_REQ_get_pubkey(x); crypto/x509/x509_req.c:87:5: 85. int ok = 0; 86. 87. > xk = X509_REQ_get_pubkey(x); 88. switch (EVP_PKEY_cmp(xk, k)) { 89. case 1: crypto/x509/x509_req.c:63:1: start of procedure X509_REQ_get_pubkey() 61. } 62. 63. > EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req) 64. { 65. if (req == NULL) crypto/x509/x509_req.c:65:9: Taking false branch 63. EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req) 64. { 65. if (req == NULL) ^ 66. return NULL; 67. return X509_PUBKEY_get(req->req_info.pubkey); crypto/x509/x509_req.c:67:5: 65. if (req == NULL) 66. return NULL; 67. > return X509_PUBKEY_get(req->req_info.pubkey); 68. } 69. crypto/x509/x_pubkey.c:170:1: start of procedure X509_PUBKEY_get() 168. } 169. 170. > EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) 171. { 172. EVP_PKEY *ret = X509_PUBKEY_get0(key); crypto/x509/x_pubkey.c:172:5: 170. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) 171. { 172. > EVP_PKEY *ret = X509_PUBKEY_get0(key); 173. if (ret != NULL) 174. EVP_PKEY_up_ref(ret); crypto/x509/x_pubkey.c:142:1: start of procedure X509_PUBKEY_get0() 140. } 141. 142. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 143. { 144. EVP_PKEY *ret = NULL; crypto/x509/x_pubkey.c:144:5: 142. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 143. { 144. > EVP_PKEY *ret = NULL; 145. 146. if (key == NULL || key->public_key == NULL) crypto/x509/x_pubkey.c:146:9: Taking false branch 144. EVP_PKEY *ret = NULL; 145. 146. if (key == NULL || key->public_key == NULL) ^ 147. return NULL; 148. crypto/x509/x_pubkey.c:146:24: Taking true branch 144. EVP_PKEY *ret = NULL; 145. 146. if (key == NULL || key->public_key == NULL) ^ 147. return NULL; 148. crypto/x509/x_pubkey.c:147:9: 145. 146. if (key == NULL || key->public_key == NULL) 147. > return NULL; 148. 149. if (key->pkey != NULL) crypto/x509/x_pubkey.c:168:1: return from a call to X509_PUBKEY_get0 166. 167. return NULL; 168. > } 169. 170. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) crypto/x509/x_pubkey.c:173:9: Taking false branch 171. { 172. EVP_PKEY *ret = X509_PUBKEY_get0(key); 173. if (ret != NULL) ^ 174. EVP_PKEY_up_ref(ret); 175. return ret; crypto/x509/x_pubkey.c:175:5: 173. if (ret != NULL) 174. EVP_PKEY_up_ref(ret); 175. > return ret; 176. } 177. crypto/x509/x_pubkey.c:176:1: return from a call to X509_PUBKEY_get 174. EVP_PKEY_up_ref(ret); 175. return ret; 176. > } 177. 178. /* crypto/x509/x509_req.c:68:1: return from a call to X509_REQ_get_pubkey 66. return NULL; 67. return X509_PUBKEY_get(req->req_info.pubkey); 68. > } 69. 70. EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req) crypto/x509/x509_req.c:88:5: 86. 87. xk = X509_REQ_get_pubkey(x); 88. > switch (EVP_PKEY_cmp(xk, k)) { 89. case 1: 90. ok = 1; crypto/evp/p_lib.c:119:1: start of procedure EVP_PKEY_cmp() 117. } 118. 119. > int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) 120. { 121. if (a->type != b->type) crypto/evp/p_lib.c:121:9: 119. int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) 120. { 121. > if (a->type != b->type) 122. return -1; 123.
https://github.com/openssl/openssl/blob/c3612970465d0a13f2fc5b47bc28ca18516a699d/crypto/x509/x509_req.c/#L88
d2a_code_trace_data_42532
int OPENSSL_SA_set(OPENSSL_SA *sa, size_t posn, void *val) { int i, level = 1; size_t n = posn; void **p; if (sa == NULL) return 0; for (level = 1; level <= SA_BLOCK_MAX_LEVELS; level++) if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0) break; for (;sa->levels < level; sa->levels++) { p = alloc_node(); if (p == NULL) return 0; p[0] = sa->nodes; sa->nodes = p; } if (sa->top < posn) sa->top = posn; p = sa->nodes; for (level = sa->levels - 1; level > 0; level--) { i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK; if (p[i] == NULL && (p[i] = alloc_node()) == NULL) return 0; p = p[i]; } p += posn & SA_BLOCK_MASK; if (val == NULL && *p != NULL) sa->nelem--; else if (val != NULL && *p == NULL) sa->nelem++; *p = val; return 1; } test/sparse_array_test.c:51: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `ossl_sa_char_set`. Showing all 10 steps of the trace test/sparse_array_test.c:51:14: Call 49. 50. for (i = 0; i < OSSL_NELEM(cases); i++) { 51. if (!TEST_true(ossl_sa_char_set(sa, cases[i].n, cases[i].v))) { ^ 52. TEST_note("iteration %zu", i + 1); 53. goto err; test/sparse_array_test.c:28:1: Parameter `sa->nelem` 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) test/sparse_array_test.c:28:1: Call 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) crypto/sparse_array.c:176:1: Parameter `sa->nelem` 174. } 175. 176. > int OPENSSL_SA_set(OPENSSL_SA *sa, size_t posn, void *val) 177. { 178. int i, level = 1; test/sparse_array_test.c:51:14: Call 49. 50. for (i = 0; i < OSSL_NELEM(cases); i++) { 51. if (!TEST_true(ossl_sa_char_set(sa, cases[i].n, cases[i].v))) { ^ 52. TEST_note("iteration %zu", i + 1); 53. goto err; test/sparse_array_test.c:28:1: Parameter `sa->nelem` 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) test/sparse_array_test.c:28:1: Call 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) crypto/sparse_array.c:176:1: <LHS trace> 174. } 175. 176. > int OPENSSL_SA_set(OPENSSL_SA *sa, size_t posn, void *val) 177. { 178. int i, level = 1; crypto/sparse_array.c:176:1: Parameter `sa->nelem` 174. } 175. 176. > int OPENSSL_SA_set(OPENSSL_SA *sa, size_t posn, void *val) 177. { 178. int i, level = 1; crypto/sparse_array.c:208:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ossl_sa_char_set` 206. p += posn & SA_BLOCK_MASK; 207. if (val == NULL && *p != NULL) 208. sa->nelem--; ^ 209. else if (val != NULL && *p == NULL) 210. sa->nelem++;
https://github.com/openssl/openssl/blob/a40f0f6475711f01d32c4cdc39e54311b7e9c876/crypto/sparse_array.c/#L208
d2a_code_trace_data_42533
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } apps/ca.c:1966: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `X509_print`. Showing all 13 steps of the trace apps/ca.c:1966:9: Call 1964. } 1965. if (!notext) 1966. X509_print(bp, x); ^ 1967. PEM_write_bio_X509(bp, x); 1968. } crypto/x509/t_x509.c:92:1: Parameter `*x->cert_info.validity.notAfter->data` 90. #endif 91. 92. > int X509_print(BIO *bp, X509 *x) 93. { 94. return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); crypto/x509/t_x509.c:94:12: Call 92. int X509_print(BIO *bp, X509 *x) 93. { 94. return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); ^ 95. } 96. crypto/x509/t_x509.c:97:1: Parameter `*x->cert_info.validity.notAfter->data` 95. } 96. 97. > int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, 98. unsigned long cflag) 99. { crypto/x509/t_x509.c:187:14: Call 185. if (BIO_write(bp, "\n Not After : ", 25) <= 0) 186. goto err; 187. if (!ASN1_TIME_print(bp, X509_get_notAfter(x))) ^ 188. goto err; 189. if (BIO_write(bp, "\n", 1) <= 0) crypto/asn1/a_time.c:202:1: Parameter `*tm->data` 200. } 201. 202. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) 203. { 204. if (tm->type == V_ASN1_UTCTIME) crypto/asn1/a_time.c:207:16: Call 205. return ASN1_UTCTIME_print(bp, tm); 206. if (tm->type == V_ASN1_GENERALIZEDTIME) 207. return ASN1_GENERALIZEDTIME_print(bp, tm); ^ 208. BIO_write(bp, "Bad time value", 14); 209. return (0); crypto/asn1/a_gentm.c:266:1: <Offset trace> 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:266:1: Parameter `*tm->data` 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:287:5: Assignment 285. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 286. + (v[2] - '0') * 10 + (v[3] - '0'); 287. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 288. if ((M > 12) || (M < 1)) 289. goto err; crypto/asn1/a_gentm.c:261:1: <Length trace> 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:261:1: Array declaration 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:308:20: Array access: Offset: [-529, +oo] Size: 12 by call to `X509_print` 306. 307. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 308. _asn1_mon[M - 1], d, h, m, s, f_len, f, y, ^ 309. (gmt) ? " GMT" : "") <= 0) 310. return (0);
https://github.com/openssl/openssl/blob/01b7851aa27aa144372f5484da916be042d9aa4f/crypto/asn1/a_gentm.c/#L308
d2a_code_trace_data_42534
static int get_certificate_status(const char *serial, CA_DB *db) { char *row[DB_NUMBER], **rrow; int ok = -1, i; size_t serial_len = strlen(serial); for (i = 0; i < DB_NUMBER; i++) row[i] = NULL; row[DB_serial] = app_malloc(serial_len + 2, "row serial#"); if (serial_len % 2) { row[DB_serial][0] = '0'; memcpy(row[DB_serial] + 1, serial, serial_len); row[DB_serial][serial_len + 1] = '\0'; } else { memcpy(row[DB_serial], serial, serial_len); row[DB_serial][serial_len] = '\0'; } make_uppercase(row[DB_serial]); ok = 1; rrow = TXT_DB_get_by_index(db->db, DB_serial, row); if (rrow == NULL) { BIO_printf(bio_err, "Serial %s not present in db.\n", row[DB_serial]); ok = -1; goto end; } else if (rrow[DB_type][0] == DB_TYPE_VAL) { BIO_printf(bio_err, "%s=Valid (%c)\n", row[DB_serial], rrow[DB_type][0]); goto end; } else if (rrow[DB_type][0] == DB_TYPE_REV) { BIO_printf(bio_err, "%s=Revoked (%c)\n", row[DB_serial], rrow[DB_type][0]); goto end; } else if (rrow[DB_type][0] == DB_TYPE_EXP) { BIO_printf(bio_err, "%s=Expired (%c)\n", row[DB_serial], rrow[DB_type][0]); goto end; } else if (rrow[DB_type][0] == DB_TYPE_SUSP) { BIO_printf(bio_err, "%s=Suspended (%c)\n", row[DB_serial], rrow[DB_type][0]); goto end; } else { BIO_printf(bio_err, "%s=Unknown (%c).\n", row[DB_serial], rrow[DB_type][0]); ok = -1; } end: for (i = 0; i < DB_NUMBER; i++) { OPENSSL_free(row[i]); } return ok; } apps/ca.c:2174: error: NULL_DEREFERENCE pointer `row[3]` last assigned on line 2168 could be null and is dereferenced at line 2174, column 9. Showing all 26 steps of the trace apps/ca.c:2157:1: start of procedure get_certificate_status() 2155. } 2156. 2157. > static int get_certificate_status(const char *serial, CA_DB *db) 2158. { 2159. char *row[DB_NUMBER], **rrow; apps/ca.c:2160:5: 2158. { 2159. char *row[DB_NUMBER], **rrow; 2160. > int ok = -1, i; 2161. size_t serial_len = strlen(serial); 2162. apps/ca.c:2161:5: 2159. char *row[DB_NUMBER], **rrow; 2160. int ok = -1, i; 2161. > size_t serial_len = strlen(serial); 2162. 2163. /* Free Resources */ apps/ca.c:2164:10: 2162. 2163. /* Free Resources */ 2164. > for (i = 0; i < DB_NUMBER; i++) 2165. row[i] = NULL; 2166. apps/ca.c:2164:17: Loop condition is true. Entering loop body 2162. 2163. /* Free Resources */ 2164. for (i = 0; i < DB_NUMBER; i++) ^ 2165. row[i] = NULL; 2166. apps/ca.c:2165:9: 2163. /* Free Resources */ 2164. for (i = 0; i < DB_NUMBER; i++) 2165. > row[i] = NULL; 2166. 2167. /* Malloc needed char spaces */ apps/ca.c:2164:32: 2162. 2163. /* Free Resources */ 2164. > for (i = 0; i < DB_NUMBER; i++) 2165. row[i] = NULL; 2166. apps/ca.c:2164:17: Loop condition is false. Leaving loop 2162. 2163. /* Free Resources */ 2164. for (i = 0; i < DB_NUMBER; i++) ^ 2165. row[i] = NULL; 2166. apps/ca.c:2168:5: 2166. 2167. /* Malloc needed char spaces */ 2168. > row[DB_serial] = app_malloc(serial_len + 2, "row serial#"); 2169. 2170. if (serial_len % 2) { 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 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. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 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/ca.c:2170:9: Taking true branch 2168. row[DB_serial] = app_malloc(serial_len + 2, "row serial#"); 2169. 2170. if (serial_len % 2) { ^ 2171. /* 2172. * Set the first char to 0 apps/ca.c:2174:9: 2172. * Set the first char to 0 2173. */ 2174. > row[DB_serial][0] = '0'; 2175. 2176. /* Copy String from serial to row[DB_serial] */
https://github.com/openssl/openssl/blob/ce506d27ab5e7d17dfe3fe649768a0d19b6c86ee/apps/ca.c/#L2174
d2a_code_trace_data_42535
void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) #ifdef OPENSSL_FIPS { fips_cipher_abort(RC2); private_RC2_set_key(key, len, data, bits); } void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) #endif { int i,j; unsigned char *k; RC2_INT *ki; unsigned int c,d; k= (unsigned char *)&(key->data[0]); *k=0; if (len > 128) len=128; if (bits <= 0) bits=1024; if (bits > 1024) bits=1024; for (i=0; i<len; i++) k[i]=data[i]; d=k[len-1]; j=0; for (i=len; i < 128; i++,j++) { d=key_table[(k[j]+d)&0xff]; k[i]=d; } j=(bits+7)>>3; i=128-j; c= (0xff>>(-bits & 0x07)); d=key_table[k[i]&c]; k[i]=d; while (i--) { d=key_table[k[i+j]^d]; k[i]=d; } ki= &(key->data[63]); for (i=127; i>=0; i-=2) *(ki--)=((k[i]<<8)|k[i-1])&0xffff; } apps/speed.c:1243: error: BUFFER_OVERRUN_L2 Offset: [0, 127] Size: 16 by call to `RC2_set_key`. Showing all 7 steps of the trace apps/speed.c:425:2: Array declaration 423. CAST_KEY cast_ks; 424. #endif 425. static const unsigned char key16[16]= ^ 426. {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0, 427. 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; apps/speed.c:1243:2: Call 1241. #endif 1242. #ifndef OPENSSL_NO_RC2 1243. RC2_set_key(&rc2_ks,16,key16,128); ^ 1244. #endif 1245. #ifndef OPENSSL_NO_RC5 crypto/rc2/rc2_skey.c:98:1: <Offset trace> 96. * the same as specifying 1024 for the 'bits' parameter. Bsafe uses 97. * a version where the bits parameter is the same as len*8 */ 98. > void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) 99. #ifdef OPENSSL_FIPS 100. { crypto/rc2/rc2_skey.c:98:1: Parameter `len` 96. * the same as specifying 1024 for the 'bits' parameter. Bsafe uses 97. * a version where the bits parameter is the same as len*8 */ 98. > void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) 99. #ifdef OPENSSL_FIPS 100. { crypto/rc2/rc2_skey.c:98:1: <Length trace> 96. * the same as specifying 1024 for the 'bits' parameter. Bsafe uses 97. * a version where the bits parameter is the same as len*8 */ 98. > void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) 99. #ifdef OPENSSL_FIPS 100. { crypto/rc2/rc2_skey.c:98:1: Parameter `*data` 96. * the same as specifying 1024 for the 'bits' parameter. Bsafe uses 97. * a version where the bits parameter is the same as len*8 */ 98. > void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) 99. #ifdef OPENSSL_FIPS 100. { crypto/rc2/rc2_skey.c:120:8: Array access: Offset: [0, 127] Size: 16 by call to `RC2_set_key` 118. 119. for (i=0; i<len; i++) 120. k[i]=data[i]; ^ 121. 122. /* expand table */
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/rc2/rc2_skey.c/#L120
d2a_code_trace_data_42536
static void contract(OPENSSL_LHASH *lh) { OPENSSL_LH_NODE **n, *n1, *np; np = lh->b[lh->p + lh->pmax - 1]; lh->b[lh->p + lh->pmax - 1] = NULL; if (lh->p == 0) { n = OPENSSL_realloc(lh->b, (unsigned int)(sizeof(OPENSSL_LH_NODE *) * lh->pmax)); if (n == NULL) { lh->error++; return; } lh->num_contract_reallocs++; lh->num_alloc_nodes /= 2; lh->pmax /= 2; lh->p = lh->pmax - 1; lh->b = n; } else lh->p--; lh->num_nodes--; lh->num_contracts++; n1 = lh->b[(int)lh->p]; if (n1 == NULL) lh->b[(int)lh->p] = np; else { while (n1->next != NULL) n1 = n1->next; n1->next = np; } } crypto/property/defn_cache.c:30: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `OPENSSL_LH_delete`. Showing all 10 steps of the trace crypto/property/defn_cache.c:30:1: Parameter `lh->pmax` 28. } PROPERTY_DEFN_ELEM; 29. 30. > DEFINE_LHASH_OF(PROPERTY_DEFN_ELEM); 31. 32. static LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns = NULL; crypto/property/defn_cache.c:30:1: Call 28. } PROPERTY_DEFN_ELEM; 29. 30. > DEFINE_LHASH_OF(PROPERTY_DEFN_ELEM); 31. 32. static LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns = NULL; crypto/lhash/lhash.c:136:1: Parameter `lh->pmax` 134. } 135. 136. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 137. { 138. unsigned long hash; crypto/lhash/lhash.c:159:9: Call 157. if ((lh->num_nodes > MIN_NODES) && 158. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) 159. contract(lh); ^ 160. 161. return ret; crypto/lhash/lhash.c:268:1: <Offset trace> 266. } 267. 268. > static void contract(OPENSSL_LHASH *lh) 269. { 270. OPENSSL_LH_NODE **n, *n1, *np; crypto/lhash/lhash.c:268:1: Parameter `lh->p` 266. } 267. 268. > static void contract(OPENSSL_LHASH *lh) 269. { 270. OPENSSL_LH_NODE **n, *n1, *np; crypto/lhash/lhash.c:288:9: Assignment 286. lh->b = n; 287. } else 288. lh->p--; ^ 289. 290. lh->num_nodes--; crypto/lhash/lhash.c:268:1: <Length trace> 266. } 267. 268. > static void contract(OPENSSL_LHASH *lh) 269. { 270. OPENSSL_LH_NODE **n, *n1, *np; crypto/lhash/lhash.c:268:1: Parameter `*lh->b` 266. } 267. 268. > static void contract(OPENSSL_LHASH *lh) 269. { 270. OPENSSL_LH_NODE **n, *n1, *np; crypto/lhash/lhash.c:293:10: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `OPENSSL_LH_delete` 291. lh->num_contracts++; 292. 293. n1 = lh->b[(int)lh->p]; ^ 294. if (n1 == NULL) 295. lh->b[(int)lh->p] = np;
https://github.com/openssl/openssl/blob/4460ad90af0338abe31286f29b36baf2e41abf19/crypto/lhash/lhash.c/#L293
d2a_code_trace_data_42537
static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) { int i; LHASH_NODE *a,*n; if (lh == NULL) return; for (i=lh->num_nodes-1; i>=0; i--) { a=lh->b[i]; while (a != NULL) { n=a->next; if(use_arg) func_arg(a->data,arg); else func(a->data); a=n; } } } ssl/ssl_lib.c:2378: error: INTEGER_OVERFLOW_L2 ([0, `s->ctx->sessions->num_nodes`] - 1):unsigned32 by call to `SSL_free`. Showing all 15 steps of the trace ssl/ssl_lib.c:2254:1: Parameter `s->ctx->sessions->num_nodes` 2252. } 2253. 2254. > SSL *SSL_dup(SSL *s) 2255. { 2256. STACK_OF(X509_NAME) *sk; ssl/ssl_lib.c:2261:11: Call 2259. int i; 2260. 2261. if ((ret=SSL_new(SSL_get_SSL_CTX(s))) == NULL) ^ 2262. return(NULL); 2263. ssl/ssl_lib.c:264:1: Parameter `ctx->sessions->num_nodes` 262. } 263. 264. > SSL *SSL_new(SSL_CTX *ctx) 265. { 266. SSL *s; ssl/ssl_lib.c:2378:20: Call 2376. { 2377. err: 2378. if (ret != NULL) SSL_free(ret); ^ 2379. ret=NULL; 2380. } ssl/ssl_lib.c:472:1: Parameter `s->initial_ctx->sessions->num_nodes` 470. } 471. 472. > void SSL_free(SSL *s) 473. { 474. int i; ssl/ssl_lib.c:532:22: Call 530. if (s->ctx) SSL_CTX_free(s->ctx); 531. #ifndef OPENSSL_NO_TLSEXT 532. if (s->initial_ctx) SSL_CTX_free(s->initial_ctx); ^ 533. #ifndef OPENSSL_NO_EC 534. if (s->tlsext_ecpointformatlist) OPENSSL_free(s->tlsext_ecpointformatlist); ssl/ssl_lib.c:1563:1: Parameter `a->sessions->num_nodes` 1561. #endif 1562. 1563. > void SSL_CTX_free(SSL_CTX *a) 1564. { 1565. int i; ssl/ssl_lib.c:1595:3: Call 1593. */ 1594. if (a->sessions != NULL) 1595. SSL_CTX_flush_sessions(a,0); ^ 1596. 1597. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); ssl/ssl_sess.c:826:1: Parameter `s->sessions->num_nodes` 824. static IMPLEMENT_LHASH_DOALL_ARG_FN(timeout, SSL_SESSION *, TIMEOUT_PARAM *) 825. 826. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 827. { 828. unsigned long i; ssl/ssl_sess.c:838:2: Call 836. i=tp.cache->down_load; 837. tp.cache->down_load=0; 838. lh_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), &tp); ^ 839. tp.cache->down_load=i; 840. CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX); crypto/lhash/lhash.c:303:1: Parameter `lh->num_nodes` 301. } 302. 303. > void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 304. { 305. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); crypto/lhash/lhash.c:305:2: Call 303. void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 304. { 305. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); ^ 306. } 307. crypto/lhash/lhash.c:270:1: <LHS trace> 268. } 269. 270. > static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:270:1: Parameter `lh->num_nodes` 268. } 269. 270. > static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:281:7: Binary operation: ([0, s->ctx->sessions->num_nodes] - 1):unsigned32 by call to `SSL_free` 279. /* reverse the order so we search from 'top to bottom' 280. * We were having memory leaks otherwise */ 281. for (i=lh->num_nodes-1; i>=0; i--) ^ 282. { 283. a=lh->b[i];
https://github.com/openssl/openssl/blob/02756aa8ba36af6e718d7a07c4e6bd8ad12e7ba1/crypto/lhash/lhash.c/#L281
d2a_code_trace_data_42538
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->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_clnt.c:47: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 12]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 14 steps of the trace ssl/statem/extensions_clnt.c:46:17: Call 44. /* Sub-packet for servername list (always 1 hostname)*/ 45. || !WPACKET_start_sub_packet_u16(pkt) 46. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) ^ 47. || !WPACKET_sub_memcpy_u16(pkt, s->ext.hostname, 48. strlen(s->ext.hostname)) ssl/packet.c:289:1: Parameter `pkt->buf->length` 287. } 288. 289. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 290. { 291. unsigned char *data; ssl/statem/extensions_clnt.c:47:17: Call 45. || !WPACKET_start_sub_packet_u16(pkt) 46. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) 47. || !WPACKET_sub_memcpy_u16(pkt, s->ext.hostname, ^ 48. strlen(s->ext.hostname)) 49. || !WPACKET_close(pkt) ssl/packet.c:345:1: Parameter `pkt->written` 343. } 344. 345. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len, 346. size_t lenbytes) 347. { ssl/packet.c:348:10: Call 346. size_t lenbytes) 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 349. || !WPACKET_memcpy(pkt, src, len) 350. || !WPACKET_close(pkt)) ssl/packet.c:252:1: Parameter `pkt->written` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/packet.c:276:10: Call 274. } 275. 276. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 277. return 0; 278. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */ 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:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 12]):unsigned64 by call to `WPACKET_sub_memcpy__` 47. return 0; 48. 49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 50. size_t newlen; 51. size_t reflen;
https://github.com/openssl/openssl/blob/f61c5ca6ca183bf0a51651857e3efb02a98889ad/ssl/packet.c/#L49
d2a_code_trace_data_42539
static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o) { AVDictionary **meta_in = NULL; AVDictionary **meta_out; int i, ret = 0; char type_in, type_out; const char *istream_spec = NULL, *ostream_spec = NULL; int idx_in = 0, idx_out = 0; parse_meta_type(inspec, &type_in, &idx_in, &istream_spec); parse_meta_type(outspec, &type_out, &idx_out, &ostream_spec); if (type_in == 'g' || type_out == 'g') o->metadata_global_manual = 1; if (type_in == 's' || type_out == 's') o->metadata_streams_manual = 1; if (type_in == 'c' || type_out == 'c') o->metadata_chapters_manual = 1; #define METADATA_CHECK_INDEX(index, nb_elems, desc)\ if ((index) < 0 || (index) >= (nb_elems)) {\ av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\ (desc), (index));\ exit_program(1);\ } #define SET_DICT(type, meta, context, index)\ switch (type) {\ case 'g':\ meta = &context->metadata;\ break;\ case 'c':\ METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\ meta = &context->chapters[index]->metadata;\ break;\ case 'p':\ METADATA_CHECK_INDEX(index, context->nb_programs, "program")\ meta = &context->programs[index]->metadata;\ break;\ }\ SET_DICT(type_in, meta_in, ic, idx_in); SET_DICT(type_out, meta_out, oc, idx_out); if (type_in == 's') { for (i = 0; i < ic->nb_streams; i++) { if ((ret = check_stream_specifier(ic, ic->streams[i], istream_spec)) > 0) { meta_in = &ic->streams[i]->metadata; break; } else if (ret < 0) exit_program(1); } if (!meta_in) { av_log(NULL, AV_LOG_FATAL, "Stream specifier %s does not match any streams.\n", istream_spec); exit_program(1); } } if (type_out == 's') { for (i = 0; i < oc->nb_streams; i++) { if ((ret = check_stream_specifier(oc, oc->streams[i], ostream_spec)) > 0) { meta_out = &oc->streams[i]->metadata; av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE); } else if (ret < 0) exit_program(1); } } else av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE); return 0; } avconv.c:2859: error: Null Dereference pointer `meta_in` last assigned on line 2793 could be null and is dereferenced at line 2859, column 32. avconv.c:2791:1: start of procedure copy_metadata() 2789. } 2790. 2791. static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o) ^ 2792. { 2793. AVDictionary **meta_in = NULL; avconv.c:2793:5: 2791. static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o) 2792. { 2793. AVDictionary **meta_in = NULL; ^ 2794. AVDictionary **meta_out; 2795. int i, ret = 0; avconv.c:2795:5: 2793. AVDictionary **meta_in = NULL; 2794. AVDictionary **meta_out; 2795. int i, ret = 0; ^ 2796. char type_in, type_out; 2797. const char *istream_spec = NULL, *ostream_spec = NULL; avconv.c:2797:5: 2795. int i, ret = 0; 2796. char type_in, type_out; 2797. const char *istream_spec = NULL, *ostream_spec = NULL; ^ 2798. int idx_in = 0, idx_out = 0; 2799. avconv.c:2798:5: 2796. char type_in, type_out; 2797. const char *istream_spec = NULL, *ostream_spec = NULL; 2798. int idx_in = 0, idx_out = 0; ^ 2799. 2800. parse_meta_type(inspec, &type_in, &idx_in, &istream_spec); avconv.c:2800:5: 2798. int idx_in = 0, idx_out = 0; 2799. 2800. parse_meta_type(inspec, &type_in, &idx_in, &istream_spec); ^ 2801. parse_meta_type(outspec, &type_out, &idx_out, &ostream_spec); 2802. avconv.c:2764:1: start of procedure parse_meta_type() 2762. * @param stream_spec for type s, the stream specifier is written here 2763. */ 2764. static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec) ^ 2765. { 2766. if (*arg) { avconv.c:2766:9: Taking true branch 2764. static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec) 2765. { 2766. if (*arg) { ^ 2767. *type = *arg; 2768. switch (*arg) { avconv.c:2767:9: 2765. { 2766. if (*arg) { 2767. *type = *arg; ^ 2768. switch (*arg) { 2769. case 'g': avconv.c:2768:9: 2766. if (*arg) { 2767. *type = *arg; 2768. switch (*arg) { ^ 2769. case 'g': 2770. break; avconv.c:2769:9: Switch condition is false. Skipping switch case 2767. *type = *arg; 2768. switch (*arg) { 2769. case 'g': ^ 2770. break; 2771. case 's': avconv.c:2771:9: Switch condition is false. Skipping switch case 2769. case 'g': 2770. break; 2771. case 's': ^ 2772. if (*(++arg) && *arg != ':') { 2773. av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", arg); avconv.c:2778:9: Switch condition is false. Skipping switch case 2776. *stream_spec = *arg == ':' ? arg + 1 : ""; 2777. break; 2778. case 'c': ^ 2779. case 'p': 2780. if (*(++arg) == ':') avconv.c:2779:9: Switch condition is false. Skipping switch case 2777. break; 2778. case 'c': 2779. case 'p': ^ 2780. if (*(++arg) == ':') 2781. *index = strtol(++arg, NULL, 0); avconv.c:2784:13: Skipping av_log(): empty list of specs 2782. break; 2783. default: 2784. av_log(NULL, AV_LOG_FATAL, "Invalid metadata type %c.\n", *arg); ^ 2785. exit_program(1); 2786. } avconv.c:2785:13: Skipping exit_program(): empty list of specs 2783. default: 2784. av_log(NULL, AV_LOG_FATAL, "Invalid metadata type %c.\n", *arg); 2785. exit_program(1); ^ 2786. } 2787. } else avconv.c:2766:5: 2764. static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec) 2765. { 2766. if (*arg) { ^ 2767. *type = *arg; 2768. switch (*arg) { avconv.c:2789:1: return from a call to parse_meta_type 2787. } else 2788. *type = 'g'; 2789. } ^ 2790. 2791. static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o) avconv.c:2801:5: 2799. 2800. parse_meta_type(inspec, &type_in, &idx_in, &istream_spec); 2801. parse_meta_type(outspec, &type_out, &idx_out, &ostream_spec); ^ 2802. 2803. if (type_in == 'g' || type_out == 'g') avconv.c:2764:1: start of procedure parse_meta_type() 2762. * @param stream_spec for type s, the stream specifier is written here 2763. */ 2764. static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec) ^ 2765. { 2766. if (*arg) { avconv.c:2766:9: Taking true branch 2764. static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec) 2765. { 2766. if (*arg) { ^ 2767. *type = *arg; 2768. switch (*arg) { avconv.c:2767:9: 2765. { 2766. if (*arg) { 2767. *type = *arg; ^ 2768. switch (*arg) { 2769. case 'g': avconv.c:2768:9: 2766. if (*arg) { 2767. *type = *arg; 2768. switch (*arg) { ^ 2769. case 'g': 2770. break; avconv.c:2769:9: Switch condition is false. Skipping switch case 2767. *type = *arg; 2768. switch (*arg) { 2769. case 'g': ^ 2770. break; 2771. case 's': avconv.c:2771:9: Switch condition is false. Skipping switch case 2769. case 'g': 2770. break; 2771. case 's': ^ 2772. if (*(++arg) && *arg != ':') { 2773. av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", arg); avconv.c:2778:9: Switch condition is false. Skipping switch case 2776. *stream_spec = *arg == ':' ? arg + 1 : ""; 2777. break; 2778. case 'c': ^ 2779. case 'p': 2780. if (*(++arg) == ':') avconv.c:2779:9: Switch condition is false. Skipping switch case 2777. break; 2778. case 'c': 2779. case 'p': ^ 2780. if (*(++arg) == ':') 2781. *index = strtol(++arg, NULL, 0); avconv.c:2784:13: Skipping av_log(): empty list of specs 2782. break; 2783. default: 2784. av_log(NULL, AV_LOG_FATAL, "Invalid metadata type %c.\n", *arg); ^ 2785. exit_program(1); 2786. } avconv.c:2785:13: Skipping exit_program(): empty list of specs 2783. default: 2784. av_log(NULL, AV_LOG_FATAL, "Invalid metadata type %c.\n", *arg); 2785. exit_program(1); ^ 2786. } 2787. } else avconv.c:2766:5: 2764. static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec) 2765. { 2766. if (*arg) { ^ 2767. *type = *arg; 2768. switch (*arg) { avconv.c:2789:1: return from a call to parse_meta_type 2787. } else 2788. *type = 'g'; 2789. } ^ 2790. 2791. static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o) avconv.c:2803:9: Taking false branch 2801. parse_meta_type(outspec, &type_out, &idx_out, &ostream_spec); 2802. 2803. if (type_in == 'g' || type_out == 'g') ^ 2804. o->metadata_global_manual = 1; 2805. if (type_in == 's' || type_out == 's') avconv.c:2803:27: Taking false branch 2801. parse_meta_type(outspec, &type_out, &idx_out, &ostream_spec); 2802. 2803. if (type_in == 'g' || type_out == 'g') ^ 2804. o->metadata_global_manual = 1; 2805. if (type_in == 's' || type_out == 's') avconv.c:2805:9: Taking false branch 2803. if (type_in == 'g' || type_out == 'g') 2804. o->metadata_global_manual = 1; 2805. if (type_in == 's' || type_out == 's') ^ 2806. o->metadata_streams_manual = 1; 2807. if (type_in == 'c' || type_out == 'c') avconv.c:2805:27: Taking false branch 2803. if (type_in == 'g' || type_out == 'g') 2804. o->metadata_global_manual = 1; 2805. if (type_in == 's' || type_out == 's') ^ 2806. o->metadata_streams_manual = 1; 2807. if (type_in == 'c' || type_out == 'c') avconv.c:2807:9: Taking false branch 2805. if (type_in == 's' || type_out == 's') 2806. o->metadata_streams_manual = 1; 2807. if (type_in == 'c' || type_out == 'c') ^ 2808. o->metadata_chapters_manual = 1; 2809. avconv.c:2807:27: Taking false branch 2805. if (type_in == 's' || type_out == 's') 2806. o->metadata_streams_manual = 1; 2807. if (type_in == 'c' || type_out == 'c') ^ 2808. o->metadata_chapters_manual = 1; 2809. avconv.c:2832:5: Switch condition is false. Skipping switch case 2830. }\ 2831. 2832. SET_DICT(type_in, meta_in, ic, idx_in); ^ 2833. SET_DICT(type_out, meta_out, oc, idx_out); 2834. avconv.c:2832:5: Switch condition is false. Skipping switch case 2830. }\ 2831. 2832. SET_DICT(type_in, meta_in, ic, idx_in); ^ 2833. SET_DICT(type_out, meta_out, oc, idx_out); 2834. avconv.c:2832:5: Switch condition is false. Skipping switch case 2830. }\ 2831. 2832. SET_DICT(type_in, meta_in, ic, idx_in); ^ 2833. SET_DICT(type_out, meta_out, oc, idx_out); 2834. avconv.c:2833:5: Switch condition is false. Skipping switch case 2831. 2832. SET_DICT(type_in, meta_in, ic, idx_in); 2833. SET_DICT(type_out, meta_out, oc, idx_out); ^ 2834. 2835. /* for input streams choose first matching stream */ avconv.c:2833:5: Switch condition is false. Skipping switch case 2831. 2832. SET_DICT(type_in, meta_in, ic, idx_in); 2833. SET_DICT(type_out, meta_out, oc, idx_out); ^ 2834. 2835. /* for input streams choose first matching stream */ avconv.c:2833:5: Switch condition is false. Skipping switch case 2831. 2832. SET_DICT(type_in, meta_in, ic, idx_in); 2833. SET_DICT(type_out, meta_out, oc, idx_out); ^ 2834. 2835. /* for input streams choose first matching stream */ avconv.c:2836:9: Taking false branch 2834. 2835. /* for input streams choose first matching stream */ 2836. if (type_in == 's') { ^ 2837. for (i = 0; i < ic->nb_streams; i++) { 2838. if ((ret = check_stream_specifier(ic, ic->streams[i], istream_spec)) > 0) { avconv.c:2850:9: Taking false branch 2848. } 2849. 2850. if (type_out == 's') { ^ 2851. for (i = 0; i < oc->nb_streams; i++) { 2852. if ((ret = check_stream_specifier(oc, oc->streams[i], ostream_spec)) > 0) { avconv.c:2859:9: 2857. } 2858. } else 2859. av_dict_copy(meta_out, *meta_in, AV_DICT_DONT_OVERWRITE); ^ 2860. 2861. return 0;
https://github.com/libav/libav/blob/4bf3c8f226252e18de8051fd0d417c1d39857b67/avconv.c/#L2859
d2a_code_trace_data_42540
IMPLEMENT_new_ctx(ofb, OFB, 256) providers/common/ciphers/aes.c:298: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 298 could be null and is dereferenced at line 298, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:298:1: start of procedure aes_256_ofb_newctx() 296. /* OFB */ 297. IMPLEMENT_new_params(ofb, OFB) 298. > IMPLEMENT_new_ctx(ofb, OFB, 256) 299. IMPLEMENT_new_ctx(ofb, OFB, 192) 300. IMPLEMENT_new_ctx(ofb, OFB, 128) 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:298:1: 296. /* OFB */ 297. IMPLEMENT_new_params(ofb, OFB) 298. > IMPLEMENT_new_ctx(ofb, OFB, 256) 299. IMPLEMENT_new_ctx(ofb, OFB, 192) 300. IMPLEMENT_new_ctx(ofb, OFB, 128)
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L298
d2a_code_trace_data_42541
static int do_multi(int multi) { int n; int fd[2]; int *fds; static char sep[]=":"; fds=malloc(multi*sizeof *fds); for(n=0 ; n < multi ; ++n) { pipe(fd); if(fork()) { close(fd[1]); fds[n]=fd[0]; } else { close(fd[0]); close(1); dup(fd[1]); close(fd[1]); mr=1; usertime=0; 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] != '+') { fprintf(stderr,"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)) { 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)) { int k; double d; p=buf+4; k=atoi(sstrsep(&p,sep)); sstrsep(&p,sep); d=atof(sstrsep(&p,sep)); if(n) rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d); else rsa_results[k][0]=d; d=atof(sstrsep(&p,sep)); if(n) rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d); else rsa_results[k][1]=d; } else if(!strncmp(buf,"+F2:",4)) { int k; double d; p=buf+4; k=atoi(sstrsep(&p,sep)); sstrsep(&p,sep); d=atof(sstrsep(&p,sep)); if(n) rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d); else rsa_results[k][0]=d; d=atof(sstrsep(&p,sep)); if(n) rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d); else rsa_results[k][1]=d; } else if(!strncmp(buf,"+F3:",4)) { int k; double d; p=buf+4; k=atoi(sstrsep(&p,sep)); sstrsep(&p,sep); d=atof(sstrsep(&p,sep)); if(n) dsa_results[k][0]=1/(1/dsa_results[k][0]+1/d); else dsa_results[k][0]=d; d=atof(sstrsep(&p,sep)); if(n) dsa_results[k][1]=1/(1/dsa_results[k][1]+1/d); else dsa_results[k][1]=d; } #ifndef OPENSSL_NO_ECDSA else if(!strncmp(buf,"+F4:",4)) { int k; double d; p=buf+4; k=atoi(sstrsep(&p,sep)); sstrsep(&p,sep); d=atof(sstrsep(&p,sep)); if(n) ecdsa_results[k][0]=1/(1/ecdsa_results[k][0]+1/d); else ecdsa_results[k][0]=d; d=atof(sstrsep(&p,sep)); if(n) ecdsa_results[k][1]=1/(1/ecdsa_results[k][1]+1/d); else ecdsa_results[k][1]=d; } #endif #ifndef OPENSSL_NO_ECDH else if(!strncmp(buf,"+F5:",4)) { int k; double d; p=buf+4; k=atoi(sstrsep(&p,sep)); sstrsep(&p,sep); d=atof(sstrsep(&p,sep)); if(n) ecdh_results[k][0]=1/(1/ecdh_results[k][0]+1/d); else ecdh_results[k][0]=d; } #endif else if(!strncmp(buf,"+H:",3)) { } else fprintf(stderr,"Unknown type '%s' from child %d\n",buf,n); } } return 1; } apps/speed.c:2509: error: NULL_DEREFERENCE pointer `fds` last assigned on line 2502 could be null and is dereferenced at line 2509, column 4. Showing all 9 steps of the trace apps/speed.c:2495:1: start of procedure do_multi() 2493. 2494. #ifdef HAVE_FORK 2495. > static int do_multi(int multi) 2496. { 2497. int n; apps/speed.c:2500:2: 2498. int fd[2]; 2499. int *fds; 2500. > static char sep[]=":"; 2501. 2502. fds=malloc(multi*sizeof *fds); apps/speed.c:2502:2: 2500. static char sep[]=":"; 2501. 2502. > fds=malloc(multi*sizeof *fds); 2503. for(n=0 ; n < multi ; ++n) 2504. { apps/speed.c:2503:6: 2501. 2502. fds=malloc(multi*sizeof *fds); 2503. > for(n=0 ; n < multi ; ++n) 2504. { 2505. pipe(fd); apps/speed.c:2503:12: Loop condition is true. Entering loop body 2501. 2502. fds=malloc(multi*sizeof *fds); 2503. for(n=0 ; n < multi ; ++n) ^ 2504. { 2505. pipe(fd); apps/speed.c:2505:3: 2503. for(n=0 ; n < multi ; ++n) 2504. { 2505. > pipe(fd); 2506. if(fork()) 2507. { apps/speed.c:2506:6: Taking true branch 2504. { 2505. pipe(fd); 2506. if(fork()) ^ 2507. { 2508. close(fd[1]); apps/speed.c:2508:4: 2506. if(fork()) 2507. { 2508. > close(fd[1]); 2509. fds[n]=fd[0]; 2510. } apps/speed.c:2509:4: 2507. { 2508. close(fd[1]); 2509. > fds[n]=fd[0]; 2510. } 2511. else
https://github.com/openssl/openssl/blob/03ddbdd9b99ea60d0967b831ffc1fe93ae7f9792/apps/speed.c/#L2509
d2a_code_trace_data_42542
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_lib.c:1044: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 7]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 18 steps of the trace ssl/t1_lib.c:1016:1: Parameter `pkt->written` 1014. } 1015. 1016. > int ssl_add_clienthello_tlsext(SSL *s, WPACKET *pkt, int *al) 1017. { 1018. #ifndef OPENSSL_NO_EC ssl/t1_lib.c:1042:14: Call 1040. /* Add RI if renegotiating */ 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, ssl/packet.c:261:1: Parameter `pkt->written` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; 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:224:1: Parameter `pkt->written` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. 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: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] - [pkt->written, pkt->written + 7]):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/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
d2a_code_trace_data_42543
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:252: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 246, column 9 is not reachable after line 252, column 10. Showing all 105 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: Skipping BN_hex2bn(): empty list of specs 250. ABORT; 251. 252. if (!BN_hex2bn(&p, "17")) ^ 253. ABORT; 254. if (!BN_hex2bn(&a, "1"))
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/ectest.c/#L252
d2a_code_trace_data_42544
void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order) { int i; for(i = 0; i < lp_order; i++) lsp[i] = cos(2.0 * M_PI * lsf[i]); } libavcodec/amrnbdec.c:346: error: Buffer Overrun L2 Offset: [3, 12] (⇐ 3 + [0, 9]) Size: 4 by call to `ff_acelp_lsf2lspd`. libavcodec/amrnbdec.c:319:1: Parameter `p->lsp[*]` 317. * @param p pointer to the AMRContext 318. */ 319. static void lsf2lsp_3(AMRContext *p) ^ 320. { 321. const uint16_t *lsf_param = p->frame.lsf; libavcodec/amrnbdec.c:346:5: Call 344. memcpy(p->prev_lsf_r, lsf_r, LP_FILTER_ORDER * sizeof(*lsf_r)); 345. 346. ff_acelp_lsf2lspd(p->lsp[3], lsf_q, LP_FILTER_ORDER); ^ 347. 348. // interpolate LSP vectors at subframes 1, 2 and 3 libavcodec/lsp.c:68:1: <Offset trace> 66. } 67. 68. void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order) ^ 69. { 70. int i; libavcodec/lsp.c:68:1: Parameter `lp_order` 66. } 67. 68. void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order) ^ 69. { 70. int i; libavcodec/lsp.c:68:1: <Length trace> 66. } 67. 68. void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order) ^ 69. { 70. int i; libavcodec/lsp.c:68:1: Parameter `*lsp` 66. } 67. 68. void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order) ^ 69. { 70. int i; libavcodec/lsp.c:73:9: Array access: Offset: [3, 12] (⇐ 3 + [0, 9]) Size: 4 by call to `ff_acelp_lsf2lspd` 71. 72. for(i = 0; i < lp_order; i++) 73. lsp[i] = cos(2.0 * M_PI * lsf[i]); ^ 74. } 75.
https://github.com/libav/libav/blob/539ff40c2d685508c62f040693df0f0facda39ff/libavcodec/lsp.c/#L73
d2a_code_trace_data_42545
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->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:865: 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:864:17: Call 862. 863. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data_info) 864. || !WPACKET_start_sub_packet_u16(pkt) ^ 865. || !WPACKET_put_bytes_u32(pkt, s->max_early_data) 866. || !WPACKET_close(pkt)) { ssl/packet.c:275:1: Parameter `pkt->buf->length` 273. } 274. 275. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 276. { 277. WPACKET_SUB *sub; ssl/statem/extensions_srvr.c:865:17: Call 863. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_early_data_info) 864. || !WPACKET_start_sub_packet_u16(pkt) 865. || !WPACKET_put_bytes_u32(pkt, s->max_early_data) ^ 866. || !WPACKET_close(pkt)) { 867. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_EARLY_DATA_INFO, ERR_R_INTERNAL_ERROR); ssl/packet.c:312:1: Parameter `pkt->written` 310. } 311. 312. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 313. { 314. unsigned char *data; ssl/packet.c:320:17: Call 318. 319. if (size > sizeof(unsigned int) 320. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 321. || !put_value(data, val, size)) 322. 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:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 6]):unsigned64 by call to `WPACKET_put_bytes__` 47. return 0; 48. 49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 50. size_t newlen; 51. size_t reflen;
https://github.com/openssl/openssl/blob/538bea6c8184670a8d1608ef288a4e1813dcefa6/ssl/packet.c/#L49
d2a_code_trace_data_42546
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); av_exit(1); } if(codec->type != type) { fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name); av_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); av_exit(1); } return codec->id; } ffmpeg.c:3085: error: Null Dereference pointer `codec` last assigned on line 3078 could be null and is dereferenced at line 3085, column 8. ffmpeg.c:3071:1: start of procedure find_codec_or_die() 3069. } 3070. 3071. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict) ^ 3072. { 3073. const char *codec_string = encoder ? "encoder" : "decoder"; ffmpeg.c:3073:32: Condition is true 3071. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict) 3072. { 3073. const char *codec_string = encoder ? "encoder" : "decoder"; ^ 3074. AVCodec *codec; 3075. ffmpeg.c:3073:5: 3071. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict) 3072. { 3073. const char *codec_string = encoder ? "encoder" : "decoder"; ^ 3074. AVCodec *codec; 3075. ffmpeg.c:3076:9: Taking false branch 3074. AVCodec *codec; 3075. 3076. if(!name) ^ 3077. return CODEC_ID_NONE; 3078. codec = encoder ? ffmpeg.c:3078:13: Condition is true 3076. if(!name) 3077. return CODEC_ID_NONE; 3078. codec = encoder ? ^ 3079. avcodec_find_encoder_by_name(name) : 3080. avcodec_find_decoder_by_name(name); ffmpeg.c:3078:5: 3076. if(!name) 3077. return CODEC_ID_NONE; 3078. codec = encoder ? ^ 3079. avcodec_find_encoder_by_name(name) : 3080. avcodec_find_decoder_by_name(name); ffmpeg.c:3081:9: Taking true branch 3079. avcodec_find_encoder_by_name(name) : 3080. avcodec_find_decoder_by_name(name); 3081. if(!codec) { ^ 3082. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name); 3083. av_exit(1); ffmpeg.c:3082:9: 3080. avcodec_find_decoder_by_name(name); 3081. if(!codec) { 3082. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name); ^ 3083. av_exit(1); 3084. } ffmpeg.c:3083:9: Skipping av_exit(): empty list of specs 3081. if(!codec) { 3082. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name); 3083. av_exit(1); ^ 3084. } 3085. if(codec->type != type) { ffmpeg.c:3085:8: 3083. av_exit(1); 3084. } 3085. if(codec->type != type) { ^ 3086. fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name); 3087. av_exit(1);
https://github.com/libav/libav/blob/27241cbffe180fc92f9f519c6ea7957fc4b3b0c9/ffmpeg.c/#L3085
d2a_code_trace_data_42547
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/statem/statem_dtls.c:720: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `dtls1_retrieve_buffered_fragment`. Showing all 15 steps of the trace ssl/statem/statem_dtls.c:708:1: Parameter `s->initial_ctx->sessions->num_items` 706. } 707. 708. > static int dtls_get_reassembled_message(SSL *s, int *errtype, size_t *len) 709. { 710. unsigned char wire[DTLS1_HM_HEADER_LENGTH]; ssl/statem/statem_dtls.c:720:9: Call 718. redo: 719. /* see if we have the required fragment already */ 720. if (dtls1_retrieve_buffered_fragment(s, &frag_len)) { ^ 721. s->init_num = frag_len; 722. *len = frag_len; ssl/statem/statem_dtls.c:443:1: Parameter `s->initial_ctx->sessions->num_items` 441. } 442. 443. > static int dtls1_retrieve_buffered_fragment(SSL *s, size_t *len) 444. { 445. /*- ssl/statem/statem_dtls.c:497:9: Call 495. } 496. 497. ssl3_send_alert(s, SSL3_AL_FATAL, al); ^ 498. s->init_num = 0; 499. return 0; ssl/s3_msg.c:63:1: Parameter `s->initial_ctx->sessions->num_items` 61. } 62. 63. > int ssl3_send_alert(SSL *s, int level, int desc) 64. { 65. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:74:9: Call 72. /* If a fatal one, remove from cache */ 73. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 74. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 75. 76. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:698:1: Parameter `ctx->sessions->num_items` 696. } 697. 698. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 699. { 700. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:700:12: Call 698. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 699. { 700. return remove_session_lock(ctx, c, 1); ^ 701. } 702. ssl/ssl_sess.c:703:1: Parameter `ctx->sessions->num_items` 701. } 702. 703. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 704. { 705. SSL_SESSION *r; ssl/ssl_sess.c:713:17: Call 711. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 712. ret = 1; 713. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 714. SSL_SESSION_list_remove(ctx, c); 715. } ssl/ssl_locl.h:598:1: Parameter `lh->num_items` 596. }; 597. 598. > DEFINE_LHASH_OF(SSL_SESSION); 599. /* Needed in ssl_cert.c */ 600. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:598:1: Call 596. }; 597. 598. > DEFINE_LHASH_OF(SSL_SESSION); 599. /* Needed in ssl_cert.c */ 600. 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 `dtls1_retrieve_buffered_fragment` 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/6438632420cee9821409221ef6717edc5ee408c1/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_42548
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_exp.c:278: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul_reciprocal`. Showing all 30 steps of the trace 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:278:14: Call 276. 277. /* wvalue will be an odd number < 2^window */ 278. if (!BN_mod_mul_reciprocal(r, r, val[wvalue >> 1], &recp, ctx)) ^ 279. goto err; 280. 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:67:18: Call 65. if (y != NULL) { 66. if (x == y) { 67. if (!BN_sqr(a, x, ctx)) ^ 68. goto err; 69. } 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: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.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); 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.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_mul_reciprocal` 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_42549
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/sslapitest.c:3815: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `SSL_set_srp_server_param`. Showing all 15 steps of the trace test/sslapitest.c:3809:12: Call 3807. } 3808. 3809. user = SRP_VBASE_get1_by_user(vbase, username); ^ 3810. if (user == NULL) { 3811. *ad = SSL_AD_INTERNAL_ERROR; crypto/srp/srp_vfy.c:534:16: Call 532. 533. if ((user = find_user(vb, username)) != NULL) 534. return srp_user_pwd_dup(user); ^ 535. 536. if ((vb->seed_key == NULL) || crypto/srp/srp_vfy.c:247:1: Parameter `src->v->top` 245. } 246. 247. > static SRP_user_pwd *srp_user_pwd_dup(SRP_user_pwd *src) 248. { 249. SRP_user_pwd *ret; test/sslapitest.c:3815:9: Call 3813. } 3814. 3815. if (SSL_set_srp_server_param(s, user->N, user->g, user->s, user->v, ^ 3816. user->info) <= 0) { 3817. *ad = SSL_AD_INTERNAL_ERROR; ssl/tls_srp.c:196:1: Parameter `N->top` 194. } 195. 196. > int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g, 197. BIGNUM *sa, BIGNUM *v, char *info) 198. { ssl/tls_srp.c:206:28: Call 204. } 205. } else 206. s->srp_ctx.N = BN_dup(N); ^ 207. } 208. if (g != NULL) { crypto/bn/bn_lib.c:266:1: Parameter `a->top` 264. } 265. 266. > BIGNUM *BN_dup(const BIGNUM *a) 267. { 268. BIGNUM *t; crypto/bn/bn_lib.c:277:10: Call 275. if (t == NULL) 276. return NULL; 277. if (!BN_copy(t, a)) { ^ 278. BN_free(t); 279. return NULL; crypto/bn/bn_lib.c:285:1: <Offset trace> 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); 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_lib.c:285:1: <Length trace> 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_lib.c:285:1: Parameter `*a->d` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_lib.c:291:9: Call 289. if (a == b) 290. return a; 291. if (bn_wexpand(a, b->top) == NULL) ^ 292. return NULL; 293. crypto/bn/bn_lib.c:910:1: Parameter `*a->d` 908. } 909. 910. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 911. { 912. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:295:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `SSL_set_srp_server_param` 293. 294. if (b->top > 0) 295. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); ^ 296. 297. a->top = b->top;
https://github.com/openssl/openssl/blob/a8ca496ddb532d7f7dc356fd2b026697388d2384/crypto/bn/bn_lib.c/#L295
d2a_code_trace_data_42550
int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, const char *dir) { DIR *d; struct dirent *dstruct; int ret = 0; CRYPTO_w_lock(CRYPTO_LOCK_READDIR); d = opendir(dir); if(!d) { SYSerr(SYS_F_OPENDIR, get_last_sys_error()); ERR_add_error_data(3, "opendir('", dir, "')"); SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK, ERR_R_SYS_LIB); goto err; } while((dstruct=readdir(d))) { char buf[1024]; int r; if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf) { SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG); goto err; } r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name); if (r <= 0 || r >= sizeof buf) goto err; if(!SSL_add_file_cert_subjects_to_stack(stack,buf)) goto err; } ret = 1; err: CRYPTO_w_unlock(CRYPTO_LOCK_READDIR); return ret; } ssl/ssl_cert.c:770: error: RESOURCE_LEAK resource acquired by call to `opendir()` at line 745, column 6 is not released after line 770, column 7. Showing all 85 steps of the trace ssl/ssl_cert.c:737:1: start of procedure SSL_add_dir_cert_subjects_to_stack() 735. #ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! */ 736. 737. > int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, 738. const char *dir) 739. { ssl/ssl_cert.c:742:2: 740. DIR *d; 741. struct dirent *dstruct; 742. > int ret = 0; 743. 744. CRYPTO_w_lock(CRYPTO_LOCK_READDIR); ssl/ssl_cert.c:744:2: 742. int ret = 0; 743. 744. > CRYPTO_w_lock(CRYPTO_LOCK_READDIR); 745. d = opendir(dir); 746. crypto/cryptlib.c:379:1: start of procedure CRYPTO_lock() 377. } 378. 379. > void CRYPTO_lock(int mode, int type, const char *file, int line) 380. { 381. #ifdef LOCK_DEBUG crypto/cryptlib.c:404:6: Taking false branch 402. } 403. #endif 404. if (type < 0) ^ 405. { 406. struct CRYPTO_dynlock_value *pointer crypto/cryptlib.c:417:7: Taking true branch 415. } 416. else 417. if (locking_callback != NULL) ^ 418. locking_callback(mode,type,file,line); 419. } crypto/cryptlib.c:418:4: Skipping __function_pointer__(): unresolved function pointer 416. else 417. if (locking_callback != NULL) 418. locking_callback(mode,type,file,line); ^ 419. } 420. crypto/cryptlib.c:404:2: 402. } 403. #endif 404. > if (type < 0) 405. { 406. struct CRYPTO_dynlock_value *pointer crypto/cryptlib.c:419:2: return from a call to CRYPTO_lock 417. if (locking_callback != NULL) 418. locking_callback(mode,type,file,line); 419. } ^ 420. 421. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, ssl/ssl_cert.c:745:2: 743. 744. CRYPTO_w_lock(CRYPTO_LOCK_READDIR); 745. > d = opendir(dir); 746. 747. /* Note that a side effect is that the CAs will be sorted by name */ ssl/ssl_cert.c:748:6: Taking false branch 746. 747. /* Note that a side effect is that the CAs will be sorted by name */ 748. if(!d) ^ 749. { 750. SYSerr(SYS_F_OPENDIR, get_last_sys_error()); ssl/ssl_cert.c:756:9: Loop condition is true. Entering loop body 754. } 755. 756. while((dstruct=readdir(d))) ^ 757. { 758. char buf[1024]; ssl/ssl_cert.c:761:6: Taking false branch 759. int r; 760. 761. if(strlen(dir)+strlen(dstruct->d_name)+2 > sizeof buf) ^ 762. { 763. SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,SSL_R_PATH_TOO_LONG); ssl/ssl_cert.c:767:3: Skipping BIO_snprintf(): empty list of specs 765. } 766. 767. r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name); ^ 768. if (r <= 0 || r >= sizeof buf) 769. goto err; ssl/ssl_cert.c:768:7: Taking false branch 766. 767. r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name); 768. if (r <= 0 || r >= sizeof buf) ^ 769. goto err; 770. if(!SSL_add_file_cert_subjects_to_stack(stack,buf)) ssl/ssl_cert.c:768:17: Taking false branch 766. 767. r = BIO_snprintf(buf,sizeof buf,"%s/%s",dir,dstruct->d_name); 768. if (r <= 0 || r >= sizeof buf) ^ 769. goto err; 770. if(!SSL_add_file_cert_subjects_to_stack(stack,buf)) ssl/ssl_cert.c:770:7: 768. if (r <= 0 || r >= sizeof buf) 769. goto err; 770. > if(!SSL_add_file_cert_subjects_to_stack(stack,buf)) 771. goto err; 772. } ssl/ssl_cert.c:672:1: start of procedure SSL_add_file_cert_subjects_to_stack() 670. */ 671. 672. > int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, 673. const char *file) 674. { ssl/ssl_cert.c:676:2: 674. { 675. BIO *in; 676. > X509 *x=NULL; 677. X509_NAME *xn=NULL; 678. int ret=1; ssl/ssl_cert.c:677:2: 675. BIO *in; 676. X509 *x=NULL; 677. > X509_NAME *xn=NULL; 678. int ret=1; 679. int (*oldcmp)(const X509_NAME * const *a, const X509_NAME * const *b); ssl/ssl_cert.c:678:2: 676. X509 *x=NULL; 677. X509_NAME *xn=NULL; 678. > int ret=1; 679. int (*oldcmp)(const X509_NAME * const *a, const X509_NAME * const *b); 680. ssl/ssl_cert.c:681:2: 679. int (*oldcmp)(const X509_NAME * const *a, const X509_NAME * const *b); 680. 681. > oldcmp=sk_X509_NAME_set_cmp_func(stack,xname_cmp); 682. 683. in=BIO_new(BIO_s_file_internal()); crypto/stack/stack.c:79:1: start of procedure sk_set_cmp_func() 77. #include <errno.h> 78. 79. > int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *,const char * const *))) 80. (const char * const *, const char * const *) 81. { crypto/stack/stack.c:82:2: 80. (const char * const *, const char * const *) 81. { 82. > int (*old)(const char * const *,const char * const *)=sk->comp; 83. 84. if (sk->comp != c) crypto/stack/stack.c:84:6: Taking true branch 82. int (*old)(const char * const *,const char * const *)=sk->comp; 83. 84. if (sk->comp != c) ^ 85. sk->sorted=0; 86. sk->comp=c; crypto/stack/stack.c:85:3: 83. 84. if (sk->comp != c) 85. > sk->sorted=0; 86. sk->comp=c; 87. crypto/stack/stack.c:86:2: 84. if (sk->comp != c) 85. sk->sorted=0; 86. > sk->comp=c; 87. 88. return old; crypto/stack/stack.c:88:2: 86. sk->comp=c; 87. 88. > return old; 89. } 90. crypto/stack/stack.c:89:2: return from a call to sk_set_cmp_func 87. 88. return old; 89. } ^ 90. 91. STACK *sk_dup(STACK *sk) ssl/ssl_cert.c:683:2: 681. oldcmp=sk_X509_NAME_set_cmp_func(stack,xname_cmp); 682. 683. > in=BIO_new(BIO_s_file_internal()); 684. 685. if (in == NULL) crypto/bio/bss_file.c:130:1: start of procedure BIO_s_file() 128. } 129. 130. > BIO_METHOD *BIO_s_file(void) 131. { 132. return(&methods_filep); crypto/bio/bss_file.c:132:2: 130. BIO_METHOD *BIO_s_file(void) 131. { 132. > return(&methods_filep); 133. } 134. crypto/bio/bss_file.c:133:2: return from a call to BIO_s_file 131. { 132. return(&methods_filep); 133. } ^ 134. 135. static int MS_CALLBACK file_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret=NULL; crypto/bio/bio_lib.c:68:2: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret=NULL; 69. 70. ret=(BIO *)OPENSSL_malloc(sizeof(BIO)); crypto/bio/bio_lib.c:70:2: 68. BIO *ret=NULL; 69. 70. > ret=(BIO *)OPENSSL_malloc(sizeof(BIO)); 71. if (ret == NULL) 72. { crypto/mem.c:282:1: start of procedure CRYPTO_malloc() 280. } 281. 282. > void *CRYPTO_malloc(int num, const char *file, int line) 283. { 284. void *ret = NULL; crypto/mem.c:284:2: 282. void *CRYPTO_malloc(int num, const char *file, int line) 283. { 284. > void *ret = NULL; 285. 286. allow_customize = 0; crypto/mem.c:286:2: 284. void *ret = NULL; 285. 286. > allow_customize = 0; 287. if (malloc_debug_func != NULL) 288. { crypto/mem.c:287:6: Taking false branch 285. 286. allow_customize = 0; 287. if (malloc_debug_func != NULL) ^ 288. { 289. allow_customize_debug = 0; crypto/mem.c:292:2: Skipping __function_pointer__(): unresolved function pointer 290. malloc_debug_func(NULL, num, file, line, 0); 291. } 292. ret = malloc_ex_func(num,file,line); ^ 293. #ifdef LEVITTE_DEBUG_MEM 294. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); crypto/mem.c:296:6: Taking false branch 294. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); 295. #endif 296. if (malloc_debug_func != NULL) ^ 297. malloc_debug_func(ret, num, file, line, 1); 298. crypto/mem.c:299:2: 297. malloc_debug_func(ret, num, file, line, 1); 298. 299. > return ret; 300. } 301. crypto/mem.c:300:2: return from a call to CRYPTO_malloc 298. 299. return ret; 300. } ^ 301. 302. void *CRYPTO_realloc(void *str, int num, const char *file, int line) crypto/bio/bio_lib.c:71:6: Taking true branch 69. 70. ret=(BIO *)OPENSSL_malloc(sizeof(BIO)); 71. if (ret == NULL) ^ 72. { 73. BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE); crypto/bio/bio_lib.c:73:3: 71. if (ret == NULL) 72. { 73. > BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE); 74. return(NULL); 75. } crypto/err/err.c:615:1: start of procedure ERR_put_error() 613. /********************************************************/ 614. 615. > void ERR_put_error(int lib, int func, int reason, const char *file, 616. int line) 617. { crypto/err/err.c:639:2: Skipping ERR_get_state(): empty list of specs 637. } 638. #endif 639. es=ERR_get_state(); ^ 640. 641. es->top=(es->top+1)%ERR_NUM_ERRORS; crypto/err/err.c:641:2: 639. es=ERR_get_state(); 640. 641. > es->top=(es->top+1)%ERR_NUM_ERRORS; 642. if (es->top == es->bottom) 643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; crypto/err/err.c:642:6: Taking false branch 640. 641. es->top=(es->top+1)%ERR_NUM_ERRORS; 642. if (es->top == es->bottom) ^ 643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; 644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason); crypto/err/err.c:644:2: 642. if (es->top == es->bottom) 643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; 644. > es->err_buffer[es->top]=ERR_PACK(lib,func,reason); 645. es->err_file[es->top]=file; 646. es->err_line[es->top]=line; crypto/err/err.c:645:2: 643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; 644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason); 645. > es->err_file[es->top]=file; 646. es->err_line[es->top]=line; 647. err_clear_data(es,es->top); crypto/err/err.c:646:2: 644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason); 645. es->err_file[es->top]=file; 646. > es->err_line[es->top]=line; 647. err_clear_data(es,es->top); 648. } crypto/err/err.c:647:2: Taking true branch 645. es->err_file[es->top]=file; 646. es->err_line[es->top]=line; 647. err_clear_data(es,es->top); ^ 648. } 649. crypto/err/err.c:647:2: Taking false branch 645. es->err_file[es->top]=file; 646. es->err_line[es->top]=line; 647. err_clear_data(es,es->top); ^ 648. } 649. crypto/err/err.c:648:2: return from a call to ERR_put_error 646. es->err_line[es->top]=line; 647. err_clear_data(es,es->top); 648. } ^ 649. 650. void ERR_clear_error(void) crypto/bio/bio_lib.c:74:3: 72. { 73. BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE); 74. > return(NULL); 75. } 76. if (!BIO_set(ret,method)) crypto/bio/bio_lib.c:82:2: return from a call to BIO_new 80. } 81. return(ret); 82. } ^ 83. 84. int BIO_set(BIO *bio, BIO_METHOD *method) ssl/ssl_cert.c:685:6: Taking true branch 683. in=BIO_new(BIO_s_file_internal()); 684. 685. if (in == NULL) ^ 686. { 687. SSLerr(SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK,ERR_R_MALLOC_FAILURE); ssl/ssl_cert.c:687:3: 685. if (in == NULL) 686. { 687. > SSLerr(SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK,ERR_R_MALLOC_FAILURE); 688. goto err; 689. } crypto/err/err.c:615:1: start of procedure ERR_put_error() 613. /********************************************************/ 614. 615. > void ERR_put_error(int lib, int func, int reason, const char *file, 616. int line) 617. { crypto/err/err.c:639:2: Skipping ERR_get_state(): empty list of specs 637. } 638. #endif 639. es=ERR_get_state(); ^ 640. 641. es->top=(es->top+1)%ERR_NUM_ERRORS; crypto/err/err.c:641:2: 639. es=ERR_get_state(); 640. 641. > es->top=(es->top+1)%ERR_NUM_ERRORS; 642. if (es->top == es->bottom) 643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; crypto/err/err.c:642:6: Taking false branch 640. 641. es->top=(es->top+1)%ERR_NUM_ERRORS; 642. if (es->top == es->bottom) ^ 643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; 644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason); crypto/err/err.c:644:2: 642. if (es->top == es->bottom) 643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; 644. > es->err_buffer[es->top]=ERR_PACK(lib,func,reason); 645. es->err_file[es->top]=file; 646. es->err_line[es->top]=line; crypto/err/err.c:645:2: 643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS; 644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason); 645. > es->err_file[es->top]=file; 646. es->err_line[es->top]=line; 647. err_clear_data(es,es->top); crypto/err/err.c:646:2: 644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason); 645. es->err_file[es->top]=file; 646. > es->err_line[es->top]=line; 647. err_clear_data(es,es->top); 648. } crypto/err/err.c:647:2: Taking true branch 645. es->err_file[es->top]=file; 646. es->err_line[es->top]=line; 647. err_clear_data(es,es->top); ^ 648. } 649. crypto/err/err.c:647:2: Taking false branch 645. es->err_file[es->top]=file; 646. es->err_line[es->top]=line; 647. err_clear_data(es,es->top); ^ 648. } 649. crypto/err/err.c:648:2: return from a call to ERR_put_error 646. es->err_line[es->top]=line; 647. err_clear_data(es,es->top); 648. } ^ 649. 650. void ERR_clear_error(void) ssl/ssl_cert.c:709:1: 707. if (0) 708. { 709. > err: 710. ret=0; 711. } ssl/ssl_cert.c:710:3: 708. { 709. err: 710. > ret=0; 711. } 712. if(in != NULL) ssl/ssl_cert.c:712:5: Taking false branch 710. ret=0; 711. } 712. if(in != NULL) ^ 713. BIO_free(in); 714. if(x != NULL) ssl/ssl_cert.c:714:5: Taking false branch 712. if(in != NULL) 713. BIO_free(in); 714. if(x != NULL) ^ 715. X509_free(x); 716. ssl/ssl_cert.c:717:2: 715. X509_free(x); 716. 717. > sk_X509_NAME_set_cmp_func(stack,oldcmp); 718. 719. return ret; crypto/stack/stack.c:79:1: start of procedure sk_set_cmp_func() 77. #include <errno.h> 78. 79. > int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *,const char * const *))) 80. (const char * const *, const char * const *) 81. { crypto/stack/stack.c:82:2: 80. (const char * const *, const char * const *) 81. { 82. > int (*old)(const char * const *,const char * const *)=sk->comp; 83. 84. if (sk->comp != c) crypto/stack/stack.c:84:6: Taking true branch 82. int (*old)(const char * const *,const char * const *)=sk->comp; 83. 84. if (sk->comp != c) ^ 85. sk->sorted=0; 86. sk->comp=c; crypto/stack/stack.c:85:3: 83. 84. if (sk->comp != c) 85. > sk->sorted=0; 86. sk->comp=c; 87. crypto/stack/stack.c:86:2: 84. if (sk->comp != c) 85. sk->sorted=0; 86. > sk->comp=c; 87. 88. return old; crypto/stack/stack.c:88:2: 86. sk->comp=c; 87. 88. > return old; 89. } 90. crypto/stack/stack.c:89:2: return from a call to sk_set_cmp_func 87. 88. return old; 89. } ^ 90. 91. STACK *sk_dup(STACK *sk) ssl/ssl_cert.c:719:2: 717. sk_X509_NAME_set_cmp_func(stack,oldcmp); 718. 719. > return ret; 720. } 721. ssl/ssl_cert.c:720:2: return from a call to SSL_add_file_cert_subjects_to_stack 718. 719. return ret; 720. } ^ 721. 722. /*! ssl/ssl_cert.c:770:7: Taking true branch 768. if (r <= 0 || r >= sizeof buf) 769. goto err; 770. if(!SSL_add_file_cert_subjects_to_stack(stack,buf)) ^ 771. goto err; 772. }
https://github.com/openssl/openssl/blob/4bf4bc784f12bcdc3a3e772f85f6d33f5eccdab3/ssl/ssl_cert.c/#L770
d2a_code_trace_data_42551
uint32_t ngx_utf8_decode(u_char **p, size_t n) { size_t len; uint32_t u, i, valid; u = **p; if (u > 0xf0) { u &= 0x07; valid = 0xffff; len = 3; } else if (u > 0xe0) { u &= 0x0f; valid = 0x7ff; len = 2; } else if (u > 0xc0) { u &= 0x1f; valid = 0x7f; len = 1; } else { (*p)++; return 0xffffffff; } if (n - 1 < len) { return 0xfffffffe; } (*p)++; while (len) { i = *(*p)++; if (i < 0x80) { return 0xffffffff; } u = (u << 6) | (i & 0x3f); len--; } if (u > valid) { return u; } return 0xffffffff; } src/http/modules/ngx_http_charset_filter_module.c:653: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64 by call to `ngx_utf8_decode`. src/http/modules/ngx_http_charset_filter_module.c:608:1: Parameter `*buf->last` 606. 607. 608. static ngx_chain_t * ^ 609. ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf, 610. ngx_http_charset_ctx_t *ctx) src/http/modules/ngx_http_charset_filter_module.c:650:17: Assignment 648. out->next = NULL; 649. 650. size = buf->last - src; ^ 651. 652. saved = src; src/http/modules/ngx_http_charset_filter_module.c:653:21: Call 651. 652. saved = src; 653. n = ngx_utf8_decode(&saved, size); ^ 654. 655. if (n == 0xfffffffe) { src/core/ngx_string.c:1081:1: <LHS trace> 1079. */ 1080. 1081. uint32_t ^ 1082. ngx_utf8_decode(u_char **p, size_t n) 1083. { src/core/ngx_string.c:1081:1: Parameter `n` 1079. */ 1080. 1081. uint32_t ^ 1082. ngx_utf8_decode(u_char **p, size_t n) 1083. { src/core/ngx_string.c:1112:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_utf8_decode` 1110. } 1111. 1112. if (n - 1 < len) { ^ 1113. return 0xfffffffe; 1114. }
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L1112
d2a_code_trace_data_42552
static ngx_int_t ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) { #if (NGX_HAVE_UNIX_DOMAIN) u_char *path, *uri, *last; size_t len; struct sockaddr_un *saun; len = u->url.len; path = u->url.data; path += 5; len -= 5; if (u->uri_part) { last = path + len; uri = ngx_strlchr(path, last, ':'); if (uri) { len = uri - path; uri++; u->uri.len = last - uri; u->uri.data = uri; } } if (len == 0) { u->err = "no path in the unix domain socket"; return NGX_ERROR; } u->host.len = len++; u->host.data = path; if (len > sizeof(saun->sun_path)) { u->err = "too long path in the unix domain socket"; return NGX_ERROR; } u->socklen = sizeof(struct sockaddr_un); saun = (struct sockaddr_un *) &u->sockaddr; saun->sun_family = AF_UNIX; (void) ngx_cpystrn((u_char *) saun->sun_path, path, len); u->addrs = ngx_pcalloc(pool, sizeof(ngx_peer_addr_t)); if (u->addrs == NULL) { return NGX_ERROR; } saun = ngx_pcalloc(pool, sizeof(struct sockaddr_un)); if (saun == NULL) { return NGX_ERROR; } u->family = AF_UNIX; u->naddrs = 1; saun->sun_family = AF_UNIX; (void) ngx_cpystrn((u_char *) saun->sun_path, path, len); u->addrs[0].sockaddr = (struct sockaddr *) saun; u->addrs[0].socklen = sizeof(struct sockaddr_un); u->addrs[0].name.len = len + 4; u->addrs[0].name.data = u->url.data; return NGX_OK; #else u->err = "the unix domain sockets are not supported on this platform"; return NGX_ERROR; #endif } src/http/modules/ngx_http_fastcgi_module.c:602: error: Integer Overflow L2 ([0, +oo] - 5):unsigned64 by call to `ngx_parse_url`. src/http/modules/ngx_http_fastcgi_module.c:593:9: Call 591. ngx_memzero(&u, sizeof(ngx_url_t)); 592. 593. if (ngx_http_script_run(r, &u.url, flcf->fastcgi_lengths->elts, 0, ^ 594. flcf->fastcgi_values->elts) 595. == NULL) src/http/ngx_http_script.c:384:1: Parameter `len` 382. 383. 384. u_char * ^ 385. ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value, 386. void *code_lengths, size_t len, void *code_values) src/http/ngx_http_script.c:415:5: Assignment 413. 414. 415. value->len = len; ^ 416. value->data = ngx_pnalloc(r->pool, len); 417. if (value->data == NULL) { src/http/modules/ngx_http_fastcgi_module.c:602:9: Call 600. u.no_resolve = 1; 601. 602. if (ngx_parse_url(r->pool, &u) != NGX_OK) { ^ 603. if (u.err) { 604. ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, src/core/ngx_inet.c:285:1: Parameter `u->url.len` 283. 284. 285. ngx_int_t ^ 286. ngx_parse_url(ngx_pool_t *pool, ngx_url_t *u) 287. { src/core/ngx_inet.c:293:16: Call 291. 292. if (ngx_strncasecmp(p, (u_char *) "unix:", 5) == 0) { 293. return ngx_parse_unix_domain_url(pool, u); ^ 294. } 295. src/core/ngx_inet.c:309:1: <LHS trace> 307. 308. 309. static ngx_int_t ^ 310. ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) 311. { src/core/ngx_inet.c:309:1: Parameter `u->url.len` 307. 308. 309. static ngx_int_t ^ 310. ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) 311. { src/core/ngx_inet.c:317:5: Assignment 315. struct sockaddr_un *saun; 316. 317. len = u->url.len; ^ 318. path = u->url.data; 319. src/core/ngx_inet.c:321:5: Binary operation: ([0, +oo] - 5):unsigned64 by call to `ngx_parse_url` 319. 320. path += 5; 321. len -= 5; ^ 322. 323. if (u->uri_part) {
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_inet.c/#L321
d2a_code_trace_data_42553
static void dequant_lsps(double *lsps, int num, const uint16_t *values, const uint16_t *sizes, int n_stages, const uint8_t *table, const double *mul_q, const double *base_q) { int n, m; memset(lsps, 0, num * sizeof(*lsps)); for (n = 0; n < n_stages; n++) { const uint8_t *t_off = &table[values[n] * num]; double base = base_q[n], mul = mul_q[n]; for (m = 0; m < num; m++) lsps[m] += base + mul * t_off[m]; table += sizes[n] * num; } } libavcodec/wmavoice.c:1791: error: Buffer Overrun L1 Offset: [12, 17] (⇐ 12 + [0, 5]) Size: 3 by call to `dequant_lsp16r`. libavcodec/wmavoice.c:1734:1: Array declaration 1732. * fully parse the superframe 1733. */ 1734. static int synth_superframe(AVCodecContext *ctx, AVFrame *frame, ^ 1735. int *got_frame_ptr) 1736. { libavcodec/wmavoice.c:1791:13: Call 1789. dequant_lsp10r(gb, lsps[2], prev_lsps, a1, a2, s->lsp_q_mode); 1790. } else /* s->lsps == 16 */ 1791. dequant_lsp16r(gb, lsps[2], prev_lsps, a1, a2, s->lsp_q_mode); ^ 1792. 1793. for (n = 0; n < s->lsps; n++) { libavcodec/wmavoice.c:950:1: Parameter `*i_lsps` 948. * generate LSPs for the other frames from them (residual coding). 949. */ 950. static void dequant_lsp16r(GetBitContext *gb, ^ 951. double *i_lsps, const double *old, 952. double *a1, double *a2, int q_mode) libavcodec/wmavoice.c:966:5: Call 964. int n; 965. 966. dequant_lsp16i(gb, i_lsps); ^ 967. 968. interpol = get_bits(gb, 5); libavcodec/wmavoice.c:917:1: Parameter `*lsps` 915. * Parse 16 independently-coded LSPs. 916. */ 917. static void dequant_lsp16i(GetBitContext *gb, double *lsps) ^ 918. { 919. static const uint16_t vec_sizes[5] = { 256, 64, 128, 64, 128 }; libavcodec/wmavoice.c:942:5: Call 940. dequant_lsps(&lsps[5], 5, &v[2], &vec_sizes[2], 2, 941. wmavoice_dq_lsp16i2, &mul_lsf[2], &base_lsf[2]); 942. dequant_lsps(&lsps[10], 6, &v[4], &vec_sizes[4], 1, ^ 943. wmavoice_dq_lsp16i3, &mul_lsf[4], &base_lsf[4]); 944. } libavcodec/wmavoice.c:823:1: <Offset trace> 821. * @param base_q base (lowest) LSF values 822. */ 823. static void dequant_lsps(double *lsps, int num, ^ 824. const uint16_t *values, 825. const uint16_t *sizes, libavcodec/wmavoice.c:823:1: Parameter `num` 821. * @param base_q base (lowest) LSF values 822. */ 823. static void dequant_lsps(double *lsps, int num, ^ 824. const uint16_t *values, 825. const uint16_t *sizes, libavcodec/wmavoice.c:823:1: <Length trace> 821. * @param base_q base (lowest) LSF values 822. */ 823. static void dequant_lsps(double *lsps, int num, ^ 824. const uint16_t *values, 825. const uint16_t *sizes, libavcodec/wmavoice.c:823:1: Parameter `*lsps` 821. * @param base_q base (lowest) LSF values 822. */ 823. static void dequant_lsps(double *lsps, int num, ^ 824. const uint16_t *values, 825. const uint16_t *sizes, libavcodec/wmavoice.c:838:13: Array access: Offset: [12, 17] (⇐ 12 + [0, 5]) Size: 3 by call to `dequant_lsp16r` 836. 837. for (m = 0; m < num; m++) 838. lsps[m] += base + mul * t_off[m]; ^ 839. 840. table += sizes[n] * num;
https://github.com/libav/libav/blob/c6507946d428ee082676d5917fbb3eb0d1d7eb2e/libavcodec/wmavoice.c/#L838