id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_44354
static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) { const tls_curve_info *cinfo; if (curve[0]) return 1; if ((curve[1] < 1) || ((size_t)curve[1] > sizeof(nid_list) / sizeof(nid_list[0]))) return 0; cinfo = &nid_list[curve[1] - 1]; # ifdef OPENSSL_NO_EC2M if (cinfo->flags & TLS_CURVE_CHAR2) return 0; # endif return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve); } ssl/t1_lib.c:1278: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: 28 by call to `tls_curve_allowed`. Showing all 7 steps of the trace ssl/t1_lib.c:1109:1: Parameter `*s->session->tlsext_ellipticcurvelist` 1107. } 1108. 1109. > unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, 1110. unsigned char *limit, int *al) 1111. { ssl/t1_lib.c:1278:17: Call 1276. /* Copy curve ID if supported */ 1277. for (i = 0; i < num_curves; i++, pcurves += 2) { 1278. if (tls_curve_allowed(s, pcurves, SSL_SECOP_CURVE_SUPPORTED)) { ^ 1279. *etmp++ = pcurves[0]; 1280. *etmp++ = pcurves[1]; ssl/t1_lib.c:442:1: <Offset trace> 440. 441. /* See if curve is allowed by security callback */ 442. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 443. { 444. const tls_curve_info *cinfo; ssl/t1_lib.c:442:1: Parameter `*curve` 440. 441. /* See if curve is allowed by security callback */ 442. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 443. { 444. const tls_curve_info *cinfo; ssl/t1_lib.c:236:1: <Length trace> 234. # define TLS_CURVE_PRIME 0x0 235. 236. > static const tls_curve_info nid_list[] = { 237. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */ 238. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */ ssl/t1_lib.c:236:1: Array declaration 234. # define TLS_CURVE_PRIME 0x0 235. 236. > static const tls_curve_info nid_list[] = { 237. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */ 238. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */ ssl/t1_lib.c:450:5: Array access: Offset: [-1, +oo] Size: 28 by call to `tls_curve_allowed` 448. sizeof(nid_list) / sizeof(nid_list[0]))) 449. return 0; 450. cinfo = &nid_list[curve[1] - 1]; ^ 451. # ifdef OPENSSL_NO_EC2M 452. if (cinfo->flags & TLS_CURVE_CHAR2)
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/ssl/t1_lib.c/#L450
d2a_code_trace_data_44355
static int kek_unwrap_key(unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen, EVP_CIPHER_CTX *ctx) { size_t blocklen = EVP_CIPHER_CTX_block_size(ctx); unsigned char *tmp; int outl, rv = 0; if (inlen < 2 * blocklen) { return 0; } if (inlen % blocklen) { return 0; } tmp = OPENSSL_malloc(inlen); if (tmp == NULL) return 0; if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl, in + inlen - 2 * blocklen, blocklen * 2) || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp + inlen - blocklen, blocklen) || !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen) || !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL) || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen)) goto err; if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) { goto err; } if (inlen < (size_t)(tmp[0] - 4)) { goto err; } *outlen = (size_t)tmp[0]; memcpy(out, tmp + 4, *outlen); rv = 1; err: OPENSSL_clear_free(tmp, inlen); return rv; } crypto/cms/cms_smime.c:763: error: BUFFER_OVERRUN_L3 Offset: 6 Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt`. Showing all 13 steps of the trace crypto/cms/cms_smime.c:763:13: Call 761. continue; 762. CMS_RecipientInfo_set0_password(ri, pass, passlen); 763. r = CMS_RecipientInfo_decrypt(cms, ri); ^ 764. CMS_RecipientInfo_set0_password(ri, NULL, 0); 765. if (r > 0) crypto/cms/cms_env.c:782:1: Parameter `ri->d.pwri->encryptedKey->length` 780. } 781. 782. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) 783. { 784. switch (ri->type) { crypto/cms/cms_smime.c:763:13: Call 761. continue; 762. CMS_RecipientInfo_set0_password(ri, pass, passlen); 763. r = CMS_RecipientInfo_decrypt(cms, ri); ^ 764. CMS_RecipientInfo_set0_password(ri, NULL, 0); 765. if (r > 0) crypto/cms/cms_env.c:782:1: Parameter `ri->d.pwri->encryptedKey->length` 780. } 781. 782. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) 783. { 784. switch (ri->type) { crypto/cms/cms_env.c:792:16: Call 790. 791. case CMS_RECIPINFO_PASS: 792. return cms_RecipientInfo_pwri_crypt(cms, ri, 0); ^ 793. 794. default: crypto/cms/cms_pwri.c:320:1: Parameter `ri->d.pwri->encryptedKey->length` 318. /* Encrypt/Decrypt content key in PWRI recipient info */ 319. 320. > int cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, 321. int en_de) 322. { crypto/cms/cms_pwri.c:409:14: Call 407. goto err; 408. } 409. if (!kek_unwrap_key(key, &keylen, ^ 410. pwri->encryptedKey->data, 411. pwri->encryptedKey->length, kekctx)) { crypto/cms/cms_pwri.c:221:1: <Length trace> 219. */ 220. 221. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 222. const unsigned char *in, size_t inlen, 223. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:221:1: Parameter `inlen` 219. */ 220. 221. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 222. const unsigned char *in, size_t inlen, 223. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:236:11: Call 234. return 0; 235. } 236. tmp = OPENSSL_malloc(inlen); ^ 237. if (tmp == NULL) 238. return 0; crypto/mem.c:125:9: Assignment 123. 124. if (num <= 0) 125. return NULL; ^ 126. 127. allow_customize = 0; crypto/cms/cms_pwri.c:236:5: Assignment 234. return 0; 235. } 236. tmp = OPENSSL_malloc(inlen); ^ 237. if (tmp == NULL) 238. return 0; crypto/cms/cms_pwri.c:258:60: Array access: Offset: 6 Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt` 256. goto err; 257. /* Check check bytes */ 258. if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) { ^ 259. /* Check byte failure */ 260. goto err;
https://github.com/openssl/openssl/blob/846ec07d904f9cc81d486db0db14fb84f61ff6e5/crypto/cms/cms_pwri.c/#L258
d2a_code_trace_data_44356
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; } crypto/dh/dh_check.c:136: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_div`. Showing all 11 steps of the trace crypto/dh/dh_check.c:101:1: Parameter `dh->p->top` 99. } 100. 101. > int DH_check(const DH *dh, int *ret) 102. { 103. int ok = 0, r; crypto/dh/dh_check.c:136:14: Call 134. *ret |= DH_CHECK_Q_NOT_PRIME; 135. /* Check p == 1 mod q i.e. q divides p - 1 */ 136. if (!BN_div(t1, t2, dh->p, dh->q, ctx)) ^ 137. goto err; 138. if (!BN_is_one(t2)) crypto/bn/bn_div.c:137:1: Parameter `num->top` 135. * If 'dv' or 'rm' is NULL, the respective value is not returned. 136. */ 137. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 138. BN_CTX *ctx) 139. { crypto/bn/bn_div.c:182:17: Call 180. if (!no_branch && BN_ucmp(num, divisor) < 0) { 181. if (rm != NULL) { 182. if (BN_copy(rm, num) == NULL) ^ 183. return 0; 184. } 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:941:1: Parameter `*a->d` 939. } 940. 941. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 942. { 943. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:295:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_div` 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/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_lib.c/#L295
d2a_code_trace_data_44357
int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, size_t *written) { int i; SSL3_BUFFER *wb = s->rlayer.wbuf; size_t currbuf = 0; size_t tmpwrit = 0; if ((s->rlayer.wpend_tot > len) || ((s->rlayer.wpend_buf != buf) && !(s->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER)) || (s->rlayer.wpend_type != type)) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_WRITE_PENDING, SSL_R_BAD_WRITE_RETRY); return -1; } for (;;) { if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0 && currbuf < s->rlayer.numwpipes - 1) { currbuf++; continue; } clear_sys_error(); if (s->wbio != NULL) { s->rwstate = SSL_WRITING; i = BIO_write(s->wbio, (char *) &(SSL3_BUFFER_get_buf(&wb[currbuf]) [SSL3_BUFFER_get_offset(&wb[currbuf])]), (unsigned int)SSL3_BUFFER_get_left(&wb[currbuf])); if (i >= 0) tmpwrit = i; } else { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_WRITE_PENDING, SSL_R_BIO_NOT_SET); i = -1; } if (i > 0 && tmpwrit == SSL3_BUFFER_get_left(&wb[currbuf])) { SSL3_BUFFER_set_left(&wb[currbuf], 0); SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); if (currbuf + 1 < s->rlayer.numwpipes) continue; s->rwstate = SSL_NOTHING; *written = s->rlayer.wpend_ret; return 1; } else if (i <= 0) { if (SSL_IS_DTLS(s)) { SSL3_BUFFER_set_left(&wb[currbuf], 0); } return i; } SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); SSL3_BUFFER_sub_left(&wb[currbuf], tmpwrit); } } ssl/record/rec_layer_d1.c:423: error: INTEGER_OVERFLOW_L2 ([0, max(1, `s->rlayer.numwpipes`)] - 1):unsigned64 by call to `dtls1_read_failed`. Showing all 25 steps of the trace ssl/record/rec_layer_d1.c:340:1: Parameter `s->rlayer.numwpipes` 338. * none of our business 339. */ 340. > int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, 341. size_t len, int peek, size_t *readbytes) 342. { ssl/record/rec_layer_d1.c:411:9: Call 409. 410. /* Check for timeout */ 411. if (dtls1_handle_timeout(s) > 0) { ^ 412. goto start; 413. } else if (ossl_statem_in_error(s)) { ssl/d1_lib.c:389:1: Parameter `s->rlayer.numwpipes` 387. } 388. 389. > int dtls1_handle_timeout(SSL *s) 390. { 391. /* if no timer is expired, don't do anything */ ssl/record/rec_layer_d1.c:421:16: Call 419. if ((SSL3_RECORD_get_length(rr) == 0) 420. || (s->rlayer.rstate == SSL_ST_READ_BODY)) { 421. iret = dtls1_get_record(s); ^ 422. if (iret <= 0) { 423. iret = dtls1_read_failed(s, iret); ssl/record/ssl3_record.c:1776:1: Parameter `s->rlayer.numwpipes` 1774. */ 1775. /* used only by dtls1_read_bytes */ 1776. > int dtls1_get_record(SSL *s) 1777. { 1778. int ssl_major, ssl_minor; ssl/record/ssl3_record.c:1794:10: Call 1792. * This is a non-blocking operation. 1793. */ 1794. if (!dtls1_process_buffered_records(s)) { ^ 1795. /* SSLfatal() already called */ 1796. return -1; ssl/record/rec_layer_d1.c:224:1: Parameter `s->rlayer.numwpipes` 222. &((s)->rlayer.d->unprocessed_rcds)) 223. 224. > int dtls1_process_buffered_records(SSL *s) 225. { 226. pitem *item; ssl/record/rec_layer_d1.c:423:20: Call 421. iret = dtls1_get_record(s); 422. if (iret <= 0) { 423. iret = dtls1_read_failed(s, iret); ^ 424. /* 425. * Anything other than a timeout is an error. SSLfatal() already ssl/statem/statem_dtls.c:939:1: Parameter `s->rlayer.numwpipes` 937. #endif 938. 939. > int dtls1_read_failed(SSL *s, int code) 940. { 941. if (code > 0) { ssl/statem/statem_dtls.c:961:12: Call 959. } 960. 961. return dtls1_handle_timeout(s); ^ 962. } 963. ssl/d1_lib.c:389:1: Parameter `s->rlayer.numwpipes` 387. } 388. 389. > int dtls1_handle_timeout(SSL *s) 390. { 391. /* if no timer is expired, don't do anything */ ssl/d1_lib.c:413:12: Call 411. dtls1_start_timer(s); 412. /* Calls SSLfatal() if required */ 413. return dtls1_retransmit_buffered_messages(s); ^ 414. } 415. ssl/statem/statem_dtls.c:979:1: Parameter `s->rlayer.numwpipes` 977. } 978. 979. > int dtls1_retransmit_buffered_messages(SSL *s) 980. { 981. pqueue *sent = s->d1->sent_messages; ssl/statem/statem_dtls.c:991:13: Call 989. for (item = pqueue_next(&iter); item != NULL; item = pqueue_next(&iter)) { 990. frag = (hm_fragment *)item->data; 991. if (dtls1_retransmit_message(s, (unsigned short) ^ 992. dtls1_get_queue_priority 993. (frag->msg_header.seq, ssl/statem/statem_dtls.c:1068:1: Parameter `s->rlayer.numwpipes` 1066. } 1067. 1068. > int dtls1_retransmit_message(SSL *s, unsigned short seq, int *found) 1069. { 1070. int ret; ssl/statem/statem_dtls.c:1126:11: Call 1124. saved_retransmit_state.epoch); 1125. 1126. ret = dtls1_do_write(s, frag->msg_header.is_ccs ? ^ 1127. SSL3_RT_CHANGE_CIPHER_SPEC : SSL3_RT_HANDSHAKE); 1128. ssl/statem/statem_dtls.c:110:1: Parameter `s->rlayer.numwpipes` 108. * SSL3_RT_CHANGE_CIPHER_SPEC) 109. */ 110. > int dtls1_do_write(SSL *s, int type) 111. { 112. int ret; ssl/statem/statem_dtls.c:240:15: Call 238. } 239. 240. ret = dtls1_write_bytes(s, type, &s->init_buf->data[s->init_off], len, ^ 241. &written); 242. if (ret < 0) { ssl/record/rec_layer_d1.c:750:1: Parameter `s->rlayer.numwpipes` 748. * not all data has been sent or non-blocking IO. 749. */ 750. > int dtls1_write_bytes(SSL *s, int type, const void *buf, size_t len, 751. size_t *written) 752. { ssl/record/rec_layer_d1.c:761:9: Call 759. } 760. s->rwstate = SSL_NOTHING; 761. i = do_dtls1_write(s, type, buf, len, 0, written); ^ 762. return i; 763. } ssl/record/rec_layer_d1.c:765:1: Parameter `s->rlayer.numwpipes` 763. } 764. 765. > int do_dtls1_write(SSL *s, int type, const unsigned char *buf, 766. size_t len, int create_empty_fragment, size_t *written) 767. { ssl/record/rec_layer_d1.c:974:12: Call 972. 973. /* we now just need to write the buffer. Calls SSLfatal() as required. */ 974. return ssl3_write_pending(s, type, buf, len, written); ^ 975. } 976. ssl/record/rec_layer_s3.c:1108:1: <LHS trace> 1106. * Return values are as per SSL_write() 1107. */ 1108. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 1109. size_t *written) 1110. { ssl/record/rec_layer_s3.c:1108:1: Parameter `s->rlayer.numwpipes` 1106. * Return values are as per SSL_write() 1107. */ 1108. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 1109. size_t *written) 1110. { ssl/record/rec_layer_s3.c:1128:16: Binary operation: ([0, max(1, s->rlayer.numwpipes)] - 1):unsigned64 by call to `dtls1_read_failed` 1126. /* Loop until we find a buffer we haven't written out yet */ 1127. if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0 1128. && currbuf < s->rlayer.numwpipes - 1) { ^ 1129. currbuf++; 1130. continue;
https://github.com/openssl/openssl/blob/a8ea8018fa187e22fb4989450b550589e20f62c2/ssl/record/rec_layer_s3.c/#L1128
d2a_code_trace_data_44358
u_char * ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) { u_char *p, zero, *last; int d; float f, scale; size_t len, slen; int64_t i64; uint64_t ui64; ngx_msec_t ms; ngx_uint_t width, sign, hex, max_width, frac_width, i; ngx_str_t *v; ngx_variable_value_t *vv; if (max == 0) { return buf; } last = buf + max; while (*fmt && buf < last) { if (*fmt == '%') { i64 = 0; ui64 = 0; zero = (u_char) ((*++fmt == '0') ? '0' : ' '); width = 0; sign = 1; hex = 0; max_width = 0; frac_width = 0; slen = (size_t) -1; while (*fmt >= '0' && *fmt <= '9') { width = width * 10 + *fmt++ - '0'; } for ( ;; ) { switch (*fmt) { case 'u': sign = 0; fmt++; continue; case 'm': max_width = 1; fmt++; continue; case 'X': hex = 2; sign = 0; fmt++; continue; case 'x': hex = 1; sign = 0; fmt++; continue; case '.': fmt++; while (*fmt >= '0' && *fmt <= '9') { frac_width = frac_width * 10 + *fmt++ - '0'; } break; case '*': slen = va_arg(args, size_t); fmt++; continue; default: break; } break; } switch (*fmt) { case 'V': v = va_arg(args, ngx_str_t *); len = v->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, v->data, len); fmt++; continue; case 'v': vv = va_arg(args, ngx_variable_value_t *); len = vv->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, vv->data, len); fmt++; continue; case 's': p = va_arg(args, u_char *); if (slen == (size_t) -1) { while (*p && buf < last) { *buf++ = *p++; } } else { len = (buf + slen < last) ? slen : (size_t) (last - buf); buf = ngx_cpymem(buf, p, len); } fmt++; continue; case 'O': i64 = (int64_t) va_arg(args, off_t); sign = 1; break; case 'P': i64 = (int64_t) va_arg(args, ngx_pid_t); sign = 1; break; case 'T': i64 = (int64_t) va_arg(args, time_t); sign = 1; break; case 'M': ms = (ngx_msec_t) va_arg(args, ngx_msec_t); if ((ngx_msec_int_t) ms == -1) { sign = 1; i64 = -1; } else { sign = 0; ui64 = (uint64_t) ms; } break; case 'z': if (sign) { i64 = (int64_t) va_arg(args, ssize_t); } else { ui64 = (uint64_t) va_arg(args, size_t); } break; case 'i': if (sign) { i64 = (int64_t) va_arg(args, ngx_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_uint_t); } if (max_width) { width = NGX_INT_T_LEN; } break; case 'd': if (sign) { i64 = (int64_t) va_arg(args, int); } else { ui64 = (uint64_t) va_arg(args, u_int); } break; case 'l': if (sign) { i64 = (int64_t) va_arg(args, long); } else { ui64 = (uint64_t) va_arg(args, u_long); } break; case 'D': if (sign) { i64 = (int64_t) va_arg(args, int32_t); } else { ui64 = (uint64_t) va_arg(args, uint32_t); } break; case 'L': if (sign) { i64 = va_arg(args, int64_t); } else { ui64 = va_arg(args, uint64_t); } break; case 'A': if (sign) { i64 = (int64_t) va_arg(args, ngx_atomic_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t); } if (max_width) { width = NGX_ATOMIC_T_LEN; } break; case 'f': f = (float) va_arg(args, double); if (f < 0) { *buf++ = '-'; f = -f; } ui64 = (int64_t) f; buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width); if (frac_width) { if (buf < last) { *buf++ = '.'; } scale = 1.0; for (i = 0; i < frac_width; i++) { scale *= 10.0; } ui64 = (uint64_t) ((f - (int64_t) ui64) * scale); buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width); } fmt++; continue; #if !(NGX_WIN32) case 'r': i64 = (int64_t) va_arg(args, rlim_t); sign = 1; break; #endif case 'p': ui64 = (uintptr_t) va_arg(args, void *); hex = 2; sign = 0; zero = '0'; width = NGX_PTR_SIZE * 2; break; case 'c': d = va_arg(args, int); *buf++ = (u_char) (d & 0xff); fmt++; continue; case 'Z': *buf++ = '\0'; fmt++; continue; case 'N': #if (NGX_WIN32) *buf++ = CR; #endif *buf++ = LF; fmt++; continue; case '%': *buf++ = '%'; fmt++; continue; default: *buf++ = *fmt++; continue; } if (sign) { if (i64 < 0) { *buf++ = '-'; ui64 = (uint64_t) -i64; } else { ui64 = (uint64_t) i64; } } buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width); fmt++; } else { *buf++ = *fmt++; } } return buf; } src/http/ngx_http_variables.c:1300: error: Buffer Overrun L2 Offset: [0, 65535] Size: 20 by call to `ngx_sprintf`. src/http/ngx_http_variables.c:1295:13: Call 1293. 1294. if (r->headers_out.content_length_n >= 0) { 1295. p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN); ^ 1296. if (p == NULL) { 1297. return NGX_ERROR; src/core/ngx_palloc.c:155:13: Assignment 153. 154. do { 155. m = p->d.last; ^ 156. 157. if ((size_t) (p->d.end - m) >= size) { src/core/ngx_palloc.c:160:17: Assignment 158. p->d.last = m + size; 159. 160. return m; ^ 161. } 162. src/http/ngx_http_variables.c:1295:9: Assignment 1293. 1294. if (r->headers_out.content_length_n >= 0) { 1295. p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN); ^ 1296. if (p == NULL) { 1297. return NGX_ERROR; src/http/ngx_http_variables.c:1300:18: Call 1298. } 1299. 1300. v->len = ngx_sprintf(p, "%O", r->headers_out.content_length_n) - p; ^ 1301. v->valid = 1; 1302. v->no_cacheable = 0; src/core/ngx_string.c:95:1: Parameter `*buf` 93. 94. 95. u_char * ngx_cdecl ^ 96. ngx_sprintf(u_char *buf, const char *fmt, ...) 97. { src/core/ngx_string.c:102:9: Call 100. 101. va_start(args, fmt); 102. p = ngx_vsnprintf(buf, /* STUB */ 65536, fmt, args); ^ 103. va_end(args); 104. src/core/ngx_string.c:123:1: <Length trace> 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:123:1: Parameter `*buf` 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:244:25: Array access: Offset: [0, 65535] Size: 20 by call to `ngx_sprintf` 242. if (slen == (size_t) -1) { 243. while (*p && buf < last) { 244. *buf++ = *p++; ^ 245. } 246.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L244
d2a_code_trace_data_44359
int ctr_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen, const unsigned char *adin, size_t adinlen) { RAND_DRBG_CTR *ctr = &drbg->ctr; if (adin != NULL && adinlen != 0) { ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0); if (drbg->flags & RAND_DRBG_FLAG_CTR_USE_DF) { adin = NULL; adinlen = 1; } } else { adinlen = 0; } for ( ; ; ) { inc_128(ctr); if (outlen < 16) { AES_encrypt(ctr->V, ctr->K, &ctr->ks); memcpy(out, ctr->K, outlen); break; } AES_encrypt(ctr->V, out, &ctr->ks); out += 16; outlen -= 16; if (outlen == 0) break; } ctr_update(drbg, adin, adinlen, NULL, 0, NULL, 0); return 1; } ssl/statem/statem_srvr.c:2820: error: BUFFER_OVERRUN_L3 Offset added: [1, 15] Size: [0, +oo] by call to `ssl_randbytes`. Showing all 10 steps of the trace ssl/statem/statem_srvr.c:2820:9: Call 2818. */ 2819. 2820. if (ssl_randbytes(s, rand_premaster_secret, ^ 2821. sizeof(rand_premaster_secret)) <= 0) { 2822. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_PROCESS_CKE_RSA, ssl/ssl_lib.c:5172:1: Parameter `size` 5170. } 5171. 5172. > int ssl_randbytes(SSL *s, unsigned char *rnd, size_t size) 5173. { 5174. if (s->drbg != NULL) { ssl/ssl_lib.c:5187:17: Call 5185. * here. 5186. */ 5187. return RAND_DRBG_generate(s->drbg, rnd, size, 0, NULL, 0); ^ 5188. } 5189. return RAND_bytes(rnd, (int)size); crypto/rand/drbg_lib.c:363:1: Parameter `outlen` 361. * 362. */ 363. > int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen, 364. int prediction_resistance, 365. const unsigned char *adin, size_t adinlen) crypto/rand/drbg_lib.c:409:10: Call 407. } 408. 409. if (!ctr_generate(drbg, out, outlen, adin, adinlen)) { ^ 410. drbg->state = DRBG_ERROR; 411. RANDerr(RAND_F_RAND_DRBG_GENERATE, RAND_R_GENERATE_ERROR); crypto/rand/drbg_rand.c:266:1: <Offset trace> 264. } 265. 266. > int ctr_generate(RAND_DRBG *drbg, 267. unsigned char *out, size_t outlen, 268. const unsigned char *adin, size_t adinlen) crypto/rand/drbg_rand.c:266:1: Parameter `outlen` 264. } 265. 266. > int ctr_generate(RAND_DRBG *drbg, 267. unsigned char *out, size_t outlen, 268. const unsigned char *adin, size_t adinlen) crypto/rand/drbg_rand.c:266:1: <Length trace> 264. } 265. 266. > int ctr_generate(RAND_DRBG *drbg, 267. unsigned char *out, size_t outlen, 268. const unsigned char *adin, size_t adinlen) crypto/rand/drbg_rand.c:266:1: Parameter `drbg->ctr.K[*]` 264. } 265. 266. > int ctr_generate(RAND_DRBG *drbg, 267. unsigned char *out, size_t outlen, 268. const unsigned char *adin, size_t adinlen) crypto/rand/drbg_rand.c:288:13: Array access: Offset added: [1, 15] Size: [0, +oo] by call to `ssl_randbytes` 286. /* Use K as temp space as it will be updated */ 287. AES_encrypt(ctr->V, ctr->K, &ctr->ks); 288. memcpy(out, ctr->K, outlen); ^ 289. break; 290. }
https://github.com/openssl/openssl/blob/e7d961e994620dd5dee6d80794a07fb9de1bab66/crypto/rand/drbg_rand.c/#L288
d2a_code_trace_data_44360
u_char * ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) { u_char *p, zero, *last; int d; float f, scale; size_t len, slen; int64_t i64; uint64_t ui64; ngx_msec_t ms; ngx_uint_t width, sign, hex, max_width, frac_width, i; ngx_str_t *v; ngx_variable_value_t *vv; if (max == 0) { return buf; } last = buf + max; while (*fmt && buf < last) { if (*fmt == '%') { i64 = 0; ui64 = 0; zero = (u_char) ((*++fmt == '0') ? '0' : ' '); width = 0; sign = 1; hex = 0; max_width = 0; frac_width = 0; slen = (size_t) -1; while (*fmt >= '0' && *fmt <= '9') { width = width * 10 + *fmt++ - '0'; } for ( ;; ) { switch (*fmt) { case 'u': sign = 0; fmt++; continue; case 'm': max_width = 1; fmt++; continue; case 'X': hex = 2; sign = 0; fmt++; continue; case 'x': hex = 1; sign = 0; fmt++; continue; case '.': fmt++; while (*fmt >= '0' && *fmt <= '9') { frac_width = frac_width * 10 + *fmt++ - '0'; } break; case '*': slen = va_arg(args, size_t); fmt++; continue; default: break; } break; } switch (*fmt) { case 'V': v = va_arg(args, ngx_str_t *); len = v->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, v->data, len); fmt++; continue; case 'v': vv = va_arg(args, ngx_variable_value_t *); len = vv->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, vv->data, len); fmt++; continue; case 's': p = va_arg(args, u_char *); if (slen == (size_t) -1) { while (*p && buf < last) { *buf++ = *p++; } } else { len = (buf + slen < last) ? slen : (size_t) (last - buf); buf = ngx_cpymem(buf, p, len); } fmt++; continue; case 'O': i64 = (int64_t) va_arg(args, off_t); sign = 1; break; case 'P': i64 = (int64_t) va_arg(args, ngx_pid_t); sign = 1; break; case 'T': i64 = (int64_t) va_arg(args, time_t); sign = 1; break; case 'M': ms = (ngx_msec_t) va_arg(args, ngx_msec_t); if ((ngx_msec_int_t) ms == -1) { sign = 1; i64 = -1; } else { sign = 0; ui64 = (uint64_t) ms; } break; case 'z': if (sign) { i64 = (int64_t) va_arg(args, ssize_t); } else { ui64 = (uint64_t) va_arg(args, size_t); } break; case 'i': if (sign) { i64 = (int64_t) va_arg(args, ngx_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_uint_t); } if (max_width) { width = NGX_INT_T_LEN; } break; case 'd': if (sign) { i64 = (int64_t) va_arg(args, int); } else { ui64 = (uint64_t) va_arg(args, u_int); } break; case 'l': if (sign) { i64 = (int64_t) va_arg(args, long); } else { ui64 = (uint64_t) va_arg(args, u_long); } break; case 'D': if (sign) { i64 = (int64_t) va_arg(args, int32_t); } else { ui64 = (uint64_t) va_arg(args, uint32_t); } break; case 'L': if (sign) { i64 = va_arg(args, int64_t); } else { ui64 = va_arg(args, uint64_t); } break; case 'A': if (sign) { i64 = (int64_t) va_arg(args, ngx_atomic_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t); } if (max_width) { width = NGX_ATOMIC_T_LEN; } break; case 'f': f = (float) va_arg(args, double); if (f < 0) { *buf++ = '-'; f = -f; } ui64 = (int64_t) f; buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width); if (frac_width) { if (buf < last) { *buf++ = '.'; } scale = 1.0; for (i = 0; i < frac_width; i++) { scale *= 10.0; } ui64 = (uint64_t) ((f - (int64_t) ui64) * scale); buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width); } fmt++; continue; #if !(NGX_WIN32) case 'r': i64 = (int64_t) va_arg(args, rlim_t); sign = 1; break; #endif case 'p': ui64 = (uintptr_t) va_arg(args, void *); hex = 2; sign = 0; zero = '0'; width = NGX_PTR_SIZE * 2; break; case 'c': d = va_arg(args, int); *buf++ = (u_char) (d & 0xff); fmt++; continue; case 'Z': *buf++ = '\0'; fmt++; continue; case 'N': #if (NGX_WIN32) *buf++ = CR; #endif *buf++ = LF; fmt++; continue; case '%': *buf++ = '%'; fmt++; continue; default: *buf++ = *fmt++; continue; } if (sign) { if (i64 < 0) { *buf++ = '-'; ui64 = (uint64_t) -i64; } else { ui64 = (uint64_t) i64; } } buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width); fmt++; } else { *buf++ = *fmt++; } } return buf; } src/http/modules/ngx_http_userid_filter_module.c:258: error: Buffer Overrun L3 Offset: [0, 65535] Size: [33, +oo] by call to `ngx_http_userid_variable`. src/http/modules/ngx_http_userid_filter_module.c:251:11: Call 249. } 250. 251. ctx = ngx_http_userid_get_uid(r, conf); ^ 252. 253. if (ctx == NULL) { src/http/modules/ngx_http_userid_filter_module.c:289:1: Parameter `conf->name.len` 287. 288. 289. static ngx_http_userid_ctx_t * ^ 290. ngx_http_userid_get_uid(ngx_http_request_t *r, ngx_http_userid_conf_t *conf) 291. { src/http/modules/ngx_http_userid_filter_module.c:258:16: Call 256. 257. if (ctx->uid_got[3] != 0) { 258. return ngx_http_userid_variable(r, v, &conf->name, ctx->uid_got); ^ 259. } 260. src/http/modules/ngx_http_userid_filter_module.c:521:1: Parameter `name->len` 519. 520. 521. static ngx_int_t ^ 522. ngx_http_userid_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, 523. ngx_str_t *name, uint32_t *uid) src/http/modules/ngx_http_userid_filter_module.c:525:5: Assignment 523. ngx_str_t *name, uint32_t *uid) 524. { 525. v->len = name->len + sizeof("=00001111222233334444555566667777") - 1; ^ 526. v->data = ngx_pnalloc(r->pool, v->len); 527. if (v->data == NULL) { src/http/modules/ngx_http_userid_filter_module.c:526:15: Call 524. { 525. v->len = name->len + sizeof("=00001111222233334444555566667777") - 1; 526. v->data = ngx_pnalloc(r->pool, v->len); ^ 527. if (v->data == NULL) { 528. return NGX_ERROR; src/core/ngx_palloc.c:155:13: Assignment 153. 154. do { 155. m = p->d.last; ^ 156. 157. if ((size_t) (p->d.end - m) >= size) { src/core/ngx_palloc.c:160:17: Assignment 158. p->d.last = m + size; 159. 160. return m; ^ 161. } 162. src/http/modules/ngx_http_userid_filter_module.c:526:5: Assignment 524. { 525. v->len = name->len + sizeof("=00001111222233334444555566667777") - 1; 526. v->data = ngx_pnalloc(r->pool, v->len); ^ 527. if (v->data == NULL) { 528. return NGX_ERROR; src/http/modules/ngx_http_userid_filter_module.c:535:5: Call 533. v->not_found = 0; 534. 535. ngx_sprintf(v->data, "%V=%08XD%08XD%08XD%08XD", ^ 536. name, uid[0], uid[1], uid[2], uid[3]); 537. src/core/ngx_string.c:95:1: Parameter `*buf` 93. 94. 95. u_char * ngx_cdecl ^ 96. ngx_sprintf(u_char *buf, const char *fmt, ...) 97. { src/core/ngx_string.c:102:9: Call 100. 101. va_start(args, fmt); 102. p = ngx_vsnprintf(buf, /* STUB */ 65536, fmt, args); ^ 103. va_end(args); 104. src/core/ngx_string.c:123:1: <Length trace> 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:123:1: Parameter `*buf` 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:244:25: Array access: Offset: [0, 65535] Size: [33, +oo] by call to `ngx_http_userid_variable` 242. if (slen == (size_t) -1) { 243. while (*p && buf < last) { 244. *buf++ = *p++; ^ 245. } 246.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L244
d2a_code_trace_data_44361
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) { bn_check_top(b); if (a == b) return a; if (bn_wexpand(a, b->top) == NULL) return NULL; if (b->top > 0) memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); a->neg = b->neg; a->top = b->top; a->flags |= b->flags & BN_FLG_FIXED_TOP; bn_check_top(a); return a; } test/sm2_internal_test.c:292: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul`. Showing all 19 steps of the trace test/sm2_internal_test.c:281:10: Call 279. BIGNUM *s = NULL; 280. 281. if (!TEST_true(BN_hex2bn(&priv, privkey_hex))) ^ 282. goto done; 283. crypto/bn/bn_print.c:166:5: Assignment 164. j = i; /* least significant 'hex' */ 165. m = 0; 166. h = 0; ^ 167. while (j > 0) { 168. m = (BN_BYTES * 2 <= j) ? BN_BYTES * 2 : j; crypto/bn/bn_print.c:184:5: Assignment 182. j -= BN_BYTES * 2; 183. } 184. ret->top = h; ^ 185. bn_correct_top(ret); 186. test/sm2_internal_test.c:292:17: Call 290. pt = EC_POINT_new(group); 291. if (!TEST_ptr(pt) 292. || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL)) ^ 293. || !TEST_true(EC_KEY_set_public_key(key, pt))) 294. goto done; crypto/ec/ec_lib.c:971:1: Parameter `g_scalar->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 `scalar->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 `scalar->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 `scalar->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:215:10: Call 213. } 214. 215. if (!BN_copy(k, scalar)) { ^ 216. ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); 217. goto err; crypto/bn/bn_lib.c:281:1: <Offset trace> 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: Parameter `b->top` 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: <Length trace> 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: Parameter `*a->d` 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:287:9: Call 285. if (a == b) 286. return a; 287. if (bn_wexpand(a, b->top) == NULL) ^ 288. return NULL; 289. crypto/bn/bn_lib.c:962:1: Parameter `*a->d` 960. } 961. 962. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:291:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul` 289. 290. if (b->top > 0) 291. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); ^ 292. 293. a->neg = b->neg;
https://github.com/openssl/openssl/blob/3051bf2afab7ac8b7b9c64e68755d1addd2fb8ff/crypto/bn/bn_lib.c/#L291
d2a_code_trace_data_44362
int ff_wma_init(AVCodecContext * avctx, int flags2) { WMACodecContext *s = avctx->priv_data; int i; float *window; float bps1, high_freq; volatile float bps; int sample_rate1; int coef_vlc_table; if( avctx->sample_rate<=0 || avctx->sample_rate>50000 || avctx->channels<=0 || avctx->channels>8 || avctx->bit_rate<=0) return -1; s->sample_rate = avctx->sample_rate; s->nb_channels = avctx->channels; s->bit_rate = avctx->bit_rate; s->block_align = avctx->block_align; dsputil_init(&s->dsp, avctx); if (avctx->codec->id == CODEC_ID_WMAV1) { s->version = 1; } else { s->version = 2; } if (s->sample_rate <= 16000) { s->frame_len_bits = 9; } else if (s->sample_rate <= 22050 || (s->sample_rate <= 32000 && s->version == 1)) { s->frame_len_bits = 10; } else { s->frame_len_bits = 11; } s->frame_len = 1 << s->frame_len_bits; if (s->use_variable_block_len) { int nb_max, nb; nb = ((flags2 >> 3) & 3) + 1; if ((s->bit_rate / s->nb_channels) >= 32000) nb += 2; nb_max = s->frame_len_bits - BLOCK_MIN_BITS; if (nb > nb_max) nb = nb_max; s->nb_block_sizes = nb + 1; } else { s->nb_block_sizes = 1; } s->use_noise_coding = 1; high_freq = s->sample_rate * 0.5; sample_rate1 = s->sample_rate; if (s->version == 2) { if (sample_rate1 >= 44100) sample_rate1 = 44100; else if (sample_rate1 >= 22050) sample_rate1 = 22050; else if (sample_rate1 >= 16000) sample_rate1 = 16000; else if (sample_rate1 >= 11025) sample_rate1 = 11025; else if (sample_rate1 >= 8000) sample_rate1 = 8000; } bps = (float)s->bit_rate / (float)(s->nb_channels * s->sample_rate); s->byte_offset_bits = av_log2((int)(bps * s->frame_len / 8.0 + 0.5)) + 2; bps1 = bps; if (s->nb_channels == 2) bps1 = bps * 1.6; if (sample_rate1 == 44100) { if (bps1 >= 0.61) s->use_noise_coding = 0; else high_freq = high_freq * 0.4; } else if (sample_rate1 == 22050) { if (bps1 >= 1.16) s->use_noise_coding = 0; else if (bps1 >= 0.72) high_freq = high_freq * 0.7; else high_freq = high_freq * 0.6; } else if (sample_rate1 == 16000) { if (bps > 0.5) high_freq = high_freq * 0.5; else high_freq = high_freq * 0.3; } else if (sample_rate1 == 11025) { high_freq = high_freq * 0.7; } else if (sample_rate1 == 8000) { if (bps <= 0.625) { high_freq = high_freq * 0.5; } else if (bps > 0.75) { s->use_noise_coding = 0; } else { high_freq = high_freq * 0.65; } } else { if (bps >= 0.8) { high_freq = high_freq * 0.75; } else if (bps >= 0.6) { high_freq = high_freq * 0.6; } else { high_freq = high_freq * 0.5; } } dprintf(s->avctx, "flags2=0x%x\n", flags2); dprintf(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n", s->version, s->nb_channels, s->sample_rate, s->bit_rate, s->block_align); dprintf(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n", bps, bps1, high_freq, s->byte_offset_bits); dprintf(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n", s->use_noise_coding, s->use_exp_vlc, s->nb_block_sizes); { int a, b, pos, lpos, k, block_len, i, j, n; const uint8_t *table; if (s->version == 1) { s->coefs_start = 3; } else { s->coefs_start = 0; } for(k = 0; k < s->nb_block_sizes; k++) { block_len = s->frame_len >> k; if (s->version == 1) { lpos = 0; for(i=0;i<25;i++) { a = wma_critical_freqs[i]; b = s->sample_rate; pos = ((block_len * 2 * a) + (b >> 1)) / b; if (pos > block_len) pos = block_len; s->exponent_bands[0][i] = pos - lpos; if (pos >= block_len) { i++; break; } lpos = pos; } s->exponent_sizes[0] = i; } else { table = NULL; a = s->frame_len_bits - BLOCK_MIN_BITS - k; if (a < 3) { if (s->sample_rate >= 44100) table = exponent_band_44100[a]; else if (s->sample_rate >= 32000) table = exponent_band_32000[a]; else if (s->sample_rate >= 22050) table = exponent_band_22050[a]; } if (table) { n = *table++; for(i=0;i<n;i++) s->exponent_bands[k][i] = table[i]; s->exponent_sizes[k] = n; } else { j = 0; lpos = 0; for(i=0;i<25;i++) { a = wma_critical_freqs[i]; b = s->sample_rate; pos = ((block_len * 2 * a) + (b << 1)) / (4 * b); pos <<= 2; if (pos > block_len) pos = block_len; if (pos > lpos) s->exponent_bands[k][j++] = pos - lpos; if (pos >= block_len) break; lpos = pos; } s->exponent_sizes[k] = j; } } s->coefs_end[k] = (s->frame_len - ((s->frame_len * 9) / 100)) >> k; s->high_band_start[k] = (int)((block_len * 2 * high_freq) / s->sample_rate + 0.5); n = s->exponent_sizes[k]; j = 0; pos = 0; for(i=0;i<n;i++) { int start, end; start = pos; pos += s->exponent_bands[k][i]; end = pos; if (start < s->high_band_start[k]) start = s->high_band_start[k]; if (end > s->coefs_end[k]) end = s->coefs_end[k]; if (end > start) s->exponent_high_bands[k][j++] = end - start; } s->exponent_high_sizes[k] = j; #if 0 tprintf(s->avctx, "%5d: coefs_end=%d high_band_start=%d nb_high_bands=%d: ", s->frame_len >> k, s->coefs_end[k], s->high_band_start[k], s->exponent_high_sizes[k]); for(j=0;j<s->exponent_high_sizes[k];j++) tprintf(s->avctx, " %d", s->exponent_high_bands[k][j]); tprintf(s->avctx, "\n"); #endif } } #ifdef TRACE { int i, j; for(i = 0; i < s->nb_block_sizes; i++) { tprintf(s->avctx, "%5d: n=%2d:", s->frame_len >> i, s->exponent_sizes[i]); for(j=0;j<s->exponent_sizes[i];j++) tprintf(s->avctx, " %d", s->exponent_bands[i][j]); tprintf(s->avctx, "\n"); } } #endif for(i = 0; i < s->nb_block_sizes; i++) { int n, j; float alpha; n = 1 << (s->frame_len_bits - i); window = av_malloc(sizeof(float) * n); alpha = M_PI / (2.0 * n); for(j=0;j<n;j++) { window[j] = sin((j + 0.5) * alpha); } s->windows[i] = window; } s->reset_block_lengths = 1; if (s->use_noise_coding) { if (s->use_exp_vlc) s->noise_mult = 0.02; else s->noise_mult = 0.04; #ifdef TRACE for(i=0;i<NOISE_TAB_SIZE;i++) s->noise_table[i] = 1.0 * s->noise_mult; #else { unsigned int seed; float norm; seed = 1; norm = (1.0 / (float)(1LL << 31)) * sqrt(3) * s->noise_mult; for(i=0;i<NOISE_TAB_SIZE;i++) { seed = seed * 314159 + 1; s->noise_table[i] = (float)((int)seed) * norm; } } #endif } coef_vlc_table = 2; if (s->sample_rate >= 32000) { if (bps1 < 0.72) coef_vlc_table = 0; else if (bps1 < 1.16) coef_vlc_table = 1; } s->coef_vlcs[0]= &coef_vlcs[coef_vlc_table * 2 ]; s->coef_vlcs[1]= &coef_vlcs[coef_vlc_table * 2 + 1]; init_coef_vlc(&s->coef_vlc[0], &s->run_table[0], &s->level_table[0], &s->int_table[0], s->coef_vlcs[0]); init_coef_vlc(&s->coef_vlc[1], &s->run_table[1], &s->level_table[1], &s->int_table[1], s->coef_vlcs[1]); return 0; } libavcodec/wma.c:227: error: Buffer Overrun L3 Offset: [-2, 2] Size: 3. libavcodec/wma.c:95:9: <Offset trace> 93. /* compute MDCT block size */ 94. if (s->sample_rate <= 16000) { 95. s->frame_len_bits = 9; ^ 96. } else if (s->sample_rate <= 22050 || 97. (s->sample_rate <= 32000 && s->version == 1)) { libavcodec/wma.c:95:9: Assignment 93. /* compute MDCT block size */ 94. if (s->sample_rate <= 16000) { 95. s->frame_len_bits = 9; ^ 96. } else if (s->sample_rate <= 22050 || 97. (s->sample_rate <= 32000 && s->version == 1)) { libavcodec/wma.c:220:17: Assignment 218. /* hardcoded tables */ 219. table = NULL; 220. a = s->frame_len_bits - BLOCK_MIN_BITS - k; ^ 221. if (a < 3) { 222. if (s->sample_rate >= 44100) libavcodec/wmadata.h:41:1: <Length trace> 39. 40. /* first value is number of bands */ 41. static const uint8_t exponent_band_22050[3][25] = { ^ 42. { 10, 4, 8, 4, 8, 8, 12, 20, 24, 24, 16, }, 43. { 14, 4, 8, 8, 4, 12, 12, 16, 24, 16, 20, 24, 32, 40, 36, }, libavcodec/wmadata.h:41:1: Array declaration 39. 40. /* first value is number of bands */ 41. static const uint8_t exponent_band_22050[3][25] = { ^ 42. { 10, 4, 8, 4, 8, 8, 12, 20, 24, 24, 16, }, 43. { 14, 4, 8, 8, 4, 12, 12, 16, 24, 16, 20, 24, 32, 40, 36, }, libavcodec/wma.c:227:25: Array access: Offset: [-2, 2] Size: 3 225. table = exponent_band_32000[a]; 226. else if (s->sample_rate >= 22050) 227. table = exponent_band_22050[a]; ^ 228. } 229. if (table) {
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/wma.c/#L227
d2a_code_trace_data_44363
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/sparse_array_test.c:89: 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:89:14: Call 87. goto err; 88. for (i = 0; i < OSSL_NELEM(cases); i++) 89. if (!TEST_true(ossl_sa_char_set(sa, cases[i].n, cases[i].v)) ^ 90. || !TEST_size_t_eq(ossl_sa_char_num(sa), cases[i].num)) 91. 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: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; test/sparse_array_test.c:89:14: Call 87. goto err; 88. for (i = 0; i < OSSL_NELEM(cases); i++) 89. if (!TEST_true(ossl_sa_char_set(sa, cases[i].n, cases[i].v)) ^ 90. || !TEST_size_t_eq(ossl_sa_char_num(sa), cases[i].num)) 91. 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: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_sa_char_set` 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_44364
static int truemotion1_decode_header(TrueMotion1Context *s) { int i; struct frame_header header; uint8_t header_buffer[128]; const uint8_t *sel_vector_table; s->mb_change_bits_row_size = ((s->avctx->width >> 2) + 7) >> 3; header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f; if (s->buf[0] < 0x10) { av_log(s->avctx, AV_LOG_ERROR, "invalid header size (%d)\n", s->buf[0]); return -1; } memset(header_buffer, 0, 128); for (i = 1; i < header.header_size; i++) header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1]; header.compression = header_buffer[0]; header.deltaset = header_buffer[1]; header.vectable = header_buffer[2]; header.ysize = AV_RL16(&header_buffer[3]); header.xsize = AV_RL16(&header_buffer[5]); header.checksum = AV_RL16(&header_buffer[7]); header.version = header_buffer[9]; header.header_type = header_buffer[10]; header.flags = header_buffer[11]; header.control = header_buffer[12]; if (header.version >= 2) { if (header.header_type > 3) { av_log(s->avctx, AV_LOG_ERROR, "invalid header type (%d)\n", header.header_type); return -1; } else if ((header.header_type == 2) || (header.header_type == 3)) { s->flags = header.flags; if (!(s->flags & FLAG_INTERFRAME)) s->flags |= FLAG_KEYFRAME; } else s->flags = FLAG_KEYFRAME; } else s->flags = FLAG_KEYFRAME; if (s->flags & FLAG_SPRITE) { av_log(s->avctx, AV_LOG_INFO, "SPRITE frame found, please report the sample to the developers\n"); #if 0 s->w = header.width; s->h = header.height; s->x = header.xoffset; s->y = header.yoffset; #else return -1; #endif } else { s->w = header.xsize; s->h = header.ysize; if (header.header_type < 2) { if ((s->w < 213) && (s->h >= 176)) { s->flags |= FLAG_INTERPOLATED; av_log(s->avctx, AV_LOG_INFO, "INTERPOLATION selected, please report the sample to the developers\n"); } } } if (header.compression > 17) { av_log(s->avctx, AV_LOG_ERROR, "invalid compression type (%d)\n", header.compression); return -1; } if ((header.deltaset != s->last_deltaset) || (header.vectable != s->last_vectable)) select_delta_tables(s, header.deltaset); if ((header.compression & 1) && header.header_type) sel_vector_table = pc_tbl2; else { if (header.vectable < 4) sel_vector_table = tables[header.vectable - 1]; else { av_log(s->avctx, AV_LOG_ERROR, "invalid vector table id (%d)\n", header.vectable); return -1; } } if (compression_types[header.compression].algorithm == ALGO_RGB24H) s->avctx->pix_fmt = PIX_FMT_RGB32; else s->avctx->pix_fmt = PIX_FMT_RGB555; if ((header.deltaset != s->last_deltaset) || (header.vectable != s->last_vectable)) { if (compression_types[header.compression].algorithm == ALGO_RGB24H) gen_vector_table24(s, sel_vector_table); else if (s->avctx->pix_fmt == PIX_FMT_RGB555) gen_vector_table15(s, sel_vector_table); else gen_vector_table16(s, sel_vector_table); } s->mb_change_bits = s->buf + header.header_size; if (s->flags & FLAG_KEYFRAME) { s->index_stream = s->mb_change_bits; } else { s->index_stream = s->mb_change_bits + (s->mb_change_bits_row_size * (s->avctx->height >> 2)); } s->index_stream_size = s->size - (s->index_stream - s->buf); s->last_deltaset = header.deltaset; s->last_vectable = header.vectable; s->compression = header.compression; s->block_width = compression_types[header.compression].block_width; s->block_height = compression_types[header.compression].block_height; s->block_type = compression_types[header.compression].block_type; if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, "tables: %d / %d c:%d %dx%d t:%d %s%s%s%s\n", s->last_deltaset, s->last_vectable, s->compression, s->block_width, s->block_height, s->block_type, s->flags & FLAG_KEYFRAME ? " KEY" : "", s->flags & FLAG_INTERFRAME ? " INTER" : "", s->flags & FLAG_SPRITE ? " SPRITE" : "", s->flags & FLAG_INTERPOLATED ? " INTERPOL" : ""); return header.header_size; } libavcodec/truemotion1.c:417: error: Buffer Overrun L2 Offset: [-oo, 17] Size: 17. libavcodec/truemotion1.c:322:1: <Offset trace> 320. /* Returns the number of bytes consumed from the bytestream. Returns -1 if 321. * there was an error while decoding the header */ 322. static int truemotion1_decode_header(TrueMotion1Context *s) ^ 323. { 324. int i; libavcodec/truemotion1.c:322:1: Parameter `*s->buf` 320. /* Returns the number of bytes consumed from the bytestream. Returns -1 if 321. * there was an error while decoding the header */ 322. static int truemotion1_decode_header(TrueMotion1Context *s) ^ 323. { 324. int i; libavcodec/truemotion1.c:344:9: Assignment 342. memset(header_buffer, 0, 128); 343. for (i = 1; i < header.header_size; i++) 344. header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1]; ^ 345. 346. header.compression = header_buffer[0]; libavcodec/truemotion1.c:346:5: Assignment 344. header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1]; 345. 346. header.compression = header_buffer[0]; ^ 347. header.deltaset = header_buffer[1]; 348. header.vectable = header_buffer[2]; libavcodec/truemotion1.c:120:1: <Length trace> 118. 119. /* { valid for metatype }, algorithm, num of deltas, vert res, horiz res */ 120. static comp_types compression_types[17] = { ^ 121. { ALGO_NOP, 0, 0, 0 }, 122. libavcodec/truemotion1.c:120:1: Array declaration 118. 119. /* { valid for metatype }, algorithm, num of deltas, vert res, horiz res */ 120. static comp_types compression_types[17] = { ^ 121. { ALGO_NOP, 0, 0, 0 }, 122. libavcodec/truemotion1.c:417:9: Array access: Offset: [-oo, 17] Size: 17 415. 416. // FIXME: where to place this ?!?! 417. if (compression_types[header.compression].algorithm == ALGO_RGB24H) ^ 418. s->avctx->pix_fmt = PIX_FMT_RGB32; 419. else
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/truemotion1.c/#L417
d2a_code_trace_data_44365
static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) { STACK *asafes, *newsafes, *bags; int i, bagnid, pbe_nid, pbe_iter, pbe_saltlen; PKCS7 *p7, *p7new; ASN1_OCTET_STRING *p12_data_tmp = NULL, *macnew = NULL; unsigned char mac[EVP_MAX_MD_SIZE]; unsigned int maclen; if (!(asafes = M_PKCS12_unpack_authsafes(p12))) return 0; if(!(newsafes = sk_new(NULL))) return 0; for (i = 0; i < sk_num (asafes); i++) { p7 = (PKCS7 *) sk_value(asafes, i); bagnid = OBJ_obj2nid(p7->type); if (bagnid == NID_pkcs7_data) { bags = M_PKCS12_unpack_p7data(p7); } else if (bagnid == NID_pkcs7_encrypted) { bags = M_PKCS12_unpack_p7encdata(p7, oldpass, -1); alg_get(p7->d.encrypted->enc_data->algorithm, &pbe_nid, &pbe_iter, &pbe_saltlen); } else continue; if (!bags) { sk_pop_free(asafes, (void(*)(void *)) PKCS7_free); return 0; } if (!newpass_bags(bags, oldpass, newpass)) { sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free); sk_pop_free(asafes, (void(*)(void *)) PKCS7_free); return 0; } if (bagnid == NID_pkcs7_data) p7new = PKCS12_pack_p7data(bags); else p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL, pbe_saltlen, pbe_iter, bags); sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free); if(!p7new) { sk_pop_free(asafes, (void(*)(void *)) PKCS7_free); return 0; } sk_push(newsafes, (char *)p7new); } sk_pop_free(asafes, (void(*)(void *)) PKCS7_free); p12_data_tmp = p12->authsafes->d.data; if(!(p12->authsafes->d.data = ASN1_OCTET_STRING_new())) goto saferr; if(!M_PKCS12_pack_authsafes(p12, newsafes)) goto saferr; if(!PKCS12_gen_mac(p12, newpass, -1, mac, &maclen)) goto saferr; if(!(macnew = ASN1_OCTET_STRING_new())) goto saferr; if(!ASN1_OCTET_STRING_set(macnew, mac, maclen)) goto saferr; ASN1_OCTET_STRING_free(p12->mac->dinfo->digest); p12->mac->dinfo->digest = macnew; ASN1_OCTET_STRING_free(p12_data_tmp); return 1; saferr: ASN1_OCTET_STRING_free(p12->authsafes->d.data); ASN1_OCTET_STRING_free(macnew); p12->authsafes->d.data = p12_data_tmp; return 0; } crypto/pkcs12/p12_npas.c:136: error: UNINITIALIZED_VALUE The value read from pbe_iter was never initialized. Showing all 1 steps of the trace crypto/pkcs12/p12_npas.c:136:16: 134. /* Repack bag in same form with new password */ 135. if (bagnid == NID_pkcs7_data) p7new = PKCS12_pack_p7data(bags); 136. > else p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL, 137. pbe_saltlen, pbe_iter, bags); 138. sk_pop_free(bags, (void(*)(void *)) PKCS12_SAFEBAG_free);
https://github.com/openssl/openssl/blob/0e1c06128adbfd2d88dc304db2262140bad045fd/crypto/pkcs12/p12_npas.c/#L136
d2a_code_trace_data_44366
void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur, Picture *last, int y, int h, int picture_structure, int first_field, int draw_edges, int low_delay, int v_edge_pos, int h_edge_pos) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); int hshift = desc->log2_chroma_w; int vshift = desc->log2_chroma_h; const int field_pic = picture_structure != PICT_FRAME; if(field_pic){ h <<= 1; y <<= 1; } if (!avctx->hwaccel && draw_edges && cur->reference && !(avctx->flags & CODEC_FLAG_EMU_EDGE)) { int *linesize = cur->f.linesize; int sides = 0, edge_h; if (y==0) sides |= EDGE_TOP; if (y + h >= v_edge_pos) sides |= EDGE_BOTTOM; edge_h= FFMIN(h, v_edge_pos - y); dsp->draw_edges(cur->f.data[0] + y * linesize[0], linesize[0], h_edge_pos, edge_h, EDGE_WIDTH, EDGE_WIDTH, sides); dsp->draw_edges(cur->f.data[1] + (y >> vshift) * linesize[1], linesize[1], h_edge_pos >> hshift, edge_h >> vshift, EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides); dsp->draw_edges(cur->f.data[2] + (y >> vshift) * linesize[2], linesize[2], h_edge_pos >> hshift, edge_h >> vshift, EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides); } h = FFMIN(h, avctx->height - y); if(field_pic && 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 || low_delay || (avctx->slice_flags & SLICE_FLAG_CODED_ORDER)) src = &cur->f; else if (last) src = &last->f; else return; if (cur->f.pict_type == AV_PICTURE_TYPE_B && picture_structure == PICT_FRAME && avctx->codec_id != AV_CODEC_ID_SVQ3) { for (i = 0; i < AV_NUM_DATA_POINTERS; i++) offset[i] = 0; }else{ 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, picture_structure, h); } } libavcodec/mpegvideo.c:2146: error: Null Dereference pointer `desc` last assigned on line 2145 could be null and is dereferenced at line 2146, column 18. libavcodec/mpegvideo.c:2140:1: start of procedure ff_draw_horiz_band() 2138. * @param h is the normal height, this will be reduced automatically if needed for the last row 2139. */ 2140. void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur, ^ 2141. Picture *last, int y, int h, int picture_structure, 2142. int first_field, int draw_edges, int low_delay, libavcodec/mpegvideo.c:2145:5: 2143. int v_edge_pos, int h_edge_pos) 2144. { 2145. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); ^ 2146. int hshift = desc->log2_chroma_w; 2147. int vshift = desc->log2_chroma_h; libavutil/pixdesc.c:1507:1: start of procedure av_pix_fmt_desc_get() 1505. } 1506. 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1509:9: Taking false branch 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1509:24: Taking true branch 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1510:9: 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1510. return NULL; ^ 1511. return &av_pix_fmt_descriptors[pix_fmt]; 1512. } libavutil/pixdesc.c:1512:1: return from a call to av_pix_fmt_desc_get 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; 1512. } ^ 1513. 1514. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) libavcodec/mpegvideo.c:2146:5: 2144. { 2145. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); 2146. int hshift = desc->log2_chroma_w; ^ 2147. int vshift = desc->log2_chroma_h; 2148. const int field_pic = picture_structure != PICT_FRAME;
https://github.com/libav/libav/blob/d7b3ee9a3a03ab88d61a5895fbdbc6689f4dd671/libavcodec/mpegvideo.c/#L2146
d2a_code_trace_data_44367
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:1063: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:1063:9: 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) 1063. CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift) ^ 1064. CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift) 1065. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1063
d2a_code_trace_data_44368
static const char *skip_space(const char *s) { while (ossl_isspace(*s)) s++; return s; } test/property_test.c:311: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, 37] by call to `ossl_method_store_add`. Showing all 25 steps of the trace test/property_test.c:277:9: Array declaration 275. char *impl; 276. } impls[] = { 277. { 1, "fast=no, colour=green", "a" }, ^ 278. { 1, "fast, colour=blue", "b" }, 279. { 1, "", "-" }, test/property_test.c:311:14: Call 309. 310. for (i = 0; i < OSSL_NELEM(impls); i++) 311. if (!TEST_true(ossl_method_store_add(store, NULL, impls[i].nid, ^ 312. impls[i].prop, impls[i].impl, 313. NULL, NULL))) { crypto/property/property.c:177:1: Parameter `*properties` 175. } 176. 177. > int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov, 178. int nid, const char *properties, void *method, 179. int (*method_up_ref)(void *), crypto/property/property.c:213:28: Call 211. ossl_method_cache_flush(store, nid); 212. if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) { 213. impl->properties = ossl_parse_property(store->ctx, properties); ^ 214. if (impl->properties == NULL) 215. goto err; crypto/property/property_parse.c:329:1: Parameter `*defn` 327. } 328. 329. > OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn) 330. { 331. PROPERTY_DEFINITION *prop = NULL; crypto/property/property_parse.c:334:5: Assignment 332. OSSL_PROPERTY_LIST *res = NULL; 333. STACK_OF(PROPERTY_DEFINITION) *sk; 334. const char *s = defn; ^ 335. int done; 336. crypto/property/property_parse.c:340:9: Call 338. return NULL; 339. 340. s = skip_space(s); ^ 341. done = *s == '\0'; 342. while (!done) { crypto/property/property_parse.c:52:1: Parameter `*s` 50. DEFINE_STACK_OF(PROPERTY_DEFINITION) 51. 52. > static const char *skip_space(const char *s) 53. { 54. while (ossl_isspace(*s)) crypto/property/property_parse.c:56:5: Assignment 54. while (ossl_isspace(*s)) 55. s++; 56. return s; ^ 57. } 58. crypto/property/property_parse.c:340:5: Assignment 338. return NULL; 339. 340. s = skip_space(s); ^ 341. done = *s == '\0'; 342. while (!done) { crypto/property/property_parse.c:350:14: Call 348. memset(&prop->v, 0, sizeof(prop->v)); 349. prop->optional = 0; 350. if (!parse_name(ctx, &s, 1, &prop->name_idx)) ^ 351. goto err; 352. prop->oper = PROPERTY_OPER_EQ; crypto/property/property_parse.c:83:1: Parameter `**t` 81. } 82. 83. > static int parse_name(OPENSSL_CTX *ctx, const char *t[], int create, 84. OSSL_PROPERTY_IDX *idx) 85. { crypto/property/property_parse.c:358:13: Call 356. goto err; 357. } 358. if (match_ch(&s, '=')) { ^ 359. if (!parse_value(ctx, &s, prop, 1)) { 360. ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE, crypto/property/property_parse.c:59:1: Parameter `**t` 57. } 58. 59. > static int match_ch(const char *t[], char m) 60. { 61. const char *s = *t; crypto/property/property_parse.c:359:18: Call 357. } 358. if (match_ch(&s, '=')) { 359. if (!parse_value(ctx, &s, prop, 1)) { ^ 360. ERR_raise_data(ERR_LIB_PROP, PROP_R_NO_VALUE, 361. "HERE-->%s", start); crypto/property/property_parse.c:254:1: Parameter `**t` 252. } 253. 254. > static int parse_value(OPENSSL_CTX *ctx, const char *t[], 255. PROPERTY_DEFINITION *res, int create) 256. { crypto/property/property_parse.c:257:5: Assignment 255. PROPERTY_DEFINITION *res, int create) 256. { 257. const char *s = *t; ^ 258. int r = 0; 259. crypto/property/property_parse.c:261:9: Assignment 259. 260. if (*s == '"' || *s == '\'') { 261. s++; ^ 262. r = parse_string(ctx, &s, s[-1], res, create); 263. } else if (*s == '+') { crypto/property/property_parse.c:262:13: Call 260. if (*s == '"' || *s == '\'') { 261. s++; 262. r = parse_string(ctx, &s, s[-1], res, create); ^ 263. } else if (*s == '+') { 264. s++; crypto/property/property_parse.c:190:1: Parameter `**t` 188. } 189. 190. > static int parse_string(OPENSSL_CTX *ctx, const char *t[], char delim, 191. PROPERTY_DEFINITION *res, const int create) 192. { crypto/property/property_parse.c:194:5: Assignment 192. { 193. char v[1000]; 194. const char *s = *t; ^ 195. size_t i = 0; 196. int err = 0; crypto/property/property_parse.c:216:10: Call 214. res->v.str_val = ossl_property_value(ctx, v, create); 215. } 216. *t = skip_space(s + 1); ^ 217. res->type = PROPERTY_TYPE_STRING; 218. return !err; crypto/property/property_parse.c:52:1: <Length trace> 50. DEFINE_STACK_OF(PROPERTY_DEFINITION) 51. 52. > static const char *skip_space(const char *s) 53. { 54. while (ossl_isspace(*s)) crypto/property/property_parse.c:52:1: Parameter `*s` 50. DEFINE_STACK_OF(PROPERTY_DEFINITION) 51. 52. > static const char *skip_space(const char *s) 53. { 54. while (ossl_isspace(*s)) crypto/property/property_parse.c:54:12: Array access: Offset: [2, +oo] Size: [1, 37] by call to `ossl_method_store_add` 52. static const char *skip_space(const char *s) 53. { 54. while (ossl_isspace(*s)) ^ 55. s++; 56. return s;
https://github.com/openssl/openssl/blob/c1d56231ef6385b557ec72eec508e55ea26ca8b0/crypto/property/property_parse.c/#L54
d2a_code_trace_data_44369
static int rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width, uint32 *img_length, unsigned char **ibuff_ptr) { int shift_width; uint32 bytes_per_pixel, bytes_per_sample; uint32 row, rowsize, src_offset, dst_offset; uint32 i, col, width, length; uint32 colsize, buffsize, col_offset, pix_offset; unsigned char *ibuff; unsigned char *src; unsigned char *dst; uint16 spp, bps; float res_temp; unsigned char *rbuff = NULL; width = *img_width; length = *img_length; spp = image->spp; bps = image->bps; rowsize = ((bps * spp * width) + 7) / 8; colsize = ((bps * spp * length) + 7) / 8; if ((colsize * width) > (rowsize * length)) buffsize = (colsize + 1) * width; else buffsize = (rowsize + 1) * length; bytes_per_sample = (bps + 7) / 8; bytes_per_pixel = ((bps * spp) + 7) / 8; if (bytes_per_pixel < (bytes_per_sample + 1)) shift_width = bytes_per_pixel; else shift_width = bytes_per_sample + 1; switch (rotation) { case 0: case 360: return (0); case 90: case 180: case 270: break; default: TIFFError("rotateImage", "Invalid rotation angle %d", rotation); return (-1); } if (!(rbuff = (unsigned char *)_TIFFmalloc(buffsize))) { TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize); return (-1); } _TIFFmemset(rbuff, '\0', buffsize); ibuff = *ibuff_ptr; switch (rotation) { case 180: if ((bps % 8) == 0) { src = ibuff; pix_offset = (spp * bps) / 8; for (row = 0; row < length; row++) { dst_offset = (length - row - 1) * rowsize; for (col = 0; col < width; col++) { col_offset = (width - col - 1) * pix_offset; dst = rbuff + dst_offset + col_offset; for (i = 0; i < bytes_per_pixel; i++) *dst++ = *src++; } } } else { for (row = 0; row < length; row++) { src_offset = row * rowsize; dst_offset = (length - row - 1) * rowsize; src = ibuff + src_offset; dst = rbuff + dst_offset; switch (shift_width) { case 1: if (bps == 1) { if (reverseSamples8bits(spp, bps, width, src, dst)) { _TIFFfree(rbuff); return (-1); } break; } if (reverseSamples16bits(spp, bps, width, src, dst)) { _TIFFfree(rbuff); return (-1); } break; case 2: if (reverseSamples24bits(spp, bps, width, src, dst)) { _TIFFfree(rbuff); return (-1); } break; case 3: case 4: case 5: if (reverseSamples32bits(spp, bps, width, src, dst)) { _TIFFfree(rbuff); return (-1); } break; default: TIFFError("rotateImage","Unsupported bit depth %d", bps); _TIFFfree(rbuff); return (-1); } } } _TIFFfree(ibuff); *(ibuff_ptr) = rbuff; break; case 90: if ((bps % 8) == 0) { for (col = 0; col < width; col++) { src_offset = ((length - 1) * rowsize) + (col * bytes_per_pixel); dst_offset = col * colsize; src = ibuff + src_offset; dst = rbuff + dst_offset; for (row = length; row > 0; row--) { for (i = 0; i < bytes_per_pixel; i++) *dst++ = *(src + i); src -= rowsize; } } } else { for (col = 0; col < width; col++) { src_offset = (length - 1) * rowsize; dst_offset = col * colsize; src = ibuff + src_offset; dst = rbuff + dst_offset; switch (shift_width) { case 1: if (bps == 1) { if (rotateContigSamples8bits(rotation, spp, bps, width, length, col, src, dst)) { _TIFFfree(rbuff); return (-1); } break; } if (rotateContigSamples16bits(rotation, spp, bps, width, length, col, src, dst)) { _TIFFfree(rbuff); return (-1); } break; case 2: if (rotateContigSamples24bits(rotation, spp, bps, width, length, col, src, dst)) { _TIFFfree(rbuff); return (-1); } break; case 3: case 4: case 5: if (rotateContigSamples32bits(rotation, spp, bps, width, length, col, src, dst)) { _TIFFfree(rbuff); return (-1); } break; default: TIFFError("rotateImage","Unsupported bit depth %d", bps); _TIFFfree(rbuff); return (-1); } } } _TIFFfree(ibuff); *(ibuff_ptr) = rbuff; *img_width = length; *img_length = width; image->width = length; image->length = width; res_temp = image->xres; image->xres = image->yres; image->yres = res_temp; break; case 270: if ((bps % 8) == 0) { for (col = 0; col < width; col++) { src_offset = col * bytes_per_pixel; dst_offset = (width - col - 1) * colsize; src = ibuff + src_offset; dst = rbuff + dst_offset; for (row = length; row > 0; row--) { for (i = 0; i < bytes_per_pixel; i++) *dst++ = *(src + i); src += rowsize; } } } else { for (col = 0; col < width; col++) { src_offset = 0; dst_offset = (width - col - 1) * colsize; src = ibuff + src_offset; dst = rbuff + dst_offset; switch (shift_width) { case 1: if (bps == 1) { if (rotateContigSamples8bits(rotation, spp, bps, width, length, col, src, dst)) { _TIFFfree(rbuff); return (-1); } break; } if (rotateContigSamples16bits(rotation, spp, bps, width, length, col, src, dst)) { _TIFFfree(rbuff); return (-1); } break; case 2: if (rotateContigSamples24bits(rotation, spp, bps, width, length, col, src, dst)) { _TIFFfree(rbuff); return (-1); } break; case 3: case 4: case 5: if (rotateContigSamples32bits(rotation, spp, bps, width, length, col, src, dst)) { _TIFFfree(rbuff); return (-1); } break; default: TIFFError("rotateImage","Unsupported bit depth %d", bps); _TIFFfree(rbuff); return (-1); } } } _TIFFfree(ibuff); *(ibuff_ptr) = rbuff; *img_width = length; *img_length = width; image->width = length; image->length = width; res_temp = image->xres; image->xres = image->yres; image->yres = res_temp; break; default: break; } return (0); } tools/tiffcrop.c:8403: error: Memory Leak memory dynamically allocated by call to `_TIFFmalloc()` at line 8250, column 34 is not reachable after line 8403, column 5. tools/tiffcrop.c:8204:1: start of procedure rotateImage() 8202. 8203. /* Rotate an image by a multiple of 90 degrees clockwise */ 8204. static int ^ 8205. rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width, 8206. uint32 *img_length, unsigned char **ibuff_ptr) tools/tiffcrop.c:8218:3: 8216. uint16 spp, bps; 8217. float res_temp; 8218. unsigned char *rbuff = NULL; ^ 8219. 8220. width = *img_width; tools/tiffcrop.c:8220:3: 8218. unsigned char *rbuff = NULL; 8219. 8220. width = *img_width; ^ 8221. length = *img_length; 8222. spp = image->spp; tools/tiffcrop.c:8221:3: 8219. 8220. width = *img_width; 8221. length = *img_length; ^ 8222. spp = image->spp; 8223. bps = image->bps; tools/tiffcrop.c:8222:3: 8220. width = *img_width; 8221. length = *img_length; 8222. spp = image->spp; ^ 8223. bps = image->bps; 8224. tools/tiffcrop.c:8223:3: 8221. length = *img_length; 8222. spp = image->spp; 8223. bps = image->bps; ^ 8224. 8225. rowsize = ((bps * spp * width) + 7) / 8; tools/tiffcrop.c:8225:3: 8223. bps = image->bps; 8224. 8225. rowsize = ((bps * spp * width) + 7) / 8; ^ 8226. colsize = ((bps * spp * length) + 7) / 8; 8227. if ((colsize * width) > (rowsize * length)) tools/tiffcrop.c:8226:3: 8224. 8225. rowsize = ((bps * spp * width) + 7) / 8; 8226. colsize = ((bps * spp * length) + 7) / 8; ^ 8227. if ((colsize * width) > (rowsize * length)) 8228. buffsize = (colsize + 1) * width; tools/tiffcrop.c:8227:7: Taking true branch 8225. rowsize = ((bps * spp * width) + 7) / 8; 8226. colsize = ((bps * spp * length) + 7) / 8; 8227. if ((colsize * width) > (rowsize * length)) ^ 8228. buffsize = (colsize + 1) * width; 8229. else tools/tiffcrop.c:8228:5: 8226. colsize = ((bps * spp * length) + 7) / 8; 8227. if ((colsize * width) > (rowsize * length)) 8228. buffsize = (colsize + 1) * width; ^ 8229. else 8230. buffsize = (rowsize + 1) * length; tools/tiffcrop.c:8232:3: 8230. buffsize = (rowsize + 1) * length; 8231. 8232. bytes_per_sample = (bps + 7) / 8; ^ 8233. bytes_per_pixel = ((bps * spp) + 7) / 8; 8234. if (bytes_per_pixel < (bytes_per_sample + 1)) tools/tiffcrop.c:8233:3: 8231. 8232. bytes_per_sample = (bps + 7) / 8; 8233. bytes_per_pixel = ((bps * spp) + 7) / 8; ^ 8234. if (bytes_per_pixel < (bytes_per_sample + 1)) 8235. shift_width = bytes_per_pixel; tools/tiffcrop.c:8234:7: Taking false branch 8232. bytes_per_sample = (bps + 7) / 8; 8233. bytes_per_pixel = ((bps * spp) + 7) / 8; 8234. if (bytes_per_pixel < (bytes_per_sample + 1)) ^ 8235. shift_width = bytes_per_pixel; 8236. else tools/tiffcrop.c:8237:5: 8235. shift_width = bytes_per_pixel; 8236. else 8237. shift_width = bytes_per_sample + 1; ^ 8238. 8239. switch (rotation) tools/tiffcrop.c:8239:3: 8237. shift_width = bytes_per_sample + 1; 8238. 8239. switch (rotation) ^ 8240. { 8241. case 0: tools/tiffcrop.c:8241:5: Switch condition is false. Skipping switch case 8239. switch (rotation) 8240. { 8241. case 0: ^ 8242. case 360: return (0); 8243. case 90: tools/tiffcrop.c:8242:5: Switch condition is false. Skipping switch case 8240. { 8241. case 0: 8242. case 360: return (0); ^ 8243. case 90: 8244. case 180: tools/tiffcrop.c:8243:5: Switch condition is false. Skipping switch case 8241. case 0: 8242. case 360: return (0); 8243. case 90: ^ 8244. case 180: 8245. case 270: break; tools/tiffcrop.c:8244:5: Switch condition is true. Entering switch case 8242. case 360: return (0); 8243. case 90: 8244. case 180: ^ 8245. case 270: break; 8246. default: TIFFError("rotateImage", "Invalid rotation angle %d", rotation); tools/tiffcrop.c:8250:9: 8248. } 8249. 8250. if (!(rbuff = (unsigned char *)_TIFFmalloc(buffsize))) ^ 8251. { 8252. TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize); libtiff/tif_unix.c:253:1: start of procedure _TIFFmalloc() 251. #endif 252. 253. void* ^ 254. _TIFFmalloc(tmsize_t s) 255. { libtiff/tif_unix.c:256:2: 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_unix.c:257:1: return from a call to _TIFFmalloc 255. { 256. return (malloc((size_t) s)); 257. } ^ 258. 259. void tools/tiffcrop.c:8250:9: Taking false branch 8248. } 8249. 8250. if (!(rbuff = (unsigned char *)_TIFFmalloc(buffsize))) ^ 8251. { 8252. TIFFError("rotateImage", "Unable to allocate rotation buffer of %1u bytes", buffsize); tools/tiffcrop.c:8255:3: 8253. return (-1); 8254. } 8255. _TIFFmemset(rbuff, '\0', buffsize); ^ 8256. 8257. ibuff = *ibuff_ptr; libtiff/tif_unix.c:271:1: start of procedure _TIFFmemset() 269. } 270. 271. void ^ 272. _TIFFmemset(void* p, int v, tmsize_t c) 273. { libtiff/tif_unix.c:274:2: 272. _TIFFmemset(void* p, int v, tmsize_t c) 273. { 274. memset(p, v, (size_t) c); ^ 275. } 276. libtiff/tif_unix.c:275:1: return from a call to _TIFFmemset 273. { 274. memset(p, v, (size_t) c); 275. } ^ 276. 277. void tools/tiffcrop.c:8257:3: 8255. _TIFFmemset(rbuff, '\0', buffsize); 8256. 8257. ibuff = *ibuff_ptr; ^ 8258. switch (rotation) 8259. { tools/tiffcrop.c:8258:3: 8256. 8257. ibuff = *ibuff_ptr; 8258. switch (rotation) ^ 8259. { 8260. case 180: if ((bps % 8) == 0) /* byte alligned data */ tools/tiffcrop.c:8260:5: Switch condition is false. Skipping switch case 8258. switch (rotation) 8259. { 8260. case 180: if ((bps % 8) == 0) /* byte alligned data */ ^ 8261. { 8262. src = ibuff; tools/tiffcrop.c:8326:5: Switch condition is false. Skipping switch case 8324. break; 8325. 8326. case 90: if ((bps % 8) == 0) /* byte aligned data */ ^ 8327. { 8328. for (col = 0; col < width; col++) tools/tiffcrop.c:8403:5: Switch condition is false. Skipping switch case 8401. break; 8402. 8403. case 270: if ((bps % 8) == 0) /* byte aligned data */ ^ 8404. { 8405. for (col = 0; col < width; col++)
https://gitlab.com/libtiff/libtiff/blob/b69a1998bedfabc32cd541408bffdef05bd01e45/tools/tiffcrop.c/#L8403
d2a_code_trace_data_44370
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:973: error: Uninitialized Value The value read from l7 was never initialized. libavcodec/h264pred.c:973:32: 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; ^ 974. SRC(0,7)=SRC(1,7)=SRC(2,6)=SRC(2,7)=SRC(3,6)= 975. SRC(3,7)=SRC(4,5)=SRC(4,6)=SRC(4,7)=SRC(5,5)=
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264pred.c/#L973
d2a_code_trace_data_44371
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:720: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqr`. Showing all 18 steps of the trace test/bntest.c:719:13: Call 717. for (j = 0; j < 2; j++) { 718. BN_GF2m_mod(c, a, b[j]); 719. BN_GF2m_mod_sqrt(d, a, b[j], ctx); ^ 720. BN_GF2m_mod_sqr(e, d, b[j], ctx); 721. BN_GF2m_add(f, c, e); crypto/bn/bn_gf2m.c:1016:1: Parameter `ctx->stack.depth` 1014. * for best performance, use the BN_GF2m_mod_sqrt_arr function. 1015. */ 1016. > int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 1017. { 1018. int ret = 0; test/bntest.c:720:13: Call 718. BN_GF2m_mod(c, a, b[j]); 719. BN_GF2m_mod_sqrt(d, a, b[j], ctx); 720. BN_GF2m_mod_sqr(e, d, b[j], ctx); ^ 721. BN_GF2m_add(f, c, e); 722. /* Test that d^2 = a, where d = sqrt(a). */ crypto/bn/bn_gf2m.c:532:1: Parameter `ctx->stack.depth` 530. * use the BN_GF2m_mod_sqr_arr function. 531. */ 532. > int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 533. { 534. int ret = 0; test/bntest.c:719:13: Call 717. for (j = 0; j < 2; j++) { 718. BN_GF2m_mod(c, a, b[j]); 719. BN_GF2m_mod_sqrt(d, a, b[j], ctx); ^ 720. BN_GF2m_mod_sqr(e, d, b[j], ctx); 721. BN_GF2m_add(f, c, e); crypto/bn/bn_gf2m.c:1016:1: Parameter `ctx->stack.depth` 1014. * for best performance, use the BN_GF2m_mod_sqrt_arr function. 1015. */ 1016. > int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 1017. { 1018. int ret = 0; test/bntest.c:720:13: Call 718. BN_GF2m_mod(c, a, b[j]); 719. BN_GF2m_mod_sqrt(d, a, b[j], ctx); 720. BN_GF2m_mod_sqr(e, d, b[j], ctx); ^ 721. BN_GF2m_add(f, c, e); 722. /* Test that d^2 = a, where d = sqrt(a). */ crypto/bn/bn_gf2m.c:532:1: Parameter `ctx->stack.depth` 530. * use the BN_GF2m_mod_sqr_arr function. 531. */ 532. > int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 533. { 534. int ret = 0; crypto/bn/bn_gf2m.c:547:11: Call 545. goto err; 546. } 547. ret = BN_GF2m_mod_sqr_arr(r, a, arr, ctx); ^ 548. bn_check_top(r); 549. err: crypto/bn/bn_gf2m.c:497:1: Parameter `ctx->stack.depth` 495. 496. /* Square a, reduce the result mod p, and store it in a. r could be a. */ 497. > int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], 498. BN_CTX *ctx) 499. { crypto/bn/bn_gf2m.c:504:5: Call 502. 503. bn_check_top(a); 504. BN_CTX_start(ctx); ^ 505. if ((s = BN_CTX_get(ctx)) == NULL) 506. goto err; 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_gf2m.c:522:5: Call 520. ret = 1; 521. err: 522. BN_CTX_end(ctx); ^ 523. return ret; 524. } 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_GF2m_mod_sqr` 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/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_44372
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:1136: error: Uninitialized Value The value read from ref[_] was never initialized. libavcodec/h264.c:1136:32: 1134. const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; 1135. if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ 1136. if(ref[0] == 0) ^ 1137. fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); 1138. if(ref[1] == 0)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1136
d2a_code_trace_data_44373
void *lh_delete(LHASH *lh, 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; 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/s3_pkt.c:768: error: INTEGER_OVERFLOW_L2 ([0, `s->ctx->sessions->num_items`] - 1):unsigned64 by call to `ssl3_get_record`. Showing all 13 steps of the trace ssl/s3_pkt.c:707:1: Parameter `s->ctx->sessions->num_items` 705. * none of our business 706. */ 707. > int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len) 708. { 709. int al,i,j,ret; ssl/s3_pkt.c:768:7: Call 766. if ((rr->length == 0) || (s->rstate == SSL_ST_READ_BODY)) 767. { 768. ret=ssl3_get_record(s); ^ 769. if (ret <= 0) return(ret); 770. } ssl/s3_pkt.c:231:1: Parameter `s->ctx->sessions->num_items` 229. */ 230. /* used only by ssl3_read_bytes */ 231. > static int ssl3_get_record(SSL *s) 232. { 233. int ssl_major,ssl_minor,al; ssl/s3_pkt.c:431:2: Call 429. return(1); 430. f_err: 431. ssl3_send_alert(s,SSL3_AL_FATAL,al); ^ 432. err: 433. return(ret); ssl/s3_pkt.c:1144:1: Parameter `s->ctx->sessions->num_items` 1142. } 1143. 1144. > void ssl3_send_alert(SSL *s, int level, int desc) 1145. { 1146. /* Map tls/ssl alert value to correct one */ ssl/s3_pkt.c:1151:3: Call 1149. /* If a fatal one, remove from cache */ 1150. if ((level == 2) && (s->session != NULL)) 1151. SSL_CTX_remove_session(s->ctx,s->session); ^ 1152. 1153. s->s3->alert_dispatch=1; ssl/ssl_sess.c:413:1: Parameter `ctx->sessions->num_items` 411. } 412. 413. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 414. { 415. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:415:9: Call 413. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 414. { 415. return remove_session_lock(ctx, c, 1); ^ 416. } 417. ssl/ssl_sess.c:418:1: Parameter `ctx->sessions->num_items` 416. } 417. 418. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 419. { 420. SSL_SESSION *r; ssl/ssl_sess.c:426:20: Call 424. { 425. if(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); 426. r=(SSL_SESSION *)lh_delete(ctx->sessions,c); ^ 427. if (r != NULL) 428. { crypto/lhash/lhash.c:217:1: <LHS trace> 215. } 216. 217. > void *lh_delete(LHASH *lh, 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, void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:240:2: Binary operation: ([0, s->ctx->sessions->num_items] - 1):unsigned64 by call to `ssl3_get_record` 238. } 239. 240. lh->num_items--; ^ 241. if ((lh->num_nodes > MIN_NODES) && 242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
https://github.com/openssl/openssl/blob/1c890fa86415d7f739509701e213a2093fe53438/crypto/lhash/lhash.c/#L240
d2a_code_trace_data_44374
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/s_cb.c:186: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`. Showing all 9 steps of the trace apps/s_cb.c:186:9: Call 184. case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: 185. BIO_printf(bio_err, "notBefore="); 186. ASN1_TIME_print(bio_err, X509_get_notBefore(err_cert)); ^ 187. BIO_printf(bio_err, "\n"); 188. break; 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_44375
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/dh/dh_check.c:144: error: INTEGER_OVERFLOW_L2 (0 - [0, 24]):unsigned64 by call to `BN_mod_word`. Showing all 10 steps of the trace crypto/dh/dh_check.c:144:13: Call 142. 143. } else if (BN_is_word(dh->g, DH_GENERATOR_2)) { 144. l = BN_mod_word(dh->p, 24); ^ 145. if (l == (BN_ULONG)-1) 146. goto err; crypto/bn/bn_word.c:13:1: Parameter `w` 11. #include "bn_lcl.h" 12. 13. > BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) 14. { 15. #ifndef BN_LLONG crypto/bn/bn_word.c:35:15: Call 33. return (BN_ULONG)-1; 34. 35. ret = BN_div_word(tmp, w); ^ 36. BN_free(tmp); 37. crypto/bn/bn_word.c:61:1: Parameter `w` 59. } 60. 61. > BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) 62. { 63. BN_ULONG ret = 0; crypto/bn/bn_word.c:67:5: Assignment 65. 66. bn_check_top(a); 67. w &= BN_MASK2; ^ 68. 69. if (!w) crypto/bn/bn_word.c:76:20: Call 74. 75. /* normalize input (so bn_div_words doesn't complain) */ 76. j = BN_BITS2 - BN_num_bits_word(w); ^ 77. w <<= j; 78. if (!BN_lshift(a, a, j)) crypto/bn/bn_lib.c:90:1: <RHS trace> 88. } 89. 90. > int BN_num_bits_word(BN_ULONG l) 91. { 92. BN_ULONG x, mask; crypto/bn/bn_lib.c:90:1: Parameter `l` 88. } 89. 90. > int BN_num_bits_word(BN_ULONG l) 91. { 92. BN_ULONG x, mask; crypto/bn/bn_lib.c:96:5: Assignment 94. 95. #if BN_BITS2 > 32 96. x = l >> 32; ^ 97. mask = (0 - x) & BN_MASK2; 98. mask = (0 - (mask >> (BN_BITS2 - 1))); crypto/bn/bn_lib.c:97:5: Binary operation: (0 - [0, 24]):unsigned64 by call to `BN_mod_word` 95. #if BN_BITS2 > 32 96. x = l >> 32; 97. mask = (0 - x) & BN_MASK2; ^ 98. mask = (0 - (mask >> (BN_BITS2 - 1))); 99. bits += 32 & mask;
https://github.com/openssl/openssl/blob/d4c69c69d171edb17b4d609c15891a9599809ed0/crypto/bn/bn_lib.c/#L97
d2a_code_trace_data_44376
static ossl_inline void constant_time_lookup(void *RESTRICT out_, const void *table_, word_t elem_bytes, word_t n_table, word_t idx) { big_register_t big_one = br_set_to_mask(1), big_i = br_set_to_mask(idx); unsigned char *out = (unsigned char *)out_; const unsigned char *table = (const unsigned char *)table_; word_t j, k; # ifndef HAS_UNALIGNED_STRUCTS unsigned char maskc; # endif memset(out, 0, elem_bytes); for (j = 0; j < n_table; j++, big_i -= big_one) { big_register_t br_mask = br_is_zero(big_i); word_t mask; # ifndef HAS_UNALIGNED_STRUCTS maskc = (unsigned char)br_mask; # endif for (k = 0; k <= elem_bytes - sizeof(big_register_t); k += sizeof(big_register_t)) { if (elem_bytes % sizeof(big_register_t)) { # ifdef HAS_UNALIGNED_STRUCTS ((unaligned_br_t *)(out + k))->unaligned |= br_mask & ((const unaligned_br_t *) (&table[k + j * elem_bytes]))->unaligned; # else size_t i; for (i = 0; i < sizeof(big_register_t); i++) out[k + i] |= maskc & ((unsigned char *) table) [k + (j * elem_bytes) + i]; # endif } else { *(big_register_t *)(out + k) |= br_mask & *(const big_register_t *)(&table[k + j * elem_bytes]); } } mask = word_is_zero(idx ^ j); # ifndef HAS_UNALIGNED_STRUCTS maskc = (unsigned char)mask; # endif if (elem_bytes % sizeof(big_register_t) >= sizeof(word_t)) { for (; k <= elem_bytes - sizeof(word_t); k += sizeof(word_t)) { if (elem_bytes % sizeof(word_t)) { # ifdef HAS_UNALIGNED_STRUCTS *(word_t *)(out + k) |= mask & ((const unaligned_word_t *) (&table[k + j * elem_bytes]))->unaligned; # else size_t i; for (i = 0; i < sizeof(word_t); i++) out[k + i] |= maskc & ((unsigned char *)table) [k + (j * elem_bytes) + i]; # endif } else { *(word_t *)(out + k) |= mask & *(const word_t *)(&table[k + j * elem_bytes]); } } } if (elem_bytes % sizeof(word_t)) { for (; k < elem_bytes; k += 1) { out[k] |= mask & table[k + j * elem_bytes]; } } } } crypto/ec/curve448/constant_time.h:214: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `word_is_zero`. Showing all 5 steps of the trace crypto/ec/curve448/constant_time.h:164:1: Parameter `idx` 162. * The table and output must not alias. 163. */ 164. > static ossl_inline void constant_time_lookup(void *RESTRICT out_, 165. const void *table_, 166. word_t elem_bytes, crypto/ec/curve448/constant_time.h:214:16: Call 212. } 213. 214. mask = word_is_zero(idx ^ j); ^ 215. # ifndef HAS_UNALIGNED_STRUCTS 216. maskc = (unsigned char)mask; 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/constant_time.h/#L214
d2a_code_trace_data_44377
static int mpegts_read_header(AVFormatContext *s, AVFormatParameters *ap) { MpegTSContext *ts = s->priv_data; ByteIOContext *pb = s->pb; uint8_t buf[1024]; int len; int64_t pos; if (ap) { ts->mpeg2ts_compute_pcr = ap->mpeg2ts_compute_pcr; if(ap->mpeg2ts_raw){ av_log(s, AV_LOG_ERROR, "use mpegtsraw_demuxer!\n"); return -1; } } pos = url_ftell(pb); len = get_buffer(pb, buf, sizeof(buf)); if (len != sizeof(buf)) goto fail; ts->raw_packet_size = get_packet_size(buf, sizeof(buf)); if (ts->raw_packet_size <= 0) goto fail; ts->stream = s; ts->auto_guess = 0; if (s->iformat == &mpegts_demuxer) { url_fseek(pb, pos, SEEK_SET); mpegts_scan_sdt(ts); mpegts_set_service(ts); handle_packets(ts, s->probesize); ts->auto_guess = 1; #ifdef DEBUG_SI av_log(ts->stream, AV_LOG_DEBUG, "tuning done\n"); #endif s->ctx_flags |= AVFMTCTX_NOHEADER; } else { AVStream *st; int pcr_pid, pid, nb_packets, nb_pcrs, ret, pcr_l; int64_t pcrs[2], pcr_h; int packet_count[2]; uint8_t packet[TS_PACKET_SIZE]; st = av_new_stream(s, 0); if (!st) goto fail; av_set_pts_info(st, 60, 1, 27000000); st->codec->codec_type = CODEC_TYPE_DATA; st->codec->codec_id = CODEC_ID_MPEG2TS; pcr_pid = -1; nb_pcrs = 0; nb_packets = 0; for(;;) { ret = read_packet(s->pb, packet, ts->raw_packet_size); if (ret < 0) return -1; pid = AV_RB16(packet + 1) & 0x1fff; if ((pcr_pid == -1 || pcr_pid == pid) && parse_pcr(&pcr_h, &pcr_l, packet) == 0) { pcr_pid = pid; packet_count[nb_pcrs] = nb_packets; pcrs[nb_pcrs] = pcr_h * 300 + pcr_l; nb_pcrs++; if (nb_pcrs >= 2) break; } nb_packets++; } ts->pcr_incr = (pcrs[1] - pcrs[0]) / (packet_count[1] - packet_count[0]); ts->cur_pcr = pcrs[0] - ts->pcr_incr * packet_count[0]; s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr; st->codec->bit_rate = s->bit_rate; st->start_time = ts->cur_pcr; #if 0 av_log(ts->stream, AV_LOG_DEBUG, "start=%0.3f pcr=%0.3f incr=%d\n", st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr); #endif } url_fseek(pb, pos, SEEK_SET); return 0; fail: return -1; } libavformat/mpegts.c:1292: error: Uninitialized Value The value read from packet_count[_] was never initialized. libavformat/mpegts.c:1292:9: 1290. /* NOTE1: the bitrate is computed without the FEC */ 1291. /* NOTE2: it is only the bitrate of the start of the stream */ 1292. ts->pcr_incr = (pcrs[1] - pcrs[0]) / (packet_count[1] - packet_count[0]); ^ 1293. ts->cur_pcr = pcrs[0] - ts->pcr_incr * packet_count[0]; 1294. s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/mpegts.c/#L1292
d2a_code_trace_data_44378
static inline int get_context(PlaneContext *p, int16_t *src, int16_t *last, int16_t *last2) { const int LT = last[-1]; const int T = last[0]; const int RT = last[1]; const int L = src[-1]; if (p->quant_table[3][127]) { const int TT = last2[0]; const int LL = src[-2]; return p->quant_table[0][(L - LT) & 0xFF] + p->quant_table[1][(LT - T) & 0xFF] + p->quant_table[2][(T - RT) & 0xFF] + p->quant_table[3][(LL - L) & 0xFF] + p->quant_table[4][(TT - T) & 0xFF]; } else return p->quant_table[0][(L - LT) & 0xFF] + p->quant_table[1][(LT - T) & 0xFF] + p->quant_table[2][(T - RT) & 0xFF]; } libavcodec/ffv1enc.c:922: error: Buffer Overrun L3 Offset: [-1, +oo] (⇐ [0, +oo] + -1) Size: 3 by call to `encode_rgb_frame`. libavcodec/ffv1enc.c:878:5: Assignment 876. FFV1Context *fs = *(void **)arg; 877. FFV1Context *f = fs->avctx->priv_data; 878. int width = fs->slice_width; ^ 879. int height = fs->slice_height; 880. int x = fs->slice_x; libavcodec/ffv1enc.c:922:9: Call 920. p->data[1] + ps * x + y * p->linesize[1], 921. p->data[2] + ps * x + y * p->linesize[2] }; 922. encode_rgb_frame(fs, planes, width, height, p->linesize); ^ 923. } 924. emms_c(); libavcodec/ffv1enc.c:296:1: Array declaration 294. } 295. 296. static void encode_rgb_frame(FFV1Context *s, const uint8_t *src[3], ^ 297. int w, int h, const int stride[3]) 298. { libavcodec/ffv1enc.c:349:17: Call 347. sample[p][1][w] = sample[p][1][w - 1]; 348. if (lbd) 349. encode_line(s, w, sample[p], (p + 1) / 2, 9); ^ 350. else 351. encode_line(s, w, sample[p], (p + 1) / 2, bits + 1); libavcodec/ffv1enc.c:170:1: Parameter `w` 168. } 169. 170. static av_always_inline int encode_line(FFV1Context *s, int w, ^ 171. int16_t *sample[3], 172. int plane_index, int bits) libavcodec/ffv1enc.c:196:19: Call 194. int diff, context; 195. 196. context = get_context(p, sample[0] + x, sample[1] + x, sample[2] + x); ^ 197. diff = sample[0][x] - predict(sample[0] + x, sample[1] + x); 198. libavcodec/ffv1.h:140:1: <Length trace> 138. } 139. 140. static inline int get_context(PlaneContext *p, int16_t *src, ^ 141. int16_t *last, int16_t *last2) 142. { libavcodec/ffv1.h:140:1: Parameter `*last` 138. } 139. 140. static inline int get_context(PlaneContext *p, int16_t *src, ^ 141. int16_t *last, int16_t *last2) 142. { libavcodec/ffv1.h:143:20: Array access: Offset: [-1, +oo] (⇐ [0, +oo] + -1) Size: 3 by call to `encode_rgb_frame` 141. int16_t *last, int16_t *last2) 142. { 143. const int LT = last[-1]; ^ 144. const int T = last[0]; 145. const int RT = last[1];
https://github.com/libav/libav/blob/2cef68da69a17ed09c313ba3c3850ec1cc0a80e0/libavcodec/ffv1.h/#L143
d2a_code_trace_data_44379
static const char *skip_space(const char *s) { while (ossl_isspace(*s)) s++; return s; } test/property_test.c:299: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, 37] by call to `ossl_method_store_add`. Showing all 25 steps of the trace test/property_test.c:265:9: Array declaration 263. char *impl; 264. } impls[] = { 265. { 1, "fast=no, colour=green", "a" }, ^ 266. { 1, "fast, colour=blue", "b" }, 267. { 1, "", "-" }, test/property_test.c:299:14: Call 297. 298. for (i = 0; i < OSSL_NELEM(impls); i++) 299. if (!TEST_true(ossl_method_store_add(store, impls[i].nid, impls[i].prop, ^ 300. impls[i].impl, NULL))) { 301. TEST_note("iteration %zd", i + 1); crypto/property/property.c:176:1: Parameter `*properties` 174. } 175. 176. > int ossl_method_store_add(OSSL_METHOD_STORE *store, 177. int nid, const char *properties, 178. void *method, void (*method_destruct)(void *)) crypto/property/property.c:205:28: Call 203. ossl_method_cache_flush(store, nid); 204. if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) { 205. impl->properties = ossl_parse_property(store->ctx, properties); ^ 206. if (impl->properties == NULL) 207. goto err; crypto/property/property_parse.c:317:1: Parameter `*defn` 315. } 316. 317. > OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn) 318. { 319. PROPERTY_DEFINITION *prop = NULL; crypto/property/property_parse.c:322:5: Assignment 320. OSSL_PROPERTY_LIST *res = NULL; 321. STACK_OF(PROPERTY_DEFINITION) *sk; 322. const char *s = defn; ^ 323. int done; 324. crypto/property/property_parse.c:328:9: Call 326. return NULL; 327. 328. s = skip_space(s); ^ 329. done = *s == '\0'; 330. while (!done) { crypto/property/property_parse.c:50:1: Parameter `*s` 48. DEFINE_STACK_OF(PROPERTY_DEFINITION) 49. 50. > static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) crypto/property/property_parse.c:54:5: Assignment 52. while (ossl_isspace(*s)) 53. s++; 54. return s; ^ 55. } 56. crypto/property/property_parse.c:328:5: Assignment 326. return NULL; 327. 328. s = skip_space(s); ^ 329. done = *s == '\0'; 330. while (!done) { crypto/property/property_parse.c:335:14: Call 333. goto err; 334. memset(&prop->v, 0, sizeof(prop->v)); 335. if (!parse_name(ctx, &s, 1, &prop->name_idx)) ^ 336. goto err; 337. prop->oper = PROPERTY_OPER_EQ; crypto/property/property_parse.c:81:1: Parameter `**t` 79. } 80. 81. > static int parse_name(OPENSSL_CTX *ctx, const char *t[], int create, 82. OSSL_PROPERTY_IDX *idx) 83. { crypto/property/property_parse.c:342:13: Call 340. goto err; 341. } 342. if (match_ch(&s, '=')) { ^ 343. if (!parse_value(ctx, &s, prop, 1)) { 344. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); crypto/property/property_parse.c:57:1: Parameter `**t` 55. } 56. 57. > static int match_ch(const char *t[], char m) 58. { 59. const char *s = *t; crypto/property/property_parse.c:343:18: Call 341. } 342. if (match_ch(&s, '=')) { 343. if (!parse_value(ctx, &s, prop, 1)) { ^ 344. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); 345. goto err; crypto/property/property_parse.c:245:1: Parameter `**t` 243. } 244. 245. > static int parse_value(OPENSSL_CTX *ctx, const char *t[], 246. PROPERTY_DEFINITION *res, int create) 247. { crypto/property/property_parse.c:248:5: Assignment 246. PROPERTY_DEFINITION *res, int create) 247. { 248. const char *s = *t; ^ 249. int r = 0; 250. crypto/property/property_parse.c:252:9: Assignment 250. 251. if (*s == '"' || *s == '\'') { 252. s++; ^ 253. r = parse_string(ctx, &s, s[-1], res, create); 254. } else if (*s == '+') { crypto/property/property_parse.c:253:13: Call 251. if (*s == '"' || *s == '\'') { 252. s++; 253. r = parse_string(ctx, &s, s[-1], res, create); ^ 254. } else if (*s == '+') { 255. s++; crypto/property/property_parse.c:184:1: Parameter `**t` 182. } 183. 184. > static int parse_string(OPENSSL_CTX *ctx, const char *t[], char delim, 185. PROPERTY_DEFINITION *res, const int create) 186. { crypto/property/property_parse.c:188:5: Assignment 186. { 187. char v[1000]; 188. const char *s = *t; ^ 189. size_t i = 0; 190. int err = 0; crypto/property/property_parse.c:205:10: Call 203. } 204. v[i] = '\0'; 205. *t = skip_space(s + 1); ^ 206. if (err) 207. PROPerr(PROP_F_PARSE_STRING, PROP_R_STRING_TOO_LONG); crypto/property/property_parse.c:50:1: <Length trace> 48. DEFINE_STACK_OF(PROPERTY_DEFINITION) 49. 50. > static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) crypto/property/property_parse.c:50:1: Parameter `*s` 48. DEFINE_STACK_OF(PROPERTY_DEFINITION) 49. 50. > static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) crypto/property/property_parse.c:52:12: Array access: Offset: [2, +oo] Size: [1, 37] by call to `ossl_method_store_add` 50. static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) ^ 53. s++; 54. return s;
https://github.com/openssl/openssl/blob/260a16f33682a819414fcba6161708a5e6bdff50/crypto/property/property_parse.c/#L52
d2a_code_trace_data_44380
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/dsa/dsa_ossl.c:421: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_sub`. Showing all 18 steps of the trace crypto/dsa/dsa_ossl.c:419:14: Call 417. 418. BN_CTX_start(ctx); 419. if ((e = BN_CTX_get(ctx)) != NULL ^ 420. && BN_set_word(r, 2) 421. && BN_sub(e, q, r) crypto/bn/bn_ctx.c:219:5: Call 217. } 218. /* OK, make sure the returned bignum is "zero" */ 219. BN_zero(ret); ^ 220. /* clear BN_FLG_CONSTTIME if leaked from previous frames */ 221. ret->flags &= (~BN_FLG_CONSTTIME); crypto/bn/bn_lib.c: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/dsa/dsa_ossl.c:421:16: Call 419. if ((e = BN_CTX_get(ctx)) != NULL 420. && BN_set_word(r, 2) 421. && BN_sub(e, q, r) ^ 422. && BN_mod_exp_mont(r, k, e, q, ctx, NULL)) 423. res = r; crypto/bn/bn_add.c:45:1: Parameter `*r->d` 43. 44. /* signed sub of b from a. */ 45. > int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 46. { 47. int ret, r_neg, cmp_res; crypto/bn/bn_add.c:54:15: Call 52. if (a->neg != b->neg) { 53. r_neg = a->neg; 54. ret = BN_uadd(r, a, b); ^ 55. } else { 56. cmp_res = BN_ucmp(a, b); crypto/bn/bn_add.c:76:1: Parameter `*r->d` 74. 75. /* unsigned add of b to a, r can be equal to a or b. */ 76. > int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 77. { 78. int max, min, dif; crypto/bn/bn_add.c:96:9: Call 94. dif = max - min; 95. 96. if (bn_wexpand(r, max + 1) == NULL) ^ 97. return 0; 98. crypto/bn/bn_lib.c:960:1: Parameter `*a->d` 958. } 959. 960. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 961. { 962. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:962:37: Call 960. BIGNUM *bn_wexpand(BIGNUM *a, int words) 961. { 962. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 963. } 964. crypto/bn/bn_lib.c:245:1: Parameter `*b->d` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `*b->d` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_sub` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_44381
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) { PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | (diff > (0 - (PTRDIFF_T)len))); return overlapped; } crypto/crmf/crmf_lib.c:727: error: INTEGER_OVERFLOW_L2 (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate`. Showing all 7 steps of the trace crypto/crmf/crmf_lib.c:727:17: Call 725. 726. if (!EVP_DecryptInit(evp_ctx, cipher, ek, iv) 727. || !EVP_DecryptUpdate(evp_ctx, outbuf, &outlen, ^ 728. ecert->encValue->data, 729. ecert->encValue->length) crypto/evp/evp_enc.c:443:1: Parameter `ctx->cipher->block_size` 441. } 442. 443. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 444. const unsigned char *in, int inl) 445. { crypto/evp/evp_enc.c:455:5: Assignment 453. } 454. 455. b = ctx->cipher->block_size; ^ 456. 457. if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS)) crypto/evp/evp_enc.c:488:16: Call 486. /* see comment about PTRDIFF_T comparison above */ 487. if (((PTRDIFF_T)out == (PTRDIFF_T)in) 488. || is_partially_overlapping(out, in, b)) { ^ 489. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING); 490. return 0; crypto/evp/evp_enc.c:283:1: <RHS trace> 281. #endif 282. 283. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 284. { 285. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:283:1: Parameter `len` 281. #endif 282. 283. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 284. { 285. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:292:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate` 290. */ 291. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | 292. (diff > (0 - (PTRDIFF_T)len))); ^ 293. 294. return overlapped;
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/evp/evp_enc.c/#L292
d2a_code_trace_data_44382
int test_mod_exp(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; int i; a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); BN_one(a); BN_one(b); BN_zero(c); if (BN_mod_exp(d, a, b, c, ctx)) { fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); return 0; } BN_bntest_rand(c, 30, 0, 1); 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_mod_exp(d, a, b, c, ctx)) return (0); 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, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); } BN_exp(e, a, b, ctx); BN_sub(e, e, d); BN_div(a, b, e, c, ctx); if (!BN_is_zero(b)) { fprintf(stderr, "Modulo exponentiation test failed!\n"); return 0; } } BN_hex2bn(&a, "050505050505"); BN_hex2bn(&b, "02"); BN_hex2bn(&c, "4141414141414141414141274141414141414141414141414141414141414141" "4141414141414141414141414141414141414141414141414141414141414141" "4141414141414141414141800000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000001"); BN_mod_exp(d, a, b, c, ctx); BN_mul(e, a, a, ctx); if (BN_cmp(d, e)) { fprintf(stderr, "BN_mod_exp and BN_mul produce different results!\n"); return 0; } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); return (1); } test/bntest.c:1040: error: MEMORY_LEAK memory dynamically allocated to `b` by call to `BN_new()` at line 975, column 9 is not reachable after line 1040, column 1. Showing all 145 steps of the trace test/bntest.c:969:1: start of procedure test_mod_exp() 967. } 968. 969. > int test_mod_exp(BIO *bp, BN_CTX *ctx) 970. { 971. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:974:5: 972. int i; 973. 974. > a = BN_new(); 975. b = BN_new(); 976. 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:975:5: 973. 974. a = BN_new(); 975. > b = BN_new(); 976. c = BN_new(); 977. 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:976:5: 974. a = BN_new(); 975. b = BN_new(); 976. > c = BN_new(); 977. d = BN_new(); 978. 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:977:5: 975. b = BN_new(); 976. c = BN_new(); 977. > d = BN_new(); 978. e = BN_new(); 979. 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:978:5: 976. c = BN_new(); 977. d = BN_new(); 978. > e = BN_new(); 979. 980. BN_one(a); 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:980:5: 978. e = BN_new(); 979. 980. > BN_one(a); 981. BN_one(b); 982. BN_zero(c); 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:981:5: 979. 980. BN_one(a); 981. > BN_one(b); 982. BN_zero(c); 983. if (BN_mod_exp(d, a, b, c, ctx)) { 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:982:5: 980. BN_one(a); 981. BN_one(b); 982. > BN_zero(c); 983. if (BN_mod_exp(d, a, b, c, ctx)) { 984. fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); 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) test/bntest.c:983:9: Taking true branch 981. BN_one(b); 982. BN_zero(c); 983. if (BN_mod_exp(d, a, b, c, ctx)) { ^ 984. fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); 985. return 0; test/bntest.c:984:9: 982. BN_zero(c); 983. if (BN_mod_exp(d, a, b, c, ctx)) { 984. > fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); 985. return 0; 986. } test/bntest.c:985:9: 983. if (BN_mod_exp(d, a, b, c, ctx)) { 984. fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); 985. > return 0; 986. } 987. test/bntest.c:1040:1: return from a call to test_mod_exp 1038. BN_free(e); 1039. return (1); 1040. > } 1041. 1042. int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L1040
d2a_code_trace_data_44383
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_clnt.c:1964: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`. Showing all 15 steps of the trace ssl/statem/statem_clnt.c:1938:1: Parameter `s->initial_ctx->sessions->num_items` 1936. } 1937. 1938. > MSG_PROCESS_RETURN tls_process_server_done(SSL *s, PACKET *pkt) 1939. { 1940. if (PACKET_remaining(pkt) > 0) { ssl/statem/statem_clnt.c:1963:10: Call 1961. * the server 1962. */ 1963. if (!ssl3_check_cert_and_algorithm(s)) { ^ 1964. ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); 1965. ossl_statem_set_error(s); ssl/statem/statem_clnt.c:2690:1: Parameter `s->initial_ctx->sessions->num_items` 2688. #define has_bits(i,m) (((i)&(m)) == (m)) 2689. 2690. > int ssl3_check_cert_and_algorithm(SSL *s) 2691. { 2692. int i; ssl/statem/statem_clnt.c:1964:9: Call 1962. */ 1963. if (!ssl3_check_cert_and_algorithm(s)) { 1964. ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); ^ 1965. ossl_statem_set_error(s); 1966. return MSG_PROCESS_ERROR; ssl/s3_msg.c:64:1: Parameter `s->initial_ctx->sessions->num_items` 62. } 63. 64. > int ssl3_send_alert(SSL *s, int level, int desc) 65. { 66. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:75:9: Call 73. /* If a fatal one, remove from cache */ 74. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 75. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 76. 77. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items` 689. } 690. 691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:693:12: Call 691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ^ 694. } 695. ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items` 694. } 695. 696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 697. { 698. SSL_SESSION *r; ssl/ssl_sess.c:706:17: Call 704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 705. ret = 1; 706. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 707. SSL_SESSION_list_remove(ctx, c); 708. } ssl/ssl_locl.h:581:1: Parameter `lh->num_items` 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:581:1: Call 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_send_alert` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_44384
int BN_dec2bn(BIGNUM **bn, const char *a) { BIGNUM *ret = NULL; BN_ULONG l = 0; int neg = 0, i, j; int num; if ((a == NULL) || (*a == '\0')) return (0); if (*a == '-') { neg = 1; a++; } for (i = 0; i <= (INT_MAX/4) && isdigit((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 = BN_DEC_NUM - (i % BN_DEC_NUM); if (j == BN_DEC_NUM) j = 0; l = 0; while (--i >= 0) { l *= 10; l += *a - '0'; a++; if (++j == BN_DEC_NUM) { if (!BN_mul_word(ret, BN_DEC_CONV) || !BN_add_word(ret, l)) goto err; l = 0; j = 0; } } 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:1623: error: BUFFER_OVERRUN_L2 Offset: [0, 536870913] (⇐ [0, 2] + [0, 536870911]) Size: 2 by call to `BN_asc2bn`. Showing all 9 steps of the trace test/bntest.c:1623:10: Call 1621. int st = 0; 1622. 1623. if (!BN_asc2bn(&bn, "0") || !BN_is_zero(bn) || BN_is_negative(bn)) { ^ 1624. fprintf(stderr, "BN_asc2bn(0) gave a bad result.\n"); 1625. goto err; crypto/bn/bn_print.c:269:1: Parameter `*a` 267. } 268. 269. > int BN_asc2bn(BIGNUM **bn, const char *a) 270. { 271. const char *p = a; crypto/bn/bn_print.c:271:5: Assignment 269. int BN_asc2bn(BIGNUM **bn, const char *a) 270. { 271. const char *p = a; ^ 272. 273. if (*p == '-') crypto/bn/bn_print.c:280:14: Call 278. return 0; 279. } else { 280. if (!BN_dec2bn(bn, p)) ^ 281. return 0; 282. } crypto/bn/bn_print.c:213:10: <Offset trace> 211. } 212. 213. for (i = 0; i <= (INT_MAX/4) && isdigit((unsigned char)a[i]); i++) ^ 214. continue; 215. crypto/bn/bn_print.c:213:10: Assignment 211. } 212. 213. for (i = 0; i <= (INT_MAX/4) && isdigit((unsigned char)a[i]); i++) ^ 214. continue; 215. crypto/bn/bn_print.c:199:1: <Length trace> 197. } 198. 199. > int BN_dec2bn(BIGNUM **bn, const char *a) 200. { 201. BIGNUM *ret = NULL; crypto/bn/bn_print.c:199:1: Parameter `*a` 197. } 198. 199. > int BN_dec2bn(BIGNUM **bn, const char *a) 200. { 201. BIGNUM *ret = NULL; crypto/bn/bn_print.c:213:37: Array access: Offset: [0, 536870913] (⇐ [0, 2] + [0, 536870911]) Size: 2 by call to `BN_asc2bn` 211. } 212. 213. for (i = 0; i <= (INT_MAX/4) && isdigit((unsigned char)a[i]); i++) ^ 214. continue; 215.
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_print.c/#L213
d2a_code_trace_data_44385
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/ssl_sess.c:606: error: INTEGER_OVERFLOW_L2 ([0, 1+max(0, `s->session_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`. Showing all 13 steps of the trace ssl/ssl_sess.c:461:1: Parameter `s->session_ctx->sessions->num_items` 459. * if the server should issue a new session ticket (to 0 otherwise). 460. */ 461. > int ssl_get_prev_session(SSL *s, CLIENTHELLO_MSG *hello, int *al) 462. { 463. /* This is used only by servers. */ ssl/ssl_sess.c:606:13: Call 604. if (!(s->s3->flags & TLS1_FLAGS_RECEIVED_EXTMS)) { 605. SSLerr(SSL_F_SSL_GET_PREV_SESSION, SSL_R_INCONSISTENT_EXTMS); 606. ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); ^ 607. fatal = 1; 608. goto err; ssl/s3_msg.c:63:1: Parameter `s->session_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:77:9: Call 75. /* If a fatal one, remove from cache */ 76. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 77. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 78. 79. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:725:1: Parameter `ctx->sessions->num_items` 723. } 724. 725. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 726. { 727. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:727:12: Call 725. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 726. { 727. return remove_session_lock(ctx, c, 1); ^ 728. } 729. ssl/ssl_sess.c:730:1: Parameter `ctx->sessions->num_items` 728. } 729. 730. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 731. { 732. SSL_SESSION *r; ssl/ssl_sess.c:740:17: Call 738. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 739. ret = 1; 740. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 741. SSL_SESSION_list_remove(ctx, c); 742. } ssl/ssl_locl.h:721:1: Parameter `lh->num_items` 719. } TLSEXT_INDEX; 720. 721. > DEFINE_LHASH_OF(SSL_SESSION); 722. /* Needed in ssl_cert.c */ 723. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:721:1: Call 719. } TLSEXT_INDEX; 720. 721. > DEFINE_LHASH_OF(SSL_SESSION); 722. /* Needed in ssl_cert.c */ 723. 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, 1+max(0, s->session_ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_send_alert` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/ffbaf06ade6dab6a0805a24087cf2e84c5db8d43/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_44386
void CRYPTO_free(void *str) { #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (call_malloc_debug) { CRYPTO_mem_debug_free(str, 0); free(str); CRYPTO_mem_debug_free(str, 1); } else { free(str); } #else free(str); #endif } crypto/x509/x509_cmp.c:268: error: USE_AFTER_FREE call to `EVP_MD_CTX_free()` eventually accesses memory that was invalidated by call to `free()` on line 262 indirectly during the call to `EVP_DigestInit_ex()`. Showing all 16 steps of the trace crypto/x509/x509_cmp.c:252:26: invalidation part of the trace starts here 250. unsigned long X509_NAME_hash_old(X509_NAME *x) 251. { 252. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); ^ 253. unsigned long ret = 0; 254. unsigned char md[16]; crypto/x509/x509_cmp.c:252:26: passed as argument to `EVP_MD_CTX_new` 250. unsigned long X509_NAME_hash_old(X509_NAME *x) 251. { 252. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); ^ 253. unsigned long ret = 0; 254. unsigned char md[16]; crypto/x509/x509_cmp.c:252:26: return from call to `EVP_MD_CTX_new` 250. unsigned long X509_NAME_hash_old(X509_NAME *x) 251. { 252. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); ^ 253. unsigned long ret = 0; 254. unsigned char md[16]; crypto/x509/x509_cmp.c:252:5: assigned 250. unsigned long X509_NAME_hash_old(X509_NAME *x) 251. { 252. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); ^ 253. unsigned long ret = 0; 254. unsigned char md[16]; crypto/x509/x509_cmp.c:262:9: when calling `EVP_DigestInit_ex` here 260. i2d_X509_NAME(x, NULL); 261. EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); 262. if (EVP_DigestInit_ex(md_ctx, EVP_md5(), NULL) ^ 263. && EVP_DigestUpdate(md_ctx, x->bytes->data, x->bytes->length) 264. && EVP_DigestFinal_ex(md_ctx, md, NULL)) crypto/evp/digest.c:170:1: parameter `ctx` of EVP_DigestInit_ex 168. } 169. 170. > int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) 171. { 172. EVP_MD_CTX_clear_flags(ctx, EVP_MD_CTX_FLAG_CLEANED); crypto/evp/digest.c:229:13: when calling `CRYPTO_free` here 227. if (ctx->digest != type) { 228. if (ctx->digest && ctx->digest->ctx_size) 229. OPENSSL_free(ctx->md_data); ^ 230. ctx->digest = type; 231. if (!(ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) && type->ctx_size) { 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/x509/x509_cmp.c:252:26: use-after-lifetime part of the trace starts here 250. unsigned long X509_NAME_hash_old(X509_NAME *x) 251. { 252. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); ^ 253. unsigned long ret = 0; 254. unsigned char md[16]; crypto/x509/x509_cmp.c:252:26: passed as argument to `EVP_MD_CTX_new` 250. unsigned long X509_NAME_hash_old(X509_NAME *x) 251. { 252. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); ^ 253. unsigned long ret = 0; 254. unsigned char md[16]; crypto/x509/x509_cmp.c:252:26: return from call to `EVP_MD_CTX_new` 250. unsigned long X509_NAME_hash_old(X509_NAME *x) 251. { 252. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); ^ 253. unsigned long ret = 0; 254. unsigned char md[16]; crypto/x509/x509_cmp.c:252:5: assigned 250. unsigned long X509_NAME_hash_old(X509_NAME *x) 251. { 252. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); ^ 253. unsigned long ret = 0; 254. unsigned char md[16]; crypto/x509/x509_cmp.c:268:5: when calling `EVP_MD_CTX_free` here 266. ((unsigned long)md[2] << 16L) | ((unsigned long)md[3] << 24L) 267. ) & 0xffffffffL; 268. EVP_MD_CTX_free(md_ctx); ^ 269. 270. return (ret); 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: invalid access occurs here 243. } 244. #else 245. free(str); ^ 246. #endif 247. }
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/mem.c/#L245
d2a_code_trace_data_44387
static int vc1_decode_p_mb(VC1Context *v) { MpegEncContext *s = &v->s; GetBitContext *gb = &s->gb; int i, j; int mb_pos = s->mb_x + s->mb_y * s->mb_stride; int cbp; int mqdiff, mquant; int ttmb = v->ttfrm; int status; static const int size_table[6] = { 0, 2, 3, 4, 5, 8 }, offset_table[6] = { 0, 1, 3, 7, 15, 31 }; int mb_has_coeffs = 1; int dmv_x, dmv_y; int index, index1; int val, sign; int first_block = 1; int dst_idx, off; int skipped, fourmv; mquant = v->pq; if (v->mv_type_is_raw) fourmv = get_bits1(gb); else fourmv = v->mv_type_mb_plane[mb_pos]; if (v->skip_is_raw) skipped = get_bits1(gb); else skipped = v->s.mbskip_table[mb_pos]; s->dsp.clear_blocks(s->block[0]); if (!fourmv) { if (!skipped) { GET_MVDATA(dmv_x, dmv_y); if (s->mb_intra) { s->current_picture.motion_val[1][s->block_index[0]][0] = 0; s->current_picture.motion_val[1][s->block_index[0]][1] = 0; } s->current_picture.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16; vc1_pred_mv(s, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0]); if (s->mb_intra && !mb_has_coeffs) { GET_MQUANT(); s->ac_pred = get_bits1(gb); cbp = 0; } else if (mb_has_coeffs) { if (s->mb_intra) s->ac_pred = get_bits1(gb); cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); GET_MQUANT(); } else { mquant = v->pq; cbp = 0; } s->current_picture.qscale_table[mb_pos] = mquant; if (!v->ttmbf && !s->mb_intra && mb_has_coeffs) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); if(!s->mb_intra) vc1_mc_1mv(v, 0); dst_idx = 0; for (i=0; i<6; i++) { s->dc_val[0][s->block_index[i]] = 0; dst_idx += i >> 2; val = ((cbp >> (5 - i)) & 1); off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize); v->mb_type[0][s->block_index[i]] = s->mb_intra; if(s->mb_intra) { v->a_avail = v->c_avail = 0; if(i == 2 || i == 3 || !s->first_slice_line) v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]]; if(i == 1 || i == 3 || s->mb_x) v->c_avail = v->mb_type[0][s->block_index[i] - 1]; vc1_decode_intra_block(v, s->block[i], i, val, mquant, (i&4)?v->codingset2:v->codingset); if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue; s->dsp.vc1_inv_trans_8x8(s->block[i]); if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1; s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); if(v->pq >= 9 && v->overlap) { if(v->c_avail) s->dsp.vc1_h_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); if(v->a_avail) s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); } } else if(val) { vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize, (i&4) && (s->flags & CODEC_FLAG_GRAY)); if(!v->ttmbf && ttmb < 8) ttmb = -1; first_block = 0; } } } else { s->mb_intra = 0; for(i = 0; i < 6; i++) { v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; } s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP; s->current_picture.qscale_table[mb_pos] = 0; vc1_pred_mv(s, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0]); vc1_mc_1mv(v, 0); return 0; } } else { if (!skipped ) { int intra_count = 0, coded_inter = 0; int is_intra[6], is_coded[6]; cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); for (i=0; i<6; i++) { val = ((cbp >> (5 - i)) & 1); s->dc_val[0][s->block_index[i]] = 0; s->mb_intra = 0; if(i < 4) { dmv_x = dmv_y = 0; s->mb_intra = 0; mb_has_coeffs = 0; if(val) { GET_MVDATA(dmv_x, dmv_y); } vc1_pred_mv(s, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0]); if(!s->mb_intra) vc1_mc_4mv_luma(v, i); intra_count += s->mb_intra; is_intra[i] = s->mb_intra; is_coded[i] = mb_has_coeffs; } if(i&4){ is_intra[i] = (intra_count >= 3); is_coded[i] = val; } if(i == 4) vc1_mc_4mv_chroma(v); v->mb_type[0][s->block_index[i]] = is_intra[i]; if(!coded_inter) coded_inter = !is_intra[i] & is_coded[i]; } if(!intra_count && !coded_inter) return 0; dst_idx = 0; GET_MQUANT(); s->current_picture.qscale_table[mb_pos] = mquant; { int intrapred = 0; for(i=0; i<6; i++) if(is_intra[i]) { if(((!s->first_slice_line || (i==2 || i==3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]]) || ((s->mb_x || (i==1 || i==3)) && v->mb_type[0][s->block_index[i] - 1])) { intrapred = 1; break; } } if(intrapred)s->ac_pred = get_bits1(gb); else s->ac_pred = 0; } if (!v->ttmbf && coded_inter) ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); for (i=0; i<6; i++) { dst_idx += i >> 2; off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize); s->mb_intra = is_intra[i]; if (is_intra[i]) { v->a_avail = v->c_avail = 0; if(i == 2 || i == 3 || !s->first_slice_line) v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]]; if(i == 1 || i == 3 || s->mb_x) v->c_avail = v->mb_type[0][s->block_index[i] - 1]; vc1_decode_intra_block(v, s->block[i], i, is_coded[i], mquant, (i&4)?v->codingset2:v->codingset); if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue; s->dsp.vc1_inv_trans_8x8(s->block[i]); if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1; s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize); if(v->pq >= 9 && v->overlap) { if(v->c_avail) s->dsp.vc1_h_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); if(v->a_avail) s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); } } else if(is_coded[i]) { status = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize, (i&4) && (s->flags & CODEC_FLAG_GRAY)); if(!v->ttmbf && ttmb < 8) ttmb = -1; first_block = 0; } } return status; } else { s->mb_intra = 0; s->current_picture.qscale_table[mb_pos] = 0; for (i=0; i<6; i++) { v->mb_type[0][s->block_index[i]] = 0; s->dc_val[0][s->block_index[i]] = 0; } for (i=0; i<4; i++) { vc1_pred_mv(s, i, 0, 0, 0, v->range_x, v->range_y, v->mb_type[0]); vc1_mc_4mv_luma(v, i); } vc1_mc_4mv_chroma(v); s->current_picture.qscale_table[mb_pos] = 0; return 0; } } return -1; } libavcodec/vc1.c:3203: error: Uninitialized Value The value read from is_coded[_] was never initialized. libavcodec/vc1.c:3203:27: 3201. s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2)); 3202. } 3203. } else if(is_coded[i]) { ^ 3204. status = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize, (i&4) && (s->flags & CODEC_FLAG_GRAY)); 3205. if(!v->ttmbf && ttmb < 8) ttmb = -1;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vc1.c/#L3203
d2a_code_trace_data_44388
static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey) { int i; if (pkey->type == EVP_PKEY_DH) { X509 *x; i = -1; x = c->pkeys[SSL_PKEY_DH_RSA].x509; if (x && X509_check_private_key(x, pkey)) i = SSL_PKEY_DH_RSA; x = c->pkeys[SSL_PKEY_DH_DSA].x509; if (i == -1 && x && X509_check_private_key(x, pkey)) i = SSL_PKEY_DH_DSA; ERR_clear_error(); } else i=ssl_cert_type(NULL,pkey); if (i < 0) { SSLerr(SSL_F_SSL_SET_PKEY,SSL_R_UNKNOWN_CERTIFICATE_TYPE); return(0); } if (c->pkeys[i].x509 != NULL) { EVP_PKEY *pktmp; pktmp = X509_get_pubkey(c->pkeys[i].x509); EVP_PKEY_copy_parameters(pktmp,pkey); EVP_PKEY_free(pktmp); ERR_clear_error(); #ifndef OPENSSL_NO_RSA if ((pkey->type == EVP_PKEY_RSA) && (RSA_flags(pkey->pkey.rsa) & RSA_METHOD_FLAG_NO_CHECK)) ; else #endif if (!X509_check_private_key(c->pkeys[i].x509,pkey)) { X509_free(c->pkeys[i].x509); c->pkeys[i].x509 = NULL; return 0; } } if (c->pkeys[i].privatekey != NULL) EVP_PKEY_free(c->pkeys[i].privatekey); CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); c->pkeys[i].privatekey=pkey; c->key= &(c->pkeys[i]); c->valid=0; return(1); } ssl/ssl_rsa.c:212: error: NULL_DEREFERENCE pointer `pktmp` last assigned on line 211 could be null and is dereferenced by call to `EVP_PKEY_copy_parameters()` at line 212, column 3. Showing all 21 steps of the trace ssl/ssl_rsa.c:182:1: start of procedure ssl_set_pkey() 180. #endif 181. 182. > static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey) 183. { 184. int i; ssl/ssl_rsa.c:188:6: Taking false branch 186. * This means for DH certificates we must set the certificate first. 187. */ 188. if (pkey->type == EVP_PKEY_DH) ^ 189. { 190. X509 *x; ssl/ssl_rsa.c:201:3: Skipping ssl_cert_type(): empty list of specs 199. } 200. else 201. i=ssl_cert_type(NULL,pkey); ^ 202. if (i < 0) 203. { ssl/ssl_rsa.c:202:6: Taking false branch 200. else 201. i=ssl_cert_type(NULL,pkey); 202. if (i < 0) ^ 203. { 204. SSLerr(SSL_F_SSL_SET_PKEY,SSL_R_UNKNOWN_CERTIFICATE_TYPE); ssl/ssl_rsa.c:208:6: Taking true branch 206. } 207. 208. if (c->pkeys[i].x509 != NULL) ^ 209. { 210. EVP_PKEY *pktmp; ssl/ssl_rsa.c:211:3: 209. { 210. EVP_PKEY *pktmp; 211. > pktmp = X509_get_pubkey(c->pkeys[i].x509); 212. EVP_PKEY_copy_parameters(pktmp,pkey); 213. EVP_PKEY_free(pktmp); crypto/x509/x509_cmp.c:300:1: start of procedure X509_get_pubkey() 298. } 299. 300. > EVP_PKEY *X509_get_pubkey(X509 *x) 301. { 302. if ((x == NULL) || (x->cert_info == NULL)) crypto/x509/x509_cmp.c:302:7: Taking false branch 300. EVP_PKEY *X509_get_pubkey(X509 *x) 301. { 302. if ((x == NULL) || (x->cert_info == NULL)) ^ 303. return(NULL); 304. return(X509_PUBKEY_get(x->cert_info->key)); crypto/x509/x509_cmp.c:302:22: Taking false branch 300. EVP_PKEY *X509_get_pubkey(X509 *x) 301. { 302. if ((x == NULL) || (x->cert_info == NULL)) ^ 303. return(NULL); 304. return(X509_PUBKEY_get(x->cert_info->key)); crypto/x509/x509_cmp.c:304:2: 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:133:1: start of procedure X509_PUBKEY_get() 131. } 132. 133. > EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) 134. { 135. EVP_PKEY *ret=NULL; crypto/asn1/x_pubkey.c:135:2: 133. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) 134. { 135. > EVP_PKEY *ret=NULL; 136. 137. if (key == NULL) goto error; crypto/asn1/x_pubkey.c:137:6: Taking false branch 135. EVP_PKEY *ret=NULL; 136. 137. if (key == NULL) goto error; ^ 138. 139. if (key->pkey != NULL) crypto/asn1/x_pubkey.c:139:6: Taking false branch 137. if (key == NULL) goto error; 138. 139. if (key->pkey != NULL) ^ 140. { 141. CRYPTO_add(&key->pkey->references, 1, CRYPTO_LOCK_EVP_PKEY); crypto/asn1/x_pubkey.c:145:6: Taking true branch 143. } 144. 145. if (key->public_key == NULL) goto error; ^ 146. 147. if ((ret = EVP_PKEY_new()) == NULL) crypto/asn1/x_pubkey.c:179:2: 177. return ret; 178. 179. > error: 180. if (ret != NULL) 181. EVP_PKEY_free(ret); crypto/asn1/x_pubkey.c:180:6: Taking false branch 178. 179. error: 180. if (ret != NULL) ^ 181. EVP_PKEY_free(ret); 182. return(NULL); crypto/asn1/x_pubkey.c:182:2: 180. if (ret != NULL) 181. EVP_PKEY_free(ret); 182. > return(NULL); 183. } 184. crypto/asn1/x_pubkey.c:183:2: return from a call to X509_PUBKEY_get 181. EVP_PKEY_free(ret); 182. return(NULL); 183. } ^ 184. 185. /* Now two pseudo ASN1 routines that take an EVP_PKEY structure crypto/x509/x509_cmp.c:305:2: return from a call to X509_get_pubkey 303. return(NULL); 304. return(X509_PUBKEY_get(x->cert_info->key)); 305. } ^ 306. 307. ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) ssl/ssl_rsa.c:212:3: 210. EVP_PKEY *pktmp; 211. pktmp = X509_get_pubkey(c->pkeys[i].x509); 212. > EVP_PKEY_copy_parameters(pktmp,pkey); 213. EVP_PKEY_free(pktmp); 214. ERR_clear_error();
https://github.com/openssl/openssl/blob/2ff5ac55c531de169597110e83873b280c9ea3dd/ssl/ssl_rsa.c/#L212
d2a_code_trace_data_44389
int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain) { ASN1_OCTET_STRING *os = NULL; EVP_MD_CTX *mctx = EVP_MD_CTX_new(); EVP_PKEY_CTX *pkctx = NULL; int r = -1; unsigned char mval[EVP_MAX_MD_SIZE]; unsigned int mlen; if (mctx == NULL) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, ERR_R_MALLOC_FAILURE); goto err; } if (CMS_signed_get_attr_count(si) >= 0) { os = CMS_signed_get0_data_by_OBJ(si, OBJ_nid2obj(NID_pkcs9_messageDigest), -3, V_ASN1_OCTET_STRING); if (!os) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE); goto err; } } if (!cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) goto err; if (EVP_DigestFinal_ex(mctx, mval, &mlen) <= 0) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_UNABLE_TO_FINALIZE_CONTEXT); goto err; } if (os) { if (mlen != (unsigned int)os->length) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH); goto err; } if (memcmp(mval, os->data, mlen)) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_VERIFICATION_FAILURE); r = 0; } else r = 1; } else { const EVP_MD *md = EVP_MD_CTX_md(mctx); pkctx = EVP_PKEY_CTX_new(si->pkey, NULL); if (pkctx == NULL) goto err; if (EVP_PKEY_verify_init(pkctx) <= 0) goto err; if (EVP_PKEY_CTX_set_signature_md(pkctx, md) <= 0) goto err; si->pctx = pkctx; if (!cms_sd_asn1_ctrl(si, 1)) goto err; r = EVP_PKEY_verify(pkctx, si->signature->data, si->signature->length, mval, mlen); if (r <= 0) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_VERIFICATION_FAILURE); r = 0; } } err: EVP_PKEY_CTX_free(pkctx); EVP_MD_CTX_free(mctx); return r; } crypto/cms/cms_sd.c:847: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 778, column 24 is not reachable after line 847, column 5. Showing all 94 steps of the trace crypto/cms/cms_sd.c:775:1: start of procedure CMS_SignerInfo_verify_content() 773. } 774. 775. > int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain) 776. { 777. ASN1_OCTET_STRING *os = NULL; crypto/cms/cms_sd.c:777:5: 775. int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain) 776. { 777. > ASN1_OCTET_STRING *os = NULL; 778. EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 779. EVP_PKEY_CTX *pkctx = NULL; crypto/cms/cms_sd.c:778:5: 776. { 777. ASN1_OCTET_STRING *os = NULL; 778. > EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 779. EVP_PKEY_CTX *pkctx = NULL; 780. int r = -1; crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new() 42. } 43. 44. > EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:46:5: 44. EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. } 48. crypto/mem.c:98:1: start of procedure CRYPTO_zalloc() 96. } 97. 98. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:100:5: 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. > void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:102:9: Taking true branch 100. void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) ^ 103. memset(ret, 0, num); 104. return ret; crypto/mem.c:103:9: 101. 102. if (ret != NULL) 103. > memset(ret, 0, num); 104. return ret; 105. } crypto/mem.c:104:5: 102. if (ret != NULL) 103. memset(ret, 0, num); 104. > return ret; 105. } 106. crypto/mem.c:105:1: return from a call to CRYPTO_zalloc 103. memset(ret, 0, num); 104. return ret; 105. > } 106. 107. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. > } 48. 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) crypto/cms/cms_sd.c:779:5: 777. ASN1_OCTET_STRING *os = NULL; 778. EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 779. > EVP_PKEY_CTX *pkctx = NULL; 780. int r = -1; 781. unsigned char mval[EVP_MAX_MD_SIZE]; crypto/cms/cms_sd.c:780:5: 778. EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 779. EVP_PKEY_CTX *pkctx = NULL; 780. > int r = -1; 781. unsigned char mval[EVP_MAX_MD_SIZE]; 782. unsigned int mlen; crypto/cms/cms_sd.c:784:9: Taking false branch 782. unsigned int mlen; 783. 784. if (mctx == NULL) { ^ 785. CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, ERR_R_MALLOC_FAILURE); 786. goto err; crypto/cms/cms_sd.c:789:9: 787. } 788. /* If we have any signed attributes look for messageDigest value */ 789. > if (CMS_signed_get_attr_count(si) >= 0) { 790. os = CMS_signed_get0_data_by_OBJ(si, 791. OBJ_nid2obj(NID_pkcs9_messageDigest), crypto/cms/cms_att.c:19:1: start of procedure CMS_signed_get_attr_count() 17. /* CMS SignedData Attribute utilities */ 18. 19. > int CMS_signed_get_attr_count(const CMS_SignerInfo *si) 20. { 21. return X509at_get_attr_count(si->signedAttrs); crypto/cms/cms_att.c:21:5: 19. int CMS_signed_get_attr_count(const CMS_SignerInfo *si) 20. { 21. > return X509at_get_attr_count(si->signedAttrs); 22. } 23. crypto/x509/x509_att.c:20:1: start of procedure X509at_get_attr_count() 18. #include "x509_lcl.h" 19. 20. > int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) 21. { 22. return sk_X509_ATTRIBUTE_num(x); crypto/x509/x509_att.c:22:5: 20. int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) 21. { 22. > return sk_X509_ATTRIBUTE_num(x); 23. } 24. include/openssl/x509.h:87:1: start of procedure sk_X509_ATTRIBUTE_num() 85. typedef struct x509_attributes_st X509_ATTRIBUTE; 86. 87. > DEFINE_STACK_OF(X509_ATTRIBUTE) 88. 89. typedef struct X509_req_info_st X509_REQ_INFO; crypto/stack/stack.c:277:1: start of procedure OPENSSL_sk_num() 275. } 276. 277. > int OPENSSL_sk_num(const OPENSSL_STACK *st) 278. { 279. if (st == NULL) crypto/stack/stack.c:279:9: Taking true branch 277. int OPENSSL_sk_num(const OPENSSL_STACK *st) 278. { 279. if (st == NULL) ^ 280. return -1; 281. return st->num; crypto/stack/stack.c:280:9: 278. { 279. if (st == NULL) 280. > return -1; 281. return st->num; 282. } crypto/stack/stack.c:282:1: return from a call to OPENSSL_sk_num 280. return -1; 281. return st->num; 282. > } 283. 284. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) include/openssl/x509.h:87:1: return from a call to sk_X509_ATTRIBUTE_num 85. typedef struct x509_attributes_st X509_ATTRIBUTE; 86. 87. > DEFINE_STACK_OF(X509_ATTRIBUTE) 88. 89. typedef struct X509_req_info_st X509_REQ_INFO; crypto/x509/x509_att.c:23:1: return from a call to X509at_get_attr_count 21. { 22. return sk_X509_ATTRIBUTE_num(x); 23. > } 24. 25. int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, crypto/cms/cms_att.c:22:1: return from a call to CMS_signed_get_attr_count 20. { 21. return X509at_get_attr_count(si->signedAttrs); 22. > } 23. 24. int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, int lastpos) crypto/cms/cms_sd.c:789:9: Taking false branch 787. } 788. /* If we have any signed attributes look for messageDigest value */ 789. if (CMS_signed_get_attr_count(si) >= 0) { ^ 790. os = CMS_signed_get0_data_by_OBJ(si, 791. OBJ_nid2obj(NID_pkcs9_messageDigest), crypto/cms/cms_sd.c:800:10: 798. } 799. 800. > if (!cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) 801. goto err; 802. crypto/cms/cms_lib.c:311:1: start of procedure cms_DigestAlgorithm_find_ctx() 309. /* Locate a message digest content from a BIO chain based on SignerInfo */ 310. 311. > int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain, 312. X509_ALGOR *mdalg) 313. { crypto/cms/cms_lib.c:316:5: 314. int nid; 315. const ASN1_OBJECT *mdoid; 316. > X509_ALGOR_get0(&mdoid, NULL, NULL, mdalg); 317. nid = OBJ_obj2nid(mdoid); 318. /* Look for digest type to match signature */ crypto/asn1/x_algor.c:53:1: start of procedure X509_ALGOR_get0() 51. } 52. 53. > void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, 54. const void **ppval, const X509_ALGOR *algor) 55. { crypto/asn1/x_algor.c:56:9: Taking true branch 54. const void **ppval, const X509_ALGOR *algor) 55. { 56. if (paobj) ^ 57. *paobj = algor->algorithm; 58. if (pptype) { crypto/asn1/x_algor.c:57:9: 55. { 56. if (paobj) 57. > *paobj = algor->algorithm; 58. if (pptype) { 59. if (algor->parameter == NULL) { crypto/asn1/x_algor.c:58:9: Taking false branch 56. if (paobj) 57. *paobj = algor->algorithm; 58. if (pptype) { ^ 59. if (algor->parameter == NULL) { 60. *pptype = V_ASN1_UNDEF; crypto/asn1/x_algor.c:58:5: 56. if (paobj) 57. *paobj = algor->algorithm; 58. > if (pptype) { 59. if (algor->parameter == NULL) { 60. *pptype = V_ASN1_UNDEF; crypto/asn1/x_algor.c:67:1: return from a call to X509_ALGOR_get0 65. *ppval = algor->parameter->value.ptr; 66. } 67. > } 68. 69. /* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */ crypto/cms/cms_lib.c:317:5: 315. const ASN1_OBJECT *mdoid; 316. X509_ALGOR_get0(&mdoid, NULL, NULL, mdalg); 317. > nid = OBJ_obj2nid(mdoid); 318. /* Look for digest type to match signature */ 319. for (;;) { crypto/objects/obj_dat.c:317:1: start of procedure OBJ_obj2nid() 315. IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, obj); 316. 317. > int OBJ_obj2nid(const ASN1_OBJECT *a) 318. { 319. const unsigned int *op; crypto/objects/obj_dat.c:322:9: Taking false branch 320. ADDED_OBJ ad, *adp; 321. 322. if (a == NULL) ^ 323. return (NID_undef); 324. if (a->nid != 0) crypto/objects/obj_dat.c:324:9: Taking false branch 322. if (a == NULL) 323. return (NID_undef); 324. if (a->nid != 0) ^ 325. return (a->nid); 326. crypto/objects/obj_dat.c:327:9: Taking false branch 325. return (a->nid); 326. 327. if (a->length == 0) ^ 328. return NID_undef; 329. crypto/objects/obj_dat.c:330:9: Taking true branch 328. return NID_undef; 329. 330. if (added != NULL) { ^ 331. ad.type = ADDED_DATA; 332. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ crypto/objects/obj_dat.c:331:9: 329. 330. if (added != NULL) { 331. > ad.type = ADDED_DATA; 332. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 333. adp = lh_ADDED_OBJ_retrieve(added, &ad); crypto/objects/obj_dat.c:332:9: 330. if (added != NULL) { 331. ad.type = ADDED_DATA; 332. > ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 333. adp = lh_ADDED_OBJ_retrieve(added, &ad); 334. if (adp != NULL) crypto/objects/obj_dat.c:333:9: 331. ad.type = ADDED_DATA; 332. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 333. > adp = lh_ADDED_OBJ_retrieve(added, &ad); 334. if (adp != NULL) 335. return (adp->obj->nid); crypto/objects/obj_lcl.h:14:1: start of procedure lh_ADDED_OBJ_retrieve() 12. DEFINE_LHASH_OF(OBJ_NAME); 13. typedef struct added_obj_st ADDED_OBJ; 14. > DEFINE_LHASH_OF(ADDED_OBJ); crypto/lhash/lhash.c:131:1: start of procedure OPENSSL_LH_retrieve() 129. } 130. 131. > void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data) 132. { 133. unsigned long hash; crypto/lhash/lhash.c:137:5: 135. void *ret; 136. 137. > lh->error = 0; 138. rn = getrn(lh, data, &hash); 139. crypto/lhash/lhash.c:138:5: Skipping getrn(): empty list of specs 136. 137. lh->error = 0; 138. rn = getrn(lh, data, &hash); ^ 139. 140. if (*rn == NULL) { crypto/lhash/lhash.c:140:9: Taking false branch 138. rn = getrn(lh, data, &hash); 139. 140. if (*rn == NULL) { ^ 141. lh->num_retrieve_miss++; 142. return (NULL); crypto/lhash/lhash.c:144:9: 142. return (NULL); 143. } else { 144. > ret = (*rn)->data; 145. lh->num_retrieve++; 146. } crypto/lhash/lhash.c:145:9: 143. } else { 144. ret = (*rn)->data; 145. > lh->num_retrieve++; 146. } 147. return (ret); crypto/lhash/lhash.c:147:5: 145. lh->num_retrieve++; 146. } 147. > return (ret); 148. } 149. crypto/lhash/lhash.c:148:1: return from a call to OPENSSL_LH_retrieve 146. } 147. return (ret); 148. > } 149. 150. static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, crypto/objects/obj_lcl.h:14:1: return from a call to lh_ADDED_OBJ_retrieve 12. DEFINE_LHASH_OF(OBJ_NAME); 13. typedef struct added_obj_st ADDED_OBJ; 14. > DEFINE_LHASH_OF(ADDED_OBJ); crypto/objects/obj_dat.c:334:13: Taking true branch 332. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 333. adp = lh_ADDED_OBJ_retrieve(added, &ad); 334. if (adp != NULL) ^ 335. return (adp->obj->nid); 336. } crypto/objects/obj_dat.c:335:13: 333. adp = lh_ADDED_OBJ_retrieve(added, &ad); 334. if (adp != NULL) 335. > return (adp->obj->nid); 336. } 337. op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ); crypto/objects/obj_dat.c:341:1: return from a call to OBJ_obj2nid 339. return (NID_undef); 340. return (nid_objs[*op].nid); 341. > } 342. 343. /* crypto/cms/cms_lib.c:336:5: Loop condition is true. Entering loop body 334. return EVP_MD_CTX_copy_ex(mctx, mtmp); 335. chain = BIO_next(chain); 336. } ^ 337. } 338. crypto/cms/cms_lib.c:321:9: Skipping BIO_find_type(): empty list of specs 319. for (;;) { 320. EVP_MD_CTX *mtmp; 321. chain = BIO_find_type(chain, BIO_TYPE_MD); ^ 322. if (chain == NULL) { 323. CMSerr(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX, crypto/cms/cms_lib.c:322:13: Taking true branch 320. EVP_MD_CTX *mtmp; 321. chain = BIO_find_type(chain, BIO_TYPE_MD); 322. if (chain == NULL) { ^ 323. CMSerr(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX, 324. CMS_R_NO_MATCHING_DIGEST); crypto/cms/cms_lib.c:323:13: Skipping ERR_put_error(): empty list of specs 321. chain = BIO_find_type(chain, BIO_TYPE_MD); 322. if (chain == NULL) { 323. CMSerr(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX, ^ 324. CMS_R_NO_MATCHING_DIGEST); 325. return 0; crypto/cms/cms_lib.c:325:13: 323. CMSerr(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX, 324. CMS_R_NO_MATCHING_DIGEST); 325. > return 0; 326. } 327. BIO_get_md_ctx(chain, &mtmp); crypto/cms/cms_lib.c:337:1: return from a call to cms_DigestAlgorithm_find_ctx 335. chain = BIO_next(chain); 336. } 337. > } 338. 339. static STACK_OF(CMS_CertificateChoices) crypto/cms/cms_sd.c:800:10: Taking true branch 798. } 799. 800. if (!cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) ^ 801. goto err; 802. crypto/cms/cms_sd.c:845:2: 843. } 844. 845. > err: 846. EVP_PKEY_CTX_free(pkctx); 847. EVP_MD_CTX_free(mctx); crypto/cms/cms_sd.c:846:5: 844. 845. err: 846. > EVP_PKEY_CTX_free(pkctx); 847. EVP_MD_CTX_free(mctx); 848. return r; crypto/evp/pmeth_lib.c:282:1: start of procedure EVP_PKEY_CTX_free() 280. } 281. 282. > void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) 283. { 284. if (ctx == NULL) crypto/evp/pmeth_lib.c:284:9: Taking true branch 282. void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) 283. { 284. if (ctx == NULL) ^ 285. return; 286. if (ctx->pmeth && ctx->pmeth->cleanup) crypto/evp/pmeth_lib.c:285:9: 283. { 284. if (ctx == NULL) 285. > return; 286. if (ctx->pmeth && ctx->pmeth->cleanup) 287. ctx->pmeth->cleanup(ctx); crypto/evp/pmeth_lib.c:294:1: return from a call to EVP_PKEY_CTX_free 292. #endif 293. OPENSSL_free(ctx); 294. > } 295. 296. int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, crypto/cms/cms_sd.c:847:5: 845. err: 846. EVP_PKEY_CTX_free(pkctx); 847. > EVP_MD_CTX_free(mctx); 848. return r; 849. crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free() 47. } 48. 49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); ^ 52. OPENSSL_free(ctx); 53. } crypto/evp/digest.c:52:5: 50. { 51. EVP_MD_CTX_reset(ctx); 52. > OPENSSL_free(ctx); 53. } 54. crypto/mem.c:163:1: start of procedure CRYPTO_free() 161. } 162. 163. > void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:165:9: Taking true branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:165:30: Taking true branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { 166. free_impl(str, file, line); ^ 167. return; 168. } crypto/mem.c:167:9: 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { 166. free_impl(str, file, line); 167. > return; 168. } 169. crypto/mem.c:181:1: return from a call to CRYPTO_free 179. free(str); 180. #endif 181. > } 182. 183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free 51. EVP_MD_CTX_reset(ctx); 52. OPENSSL_free(ctx); 53. > } 54. 55. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
https://github.com/openssl/openssl/blob/d53b1dd4483243a271eea7288915a1fb5293505c/crypto/cms/cms_sd.c/#L847
d2a_code_trace_data_44390
static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method) { int j,k; int ch; int run, case_val; int switchtable[23] = {0,5,1,5,5,5,5,5,2,5,5,5,5,5,5,5,3,5,5,5,5,5,4}; for (ch = 0; ch < channels; ch++) { for (j = 0; j < 64; ) { if((coding_method[ch][sb][j] - 8) > 22) { run = 1; case_val = 8; } else { switch (switchtable[coding_method[ch][sb][j]-8]) { case 0: run = 10; case_val = 10; break; case 1: run = 1; case_val = 16; break; case 2: run = 5; case_val = 24; break; case 3: run = 3; case_val = 30; break; case 4: run = 1; case_val = 30; break; case 5: run = 1; case_val = 8; break; default: run = 1; case_val = 8; break; } } for (k = 0; k < run; k++) if (j + k < 128) if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j]) if (k > 0) { SAMPLES_NEEDED memset(&coding_method[ch][sb][j + k], case_val, k * sizeof(int8_t)); memset(&coding_method[ch][sb][j + k], case_val, 3 * sizeof(int8_t)); } j += run; } } } libavcodec/qdm2.c:760: error: Buffer Overrun L2 Offset: [0, 30] Size: 30 by call to `fix_coding_method_array`. libavcodec/qdm2.c:759:18: Assignment 757. coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 0xff; 758. } 759. for (sb = 0; sb < 30; sb++) ^ 760. fix_coding_method_array(sb, nb_channels, coding_method); 761. for (ch = 0; ch < nb_channels; ch++) libavcodec/qdm2.c:760:17: Call 758. } 759. for (sb = 0; sb < 30; sb++) 760. fix_coding_method_array(sb, nb_channels, coding_method); ^ 761. for (ch = 0; ch < nb_channels; ch++) 762. for (sb = 0; sb < 30; sb++) libavcodec/qdm2.c:529:1: <Offset trace> 527. * @param coding_method q->coding_method[0][0][0] 528. */ 529. static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method) ^ 530. { 531. int j,k; libavcodec/qdm2.c:529:1: Parameter `sb` 527. * @param coding_method q->coding_method[0][0][0] 528. */ 529. static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method) ^ 530. { 531. int j,k; libavcodec/qdm2.c:529:1: <Length trace> 527. * @param coding_method q->coding_method[0][0][0] 528. */ 529. static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method) ^ 530. { 531. int j,k; libavcodec/qdm2.c:529:1: Parameter `(*coding_method)[*]` 527. * @param coding_method q->coding_method[0][0][0] 528. */ 529. static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method) ^ 530. { 531. int j,k; libavcodec/qdm2.c:554:25: Array access: Offset: [0, 30] Size: 30 by call to `fix_coding_method_array` 552. for (k = 0; k < run; k++) 553. if (j + k < 128) 554. if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j]) ^ 555. if (k > 0) { 556. SAMPLES_NEEDED
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/qdm2.c/#L554
d2a_code_trace_data_44391
static inline void skip_remaining(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE bc->bits >>= n; #else bc->bits <<= n; #endif bc->bits_left -= n; } libavcodec/takdec.c:785: error: Integer Overflow L2 ([0, +oo] - 6):unsigned32 by call to `bitstream_skip`. libavcodec/takdec.c:688:16: Call 686. bitstream_init8(bc, pkt->data, pkt->size); 687. 688. if ((ret = ff_tak_decode_frame_header(avctx, bc, &s->ti, 0)) < 0) ^ 689. return ret; 690. libavcodec/tak.c:127:9: Call 125. TAKStreamInfo *ti, int log_level_offset) 126. { 127. if (bitstream_read(bc, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) { ^ 128. av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n"); 129. return AVERROR_INVALIDDATA; 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/takdec.c:783:21: Call 781. 782. if (avctx->channels == 2) { 783. if (bitstream_read_bit(bc)) { ^ 784. // some kind of subframe length, but it seems to be unused 785. bitstream_skip(bc, 6); 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: 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: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/takdec.c:785:21: Call 783. if (bitstream_read_bit(bc)) { 784. // some kind of subframe length, but it seems to be unused 785. bitstream_skip(bc, 6); ^ 786. } 787. libavcodec/bitstream.h:241:1: Parameter `n` 239. 240. /* Skip n bits in the buffer. */ 241. static inline void bitstream_skip(BitstreamContext *bc, unsigned n) ^ 242. { 243. if (n <= bc->bits_left) libavcodec/bitstream.h:244:9: Call 242. { 243. if (n <= bc->bits_left) 244. skip_remaining(bc, n); ^ 245. else { 246. n -= bc->bits_left; libavcodec/bitstream.h:230:1: <LHS trace> 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: Parameter `bc->bits_left` 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: <RHS trace> 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: Parameter `n` 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:237:5: Binary operation: ([0, +oo] - 6):unsigned32 by call to `bitstream_skip` 235. bc->bits <<= n; 236. #endif 237. bc->bits_left -= n; ^ 238. } 239.
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L237
d2a_code_trace_data_44392
static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, const unsigned char *sess_id, int sesslen, SSL_SESSION **psess) { SSL_SESSION *sess; unsigned char *sdec; const unsigned char *p; int slen, mlen, renew_ticket = 0; unsigned char tick_hmac[EVP_MAX_MD_SIZE]; HMAC_CTX *hctx = NULL; EVP_CIPHER_CTX ctx; SSL_CTX *tctx = s->initial_ctx; if (eticklen < 48) return 2; hctx = HMAC_CTX_new(); if (hctx == NULL) return -2; EVP_CIPHER_CTX_init(&ctx); if (tctx->tlsext_ticket_key_cb) { unsigned char *nctick = (unsigned char *)etick; int rv = tctx->tlsext_ticket_key_cb(s, nctick, nctick + 16, &ctx, hctx, 0); if (rv < 0) return -1; if (rv == 0) return 2; if (rv == 2) renew_ticket = 1; } else { if (memcmp(etick, tctx->tlsext_tick_key_name, 16)) return 2; if (HMAC_Init_ex(hctx, tctx->tlsext_tick_hmac_key, 16, EVP_sha256(), NULL) <= 0 || EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, tctx->tlsext_tick_aes_key, etick + 16) <= 0) { goto err; } } mlen = HMAC_size(hctx); if (mlen < 0) { goto err; } eticklen -= mlen; if (HMAC_Update(hctx, etick, eticklen) <= 0 || HMAC_Final(hctx, tick_hmac, NULL) <= 0) { goto err; } HMAC_CTX_free(hctx); if (CRYPTO_memcmp(tick_hmac, etick + eticklen, mlen)) { EVP_CIPHER_CTX_cleanup(&ctx); return 2; } p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx); eticklen -= 16 + EVP_CIPHER_CTX_iv_length(&ctx); sdec = OPENSSL_malloc(eticklen); if (sdec == NULL || EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen) <= 0) { EVP_CIPHER_CTX_cleanup(&ctx); return -1; } if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0) { EVP_CIPHER_CTX_cleanup(&ctx); OPENSSL_free(sdec); return 2; } slen += mlen; EVP_CIPHER_CTX_cleanup(&ctx); p = sdec; sess = d2i_SSL_SESSION(NULL, &p, slen); OPENSSL_free(sdec); if (sess) { if (sesslen) memcpy(sess->session_id, sess_id, sesslen); sess->session_id_length = sesslen; *psess = sess; if (renew_ticket) return 4; else return 3; } ERR_clear_error(); return 2; err: EVP_CIPHER_CTX_cleanup(&ctx); HMAC_CTX_free(hctx); return -1; } ssl/t1_lib.c:3086: error: MEMORY_LEAK memory dynamically allocated to `return` by call to `HMAC_CTX_new()` at line 3069, column 12 is not reachable after line 3086, column 13. Showing all 35 steps of the trace ssl/t1_lib.c:3053:1: start of procedure tls_decrypt_ticket() 3051. * 4: same as 3, but the ticket needs to be renewed. 3052. */ 3053. > static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, 3054. int eticklen, const unsigned char *sess_id, 3055. int sesslen, SSL_SESSION **psess) ssl/t1_lib.c:3060:5: 3058. unsigned char *sdec; 3059. const unsigned char *p; 3060. > int slen, mlen, renew_ticket = 0; 3061. unsigned char tick_hmac[EVP_MAX_MD_SIZE]; 3062. HMAC_CTX *hctx = NULL; ssl/t1_lib.c:3062:5: 3060. int slen, mlen, renew_ticket = 0; 3061. unsigned char tick_hmac[EVP_MAX_MD_SIZE]; 3062. > HMAC_CTX *hctx = NULL; 3063. EVP_CIPHER_CTX ctx; 3064. SSL_CTX *tctx = s->initial_ctx; ssl/t1_lib.c:3064:5: 3062. HMAC_CTX *hctx = NULL; 3063. EVP_CIPHER_CTX ctx; 3064. > SSL_CTX *tctx = s->initial_ctx; 3065. /* Need at least keyname + iv + some encrypted data */ 3066. if (eticklen < 48) ssl/t1_lib.c:3066:9: Taking false branch 3064. SSL_CTX *tctx = s->initial_ctx; 3065. /* Need at least keyname + iv + some encrypted data */ 3066. if (eticklen < 48) ^ 3067. return 2; 3068. /* Initialize session ticket encryption and HMAC contexts */ ssl/t1_lib.c:3069:5: 3067. return 2; 3068. /* Initialize session ticket encryption and HMAC contexts */ 3069. > hctx = HMAC_CTX_new(); 3070. if (hctx == NULL) 3071. return -2; crypto/hmac/hmac.c:173:1: start of procedure HMAC_CTX_new() 171. } 172. 173. > HMAC_CTX *HMAC_CTX_new(void) 174. { 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); crypto/hmac/hmac.c:175:5: 173. HMAC_CTX *HMAC_CTX_new(void) 174. { 175. > HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { 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/hmac/hmac.c:176:9: Taking true branch 174. { 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); 176. if (ctx) ^ 177. if (!HMAC_CTX_reset(ctx)) { 178. HMAC_CTX_free(ctx); crypto/hmac/hmac.c:177:14: Taking false branch 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { ^ 178. HMAC_CTX_free(ctx); 179. ctx = NULL; crypto/hmac/hmac.c:181:5: 179. ctx = NULL; 180. } 181. > return ctx; 182. } 183. crypto/hmac/hmac.c:182:1: return from a call to HMAC_CTX_new 180. } 181. return ctx; 182. > } 183. 184. static void hmac_ctx_cleanup(HMAC_CTX *ctx) ssl/t1_lib.c:3070:9: Taking false branch 3068. /* Initialize session ticket encryption and HMAC contexts */ 3069. hctx = HMAC_CTX_new(); 3070. if (hctx == NULL) ^ 3071. return -2; 3072. EVP_CIPHER_CTX_init(&ctx); ssl/t1_lib.c:3072:5: 3070. if (hctx == NULL) 3071. return -2; 3072. > EVP_CIPHER_CTX_init(&ctx); 3073. if (tctx->tlsext_ticket_key_cb) { 3074. unsigned char *nctick = (unsigned char *)etick; crypto/evp/evp_enc.c:69:1: start of procedure EVP_CIPHER_CTX_init() 67. #include "evp_locl.h" 68. 69. > void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) 70. { 71. memset(ctx, 0, sizeof(*ctx)); crypto/evp/evp_enc.c:71:5: 69. void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) 70. { 71. > memset(ctx, 0, sizeof(*ctx)); 72. } 73. crypto/evp/evp_enc.c:72:1: return from a call to EVP_CIPHER_CTX_init 70. { 71. memset(ctx, 0, sizeof(*ctx)); 72. > } 73. 74. EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void) ssl/t1_lib.c:3073:9: Taking false branch 3071. return -2; 3072. EVP_CIPHER_CTX_init(&ctx); 3073. if (tctx->tlsext_ticket_key_cb) { ^ 3074. unsigned char *nctick = (unsigned char *)etick; 3075. int rv = tctx->tlsext_ticket_key_cb(s, nctick, nctick + 16, ssl/t1_lib.c:3085:13: Taking true branch 3083. } else { 3084. /* Check key name matches */ 3085. if (memcmp(etick, tctx->tlsext_tick_key_name, 16)) ^ 3086. return 2; 3087. if (HMAC_Init_ex(hctx, tctx->tlsext_tick_hmac_key, 16, ssl/t1_lib.c:3086:13: 3084. /* Check key name matches */ 3085. if (memcmp(etick, tctx->tlsext_tick_key_name, 16)) 3086. > return 2; 3087. if (HMAC_Init_ex(hctx, tctx->tlsext_tick_hmac_key, 16, 3088. EVP_sha256(), NULL) <= 0
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/ssl/t1_lib.c/#L3086
d2a_code_trace_data_44393
static inline void refill_32(BitstreamContext *bc) { if (bc->ptr >= bc->buffer_end) return; #ifdef BITSTREAM_READER_LE bc->bits = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits; #else bc->bits = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left); #endif bc->ptr += 4; bc->bits_left += 32; } libavcodec/mpc7.c:86: error: Integer Overflow L2 (32 - [0, 63]):unsigned32 by call to `bitstream_read`. libavcodec/mpc7.c:82:5: Call 80. c->bdsp.bswap_buf((uint32_t *) buf, (const uint32_t *) avctx->extradata, 4); 81. ff_mpc_init(); 82. bitstream_init(&bc, buf, 128); ^ 83. 84. c->IS = bitstream_read_bit(&bc); libavcodec/bitstream.h:85:9: Assignment 83. bc->buffer = 84. bc->ptr = NULL; 85. bc->bits_left = 0; ^ 86. return AVERROR_INVALIDDATA; 87. } libavcodec/mpc7.c:84:19: Call 82. bitstream_init(&bc, buf, 128); 83. 84. c->IS = bitstream_read_bit(&bc); ^ 85. c->MSS = bitstream_read_bit(&bc); 86. c->maxbands = bitstream_read(&bc, 6); 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: 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: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/mpc7.c:85:19: Call 83. 84. c->IS = bitstream_read_bit(&bc); 85. c->MSS = bitstream_read_bit(&bc); ^ 86. c->maxbands = bitstream_read(&bc, 6); 87. if(c->maxbands >= BANDS){ 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: 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: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/mpc7.c:86:19: Call 84. c->IS = bitstream_read_bit(&bc); 85. c->MSS = bitstream_read_bit(&bc); 86. c->maxbands = bitstream_read(&bc, 6); ^ 87. if(c->maxbands >= BANDS){ 88. av_log(avctx, AV_LOG_ERROR, "Too many bands: %i\n", c->maxbands); libavcodec/bitstream.h:183:1: Parameter `n` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/bitstream.h:189:9: Call 187. 188. if (n > bc->bits_left) { 189. refill_32(bc); ^ 190. if (bc->bits_left < 32) 191. bc->bits_left = n; libavcodec/bitstream.h:60:1: <RHS trace> 58. } 59. 60. static inline void refill_32(BitstreamContext *bc) ^ 61. { 62. if (bc->ptr >= bc->buffer_end) libavcodec/bitstream.h:60:1: Parameter `bc->bits_left` 58. } 59. 60. static inline void refill_32(BitstreamContext *bc) ^ 61. { 62. if (bc->ptr >= bc->buffer_end) libavcodec/bitstream.h:68:5: Binary operation: (32 - [0, 63]):unsigned32 by call to `bitstream_read` 66. bc->bits = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits; 67. #else 68. bc->bits = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left); ^ 69. #endif 70. bc->ptr += 4;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L68
d2a_code_trace_data_44394
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", 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:2067: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `X509_print_ex`. Showing all 15 steps of the trace apps/ca.c:1977:10: Call 1975. } 1976. 1977. if (!X509_set_subject_name(ret, subject)) ^ 1978. goto err; 1979. crypto/x509/x509_set.c:106:1: Parameter `*x->cert_info->subject` 104. } 105. 106. > int X509_set_subject_name(X509 *x, X509_NAME *name) 107. { 108. if ((x == NULL) || (x->cert_info == NULL)) apps/ca.c:2057:14: Call 2055. /* Set the right value for the noemailDN option */ 2056. if (email_dn == 0) { 2057. if (!X509_set_subject_name(ret, dn_subject)) ^ 2058. goto err; 2059. } crypto/x509/x509_set.c:106:1: Parameter `*x->cert_info->subject` 104. } 105. 106. > int X509_set_subject_name(X509 *x, X509_NAME *name) 107. { 108. if ((x == NULL) || (x->cert_info == NULL)) apps/ca.c:2067:9: Call 2065. */ 2066. certopt |= X509_FLAG_NO_SIGDUMP | X509_FLAG_NO_SIGNAME; 2067. X509_print_ex(bio_err, ret, nameopt, certopt); ^ 2068. } 2069. crypto/asn1/t_x509.c:105:1: Parameter `*x->cert_info->validity->notBefore->data` 103. } 104. 105. > int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, 106. unsigned long cflag) 107. { crypto/asn1/t_x509.c:193:14: Call 191. if (BIO_write(bp, " Not Before: ", 24) <= 0) 192. goto err; 193. if (!ASN1_TIME_print(bp, X509_get_notBefore(x))) ^ 194. goto err; 195. if (BIO_write(bp, "\n Not After : ", 25) <= 0) crypto/asn1/t_x509.c:392:1: Parameter `*tm->data` 390. } 391. 392. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) 393. { 394. if (tm->type == V_ASN1_UTCTIME) crypto/asn1/t_x509.c:397:16: Call 395. return ASN1_UTCTIME_print(bp, tm); 396. if (tm->type == V_ASN1_GENERALIZEDTIME) 397. return ASN1_GENERALIZEDTIME_print(bp, tm); ^ 398. BIO_write(bp, "Bad time value", 14); 399. return (0); crypto/asn1/t_x509.c:407:1: <Offset trace> 405. }; 406. 407. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 408. { 409. char *v; crypto/asn1/t_x509.c:407:1: Parameter `*tm->data` 405. }; 406. 407. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 408. { 409. char *v; crypto/asn1/t_x509.c:428:5: Assignment 426. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 427. + (v[2] - '0') * 10 + (v[3] - '0'); 428. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 429. if ((M > 12) || (M < 1)) 430. goto err; crypto/asn1/t_x509.c:402:1: <Length trace> 400. } 401. 402. > static const char *mon[12] = { 403. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 404. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/t_x509.c:402:1: Array declaration 400. } 401. 402. > static const char *mon[12] = { 403. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 404. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/t_x509.c:449:20: Array access: Offset: [-529, +oo] Size: 12 by call to `X509_print_ex` 447. 448. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 449. mon[M - 1], d, h, m, s, f_len, f, y, ^ 450. (gmt) ? " GMT" : "") <= 0) 451. return (0);
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/crypto/asn1/t_x509.c/#L449
d2a_code_trace_data_44395
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecdsa_ossl.c:257: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul_montgomery`. Showing all 19 steps of the trace crypto/ec/ecdsa_ossl.c:223:18: Call 221. do { 222. if (in_kinv == NULL || in_r == NULL) { 223. if (!ecdsa_sign_setup(eckey, ctx, &kinv, &ret->r, dgst, dgst_len)) { ^ 224. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_ECDSA_LIB); 225. goto err; crypto/ec/ecdsa_ossl.c:33:1: Parameter `ctx_in->stack.depth` 31. } 32. 33. > static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, 34. BIGNUM **kinvp, BIGNUM **rp, 35. const unsigned char *dgst, int dlen) crypto/ec/ecdsa_ossl.c:257:17: Call 255. */ 256. if (!bn_to_mont_fixed_top(s, s, group->mont_data, ctx) 257. || !BN_mod_mul_montgomery(s, s, ckinv, group->mont_data, ctx)) { ^ 258. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); 259. goto err; crypto/bn/bn_mont.c:26:1: Parameter `ctx->stack.depth` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:29:15: Call 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { 29. int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx); ^ 30. 31. bn_correct_top(r); crypto/bn/bn_mont.c:37:1: Parameter `ctx->stack.depth` 35. } 36. 37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 38. BN_MONT_CTX *mont, BN_CTX *ctx) 39. { crypto/bn/bn_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: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_mont.c:67:14: Call 65. bn_check_top(tmp); 66. if (a == b) { 67. if (!BN_sqr(tmp, a, ctx)) ^ 68. goto err; 69. } else { crypto/bn/bn_sqr.c:32:5: Call 30. } 31. 32. BN_CTX_start(ctx); ^ 33. rr = (a != r) ? r : BN_CTX_get(ctx); 34. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_sqr.c:94:5: Call 92. bn_check_top(rr); 93. bn_check_top(tmp); 94. BN_CTX_end(ctx); ^ 95. return ret; 96. } crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 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:274:1: <Offset trace> 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:274:1: Parameter `st->depth` 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:274:1: <Length trace> 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:274:1: Parameter `*st->indexes` 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:276:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul_montgomery` 274. static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; ^ 277. } 278.
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_ctx.c/#L276
d2a_code_trace_data_44396
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:2037: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_div`. Showing all 12 steps of the trace test/bntest.c:2010:1: Parameter `ctx->stack.depth` 2008. } 2009. 2010. > int test_rshift(BIO *bp, BN_CTX *ctx) 2011. { 2012. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:2037:9: Call 2035. BIO_puts(bp, "\n"); 2036. } 2037. BN_div(d, e, a, c, ctx); ^ 2038. BN_sub(d, d, b); 2039. if (!BN_is_zero(d)) { crypto/bn/bn_div.c:193:5: Call 191. } 192. 193. BN_CTX_start(ctx); ^ 194. tmp = BN_CTX_get(ctx); 195. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:416:5: Call 414. if (no_branch) 415. bn_correct_top(res); 416. BN_CTX_end(ctx); ^ 417. return (1); 418. err: crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 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: <Offset 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:271:1: <Length 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->indexes` 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: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_div` 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/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_44397
static int t_fromb64(unsigned char *a, size_t alen, const char *src) { char *loc; int i, j; int size; while (*src && (*src == ' ' || *src == '\t' || *src == '\n')) ++src; size = strlen(src); if (alen > INT_MAX || size > (int)alen) return -1; i = 0; while (i < size) { loc = strchr(b64table, src[i]); if (loc == (char *)0) break; else a[i] = loc - b64table; ++i; } if (i == 0) return 0; size = i; i = size - 1; j = size; while (1) { a[j] = a[i]; if (--i < 0) break; a[j] |= (a[i] & 3) << 6; --j; a[j] = (unsigned char)((a[i] & 0x3c) >> 2); if (--i < 0) break; a[j] |= (a[i] & 0xf) << 4; --j; a[j] = (unsigned char)((a[i] & 0x30) >> 4); if (--i < 0) break; a[j] |= (a[i] << 2); a[--j] = 0; if (--i < 0) break; } while (a[j] == 0 && j <= size) ++j; i = 0; while (j <= size) a[i++] = a[j++]; return i; } apps/srp.c:429: error: BUFFER_OVERRUN_L2 Offset: [-oo, 2147483648] Size: 2500 by call to `srp_create_user`. Showing all 13 steps of the trace apps/srp.c:363:50: Unknown value from: strcmp 361. if (pp[DB_srptype][0] == DB_SRP_INDEX) { 362. maxgN = i; 363. if ((gNindex < 0) && (gN != NULL) && strcmp(gN, pp[DB_srpid]) == 0) ^ 364. gNindex = i; 365. apps/srp.c:429:22: Call 427. if (! 428. (gNid = 429. srp_create_user(user, &(row[DB_srpverifier]), ^ 430. &(row[DB_srpsalt]), 431. gNrow ? gNrow[DB_srpsalt] : gN, apps/srp.c:152:1: Parameter `g->strlen` 150. } 151. 152. > static char *srp_create_user(char *user, char **srp_verifier, 153. char **srp_usersalt, char *g, char *N, 154. char *passout, int verbose) apps/srp.c:169:14: Call 167. if (! 168. (gNid = 169. SRP_create_verifier(user, password, &salt, srp_verifier, N, ^ 170. g))) { 171. BIO_printf(bio_err, "Internal error creating SRP verifier\n"); crypto/srp/srp_vfy.c:543:1: Array declaration 541. * create a verifier (*salt,*verifier,g and N are in base64) 542. */ 543. > char *SRP_create_verifier(const char *user, const char *pass, char **salt, 544. char **verifier, const char *N, const char *g) 545. { crypto/srp/srp_vfy.c:564:20: Call 562. N_bn_alloc = BN_bin2bn(tmp, len, NULL); 563. N_bn = N_bn_alloc; 564. if ((len = t_fromb64(tmp, sizeof(tmp) ,g)) <= 0) ^ 565. goto err; 566. g_bn_alloc = BN_bin2bn(tmp, len, NULL); crypto/srp/srp_vfy.c:33:1: <Offset trace> 31. * Convert a base64 string into raw byte array representation. 32. */ 33. > static int t_fromb64(unsigned char *a, size_t alen, const char *src) 34. { 35. char *loc; crypto/srp/srp_vfy.c:33:1: Parameter `alen` 31. * Convert a base64 string into raw byte array representation. 32. */ 33. > static int t_fromb64(unsigned char *a, size_t alen, const char *src) 34. { 35. char *loc; crypto/srp/srp_vfy.c:57:5: Assignment 55. if (i == 0) 56. return 0; 57. size = i; ^ 58. i = size - 1; 59. j = size; crypto/srp/srp_vfy.c:59:5: Assignment 57. size = i; 58. i = size - 1; 59. j = size; ^ 60. while (1) { 61. a[j] = a[i]; crypto/srp/srp_vfy.c:33:1: <Length trace> 31. * Convert a base64 string into raw byte array representation. 32. */ 33. > static int t_fromb64(unsigned char *a, size_t alen, const char *src) 34. { 35. char *loc; crypto/srp/srp_vfy.c:33:1: Parameter `*a` 31. * Convert a base64 string into raw byte array representation. 32. */ 33. > static int t_fromb64(unsigned char *a, size_t alen, const char *src) 34. { 35. char *loc; crypto/srp/srp_vfy.c:80:12: Array access: Offset: [-oo, 2147483648] Size: 2500 by call to `srp_create_user` 78. break; 79. } 80. while (a[j] == 0 && j <= size) ^ 81. ++j; 82. i = 0;
https://github.com/openssl/openssl/blob/9dd4ac8cf17f2afd636e85ae0111d1df4104a475/crypto/srp/srp_vfy.c/#L80
d2a_code_trace_data_44398
void parse_options(int argc, char **argv, const OptionDef *options, void (* parse_arg_function)(const char*)) { const char *opt, *arg; int optindex, handleoptions=1; const OptionDef *po; optindex = 1; while (optindex < argc) { opt = argv[optindex++]; if (handleoptions && opt[0] == '-' && opt[1] != '\0') { if (opt[1] == '-' && opt[2] == '\0') { handleoptions = 0; continue; } po= find_option(options, opt + 1); if (!po->name) po= find_option(options, "default"); if (!po->name) { unknown_opt: fprintf(stderr, "%s: unrecognized option '%s'\n", argv[0], opt); exit(1); } arg = NULL; if (po->flags & HAS_ARG) { arg = argv[optindex++]; if (!arg) { fprintf(stderr, "%s: missing argument for option '%s'\n", argv[0], opt); exit(1); } } if (po->flags & OPT_STRING) { char *str; str = av_strdup(arg); *po->u.str_arg = str; } else if (po->flags & OPT_BOOL) { *po->u.int_arg = 1; } else if (po->flags & OPT_INT) { *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX); } else if (po->flags & OPT_INT64) { *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX); } else if (po->flags & OPT_FLOAT) { *po->u.float_arg = parse_number_or_die(opt+1, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0); } else if (po->flags & OPT_FUNC2) { if(po->u.func2_arg(opt+1, arg)<0) goto unknown_opt; } else { po->u.func_arg(arg); } if(po->flags & OPT_EXIT) exit(0); } else { if (parse_arg_function) parse_arg_function(opt); } } } cmdutils.c:161: error: Null Dereference pointer `arg` last assigned on line 142 could be null and is dereferenced by call to `parse_number_or_die()` at line 161, column 36. cmdutils.c:117:1: start of procedure parse_options() 115. } 116. 117. void parse_options(int argc, char **argv, const OptionDef *options, ^ 118. void (* parse_arg_function)(const char*)) 119. { cmdutils.c:121:5: 119. { 120. const char *opt, *arg; 121. int optindex, handleoptions=1; ^ 122. const OptionDef *po; 123. cmdutils.c:125:5: 123. 124. /* parse options */ 125. optindex = 1; ^ 126. while (optindex < argc) { 127. opt = argv[optindex++]; cmdutils.c:126:12: Loop condition is true. Entering loop body 124. /* parse options */ 125. optindex = 1; 126. while (optindex < argc) { ^ 127. opt = argv[optindex++]; 128. cmdutils.c:127:9: 125. optindex = 1; 126. while (optindex < argc) { 127. opt = argv[optindex++]; ^ 128. 129. if (handleoptions && opt[0] == '-' && opt[1] != '\0') { cmdutils.c:129:13: Taking true branch 127. opt = argv[optindex++]; 128. 129. if (handleoptions && opt[0] == '-' && opt[1] != '\0') { ^ 130. if (opt[1] == '-' && opt[2] == '\0') { 131. handleoptions = 0; cmdutils.c:129:30: Taking true branch 127. opt = argv[optindex++]; 128. 129. if (handleoptions && opt[0] == '-' && opt[1] != '\0') { ^ 130. if (opt[1] == '-' && opt[2] == '\0') { 131. handleoptions = 0; cmdutils.c:129:47: Taking true branch 127. opt = argv[optindex++]; 128. 129. if (handleoptions && opt[0] == '-' && opt[1] != '\0') { ^ 130. if (opt[1] == '-' && opt[2] == '\0') { 131. handleoptions = 0; cmdutils.c:130:17: Taking false branch 128. 129. if (handleoptions && opt[0] == '-' && opt[1] != '\0') { 130. if (opt[1] == '-' && opt[2] == '\0') { ^ 131. handleoptions = 0; 132. continue; cmdutils.c:134:13: Skipping find_option(): empty list of specs 132. continue; 133. } 134. po= find_option(options, opt + 1); ^ 135. if (!po->name) 136. po= find_option(options, "default"); cmdutils.c:135:18: Taking false branch 133. } 134. po= find_option(options, opt + 1); 135. if (!po->name) ^ 136. po= find_option(options, "default"); 137. if (!po->name) { cmdutils.c:137:18: Taking false branch 135. if (!po->name) 136. po= find_option(options, "default"); 137. if (!po->name) { ^ 138. unknown_opt: 139. fprintf(stderr, "%s: unrecognized option '%s'\n", argv[0], opt); cmdutils.c:142:13: 140. exit(1); 141. } 142. arg = NULL; ^ 143. if (po->flags & HAS_ARG) { 144. arg = argv[optindex++]; cmdutils.c:143:17: Taking false branch 141. } 142. arg = NULL; 143. if (po->flags & HAS_ARG) { ^ 144. arg = argv[optindex++]; 145. if (!arg) { cmdutils.c:150:17: Taking false branch 148. } 149. } 150. if (po->flags & OPT_STRING) { ^ 151. char *str; 152. str = av_strdup(arg); cmdutils.c:154:24: Taking false branch 152. str = av_strdup(arg); 153. *po->u.str_arg = str; 154. } else if (po->flags & OPT_BOOL) { ^ 155. *po->u.int_arg = 1; 156. } else if (po->flags & OPT_INT) { cmdutils.c:156:24: Taking false branch 154. } else if (po->flags & OPT_BOOL) { 155. *po->u.int_arg = 1; 156. } else if (po->flags & OPT_INT) { ^ 157. *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX); 158. } else if (po->flags & OPT_INT64) { cmdutils.c:158:24: Taking false branch 156. } else if (po->flags & OPT_INT) { 157. *po->u.int_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT_MIN, INT_MAX); 158. } else if (po->flags & OPT_INT64) { ^ 159. *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX); 160. } else if (po->flags & OPT_FLOAT) { cmdutils.c:160:24: Taking true branch 158. } else if (po->flags & OPT_INT64) { 159. *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX); 160. } else if (po->flags & OPT_FLOAT) { ^ 161. *po->u.float_arg = parse_number_or_die(opt+1, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0); 162. } else if (po->flags & OPT_FUNC2) { cmdutils.c:161:17: 159. *po->u.int64_arg = parse_number_or_die(opt+1, arg, OPT_INT64, INT64_MIN, INT64_MAX); 160. } else if (po->flags & OPT_FLOAT) { 161. *po->u.float_arg = parse_number_or_die(opt+1, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0); ^ 162. } else if (po->flags & OPT_FUNC2) { 163. if(po->u.func2_arg(opt+1, arg)<0) cmdutils.c:57:1: start of procedure parse_number_or_die() 55. struct SwsContext *sws_opts; 56. 57. double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max) ^ 58. { 59. char *tail; cmdutils.c:61:5: 59. char *tail; 60. const char *error; 61. double d = strtod(numstr, &tail); ^ 62. if (*tail) 63. error= "Expected number for %s but found: %s\n"; cmdutils.c:62:9: Taking false branch 60. const char *error; 61. double d = strtod(numstr, &tail); 62. if (*tail) ^ 63. error= "Expected number for %s but found: %s\n"; 64. else if (d < min || d > max) cmdutils.c:64:14: Taking false branch 62. if (*tail) 63. error= "Expected number for %s but found: %s\n"; 64. else if (d < min || d > max) ^ 65. error= "The value for %s was %s which is not within %f - %f\n"; 66. else if(type == OPT_INT64 && (int64_t)d != d) cmdutils.c:64:25: Taking false branch 62. if (*tail) 63. error= "Expected number for %s but found: %s\n"; 64. else if (d < min || d > max) ^ 65. error= "The value for %s was %s which is not within %f - %f\n"; 66. else if(type == OPT_INT64 && (int64_t)d != d) cmdutils.c:66:13: Taking false branch 64. else if (d < min || d > max) 65. error= "The value for %s was %s which is not within %f - %f\n"; 66. else if(type == OPT_INT64 && (int64_t)d != d) ^ 67. error= "Expected int64 for %s but found %s\n"; 68. else cmdutils.c:69:9: 67. error= "Expected int64 for %s but found %s\n"; 68. else 69. return d; ^ 70. fprintf(stderr, error, context, numstr, min, max); 71. exit(1); cmdutils.c:72:1: return from a call to parse_number_or_die 70. fprintf(stderr, error, context, numstr, min, max); 71. exit(1); 72. } ^ 73. 74. int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration)
https://github.com/libav/libav/blob/712ca84c21a4d7faf97fa79732bf5c347ec6fbc3/cmdutils.c/#L161
d2a_code_trace_data_44399
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); r->neg = a->neg; lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } test/srptest.c:177: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `SRP_create_verifier_BN`. Showing all 20 steps of the trace test/srptest.c:177:10: Call 175. BN_hex2bn(&s, "BEB25379D1A8581EB5A727673A2441EE"); 176. /* Set up server's password entry */ 177. if (!TEST_true(SRP_create_verifier_BN("alice", "password123", &s, &v, GN->N, ^ 178. GN->g))) 179. goto err; crypto/srp/srp_vfy.c:633:1: Parameter `g->top` 631. * BIGNUMS. 632. */ 633. > int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 634. BIGNUM **verifier, const BIGNUM *N, 635. const BIGNUM *g) crypto/srp/srp_vfy.c:664:10: Call 662. goto err; 663. 664. if (!BN_mod_exp(*verifier, g, x, N, bn_ctx)) { ^ 665. BN_clear_free(*verifier); 666. goto err; crypto/bn/bn_exp.c:91:1: Parameter `a->top` 89. } 90. 91. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 92. BN_CTX *ctx) 93. { crypto/bn/bn_exp.c:144:19: Call 142. } else 143. # endif 144. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 145. } else 146. #endif crypto/bn/bn_exp.c:294:1: Parameter `a->top` 292. } 293. 294. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 295. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 296. { crypto/bn/bn_exp.c:306:16: Call 304. 305. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 306. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 307. } 308. crypto/bn/bn_exp.c:594:1: Parameter `a->top` 592. * http://www.daemonology.net/hyperthreading-considered-harmful/) 593. */ 594. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 595. const BIGNUM *m, BN_CTX *ctx, 596. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:747:14: Call 745. /* prepare a^1 in Montgomery domain */ 746. if (a->neg || BN_ucmp(a, m) >= 0) { 747. if (!BN_mod(&am, a, m, ctx)) ^ 748. goto err; 749. if (!BN_to_montgomery(&am, &am, mont, ctx)) crypto/bn/bn_div.c:140:1: Parameter `num->top` 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/bn/bn_div.c:210:11: Call 208. sdiv->neg = 0; 209. norm_shift += BN_BITS2; 210. if (!(BN_lshift(snum, num, norm_shift))) ^ 211. goto err; 212. snum->neg = 0; crypto/bn/bn_shift.c:83:1: <Offset trace> 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:83:1: Parameter `n` 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:5: Assignment 95. } 96. 97. nw = n / BN_BITS2; ^ 98. if (bn_wexpand(r, a->top + nw + 1) == NULL) 99. return (0); crypto/bn/bn_shift.c:83:1: <Length trace> 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:83:1: Parameter `*r->d` 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:98:9: Call 96. 97. nw = n / BN_BITS2; 98. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 99. return (0); 100. r->neg = a->neg; crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_shift.c:104:5: Assignment 102. rb = BN_BITS2 - lb; 103. f = a->d; 104. t = r->d; ^ 105. t[a->top + nw] = 0; 106. if (lb == 0) crypto/bn/bn_shift.c:112:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `SRP_create_verifier_BN` 110. for (i = a->top - 1; i >= 0; i--) { 111. l = f[i]; 112. t[nw + i + 1] |= (l >> rb) & BN_MASK2; ^ 113. t[nw + i] = (l << lb) & BN_MASK2; 114. }
https://github.com/openssl/openssl/blob/b66411f6cda6970c01283ddde6d8063c57b3b7d9/crypto/bn/bn_shift.c/#L112
d2a_code_trace_data_44400
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:924: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:924:16: 922. } 923. 924. start= FFMAX(0, x + dia_size - xmax); ^ 925. end = FFMIN(dia_size, y - ymin + 1); 926. for(dir= start; dir<end; dir++){
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L924
d2a_code_trace_data_44401
static int dtls_get_reassembled_message(SSL *s, int *errtype, size_t *len) { unsigned char wire[DTLS1_HM_HEADER_LENGTH]; size_t mlen, frag_off, frag_len; int i, ret, recvd_type; struct hm_header_st msg_hdr; size_t readbytes; *errtype = 0; redo: ret = dtls1_retrieve_buffered_fragment(s, &frag_len); if (ret < 0) { return 0; } if (ret > 0) { s->init_num = frag_len; *len = frag_len; return 1; } i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, &recvd_type, wire, DTLS1_HM_HEADER_LENGTH, 0, &readbytes); if (i <= 0) { s->rwstate = SSL_READING; *len = 0; return 0; } if (recvd_type == SSL3_RT_CHANGE_CIPHER_SPEC) { if (wire[0] != SSL3_MT_CCS) { SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_F_DTLS_GET_REASSEMBLED_MESSAGE, SSL_R_BAD_CHANGE_CIPHER_SPEC); goto f_err; } memcpy(s->init_buf->data, wire, readbytes); s->init_num = readbytes - 1; s->init_msg = s->init_buf->data + 1; s->s3->tmp.message_type = SSL3_MT_CHANGE_CIPHER_SPEC; s->s3->tmp.message_size = readbytes - 1; *len = readbytes - 1; return 1; } if (readbytes != DTLS1_HM_HEADER_LENGTH) { SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_F_DTLS_GET_REASSEMBLED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE); goto f_err; } dtls1_get_message_header(wire, &msg_hdr); mlen = msg_hdr.msg_len; frag_off = msg_hdr.frag_off; frag_len = msg_hdr.frag_len; if (frag_len > RECORD_LAYER_get_rrec_length(&s->rlayer)) { SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_F_DTLS_GET_REASSEMBLED_MESSAGE, SSL_R_BAD_LENGTH); goto f_err; } if (msg_hdr.seq != s->d1->handshake_read_seq) { *errtype = dtls1_process_out_of_seq_message(s, &msg_hdr); return 0; } if (frag_len && frag_len < mlen) { *errtype = dtls1_reassemble_fragment(s, &msg_hdr); return 0; } if (!s->server && s->d1->r_msg_hdr.frag_off == 0 && s->statem.hand_state != TLS_ST_OK && wire[0] == SSL3_MT_HELLO_REQUEST) { if (wire[1] == 0 && wire[2] == 0 && wire[3] == 0) { if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, wire, DTLS1_HM_HEADER_LENGTH, s, s->msg_callback_arg); s->init_num = 0; goto redo; } else { SSLfatal(s, SSL_AD_UNEXPECTED_MESSAGE, SSL_F_DTLS_GET_REASSEMBLED_MESSAGE, SSL_R_UNEXPECTED_MESSAGE); goto f_err; } } if (!dtls1_preprocess_fragment(s, &msg_hdr)) { goto f_err; } if (frag_len > 0) { unsigned char *p = (unsigned char *)s->init_buf->data + DTLS1_HM_HEADER_LENGTH; i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL, &p[frag_off], frag_len, 0, &readbytes); if (i <= 0) { s->rwstate = SSL_READING; *len = 0; return 0; } } else { readbytes = 0; } if (readbytes != frag_len) { SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_F_DTLS_GET_REASSEMBLED_MESSAGE, SSL_R_BAD_LENGTH); goto f_err; } *len = s->init_num = frag_len; return 1; f_err: s->init_num = 0; *len = 0; return 0; } ssl/statem/statem_dtls.c:765: error: BUFFER_OVERRUN_L3 Offset added: 12 Size: [1, 2147483644]. Showing all 5 steps of the trace ssl/statem/statem_dtls.c:726:1: <Length trace> 724. } 725. 726. > static int dtls_get_reassembled_message(SSL *s, int *errtype, size_t *len) 727. { 728. unsigned char wire[DTLS1_HM_HEADER_LENGTH]; ssl/statem/statem_dtls.c:726:1: Parameter `*s->init_buf->data` 724. } 725. 726. > static int dtls_get_reassembled_message(SSL *s, int *errtype, size_t *len) 727. { 728. unsigned char wire[DTLS1_HM_HEADER_LENGTH]; ssl/statem/statem_dtls.c:738:11: Call 736. redo: 737. /* see if we have the required fragment already */ 738. ret = dtls1_retrieve_buffered_fragment(s, &frag_len); ^ 739. if (ret < 0) { 740. /* SSLfatal() already called */ ssl/statem/statem_dtls.c:456:1: Parameter `*s->init_buf->data` 454. * fatal error. 455. */ 456. > static int dtls1_retrieve_buffered_fragment(SSL *s, size_t *len) 457. { 458. /*- ssl/statem/statem_dtls.c:765:9: Array access: Offset added: 12 Size: [1, 2147483644] 763. } 764. 765. memcpy(s->init_buf->data, wire, readbytes); ^ 766. s->init_num = readbytes - 1; 767. s->init_msg = s->init_buf->data + 1;
https://github.com/openssl/openssl/blob/e7d961e994620dd5dee6d80794a07fb9de1bab66/ssl/statem/statem_dtls.c/#L765
d2a_code_trace_data_44402
static void test_fail_bignum_common(const char *prefix, const char *file, int line, const char *type, const char *left, const char *right, const char *op, const BIGNUM *bn1, const BIGNUM *bn2) { const int indent = subtest_level(); const size_t bytes = bn_bytes; char b1[MAX_STRING_WIDTH + 1], b2[MAX_STRING_WIDTH + 1]; char *p, bdiff[MAX_STRING_WIDTH + 1]; size_t l1, l2, n1, n2, i, len; unsigned int cnt, diff, real_diff; unsigned char *m1 = NULL, *m2 = NULL; int lz1 = 1, lz2 = 1; unsigned char buffer[MEM_BUFFER_SIZE * 2], *bufp = buffer; l1 = bn1 == NULL ? 0 : (BN_num_bytes(bn1) + (BN_is_negative(bn1) ? 1 : 0)); l2 = bn2 == NULL ? 0 : (BN_num_bytes(bn2) + (BN_is_negative(bn2) ? 1 : 0)); if (l1 == 0 && l2 == 0) { if ((bn1 == NULL) == (bn2 == NULL)) { test_bignum_header_line(); test_bignum_zero_print(bn1, ' '); } else { test_diff_header(left, right); test_bignum_header_line(); test_bignum_zero_print(bn1, '-'); test_bignum_zero_print(bn2, '+'); } goto fin; } if (l1 != l2 || bn1 == NULL || bn2 == NULL || BN_cmp(bn1, bn2) != 0) test_diff_header(left, right); test_bignum_header_line(); len = ((l1 > l2 ? l1 : l2) + bytes - 1) / bytes * bytes; if (len > MEM_BUFFER_SIZE && (bufp = OPENSSL_malloc(len * 2)) == NULL) { bufp = buffer; len = MEM_BUFFER_SIZE; test_printf_stderr("%*s# WARNING: these BIGNUMs have been truncated", indent, ""); } if (bn1 != NULL) { m1 = bufp; BN_bn2binpad(bn1, m1, len); } if (bn2 != NULL) { m2 = bufp + len; BN_bn2binpad(bn2, m2, len); } while (len > 0) { cnt = 8 * (len - bytes); n1 = convert_bn_memory(m1, bytes, b1, &lz1, bn1); n2 = convert_bn_memory(m2, bytes, b2, &lz2, bn2); diff = real_diff = 0; i = 0; p = bdiff; for (i=0; b1[i] != '\0'; i++) if (b1[i] == b2[i] || b1[i] == ' ' || b2[i] == ' ') { *p++ = ' '; diff |= b1[i] != b2[i]; } else { *p++ = '^'; real_diff = diff = 1; } *p++ = '\0'; if (!diff) { test_printf_stderr("%*s# %s:% 5d\n", indent, "", n2 > n1 ? b2 : b1, cnt); } else { if (cnt == 0 && bn1 == NULL) test_printf_stderr("%*s# -%s\n", indent, "", b1); else if (cnt == 0 || n1 > 0) test_printf_stderr("%*s# -%s:% 5d\n", indent, "", b1, cnt); if (cnt == 0 && bn2 == NULL) test_printf_stderr("%*s# +%s\n", indent, "", b2); else if (cnt == 0 || n2 > 0) test_printf_stderr("%*s# +%s:% 5d\n", indent, "", b2, cnt); if (real_diff && (cnt == 0 || (n1 > 0 && n2 > 0)) && bn1 != NULL && bn2 != NULL) test_printf_stderr("%*s# %s\n", indent, "", bdiff); } if (m1 != NULL) m1 += bytes; if (m2 != NULL) m2 += bytes; len -= bytes; } fin: test_printf_stderr("\n"); test_flush_stderr(); if (bufp != buffer) OPENSSL_free(bufp); } test/testutil/tests.c:331: error: INTEGER_OVERFLOW_L2 ([1, +oo] - 32):unsigned64. Showing all 6 steps of the trace test/testutil/tests.c:316:9: <LHS trace> 314. if (len > MEM_BUFFER_SIZE && (bufp = OPENSSL_malloc(len * 2)) == NULL) { 315. bufp = buffer; 316. len = MEM_BUFFER_SIZE; ^ 317. test_printf_stderr("%*s# WARNING: these BIGNUMs have been truncated", 318. indent, ""); test/testutil/tests.c:316:9: Assignment 314. if (len > MEM_BUFFER_SIZE && (bufp = OPENSSL_malloc(len * 2)) == NULL) { 315. bufp = buffer; 316. len = MEM_BUFFER_SIZE; ^ 317. test_printf_stderr("%*s# WARNING: these BIGNUMs have been truncated", 318. indent, ""); test/testutil/tests.c:201:1: <RHS trace> 199. } 200. 201. > static const int bn_bytes = (MAX_STRING_WIDTH - 9) / (BN_OUTPUT_SIZE * 2 + 1) 202. * BN_OUTPUT_SIZE; 203. static const int bn_chars = (MAX_STRING_WIDTH - 9) / (BN_OUTPUT_SIZE * 2 + 1) test/testutil/tests.c:201:1: Assignment 199. } 200. 201. > static const int bn_bytes = (MAX_STRING_WIDTH - 9) / (BN_OUTPUT_SIZE * 2 + 1) 202. * BN_OUTPUT_SIZE; 203. static const int bn_chars = (MAX_STRING_WIDTH - 9) / (BN_OUTPUT_SIZE * 2 + 1) test/testutil/tests.c:284:5: Assignment 282. { 283. const int indent = subtest_level(); 284. const size_t bytes = bn_bytes; ^ 285. char b1[MAX_STRING_WIDTH + 1], b2[MAX_STRING_WIDTH + 1]; 286. char *p, bdiff[MAX_STRING_WIDTH + 1]; test/testutil/tests.c:331:9: Binary operation: ([1, +oo] - 32):unsigned64 329. 330. while (len > 0) { 331. cnt = 8 * (len - bytes); ^ 332. n1 = convert_bn_memory(m1, bytes, b1, &lz1, bn1); 333. n2 = convert_bn_memory(m2, bytes, b2, &lz2, bn2);
https://github.com/openssl/openssl/blob/ffbaf06ade6dab6a0805a24087cf2e84c5db8d43/test/testutil/tests.c/#L331
d2a_code_trace_data_44403
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/rsa_sp800_56b_test.c:305: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `rsa_check_private_exponent`. Showing all 30 steps of the trace test/rsa_sp800_56b_test.c:305:14: Call 303. && TEST_true(RSA_set0_key(key, n, e, d)) 304. /* fails since d >= lcm(p-1, q-1) */ 305. && TEST_false(rsa_check_private_exponent(key, 8, ctx)) ^ 306. && TEST_true(BN_set_word(d, 45)) 307. /* d is correct size and 1 = e.d mod lcm(p-1, q-1) */ crypto/rsa/rsa_sp800_56b_check.c:157:1: Parameter `ctx->stack.depth` 155. * (Step 6b) 1 = (d*e) mod LCM(p–1, q–1) 156. */ 157. > int rsa_check_private_exponent(const RSA *rsa, int nbits, BN_CTX *ctx) 158. { 159. int ret; crypto/rsa/rsa_sp800_56b_check.c:166:5: Call 164. return 0; 165. 166. BN_CTX_start(ctx); ^ 167. r = BN_CTX_get(ctx); 168. p1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/rsa/rsa_sp800_56b_check.c:167:9: Call 165. 166. BN_CTX_start(ctx); 167. r = BN_CTX_get(ctx); ^ 168. p1 = BN_CTX_get(ctx); 169. q1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_check.c:168:10: Call 166. BN_CTX_start(ctx); 167. r = BN_CTX_get(ctx); 168. p1 = BN_CTX_get(ctx); ^ 169. q1 = BN_CTX_get(ctx); 170. lcm = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_check.c:169:10: Call 167. r = BN_CTX_get(ctx); 168. p1 = BN_CTX_get(ctx); 169. q1 = BN_CTX_get(ctx); ^ 170. lcm = BN_CTX_get(ctx); 171. p1q1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_check.c:170:11: Call 168. p1 = BN_CTX_get(ctx); 169. q1 = BN_CTX_get(ctx); 170. lcm = BN_CTX_get(ctx); ^ 171. p1q1 = BN_CTX_get(ctx); 172. gcd = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_check.c:171:12: Call 169. q1 = BN_CTX_get(ctx); 170. lcm = BN_CTX_get(ctx); 171. p1q1 = BN_CTX_get(ctx); ^ 172. gcd = BN_CTX_get(ctx); 173. ret = (gcd != NULL crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_check.c:172:11: Call 170. lcm = BN_CTX_get(ctx); 171. p1q1 = BN_CTX_get(ctx); 172. gcd = BN_CTX_get(ctx); ^ 173. ret = (gcd != NULL 174. /* LCM(p - 1, q - 1) */ crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_check.c:175:15: Call 173. ret = (gcd != NULL 174. /* LCM(p - 1, q - 1) */ 175. && (rsa_get_lcm(ctx, rsa->p, rsa->q, lcm, gcd, p1, q1, p1q1) == 1) ^ 176. /* (Step 6a) d < LCM(p - 1, q - 1) */ 177. && (BN_cmp(rsa->d, lcm) < 0) crypto/rsa/rsa_sp800_56b_check.c:220:1: Parameter `ctx->stack.depth` 218. 219. /* return LCM(p-1, q-1) */ 220. > int rsa_get_lcm(BN_CTX *ctx, const BIGNUM *p, const BIGNUM *q, 221. BIGNUM *lcm, BIGNUM *gcd, BIGNUM *p1, BIGNUM *q1, 222. BIGNUM *p1q1) crypto/rsa/rsa_sp800_56b_check.c:226:15: Call 224. return BN_sub(p1, p, BN_value_one()) /* p-1 */ 225. && BN_sub(q1, q, BN_value_one()) /* q-1 */ 226. && BN_mul(p1q1, p1, q1, ctx) /* (p-1)(q-1) */ ^ 227. && BN_gcd(gcd, p1, q1, ctx) 228. && BN_div(lcm, NULL, p1q1, gcd, ctx); /* LCM((p-1, q-1)) */ 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:507:1: Parameter `ctx->stack.depth` 505. } 506. 507. > int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 508. { 509. int ret = 0; 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.depth` 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.depth` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <LHS trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `rsa_check_private_exponent` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_44404
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_prime.c:139: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`. Showing all 10 steps of the trace crypto/bn/bn_prime.c:79:5: Call 77. if (ctx == NULL) 78. goto err; 79. BN_CTX_start(ctx); ^ 80. t = BN_CTX_get(ctx); 81. if (t == 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_prime.c:139:9: Call 137. OPENSSL_free(mods); 138. if (ctx != NULL) 139. BN_CTX_end(ctx); ^ 140. BN_CTX_free(ctx); 141. bn_check_top(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_44405
static void doapr_outch(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, int c) { assert(*sbuffer != NULL || buffer != NULL); if (buffer) { while (*currlen >= *maxlen) { if (*buffer == NULL) { if (*maxlen == 0) *maxlen = 1024; *buffer = OPENSSL_malloc(*maxlen); if (*currlen > 0) { assert(*sbuffer != NULL); memcpy(*buffer, *sbuffer, *currlen); } *sbuffer = NULL; } else { *maxlen += 1024; *buffer = OPENSSL_realloc(*buffer, *maxlen); } } assert(*sbuffer != NULL || *buffer != NULL); } if (*currlen < *maxlen) { if (*sbuffer) (*sbuffer)[(*currlen)++] = (char)c; else (*buffer)[(*currlen)++] = (char)c; } return; } crypto/ts/ts_rsp_sign.c:974: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] (⇐ [-1, 2147483647] + [0, +oo]) Size: 23 by call to `BIO_snprintf`. Showing all 15 steps of the trace crypto/ts/ts_rsp_sign.c:945:1: Array declaration 943. } 944. 945. > static ASN1_GENERALIZEDTIME 946. *TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time, 947. long sec, long usec, unsigned precision) crypto/ts/ts_rsp_sign.c:952:5: Assignment 950. struct tm *tm = NULL; 951. char genTime_str[17 + TS_MAX_CLOCK_PRECISION_DIGITS]; 952. char *p = genTime_str; ^ 953. char *p_end = genTime_str + sizeof(genTime_str); 954. crypto/ts/ts_rsp_sign.c:968:5: Assignment 966. * fraction-of-second details". 967. */ 968. p += BIO_snprintf(p, p_end - p, ^ 969. "%04d%02d%02d%02d%02d%02d", 970. tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, crypto/ts/ts_rsp_sign.c:974:9: Call 972. if (precision > 0) { 973. /* Add fraction of seconds (leave space for dot and null). */ 974. BIO_snprintf(p, 2 + precision, ".%06ld", usec); ^ 975. /* 976. * We cannot use the snprintf return value, because it might have crypto/bio/b_print.c:786:1: Parameter `*buf` 784. * function should be renamed, but to what?) 785. */ 786. > int BIO_snprintf(char *buf, size_t n, const char *format, ...) 787. { 788. va_list args; crypto/bio/b_print.c:793:11: Call 791. va_start(args, format); 792. 793. ret = BIO_vsnprintf(buf, n, format, args); ^ 794. 795. va_end(args); crypto/bio/b_print.c:799:1: Parameter `*buf` 797. } 798. 799. > int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) 800. { 801. size_t retlen; crypto/bio/b_print.c:804:5: Call 802. int truncated; 803. 804. _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); ^ 805. 806. if (truncated) crypto/bio/b_print.c:168:1: Parameter `*maxlen` 166. #define OSSL_MAX(p,q) ((p >= q) ? p : q) 167. 168. > static void 169. _dopr(char **sbuffer, 170. char **buffer, crypto/bio/b_print.c:199:17: Call 197. state = DP_S_FLAGS; 198. else 199. doapr_outch(sbuffer, buffer, &currlen, maxlen, ch); ^ 200. ch = *format++; 201. break; crypto/bio/b_print.c:703:1: <Offset trace> 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: Parameter `*maxlen` 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: <Length trace> 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:703:1: Parameter `**sbuffer` 701. } 702. 703. > static void 704. doapr_outch(char **sbuffer, 705. char **buffer, size_t *currlen, size_t *maxlen, int c) crypto/bio/b_print.c:732:13: Array access: Offset: [-1, +oo] (⇐ [-1, 2147483647] + [0, +oo]) Size: 23 by call to `BIO_snprintf` 730. if (*currlen < *maxlen) { 731. if (*sbuffer) 732. (*sbuffer)[(*currlen)++] = (char)c; ^ 733. else 734. (*buffer)[(*currlen)++] = (char)c;
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/crypto/bio/b_print.c/#L732
d2a_code_trace_data_44406
static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al) { #ifndef OPENSSL_NO_RSA unsigned char *encdata = NULL; EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *pctx = NULL; size_t enclen; unsigned char *pms = NULL; size_t pmslen = 0; if (s->session->peer == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pkey = X509_get0_pubkey(s->session->peer); if (EVP_PKEY_get0_RSA(pkey) == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pmslen = SSL_MAX_MASTER_KEY_LENGTH; pms = OPENSSL_malloc(pmslen); if (pms == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); *al = SSL_AD_INTERNAL_ERROR; return 0; } pms[0] = s->client_version >> 8; pms[1] = s->client_version & 0xff; if (RAND_bytes(pms + 2, (int)(pmslen - 2)) <= 0) { goto err; } if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } pctx = EVP_PKEY_CTX_new(pkey, NULL); if (pctx == NULL || EVP_PKEY_encrypt_init(pctx) <= 0 || EVP_PKEY_encrypt(pctx, NULL, &enclen, pms, pmslen) <= 0) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_EVP_LIB); goto err; } if (!WPACKET_allocate_bytes(pkt, enclen, &encdata) || EVP_PKEY_encrypt(pctx, encdata, &enclen, pms, pmslen) <= 0) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT); goto err; } EVP_PKEY_CTX_free(pctx); pctx = NULL; # ifdef PKCS1_CHECK if (s->options & SSL_OP_PKCS1_CHECK_1) (*p)[1]++; if (s->options & SSL_OP_PKCS1_CHECK_2) tmp_buf[0] = 0x70; # endif if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } s->s3->tmp.pms = pms; s->s3->tmp.pmslen = pmslen; if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen)) goto err; return 1; err: OPENSSL_clear_free(pms, pmslen); EVP_PKEY_CTX_free(pctx); return 0; #else SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); *al = SSL_AD_INTERNAL_ERROR; return 0; #endif } ssl/statem/statem_clnt.c:2685: error: NULL_DEREFERENCE pointer `pkey` last assigned on line 2684 could be null and is dereferenced by call to `EVP_PKEY_get0_RSA()` at line 2685, column 9. Showing all 30 steps of the trace ssl/statem/statem_clnt.c:2666:1: start of procedure tls_construct_cke_rsa() 2664. } 2665. 2666. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al) 2667. { 2668. #ifndef OPENSSL_NO_RSA ssl/statem/statem_clnt.c:2669:5: 2667. { 2668. #ifndef OPENSSL_NO_RSA 2669. > unsigned char *encdata = NULL; 2670. EVP_PKEY *pkey = NULL; 2671. EVP_PKEY_CTX *pctx = NULL; ssl/statem/statem_clnt.c:2670:5: 2668. #ifndef OPENSSL_NO_RSA 2669. unsigned char *encdata = NULL; 2670. > EVP_PKEY *pkey = NULL; 2671. EVP_PKEY_CTX *pctx = NULL; 2672. size_t enclen; ssl/statem/statem_clnt.c:2671:5: 2669. unsigned char *encdata = NULL; 2670. EVP_PKEY *pkey = NULL; 2671. > EVP_PKEY_CTX *pctx = NULL; 2672. size_t enclen; 2673. unsigned char *pms = NULL; ssl/statem/statem_clnt.c:2673:5: 2671. EVP_PKEY_CTX *pctx = NULL; 2672. size_t enclen; 2673. > unsigned char *pms = NULL; 2674. size_t pmslen = 0; 2675. ssl/statem/statem_clnt.c:2674:5: 2672. size_t enclen; 2673. unsigned char *pms = NULL; 2674. > size_t pmslen = 0; 2675. 2676. if (s->session->peer == NULL) { ssl/statem/statem_clnt.c:2676:9: Taking false branch 2674. size_t pmslen = 0; 2675. 2676. if (s->session->peer == NULL) { ^ 2677. /* 2678. * We should always have a server certificate with SSL_kRSA. ssl/statem/statem_clnt.c:2684:5: 2682. } 2683. 2684. > pkey = X509_get0_pubkey(s->session->peer); 2685. if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2686. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); crypto/x509/x509_cmp.c:265:1: start of procedure X509_get0_pubkey() 263. } 264. 265. > EVP_PKEY *X509_get0_pubkey(const X509 *x) 266. { 267. if (x == NULL) crypto/x509/x509_cmp.c:267:9: Taking false branch 265. EVP_PKEY *X509_get0_pubkey(const X509 *x) 266. { 267. if (x == NULL) ^ 268. return NULL; 269. return X509_PUBKEY_get0(x->cert_info.key); crypto/x509/x509_cmp.c:269:5: 267. if (x == NULL) 268. return NULL; 269. > return X509_PUBKEY_get0(x->cert_info.key); 270. } 271. crypto/x509/x_pubkey.c:140:1: start of procedure X509_PUBKEY_get0() 138. } 139. 140. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 141. { 142. EVP_PKEY *ret = NULL; crypto/x509/x_pubkey.c:142:5: 140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 141. { 142. > EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) crypto/x509/x_pubkey.c:144:9: Taking false branch 142. EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) ^ 145. return NULL; 146. crypto/x509/x_pubkey.c:144:24: Taking false branch 142. EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) ^ 145. return NULL; 146. crypto/x509/x_pubkey.c:147:9: Taking false branch 145. return NULL; 146. 147. if (key->pkey != NULL) ^ 148. return key->pkey; 149. crypto/x509/x_pubkey.c:158:5: 156. * in the queue. 157. */ 158. > x509_pubkey_decode(&ret, key); 159. /* If decode doesn't fail something bad happened */ 160. if (ret != NULL) { crypto/x509/x_pubkey.c:103:1: start of procedure x509_pubkey_decode() 101. 102. 103. > static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key) 104. { 105. EVP_PKEY *pkey = EVP_PKEY_new(); crypto/x509/x_pubkey.c:105:5: Skipping EVP_PKEY_new(): empty list of specs 103. static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key) 104. { 105. EVP_PKEY *pkey = EVP_PKEY_new(); ^ 106. 107. if (pkey == NULL) { crypto/x509/x_pubkey.c:107:9: Taking true branch 105. EVP_PKEY *pkey = EVP_PKEY_new(); 106. 107. if (pkey == NULL) { ^ 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); 109. return -1; crypto/x509/x_pubkey.c:108:9: Skipping ERR_put_error(): empty list of specs 106. 107. if (pkey == NULL) { 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); ^ 109. return -1; 110. } crypto/x509/x_pubkey.c:109:9: 107. if (pkey == NULL) { 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); 109. > return -1; 110. } 111. crypto/x509/x_pubkey.c:138:1: return from a call to x509_pubkey_decode 136. EVP_PKEY_free(pkey); 137. return 0; 138. > } 139. 140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) crypto/x509/x_pubkey.c:160:9: Taking false branch 158. x509_pubkey_decode(&ret, key); 159. /* If decode doesn't fail something bad happened */ 160. if (ret != NULL) { ^ 161. X509err(X509_F_X509_PUBKEY_GET0, ERR_R_INTERNAL_ERROR); 162. EVP_PKEY_free(ret); crypto/x509/x_pubkey.c:165:5: 163. } 164. 165. > return NULL; 166. } 167. crypto/x509/x_pubkey.c:166:1: return from a call to X509_PUBKEY_get0 164. 165. return NULL; 166. > } 167. 168. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) crypto/x509/x509_cmp.c:270:1: return from a call to X509_get0_pubkey 268. return NULL; 269. return X509_PUBKEY_get0(x->cert_info.key); 270. > } 271. 272. EVP_PKEY *X509_get_pubkey(X509 *x) ssl/statem/statem_clnt.c:2685:9: 2683. 2684. pkey = X509_get0_pubkey(s->session->peer); 2685. > if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2686. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); 2687. return 0; crypto/evp/p_lib.c:290:1: start of procedure EVP_PKEY_get0_RSA() 288. } 289. 290. > RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) 291. { 292. if (pkey->type != EVP_PKEY_RSA) { crypto/evp/p_lib.c:292:9: 290. RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) 291. { 292. > if (pkey->type != EVP_PKEY_RSA) { 293. EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY); 294. return NULL;
https://github.com/openssl/openssl/blob/b169c0ec40408566270fb638bcbfab01a0d2dc60/ssl/statem/statem_clnt.c/#L2685
d2a_code_trace_data_44407
static void fill_caches(H264Context *h, int mb_type, int for_deblock){ MpegEncContext * const s = &h->s; const int mb_xy= s->mb_x + s->mb_y*s->mb_stride; int topleft_xy, top_xy, topright_xy, left_xy[2]; int topleft_type, top_type, topright_type, left_type[2]; int left_block[8]; int topleft_partition= -1; int i; top_xy = mb_xy - (s->mb_stride << FIELD_PICTURE); if(for_deblock && (h->slice_num == 1 || h->slice_table[mb_xy] == h->slice_table[top_xy]) && !FRAME_MBAFF) return; topleft_xy = top_xy - 1; topright_xy= top_xy + 1; left_xy[1] = left_xy[0] = mb_xy-1; left_block[0]= 0; left_block[1]= 1; left_block[2]= 2; left_block[3]= 3; left_block[4]= 7; left_block[5]= 10; left_block[6]= 8; left_block[7]= 11; if(FRAME_MBAFF){ const int pair_xy = s->mb_x + (s->mb_y & ~1)*s->mb_stride; const int top_pair_xy = pair_xy - s->mb_stride; const int topleft_pair_xy = top_pair_xy - 1; const int topright_pair_xy = top_pair_xy + 1; const int topleft_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[topleft_pair_xy]); const int top_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[top_pair_xy]); const int topright_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[topright_pair_xy]); const int left_mb_frame_flag = !IS_INTERLACED(s->current_picture.mb_type[pair_xy-1]); const int curr_mb_frame_flag = !IS_INTERLACED(mb_type); const int bottom = (s->mb_y & 1); tprintf(s->avctx, "fill_caches: curr_mb_frame_flag:%d, left_mb_frame_flag:%d, topleft_mb_frame_flag:%d, top_mb_frame_flag:%d, topright_mb_frame_flag:%d\n", curr_mb_frame_flag, left_mb_frame_flag, topleft_mb_frame_flag, top_mb_frame_flag, topright_mb_frame_flag); if (bottom ? !curr_mb_frame_flag : (!curr_mb_frame_flag && !top_mb_frame_flag) ) { top_xy -= s->mb_stride; } if (bottom ? !curr_mb_frame_flag : (!curr_mb_frame_flag && !topleft_mb_frame_flag) ) { topleft_xy -= s->mb_stride; } else if(bottom && curr_mb_frame_flag && !left_mb_frame_flag) { topleft_xy += s->mb_stride; topleft_partition = 0; } if (bottom ? !curr_mb_frame_flag : (!curr_mb_frame_flag && !topright_mb_frame_flag) ) { topright_xy -= s->mb_stride; } if (left_mb_frame_flag != curr_mb_frame_flag) { left_xy[1] = left_xy[0] = pair_xy - 1; if (curr_mb_frame_flag) { if (bottom) { left_block[0]= 2; left_block[1]= 2; left_block[2]= 3; left_block[3]= 3; left_block[4]= 8; left_block[5]= 11; left_block[6]= 8; left_block[7]= 11; } else { left_block[0]= 0; left_block[1]= 0; left_block[2]= 1; left_block[3]= 1; left_block[4]= 7; left_block[5]= 10; left_block[6]= 7; left_block[7]= 10; } } else { left_xy[1] += s->mb_stride; left_block[1]= 2; left_block[2]= 0; left_block[3]= 2; left_block[5]= 10; left_block[6]= 7; left_block[7]= 10; } } } h->top_mb_xy = top_xy; h->left_mb_xy[0] = left_xy[0]; h->left_mb_xy[1] = left_xy[1]; if(for_deblock){ topleft_type = 0; topright_type = 0; top_type = h->slice_table[top_xy ] < 255 ? s->current_picture.mb_type[top_xy] : 0; left_type[0] = h->slice_table[left_xy[0] ] < 255 ? s->current_picture.mb_type[left_xy[0]] : 0; left_type[1] = h->slice_table[left_xy[1] ] < 255 ? s->current_picture.mb_type[left_xy[1]] : 0; if(FRAME_MBAFF && !IS_INTRA(mb_type)){ int list; int v = *(uint16_t*)&h->non_zero_count[mb_xy][14]; for(i=0; i<16; i++) h->non_zero_count_cache[scan8[i]] = (v>>i)&1; for(list=0; list<h->list_count; list++){ if(USES_LIST(mb_type,list)){ uint32_t *src = (uint32_t*)s->current_picture.motion_val[list][h->mb2b_xy[mb_xy]]; uint32_t *dst = (uint32_t*)h->mv_cache[list][scan8[0]]; int8_t *ref = &s->current_picture.ref_index[list][h->mb2b8_xy[mb_xy]]; for(i=0; i<4; i++, dst+=8, src+=h->b_stride){ dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; } *(uint32_t*)&h->ref_cache[list][scan8[ 0]] = *(uint32_t*)&h->ref_cache[list][scan8[ 2]] = pack16to32(ref[0],ref[1])*0x0101; ref += h->b8_stride; *(uint32_t*)&h->ref_cache[list][scan8[ 8]] = *(uint32_t*)&h->ref_cache[list][scan8[10]] = pack16to32(ref[0],ref[1])*0x0101; }else{ fill_rectangle(&h-> mv_cache[list][scan8[ 0]], 4, 4, 8, 0, 4); fill_rectangle(&h->ref_cache[list][scan8[ 0]], 4, 4, 8, (uint8_t)LIST_NOT_USED, 1); } } } }else{ topleft_type = h->slice_table[topleft_xy ] == h->slice_num ? s->current_picture.mb_type[topleft_xy] : 0; top_type = h->slice_table[top_xy ] == h->slice_num ? s->current_picture.mb_type[top_xy] : 0; topright_type= h->slice_table[topright_xy] == h->slice_num ? s->current_picture.mb_type[topright_xy]: 0; left_type[0] = h->slice_table[left_xy[0] ] == h->slice_num ? s->current_picture.mb_type[left_xy[0]] : 0; left_type[1] = h->slice_table[left_xy[1] ] == h->slice_num ? s->current_picture.mb_type[left_xy[1]] : 0; } if(IS_INTRA(mb_type)){ h->topleft_samples_available= h->top_samples_available= h->left_samples_available= 0xFFFF; h->topright_samples_available= 0xEEEA; if(!IS_INTRA(top_type) && (top_type==0 || h->pps.constrained_intra_pred)){ h->topleft_samples_available= 0xB3FF; h->top_samples_available= 0x33FF; h->topright_samples_available= 0x26EA; } for(i=0; i<2; i++){ if(!IS_INTRA(left_type[i]) && (left_type[i]==0 || h->pps.constrained_intra_pred)){ h->topleft_samples_available&= 0xDF5F; h->left_samples_available&= 0x5F5F; } } if(!IS_INTRA(topleft_type) && (topleft_type==0 || h->pps.constrained_intra_pred)) h->topleft_samples_available&= 0x7FFF; if(!IS_INTRA(topright_type) && (topright_type==0 || h->pps.constrained_intra_pred)) h->topright_samples_available&= 0xFBFF; if(IS_INTRA4x4(mb_type)){ if(IS_INTRA4x4(top_type)){ h->intra4x4_pred_mode_cache[4+8*0]= h->intra4x4_pred_mode[top_xy][4]; h->intra4x4_pred_mode_cache[5+8*0]= h->intra4x4_pred_mode[top_xy][5]; h->intra4x4_pred_mode_cache[6+8*0]= h->intra4x4_pred_mode[top_xy][6]; h->intra4x4_pred_mode_cache[7+8*0]= h->intra4x4_pred_mode[top_xy][3]; }else{ int pred; if(!top_type || (IS_INTER(top_type) && h->pps.constrained_intra_pred)) pred= -1; else{ pred= 2; } h->intra4x4_pred_mode_cache[4+8*0]= h->intra4x4_pred_mode_cache[5+8*0]= h->intra4x4_pred_mode_cache[6+8*0]= h->intra4x4_pred_mode_cache[7+8*0]= pred; } for(i=0; i<2; i++){ if(IS_INTRA4x4(left_type[i])){ h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= h->intra4x4_pred_mode[left_xy[i]][left_block[0+2*i]]; h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= h->intra4x4_pred_mode[left_xy[i]][left_block[1+2*i]]; }else{ int pred; if(!left_type[i] || (IS_INTER(left_type[i]) && h->pps.constrained_intra_pred)) pred= -1; else{ pred= 2; } h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= pred; } } } } if(top_type){ h->non_zero_count_cache[4+8*0]= h->non_zero_count[top_xy][4]; h->non_zero_count_cache[5+8*0]= h->non_zero_count[top_xy][5]; h->non_zero_count_cache[6+8*0]= h->non_zero_count[top_xy][6]; h->non_zero_count_cache[7+8*0]= h->non_zero_count[top_xy][3]; h->non_zero_count_cache[1+8*0]= h->non_zero_count[top_xy][9]; h->non_zero_count_cache[2+8*0]= h->non_zero_count[top_xy][8]; h->non_zero_count_cache[1+8*3]= h->non_zero_count[top_xy][12]; h->non_zero_count_cache[2+8*3]= h->non_zero_count[top_xy][11]; }else{ h->non_zero_count_cache[4+8*0]= h->non_zero_count_cache[5+8*0]= h->non_zero_count_cache[6+8*0]= h->non_zero_count_cache[7+8*0]= h->non_zero_count_cache[1+8*0]= h->non_zero_count_cache[2+8*0]= h->non_zero_count_cache[1+8*3]= h->non_zero_count_cache[2+8*3]= h->pps.cabac && !IS_INTRA(mb_type) ? 0 : 64; } for (i=0; i<2; i++) { if(left_type[i]){ h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[0+2*i]]; h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[1+2*i]]; h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count[left_xy[i]][left_block[4+2*i]]; h->non_zero_count_cache[0+8*4 + 8*i]= h->non_zero_count[left_xy[i]][left_block[5+2*i]]; }else{ h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count_cache[0+8*4 + 8*i]= h->pps.cabac && !IS_INTRA(mb_type) ? 0 : 64; } } if( h->pps.cabac ) { if(top_type) { h->top_cbp = h->cbp_table[top_xy]; } else if(IS_INTRA(mb_type)) { h->top_cbp = 0x1C0; } else { h->top_cbp = 0; } if (left_type[0]) { h->left_cbp = h->cbp_table[left_xy[0]] & 0x1f0; } else if(IS_INTRA(mb_type)) { h->left_cbp = 0x1C0; } else { h->left_cbp = 0; } if (left_type[0]) { h->left_cbp |= ((h->cbp_table[left_xy[0]]>>((left_block[0]&(~1))+1))&0x1) << 1; } if (left_type[1]) { h->left_cbp |= ((h->cbp_table[left_xy[1]]>>((left_block[2]&(~1))+1))&0x1) << 3; } } #if 1 if(IS_INTER(mb_type) || IS_DIRECT(mb_type)){ int list; for(list=0; list<h->list_count; list++){ if(!USES_LIST(mb_type, list) && !IS_DIRECT(mb_type) && !h->deblocking_filter){ continue; } h->mv_cache_clean[list]= 0; if(USES_LIST(top_type, list)){ const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride; const int b8_xy= h->mb2b8_xy[top_xy] + h->b8_stride; *(uint32_t*)h->mv_cache[list][scan8[0] + 0 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + 0]; *(uint32_t*)h->mv_cache[list][scan8[0] + 1 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + 1]; *(uint32_t*)h->mv_cache[list][scan8[0] + 2 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + 2]; *(uint32_t*)h->mv_cache[list][scan8[0] + 3 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + 3]; h->ref_cache[list][scan8[0] + 0 - 1*8]= h->ref_cache[list][scan8[0] + 1 - 1*8]= s->current_picture.ref_index[list][b8_xy + 0]; h->ref_cache[list][scan8[0] + 2 - 1*8]= h->ref_cache[list][scan8[0] + 3 - 1*8]= s->current_picture.ref_index[list][b8_xy + 1]; }else{ *(uint32_t*)h->mv_cache [list][scan8[0] + 0 - 1*8]= *(uint32_t*)h->mv_cache [list][scan8[0] + 1 - 1*8]= *(uint32_t*)h->mv_cache [list][scan8[0] + 2 - 1*8]= *(uint32_t*)h->mv_cache [list][scan8[0] + 3 - 1*8]= 0; *(uint32_t*)&h->ref_cache[list][scan8[0] + 0 - 1*8]= ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101; } for(i=0; i<2; i++){ int cache_idx = scan8[0] - 1 + i*2*8; if(USES_LIST(left_type[i], list)){ const int b_xy= h->mb2b_xy[left_xy[i]] + 3; const int b8_xy= h->mb2b8_xy[left_xy[i]] + 1; *(uint32_t*)h->mv_cache[list][cache_idx ]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0+i*2]]; *(uint32_t*)h->mv_cache[list][cache_idx+8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[1+i*2]]; h->ref_cache[list][cache_idx ]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[0+i*2]>>1)]; h->ref_cache[list][cache_idx+8]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[1+i*2]>>1)]; }else{ *(uint32_t*)h->mv_cache [list][cache_idx ]= *(uint32_t*)h->mv_cache [list][cache_idx+8]= 0; h->ref_cache[list][cache_idx ]= h->ref_cache[list][cache_idx+8]= left_type[i] ? LIST_NOT_USED : PART_NOT_AVAILABLE; } } if((for_deblock || (IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred)) && !FRAME_MBAFF) continue; if(USES_LIST(topleft_type, list)){ const int b_xy = h->mb2b_xy[topleft_xy] + 3 + h->b_stride + (topleft_partition & 2*h->b_stride); const int b8_xy= h->mb2b8_xy[topleft_xy] + 1 + (topleft_partition & h->b8_stride); *(uint32_t*)h->mv_cache[list][scan8[0] - 1 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy]; h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy]; }else{ *(uint32_t*)h->mv_cache[list][scan8[0] - 1 - 1*8]= 0; h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE; } if(USES_LIST(topright_type, list)){ const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride; const int b8_xy= h->mb2b8_xy[topright_xy] + h->b8_stride; *(uint32_t*)h->mv_cache[list][scan8[0] + 4 - 1*8]= *(uint32_t*)s->current_picture.motion_val[list][b_xy]; h->ref_cache[list][scan8[0] + 4 - 1*8]= s->current_picture.ref_index[list][b8_xy]; }else{ *(uint32_t*)h->mv_cache [list][scan8[0] + 4 - 1*8]= 0; h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE; } if((IS_SKIP(mb_type) || IS_DIRECT(mb_type)) && !FRAME_MBAFF) continue; h->ref_cache[list][scan8[5 ]+1] = h->ref_cache[list][scan8[7 ]+1] = h->ref_cache[list][scan8[13]+1] = h->ref_cache[list][scan8[4 ]] = h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE; *(uint32_t*)h->mv_cache [list][scan8[5 ]+1]= *(uint32_t*)h->mv_cache [list][scan8[7 ]+1]= *(uint32_t*)h->mv_cache [list][scan8[13]+1]= *(uint32_t*)h->mv_cache [list][scan8[4 ]]= *(uint32_t*)h->mv_cache [list][scan8[12]]= 0; if( h->pps.cabac ) { if(USES_LIST(top_type, list)){ const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride; *(uint32_t*)h->mvd_cache[list][scan8[0] + 0 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 0]; *(uint32_t*)h->mvd_cache[list][scan8[0] + 1 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 1]; *(uint32_t*)h->mvd_cache[list][scan8[0] + 2 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 2]; *(uint32_t*)h->mvd_cache[list][scan8[0] + 3 - 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + 3]; }else{ *(uint32_t*)h->mvd_cache [list][scan8[0] + 0 - 1*8]= *(uint32_t*)h->mvd_cache [list][scan8[0] + 1 - 1*8]= *(uint32_t*)h->mvd_cache [list][scan8[0] + 2 - 1*8]= *(uint32_t*)h->mvd_cache [list][scan8[0] + 3 - 1*8]= 0; } if(USES_LIST(left_type[0], list)){ const int b_xy= h->mb2b_xy[left_xy[0]] + 3; *(uint32_t*)h->mvd_cache[list][scan8[0] - 1 + 0*8]= *(uint32_t*)h->mvd_table[list][b_xy + h->b_stride*left_block[0]]; *(uint32_t*)h->mvd_cache[list][scan8[0] - 1 + 1*8]= *(uint32_t*)h->mvd_table[list][b_xy + h->b_stride*left_block[1]]; }else{ *(uint32_t*)h->mvd_cache [list][scan8[0] - 1 + 0*8]= *(uint32_t*)h->mvd_cache [list][scan8[0] - 1 + 1*8]= 0; } if(USES_LIST(left_type[1], list)){ const int b_xy= h->mb2b_xy[left_xy[1]] + 3; *(uint32_t*)h->mvd_cache[list][scan8[0] - 1 + 2*8]= *(uint32_t*)h->mvd_table[list][b_xy + h->b_stride*left_block[2]]; *(uint32_t*)h->mvd_cache[list][scan8[0] - 1 + 3*8]= *(uint32_t*)h->mvd_table[list][b_xy + h->b_stride*left_block[3]]; }else{ *(uint32_t*)h->mvd_cache [list][scan8[0] - 1 + 2*8]= *(uint32_t*)h->mvd_cache [list][scan8[0] - 1 + 3*8]= 0; } *(uint32_t*)h->mvd_cache [list][scan8[5 ]+1]= *(uint32_t*)h->mvd_cache [list][scan8[7 ]+1]= *(uint32_t*)h->mvd_cache [list][scan8[13]+1]= *(uint32_t*)h->mvd_cache [list][scan8[4 ]]= *(uint32_t*)h->mvd_cache [list][scan8[12]]= 0; if(h->slice_type == FF_B_TYPE){ fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, 0, 1); if(IS_DIRECT(top_type)){ *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0x01010101; }else if(IS_8X8(top_type)){ int b8_xy = h->mb2b8_xy[top_xy] + h->b8_stride; h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy]; h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 1]; }else{ *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0; } if(IS_DIRECT(left_type[0])) h->direct_cache[scan8[0] - 1 + 0*8]= 1; else if(IS_8X8(left_type[0])) h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[h->mb2b8_xy[left_xy[0]] + 1 + h->b8_stride*(left_block[0]>>1)]; else h->direct_cache[scan8[0] - 1 + 0*8]= 0; if(IS_DIRECT(left_type[1])) h->direct_cache[scan8[0] - 1 + 2*8]= 1; else if(IS_8X8(left_type[1])) h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[h->mb2b8_xy[left_xy[1]] + 1 + h->b8_stride*(left_block[2]>>1)]; else h->direct_cache[scan8[0] - 1 + 2*8]= 0; } } if(FRAME_MBAFF){ #define MAP_MVS\ MAP_F2F(scan8[0] - 1 - 1*8, topleft_type)\ MAP_F2F(scan8[0] + 0 - 1*8, top_type)\ MAP_F2F(scan8[0] + 1 - 1*8, top_type)\ MAP_F2F(scan8[0] + 2 - 1*8, top_type)\ MAP_F2F(scan8[0] + 3 - 1*8, top_type)\ MAP_F2F(scan8[0] + 4 - 1*8, topright_type)\ MAP_F2F(scan8[0] - 1 + 0*8, left_type[0])\ MAP_F2F(scan8[0] - 1 + 1*8, left_type[0])\ MAP_F2F(scan8[0] - 1 + 2*8, left_type[1])\ MAP_F2F(scan8[0] - 1 + 3*8, left_type[1]) if(MB_FIELD){ #define MAP_F2F(idx, mb_type)\ if(!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\ h->ref_cache[list][idx] <<= 1;\ h->mv_cache[list][idx][1] /= 2;\ h->mvd_cache[list][idx][1] /= 2;\ } MAP_MVS #undef MAP_F2F }else{ #define MAP_F2F(idx, mb_type)\ if(IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\ h->ref_cache[list][idx] >>= 1;\ h->mv_cache[list][idx][1] <<= 1;\ h->mvd_cache[list][idx][1] <<= 1;\ } MAP_MVS #undef MAP_F2F } } } } #endif h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]); } libavcodec/h264.c:388: error: Integer Overflow L2 ([0, 255] × 16843009):signed32. libavcodec/h264.c:388:72: <LHS trace> 386. *(uint32_t*)h->mv_cache [list][scan8[0] + 2 - 1*8]= 387. *(uint32_t*)h->mv_cache [list][scan8[0] + 3 - 1*8]= 0; 388. *(uint32_t*)&h->ref_cache[list][scan8[0] + 0 - 1*8]= ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101; ^ 389. } 390. libavcodec/h264.c:388:72: Assignment 386. *(uint32_t*)h->mv_cache [list][scan8[0] + 2 - 1*8]= 387. *(uint32_t*)h->mv_cache [list][scan8[0] + 3 - 1*8]= 0; 388. *(uint32_t*)&h->ref_cache[list][scan8[0] + 0 - 1*8]= ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101; ^ 389. } 390. libavcodec/h264.c:388:17: Binary operation: ([0, 255] × 16843009):signed32 386. *(uint32_t*)h->mv_cache [list][scan8[0] + 2 - 1*8]= 387. *(uint32_t*)h->mv_cache [list][scan8[0] + 3 - 1*8]= 0; 388. *(uint32_t*)&h->ref_cache[list][scan8[0] + 0 - 1*8]= ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101; ^ 389. } 390.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L388
d2a_code_trace_data_44408
static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) { const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; int alpha = alpha_table[index_a]; int beta = beta_table[qp - qp_bd_offset + h->slice_beta_offset]; if (alpha ==0 || beta == 0) return; if( bS[0] < 4 ) { int8_t tc[4]; tc[0] = tc0_table[index_a][bS[0*bsi]]; tc[1] = tc0_table[index_a][bS[1*bsi]]; tc[2] = tc0_table[index_a][bS[2*bsi]]; tc[3] = tc0_table[index_a][bS[3*bsi]]; h->h264dsp.h264_h_loop_filter_luma_mbaff(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_h_loop_filter_luma_mbaff_intra(pix, stride, alpha, beta); } } libavcodec/h264_loopfilter.c:714: error: Buffer Overrun L2 Offset: [1, 4] Size: 4 by call to `filter_mb_mbaff_edgev`. libavcodec/h264_loopfilter.c:684:21: Assignment 682. 683. if( IS_INTRA( mbn_type ) ) 684. bS[i] = 4; ^ 685. else{ 686. bS[i] = 1 + !!(h->non_zero_count_cache[12+8*(i>>1)] | libavcodec/h264_loopfilter.c:714:13: Call 712. if(MB_FIELD){ 713. filter_mb_mbaff_edgev ( h, img_y , linesize, bS , 1, qp [0] ); 714. filter_mb_mbaff_edgev ( h, img_y + 8* linesize, linesize, bS+4, 1, qp [1] ); ^ 715. if (chroma){ 716. if (CHROMA444) { libavcodec/h264_loopfilter.c:140:1: <Offset trace> 138. } 139. 140. static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) { ^ 141. const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); 142. int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; libavcodec/h264_loopfilter.c:140:1: Parameter `*bS` 138. } 139. 140. static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) { ^ 141. const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); 142. int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; libavcodec/h264_loopfilter.c:73:1: <Length trace> 71. 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 72. }; 73. static const uint8_t tc0_table[52*3][4] = { ^ 74. {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, 75. {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, libavcodec/h264_loopfilter.c:73:1: Array declaration 71. 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 72. }; 73. static const uint8_t tc0_table[52*3][4] = { ^ 74. {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, 75. {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, libavcodec/h264_loopfilter.c:149:17: Array access: Offset: [1, 4] Size: 4 by call to `filter_mb_mbaff_edgev` 147. if( bS[0] < 4 ) { 148. int8_t tc[4]; 149. tc[0] = tc0_table[index_a][bS[0*bsi]]; ^ 150. tc[1] = tc0_table[index_a][bS[1*bsi]]; 151. tc[2] = tc0_table[index_a][bS[2*bsi]];
https://github.com/libav/libav/blob/ecf026f1aa8ffe170b5b8c577cae56a405ebafc8/libavcodec/h264_loopfilter.c/#L149
d2a_code_trace_data_44409
static int check_chain_extensions(X509_STORE_CTX *ctx) { int i, ok = 0, must_be_ca, plen = 0; X509 *x; int (*cb) (int xok, X509_STORE_CTX *xctx); int proxy_path_length = 0; int purpose; int allow_proxy_certs; cb = ctx->verify_cb; must_be_ca = -1; if (ctx->parent) { allow_proxy_certs = 0; purpose = X509_PURPOSE_CRL_SIGN; } else { allow_proxy_certs = ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) allow_proxy_certs = 1; purpose = ctx->param->purpose; } for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { int ret; x = sk_X509_value(ctx->chain, i); if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) && (x->ex_flags & EXFLAG_CRITICAL)) { ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) { ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } ret = X509_check_ca(x); switch (must_be_ca) { case -1: if ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1) && (ret != 0)) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; case 0: if (ret != 0) { ret = 0; ctx->error = X509_V_ERR_INVALID_NON_CA; } else ret = 1; break; default: if ((ret == 0) || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1))) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; } if (ret == 0) { ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (ctx->param->purpose > 0) { ret = X509_check_purpose(x, purpose, must_be_ca > 0); if ((ret == 0) || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1))) { ctx->error = X509_V_ERR_INVALID_PURPOSE; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } } if ((i > 1) && !(x->ex_flags & EXFLAG_SI) && (x->ex_pathlen != -1) && (plen > (x->ex_pathlen + proxy_path_length + 1))) { ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (!(x->ex_flags & EXFLAG_SI)) plen++; if (x->ex_flags & EXFLAG_PROXY) { if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) { ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } proxy_path_length++; must_be_ca = 0; } else must_be_ca = 1; } ok = 1; end: return ok; } crypto/x509/x509_vfy.c:382: error: NULL_DEREFERENCE pointer `x` last assigned on line 380 could be null and is dereferenced at line 382, column 17. Showing all 23 steps of the trace crypto/x509/x509_vfy.c:340:1: start of procedure check_chain_extensions() 338. */ 339. 340. > static int check_chain_extensions(X509_STORE_CTX *ctx) 341. { 342. int i, ok = 0, must_be_ca, plen = 0; crypto/x509/x509_vfy.c:342:5: 340. static int check_chain_extensions(X509_STORE_CTX *ctx) 341. { 342. > int i, ok = 0, must_be_ca, plen = 0; 343. X509 *x; 344. int (*cb) (int xok, X509_STORE_CTX *xctx); crypto/x509/x509_vfy.c:345:5: 343. X509 *x; 344. int (*cb) (int xok, X509_STORE_CTX *xctx); 345. > int proxy_path_length = 0; 346. int purpose; 347. int allow_proxy_certs; crypto/x509/x509_vfy.c:348:5: 346. int purpose; 347. int allow_proxy_certs; 348. > cb = ctx->verify_cb; 349. 350. /*- crypto/x509/x509_vfy.c:359:5: 357. * all certificates in the chain except the leaf certificate. 358. */ 359. > must_be_ca = -1; 360. 361. /* CRL path validation */ crypto/x509/x509_vfy.c:362:9: Taking false branch 360. 361. /* CRL path validation */ 362. if (ctx->parent) { ^ 363. allow_proxy_certs = 0; 364. purpose = X509_PURPOSE_CRL_SIGN; crypto/x509/x509_vfy.c:367:17: Condition is true 365. } else { 366. allow_proxy_certs = 367. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); ^ 368. /* 369. * A hack to keep people who don't want to modify their software crypto/x509/x509_vfy.c:367:13: 365. } else { 366. allow_proxy_certs = 367. > ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 368. /* 369. * A hack to keep people who don't want to modify their software crypto/x509/x509_vfy.c:366:9: 364. purpose = X509_PURPOSE_CRL_SIGN; 365. } else { 366. > allow_proxy_certs = 367. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 368. /* crypto/x509/x509_vfy.c:372:13: Taking false branch 370. * happy 371. */ 372. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) ^ 373. allow_proxy_certs = 1; 374. purpose = ctx->param->purpose; crypto/x509/x509_vfy.c:374:9: 372. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) 373. allow_proxy_certs = 1; 374. > purpose = ctx->param->purpose; 375. } 376. crypto/x509/x509_vfy.c:378:10: 376. 377. /* Check all untrusted certificates */ 378. > for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { 379. int ret; 380. x = sk_X509_value(ctx->chain, i); crypto/x509/x509_vfy.c:378:17: Loop condition is true. Entering loop body 376. 377. /* Check all untrusted certificates */ 378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { ^ 379. int ret; 380. x = sk_X509_value(ctx->chain, i); crypto/x509/x509_vfy.c:380:13: Condition is true 378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { 379. int ret; 380. x = sk_X509_value(ctx->chain, i); ^ 381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 382. && (x->ex_flags & EXFLAG_CRITICAL)) { crypto/x509/x509_vfy.c:380:9: 378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { 379. int ret; 380. > x = sk_X509_value(ctx->chain, i); 381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 382. && (x->ex_flags & EXFLAG_CRITICAL)) { crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:17: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:28: Taking true branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:327:9: 325. { 326. if (!st || (i < 0) || (i >= st->num)) 327. > return NULL; 328. return st->data[i]; 329. } crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:381:15: Taking true branch 379. int ret; 380. x = sk_X509_value(ctx->chain, i); 381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) ^ 382. && (x->ex_flags & EXFLAG_CRITICAL)) { 383. ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; crypto/x509/x509_vfy.c:382:17: 380. x = sk_X509_value(ctx->chain, i); 381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 382. > && (x->ex_flags & EXFLAG_CRITICAL)) { 383. ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; 384. ctx->error_depth = i;
https://github.com/openssl/openssl/blob/e29c73c93b88a4b7f492c7c8c7343223e7548612/crypto/x509/x509_vfy.c/#L382
d2a_code_trace_data_44410
static int dca_subsubframe(DCAContext * s) { int k, l; int subsubframe = s->current_subsubframe; const float *quant_step_table; float subband_samples[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][8]; if (s->bit_rate == 0x1f) quant_step_table = lossless_quant_d; else quant_step_table = lossy_quant_d; for (k = 0; k < s->prim_channels; k++) { for (l = 0; l < s->vq_start_subband[k]; l++) { int m; int abits = s->bitalloc[k][l]; float quant_step_size = quant_step_table[abits]; float rscale; int sel = s->quant_index_huffman[k][abits]; if(!abits){ memset(subband_samples[k][l], 0, 8 * sizeof(subband_samples[0][0][0])); }else if(abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table){ if(abits <= 7){ int block_code1, block_code2, size, levels; int block[8]; size = abits_sizes[abits-1]; levels = abits_levels[abits-1]; block_code1 = get_bits(&s->gb, size); decode_blockcode(block_code1, levels, block); block_code2 = get_bits(&s->gb, size); decode_blockcode(block_code2, levels, &block[4]); for (m = 0; m < 8; m++) subband_samples[k][l][m] = block[m]; }else{ for (m = 0; m < 8; m++) subband_samples[k][l][m] = get_sbits(&s->gb, abits - 3); } }else{ for (m = 0; m < 8; m++) subband_samples[k][l][m] = get_bitalloc(&s->gb, &dca_smpl_bitalloc[abits], sel); } if (s->transition_mode[k][l] && subsubframe >= s->transition_mode[k][l]) rscale = quant_step_size * s->scale_factor[k][l][1]; else rscale = quant_step_size * s->scale_factor[k][l][0]; rscale *= s->scalefactor_adj[k][sel]; for (m = 0; m < 8; m++) subband_samples[k][l][m] *= rscale; if (s->prediction_mode[k][l]) { int n; for (m = 0; m < 8; m++) { for (n = 1; n <= 4; n++) if (m >= n) subband_samples[k][l][m] += (adpcm_vb[s->prediction_vq[k][l]][n - 1] * subband_samples[k][l][m - n] / 8192); else if (s->predictor_history) subband_samples[k][l][m] += (adpcm_vb[s->prediction_vq[k][l]][n - 1] * s->subband_samples_hist[k][l][m - n + 4] / 8192); } } } for (l = s->vq_start_subband[k]; l < s->subband_activity[k]; l++) { int m; if (!s->debug_flag & 0x01) { av_log(s->avctx, AV_LOG_DEBUG, "Stream with high frequencies VQ coding\n"); s->debug_flag |= 0x01; } for (m = 0; m < 8; m++) { subband_samples[k][l][m] = high_freq_vq[s->high_freq_vq[k][l]][subsubframe * 8 + m] * (float) s->scale_factor[k][l][0] / 16.0; } } } if (s->aspf || subsubframe == s->subsubframes - 1) { if (0xFFFF == get_bits(&s->gb, 16)) { #ifdef TRACE av_log(s->avctx, AV_LOG_DEBUG, "Got subframe DSYNC\n"); #endif } else { av_log(s->avctx, AV_LOG_ERROR, "Didn't get subframe DSYNC\n"); } } for (k = 0; k < s->prim_channels; k++) for (l = 0; l < s->vq_start_subband[k]; l++) memcpy(s->subband_samples_hist[k][l], &subband_samples[k][l][4], 4 * sizeof(subband_samples[0][0][0])); for (k = 0; k < s->prim_channels; k++) { qmf_32_subbands(s, k, subband_samples[k], &s->samples[256 * k], 2.0 / 3 , 0 ); } if (s->prim_channels > dca_channels[s->output & DCA_CHANNEL_MASK]) { dca_downmix(s->samples, s->amode, s->downmix_coef); } if (s->output & DCA_LFE) { int lfe_samples = 2 * s->lfe * s->subsubframes; int i_channels = dca_channels[s->output & DCA_CHANNEL_MASK]; lfe_interpolation_fir(s->lfe, 2 * s->lfe, s->lfe_data + lfe_samples + 2 * s->lfe * subsubframe, &s->samples[256 * i_channels], 256.0, 0 ); } return 0; } libavcodec/dca.c:939: error: Buffer Overrun L3 Offset: [-3, 6] Size: 8. libavcodec/dca.c:934:22: <Offset trace> 932. if (s->prediction_mode[k][l]) { 933. int n; 934. for (m = 0; m < 8; m++) { ^ 935. for (n = 1; n <= 4; n++) 936. if (m >= n) libavcodec/dca.c:934:22: Assignment 932. if (s->prediction_mode[k][l]) { 933. int n; 934. for (m = 0; m < 8; m++) { ^ 935. for (n = 1; n <= 4; n++) 936. if (m >= n) libavcodec/dca.c:848:1: <Length trace> 846. static const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 }; 847. 848. static int dca_subsubframe(DCAContext * s) ^ 849. { 850. int k, l; libavcodec/dca.c:848:1: Array declaration 846. static const uint8_t abits_levels[7] = { 3, 5, 7, 9, 13, 17, 25 }; 847. 848. static int dca_subsubframe(DCAContext * s) ^ 849. { 850. int k, l; libavcodec/dca.c:939:34: Array access: Offset: [-3, 6] Size: 8 937. subband_samples[k][l][m] += 938. (adpcm_vb[s->prediction_vq[k][l]][n - 1] * 939. subband_samples[k][l][m - n] / 8192); ^ 940. else if (s->predictor_history) 941. subband_samples[k][l][m] +=
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/dca.c/#L939
d2a_code_trace_data_44411
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_gf2m.c:1042: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqr_arr`. Showing all 13 steps of the trace crypto/bn/bn_gf2m.c:983:1: Parameter `ctx->stack.depth` 981. * 0. Uses algorithms A.4.7 and A.4.6 from IEEE P1363. 982. */ 983. > int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[], 984. BN_CTX *ctx) 985. { crypto/bn/bn_gf2m.c:997:5: Call 995. } 996. 997. BN_CTX_start(ctx); ^ 998. a = BN_CTX_get(ctx); 999. z = 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_gf2m.c:1042:22: Call 1040. goto err; 1041. for (j = 1; j <= p[0] - 1; j++) { 1042. if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx)) ^ 1043. goto err; 1044. if (!BN_GF2m_mod_sqr_arr(w2, w, p, ctx)) crypto/bn/bn_gf2m.c:489:1: Parameter `ctx->stack.depth` 487. 488. /* Square a, reduce the result mod p, and store it in a. r could be a. */ 489. > int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], 490. BN_CTX *ctx) 491. { crypto/bn/bn_gf2m.c:496:5: Call 494. 495. bn_check_top(a); 496. BN_CTX_start(ctx); ^ 497. if ((s = BN_CTX_get(ctx)) == NULL) 498. goto err; 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_gf2m.c:514:5: Call 512. ret = 1; 513. err: 514. BN_CTX_end(ctx); ^ 515. return ret; 516. } 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:274:1: <LHS trace> 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:274:1: Parameter `st->depth` 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:276:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqr_arr` 274. static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; ^ 277. } 278.
https://github.com/openssl/openssl/blob/f3021aca4a154c2ff9bd0030f7974eb6a719550d/crypto/bn/bn_ctx.c/#L276
d2a_code_trace_data_44412
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) { int line_size; int sample_size = av_get_bytes_per_sample(sample_fmt); int planar = av_sample_fmt_is_planar(sample_fmt); if (!sample_size || nb_samples <= 0 || nb_channels <= 0) return AVERROR(EINVAL); if (!align) { if (nb_samples > INT_MAX - 31) return AVERROR(EINVAL); align = 1; nb_samples = FFALIGN(nb_samples, 32); } if (nb_channels > INT_MAX / align || (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size) return AVERROR(EINVAL); line_size = planar ? FFALIGN(nb_samples * sample_size, align) : FFALIGN(nb_samples * sample_size * nb_channels, align); if (linesize) *linesize = line_size; return planar ? line_size * nb_channels : line_size; } avconv.c:2447: error: Integer Overflow L2 ([1, 2147483616] + 32):signed32 by call to `process_input_packet`. avconv.c:2448:13: Call 2446. if (ist->decoding_needed) { 2447. process_input_packet(ist, NULL, 1); 2448. avcodec_flush_buffers(avctx); ^ 2449. } 2450. libavcodec/utils.c:2247:9: Call 2245. 2246. if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) 2247. ff_thread_flush(avctx); ^ 2248. else if (avctx->codec->flush) 2249. avctx->codec->flush(avctx); libavcodec/pthread_frame.c:678:5: Assignment 676. fctx->next_decoding = fctx->next_finished = 0; 677. fctx->delaying = 1; 678. fctx->prev_thread = NULL; ^ 679. for (i = 0; i < avctx->thread_count; i++) { 680. PerThreadContext *p = &fctx->threads[i]; avconv.c:2447:13: Call 2445. // flush decoders 2446. if (ist->decoding_needed) { 2447. process_input_packet(ist, NULL, 1); ^ 2448. avcodec_flush_buffers(avctx); 2449. } avconv.c:1373:1: Parameter `ist->decoded_frame->nb_samples` 1371. 1372. /* pkt = NULL means EOF (needed to flush decoder buffers) */ 1373. static void process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof) ^ 1374. { 1375. int i; avconv.c:1404:19: Call 1402. switch (ist->dec_ctx->codec_type) { 1403. case AVMEDIA_TYPE_AUDIO: 1404. ret = decode_audio (ist, repeating ? NULL : &avpkt, &got_output); ^ 1405. break; 1406. case AVMEDIA_TYPE_VIDEO: avconv.c:1164:1: Parameter `ist->decoded_frame->nb_samples` 1162. } 1163. 1164. static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) ^ 1165. { 1166. AVFrame *decoded_frame, *f; avconv.c:1240:19: Call 1238. if (i < ist->nb_filters - 1) { 1239. f = ist->filter_frame; 1240. err = av_frame_ref(f, decoded_frame); ^ 1241. if (err < 0) 1242. break; libavutil/frame.c:199:1: Parameter `src->nb_samples` 197. } 198. 199. int av_frame_ref(AVFrame *dst, const AVFrame *src) ^ 200. { 201. int i, ret = 0; libavutil/frame.c:207:5: Assignment 205. dst->height = src->height; 206. dst->channel_layout = src->channel_layout; 207. dst->nb_samples = src->nb_samples; ^ 208. 209. ret = av_frame_copy_props(dst, src); libavutil/frame.c:215:15: Call 213. /* duplicate the frame data if it's not refcounted */ 214. if (!src->buf[0]) { 215. ret = av_frame_get_buffer(dst, 32); ^ 216. if (ret < 0) 217. return ret; libavutil/frame.c:186:1: Parameter `frame->nb_samples` 184. } 185. 186. int av_frame_get_buffer(AVFrame *frame, int align) ^ 187. { 188. if (frame->format < 0) libavutil/frame.c:194:16: Call 192. return get_video_buffer(frame, align); 193. else if (frame->nb_samples > 0 && frame->channel_layout) 194. return get_audio_buffer(frame, align); ^ 195. 196. return AVERROR(EINVAL); libavutil/frame.c:137:1: Parameter `frame->nb_samples` 135. } 136. 137. static int get_audio_buffer(AVFrame *frame, int align) ^ 138. { 139. int channels = av_get_channel_layout_nb_channels(frame->channel_layout); libavutil/frame.c:145:15: Call 143. 144. if (!frame->linesize[0]) { 145. ret = av_samples_get_buffer_size(&frame->linesize[0], channels, ^ 146. frame->nb_samples, frame->format, 147. align); libavutil/samplefmt.c:108:1: <LHS trace> 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:108:1: Parameter `nb_samples` 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `process_input_packet` 122. return AVERROR(EINVAL); 123. align = 1; 124. nb_samples = FFALIGN(nb_samples, 32); ^ 125. } 126.
https://github.com/libav/libav/blob/ccea588f831906084b8c8235222920e6984beb72/libavutil/samplefmt.c/#L124
d2a_code_trace_data_44413
static int do_decode(AVCodecContext *avctx, AVPacket *pkt) { int got_frame; int ret; av_assert0(!avctx->internal->buffer_frame->buf[0]); if (!pkt) pkt = avctx->internal->buffer_pkt; avctx->refcounted_frames = 1; if (avctx->internal->draining_done) return AVERROR_EOF; if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { ret = avcodec_decode_video2(avctx, avctx->internal->buffer_frame, &got_frame, pkt); if (ret >= 0) ret = pkt->size; } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame, &got_frame, pkt); } else { ret = AVERROR(EINVAL); } if (ret < 0) return ret; if (avctx->internal->draining && !got_frame) avctx->internal->draining_done = 1; if (ret >= pkt->size) { av_packet_unref(avctx->internal->buffer_pkt); } else { int consumed = ret; if (pkt != avctx->internal->buffer_pkt) { av_packet_unref(avctx->internal->buffer_pkt); if ((ret = av_packet_ref(avctx->internal->buffer_pkt, pkt)) < 0) return ret; } avctx->internal->buffer_pkt->data += consumed; avctx->internal->buffer_pkt->size -= consumed; avctx->internal->buffer_pkt->pts = AV_NOPTS_VALUE; avctx->internal->buffer_pkt->dts = AV_NOPTS_VALUE; } if (got_frame) av_assert0(avctx->internal->buffer_frame->buf[0]); return 0; } libavcodec/utils.c:1753: error: Null Dereference pointer `avctx->internal->buffer_pkt->side_data` last assigned on line 1752 could be null and is dereferenced by call to `av_packet_ref()` at line 1753, column 24. libavcodec/utils.c:1708:1: start of procedure do_decode() 1706. } 1707. 1708. static int do_decode(AVCodecContext *avctx, AVPacket *pkt) ^ 1709. { 1710. int got_frame; libavcodec/utils.c:1713:5: Taking false branch 1711. int ret; 1712. 1713. av_assert0(!avctx->internal->buffer_frame->buf[0]); ^ 1714. 1715. if (!pkt) libavcodec/utils.c:1713:5: Loop condition is false. Leaving loop 1711. int ret; 1712. 1713. av_assert0(!avctx->internal->buffer_frame->buf[0]); ^ 1714. 1715. if (!pkt) libavcodec/utils.c:1715:10: Taking false branch 1713. av_assert0(!avctx->internal->buffer_frame->buf[0]); 1714. 1715. if (!pkt) ^ 1716. pkt = avctx->internal->buffer_pkt; 1717. libavcodec/utils.c:1721:5: 1719. // of the legacy API, and users using the new API should not be forced to 1720. // even know about this field. 1721. avctx->refcounted_frames = 1; ^ 1722. 1723. // Some codecs (at least wma lossless) will crash when feeding drain packets libavcodec/utils.c:1725:9: Taking false branch 1723. // Some codecs (at least wma lossless) will crash when feeding drain packets 1724. // after EOF was signaled. 1725. if (avctx->internal->draining_done) ^ 1726. return AVERROR_EOF; 1727. libavcodec/utils.c:1728:9: Taking false branch 1726. return AVERROR_EOF; 1727. 1728. if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { ^ 1729. ret = avcodec_decode_video2(avctx, avctx->internal->buffer_frame, 1730. &got_frame, pkt); libavcodec/utils.c:1733:16: Taking true branch 1731. if (ret >= 0) 1732. ret = pkt->size; 1733. } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { ^ 1734. ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame, 1735. &got_frame, pkt); libavcodec/utils.c:1734:9: Skipping avcodec_decode_audio4(): empty list of specs 1732. ret = pkt->size; 1733. } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { 1734. ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame, ^ 1735. &got_frame, pkt); 1736. } else { libavcodec/utils.c:1740:9: Taking false branch 1738. } 1739. 1740. if (ret < 0) ^ 1741. return ret; 1742. libavcodec/utils.c:1743:9: Taking true branch 1741. return ret; 1742. 1743. if (avctx->internal->draining && !got_frame) ^ 1744. avctx->internal->draining_done = 1; 1745. libavcodec/utils.c:1743:39: Taking false branch 1741. return ret; 1742. 1743. if (avctx->internal->draining && !got_frame) ^ 1744. avctx->internal->draining_done = 1; 1745. libavcodec/utils.c:1746:9: Taking false branch 1744. avctx->internal->draining_done = 1; 1745. 1746. if (ret >= pkt->size) { ^ 1747. av_packet_unref(avctx->internal->buffer_pkt); 1748. } else { libavcodec/utils.c:1749:9: 1747. av_packet_unref(avctx->internal->buffer_pkt); 1748. } else { 1749. int consumed = ret; ^ 1750. 1751. if (pkt != avctx->internal->buffer_pkt) { libavcodec/utils.c:1751:13: Taking true branch 1749. int consumed = ret; 1750. 1751. if (pkt != avctx->internal->buffer_pkt) { ^ 1752. av_packet_unref(avctx->internal->buffer_pkt); 1753. if ((ret = av_packet_ref(avctx->internal->buffer_pkt, pkt)) < 0) libavcodec/utils.c:1752:13: 1750. 1751. if (pkt != avctx->internal->buffer_pkt) { 1752. av_packet_unref(avctx->internal->buffer_pkt); ^ 1753. if ((ret = av_packet_ref(avctx->internal->buffer_pkt, pkt)) < 0) 1754. return ret; libavcodec/avpacket.c:347:1: start of procedure av_packet_unref() 345. } 346. 347. void av_packet_unref(AVPacket *pkt) ^ 348. { 349. av_packet_free_side_data(pkt); libavcodec/avpacket.c:349:5: 347. void av_packet_unref(AVPacket *pkt) 348. { 349. av_packet_free_side_data(pkt); ^ 350. av_buffer_unref(&pkt->buf); 351. av_init_packet(pkt); libavcodec/avpacket.c:215:1: start of procedure av_packet_free_side_data() 213. #endif 214. 215. void av_packet_free_side_data(AVPacket *pkt) ^ 216. { 217. int i; libavcodec/avpacket.c:218:10: 216. { 217. int i; 218. for (i = 0; i < pkt->side_data_elems; i++) ^ 219. av_free(pkt->side_data[i].data); 220. av_freep(&pkt->side_data); libavcodec/avpacket.c:218:17: Loop condition is false. Leaving loop 216. { 217. int i; 218. for (i = 0; i < pkt->side_data_elems; i++) ^ 219. av_free(pkt->side_data[i].data); 220. av_freep(&pkt->side_data); libavcodec/avpacket.c:220:5: Skipping av_freep(): empty list of specs 218. for (i = 0; i < pkt->side_data_elems; i++) 219. av_free(pkt->side_data[i].data); 220. av_freep(&pkt->side_data); ^ 221. pkt->side_data_elems = 0; 222. } libavcodec/avpacket.c:221:5: 219. av_free(pkt->side_data[i].data); 220. av_freep(&pkt->side_data); 221. pkt->side_data_elems = 0; ^ 222. } 223. libavcodec/avpacket.c:222:1: return from a call to av_packet_free_side_data 220. av_freep(&pkt->side_data); 221. pkt->side_data_elems = 0; 222. } ^ 223. 224. #if FF_API_AVPACKET_OLD_API libavcodec/avpacket.c:350:5: 348. { 349. av_packet_free_side_data(pkt); 350. av_buffer_unref(&pkt->buf); ^ 351. av_init_packet(pkt); 352. pkt->data = NULL; libavutil/buffer.c:107:1: start of procedure av_buffer_unref() 105. } 106. 107. void av_buffer_unref(AVBufferRef **buf) ^ 108. { 109. AVBuffer *b; libavutil/buffer.c:111:10: Taking false branch 109. AVBuffer *b; 110. 111. if (!buf || !*buf) ^ 112. return; 113. b = (*buf)->buffer; libavutil/buffer.c:111:18: Taking false branch 109. AVBuffer *b; 110. 111. if (!buf || !*buf) ^ 112. return; 113. b = (*buf)->buffer; libavutil/buffer.c:113:5: 111. if (!buf || !*buf) 112. return; 113. b = (*buf)->buffer; ^ 114. av_freep(buf); 115. libavutil/buffer.c:114:5: Skipping av_freep(): empty list of specs 112. return; 113. b = (*buf)->buffer; 114. av_freep(buf); ^ 115. 116. if (atomic_fetch_add_explicit(&b->refcount, -1, memory_order_acq_rel) == 1) { libavutil/buffer.c:116:9: Taking false branch 114. av_freep(buf); 115. 116. if (atomic_fetch_add_explicit(&b->refcount, -1, memory_order_acq_rel) == 1) { ^ 117. b->free(b->opaque, b->data); 118. av_freep(&b); libavutil/buffer.c:116:5: 114. av_freep(buf); 115. 116. if (atomic_fetch_add_explicit(&b->refcount, -1, memory_order_acq_rel) == 1) { ^ 117. b->free(b->opaque, b->data); 118. av_freep(&b); libavutil/buffer.c:120:1: return from a call to av_buffer_unref 118. av_freep(&b); 119. } 120. } ^ 121. 122. int av_buffer_is_writable(const AVBufferRef *buf) libavcodec/avpacket.c:351:5: 349. av_packet_free_side_data(pkt); 350. av_buffer_unref(&pkt->buf); 351. av_init_packet(pkt); ^ 352. pkt->data = NULL; 353. pkt->size = 0; libavcodec/avpacket.c:31:1: start of procedure av_init_packet() 29. #include "avcodec.h" 30. 31. void av_init_packet(AVPacket *pkt) ^ 32. { 33. pkt->pts = AV_NOPTS_VALUE; libavcodec/avpacket.c:33:5: 31. void av_init_packet(AVPacket *pkt) 32. { 33. pkt->pts = AV_NOPTS_VALUE; ^ 34. pkt->dts = AV_NOPTS_VALUE; 35. pkt->pos = -1; libavcodec/avpacket.c:34:5: 32. { 33. pkt->pts = AV_NOPTS_VALUE; 34. pkt->dts = AV_NOPTS_VALUE; ^ 35. pkt->pos = -1; 36. pkt->duration = 0; libavcodec/avpacket.c:35:5: 33. pkt->pts = AV_NOPTS_VALUE; 34. pkt->dts = AV_NOPTS_VALUE; 35. pkt->pos = -1; ^ 36. pkt->duration = 0; 37. #if FF_API_CONVERGENCE_DURATION libavcodec/avpacket.c:36:5: 34. pkt->dts = AV_NOPTS_VALUE; 35. pkt->pos = -1; 36. pkt->duration = 0; ^ 37. #if FF_API_CONVERGENCE_DURATION 38. FF_DISABLE_DEPRECATION_WARNINGS libavcodec/avpacket.c:39:5: 37. #if FF_API_CONVERGENCE_DURATION 38. FF_DISABLE_DEPRECATION_WARNINGS 39. pkt->convergence_duration = 0; ^ 40. FF_ENABLE_DEPRECATION_WARNINGS 41. #endif libavcodec/avpacket.c:42:5: 40. FF_ENABLE_DEPRECATION_WARNINGS 41. #endif 42. pkt->flags = 0; ^ 43. pkt->stream_index = 0; 44. pkt->buf = NULL; libavcodec/avpacket.c:43:5: 41. #endif 42. pkt->flags = 0; 43. pkt->stream_index = 0; ^ 44. pkt->buf = NULL; 45. pkt->side_data = NULL; libavcodec/avpacket.c:44:5: 42. pkt->flags = 0; 43. pkt->stream_index = 0; 44. pkt->buf = NULL; ^ 45. pkt->side_data = NULL; 46. pkt->side_data_elems = 0; libavcodec/avpacket.c:45:5: 43. pkt->stream_index = 0; 44. pkt->buf = NULL; 45. pkt->side_data = NULL; ^ 46. pkt->side_data_elems = 0; 47. } libavcodec/avpacket.c:46:5: 44. pkt->buf = NULL; 45. pkt->side_data = NULL; 46. pkt->side_data_elems = 0; ^ 47. } 48. libavcodec/avpacket.c:47:1: return from a call to av_init_packet 45. pkt->side_data = NULL; 46. pkt->side_data_elems = 0; 47. } ^ 48. 49. AVPacket *av_packet_alloc(void) libavcodec/avpacket.c:352:5: 350. av_buffer_unref(&pkt->buf); 351. av_init_packet(pkt); 352. pkt->data = NULL; ^ 353. pkt->size = 0; 354. } libavcodec/avpacket.c:353:5: 351. av_init_packet(pkt); 352. pkt->data = NULL; 353. pkt->size = 0; ^ 354. } 355. libavcodec/avpacket.c:354:1: return from a call to av_packet_unref 352. pkt->data = NULL; 353. pkt->size = 0; 354. } ^ 355. 356. int av_packet_ref(AVPacket *dst, const AVPacket *src) libavcodec/utils.c:1753:17: 1751. if (pkt != avctx->internal->buffer_pkt) { 1752. av_packet_unref(avctx->internal->buffer_pkt); 1753. if ((ret = av_packet_ref(avctx->internal->buffer_pkt, pkt)) < 0) ^ 1754. return ret; 1755. } libavcodec/avpacket.c:356:1: start of procedure av_packet_ref() 354. } 355. 356. int av_packet_ref(AVPacket *dst, const AVPacket *src) ^ 357. { 358. int ret; libavcodec/avpacket.c:360:5: 358. int ret; 359. 360. ret = av_packet_copy_props(dst, src); ^ 361. if (ret < 0) 362. return ret; libavcodec/avpacket.c:315:1: start of procedure av_packet_copy_props() 313. } 314. 315. int av_packet_copy_props(AVPacket *dst, const AVPacket *src) ^ 316. { 317. int i; libavcodec/avpacket.c:319:5: 317. int i; 318. 319. dst->pts = src->pts; ^ 320. dst->dts = src->dts; 321. dst->pos = src->pos; libavcodec/avpacket.c:320:5: 318. 319. dst->pts = src->pts; 320. dst->dts = src->dts; ^ 321. dst->pos = src->pos; 322. dst->duration = src->duration; libavcodec/avpacket.c:321:5: 319. dst->pts = src->pts; 320. dst->dts = src->dts; 321. dst->pos = src->pos; ^ 322. dst->duration = src->duration; 323. #if FF_API_CONVERGENCE_DURATION libavcodec/avpacket.c:322:5: 320. dst->dts = src->dts; 321. dst->pos = src->pos; 322. dst->duration = src->duration; ^ 323. #if FF_API_CONVERGENCE_DURATION 324. FF_DISABLE_DEPRECATION_WARNINGS libavcodec/avpacket.c:325:5: 323. #if FF_API_CONVERGENCE_DURATION 324. FF_DISABLE_DEPRECATION_WARNINGS 325. dst->convergence_duration = src->convergence_duration; ^ 326. FF_ENABLE_DEPRECATION_WARNINGS 327. #endif libavcodec/avpacket.c:328:5: 326. FF_ENABLE_DEPRECATION_WARNINGS 327. #endif 328. dst->flags = src->flags; ^ 329. dst->stream_index = src->stream_index; 330. libavcodec/avpacket.c:329:5: 327. #endif 328. dst->flags = src->flags; 329. dst->stream_index = src->stream_index; ^ 330. 331. for (i = 0; i < src->side_data_elems; i++) { libavcodec/avpacket.c:331:10: 329. dst->stream_index = src->stream_index; 330. 331. for (i = 0; i < src->side_data_elems; i++) { ^ 332. enum AVPacketSideDataType type = src->side_data[i].type; 333. int size = src->side_data[i].size; libavcodec/avpacket.c:331:17: Loop condition is true. Entering loop body 329. dst->stream_index = src->stream_index; 330. 331. for (i = 0; i < src->side_data_elems; i++) { ^ 332. enum AVPacketSideDataType type = src->side_data[i].type; 333. int size = src->side_data[i].size; libavcodec/avpacket.c:332:10: 330. 331. for (i = 0; i < src->side_data_elems; i++) { 332. enum AVPacketSideDataType type = src->side_data[i].type; ^ 333. int size = src->side_data[i].size; 334. uint8_t *src_data = src->side_data[i].data; libavcodec/avpacket.c:333:10: 331. for (i = 0; i < src->side_data_elems; i++) { 332. enum AVPacketSideDataType type = src->side_data[i].type; 333. int size = src->side_data[i].size; ^ 334. uint8_t *src_data = src->side_data[i].data; 335. uint8_t *dst_data = av_packet_new_side_data(dst, type, size); libavcodec/avpacket.c:334:10: 332. enum AVPacketSideDataType type = src->side_data[i].type; 333. int size = src->side_data[i].size; 334. uint8_t *src_data = src->side_data[i].data; ^ 335. uint8_t *dst_data = av_packet_new_side_data(dst, type, size); 336. libavcodec/avpacket.c:335:10: 333. int size = src->side_data[i].size; 334. uint8_t *src_data = src->side_data[i].data; 335. uint8_t *dst_data = av_packet_new_side_data(dst, type, size); ^ 336. 337. if (!dst_data) { libavcodec/avpacket.c:263:1: start of procedure av_packet_new_side_data() 261. 262. 263. uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, ^ 264. int size) 265. { libavcodec/avpacket.c:269:10: Taking false branch 267. uint8_t *data; 268. 269. if (!size || (unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) ^ 270. return NULL; 271. data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); libavcodec/avpacket.c:269:18: Taking false branch 267. uint8_t *data; 268. 269. if (!size || (unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) ^ 270. return NULL; 271. data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); libavcodec/avpacket.c:271:5: 269. if (!size || (unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) 270. return NULL; 271. data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); ^ 272. if (!data) 273. return NULL; libavutil/mem.c:62:1: start of procedure av_malloc() 60. * linker will do it automatically. */ 61. 62. void *av_malloc(size_t size) ^ 63. { 64. void *ptr = NULL; libavutil/mem.c:64:5: 62. void *av_malloc(size_t size) 63. { 64. void *ptr = NULL; ^ 65. 66. /* let's disallow possibly ambiguous cases */ libavutil/mem.c:67:9: Taking true branch 65. 66. /* let's disallow possibly ambiguous cases */ 67. if (size > (INT_MAX - 32) || !size) ^ 68. return NULL; 69. libavutil/mem.c:68:9: 66. /* let's disallow possibly ambiguous cases */ 67. if (size > (INT_MAX - 32) || !size) 68. return NULL; ^ 69. 70. #if HAVE_POSIX_MEMALIGN libavutil/mem.c:105:1: return from a call to av_malloc 103. #endif 104. return ptr; 105. } ^ 106. 107. void *av_realloc(void *ptr, size_t size) libavcodec/avpacket.c:272:10: Taking true branch 270. return NULL; 271. data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); 272. if (!data) ^ 273. return NULL; 274. libavcodec/avpacket.c:273:9: 271. data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); 272. if (!data) 273. return NULL; ^ 274. 275. ret = av_packet_add_side_data(pkt, type, data, size); libavcodec/avpacket.c:282:1: return from a call to av_packet_new_side_data 280. 281. return data; 282. } ^ 283. 284. uint8_t *av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, libavcodec/avpacket.c:337:14: Taking true branch 335. uint8_t *dst_data = av_packet_new_side_data(dst, type, size); 336. 337. if (!dst_data) { ^ 338. av_packet_free_side_data(dst); 339. return AVERROR(ENOMEM); libavcodec/avpacket.c:338:13: 336. 337. if (!dst_data) { 338. av_packet_free_side_data(dst); ^ 339. return AVERROR(ENOMEM); 340. } libavcodec/avpacket.c:215:1: start of procedure av_packet_free_side_data() 213. #endif 214. 215. void av_packet_free_side_data(AVPacket *pkt) ^ 216. { 217. int i; libavcodec/avpacket.c:218:10: 216. { 217. int i; 218. for (i = 0; i < pkt->side_data_elems; i++) ^ 219. av_free(pkt->side_data[i].data); 220. av_freep(&pkt->side_data); libavcodec/avpacket.c:218:17: Loop condition is false. Leaving loop 216. { 217. int i; 218. for (i = 0; i < pkt->side_data_elems; i++) ^ 219. av_free(pkt->side_data[i].data); 220. av_freep(&pkt->side_data); libavcodec/avpacket.c:220:5: Skipping av_freep(): empty list of specs 218. for (i = 0; i < pkt->side_data_elems; i++) 219. av_free(pkt->side_data[i].data); 220. av_freep(&pkt->side_data); ^ 221. pkt->side_data_elems = 0; 222. } libavcodec/avpacket.c:221:5: 219. av_free(pkt->side_data[i].data); 220. av_freep(&pkt->side_data); 221. pkt->side_data_elems = 0; ^ 222. } 223. libavcodec/avpacket.c:222:1: return from a call to av_packet_free_side_data 220. av_freep(&pkt->side_data); 221. pkt->side_data_elems = 0; 222. } ^ 223. 224. #if FF_API_AVPACKET_OLD_API libavcodec/avpacket.c:339:13: 337. if (!dst_data) { 338. av_packet_free_side_data(dst); 339. return AVERROR(ENOMEM); ^ 340. } 341. memcpy(dst_data, src_data, size); libavcodec/avpacket.c:345:1: return from a call to av_packet_copy_props 343. 344. return 0; 345. } ^ 346. 347. void av_packet_unref(AVPacket *pkt) libavcodec/avpacket.c:361:9: Taking true branch 359. 360. ret = av_packet_copy_props(dst, src); 361. if (ret < 0) ^ 362. return ret; 363. libavcodec/avpacket.c:362:9: 360. ret = av_packet_copy_props(dst, src); 361. if (ret < 0) 362. return ret; ^ 363. 364. if (!src->buf) { libavcodec/avpacket.c:386:1: return from a call to av_packet_ref 384. av_packet_free_side_data(dst); 385. return ret; 386. } ^ 387. 388. AVPacket *av_packet_clone(const AVPacket *src)
https://github.com/libav/libav/blob/d0c84c41d33ffd270d5f9fe0290e08341397fdee/libavcodec/utils.c/#L1753
d2a_code_trace_data_44414
int test_mod_exp(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; int i; a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); BN_one(a); BN_one(b); BN_zero(c); if (BN_mod_exp(d, a, b, c, ctx)) { fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); return 0; } BN_bntest_rand(c, 30, 0, 1); 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_mod_exp(d, a, b, c, ctx)) return (0); 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, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); } BN_exp(e, a, b, ctx); BN_sub(e, e, d); BN_div(a, b, e, c, ctx); if (!BN_is_zero(b)) { fprintf(stderr, "Modulo exponentiation test failed!\n"); return 0; } } BN_hex2bn(&a, "050505050505"); BN_hex2bn(&b, "02"); BN_hex2bn(&c, "4141414141414141414141274141414141414141414141414141414141414141" "4141414141414141414141414141414141414141414141414141414141414141" "4141414141414141414141800000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000001"); BN_mod_exp(d, a, b, c, ctx); BN_mul(e, a, a, ctx); if (BN_cmp(d, e)) { fprintf(stderr, "BN_mod_exp and BN_mul produce different results!\n"); return 0; } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); return (1); } test/bntest.c:1050: error: MEMORY_LEAK memory dynamically allocated to `a` by call to `BN_new()` at line 984, column 9 is not reachable after line 1050, column 1. Showing all 145 steps of the trace test/bntest.c:979:1: start of procedure test_mod_exp() 977. } 978. 979. > int test_mod_exp(BIO *bp, BN_CTX *ctx) 980. { 981. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:984:5: 982. int i; 983. 984. > a = BN_new(); 985. b = BN_new(); 986. 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:985:5: 983. 984. a = BN_new(); 985. > b = BN_new(); 986. c = BN_new(); 987. 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:986:5: 984. a = BN_new(); 985. b = BN_new(); 986. > c = BN_new(); 987. d = BN_new(); 988. 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:987:5: 985. b = BN_new(); 986. c = BN_new(); 987. > d = BN_new(); 988. e = BN_new(); 989. 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:988:5: 986. c = BN_new(); 987. d = BN_new(); 988. > e = BN_new(); 989. 990. BN_one(a); 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:990:5: 988. e = BN_new(); 989. 990. > BN_one(a); 991. BN_one(b); 992. BN_zero(c); 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:991:5: 989. 990. BN_one(a); 991. > BN_one(b); 992. BN_zero(c); 993. if (BN_mod_exp(d, a, b, c, ctx)) { 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:992:5: 990. BN_one(a); 991. BN_one(b); 992. > BN_zero(c); 993. if (BN_mod_exp(d, a, b, c, ctx)) { 994. fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); 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) test/bntest.c:993:9: Taking true branch 991. BN_one(b); 992. BN_zero(c); 993. if (BN_mod_exp(d, a, b, c, ctx)) { ^ 994. fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); 995. return 0; test/bntest.c:994:9: 992. BN_zero(c); 993. if (BN_mod_exp(d, a, b, c, ctx)) { 994. > fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); 995. return 0; 996. } test/bntest.c:995:9: 993. if (BN_mod_exp(d, a, b, c, ctx)) { 994. fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); 995. > return 0; 996. } 997. test/bntest.c:1050:1: return from a call to test_mod_exp 1048. BN_free(e); 1049. return (1); 1050. > } 1051. 1052. int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L1050
d2a_code_trace_data_44415
void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift) { *h_shift = pix_fmt_info[pix_fmt].x_chroma_shift; *v_shift = pix_fmt_info[pix_fmt].y_chroma_shift; } libavcodec/h261dec.c:564: error: Buffer Overrun L2 Offset: [0, 1001] Size: 40 by call to `MPV_common_init`. libavcodec/h261dec.c:574:11: Call 572. } 573. 574. ret = h261_decode_picture_header(h); ^ 575. 576. /* skip if the header was thrashed */ libavcodec/h261dec.c:462:38: Assignment 460. s->picture_number = (s->picture_number&~31) + i; 461. 462. s->avctx->time_base= (AVRational){1001, 30000}; ^ 463. s->current_picture.pts= s->picture_number; 464. libavcodec/h261dec.c:564:13: Call 562. 563. if(!s->context_initialized){ 564. if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix ^ 565. return -1; 566. } libavcodec/mpegvideo.c:399:1: Parameter `s->avctx->pix_fmt` 397. * this assumes that some variables like width/height are already set 398. */ 399. int MPV_common_init(MpegEncContext *s) ^ 400. { 401. int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y, threads; libavcodec/mpegvideo.c:427:5: Call 425. 426. /* set chroma shifts */ 427. avcodec_get_chroma_sub_sample(s->avctx->pix_fmt,&(s->chroma_x_shift), ^ 428. &(s->chroma_y_shift) ); 429. libavcodec/imgconvert.c:384:1: <Offset trace> 382. }; 383. 384. void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift) ^ 385. { 386. *h_shift = pix_fmt_info[pix_fmt].x_chroma_shift; libavcodec/imgconvert.c:384:1: Parameter `pix_fmt` 382. }; 383. 384. void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift) ^ 385. { 386. *h_shift = pix_fmt_info[pix_fmt].x_chroma_shift; libavcodec/imgconvert.c:65:1: <Length trace> 63. 64. /* this table gives more information about formats */ 65. static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { ^ 66. /* YUV formats */ 67. [PIX_FMT_YUV420P] = { libavcodec/imgconvert.c:65:1: Array declaration 63. 64. /* this table gives more information about formats */ 65. static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { ^ 66. /* YUV formats */ 67. [PIX_FMT_YUV420P] = { libavcodec/imgconvert.c:386:16: Array access: Offset: [0, 1001] Size: 40 by call to `MPV_common_init` 384. void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift) 385. { 386. *h_shift = pix_fmt_info[pix_fmt].x_chroma_shift; ^ 387. *v_shift = pix_fmt_info[pix_fmt].y_chroma_shift; 388. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/imgconvert.c/#L386
d2a_code_trace_data_44416
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/x509_cmp.c:90: 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/x509_cmp.c:90:9: Call 88. if (ctx == NULL) 89. goto err; 90. f = X509_NAME_oneline(a->cert_info.issuer, NULL, 0); ^ 91. if (!EVP_DigestInit_ex(ctx, EVP_md5(), NULL)) 92. goto err; 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_44417
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:977: error: Uninitialized Value The value read from l7 was never initialized. libavcodec/h264pred.c:977:41: 975. SRC(3,7)=SRC(4,5)=SRC(4,6)=SRC(4,7)=SRC(5,5)= 976. SRC(5,6)=SRC(5,7)=SRC(6,4)=SRC(6,5)=SRC(6,6)= 977. SRC(6,7)=SRC(7,4)=SRC(7,5)=SRC(7,6)=SRC(7,7)= l7; ^ 978. } 979. #undef PREDICT_8x8_LOAD_LEFT
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264pred.c/#L977
d2a_code_trace_data_44418
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_chk.c:98: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 25 steps of the trace crypto/rsa/rsa_chk.c:54:9: Call 52. 53. /* p prime? */ 54. if (BN_is_prime_ex(key->p, BN_prime_checks, NULL, cb) != 1) { ^ 55. ret = 0; 56. RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_P_NOT_PRIME); crypto/bn/bn_prime.c:194:1: Parameter `ctx_passed->stack.depth` 192. } 193. 194. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 195. BN_GENCB *cb) 196. { crypto/bn/bn_prime.c:197:12: Call 195. BN_GENCB *cb) 196. { 197. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); ^ 198. } 199. crypto/bn/bn_prime.c:200:1: Parameter `ctx_passed->stack.depth` 198. } 199. 200. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 201. int do_trial_division, BN_GENCB *cb) 202. { 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:194:1: Parameter `ctx_passed->stack.depth` 192. } 193. 194. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 195. BN_GENCB *cb) 196. { crypto/bn/bn_prime.c:197:12: Call 195. BN_GENCB *cb) 196. { 197. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); ^ 198. } 199. crypto/bn/bn_prime.c:200:1: Parameter `ctx_passed->stack.depth` 198. } 199. 200. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 201. int do_trial_division, BN_GENCB *cb) 202. { 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:829:1: Parameter `ctx->stack.depth` 827. #endif /* BN_RECURSION */ 828. 829. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 830. { 831. int ret = 0; crypto/rsa/rsa_chk.c:98:10: Call 96. goto err; 97. } 98. if (!BN_mod_mul(i, key->d, key->e, k, ctx)) { ^ 99. ret = -1; 100. goto err; crypto/bn/bn_mod.c:73:1: Parameter `ctx->stack.depth` 71. 72. /* slow but works */ 73. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 74. BN_CTX *ctx) 75. { crypto/bn/bn_mod.c:83:5: Call 81. bn_check_top(m); 82. 83. BN_CTX_start(ctx); ^ 84. if ((t = BN_CTX_get(ctx)) == NULL) 85. goto err; 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_mod.c:90:14: Call 88. goto err; 89. } else { 90. if (!BN_mul(t, a, b, ctx)) ^ 91. goto err; 92. } crypto/bn/bn_mul.c:855:5: Call 853. top = al + bl; 854. 855. BN_CTX_start(ctx); ^ 856. if ((r == a) || (r == b)) { 857. if ((rr = BN_CTX_get(ctx)) == NULL) crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mul.c:979:5: Call 977. err: 978. bn_check_top(r); 979. BN_CTX_end(ctx); ^ 980. return (ret); 981. } crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 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: <Offset 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:271:1: <Length 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->indexes` 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: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 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/2f3930bc0edbfdc7718f709b856fa53f0ec57cde/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_44419
static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple){ MpegEncContext * const s = &h->s; const int mb_x= s->mb_x; const int mb_y= s->mb_y; const int mb_xy= mb_x + mb_y*s->mb_stride; const int mb_type= s->current_picture.mb_type[mb_xy]; uint8_t *dest_y, *dest_cb, *dest_cr; int linesize, uvlinesize ; int i; int *block_offset = &h->block_offset[0]; const unsigned int bottom = mb_y & 1; const int transform_bypass = (s->qscale == 0 && h->sps.transform_bypass), is_h264 = (simple || s->codec_id == CODEC_ID_H264); void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride); void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride); dest_y = s->current_picture.data[0] + (mb_y * 16* s->linesize ) + mb_x * 16; dest_cb = s->current_picture.data[1] + (mb_y * 8 * s->uvlinesize) + mb_x * 8; dest_cr = s->current_picture.data[2] + (mb_y * 8 * s->uvlinesize) + mb_x * 8; s->dsp.prefetch(dest_y + (s->mb_x&3)*4*s->linesize + 64, s->linesize, 4); s->dsp.prefetch(dest_cb + (s->mb_x&7)*s->uvlinesize + 64, dest_cr - dest_cb, 2); if (!simple && MB_FIELD) { linesize = h->mb_linesize = s->linesize * 2; uvlinesize = h->mb_uvlinesize = s->uvlinesize * 2; block_offset = &h->block_offset[24]; if(mb_y&1){ dest_y -= s->linesize*15; dest_cb-= s->uvlinesize*7; dest_cr-= s->uvlinesize*7; } if(FRAME_MBAFF) { int list; for(list=0; list<h->list_count; list++){ if(!USES_LIST(mb_type, list)) continue; if(IS_16X16(mb_type)){ int8_t *ref = &h->ref_cache[list][scan8[0]]; fill_rectangle(ref, 4, 4, 8, (16+*ref)^(s->mb_y&1), 1); }else{ for(i=0; i<16; i+=4){ int ref = h->ref_cache[list][scan8[i]]; if(ref >= 0) fill_rectangle(&h->ref_cache[list][scan8[i]], 2, 2, 8, (16+ref)^(s->mb_y&1), 1); } } } } } else { linesize = h->mb_linesize = s->linesize; uvlinesize = h->mb_uvlinesize = s->uvlinesize; } if(transform_bypass){ idct_dc_add = idct_add = IS_8x8DCT(mb_type) ? s->dsp.add_pixels8 : s->dsp.add_pixels4; }else if(IS_8x8DCT(mb_type)){ idct_dc_add = s->dsp.h264_idct8_dc_add; idct_add = s->dsp.h264_idct8_add; }else{ idct_dc_add = s->dsp.h264_idct_dc_add; idct_add = s->dsp.h264_idct_add; } if(!simple && FRAME_MBAFF && h->deblocking_filter && IS_INTRA(mb_type) && (!bottom || !IS_INTRA(s->current_picture.mb_type[mb_xy-s->mb_stride]))){ int mbt_y = mb_y&~1; uint8_t *top_y = s->current_picture.data[0] + (mbt_y * 16* s->linesize ) + mb_x * 16; uint8_t *top_cb = s->current_picture.data[1] + (mbt_y * 8 * s->uvlinesize) + mb_x * 8; uint8_t *top_cr = s->current_picture.data[2] + (mbt_y * 8 * s->uvlinesize) + mb_x * 8; xchg_pair_border(h, top_y, top_cb, top_cr, s->linesize, s->uvlinesize, 1); } if (!simple && IS_INTRA_PCM(mb_type)) { unsigned int x, y; for(i=0; i<16; i++) { for (y=0; y<4; y++) { for (x=0; x<4; x++) { *(dest_y + block_offset[i] + y*linesize + x) = h->mb[i*16+y*4+x]; } } } for(i=16; i<16+4; i++) { for (y=0; y<4; y++) { for (x=0; x<4; x++) { *(dest_cb + block_offset[i] + y*uvlinesize + x) = h->mb[i*16+y*4+x]; } } } for(i=20; i<20+4; i++) { for (y=0; y<4; y++) { for (x=0; x<4; x++) { *(dest_cr + block_offset[i] + y*uvlinesize + x) = h->mb[i*16+y*4+x]; } } } } else { if(IS_INTRA(mb_type)){ if(h->deblocking_filter && (simple || !FRAME_MBAFF)) xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 1, simple); if(simple || !ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){ h->hpc.pred8x8[ h->chroma_pred_mode ](dest_cb, uvlinesize); h->hpc.pred8x8[ h->chroma_pred_mode ](dest_cr, uvlinesize); } if(IS_INTRA4x4(mb_type)){ if(simple || !s->encoding){ if(IS_8x8DCT(mb_type)){ for(i=0; i<16; i+=4){ uint8_t * const ptr= dest_y + block_offset[i]; const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ]; const int nnz = h->non_zero_count_cache[ scan8[i] ]; h->hpc.pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000, (h->topright_samples_available<<i)&0x4000, linesize); if(nnz){ if(nnz == 1 && h->mb[i*16]) idct_dc_add(ptr, h->mb + i*16, linesize); else idct_add(ptr, h->mb + i*16, linesize); } } }else for(i=0; i<16; i++){ uint8_t * const ptr= dest_y + block_offset[i]; uint8_t *topright; const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ]; int nnz, tr; if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){ const int topright_avail= (h->topright_samples_available<<i)&0x8000; assert(mb_y || linesize <= block_offset[i]); if(!topright_avail){ tr= ptr[3 - linesize]*0x01010101; topright= (uint8_t*) &tr; }else topright= ptr + 4 - linesize; }else topright= NULL; h->hpc.pred4x4[ dir ](ptr, topright, linesize); nnz = h->non_zero_count_cache[ scan8[i] ]; if(nnz){ if(is_h264){ if(nnz == 1 && h->mb[i*16]) idct_dc_add(ptr, h->mb + i*16, linesize); else idct_add(ptr, h->mb + i*16, linesize); }else svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0); } } } }else{ h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize); if(is_h264){ if(!transform_bypass) h264_luma_dc_dequant_idct_c(h->mb, s->qscale, h->dequant4_coeff[0][s->qscale][0]); }else svq3_luma_dc_dequant_idct_c(h->mb, s->qscale); } if(h->deblocking_filter && (simple || !FRAME_MBAFF)) xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 0, simple); }else if(is_h264){ hl_motion(h, dest_y, dest_cb, dest_cr, s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab, s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab, s->dsp.weight_h264_pixels_tab, s->dsp.biweight_h264_pixels_tab); } if(!IS_INTRA4x4(mb_type)){ if(is_h264){ if(IS_INTRA16x16(mb_type)){ for(i=0; i<16; i++){ if(h->non_zero_count_cache[ scan8[i] ]) idct_add(dest_y + block_offset[i], h->mb + i*16, linesize); else if(h->mb[i*16]) idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize); } }else{ const int di = IS_8x8DCT(mb_type) ? 4 : 1; for(i=0; i<16; i+=di){ int nnz = h->non_zero_count_cache[ scan8[i] ]; if(nnz){ if(nnz==1 && h->mb[i*16]) idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize); else idct_add(dest_y + block_offset[i], h->mb + i*16, linesize); } } } }else{ for(i=0; i<16; i++){ if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ uint8_t * const ptr= dest_y + block_offset[i]; svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, IS_INTRA(mb_type) ? 1 : 0); } } } } if(simple || !ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){ uint8_t *dest[2] = {dest_cb, dest_cr}; if(transform_bypass){ idct_add = idct_dc_add = s->dsp.add_pixels4; }else{ idct_add = s->dsp.h264_idct_add; idct_dc_add = s->dsp.h264_idct_dc_add; chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp[0], h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]); chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp[1], h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]); } if(is_h264){ for(i=16; i<16+8; i++){ if(h->non_zero_count_cache[ scan8[i] ]) idct_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize); else if(h->mb[i*16]) idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize); } }else{ for(i=16; i<16+8; i++){ if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i]; svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2); } } } } } if(h->deblocking_filter) { if (!simple && FRAME_MBAFF) { const int mb_y = s->mb_y - 1; uint8_t *pair_dest_y, *pair_dest_cb, *pair_dest_cr; const int mb_xy= mb_x + mb_y*s->mb_stride; const int mb_type_top = s->current_picture.mb_type[mb_xy]; const int mb_type_bottom= s->current_picture.mb_type[mb_xy+s->mb_stride]; if (!bottom) return; pair_dest_y = s->current_picture.data[0] + (mb_y * 16* s->linesize ) + mb_x * 16; pair_dest_cb = s->current_picture.data[1] + (mb_y * 8 * s->uvlinesize) + mb_x * 8; pair_dest_cr = s->current_picture.data[2] + (mb_y * 8 * s->uvlinesize) + mb_x * 8; if(IS_INTRA(mb_type_top | mb_type_bottom)) xchg_pair_border(h, pair_dest_y, pair_dest_cb, pair_dest_cr, s->linesize, s->uvlinesize, 0); backup_pair_border(h, pair_dest_y, pair_dest_cb, pair_dest_cr, s->linesize, s->uvlinesize); s->mb_y--; tprintf(h->s.avctx, "call mbaff filter_mb mb_x:%d mb_y:%d pair_dest_y = %p, dest_y = %p\n", mb_x, mb_y, pair_dest_y, dest_y); fill_caches(h, mb_type_top, 1); h->chroma_qp[0] = get_chroma_qp(h, 0, s->current_picture.qscale_table[mb_xy]); h->chroma_qp[1] = get_chroma_qp(h, 1, s->current_picture.qscale_table[mb_xy]); filter_mb(h, mb_x, mb_y, pair_dest_y, pair_dest_cb, pair_dest_cr, linesize, uvlinesize); s->mb_y++; tprintf(h->s.avctx, "call mbaff filter_mb\n"); fill_caches(h, mb_type_bottom, 1); h->chroma_qp[0] = get_chroma_qp(h, 0, s->current_picture.qscale_table[mb_xy+s->mb_stride]); h->chroma_qp[1] = get_chroma_qp(h, 1, s->current_picture.qscale_table[mb_xy+s->mb_stride]); filter_mb(h, mb_x, mb_y+1, dest_y, dest_cb, dest_cr, linesize, uvlinesize); } else { tprintf(h->s.avctx, "call filter_mb\n"); backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, simple); fill_caches(h, mb_type, 1); filter_mb_fast(h, mb_x, mb_y, dest_y, dest_cb, dest_cr, linesize, uvlinesize); } } } libavcodec/h264.c:6784: error: Buffer Overrun L2 Offset: [-oo, 12+max(51, `h->s.qscale`)] Size: 52 by call to `hl_decode_mb`. libavcodec/h264.c:6747:1: Parameter `h->s.qscale` 6745. } 6746. 6747. static int decode_slice(struct AVCodecContext *avctx, H264Context *h){ ^ 6748. MpegEncContext * const s = &h->s; 6749. const int part_mask= s->partitioned_frame ? (AC_END|AC_ERROR) : 0x7F; libavcodec/h264.c:6780:23: Call 6778. for(;;){ 6779. //START_TIMER 6780. int ret = decode_mb_cabac(h); ^ 6781. int eos; 6782. //STOP_TIMER("decode_mb_cabac") libavcodec/h264.c:5577:1: Parameter `h->s.qscale` 5575. * @returns 0 if ok, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed 5576. */ 5577. static int decode_mb_cabac(H264Context *h) { ^ 5578. MpegEncContext * const s = &h->s; 5579. const int mb_xy= s->mb_x + s->mb_y*s->mb_stride; libavcodec/h264.c:6784:24: Call 6782. //STOP_TIMER("decode_mb_cabac") 6783. 6784. if(ret>=0) hl_decode_mb(h); ^ 6785. 6786. if( ret >= 0 && FRAME_MBAFF ) { //FIXME optimal? or let mb_decode decode 16x32 ? libavcodec/h264.c:2724:1: Parameter `h->s.qscale` 2722. } 2723. 2724. static void hl_decode_mb(H264Context *h){ ^ 2725. MpegEncContext * const s = &h->s; 2726. const int mb_x= s->mb_x; libavcodec/h264.c:2736:9: Call 2734. 2735. if (is_complex) 2736. hl_decode_mb_complex(h); ^ 2737. else hl_decode_mb_simple(h); 2738. } libavcodec/h264.c:2720:1: Parameter `h->s.qscale` 2718. * Process a macroblock; this handles edge cases, such as interlacing. 2719. */ 2720. static void av_noinline hl_decode_mb_complex(H264Context *h){ ^ 2721. hl_decode_mb_internal(h, 0); 2722. } libavcodec/h264.c:2721:5: Call 2719. */ 2720. static void av_noinline hl_decode_mb_complex(H264Context *h){ 2721. hl_decode_mb_internal(h, 0); ^ 2722. } 2723. libavcodec/h264.c:2434:1: <Offset trace> 2432. } 2433. 2434. static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple){ ^ 2435. MpegEncContext * const s = &h->s; 2436. const int mb_x= s->mb_x; libavcodec/h264.c:2434:1: Parameter `h->s.qscale` 2432. } 2433. 2434. static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple){ ^ 2435. MpegEncContext * const s = &h->s; 2436. const int mb_x= s->mb_x; libavcodec/h264data.h:83:1: <Length trace> 81. {-1, 2, 0, 1, -1, 4, 3}; 82. 83. static const uint8_t chroma_qp[52]={ ^ 84. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11, 85. 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27, libavcodec/h264data.h:83:1: Array declaration 81. {-1, 2, 0, 1, -1, 4, 3}; 82. 83. static const uint8_t chroma_qp[52]={ ^ 84. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11, 85. 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27, libavcodec/h264.c:2662:72: Array access: Offset: [-oo, 12+max(51, h->s.qscale)] Size: 52 by call to `hl_decode_mb` 2660. if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ 2661. uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i]; 2662. svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2); ^ 2663. } 2664. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L2662
d2a_code_trace_data_44420
static int check_name_constraints(X509_STORE_CTX *ctx) { X509 *x; int i, j, rv; for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { x = sk_X509_value(ctx->chain, i); if (i && (x->ex_flags & EXFLAG_SI)) continue; for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; if (nc) { rv = NAME_CONSTRAINTS_check(x, nc); if (rv != X509_V_OK) { ctx->error = rv; ctx->error_depth = i; ctx->current_cert = x; if (!ctx->verify_cb(0, ctx)) return 0; } } } } return 1; } crypto/x509/x509_vfy.c:491: error: NULL_DEREFERENCE pointer `x` last assigned on line 489 could be null and is dereferenced at line 491, column 19. Showing all 66 steps of the trace crypto/x509/x509_vfy.c:483:1: start of procedure check_name_constraints() 481. } 482. 483. > static int check_name_constraints(X509_STORE_CTX *ctx) 484. { 485. X509 *x; crypto/x509/x509_vfy.c:488:14: Condition is true 486. int i, j, rv; 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { ^ 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ crypto/x509/x509_vfy.c:488:10: 486. int i, j, rv; 487. /* Check name constraints for all certificates */ 488. > for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ crypto/stack/stack.c:317:1: start of procedure sk_num() 315. } 316. 317. > int sk_num(const _STACK *st) 318. { 319. if (st == NULL) crypto/stack/stack.c:319:9: Taking false branch 317. int sk_num(const _STACK *st) 318. { 319. if (st == NULL) ^ 320. return -1; 321. return st->num; crypto/stack/stack.c:321:5: 319. if (st == NULL) 320. return -1; 321. > return st->num; 322. } 323. crypto/stack/stack.c:322:1: return from a call to sk_num 320. return -1; 321. return st->num; 322. > } 323. 324. void *sk_value(const _STACK *st, int i) crypto/x509/x509_vfy.c:488:43: Loop condition is true. Entering loop body 486. int i, j, rv; 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { ^ 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ crypto/x509/x509_vfy.c:489:13: Condition is true 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. x = sk_X509_value(ctx->chain, i); ^ 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) crypto/x509/x509_vfy.c:489:9: 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. > x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:17: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:28: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:328:5: 326. if (!st || (i < 0) || (i >= st->num)) 327. return NULL; 328. > return st->data[i]; 329. } 330. crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:491:13: Taking true branch 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) ^ 492. continue; 493. /* crypto/x509/x509_vfy.c:491:19: Taking true branch 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) ^ 492. continue; 493. /* crypto/x509/x509_vfy.c:488:51: 486. int i, j, rv; 487. /* Check name constraints for all certificates */ 488. > for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ crypto/x509/x509_vfy.c:488:43: Loop condition is true. Entering loop body 486. int i, j, rv; 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { ^ 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ crypto/x509/x509_vfy.c:489:13: Condition is true 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. x = sk_X509_value(ctx->chain, i); ^ 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) crypto/x509/x509_vfy.c:489:9: 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. > x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:17: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:28: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:328:5: 326. if (!st || (i < 0) || (i >= st->num)) 327. return NULL; 328. > return st->data[i]; 329. } 330. crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:491:13: Taking true branch 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) ^ 492. continue; 493. /* crypto/x509/x509_vfy.c:491:19: Taking false branch 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) ^ 492. continue; 493. /* crypto/x509/x509_vfy.c:499:18: Condition is true 497. * to be obeyed. 498. */ 499. for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { ^ 500. NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; 501. if (nc) { crypto/x509/x509_vfy.c:499:14: 497. * to be obeyed. 498. */ 499. > for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { 500. NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; 501. if (nc) { crypto/stack/stack.c:317:1: start of procedure sk_num() 315. } 316. 317. > int sk_num(const _STACK *st) 318. { 319. if (st == NULL) crypto/stack/stack.c:319:9: Taking false branch 317. int sk_num(const _STACK *st) 318. { 319. if (st == NULL) ^ 320. return -1; 321. return st->num; crypto/stack/stack.c:321:5: 319. if (st == NULL) 320. return -1; 321. > return st->num; 322. } 323. crypto/stack/stack.c:322:1: return from a call to sk_num 320. return -1; 321. return st->num; 322. > } 323. 324. void *sk_value(const _STACK *st, int i) crypto/x509/x509_vfy.c:499:47: Loop condition is true. Entering loop body 497. * to be obeyed. 498. */ 499. for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { ^ 500. NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; 501. if (nc) { crypto/x509/x509_vfy.c:500:36: Condition is true 498. */ 499. for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { 500. NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; ^ 501. if (nc) { 502. rv = NAME_CONSTRAINTS_check(x, nc); crypto/x509/x509_vfy.c:500:13: 498. */ 499. for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { 500. > NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; 501. if (nc) { 502. rv = NAME_CONSTRAINTS_check(x, nc); crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:17: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:28: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:328:5: 326. if (!st || (i < 0) || (i >= st->num)) 327. return NULL; 328. > return st->data[i]; 329. } 330. crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:501:17: Taking true branch 499. for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { 500. NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; 501. if (nc) { ^ 502. rv = NAME_CONSTRAINTS_check(x, nc); 503. if (rv != X509_V_OK) { crypto/x509/x509_vfy.c:502:17: Skipping NAME_CONSTRAINTS_check(): empty list of specs 500. NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; 501. if (nc) { 502. rv = NAME_CONSTRAINTS_check(x, nc); ^ 503. if (rv != X509_V_OK) { 504. ctx->error = rv; crypto/x509/x509_vfy.c:503:21: Taking true branch 501. if (nc) { 502. rv = NAME_CONSTRAINTS_check(x, nc); 503. if (rv != X509_V_OK) { ^ 504. ctx->error = rv; 505. ctx->error_depth = i; crypto/x509/x509_vfy.c:504:21: 502. rv = NAME_CONSTRAINTS_check(x, nc); 503. if (rv != X509_V_OK) { 504. > ctx->error = rv; 505. ctx->error_depth = i; 506. ctx->current_cert = x; crypto/x509/x509_vfy.c:505:21: 503. if (rv != X509_V_OK) { 504. ctx->error = rv; 505. > ctx->error_depth = i; 506. ctx->current_cert = x; 507. if (!ctx->verify_cb(0, ctx)) crypto/x509/x509_vfy.c:506:21: 504. ctx->error = rv; 505. ctx->error_depth = i; 506. > ctx->current_cert = x; 507. if (!ctx->verify_cb(0, ctx)) 508. return 0; crypto/x509/x509_vfy.c:507:26: Taking false branch 505. ctx->error_depth = i; 506. ctx->current_cert = x; 507. if (!ctx->verify_cb(0, ctx)) ^ 508. return 0; 509. } crypto/x509/x509_vfy.c:499:54: 497. * to be obeyed. 498. */ 499. > for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { 500. NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; 501. if (nc) { crypto/x509/x509_vfy.c:499:47: Loop condition is false. Leaving loop 497. * to be obeyed. 498. */ 499. for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { ^ 500. NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; 501. if (nc) { crypto/x509/x509_vfy.c:488:51: 486. int i, j, rv; 487. /* Check name constraints for all certificates */ 488. > for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ crypto/x509/x509_vfy.c:488:43: Loop condition is true. Entering loop body 486. int i, j, rv; 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { ^ 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ crypto/x509/x509_vfy.c:489:13: Condition is true 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. x = sk_X509_value(ctx->chain, i); ^ 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) crypto/x509/x509_vfy.c:489:9: 487. /* Check name constraints for all certificates */ 488. for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { 489. > x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:17: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:28: Taking true branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:327:9: 325. { 326. if (!st || (i < 0) || (i >= st->num)) 327. > return NULL; 328. return st->data[i]; 329. } crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:491:13: Taking true branch 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. if (i && (x->ex_flags & EXFLAG_SI)) ^ 492. continue; 493. /* crypto/x509/x509_vfy.c:491:19: 489. x = sk_X509_value(ctx->chain, i); 490. /* Ignore self issued certs unless last in chain */ 491. > if (i && (x->ex_flags & EXFLAG_SI)) 492. continue; 493. /*
https://github.com/openssl/openssl/blob/e29c73c93b88a4b7f492c7c8c7343223e7548612/crypto/x509/x509_vfy.c/#L491
d2a_code_trace_data_44421
int BN_set_bit(BIGNUM *a, int n) { int i, j, k; if (n < 0) return 0; i = n / BN_BITS2; j = n % BN_BITS2; if (a->top <= i) { if (bn_wexpand(a, i + 1) == NULL) return 0; for (k = a->top; k < i + 1; k++) a->d[k] = 0; a->top = i + 1; a->flags &= ~BN_FLG_FIXED_TOP; } a->d[i] |= (((BN_ULONG)1) << j); bn_check_top(a); return 1; } test/ectest.c:1825: error: INTEGER_OVERFLOW_L2 ([-oo, 9223372036854775807] + 1):signed32 by call to `EC_GROUP_new_from_ecparameters`. Showing all 6 steps of the trace test/ectest.c:1825:13: Call 1823. if (!TEST_ptr(group = EC_GROUP_new_by_curve_name(NID_secp224r1)) 1824. || !TEST_ptr(ecparameters = EC_GROUP_get_ecparameters(group, NULL)) 1825. || !TEST_ptr(group2 = EC_GROUP_new_from_ecparameters(ecparameters)) ^ 1826. || !TEST_int_eq(EC_GROUP_cmp(group, group2, NULL), 0)) 1827. goto err; crypto/ec/ec_asn1.c:568:1: Parameter `params->fieldID->p.char_two->m` 566. } 567. 568. > EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params) 569. { 570. int ok = 0, tmp; crypto/ec/ec_asn1.c:652:18: Call 650. if (!BN_set_bit(p, (int)char_two->m)) 651. goto err; 652. if (!BN_set_bit(p, (int)tmp_long)) ^ 653. goto err; 654. if (!BN_set_bit(p, 0)) crypto/bn/bn_lib.c:628:1: <LHS trace> 626. } 627. 628. > int BN_set_bit(BIGNUM *a, int n) 629. { 630. int i, j, k; crypto/bn/bn_lib.c:628:1: Parameter `a->top` 626. } 627. 628. > int BN_set_bit(BIGNUM *a, int n) 629. { 630. int i, j, k; crypto/bn/bn_lib.c:640:37: Binary operation: ([-oo, 9223372036854775807] + 1):signed32 by call to `EC_GROUP_new_from_ecparameters` 638. if (bn_wexpand(a, i + 1) == NULL) 639. return 0; 640. for (k = a->top; k < i + 1; k++) ^ 641. a->d[k] = 0; 642. a->top = i + 1;
https://github.com/openssl/openssl/blob/b11327929294cf825e4759d97af6f174bd6b081c/crypto/bn/bn_lib.c/#L640
d2a_code_trace_data_44422
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:2107: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`. Showing all 39 steps of the trace test/bntest.c:2107:14: Call 2105. /* Calculate r = 1 ^ 0 mod 1, and check the result is always 0 */ 2106. for (i = 0; i < 2; i++) { 2107. if (!TEST_true(BN_mod_exp(r, a, p, m, NULL)) ^ 2108. || !TEST_BN_eq_zero(r) 2109. || !TEST_true(BN_mod_exp_mont(r, a, p, m, NULL, NULL)) crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth` 87. } 88. 89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 90. BN_CTX *ctx) 91. { crypto/bn/bn_exp.c:141:19: Call 139. && (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) { 140. BN_ULONG A = a->d[0]; 141. ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL); ^ 142. } else 143. # endif crypto/bn/bn_exp.c:1129:1: Parameter `ctx->stack.depth` 1127. } 1128. 1129. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, 1130. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 1131. { test/bntest.c:2109:21: Call 2107. if (!TEST_true(BN_mod_exp(r, a, p, m, NULL)) 2108. || !TEST_BN_eq_zero(r) 2109. || !TEST_true(BN_mod_exp_mont(r, a, p, m, NULL, NULL)) ^ 2110. || !TEST_BN_eq_zero(r) 2111. || !TEST_true(BN_mod_exp_mont_consttime(r, a, p, m, NULL, NULL)) crypto/bn/bn_exp.c:296:1: Parameter `ctx->stack.depth` 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. { test/bntest.c:2111:21: Call 2109. || !TEST_true(BN_mod_exp_mont(r, a, p, m, NULL, NULL)) 2110. || !TEST_BN_eq_zero(r) 2111. || !TEST_true(BN_mod_exp_mont_consttime(r, a, p, m, NULL, NULL)) ^ 2112. || !TEST_BN_eq_zero(r) 2113. || !TEST_true(BN_mod_exp_mont_word(r, 1, p, m, NULL, NULL)) 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) test/bntest.c:2113:21: Call 2111. || !TEST_true(BN_mod_exp_mont_consttime(r, a, p, m, NULL, NULL)) 2112. || !TEST_BN_eq_zero(r) 2113. || !TEST_true(BN_mod_exp_mont_word(r, 1, p, m, NULL, NULL)) ^ 2114. || !TEST_BN_eq_zero(r) 2115. || !TEST_true(BN_mod_exp_simple(r, a, p, m, NULL)) crypto/bn/bn_exp.c:1129:1: Parameter `ctx->stack.depth` 1127. } 1128. 1129. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, 1130. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 1131. { test/bntest.c:2115:21: Call 2113. || !TEST_true(BN_mod_exp_mont_word(r, 1, p, m, NULL, NULL)) 2114. || !TEST_BN_eq_zero(r) 2115. || !TEST_true(BN_mod_exp_simple(r, a, p, m, NULL)) ^ 2116. || !TEST_BN_eq_zero(r) 2117. || !TEST_true(BN_mod_exp_recp(r, a, p, m, NULL)) crypto/bn/bn_exp.c:1277:1: Parameter `ctx->stack.depth` 1275. 1276. /* The old fallback, simple version :-) */ 1277. > int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 1278. const BIGNUM *m, BN_CTX *ctx) 1279. { test/bntest.c:2117:21: Call 2115. || !TEST_true(BN_mod_exp_simple(r, a, p, m, NULL)) 2116. || !TEST_BN_eq_zero(r) 2117. || !TEST_true(BN_mod_exp_recp(r, a, p, m, NULL)) ^ 2118. || !TEST_BN_eq_zero(r)) 2119. goto err; 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. { test/bntest.c:2107:14: Call 2105. /* Calculate r = 1 ^ 0 mod 1, and check the result is always 0 */ 2106. for (i = 0; i < 2; i++) { 2107. if (!TEST_true(BN_mod_exp(r, a, p, m, NULL)) ^ 2108. || !TEST_BN_eq_zero(r) 2109. || !TEST_true(BN_mod_exp_mont(r, a, p, m, NULL, NULL)) crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth` 87. } 88. 89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 90. BN_CTX *ctx) 91. { crypto/bn/bn_exp.c:149:15: Call 147. #ifdef RECP_MUL_MOD 148. { 149. ret = BN_mod_exp_recp(r, a, p, m, ctx); ^ 150. } 151. #else crypto/bn/bn_exp.c:161:1: Parameter `ctx->stack.depth` 159. } 160. 161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 162. const BIGNUM *m, BN_CTX *ctx) 163. { crypto/bn/bn_exp.c:191:5: Call 189. } 190. 191. BN_CTX_start(ctx); ^ 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_exp.c:192:10: Call 190. 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); ^ 193. val[0] = BN_CTX_get(ctx); 194. if (val[0] == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:193:14: Call 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); ^ 194. if (val[0] == NULL) 195. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:210:10: Call 208. } 209. 210. if (!BN_nnmod(val[0], a, m, ctx)) ^ 211. goto err; /* 1 */ 212. if (BN_is_zero(val[0])) { crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_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` 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_44423
static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt) { #ifndef OPENSSL_NO_RSA unsigned char *encdata = NULL; EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *pctx = NULL; size_t enclen; unsigned char *pms = NULL; size_t pmslen = 0; if (s->session->peer == NULL) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pkey = X509_get0_pubkey(s->session->peer); if (EVP_PKEY_get0_RSA(pkey) == NULL) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pmslen = SSL_MAX_MASTER_KEY_LENGTH; pms = OPENSSL_malloc(pmslen); if (pms == NULL) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); return 0; } pms[0] = s->client_version >> 8; pms[1] = s->client_version & 0xff; if (ssl_randbytes(s, pms + 2, (int)(pmslen - 2)) <= 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); goto err; } if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } pctx = EVP_PKEY_CTX_new(pkey, NULL); if (pctx == NULL || EVP_PKEY_encrypt_init(pctx) <= 0 || EVP_PKEY_encrypt(pctx, NULL, &enclen, pms, pmslen) <= 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_EVP_LIB); goto err; } if (!WPACKET_allocate_bytes(pkt, enclen, &encdata) || EVP_PKEY_encrypt(pctx, encdata, &enclen, pms, pmslen) <= 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT); goto err; } EVP_PKEY_CTX_free(pctx); pctx = NULL; if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen)) { goto err; } s->s3->tmp.pms = pms; s->s3->tmp.pmslen = pmslen; return 1; err: OPENSSL_clear_free(pms, pmslen); EVP_PKEY_CTX_free(pctx); return 0; #else SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; #endif } ssl/statem/statem_clnt.c:2879: error: NULL_DEREFERENCE pointer `pkey` last assigned on line 2878 could be null and is dereferenced by call to `EVP_PKEY_get0_RSA()` at line 2879, column 9. Showing all 30 steps of the trace ssl/statem/statem_clnt.c:2859:1: start of procedure tls_construct_cke_rsa() 2857. } 2858. 2859. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt) 2860. { 2861. #ifndef OPENSSL_NO_RSA ssl/statem/statem_clnt.c:2862:5: 2860. { 2861. #ifndef OPENSSL_NO_RSA 2862. > unsigned char *encdata = NULL; 2863. EVP_PKEY *pkey = NULL; 2864. EVP_PKEY_CTX *pctx = NULL; ssl/statem/statem_clnt.c:2863:5: 2861. #ifndef OPENSSL_NO_RSA 2862. unsigned char *encdata = NULL; 2863. > EVP_PKEY *pkey = NULL; 2864. EVP_PKEY_CTX *pctx = NULL; 2865. size_t enclen; ssl/statem/statem_clnt.c:2864:5: 2862. unsigned char *encdata = NULL; 2863. EVP_PKEY *pkey = NULL; 2864. > EVP_PKEY_CTX *pctx = NULL; 2865. size_t enclen; 2866. unsigned char *pms = NULL; ssl/statem/statem_clnt.c:2866:5: 2864. EVP_PKEY_CTX *pctx = NULL; 2865. size_t enclen; 2866. > unsigned char *pms = NULL; 2867. size_t pmslen = 0; 2868. ssl/statem/statem_clnt.c:2867:5: 2865. size_t enclen; 2866. unsigned char *pms = NULL; 2867. > size_t pmslen = 0; 2868. 2869. if (s->session->peer == NULL) { ssl/statem/statem_clnt.c:2869:9: Taking false branch 2867. size_t pmslen = 0; 2868. 2869. if (s->session->peer == NULL) { ^ 2870. /* 2871. * We should always have a server certificate with SSL_kRSA. ssl/statem/statem_clnt.c:2878:5: 2876. } 2877. 2878. > pkey = X509_get0_pubkey(s->session->peer); 2879. if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2880. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, crypto/x509/x509_cmp.c:264:1: start of procedure X509_get0_pubkey() 262. } 263. 264. > EVP_PKEY *X509_get0_pubkey(const X509 *x) 265. { 266. if (x == NULL) crypto/x509/x509_cmp.c:266:9: Taking false branch 264. EVP_PKEY *X509_get0_pubkey(const X509 *x) 265. { 266. if (x == NULL) ^ 267. return NULL; 268. return X509_PUBKEY_get0(x->cert_info.key); crypto/x509/x509_cmp.c:268:5: 266. if (x == NULL) 267. return NULL; 268. > return X509_PUBKEY_get0(x->cert_info.key); 269. } 270. crypto/x509/x_pubkey.c:140:1: start of procedure X509_PUBKEY_get0() 138. } 139. 140. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 141. { 142. EVP_PKEY *ret = NULL; crypto/x509/x_pubkey.c:142:5: 140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 141. { 142. > EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) crypto/x509/x_pubkey.c:144:9: Taking false branch 142. EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) ^ 145. return NULL; 146. crypto/x509/x_pubkey.c:144:24: Taking false branch 142. EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) ^ 145. return NULL; 146. crypto/x509/x_pubkey.c:147:9: Taking false branch 145. return NULL; 146. 147. if (key->pkey != NULL) ^ 148. return key->pkey; 149. crypto/x509/x_pubkey.c:158:5: 156. * in the queue. 157. */ 158. > x509_pubkey_decode(&ret, key); 159. /* If decode doesn't fail something bad happened */ 160. if (ret != NULL) { crypto/x509/x_pubkey.c:103:1: start of procedure x509_pubkey_decode() 101. 102. 103. > static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key) 104. { 105. EVP_PKEY *pkey = EVP_PKEY_new(); crypto/x509/x_pubkey.c:105:5: Skipping EVP_PKEY_new(): empty list of specs 103. static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key) 104. { 105. EVP_PKEY *pkey = EVP_PKEY_new(); ^ 106. 107. if (pkey == NULL) { crypto/x509/x_pubkey.c:107:9: Taking true branch 105. EVP_PKEY *pkey = EVP_PKEY_new(); 106. 107. if (pkey == NULL) { ^ 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); 109. return -1; crypto/x509/x_pubkey.c:108:9: Skipping ERR_put_error(): empty list of specs 106. 107. if (pkey == NULL) { 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); ^ 109. return -1; 110. } crypto/x509/x_pubkey.c:109:9: 107. if (pkey == NULL) { 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); 109. > return -1; 110. } 111. crypto/x509/x_pubkey.c:138:1: return from a call to x509_pubkey_decode 136. EVP_PKEY_free(pkey); 137. return 0; 138. > } 139. 140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) crypto/x509/x_pubkey.c:160:9: Taking false branch 158. x509_pubkey_decode(&ret, key); 159. /* If decode doesn't fail something bad happened */ 160. if (ret != NULL) { ^ 161. X509err(X509_F_X509_PUBKEY_GET0, ERR_R_INTERNAL_ERROR); 162. EVP_PKEY_free(ret); crypto/x509/x_pubkey.c:165:5: 163. } 164. 165. > return NULL; 166. } 167. crypto/x509/x_pubkey.c:166:1: return from a call to X509_PUBKEY_get0 164. 165. return NULL; 166. > } 167. 168. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) crypto/x509/x509_cmp.c:269:1: return from a call to X509_get0_pubkey 267. return NULL; 268. return X509_PUBKEY_get0(x->cert_info.key); 269. > } 270. 271. EVP_PKEY *X509_get_pubkey(X509 *x) ssl/statem/statem_clnt.c:2879:9: 2877. 2878. pkey = X509_get0_pubkey(s->session->peer); 2879. > if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2880. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA, 2881. ERR_R_INTERNAL_ERROR); crypto/evp/p_lib.c:311:1: start of procedure EVP_PKEY_get0_RSA() 309. } 310. 311. > RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) 312. { 313. if (pkey->type != EVP_PKEY_RSA) { crypto/evp/p_lib.c:313:9: 311. RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) 312. { 313. > if (pkey->type != EVP_PKEY_RSA) { 314. EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY); 315. return NULL;
https://github.com/openssl/openssl/blob/066904cceef26bbb5c63c237d20829fb0db82ddc/ssl/statem/statem_clnt.c/#L2879
d2a_code_trace_data_44424
void CRYPTO_free(void *str) { #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (call_malloc_debug) { CRYPTO_mem_debug_free(str, 0); free(str); CRYPTO_mem_debug_free(str, 1); } else { free(str); } #else free(str); #endif } crypto/x509v3/v3_pci.c:146: error: USE_AFTER_FREE call to `CRYPTO_free()` eventually accesses memory that was invalidated by call to `free()` on line 132 indirectly during the call to `CRYPTO_realloc()`. Showing all 16 steps of the trace crypto/x509v3/v3_pci.c:113:23: invalidation part of the trace starts here 111. long val_len; 112. if (!*policy) { 113. *policy = ASN1_OCTET_STRING_new(); ^ 114. if (*policy == NULL) { 115. X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE); crypto/x509v3/v3_pci.c:113:23: passed as argument to `ASN1_OCTET_STRING_new` 111. long val_len; 112. if (!*policy) { 113. *policy = ASN1_OCTET_STRING_new(); ^ 114. if (*policy == NULL) { 115. X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE); crypto/x509v3/v3_pci.c:113:23: return from call to `ASN1_OCTET_STRING_new` 111. long val_len; 112. if (!*policy) { 113. *policy = ASN1_OCTET_STRING_new(); ^ 114. if (*policy == NULL) { 115. X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE); crypto/x509v3/v3_pci.c:113:13: assigned 111. long val_len; 112. if (!*policy) { 113. *policy = ASN1_OCTET_STRING_new(); ^ 114. if (*policy == NULL) { 115. X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE); crypto/x509v3/v3_pci.c:132:24: when calling `CRYPTO_realloc` here 130. } 131. 132. tmp_data = OPENSSL_realloc((*policy)->data, ^ 133. (*policy)->length + val_len + 1); 134. if (tmp_data) { 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/x509v3/v3_pci.c:113:23: use-after-lifetime part of the trace starts here 111. long val_len; 112. if (!*policy) { 113. *policy = ASN1_OCTET_STRING_new(); ^ 114. if (*policy == NULL) { 115. X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE); crypto/x509v3/v3_pci.c:113:23: passed as argument to `ASN1_OCTET_STRING_new` 111. long val_len; 112. if (!*policy) { 113. *policy = ASN1_OCTET_STRING_new(); ^ 114. if (*policy == NULL) { 115. X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE); crypto/x509v3/v3_pci.c:113:23: return from call to `ASN1_OCTET_STRING_new` 111. long val_len; 112. if (!*policy) { 113. *policy = ASN1_OCTET_STRING_new(); ^ 114. if (*policy == NULL) { 115. X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE); crypto/x509v3/v3_pci.c:113:13: assigned 111. long val_len; 112. if (!*policy) { 113. *policy = ASN1_OCTET_STRING_new(); ^ 114. if (*policy == NULL) { 115. X509V3err(X509V3_F_PROCESS_PCI_VALUE, ERR_R_MALLOC_FAILURE); crypto/x509v3/v3_pci.c:146:17: when calling `CRYPTO_free` here 144. * too! 145. */ 146. OPENSSL_free((*policy)->data); ^ 147. (*policy)->data = NULL; 148. (*policy)->length = 0; 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: invalid access occurs here 243. } 244. #else 245. free(str); ^ 246. #endif 247. }
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/mem.c/#L245
d2a_code_trace_data_44425
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/dh/dh_check.c:98: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp`. Showing all 20 steps of the trace crypto/dh/dh_check.c:83:2: Call 81. ctx=BN_CTX_new(); 82. if (ctx == NULL) goto err; 83. BN_CTX_start(ctx); ^ 84. t1=BN_CTX_get(ctx); 85. if (t1 == NULL) goto err; crypto/bn/bn_ctx.c:257:1: Parameter `ctx->stack.depth` 255. } 256. 257. > void BN_CTX_start(BN_CTX *ctx) 258. { 259. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/dh/dh_check.c:98:9: Call 96. { 97. /* Check g^q == 1 mod p */ 98. if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx)) ^ 99. goto err; 100. if (!BN_is_one(t1)) crypto/bn/bn_exp.c:194:1: Parameter `ctx->stack.depth` 192. 193. 194. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 195. BN_CTX *ctx) 196. { crypto/bn/bn_exp.c:259:9: Call 257. #endif 258. #ifdef RECP_MUL_MOD 259. { ret=BN_mod_exp_recp(r,a,p,m,ctx); } ^ 260. #else 261. { ret=BN_mod_exp_simple(r,a,p,m,ctx); } crypto/bn/bn_exp.c:269:1: Parameter `ctx->stack.depth` 267. 268. 269. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 270. const BIGNUM *m, BN_CTX *ctx) 271. { crypto/bn/bn_exp.c:294:2: Call 292. } 293. 294. BN_CTX_start(ctx); ^ 295. aa = BN_CTX_get(ctx); 296. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:257:1: Parameter `ctx->stack.depth` 255. } 256. 257. > void BN_CTX_start(BN_CTX *ctx) 258. { 259. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_exp.c:312:7: Call 310. } 311. 312. if (!BN_nnmod(val[0],a,m,ctx)) goto err; /* 1 */ ^ 313. if (BN_is_zero(val[0])) 314. { crypto/bn/bn_mod.c:129:1: Parameter `ctx->stack.depth` 127. 128. 129. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 130. { 131. /* like BN_mod, but returns non-negative remainder crypto/bn/bn_mod.c:134:8: Call 132. * (i.e., 0 <= r < |d| always holds) */ 133. 134. if (!(BN_mod(r,m,d,ctx))) ^ 135. return 0; 136. if (!r->neg) crypto/bn/bn_div.c:183:1: Parameter `ctx->stack.depth` 181. * If 'dv' or 'rm' is NULL, the respective value is not returned. 182. */ 183. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 184. BN_CTX *ctx) 185. { crypto/bn/bn_div.c:228:2: Call 226. } 227. 228. BN_CTX_start(ctx); ^ 229. tmp=BN_CTX_get(ctx); 230. snum=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:257:1: Parameter `ctx->stack.depth` 255. } 256. 257. > void BN_CTX_start(BN_CTX *ctx) 258. { 259. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:443:2: Call 441. } 442. if (no_branch) bn_correct_top(res); 443. BN_CTX_end(ctx); ^ 444. return(1); 445. err: crypto/bn/bn_ctx.c:272:1: Parameter `ctx->stack.depth` 270. } 271. 272. > void BN_CTX_end(BN_CTX *ctx) 273. { 274. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:279:21: Call 277. else 278. { 279. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 280. /* Does this stack frame have anything to release? */ 281. if(fp < ctx->used) crypto/bn/bn_ctx.c:353:1: <LHS trace> 351. } 352. 353. > static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:353:1: Parameter `st->depth` 351. } 352. 353. > static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:355:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp` 353. static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; ^ 356. } 357.
https://github.com/openssl/openssl/blob/53e5161231854d64fd89e993944609a329a92db4/crypto/bn/bn_ctx.c/#L355
d2a_code_trace_data_44426
static ossl_inline size_t constant_time_lt_s(size_t a, size_t b) { return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b))); } ssl/record/ssl3_record.c:1628: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [1, 64]):unsigned64 by call to `ssl3_cbc_copy_mac`. Showing all 10 steps of the trace ssl/record/ssl3_record.c:1495:1: Parameter `s->rlayer.rrec.length` 1493. } 1494. 1495. > int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap) 1496. { 1497. int i, al; ssl/record/ssl3_record.c:1535:5: Assignment 1533. /* decrypt in place in 'rr->input' */ 1534. rr->data = rr->input; 1535. rr->orig_len = rr->length; ^ 1536. 1537. if (SSL_READ_ETM(s) && s->read_hash) { ssl/record/ssl3_record.c:1628:18: Call 1626. */ 1627. mac = mac_tmp; 1628. if (!ssl3_cbc_copy_mac(mac_tmp, rr, mac_size)) { ^ 1629. al = SSL_AD_INTERNAL_ERROR; 1630. SSLerr(SSL_F_DTLS1_PROCESS_RECORD, ERR_R_INTERNAL_ERROR); ssl/record/ssl3_record.c:1420:1: Parameter `md_size` 1418. #define CBC_MAC_ROTATE_IN_PLACE 1419. 1420. > int ssl3_cbc_copy_mac(unsigned char *out, 1421. const SSL3_RECORD *rec, size_t md_size) 1422. { ssl/record/ssl3_record.c:1478:26: Call 1476. ((volatile unsigned char *)rotated_mac)[rotate_offset ^ 32]; 1477. out[j++] = rotated_mac[rotate_offset++]; 1478. rotate_offset &= constant_time_lt_s(rotate_offset, md_size); ^ 1479. } 1480. #else include/internal/constant_time_locl.h:117:1: <LHS trace> 115. } 116. 117. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b) 118. { 119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b))); include/internal/constant_time_locl.h:117:1: Parameter `a` 115. } 116. 117. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b) 118. { 119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b))); include/internal/constant_time_locl.h:117:1: <RHS trace> 115. } 116. 117. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b) 118. { 119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b))); include/internal/constant_time_locl.h:117:1: Parameter `b` 115. } 116. 117. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b) 118. { 119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b))); include/internal/constant_time_locl.h:119:12: Binary operation: ([0, +oo] - [1, 64]):unsigned64 by call to `ssl3_cbc_copy_mac` 117. static ossl_inline size_t constant_time_lt_s(size_t a, size_t b) 118. { 119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b))); ^ 120. } 121.
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/include/internal/constant_time_locl.h/#L119
d2a_code_trace_data_44427
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:1894: error: Buffer Overrun L1 Offset: 10 (⇐ 2 + 8) Size: 4 by call to `ff_estimate_motion_b`. libavcodec/motion_est.c:1894:17: Call 1892. if(type == CANDIDATE_MB_TYPE_BACKWARD || type == CANDIDATE_MB_TYPE_BIDIR){ 1893. c->skip=0; 1894. ff_estimate_motion_b(s, mb_x, mb_y, s->b_back_mv_table, 2, s->b_code); ^ 1895. } 1896. if(type == CANDIDATE_MB_TYPE_FORWARD_I || type == CANDIDATE_MB_TYPE_BIDIR_I){ libavcodec/motion_est.c:1481:1: Parameter `ref_index` 1479. } 1480. 1481. static int ff_estimate_motion_b(MpegEncContext * s, ^ 1482. int mb_x, int mb_y, int16_t (*mv_table)[2], int ref_index, int f_code) 1483. { libavcodec/motion_est.c:1556:16: Call 1554. } 1555. 1556. dmin = ff_epzs_motion_search(s, &mx, &my, P, 0, ref_index, s->p_mv_table, mv_scale, 0, 16); ^ 1557. 1558. break; libavcodec/motion_est_template.c:1116:1: Parameter `ref_index` 1114. 1115. //this function is dedicated to the braindamaged gcc 1116. inline int ff_epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr, ^ 1117. int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], 1118. int ref_mv_scale, int size, int h) libavcodec/motion_est_template.c:1123:16: Call 1121. //FIXME convert other functions in the same way if faster 1122. if(c->flags==0 && h==16 && size==0){ 1123. return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, 0, 0, 16); ^ 1124. // case FLAG_QPEL: 1125. // return epzs_motion_search_internal(s, mx_ptr, my_ptr, P, src_index, ref_index, last_mv, ref_mv_scale, FLAG_QPEL); libavcodec/motion_est_template.c:999:1: Parameter `ref_index` 997. optimal mv. 998. */ 999. static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr, ^ 1000. int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], 1001. int ref_mv_scale, int flags, int size, int h) libavcodec/motion_est_template.c:1105:11: Call 1103. 1104. //check(best[0],best[1],0, b0) 1105. dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); ^ 1106. 1107. //check(best[0],best[1],0, b1) libavcodec/motion_est_template.c:973:1: Parameter `ref_index` 971. } 972. 973. static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin, ^ 974. int src_index, int ref_index, int const penalty_factor, 975. int size, int h, int flags){ libavcodec/motion_est_template.c:980:18: Call 978. return funny_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); 979. else if(c->dia_size<-1) 980. return sab_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); ^ 981. else if(c->dia_size<2) 982. return small_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); libavcodec/motion_est_template.c:809:1: Parameter `ref_index` 807. 808. #define MAX_SAB_SIZE ME_MAP_SIZE 809. static int sab_diamond_search(MpegEncContext * s, int *best, int dmin, ^ 810. int src_index, int ref_index, int const penalty_factor, 811. int size, int h, int flags) libavcodec/motion_est_template.c:872:9: Call 870. continue; 871. 872. SAB_CHECK_MV(x-1, y) ^ 873. SAB_CHECK_MV(x+1, y) 874. SAB_CHECK_MV(x , y-1) libavcodec/motion_est.c:108:1: <Length trace> 106. against a proposed motion-compensated prediction of that block 107. */ 108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 109. const int size, const int h, int ref_index, int src_index, 110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ libavcodec/motion_est.c:108:1: Parameter `ref_index` 106. against a proposed motion-compensated prediction of that block 107. */ 108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 109. const int size, const int h, int ref_index, int src_index, 110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ libavcodec/motion_est.c:119:5: Assignment 117. const int hx= subx + (x<<(1+qpel)); 118. const int hy= suby + (y<<(1+qpel)); 119. uint8_t * const * const ref= c->ref[ref_index]; ^ 120. uint8_t * const * const src= c->src[src_index]; 121. int d; libavcodec/motion_est.c:176:50: Array access: Offset: 10 (⇐ 2 + 8) Size: 4 by call to `ff_estimate_motion_b` 174. 175. c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16); 176. c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16); ^ 177. } 178. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L176
d2a_code_trace_data_44428
static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, int16_t *block, int n, int qscale, int index_bits, int level_bias, int level_shift) { int i, j, index1, index2, len; int level, component, sign; const uint8_t *weight_matrix; OPEN_READER(bs, &ctx->gb); if (!ctx->is_444) { if (n&2) { component = 1 + (n&1); weight_matrix = ctx->cid_table->chroma_weight; } else { component = 0; weight_matrix = ctx->cid_table->luma_weight; } } else { component = (n >> 1) % 3; if (component) { weight_matrix = ctx->cid_table->chroma_weight; } else { weight_matrix = ctx->cid_table->luma_weight; } } UPDATE_CACHE(bs, &ctx->gb); GET_VLC(len, bs, &ctx->gb, ctx->dc_vlc.table, DNXHD_DC_VLC_BITS, 1); if (len) { level = GET_CACHE(bs, &ctx->gb); LAST_SKIP_BITS(bs, &ctx->gb, len); sign = ~level >> 31; level = (NEG_USR32(sign ^ level, len) ^ sign) - sign; ctx->last_dc[component] += level; } block[0] = ctx->last_dc[component]; for (i = 1; ; i++) { UPDATE_CACHE(bs, &ctx->gb); GET_VLC(index1, bs, &ctx->gb, ctx->ac_vlc.table, DNXHD_VLC_BITS, 2); level = ctx->cid_table->ac_level[index1]; if (!level) break; sign = SHOW_SBITS(bs, &ctx->gb, 1); SKIP_BITS(bs, &ctx->gb, 1); if (ctx->cid_table->ac_index_flag[index1]) { level += SHOW_UBITS(bs, &ctx->gb, index_bits) << 6; SKIP_BITS(bs, &ctx->gb, index_bits); } if (ctx->cid_table->ac_run_flag[index1]) { UPDATE_CACHE(bs, &ctx->gb); GET_VLC(index2, bs, &ctx->gb, ctx->run_vlc.table, DNXHD_VLC_BITS, 2); i += ctx->cid_table->run[index2]; } if (i > 63) { av_log(ctx->avctx, AV_LOG_ERROR, "ac tex damaged %d, %d\n", n, i); break; } j = ctx->scantable.permutated[i]; level = (2*level+1) * qscale * weight_matrix[i]; if (level_bias < 32 || weight_matrix[i] != level_bias) level += level_bias; level >>= level_shift; block[j] = (level^sign) - sign; } CLOSE_READER(bs, &ctx->gb); } libavcodec/dnxhddec.c:226: error: Buffer Overrun L3 Offset: [-2, 2] Size: 3. libavcodec/dnxhddec.c:207:13: <Offset trace> 205. weight_matrix = ctx->cid_table->chroma_weight; 206. } else { 207. component = 0; ^ 208. weight_matrix = ctx->cid_table->luma_weight; 209. } libavcodec/dnxhddec.c:207:13: Assignment 205. weight_matrix = ctx->cid_table->chroma_weight; 206. } else { 207. component = 0; ^ 208. weight_matrix = ctx->cid_table->luma_weight; 209. } libavcodec/dnxhddec.c:190:1: <Length trace> 188. } 189. 190. static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, ^ 191. int16_t *block, int n, 192. int qscale, libavcodec/dnxhddec.c:190:1: Parameter `ctx->last_dc[*]` 188. } 189. 190. static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, ^ 191. int16_t *block, int n, 192. int qscale, libavcodec/dnxhddec.c:226:9: Array access: Offset: [-2, 2] Size: 3 224. sign = ~level >> 31; 225. level = (NEG_USR32(sign ^ level, len) ^ sign) - sign; 226. ctx->last_dc[component] += level; ^ 227. } 228. block[0] = ctx->last_dc[component];
https://github.com/libav/libav/blob/18c896be3d8e926ef806e7de29c4a168d7763389/libavcodec/dnxhddec.c/#L226
d2a_code_trace_data_44429
int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len) { SHA_LONG64 l; unsigned char *p = c->u.p; const unsigned char *data = (const unsigned char *)_data; if (len == 0) return 1; l = (c->Nl + (((SHA_LONG64) len) << 3)) & U64(0xffffffffffffffff); if (l < c->Nl) c->Nh++; if (sizeof(len) >= 8) c->Nh += (((SHA_LONG64) len) >> 61); c->Nl = l; if (c->num != 0) { size_t n = sizeof(c->u) - c->num; if (len < n) { memcpy(p + c->num, data, len), c->num += (unsigned int)len; return 1; } else { memcpy(p + c->num, data, n), c->num = 0; len -= n, data += n; sha512_block_data_order(c, p, 1); } } if (len >= sizeof(c->u)) { #ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA if ((size_t)data % sizeof(c->u.d[0]) != 0) while (len >= sizeof(c->u)) memcpy(p, data, sizeof(c->u)), sha512_block_data_order(c, p, 1), len -= sizeof(c->u), data += sizeof(c->u); else #endif sha512_block_data_order(c, data, len / sizeof(c->u)), data += len, len %= sizeof(c->u), data -= len; } if (len != 0) memcpy(p, data, len), c->num = (int)len; return 1; } crypto/ec/curve25519.c:4621: error: INTEGER_OVERFLOW_L2 (32 - [1, 127]):unsigned64 by call to `SHA512_Update`. Showing all 10 steps of the trace crypto/ec/curve25519.c:4619:3: Call 4617. ge_p3_tobytes(out_sig, &R); 4618. 4619. SHA512_Init(&hash_ctx); ^ 4620. SHA512_Update(&hash_ctx, out_sig, 32); 4621. SHA512_Update(&hash_ctx, public_key, 32); crypto/sha/sha512.c:94:5: Assignment 92. c->Nl = 0; 93. c->Nh = 0; 94. c->num = 0; ^ 95. c->md_len = SHA512_DIGEST_LENGTH; 96. return 1; crypto/ec/curve25519.c:4620:3: Call 4618. 4619. SHA512_Init(&hash_ctx); 4620. SHA512_Update(&hash_ctx, out_sig, 32); ^ 4621. SHA512_Update(&hash_ctx, public_key, 32); 4622. SHA512_Update(&hash_ctx, message, message_len); crypto/sha/sha512.c:188:1: Parameter `c->num` 186. } 187. 188. > int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len) 189. { 190. SHA_LONG64 l; crypto/ec/curve25519.c:4621:3: Call 4619. SHA512_Init(&hash_ctx); 4620. SHA512_Update(&hash_ctx, out_sig, 32); 4621. SHA512_Update(&hash_ctx, public_key, 32); ^ 4622. SHA512_Update(&hash_ctx, message, message_len); 4623. SHA512_Final(hram, &hash_ctx); crypto/sha/sha512.c:188:1: <LHS trace> 186. } 187. 188. > int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len) 189. { 190. SHA_LONG64 l; crypto/sha/sha512.c:188:1: Parameter `len` 186. } 187. 188. > int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len) 189. { 190. SHA_LONG64 l; crypto/sha/sha512.c:188:1: <RHS trace> 186. } 187. 188. > int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len) 189. { 190. SHA_LONG64 l; crypto/sha/sha512.c:188:1: Parameter `len` 186. } 187. 188. > int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len) 189. { 190. SHA_LONG64 l; crypto/sha/sha512.c:212:13: Binary operation: (32 - [1, 127]):unsigned64 by call to `SHA512_Update` 210. } else { 211. memcpy(p + c->num, data, n), c->num = 0; 212. len -= n, data += n; ^ 213. sha512_block_data_order(c, p, 1); 214. }
https://github.com/openssl/openssl/blob/04dec1ab34df70c1588d42cc394e8fa8b5f3191c/crypto/sha/sha512.c/#L212
d2a_code_trace_data_44430
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); } crypto/x509/x509_cmp.c:42: 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/x509_cmp.c:42:9: Call 40. if (ctx == NULL) 41. goto err; 42. f = X509_NAME_oneline(a->cert_info.issuer, NULL, 0); ^ 43. if (!EVP_DigestInit_ex(ctx, EVP_md5(), NULL)) 44. goto err; 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_44431
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:1162: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:1162:9: 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) 1162. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) ^ 1163. }else{ 1164. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1162
d2a_code_trace_data_44432
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 && ossl_isxdigit(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/params_test.c:341: error: BUFFER_OVERRUN_L2 Offset: [0, 536870912] (⇐ [0, 1] + [0, 536870911]) Size: 9 by call to `BN_hex2bn`. Showing all 6 steps of the trace test/params_test.c:341:10: Call 339. app_p1 = app_p1_init; 340. app_p2 = app_p2_init; 341. if (!BN_hex2bn(&app_p3, app_p3_init) ^ 342. || (l = BN_bn2nativepad(app_p3, bignumbin, sizeof(bignumbin))) < 0) 343. return 0; crypto/bn/bn_print.c:141:10: <Offset trace> 139. } 140. 141. for (i = 0; i <= INT_MAX / 4 && ossl_isxdigit(a[i]); i++) ^ 142. continue; 143. crypto/bn/bn_print.c:141:10: Assignment 139. } 140. 141. for (i = 0; i <= INT_MAX / 4 && ossl_isxdigit(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: 9 by call to `BN_hex2bn` 139. } 140. 141. for (i = 0; i <= INT_MAX / 4 && ossl_isxdigit(a[i]); i++) ^ 142. continue; 143.
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_print.c/#L141
d2a_code_trace_data_44433
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } r->neg = a->neg; nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } crypto/srp/srp_vfy.c:569: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `SRP_create_verifier_BN`. Showing all 22 steps of the trace crypto/srp/srp_vfy.c:542:22: Call 540. if ((len = t_fromb64(tmp, N)) == 0) 541. goto err; 542. N_bn_alloc = BN_bin2bn(tmp, len, NULL); ^ 543. N_bn = N_bn_alloc; 544. if ((len = t_fromb64(tmp, g)) == 0) crypto/bn/bn_lib.c:492:9: Assignment 490. n = len; 491. if (n == 0) { 492. ret->top = 0; ^ 493. return (ret); 494. } crypto/srp/srp_vfy.c:569:10: Call 567. } 568. 569. if (!SRP_create_verifier_BN(user, pass, &s, &v, N_bn, g_bn)) ^ 570. goto err; 571. crypto/srp/srp_vfy.c:610:1: Parameter `g->top` 608. * BIGNUMS. 609. */ 610. > int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 611. BIGNUM **verifier, const BIGNUM *N, 612. const BIGNUM *g) crypto/srp/srp_vfy.c:641:10: Call 639. goto err; 640. 641. if (!BN_mod_exp(*verifier, g, x, N, bn_ctx)) { ^ 642. BN_clear_free(*verifier); 643. goto err; crypto/bn/bn_exp.c:90:1: Parameter `a->top` 88. } 89. 90. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 91. BN_CTX *ctx) 92. { crypto/bn/bn_exp.c:150:19: Call 148. } else 149. # endif 150. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 151. } else 152. #endif crypto/bn/bn_exp.c:300:1: Parameter `a->top` 298. } 299. 300. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 301. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 302. { crypto/bn/bn_exp.c:312:16: Call 310. 311. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 312. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 313. } 314. crypto/bn/bn_exp.c:600:1: Parameter `a->top` 598. * http://www.daemonology.net/hyperthreading-considered-harmful/) 599. */ 600. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 601. const BIGNUM *m, BN_CTX *ctx, 602. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:753:14: Call 751. /* prepare a^1 in Montgomery domain */ 752. if (a->neg || BN_ucmp(a, m) >= 0) { 753. if (!BN_mod(&am, a, m, ctx)) ^ 754. goto err; 755. if (!BN_to_montgomery(&am, &am, mont, ctx)) crypto/bn/bn_div.c:140:1: Parameter `num->top` 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/bn/bn_div.c:210:11: Call 208. sdiv->neg = 0; 209. norm_shift += BN_BITS2; 210. if (!(BN_lshift(snum, num, norm_shift))) ^ 211. goto err; 212. snum->neg = 0; crypto/bn/bn_shift.c:81:1: <Offset trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `n` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:96:5: Assignment 94. 95. r->neg = a->neg; 96. nw = n / BN_BITS2; ^ 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) 98. return (0); crypto/bn/bn_shift.c:81:1: <Length trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `*r->d` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:9: Call 95. r->neg = a->neg; 96. nw = n / BN_BITS2; 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 98. return (0); 99. lb = n % BN_BITS2; crypto/bn/bn_lib.c:1016:1: Parameter `*a->d` 1014. } 1015. 1016. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 1017. { 1018. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_shift.c:102:5: Assignment 100. rb = BN_BITS2 - lb; 101. f = a->d; 102. t = r->d; ^ 103. t[a->top + nw] = 0; 104. if (lb == 0) crypto/bn/bn_shift.c:110:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `SRP_create_verifier_BN` 108. for (i = a->top - 1; i >= 0; i--) { 109. l = f[i]; 110. t[nw + i + 1] |= (l >> rb) & BN_MASK2; ^ 111. t[nw + i] = (l << lb) & BN_MASK2; 112. }
https://github.com/openssl/openssl/blob/4973a60cb92dc121fc09246bff3815afc0f8ab9a/crypto/bn/bn_shift.c/#L110
d2a_code_trace_data_44434
static inline void refill_32(BitstreamContext *bc) { if (bc->ptr >= bc->buffer_end) return; #ifdef BITSTREAM_READER_LE bc->bits = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits; #else bc->bits = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left); #endif bc->ptr += 4; bc->bits_left += 32; } libavcodec/tak_parser.c:58: error: Integer Overflow L2 (32 - [0, 64]):unsigned32 by call to `ff_tak_decode_frame_header`. libavcodec/tak_parser.c:57:9: Call 55. if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { 56. TAKStreamInfo ti; 57. bitstream_init(&bc, buf, buf_size); ^ 58. if (!ff_tak_decode_frame_header(avctx, &bc, &ti, 127)) 59. s->duration = t->ti.last_frame_samples ? t->ti.last_frame_samples libavcodec/bitstream.h:85:9: Assignment 83. bc->buffer = 84. bc->ptr = NULL; 85. bc->bits_left = 0; ^ 86. return AVERROR_INVALIDDATA; 87. } libavcodec/tak_parser.c:58:14: Call 56. TAKStreamInfo ti; 57. bitstream_init(&bc, buf, buf_size); 58. if (!ff_tak_decode_frame_header(avctx, &bc, &ti, 127)) ^ 59. s->duration = t->ti.last_frame_samples ? t->ti.last_frame_samples 60. : t->ti.frame_samples; libavcodec/tak.c:124:1: Parameter `bc->bits_left` 122. } 123. 124. int ff_tak_decode_frame_header(AVCodecContext *avctx, BitstreamContext *bc, ^ 125. TAKStreamInfo *ti, int log_level_offset) 126. { libavcodec/tak.c:127:9: Call 125. TAKStreamInfo *ti, int log_level_offset) 126. { 127. if (bitstream_read(bc, TAK_FRAME_HEADER_SYNC_ID_BITS) != TAK_FRAME_HEADER_SYNC_ID) { ^ 128. av_log(avctx, AV_LOG_ERROR + log_level_offset, "missing sync id\n"); 129. return AVERROR_INVALIDDATA; libavcodec/bitstream.h:183:1: Parameter `n` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/bitstream.h:189:9: Call 187. 188. if (n > bc->bits_left) { 189. refill_32(bc); ^ 190. if (bc->bits_left < 32) 191. bc->bits_left = n; libavcodec/bitstream.h:60:1: <RHS trace> 58. } 59. 60. static inline void refill_32(BitstreamContext *bc) ^ 61. { 62. if (bc->ptr >= bc->buffer_end) libavcodec/bitstream.h:60:1: Parameter `bc->bits_left` 58. } 59. 60. static inline void refill_32(BitstreamContext *bc) ^ 61. { 62. if (bc->ptr >= bc->buffer_end) libavcodec/bitstream.h:68:5: Binary operation: (32 - [0, 64]):unsigned32 by call to `ff_tak_decode_frame_header` 66. bc->bits = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits; 67. #else 68. bc->bits = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left); ^ 69. #endif 70. bc->ptr += 4;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L68
d2a_code_trace_data_44435
int EVP_PKEY_asn1_add_alias(int to, int from) { EVP_PKEY_ASN1_METHOD *ameth; ameth = EVP_PKEY_asn1_new(from, ASN1_PKEY_ALIAS, NULL, NULL); if (ameth == NULL) return 0; ameth->pkey_base_id = to; if (!EVP_PKEY_asn1_add0(ameth)) { EVP_PKEY_asn1_free(ameth); return 0; } return 1; } crypto/asn1/ameth_lib.c:243: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_PKEY_asn1_new()` at line 238, column 13 is not reachable after line 243, column 9. Showing all 64 steps of the trace crypto/asn1/ameth_lib.c:235:1: start of procedure EVP_PKEY_asn1_add_alias() 233. } 234. 235. > int EVP_PKEY_asn1_add_alias(int to, int from) 236. { 237. EVP_PKEY_ASN1_METHOD *ameth; crypto/asn1/ameth_lib.c:238:5: 236. { 237. EVP_PKEY_ASN1_METHOD *ameth; 238. > ameth = EVP_PKEY_asn1_new(from, ASN1_PKEY_ALIAS, NULL, NULL); 239. if (ameth == NULL) 240. return 0; crypto/asn1/ameth_lib.c:274:1: start of procedure EVP_PKEY_asn1_new() 272. } 273. 274. > EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, 275. const char *pem_str, const char *info) 276. { crypto/asn1/ameth_lib.c:277:5: 275. const char *pem_str, const char *info) 276. { 277. > EVP_PKEY_ASN1_METHOD *ameth = OPENSSL_zalloc(sizeof(*ameth)); 278. 279. if (ameth == 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/asn1/ameth_lib.c:279:9: Taking false branch 277. EVP_PKEY_ASN1_METHOD *ameth = OPENSSL_zalloc(sizeof(*ameth)); 278. 279. if (ameth == NULL) ^ 280. return NULL; 281. crypto/asn1/ameth_lib.c:282:5: 280. return NULL; 281. 282. > ameth->pkey_id = id; 283. ameth->pkey_base_id = id; 284. ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; crypto/asn1/ameth_lib.c:283:5: 281. 282. ameth->pkey_id = id; 283. > ameth->pkey_base_id = id; 284. ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; 285. crypto/asn1/ameth_lib.c:284:5: 282. ameth->pkey_id = id; 283. ameth->pkey_base_id = id; 284. > ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; 285. 286. if (info) { crypto/asn1/ameth_lib.c:286:9: Taking false branch 284. ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; 285. 286. if (info) { ^ 287. ameth->info = OPENSSL_strdup(info); 288. if (!ameth->info) crypto/asn1/ameth_lib.c:292:9: Taking false branch 290. } 291. 292. if (pem_str) { ^ 293. ameth->pem_str = OPENSSL_strdup(pem_str); 294. if (!ameth->pem_str) crypto/asn1/ameth_lib.c:298:5: 296. } 297. 298. > return ameth; 299. 300. err: crypto/asn1/ameth_lib.c:304:1: return from a call to EVP_PKEY_asn1_new 302. return NULL; 303. 304. > } 305. 306. void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, crypto/asn1/ameth_lib.c:239:9: Taking false branch 237. EVP_PKEY_ASN1_METHOD *ameth; 238. ameth = EVP_PKEY_asn1_new(from, ASN1_PKEY_ALIAS, NULL, NULL); 239. if (ameth == NULL) ^ 240. return 0; 241. ameth->pkey_base_id = to; crypto/asn1/ameth_lib.c:241:5: 239. if (ameth == NULL) 240. return 0; 241. > ameth->pkey_base_id = to; 242. if (!EVP_PKEY_asn1_add0(ameth)) { 243. EVP_PKEY_asn1_free(ameth); crypto/asn1/ameth_lib.c:242:10: 240. return 0; 241. ameth->pkey_base_id = to; 242. > if (!EVP_PKEY_asn1_add0(ameth)) { 243. EVP_PKEY_asn1_free(ameth); 244. return 0; crypto/asn1/ameth_lib.c:222:1: start of procedure EVP_PKEY_asn1_add0() 220. } 221. 222. > int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth) 223. { 224. if (app_methods == NULL) { crypto/asn1/ameth_lib.c:224:9: Taking false branch 222. int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth) 223. { 224. if (app_methods == NULL) { ^ 225. app_methods = sk_EVP_PKEY_ASN1_METHOD_new(ameth_cmp); 226. if (app_methods == NULL) crypto/asn1/ameth_lib.c:229:10: 227. return 0; 228. } 229. > if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth)) 230. return 0; 231. sk_EVP_PKEY_ASN1_METHOD_sort(app_methods); crypto/include/internal/asn1_int.h:107:1: start of procedure sk_EVP_PKEY_ASN1_METHOD_push() 105. } /* EVP_PKEY_ASN1_METHOD */ ; 106. 107. > DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD) 108. 109. extern const EVP_PKEY_ASN1_METHOD cmac_asn1_meth; crypto/stack/stack.c:259:1: start of procedure 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:5: 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: start of procedure sk_insert() 165. } 166. 167. > int sk_insert(_STACK *st, void *data, int loc) 168. { 169. char **s; crypto/stack/stack.c:171:9: Taking false branch 169. char **s; 170. 171. if (st == NULL) ^ 172. return 0; 173. if (st->num_alloc <= st->num + 1) { crypto/stack/stack.c:173:9: Taking true branch 171. if (st == NULL) 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); crypto/stack/stack.c:174:9: 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: start of procedure 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:168:9: Taking true branch 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 167. { 168. if (str == NULL) ^ 169. return CRYPTO_malloc(num, file, line); 170. crypto/mem.c:169:9: 167. { 168. if (str == NULL) 169. > return CRYPTO_malloc(num, file, line); 170. 171. if (num == 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 true branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:125:9: 123. 124. if (num <= 0) 125. > return NULL; 126. 127. allow_customize = 0; 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:191:1: return from a call to CRYPTO_realloc 189. return realloc(str, num); 190. 191. > } 192. 193. void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num, crypto/stack/stack.c:176:13: Taking true branch 174. s = OPENSSL_realloc((char *)st->data, 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); 176. if (s == NULL) ^ 177. return (0); 178. st->data = s; crypto/stack/stack.c:177:13: 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); 176. if (s == NULL) 177. > return (0); 178. st->data = s; 179. st->num_alloc *= 2; crypto/stack/stack.c:191:1: return from a call to sk_insert 189. st->sorted = 0; 190. return (st->num); 191. > } 192. 193. void *sk_delete_ptr(_STACK *st, void *p) crypto/stack/stack.c:262:1: return from a call to sk_push 260. { 261. return (sk_insert(st, data, st->num)); 262. > } 263. 264. int sk_unshift(_STACK *st, void *data) crypto/include/internal/asn1_int.h:107:1: return from a call to sk_EVP_PKEY_ASN1_METHOD_push 105. } /* EVP_PKEY_ASN1_METHOD */ ; 106. 107. > DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD) 108. 109. extern const EVP_PKEY_ASN1_METHOD cmac_asn1_meth; crypto/asn1/ameth_lib.c:229:10: Taking true branch 227. return 0; 228. } 229. if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth)) ^ 230. return 0; 231. sk_EVP_PKEY_ASN1_METHOD_sort(app_methods); crypto/asn1/ameth_lib.c:230:9: 228. } 229. if (!sk_EVP_PKEY_ASN1_METHOD_push(app_methods, ameth)) 230. > return 0; 231. sk_EVP_PKEY_ASN1_METHOD_sort(app_methods); 232. return 1; crypto/asn1/ameth_lib.c:233:1: return from a call to EVP_PKEY_asn1_add0 231. sk_EVP_PKEY_ASN1_METHOD_sort(app_methods); 232. return 1; 233. > } 234. 235. int EVP_PKEY_asn1_add_alias(int to, int from) crypto/asn1/ameth_lib.c:242:10: Taking true branch 240. return 0; 241. ameth->pkey_base_id = to; 242. if (!EVP_PKEY_asn1_add0(ameth)) { ^ 243. EVP_PKEY_asn1_free(ameth); 244. return 0; crypto/asn1/ameth_lib.c:243:9: 241. ameth->pkey_base_id = to; 242. if (!EVP_PKEY_asn1_add0(ameth)) { 243. > EVP_PKEY_asn1_free(ameth); 244. return 0; 245. } crypto/asn1/ameth_lib.c:340:1: start of procedure EVP_PKEY_asn1_free() 338. } 339. 340. > void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) 341. { 342. if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) { crypto/asn1/ameth_lib.c:342:9: Taking true branch 340. void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) 341. { 342. if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) { ^ 343. OPENSSL_free(ameth->pem_str); 344. OPENSSL_free(ameth->info); crypto/asn1/ameth_lib.c:342:19: Taking false branch 340. void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) 341. { 342. if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) { ^ 343. OPENSSL_free(ameth->pem_str); 344. OPENSSL_free(ameth->info); crypto/asn1/ameth_lib.c:342:5: 340. void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth) 341. { 342. > if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC)) { 343. OPENSSL_free(ameth->pem_str); 344. OPENSSL_free(ameth->info); crypto/asn1/ameth_lib.c:347:1: return from a call to EVP_PKEY_asn1_free 345. OPENSSL_free(ameth); 346. } 347. > } 348. 349. void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/asn1/ameth_lib.c/#L243
d2a_code_trace_data_44436
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/dtlstest.c:99: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/dtlstest.c:69:10: Call 67. 68. /* BIO is freed by create_ssl_connection on error */ 69. if (!create_ssl_objects(sctx, cctx, &serverssl1, &clientssl1, NULL, ^ 70. c_to_s_fbio)) { 71. printf("Unable to create SSL objects\n"); test/ssltestlib.c:577:21: Call 575. 576. if (*sssl == NULL) 577. serverssl = SSL_new(serverctx); ^ 578. else 579. serverssl = *sssl; ssl/ssl_lib.c:520:1: Parameter `ctx->sessions->num_items` 518. } 519. 520. > SSL *SSL_new(SSL_CTX *ctx) 521. { 522. SSL *s; test/dtlstest.c:99:5: Call 97. testresult = 1; 98. end: 99. SSL_free(serverssl1); ^ 100. SSL_free(clientssl1); 101. SSL_CTX_free(sctx); ssl/ssl_lib.c:962:1: Parameter `s->initial_ctx->sessions->num_items` 960. } 961. 962. > void SSL_free(SSL *s) 963. { 964. int i; ssl/ssl_lib.c:992:9: Call 990. /* Make the next call work :-) */ 991. if (s->session != NULL) { 992. ssl_clear_bad_session(s); ^ 993. SSL_SESSION_free(s->session); 994. } ssl/ssl_sess.c:1008:1: Parameter `s->initial_ctx->sessions->num_items` 1006. } 1007. 1008. > int ssl_clear_bad_session(SSL *s) 1009. { 1010. if ((s->session != NULL) && ssl/ssl_sess.c:1013:9: Call 1011. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1012. !(SSL_in_init(s) || SSL_in_before(s))) { 1013. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1014. return (1); 1015. } else ssl/ssl_sess.c:697:1: Parameter `ctx->sessions->num_items` 695. } 696. 697. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 698. { 699. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:699:12: Call 697. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 698. { 699. return remove_session_lock(ctx, c, 1); ^ 700. } 701. ssl/ssl_sess.c:702:1: Parameter `ctx->sessions->num_items` 700. } 701. 702. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 703. { 704. SSL_SESSION *r; ssl/ssl_sess.c:712:17: Call 710. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 711. ret = 1; 712. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 713. SSL_SESSION_list_remove(ctx, c); 714. } ssl/ssl_locl.h:595:1: Parameter `lh->num_items` 593. }; 594. 595. > DEFINE_LHASH_OF(SSL_SESSION); 596. /* Needed in ssl_cert.c */ 597. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:595:1: Call 593. }; 594. 595. > DEFINE_LHASH_OF(SSL_SESSION); 596. /* Needed in ssl_cert.c */ 597. 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/1fb9fdc3027b27d8eb6a1e6a846435b070980770/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_44437
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); } crypto/x509/x_name.c:504: error: BUFFER_OVERRUN_L3 Offset added: [0, 200] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace crypto/x509/x_name.c:504:9: Call 502. l = 80 - 2 - obase; 503. 504. b = X509_NAME_oneline(name, NULL, 0); ^ 505. if (!b) 506. return 0; 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:56:9: Array access: Offset added: [0, 200] Size: [1, 2147483644] by call to `X509_NAME_oneline` 54. OPENSSL_free(b); 55. } 56. strncpy(buf, "NO X509_NAME", len); ^ 57. buf[len - 1] = '\0'; 58. return buf;
https://github.com/openssl/openssl/blob/cdb2a60347f988037d29adc7e4415e9c66c8a5a5/crypto/x509/x509_obj.c/#L56
d2a_code_trace_data_44438
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:841: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_recp`. Showing all 23 steps of the trace test/bntest.c:859:21: Call 857. } 858. 859. kronecker = BN_kronecker(a, b, ctx); ^ 860. if (kronecker < -1) 861. goto err; 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: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_kron.c:135:5: Call 133. } 134. end: 135. BN_CTX_end(ctx); ^ 136. if (err) 137. return -2; 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); test/bntest.c:841:14: Call 839. b->neg = 0; 840. 841. if (!BN_mod_exp_recp(r, a, t, b, ctx)) ^ 842. goto err; 843. b->neg = 1; crypto/bn/bn_exp.c:168:1: Parameter `ctx->stack.depth` 166. } 167. 168. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 169. const BIGNUM *m, BN_CTX *ctx) 170. { crypto/bn/bn_exp.c:196:5: Call 194. } 195. 196. BN_CTX_start(ctx); ^ 197. aa = BN_CTX_get(ctx); 198. val[0] = 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_exp.c:215:10: Call 213. } 214. 215. if (!BN_nnmod(val[0], a, m, ctx)) ^ 216. goto err; /* 1 */ 217. 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:193:5: Call 191. } 192. 193. BN_CTX_start(ctx); ^ 194. tmp = BN_CTX_get(ctx); 195. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:416:5: Call 414. if (no_branch) 415. bn_correct_top(res); 416. BN_CTX_end(ctx); ^ 417. return (1); 418. err: crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 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: <Offset 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:271:1: <Length 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->indexes` 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: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_recp` 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/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_44439
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, int32_t sb_samples[SBLIMIT]) { int32_t tmp[32]; register MPA_INT *synth_buf; register const MPA_INT *w, *w2, *p; int j, offset, v; OUT_INT *samples2; #if FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif dct32(tmp, sb_samples); offset = *synth_buf_offset; synth_buf = synth_buf_ptr + offset; for(j=0;j<32;j++) { v = tmp[j]; #if FRAC_BITS <= 15 v = av_clip_int16(v); #endif synth_buf[j] = v; } memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(sum, +=, w, p); p = synth_buf + 48; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); samples += incr; w++; for(j=1;j<16;j++) { sum2 = 0; p = synth_buf + 16 + j; SUM8P2(sum, +=, sum2, -=, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p); *samples = round_sample(&sum); samples += incr; sum += sum2; *samples2 = round_sample(&sum); samples2 -= incr; w++; w2--; } p = synth_buf + 32; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; offset = (offset - 32) & 511; *synth_buf_offset = offset; } libavcodec/mpc.c:60: error: Buffer Overrun L2 Offset: [288+min(0, `c->synth_buf_offset[*]`), 289+max(511, `c->synth_buf_offset[*]`)] (⇐ [32+min(0, `c->synth_buf_offset[*]`), 33+max(511, `c->synth_buf_offset[*]`)] + 256) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]` 49. * Process decoded Musepack data and produce PCM 50. */ 51. static void mpc_synth(MPCContext *c, int16_t *out) ^ 52. { 53. int dither_state = 0; libavcodec/mpc.c:60:13: Call 58. samples_ptr = samples + ch; 59. for(i = 0; i < SAMPLES_PER_BAND; i++) { 60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 61. mpa_window, &dither_state, 62. samples_ptr, 2, libavcodec/mpegaudiodec.c:858:1: <Length trace> 856. 32 samples. */ 857. /* XXX: optimize by avoiding ring buffer usage */ 858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 859. MPA_INT *window, int *dither_state, 860. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr` 856. 32 samples. */ 857. /* XXX: optimize by avoiding ring buffer usage */ 858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 859. MPA_INT *window, int *dither_state, 860. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:877:5: Assignment 875. 876. offset = *synth_buf_offset; 877. synth_buf = synth_buf_ptr + offset; ^ 878. 879. for(j=0;j<32;j++) { libavcodec/mpegaudiodec.c:922:5: Assignment 920. } 921. 922. p = synth_buf + 32; ^ 923. SUM8(sum, -=, w + 32, p); 924. *samples = round_sample(&sum); libavcodec/mpegaudiodec.c:923:5: Array access: Offset: [288+min(0, c->synth_buf_offset[*]), 289+max(511, c->synth_buf_offset[*])] (⇐ [32+min(0, c->synth_buf_offset[*]), 33+max(511, c->synth_buf_offset[*])] + 256) Size: 2 by call to `ff_mpa_synth_filter` 921. 922. p = synth_buf + 32; 923. SUM8(sum, -=, w + 32, p); ^ 924. *samples = round_sample(&sum); 925. *dither_state= sum;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L923
d2a_code_trace_data_44440
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ec_lib.c:1016: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set`. Showing all 43 steps of the trace crypto/ec/ec_lib.c:1016:10: Call 1014. goto err; 1015. 1016. if (!BN_MONT_CTX_set(group->mont_data, group->order, ctx)) { ^ 1017. BN_MONT_CTX_free(group->mont_data); 1018. group->mont_data = NULL; crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth` 261. } 262. 263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 264. { 265. int i, ret = 0; crypto/bn/bn_mont.c:271:5: Call 269. return 0; 270. 271. BN_CTX_start(ctx); ^ 272. if ((Ri = BN_CTX_get(ctx)) == NULL) 273. 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_mont.c:272:15: Call 270. 271. BN_CTX_start(ctx); 272. if ((Ri = BN_CTX_get(ctx)) == NULL) ^ 273. goto err; 274. R = &(mont->RR); /* grab RR as a temp */ 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:351:19: Call 349. if (BN_is_one(&tmod)) 350. BN_zero(Ri); 351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 352. goto err; 353. if (!BN_lshift(Ri, Ri, BN_BITS2)) crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth` 122. BN_CTX *ctx); 123. 124. > BIGNUM *BN_mod_inverse(BIGNUM *in, 125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 126. { crypto/bn/bn_gcd.c:129:10: Call 127. BIGNUM *rv; 128. int noinv; 129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 130. if (noinv) 131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth` 133. } 134. 135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 137. int *pnoinv) crypto/bn/bn_gcd.c:155:16: Call 153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 155. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 156. } 157. crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth` 456. * not contain branches that may leak sensitive information. 457. */ 458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 459. const BIGNUM *a, const BIGNUM *n, 460. BN_CTX *ctx) crypto/bn/bn_gcd.c:469:5: Call 467. bn_check_top(n); 468. 469. BN_CTX_start(ctx); ^ 470. A = BN_CTX_get(ctx); 471. 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_gcd.c:470:9: Call 468. 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); ^ 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:471:9: Call 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); ^ 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:472:9: Call 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); ^ 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:473:9: Call 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); ^ 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:474:9: Call 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); ^ 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:475:9: Call 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); ^ 476. T = BN_CTX_get(ctx); 477. if (T == 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_gcd.c:476:9: Call 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); ^ 477. if (T == NULL) 478. 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_gcd.c:504:18: Call 502. bn_init(&local_B); 503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 504. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 505. goto err; 506. /* Ensure local_B goes out of scope before any further use of B */ 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_MONT_CTX_set` 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_44441
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:2065: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`. Showing all 25 steps of the trace test/bntest.c:2065:10: Call 2063. BN_zero(zero); 2064. 2065. if (!TEST_true(BN_mod_exp(r, a, zero, BN_value_one(), NULL)) ^ 2066. || !TEST_BN_eq_zero(r) 2067. || !TEST_true(BN_mod_exp_mont(r, a, zero, BN_value_one(), crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth` 87. } 88. 89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 90. BN_CTX *ctx) 91. { crypto/bn/bn_exp.c:149:15: Call 147. #ifdef RECP_MUL_MOD 148. { 149. ret = BN_mod_exp_recp(r, a, p, m, ctx); ^ 150. } 151. #else crypto/bn/bn_exp.c:161:1: Parameter `ctx->stack.depth` 159. } 160. 161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 162. const BIGNUM *m, BN_CTX *ctx) 163. { crypto/bn/bn_exp.c:191:5: Call 189. } 190. 191. BN_CTX_start(ctx); ^ 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_exp.c:192:10: Call 190. 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); ^ 193. val[0] = BN_CTX_get(ctx); 194. if (val[0] == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:193:14: Call 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); ^ 194. if (val[0] == NULL) 195. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:210:10: Call 208. } 209. 210. if (!BN_nnmod(val[0], a, m, ctx)) ^ 211. goto err; /* 1 */ 212. if (BN_is_zero(val[0])) { crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_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` 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_44442
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/apps.c:156: error: BUFFER_OVERRUN_L3 Offset added: [0, 200] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace apps/apps.c:156:9: Call 154. char *p; 155. 156. p = X509_NAME_oneline(X509_get_subject_name(x), NULL, 0); ^ 157. BIO_puts(out, "subject="); 158. BIO_puts(out, p); 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:56:9: Array access: Offset added: [0, 200] Size: [1, 2147483644] by call to `X509_NAME_oneline` 54. OPENSSL_free(b); 55. } 56. strncpy(buf, "NO X509_NAME", len); ^ 57. buf[len - 1] = '\0'; 58. return buf;
https://github.com/openssl/openssl/blob/645c694d85c8f48c74e7db8730ead874656c781e/crypto/x509/x509_obj.c/#L56
d2a_code_trace_data_44443
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/magicyuv.c:381: error: Integer Overflow L2 ([1, +oo] - 4):unsigned32 by call to `bitstream_read`. libavcodec/magicyuv.c:381:17: Call 379. j = i = 0; 380. while (bitstream_bits_left(&bc) >= 8) { 381. int b = bitstream_read(&bc, 4); ^ 382. int x = bitstream_read(&bc, 4); 383. int l = bitstream_read(&bc, b) + 1; libavcodec/bitstream.h:183:1: Parameter `n` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/bitstream.h:194:12: Call 192. } 193. 194. return get_val(bc, n); ^ 195. } 196. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([1, +oo] - 4):unsigned32 by call to `bitstream_read` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
d2a_code_trace_data_44444
PUT_HEVC_QPEL_HV(3, 1) libavcodec/hevcdsp_template.c:983: error: Buffer Overrun L3 Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h3v1_9`. libavcodec/hevcdsp_template.c:983:1: Call 981. QPEL(12) 982. QPEL(8) 983. QPEL(4) ^ 984. 985. static inline void FUNC(put_hevc_epel_pixels)(int16_t *dst, ptrdiff_t dststride, libavcodec/hevcdsp_template.c:907:1: <Offset trace> 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: Assignment 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: <Length trace> 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: Array declaration 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: Assignment 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: Array access: Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h3v1_9` 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3)
https://github.com/libav/libav/blob/688417399c69aadd4c287bdb0dec82ef8799011c/libavcodec/hevcdsp_template.c/#L907
d2a_code_trace_data_44445
u_char * ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) { u_char *p, zero, *last; int d; float f, scale; size_t len, slen; int64_t i64; uint64_t ui64; ngx_msec_t ms; ngx_uint_t width, sign, hex, max_width, frac_width, i; ngx_str_t *v; ngx_variable_value_t *vv; if (max == 0) { return buf; } last = buf + max; while (*fmt && buf < last) { if (*fmt == '%') { i64 = 0; ui64 = 0; zero = (u_char) ((*++fmt == '0') ? '0' : ' '); width = 0; sign = 1; hex = 0; max_width = 0; frac_width = 0; slen = (size_t) -1; while (*fmt >= '0' && *fmt <= '9') { width = width * 10 + *fmt++ - '0'; } for ( ;; ) { switch (*fmt) { case 'u': sign = 0; fmt++; continue; case 'm': max_width = 1; fmt++; continue; case 'X': hex = 2; sign = 0; fmt++; continue; case 'x': hex = 1; sign = 0; fmt++; continue; case '.': fmt++; while (*fmt >= '0' && *fmt <= '9') { frac_width = frac_width * 10 + *fmt++ - '0'; } break; case '*': slen = va_arg(args, size_t); fmt++; continue; default: break; } break; } switch (*fmt) { case 'V': v = va_arg(args, ngx_str_t *); len = v->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, v->data, len); fmt++; continue; case 'v': vv = va_arg(args, ngx_variable_value_t *); len = vv->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, vv->data, len); fmt++; continue; case 's': p = va_arg(args, u_char *); if (slen == (size_t) -1) { while (*p && buf < last) { *buf++ = *p++; } } else { len = (buf + slen < last) ? slen : (size_t) (last - buf); buf = ngx_cpymem(buf, p, len); } fmt++; continue; case 'O': i64 = (int64_t) va_arg(args, off_t); sign = 1; break; case 'P': i64 = (int64_t) va_arg(args, ngx_pid_t); sign = 1; break; case 'T': i64 = (int64_t) va_arg(args, time_t); sign = 1; break; case 'M': ms = (ngx_msec_t) va_arg(args, ngx_msec_t); if ((ngx_msec_int_t) ms == -1) { sign = 1; i64 = -1; } else { sign = 0; ui64 = (uint64_t) ms; } break; case 'z': if (sign) { i64 = (int64_t) va_arg(args, ssize_t); } else { ui64 = (uint64_t) va_arg(args, size_t); } break; case 'i': if (sign) { i64 = (int64_t) va_arg(args, ngx_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_uint_t); } if (max_width) { width = NGX_INT_T_LEN; } break; case 'd': if (sign) { i64 = (int64_t) va_arg(args, int); } else { ui64 = (uint64_t) va_arg(args, u_int); } break; case 'l': if (sign) { i64 = (int64_t) va_arg(args, long); } else { ui64 = (uint64_t) va_arg(args, u_long); } break; case 'D': if (sign) { i64 = (int64_t) va_arg(args, int32_t); } else { ui64 = (uint64_t) va_arg(args, uint32_t); } break; case 'L': if (sign) { i64 = va_arg(args, int64_t); } else { ui64 = va_arg(args, uint64_t); } break; case 'A': if (sign) { i64 = (int64_t) va_arg(args, ngx_atomic_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t); } if (max_width) { width = NGX_ATOMIC_T_LEN; } break; case 'f': f = (float) va_arg(args, double); if (f < 0) { *buf++ = '-'; f = -f; } ui64 = (int64_t) f; buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width); if (frac_width) { if (buf < last) { *buf++ = '.'; } scale = 1.0; for (i = 0; i < frac_width; i++) { scale *= 10.0; } ui64 = (uint64_t) ((f - (int64_t) ui64) * scale); buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width); } fmt++; continue; #if !(NGX_WIN32) case 'r': i64 = (int64_t) va_arg(args, rlim_t); sign = 1; break; #endif case 'p': ui64 = (uintptr_t) va_arg(args, void *); hex = 2; sign = 0; zero = '0'; width = NGX_PTR_SIZE * 2; break; case 'c': d = va_arg(args, int); *buf++ = (u_char) (d & 0xff); fmt++; continue; case 'Z': *buf++ = '\0'; fmt++; continue; case 'N': #if (NGX_WIN32) *buf++ = CR; #endif *buf++ = LF; fmt++; continue; case '%': *buf++ = '%'; fmt++; continue; default: *buf++ = *fmt++; continue; } if (sign) { if (i64 < 0) { *buf++ = '-'; ui64 = (uint64_t) -i64; } else { ui64 = (uint64_t) i64; } } buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width); fmt++; } else { *buf++ = *fmt++; } } return buf; } src/http/modules/ngx_http_proxy_module.c:1210: error: Buffer Overrun L2 Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`. src/http/modules/ngx_http_proxy_module.c:1190:10: Unknown value from: ngx_http_proxy_parse_status_line 1188. } 1189. 1190. rc = ngx_http_proxy_parse_status_line(r, ctx); ^ 1191. 1192. if (rc == NGX_AGAIN) { src/http/modules/ngx_http_proxy_module.c:1210:9: Call 1208. #endif 1209. 1210. ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ^ 1211. "upstream sent no valid HTTP/1.0 header"); 1212. src/core/ngx_log.c:67:1: Array declaration 65. #if (NGX_HAVE_VARIADIC_MACROS) 66. 67. void ^ 68. ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, 69. const char *fmt, ...) src/core/ngx_log.c:88:5: Assignment 86. } 87. 88. last = errstr + NGX_MAX_ERROR_STR; ^ 89. 90. ngx_memcpy(errstr, ngx_cached_err_log_time.data, src/core/ngx_log.c:133:13: Call 131. ? " (%d: " : " (%Xd: ", err); 132. #else 133. p = ngx_snprintf(p, last - p, " (%d: ", err); ^ 134. #endif 135. src/core/ngx_string.c:109:1: Parameter `max` 107. 108. 109. u_char * ngx_cdecl ^ 110. ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...) 111. { src/core/ngx_string.c:116:9: Call 114. 115. va_start(args, fmt); 116. p = ngx_vsnprintf(buf, max, fmt, args); ^ 117. va_end(args); 118. src/core/ngx_string.c:123:1: <Length trace> 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:123:1: Parameter `*buf` 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:244:25: Array access: Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core` 242. if (slen == (size_t) -1) { 243. while (*p && buf < last) { 244. *buf++ = *p++; ^ 245. } 246.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L244
d2a_code_trace_data_44446
static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength) { BIGNUM *bn = NULL; static RSA *rsa_tmp = NULL; if (!rsa_tmp && ((bn = BN_new()) == NULL)) BIO_printf(bio_err, "Allocation error in generating RSA key\n"); if (!rsa_tmp && bn) { if (!s_quiet) { BIO_printf(bio_err, "Generating temp (%d bit) RSA key...", keylength); (void)BIO_flush(bio_err); } if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) || !RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) { RSA_free(rsa_tmp); rsa_tmp = NULL; } if (!s_quiet) { BIO_printf(bio_err, "\n"); (void)BIO_flush(bio_err); } BN_free(bn); } return (rsa_tmp); } apps/s_server.c:3137: error: NULL_DEREFERENCE pointer `rsa_tmp` last assigned on line 3135 could be null and is dereferenced by call to `RSA_free()` at line 3137, column 13. Showing all 26 steps of the trace apps/s_server.c:3122:1: start of procedure tmp_rsa_cb() 3120. 3121. #ifndef OPENSSL_NO_RSA 3122. > static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength) 3123. { 3124. BIGNUM *bn = NULL; apps/s_server.c:3124:5: 3122. static RSA *tmp_rsa_cb(SSL *s, int is_export, int keylength) 3123. { 3124. > BIGNUM *bn = NULL; 3125. static RSA *rsa_tmp = NULL; 3126. apps/s_server.c:3125:5: 3123. { 3124. BIGNUM *bn = NULL; 3125. > static RSA *rsa_tmp = NULL; 3126. 3127. if (!rsa_tmp && ((bn = BN_new()) == NULL)) apps/s_server.c:3127:10: Taking true branch 3125. static RSA *rsa_tmp = NULL; 3126. 3127. if (!rsa_tmp && ((bn = BN_new()) == NULL)) ^ 3128. BIO_printf(bio_err, "Allocation error in generating RSA key\n"); 3129. if (!rsa_tmp && bn) { apps/s_server.c:3127:22: Taking false branch 3125. static RSA *rsa_tmp = NULL; 3126. 3127. if (!rsa_tmp && ((bn = BN_new()) == NULL)) ^ 3128. BIO_printf(bio_err, "Allocation error in generating RSA key\n"); 3129. if (!rsa_tmp && bn) { apps/s_server.c:3129:10: Taking true branch 3127. if (!rsa_tmp && ((bn = BN_new()) == NULL)) 3128. BIO_printf(bio_err, "Allocation error in generating RSA key\n"); 3129. if (!rsa_tmp && bn) { ^ 3130. if (!s_quiet) { 3131. BIO_printf(bio_err, "Generating temp (%d bit) RSA key...", apps/s_server.c:3129:21: Taking true branch 3127. if (!rsa_tmp && ((bn = BN_new()) == NULL)) 3128. BIO_printf(bio_err, "Allocation error in generating RSA key\n"); 3129. if (!rsa_tmp && bn) { ^ 3130. if (!s_quiet) { 3131. BIO_printf(bio_err, "Generating temp (%d bit) RSA key...", apps/s_server.c:3130:14: Taking false branch 3128. BIO_printf(bio_err, "Allocation error in generating RSA key\n"); 3129. if (!rsa_tmp && bn) { 3130. if (!s_quiet) { ^ 3131. BIO_printf(bio_err, "Generating temp (%d bit) RSA key...", 3132. keylength); apps/s_server.c:3135:14: 3133. (void)BIO_flush(bio_err); 3134. } 3135. > if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) || 3136. !RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) { 3137. RSA_free(rsa_tmp); crypto/bn/bn_lib.c:527:1: start of procedure BN_set_word() 525. } 526. 527. > int BN_set_word(BIGNUM *a, BN_ULONG w) 528. { 529. bn_check_top(a); crypto/bn/bn_lib.c:530:9: Condition is true 528. { 529. bn_check_top(a); 530. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 531. return (0); 532. a->neg = 0; crypto/bn/bn_lib.c:530:9: Taking false branch 528. { 529. bn_check_top(a); 530. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 531. return (0); 532. a->neg = 0; crypto/bn/bn_lib.c:532:5: 530. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 531. return (0); 532. > a->neg = 0; 533. a->d[0] = w; 534. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:533:5: 531. return (0); 532. a->neg = 0; 533. > a->d[0] = w; 534. a->top = (w ? 1 : 0); 535. bn_check_top(a); crypto/bn/bn_lib.c:534:15: Condition is true 532. a->neg = 0; 533. a->d[0] = w; 534. a->top = (w ? 1 : 0); ^ 535. bn_check_top(a); 536. return (1); crypto/bn/bn_lib.c:534:5: 532. a->neg = 0; 533. a->d[0] = w; 534. > a->top = (w ? 1 : 0); 535. bn_check_top(a); 536. return (1); crypto/bn/bn_lib.c:536:5: 534. a->top = (w ? 1 : 0); 535. bn_check_top(a); 536. > return (1); 537. } 538. crypto/bn/bn_lib.c:537:1: return from a call to BN_set_word 535. bn_check_top(a); 536. return (1); 537. > } 538. 539. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) apps/s_server.c:3135:14: Taking false branch 3133. (void)BIO_flush(bio_err); 3134. } 3135. if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) || ^ 3136. !RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) { 3137. RSA_free(rsa_tmp); apps/s_server.c:3135:42: 3133. (void)BIO_flush(bio_err); 3134. } 3135. > if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) || 3136. !RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) { 3137. RSA_free(rsa_tmp); crypto/rsa/rsa_lib.c:72:1: start of procedure RSA_new() 70. static const RSA_METHOD *default_RSA_meth = NULL; 71. 72. > RSA *RSA_new(void) 73. { 74. RSA *r = RSA_new_method(NULL); crypto/rsa/rsa_lib.c:74:5: Skipping RSA_new_method(): empty list of specs 72. RSA *RSA_new(void) 73. { 74. RSA *r = RSA_new_method(NULL); ^ 75. 76. return r; crypto/rsa/rsa_lib.c:76:5: 74. RSA *r = RSA_new_method(NULL); 75. 76. > return r; 77. } 78. crypto/rsa/rsa_lib.c:77:1: return from a call to RSA_new 75. 76. return r; 77. > } 78. 79. void RSA_set_default_method(const RSA_METHOD *meth) apps/s_server.c:3135:42: Taking true branch 3133. (void)BIO_flush(bio_err); 3134. } 3135. if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) || ^ 3136. !RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) { 3137. RSA_free(rsa_tmp); apps/s_server.c:3137:13: 3135. if (!BN_set_word(bn, RSA_F4) || ((rsa_tmp = RSA_new()) == NULL) || 3136. !RSA_generate_key_ex(rsa_tmp, keylength, bn, NULL)) { 3137. > RSA_free(rsa_tmp); 3138. rsa_tmp = NULL; 3139. }
https://github.com/openssl/openssl/blob/4cfa6204e8740a3e89b96fac3f1ac49d137e9dc9/apps/s_server.c/#L3137
d2a_code_trace_data_44447
static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size) { GetBitContext gb; int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0; int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0; int dts_flag = -1, cts_flag = -1; int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE; init_get_bits(&gb, buf, buf_size * 8); if (sl->use_au_start) au_start_flag = get_bits1(&gb); if (sl->use_au_end) au_end_flag = get_bits1(&gb); if (!sl->use_au_start && !sl->use_au_end) au_start_flag = au_end_flag = 1; if (sl->ocr_len > 0) ocr_flag = get_bits1(&gb); if (sl->use_idle) idle_flag = get_bits1(&gb); if (sl->use_padding) padding_flag = get_bits1(&gb); if (padding_flag) padding_bits = get_bits(&gb, 3); if (!idle_flag && (!padding_flag || padding_bits != 0)) { if (sl->packet_seq_num_len) skip_bits_long(&gb, sl->packet_seq_num_len); if (sl->degr_prior_len) if (get_bits1(&gb)) skip_bits(&gb, sl->degr_prior_len); if (ocr_flag) skip_bits_long(&gb, sl->ocr_len); if (au_start_flag) { if (sl->use_rand_acc_pt) get_bits1(&gb); if (sl->au_seq_num_len > 0) skip_bits_long(&gb, sl->au_seq_num_len); if (sl->use_timestamps) { dts_flag = get_bits1(&gb); cts_flag = get_bits1(&gb); } } if (sl->inst_bitrate_len) inst_bitrate_flag = get_bits1(&gb); if (dts_flag == 1) dts = get_bits64(&gb, sl->timestamp_len); if (cts_flag == 1) cts = get_bits64(&gb, sl->timestamp_len); if (sl->au_len > 0) skip_bits_long(&gb, sl->au_len); if (inst_bitrate_flag) skip_bits_long(&gb, sl->inst_bitrate_len); } if (dts != AV_NOPTS_VALUE) pes->dts = dts; if (cts != AV_NOPTS_VALUE) pes->pts = cts; if (sl->timestamp_len && sl->timestamp_res) avpriv_set_pts_info(pes->st, sl->timestamp_len, 1, sl->timestamp_res); return (get_bits_count(&gb) + 7) >> 3; } libavformat/mpegts.c:745: error: Null Dereference pointer `&gb->buffer` last assigned on line 736 could be null and is dereferenced by call to `get_bits1()` at line 745, column 20. libavformat/mpegts.c:728:1: start of procedure read_sl_header() 726. } 727. 728. static int read_sl_header(PESContext *pes, SLConfigDescr *sl, ^ 729. const uint8_t *buf, int buf_size) 730. { libavformat/mpegts.c:732:5: 730. { 731. GetBitContext gb; 732. int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0; ^ 733. int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0; 734. int dts_flag = -1, cts_flag = -1; libavformat/mpegts.c:733:5: 731. GetBitContext gb; 732. int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0; 733. int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0; ^ 734. int dts_flag = -1, cts_flag = -1; 735. int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE; libavformat/mpegts.c:734:5: 732. int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0; 733. int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0; 734. int dts_flag = -1, cts_flag = -1; ^ 735. int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE; 736. init_get_bits(&gb, buf, buf_size * 8); libavformat/mpegts.c:735:5: 733. int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0; 734. int dts_flag = -1, cts_flag = -1; 735. int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE; ^ 736. init_get_bits(&gb, buf, buf_size * 8); 737. libavformat/mpegts.c:736:5: 734. int dts_flag = -1, cts_flag = -1; 735. int64_t dts = AV_NOPTS_VALUE, cts = AV_NOPTS_VALUE; 736. init_get_bits(&gb, buf, buf_size * 8); ^ 737. 738. if (sl->use_au_start) 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. /** libavformat/mpegts.c:738:9: Taking false branch 736. init_get_bits(&gb, buf, buf_size * 8); 737. 738. if (sl->use_au_start) ^ 739. au_start_flag = get_bits1(&gb); 740. if (sl->use_au_end) libavformat/mpegts.c:740:9: Taking false branch 738. if (sl->use_au_start) 739. au_start_flag = get_bits1(&gb); 740. if (sl->use_au_end) ^ 741. au_end_flag = get_bits1(&gb); 742. if (!sl->use_au_start && !sl->use_au_end) libavformat/mpegts.c:742:10: Taking true branch 740. if (sl->use_au_end) 741. au_end_flag = get_bits1(&gb); 742. if (!sl->use_au_start && !sl->use_au_end) ^ 743. au_start_flag = au_end_flag = 1; 744. if (sl->ocr_len > 0) libavformat/mpegts.c:742:31: Taking true branch 740. if (sl->use_au_end) 741. au_end_flag = get_bits1(&gb); 742. if (!sl->use_au_start && !sl->use_au_end) ^ 743. au_start_flag = au_end_flag = 1; 744. if (sl->ocr_len > 0) libavformat/mpegts.c:743:9: 741. au_end_flag = get_bits1(&gb); 742. if (!sl->use_au_start && !sl->use_au_end) 743. au_start_flag = au_end_flag = 1; ^ 744. if (sl->ocr_len > 0) 745. ocr_flag = get_bits1(&gb); libavformat/mpegts.c:744:9: Taking true branch 742. if (!sl->use_au_start && !sl->use_au_end) 743. au_start_flag = au_end_flag = 1; 744. if (sl->ocr_len > 0) ^ 745. ocr_flag = get_bits1(&gb); 746. if (sl->use_idle) libavformat/mpegts.c:745:9: 743. au_start_flag = au_end_flag = 1; 744. if (sl->ocr_len > 0) 745. ocr_flag = get_bits1(&gb); ^ 746. if (sl->use_idle) 747. idle_flag = get_bits1(&gb); 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/libavformat/mpegts.c/#L745
d2a_code_trace_data_44448
static av_cold void huff_build_tree(IdcinContext *s, int prev) { hnode_t *node, *hnodes; int num_hnodes, i; num_hnodes = HUF_TOKENS; hnodes = s->huff_nodes[prev]; for(i = 0; i < HUF_TOKENS * 2; i++) hnodes[i].used = 0; while (1) { node = &hnodes[num_hnodes]; node->children[0] = huff_smallest_node(hnodes, num_hnodes); if(node->children[0] == -1) break; node->children[1] = huff_smallest_node(hnodes, num_hnodes); if(node->children[1] == -1) break; node->count = hnodes[node->children[0]].count + hnodes[node->children[1]].count; num_hnodes++; } s->num_huff_nodes[prev] = num_hnodes - 1; } libavcodec/idcinvideo.c:166: error: Buffer Overrun L1 Offset: [256, +oo] (⇐ [0, 255] + [256, +oo]) Size: 256 by call to `huff_build_tree`. libavcodec/idcinvideo.c:163:10: Assignment 161. /* build the 256 Huffman decode trees */ 162. histograms = (unsigned char *)s->avctx->extradata; 163. for (i = 0; i < 256; i++) { ^ 164. for(j = 0; j < HUF_TOKENS; j++) 165. s->huff_nodes[i][j].count = histograms[histogram_index++]; libavcodec/idcinvideo.c:166:9: Call 164. for(j = 0; j < HUF_TOKENS; j++) 165. s->huff_nodes[i][j].count = histograms[histogram_index++]; 166. huff_build_tree(s, i); ^ 167. } 168. libavcodec/idcinvideo.c:120:5: <Offset trace> 118. int num_hnodes, i; 119. 120. num_hnodes = HUF_TOKENS; ^ 121. hnodes = s->huff_nodes[prev]; 122. for(i = 0; i < HUF_TOKENS * 2; i++) libavcodec/idcinvideo.c:120:5: Assignment 118. int num_hnodes, i; 119. 120. num_hnodes = HUF_TOKENS; ^ 121. hnodes = s->huff_nodes[prev]; 122. for(i = 0; i < HUF_TOKENS * 2; i++) libavcodec/idcinvideo.c:116:1: <Length trace> 114. * That is: huff_nodes[prev][num_huff_nodes[prev]] is the root node. 115. */ 116. static av_cold void huff_build_tree(IdcinContext *s, int prev) { ^ 117. hnode_t *node, *hnodes; 118. int num_hnodes, i; libavcodec/idcinvideo.c:116:1: Parameter `prev` 114. * That is: huff_nodes[prev][num_huff_nodes[prev]] is the root node. 115. */ 116. static av_cold void huff_build_tree(IdcinContext *s, int prev) { ^ 117. hnode_t *node, *hnodes; 118. int num_hnodes, i; libavcodec/idcinvideo.c:121:5: Assignment 119. 120. num_hnodes = HUF_TOKENS; 121. hnodes = s->huff_nodes[prev]; ^ 122. for(i = 0; i < HUF_TOKENS * 2; i++) 123. hnodes[i].used = 0; libavcodec/idcinvideo.c:126:9: Array access: Offset: [256, +oo] (⇐ [0, 255] + [256, +oo]) Size: 256 by call to `huff_build_tree` 124. 125. while (1) { 126. node = &hnodes[num_hnodes]; /* next free node */ ^ 127. 128. /* pick two lowest counts */
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/idcinvideo.c/#L126
d2a_code_trace_data_44449
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/rsa/rsa_ossl.c:810: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, +oo] by call to `BN_mul`. Showing all 19 steps of the trace 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:219:5: Call 217. } 218. /* OK, make sure the returned bignum is "zero" */ 219. BN_zero(ret); ^ 220. /* clear BN_FLG_CONSTTIME if leaked from previous frames */ 221. ret->flags &= (~BN_FLG_CONSTTIME); crypto/bn/bn_lib.c:359:1: Parameter `*a->d` 357. } 358. 359. > int BN_set_word(BIGNUM *a, BN_ULONG w) 360. { 361. bn_check_top(a); crypto/bn/bn_lib.c:362:9: Call 360. { 361. bn_check_top(a); 362. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 363. return 0; 364. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `*a->d` 658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 659. 660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 661. { 662. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/rsa/rsa_ossl.c:810:10: Call 808. goto err; 809. 810. if (!BN_mul(r1, r0, rsa->iqmp, ctx)) ^ 811. goto err; 812. crypto/bn/bn_mul.c:497:1: Parameter `*r->d` 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:507:1: Parameter `*r->d` 505. } 506. 507. > int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 508. { 509. int ret = 0; crypto/bn/bn_mul.c:555:17: Call 553. # endif 554. if (al == 8) { 555. if (bn_wexpand(rr, 16) == NULL) ^ 556. goto err; 557. rr->top = 16; crypto/bn/bn_lib.c:960:1: Parameter `*a->d` 958. } 959. 960. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 961. { 962. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:962:37: Call 960. BIGNUM *bn_wexpand(BIGNUM *a, int words) 961. { 962. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 963. } 964. crypto/bn/bn_lib.c:245:1: Parameter `*b->d` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `*b->d` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, +oo] by call to `BN_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/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_44450
static int createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr) { unsigned char *sect_buff = NULL; unsigned char *new_buff = NULL; static uint32 prev_sectsize = 0; sect_buff = *sect_buff_ptr; if (!sect_buff) { sect_buff = (unsigned char *)_TIFFmalloc(sectsize); *sect_buff_ptr = sect_buff; _TIFFmemset(sect_buff, 0, sectsize); } else { if (prev_sectsize < sectsize) { new_buff = _TIFFrealloc(sect_buff, sectsize); if (!new_buff) { free (sect_buff); sect_buff = (unsigned char *)_TIFFmalloc(sectsize); } else sect_buff = new_buff; _TIFFmemset(sect_buff, 0, sectsize); } } if (!sect_buff) { TIFFError("createImageSection", "Unable to allocate/reallocate section buffer"); return (-1); } prev_sectsize = sectsize; *sect_buff_ptr = sect_buff; return (0); } tools/tiffcrop.c:7350: error: Null Dereference pointer `sect_buff` last assigned on line 7345 could be null and is dereferenced by call to `_TIFFmemset()` at line 7350, column 7. tools/tiffcrop.c:7322:1: start of procedure createImageSection() 7320. 7321. /* Create a buffer to write one section at a time */ 7322. static int ^ 7323. createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr) 7324. { tools/tiffcrop.c:7325:3: 7323. createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr) 7324. { 7325. unsigned char *sect_buff = NULL; ^ 7326. unsigned char *new_buff = NULL; 7327. static uint32 prev_sectsize = 0; tools/tiffcrop.c:7326:3: 7324. { 7325. unsigned char *sect_buff = NULL; 7326. unsigned char *new_buff = NULL; ^ 7327. static uint32 prev_sectsize = 0; 7328. tools/tiffcrop.c:7327:3: 7325. unsigned char *sect_buff = NULL; 7326. unsigned char *new_buff = NULL; 7327. static uint32 prev_sectsize = 0; ^ 7328. 7329. sect_buff = *sect_buff_ptr; tools/tiffcrop.c:7329:3: 7327. static uint32 prev_sectsize = 0; 7328. 7329. sect_buff = *sect_buff_ptr; ^ 7330. 7331. if (!sect_buff) tools/tiffcrop.c:7331:8: Taking false branch 7329. sect_buff = *sect_buff_ptr; 7330. 7331. if (!sect_buff) ^ 7332. { 7333. sect_buff = (unsigned char *)_TIFFmalloc(sectsize); tools/tiffcrop.c:7339:9: Taking true branch 7337. else 7338. { 7339. if (prev_sectsize < sectsize) ^ 7340. { 7341. new_buff = _TIFFrealloc(sect_buff, sectsize); tools/tiffcrop.c:7341:7: 7339. if (prev_sectsize < sectsize) 7340. { 7341. new_buff = _TIFFrealloc(sect_buff, sectsize); ^ 7342. if (!new_buff) 7343. { libtiff/tif_unix.c:333:1: start of procedure _TIFFrealloc() 331. } 332. 333. void* ^ 334. _TIFFrealloc(void* p, tmsize_t s) 335. { libtiff/tif_unix.c:336:2: 334. _TIFFrealloc(void* p, tmsize_t s) 335. { 336. return (realloc(p, (size_t) s)); ^ 337. } 338. libtiff/tif_unix.c:337:1: return from a call to _TIFFrealloc 335. { 336. return (realloc(p, (size_t) s)); 337. } ^ 338. 339. void tools/tiffcrop.c:7342:12: Taking true branch 7340. { 7341. new_buff = _TIFFrealloc(sect_buff, sectsize); 7342. if (!new_buff) ^ 7343. { 7344. free (sect_buff); tools/tiffcrop.c:7344:2: 7342. if (!new_buff) 7343. { 7344. free (sect_buff); ^ 7345. sect_buff = (unsigned char *)_TIFFmalloc(sectsize); 7346. } tools/tiffcrop.c:7345:9: 7343. { 7344. free (sect_buff); 7345. sect_buff = (unsigned char *)_TIFFmalloc(sectsize); ^ 7346. } 7347. else libtiff/tif_unix.c:310:1: start of procedure _TIFFmalloc() 308. #endif 309. 310. void* ^ 311. _TIFFmalloc(tmsize_t s) 312. { libtiff/tif_unix.c:313:13: Taking false branch 311. _TIFFmalloc(tmsize_t s) 312. { 313. if (s == 0) ^ 314. return ((void *) NULL); 315. libtiff/tif_unix.c:316:2: 314. return ((void *) NULL); 315. 316. return (malloc((size_t) s)); ^ 317. } 318. libtiff/tif_unix.c:317:1: return from a call to _TIFFmalloc 315. 316. return (malloc((size_t) s)); 317. } ^ 318. 319. void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz) tools/tiffcrop.c:7350:7: 7348. sect_buff = new_buff; 7349. 7350. _TIFFmemset(sect_buff, 0, sectsize); ^ 7351. } 7352. } libtiff/tif_unix.c:339:1: start of procedure _TIFFmemset() 337. } 338. 339. void ^ 340. _TIFFmemset(void* p, int v, tmsize_t c) 341. { libtiff/tif_unix.c:342:2: 340. _TIFFmemset(void* p, int v, tmsize_t c) 341. { 342. memset(p, v, (size_t) c); ^ 343. } 344. libtiff/tif_unix.c:343:1: return from a call to _TIFFmemset 341. { 342. memset(p, v, (size_t) c); 343. } ^ 344. 345. void
https://gitlab.com/libtiff/libtiff/blob/6dac309a9701d15ac52d895d566ddae2ed49db9b/tools/tiffcrop.c/#L7350
d2a_code_trace_data_44451
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:1177: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1177:13: 1175. (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) 1176. if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line 1177. CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, ^ 1178. (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) 1179. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1177
d2a_code_trace_data_44452
static void init_uni_dc_tab(void) { int level, uni_code, uni_len; for(level=-256; level<256; level++){ int size, v, l; size = 0; v = abs(level); while (v) { v >>= 1; size++; } if (level < 0) l= (-level) ^ ((1 << size) - 1); else l= level; uni_code= DCtab_lum[size][0]; uni_len = DCtab_lum[size][1]; if (size > 0) { uni_code<<=size; uni_code|=l; uni_len+=size; if (size > 8){ uni_code<<=1; uni_code|=1; uni_len++; } } uni_DCtab_lum_bits[level+256]= uni_code; uni_DCtab_lum_len [level+256]= uni_len; uni_code= DCtab_chrom[size][0]; uni_len = DCtab_chrom[size][1]; if (size > 0) { uni_code<<=size; uni_code|=l; uni_len+=size; if (size > 8){ uni_code<<=1; uni_code|=1; uni_len++; } } uni_DCtab_chrom_bits[level+256]= uni_code; uni_DCtab_chrom_len [level+256]= uni_len; } } libavcodec/h263.c:1887: error: Buffer Overrun L2 Offset: [0, 511] Size: 2. libavcodec/h263.c:1860:9: <Offset trace> 1858. int level, uni_code, uni_len; 1859. 1860. for(level=-256; level<256; level++){ ^ 1861. int size, v, l; 1862. /* find number of bits */ libavcodec/h263.c:1860:9: Assignment 1858. int level, uni_code, uni_len; 1859. 1860. for(level=-256; level<256; level++){ ^ 1861. int size, v, l; 1862. /* find number of bits */ libavcodec/mpeg4data.h:72:1: <Length trace> 70. 71. /* dc encoding for mpeg4 */ 72. const uint8_t DCtab_lum[13][2] = ^ 73. { 74. {3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, libavcodec/mpeg4data.h:72:1: Array declaration 70. 71. /* dc encoding for mpeg4 */ 72. const uint8_t DCtab_lum[13][2] = ^ 73. { 74. {3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, libavcodec/h263.c:1876:9: Assignment 1874. 1875. /* luminance */ 1876. uni_code= DCtab_lum[size][0]; ^ 1877. uni_len = DCtab_lum[size][1]; 1878. libavcodec/h263.c:1887:9: Assignment 1885. } 1886. } 1887. uni_DCtab_lum_bits[level+256]= uni_code; ^ 1888. uni_DCtab_lum_len [level+256]= uni_len; 1889. libavcodec/h263.c:1887:9: Array access: Offset: [0, 511] Size: 2 1885. } 1886. } 1887. uni_DCtab_lum_bits[level+256]= uni_code; ^ 1888. uni_DCtab_lum_len [level+256]= uni_len; 1889.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h263.c/#L1887
d2a_code_trace_data_44453
int RAND_status(void) { const RAND_METHOD *meth = RAND_get_rand_method(); if (meth->status != NULL) return meth->status(); return 0; } crypto/rand/rand_lib.c:851: error: NULL_DEREFERENCE pointer `meth` last assigned on line 849 could be null and is dereferenced at line 851, column 9. Showing all 14 steps of the trace crypto/rand/rand_lib.c:847:1: start of procedure RAND_status() 845. #endif 846. 847. > int RAND_status(void) 848. { 849. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:849:5: 847. int RAND_status(void) 848. { 849. > const RAND_METHOD *meth = RAND_get_rand_method(); 850. 851. if (meth->status != 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:851:9: 849. const RAND_METHOD *meth = RAND_get_rand_method(); 850. 851. > if (meth->status != NULL) 852. return meth->status(); 853. return 0;
https://github.com/openssl/openssl/blob/95658c32436017aeeef3d8598957071baf6769a9/crypto/rand/rand_lib.c/#L851