id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_42254
static inline void idctRowCondDC (DCTELEM * row) { int a0, a1, a2, a3, b0, b1, b2, b3; #ifdef HAVE_FAST_64BIT uint64_t temp; #else uint32_t temp; #endif #ifdef HAVE_FAST_64BIT #ifdef WORDS_BIGENDIAN #define ROW0_MASK 0xffff000000000000LL #else #define ROW0_MASK 0xffffLL #endif if(sizeof(DCTELEM)==2){ if ( ((((uint64_t *)row)[0] & ~ROW0_MASK) | ((uint64_t *)row)[1]) == 0) { temp = (row[0] << 3) & 0xffff; temp += temp << 16; temp += temp << 32; ((uint64_t *)row)[0] = temp; ((uint64_t *)row)[1] = temp; return; } }else{ if (!(row[1]|row[2]|row[3]|row[4]|row[5]|row[6]|row[7])) { row[0]=row[1]=row[2]=row[3]=row[4]=row[5]=row[6]=row[7]= row[0] << 3; return; } } #else if(sizeof(DCTELEM)==2){ if (!(((uint32_t*)row)[1] | ((uint32_t*)row)[2] | ((uint32_t*)row)[3] | row[1])) { temp = (row[0] << 3) & 0xffff; temp += temp << 16; ((uint32_t*)row)[0]=((uint32_t*)row)[1] = ((uint32_t*)row)[2]=((uint32_t*)row)[3] = temp; return; } }else{ if (!(row[1]|row[2]|row[3]|row[4]|row[5]|row[6]|row[7])) { row[0]=row[1]=row[2]=row[3]=row[4]=row[5]=row[6]=row[7]= row[0] << 3; return; } } #endif a0 = (W4 * row[0]) + (1 << (ROW_SHIFT - 1)); a1 = a0; a2 = a0; a3 = a0; a0 += W2 * row[2]; a1 += W6 * row[2]; a2 -= W6 * row[2]; a3 -= W2 * row[2]; MUL16(b0, W1, row[1]); MAC16(b0, W3, row[3]); MUL16(b1, W3, row[1]); MAC16(b1, -W7, row[3]); MUL16(b2, W5, row[1]); MAC16(b2, -W1, row[3]); MUL16(b3, W7, row[1]); MAC16(b3, -W5, row[3]); #ifdef HAVE_FAST_64BIT temp = ((uint64_t*)row)[1]; #else temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3]; #endif if (temp != 0) { a0 += W4*row[4] + W6*row[6]; a1 += - W4*row[4] - W2*row[6]; a2 += - W4*row[4] + W2*row[6]; a3 += W4*row[4] - W6*row[6]; MAC16(b0, W5, row[5]); MAC16(b0, W7, row[7]); MAC16(b1, -W1, row[5]); MAC16(b1, -W5, row[7]); MAC16(b2, W7, row[5]); MAC16(b2, W3, row[7]); MAC16(b3, W3, row[5]); MAC16(b3, -W1, row[7]); } row[0] = (a0 + b0) >> ROW_SHIFT; row[7] = (a0 - b0) >> ROW_SHIFT; row[1] = (a1 + b1) >> ROW_SHIFT; row[6] = (a1 - b1) >> ROW_SHIFT; row[2] = (a2 + b2) >> ROW_SHIFT; row[5] = (a2 - b2) >> ROW_SHIFT; row[3] = (a3 + b3) >> ROW_SHIFT; row[4] = (a3 - b3) >> ROW_SHIFT; } libavcodec/wmv2.c:70: error: Buffer Overrun L1 Offset: [12, 36] (⇐ [5, 29] + 7) Size: 6 by call to `wmv2_add_block`. libavcodec/wmv2.c:70:5: Call 68. 69. wmv2_add_block(w, block1[4], dest_cb , s->uvlinesize, 4); 70. wmv2_add_block(w, block1[5], dest_cr , s->uvlinesize, 5); ^ 71. } 72. libavcodec/wmv2.c:35:1: Parameter `n` 33. } 34. 35. static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){ ^ 36. MpegEncContext * const s= &w->s; 37. libavcodec/wmv2.c:45:9: Call 43. case 1: 44. ff_simple_idct84_add(dst , stride, block1); 45. ff_simple_idct84_add(dst + 4*stride, stride, w->abt_block2[n]); ^ 46. memset(w->abt_block2[n], 0, 64*sizeof(DCTELEM)); 47. break; libavcodec/simple_idct.c:558:1: Parameter `*block` 556. } 557. 558. void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block) ^ 559. { 560. int i; libavcodec/simple_idct.c:564:9: Call 562. /* IDCT8 on each line */ 563. for(i=0; i<4; i++) { 564. idctRowCondDC(block + i*8); ^ 565. } 566. libavcodec/simple_idct.c:78:1: <Length trace> 76. #endif 77. 78. static inline void idctRowCondDC (DCTELEM * row) ^ 79. { 80. int a0, a1, a2, a3, b0, b1, b2, b3; libavcodec/simple_idct.c:78:1: Parameter `*row` 76. #endif 77. 78. static inline void idctRowCondDC (DCTELEM * row) ^ 79. { 80. int a0, a1, a2, a3, b0, b1, b2, b3; libavcodec/simple_idct.c:161:13: Array access: Offset: [12, 36] (⇐ [5, 29] + 7) Size: 6 by call to `wmv2_add_block` 159. 160. MAC16(b0, W5, row[5]); 161. MAC16(b0, W7, row[7]); ^ 162. 163. MAC16(b1, -W1, row[5]);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/simple_idct.c/#L161
d2a_code_trace_data_42255
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_parse.c:1406: error: Buffer Overrun L2 Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`. src/http/ngx_http_parse.c:1406:5: Call 1404. unsafe: 1405. 1406. ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ^ 1407. "unsafe URI \"%V\" was detected", uri); 1408. 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_42256
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecp_nistz256.c:1342: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`. Showing all 10 steps of the trace crypto/ec/ecp_nistz256.c:1147:5: Call 1145. } 1146. 1147. BN_CTX_start(ctx); ^ 1148. 1149. if (scalar) { 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/ec/ecp_nistz256.c:1342:5: Call 1340. 1341. err: 1342. BN_CTX_end(ctx); ^ 1343. OPENSSL_free(new_points); 1344. OPENSSL_free(new_scalars); 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_42257
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bntest.c:1402: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_inv`. Showing all 11 steps of the trace crypto/bn/bntest.c:1381:1: Parameter `ctx->stack.depth` 1379. } 1380. 1381. > int test_gf2m_mod_inv(BIO *bp,BN_CTX *ctx) 1382. { 1383. BIGNUM *a,*b[2],*c,*d; crypto/bn/bntest.c:1402:4: Call 1400. for (j=0; j < 2; j++) 1401. { 1402. BN_GF2m_mod_inv(c, a, b[j], ctx); ^ 1403. BN_GF2m_mod_mul(d, a, c, b[j], ctx); 1404. #if 0 /* make test uses ouput in bc but bc can't handle GF(2^m) arithmetic */ crypto/bn/bn_gf2m.c:526:1: Parameter `ctx->stack.depth` 524. * of Elliptic Curve Cryptography Over Binary Fields". 525. */ 526. > int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 527. { 528. BIGNUM *b, *c = NULL, *u = NULL, *v = NULL, *tmp; crypto/bn/bn_gf2m.c:534:2: Call 532. bn_check_top(p); 533. 534. BN_CTX_start(ctx); ^ 535. 536. if ((b = BN_CTX_get(ctx))==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/bn/bn_gf2m.c:652:4: Call 650. bn_correct_top(v); 651. #endif 652. BN_CTX_end(ctx); ^ 653. return ret; 654. } 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_GF2m_mod_inv` 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/27dfffd5b75ee1db114e32f6dc73e266513889c5/crypto/bn/bn_ctx.c/#L355
d2a_code_trace_data_42258
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecp_nistz256.c:892: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`. Showing all 9 steps of the trace crypto/ec/ecp_nistz256.c:777:8: Parameter `ctx->stack.depth` 775. } 776. 777. __owur static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx) ^ 778. { 779. /* crypto/ec/ecp_nistz256.c:892:9: Call 890. err: 891. if (ctx != NULL) 892. BN_CTX_end(ctx); ^ 893. BN_CTX_free(new_ctx); 894. 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_42259
static int pkey_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { MAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx); switch (type) { case EVP_PKEY_CTRL_CIPHER: switch (hctx->type) { case MAC_TYPE_RAW: return -2; case MAC_TYPE_MAC: { OSSL_PARAM params[3]; size_t params_n = 0; char *ciphname = (char *)OBJ_nid2sn(EVP_CIPHER_nid(p2)); #ifndef OPENSSL_NO_ENGINE char *engineid = (char *)ENGINE_get_id(ctx->engine); params[params_n++] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ENGINE, engineid, strlen(engineid) + 1); #endif params[params_n++] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_CIPHER, ciphname, strlen(ciphname) + 1); params[params_n] = OSSL_PARAM_construct_end(); if (!EVP_MAC_CTX_set_params(hctx->ctx, params) || !EVP_MAC_init(hctx->ctx)) return 0; } break; default: return 0; } break; case EVP_PKEY_CTRL_MD: switch (hctx->type) { case MAC_TYPE_RAW: hctx->raw_data.md = p2; break; case MAC_TYPE_MAC: { EVP_MAC_CTX *new_mac_ctx; if (ctx->pkey == NULL) return 0; new_mac_ctx = EVP_MAC_CTX_dup((EVP_MAC_CTX *)ctx->pkey ->pkey.ptr); if (new_mac_ctx == NULL) return 0; EVP_MAC_CTX_free(hctx->ctx); hctx->ctx = new_mac_ctx; } break; default: return 0; } break; case EVP_PKEY_CTRL_SET_DIGEST_SIZE: { OSSL_PARAM params[2] = { OSSL_PARAM_END, OSSL_PARAM_END }; size_t size = (size_t)p1; size_t verify = 0; params[0] = OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_SIZE, &size); if (!EVP_MAC_CTX_set_params(hctx->ctx, params)) return 0; params[0] = OSSL_PARAM_construct_size_t(OSSL_MAC_PARAM_SIZE, &verify); if (!EVP_MAC_CTX_get_params(hctx->ctx, params)) return 0; if (verify != size) return -2; } break; case EVP_PKEY_CTRL_SET_MAC_KEY: switch (hctx->type) { case MAC_TYPE_RAW: if ((!p2 && p1 > 0) || (p1 < -1)) return 0; if (!ASN1_OCTET_STRING_set(&hctx->raw_data.ktmp, p2, p1)) return 0; break; case MAC_TYPE_MAC: { OSSL_PARAM params[2]; size_t params_n = 0; params[params_n++] = OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY, p2, p1); params[params_n] = OSSL_PARAM_construct_end(); return EVP_MAC_CTX_set_params(hctx->ctx, params); } break; default: return 0; } break; case EVP_PKEY_CTRL_DIGESTINIT: switch (hctx->type) { case MAC_TYPE_RAW: if (!EVP_MAC_init(hctx->ctx)) return 0; { ASN1_OCTET_STRING *key = (ASN1_OCTET_STRING *)ctx->pkey->pkey.ptr; OSSL_PARAM params[4]; size_t params_n = 0; char *mdname = (char *)OBJ_nid2sn(EVP_MD_nid(hctx->raw_data.md)); #ifndef OPENSSL_NO_ENGINE char *engineid = ctx->engine == NULL ? NULL : (char *)ENGINE_get_id(ctx->engine); if (engineid != NULL) { size_t engineid_l = strlen(engineid) + 1; params[params_n++] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ENGINE, engineid, engineid_l); } #endif params[params_n++] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, mdname, strlen(mdname) + 1); params[params_n++] = OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY, key->data, key->length); params[params_n] = OSSL_PARAM_construct_end(); return EVP_MAC_CTX_set_params(hctx->ctx, params); } break; case MAC_TYPE_MAC: return -2; default: return 0; } break; default: return -2; } return 1; } crypto/evp/pkey_mac.c:288: error: NULL_DEREFERENCE pointer `ciphname` last assigned on line 276 could be null and is dereferenced by call to `strlen()` at line 288, column 54. Showing all 39 steps of the trace crypto/evp/pkey_mac.c:262:1: start of procedure pkey_mac_ctrl() 260. } 261. 262. > static int pkey_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) 263. { 264. MAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx); crypto/evp/pkey_mac.c:264:5: 262. static int pkey_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) 263. { 264. > MAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx); 265. 266. switch (type) { crypto/evp/pmeth_lib.c:576:1: start of procedure EVP_PKEY_CTX_get_data() 574. } 575. 576. > void *EVP_PKEY_CTX_get_data(const EVP_PKEY_CTX *ctx) 577. { 578. return ctx->data; crypto/evp/pmeth_lib.c:578:5: 576. void *EVP_PKEY_CTX_get_data(const EVP_PKEY_CTX *ctx) 577. { 578. > return ctx->data; 579. } 580. crypto/evp/pmeth_lib.c:579:1: return from a call to EVP_PKEY_CTX_get_data 577. { 578. return ctx->data; 579. > } 580. 581. EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx) crypto/evp/pkey_mac.c:266:5: 264. MAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx); 265. 266. > switch (type) { 267. 268. case EVP_PKEY_CTRL_CIPHER: crypto/evp/pkey_mac.c:268:5: Switch condition is true. Entering switch case 266. switch (type) { 267. 268. case EVP_PKEY_CTRL_CIPHER: ^ 269. switch (hctx->type) { 270. case MAC_TYPE_RAW: crypto/evp/pkey_mac.c:269:9: 267. 268. case EVP_PKEY_CTRL_CIPHER: 269. > switch (hctx->type) { 270. case MAC_TYPE_RAW: 271. return -2; /* The raw types don't support ciphers */ crypto/evp/pkey_mac.c:270:9: Switch condition is false. Skipping switch case 268. case EVP_PKEY_CTRL_CIPHER: 269. switch (hctx->type) { 270. case MAC_TYPE_RAW: ^ 271. return -2; /* The raw types don't support ciphers */ 272. case MAC_TYPE_MAC: crypto/evp/pkey_mac.c:272:9: Switch condition is true. Entering switch case 270. case MAC_TYPE_RAW: 271. return -2; /* The raw types don't support ciphers */ 272. case MAC_TYPE_MAC: ^ 273. { 274. OSSL_PARAM params[3]; crypto/evp/pkey_mac.c:275:17: 273. { 274. OSSL_PARAM params[3]; 275. > size_t params_n = 0; 276. char *ciphname = (char *)OBJ_nid2sn(EVP_CIPHER_nid(p2)); 277. #ifndef OPENSSL_NO_ENGINE crypto/evp/pkey_mac.c:276:17: 274. OSSL_PARAM params[3]; 275. size_t params_n = 0; 276. > char *ciphname = (char *)OBJ_nid2sn(EVP_CIPHER_nid(p2)); 277. #ifndef OPENSSL_NO_ENGINE 278. char *engineid = (char *)ENGINE_get_id(ctx->engine); crypto/evp/evp_lib.c:423:1: start of procedure EVP_CIPHER_nid() 421. } 422. 423. > int EVP_CIPHER_nid(const EVP_CIPHER *cipher) 424. { 425. return cipher->nid; crypto/evp/evp_lib.c:425:5: 423. int EVP_CIPHER_nid(const EVP_CIPHER *cipher) 424. { 425. > return cipher->nid; 426. } 427. crypto/evp/evp_lib.c:426:1: return from a call to EVP_CIPHER_nid 424. { 425. return cipher->nid; 426. > } 427. 428. int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) crypto/objects/obj_dat.c:250:1: start of procedure OBJ_nid2sn() 248. } 249. 250. > const char *OBJ_nid2sn(int n) 251. { 252. ADDED_OBJ ad, *adp; crypto/objects/obj_dat.c:255:10: Taking true branch 253. ASN1_OBJECT ob; 254. 255. if ((n >= 0) && (n < NUM_NID)) { ^ 256. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) { 257. OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID); crypto/objects/obj_dat.c:255:22: Taking false branch 253. ASN1_OBJECT ob; 254. 255. if ((n >= 0) && (n < NUM_NID)) { ^ 256. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) { 257. OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID); crypto/objects/obj_dat.c:264:5: Skipping OPENSSL_init_crypto(): empty list of specs 262. 263. /* Make sure we've loaded config before checking for any "added" objects */ 264. OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL); ^ 265. 266. if (added == NULL) crypto/objects/obj_dat.c:266:9: Taking true branch 264. OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL); 265. 266. if (added == NULL) ^ 267. return NULL; 268. crypto/objects/obj_dat.c:267:9: 265. 266. if (added == NULL) 267. > return NULL; 268. 269. ad.type = ADDED_NID; crypto/objects/obj_dat.c:278:1: return from a call to OBJ_nid2sn 276. OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID); 277. return NULL; 278. > } 279. 280. const char *OBJ_nid2ln(int n) crypto/evp/pkey_mac.c:278:17: 276. char *ciphname = (char *)OBJ_nid2sn(EVP_CIPHER_nid(p2)); 277. #ifndef OPENSSL_NO_ENGINE 278. > char *engineid = (char *)ENGINE_get_id(ctx->engine); 279. 280. params[params_n++] = crypto/engine/eng_lib.c:249:1: start of procedure ENGINE_get_id() 247. } 248. 249. > const char *ENGINE_get_id(const ENGINE *e) 250. { 251. return e->id; crypto/engine/eng_lib.c:251:5: 249. const char *ENGINE_get_id(const ENGINE *e) 250. { 251. > return e->id; 252. } 253. crypto/engine/eng_lib.c:252:1: return from a call to ENGINE_get_id 250. { 251. return e->id; 252. > } 253. 254. const char *ENGINE_get_name(const ENGINE *e) crypto/evp/pkey_mac.c:280:17: 278. char *engineid = (char *)ENGINE_get_id(ctx->engine); 279. 280. > params[params_n++] = 281. OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_ENGINE, 282. engineid, crypto/params.c:808:1: start of procedure OSSL_PARAM_construct_utf8_string() 806. } 807. 808. > OSSL_PARAM OSSL_PARAM_construct_utf8_string(const char *key, char *buf, 809. size_t bsize) 810. { crypto/params.c:811:5: 809. size_t bsize) 810. { 811. > return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize); 812. } 813. crypto/params.c:30:1: start of procedure ossl_param_construct() 28. } 29. 30. > static OSSL_PARAM ossl_param_construct(const char *key, unsigned int data_type, 31. void *data, size_t data_size) 32. { crypto/params.c:35:5: 33. OSSL_PARAM res; 34. 35. > res.key = key; 36. res.data_type = data_type; 37. res.data = data; crypto/params.c:36:5: 34. 35. res.key = key; 36. > res.data_type = data_type; 37. res.data = data; 38. res.data_size = data_size; crypto/params.c:37:5: 35. res.key = key; 36. res.data_type = data_type; 37. > res.data = data; 38. res.data_size = data_size; 39. res.return_size = 0; crypto/params.c:38:5: 36. res.data_type = data_type; 37. res.data = data; 38. > res.data_size = data_size; 39. res.return_size = 0; 40. return res; crypto/params.c:39:5: 37. res.data = data; 38. res.data_size = data_size; 39. > res.return_size = 0; 40. return res; 41. } crypto/params.c:40:5: 38. res.data_size = data_size; 39. res.return_size = 0; 40. > return res; 41. } 42. crypto/params.c:41:1: return from a call to ossl_param_construct 39. res.return_size = 0; 40. return res; 41. > } 42. 43. int OSSL_PARAM_get_int(const OSSL_PARAM *p, int *val) crypto/params.c:812:1: return from a call to OSSL_PARAM_construct_utf8_string 810. { 811. return ossl_param_construct(key, OSSL_PARAM_UTF8_STRING, buf, bsize); 812. > } 813. 814. OSSL_PARAM OSSL_PARAM_construct_octet_string(const char *key, void *buf, crypto/evp/pkey_mac.c:285:17: 283. strlen(engineid) + 1); 284. #endif 285. > params[params_n++] = 286. OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_CIPHER, 287. ciphname,
https://github.com/openssl/openssl/blob/5ffc33244cd4d66e47dfa66ce89cb38d0f3074cc/crypto/evp/pkey_mac.c/#L288
d2a_code_trace_data_42260
static int opt_vstats(const char *opt, const char *arg) { char filename[40]; time_t today2 = time(NULL); struct tm *today = localtime(&today2); snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, today->tm_sec); return opt_vstats_file(opt, filename); } avconv.c:4098: error: Null Dereference pointer `today` last assigned on line 4096 could be null and is dereferenced at line 4098, column 69. avconv.c:4092:1: start of procedure opt_vstats() 4090. } 4091. 4092. static int opt_vstats(const char *opt, const char *arg) ^ 4093. { 4094. char filename[40]; avconv.c:4095:5: 4093. { 4094. char filename[40]; 4095. time_t today2 = time(NULL); ^ 4096. struct tm *today = localtime(&today2); 4097. avconv.c:4096:5: 4094. char filename[40]; 4095. time_t today2 = time(NULL); 4096. struct tm *today = localtime(&today2); ^ 4097. 4098. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, avconv.c:4098:5: 4096. struct tm *today = localtime(&today2); 4097. 4098. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 4099. today->tm_sec); 4100. return opt_vstats_file(opt, filename);
https://github.com/libav/libav/blob/4bf3c8f226252e18de8051fd0d417c1d39857b67/avconv.c/#L4098
d2a_code_trace_data_42261
void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) { register RC4_INT tmp; register int id1,id2; register RC4_INT *d; unsigned int i; d= &(key->data[0]); #if defined(__ia64) || defined(__ia64__) || defined(_M_IA64) d=(RC4_INT *)(((size_t)(d+255))&~(sizeof(key->data)-1)); #endif key->x = 0; key->y = 0; id1=id2=0; #define SK_LOOP(d,n) { \ tmp=d[(n)]; \ id2 = (data[id1] + tmp + id2) & 0xff; \ if (++id1 == len) id1=0; \ d[(n)]=d[id2]; \ d[id2]=tmp; } #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ defined(__INTEL__) || \ defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) if (sizeof(RC4_INT) > 1) { if (OPENSSL_ia32cap_P & (1<<28)) { unsigned char *cp=(unsigned char *)d; for (i=0;i<256;i++) cp[i]=i; for (i=0;i<256;i++) SK_LOOP(cp,i); d[256/sizeof(RC4_INT)]=-1; return; } } # endif #endif for (i=0; i < 256; i++) d[i]=i; for (i=0; i < 256; i+=4) { SK_LOOP(d,i+0); SK_LOOP(d,i+1); SK_LOOP(d,i+2); SK_LOOP(d,i+3); } } crypto/rc4/rc4_skey.c:151: error: BUFFER_OVERRUN_L2 Offset: [3, 258] Size: 256. Showing all 6 steps of the trace crypto/rc4/rc4_skey.c:146:7: <Offset trace> 144. #endif 145. for (i=0; i < 256; i++) d[i]=i; 146. for (i=0; i < 256; i+=4) ^ 147. { 148. SK_LOOP(d,i+0); crypto/rc4/rc4_skey.c:146:7: Assignment 144. #endif 145. for (i=0; i < 256; i++) d[i]=i; 146. for (i=0; i < 256; i+=4) ^ 147. { 148. SK_LOOP(d,i+0); crypto/rc4/rc4_skey.c:88:1: <Length trace> 86. */ 87. 88. > void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) 89. { 90. register RC4_INT tmp; crypto/rc4/rc4_skey.c:88:1: Parameter `key->data[*]` 86. */ 87. 88. > void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) 89. { 90. register RC4_INT tmp; crypto/rc4/rc4_skey.c:95:9: Assignment 93. unsigned int i; 94. 95. d= &(key->data[0]); ^ 96. #if defined(__ia64) || defined(__ia64__) || defined(_M_IA64) 97. /* see crypto/rc4/asm/rc4-ia64.S for further details... */ crypto/rc4/rc4_skey.c:151:3: Array access: Offset: [3, 258] Size: 256 149. SK_LOOP(d,i+1); 150. SK_LOOP(d,i+2); 151. SK_LOOP(d,i+3); ^ 152. } 153. }
https://github.com/openssl/openssl/blob/914c2a28c05797dc44fb3f498e6e12e5bc0db2b3/crypto/rc4/rc4_skey.c/#L151
d2a_code_trace_data_42262
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/sslapitest.c:2552: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/sslapitest.c:2467:10: Call 2465. } 2466. 2467. if (!create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, NULL)) { ^ 2468. printf("Unable to create SSL objects\n"); 2469. goto end; test/ssltestlib.c:580:21: Call 578. 579. if (*sssl == NULL) 580. serverssl = SSL_new(serverctx); ^ 581. else 582. serverssl = *sssl; ssl/ssl_lib.c:521:1: Parameter `ctx->sessions->num_items` 519. } 520. 521. > SSL *SSL_new(SSL_CTX *ctx) 522. { 523. SSL *s; test/sslapitest.c:2552:5: Call 2550. end: 2551. SSL_SESSION_free(sess); 2552. SSL_free(serverssl); ^ 2553. SSL_free(clientssl); 2554. SSL_CTX_free(sctx); ssl/ssl_lib.c:963:1: Parameter `s->session_ctx->sessions->num_items` 961. } 962. 963. > void SSL_free(SSL *s) 964. { 965. int i; ssl/ssl_lib.c:993:9: Call 991. /* Make the next call work :-) */ 992. if (s->session != NULL) { 993. ssl_clear_bad_session(s); ^ 994. SSL_SESSION_free(s->session); 995. } ssl/ssl_sess.c:1039:1: Parameter `s->session_ctx->sessions->num_items` 1037. } 1038. 1039. > int ssl_clear_bad_session(SSL *s) 1040. { 1041. if ((s->session != NULL) && ssl/ssl_sess.c:1044:9: Call 1042. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1043. !(SSL_in_init(s) || SSL_in_before(s))) { 1044. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1045. return (1); 1046. } else 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:689:1: Parameter `lh->num_items` 687. } CLIENTHELLO_MSG; 688. 689. > DEFINE_LHASH_OF(SSL_SESSION); 690. /* Needed in ssl_cert.c */ 691. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:689:1: Call 687. } CLIENTHELLO_MSG; 688. 689. > DEFINE_LHASH_OF(SSL_SESSION); 690. /* Needed in ssl_cert.c */ 691. 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/e128f891de71bbdba8391355af8d6d47d20b1969/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_42263
static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count) { int16_t weight[8][64]; DCTELEM orig[8][64]; const int mb_x= s->mb_x; const int mb_y= s->mb_y; int i; int skip_dct[8]; int dct_offset = s->linesize*8; uint8_t *ptr_y, *ptr_cb, *ptr_cr; int wrap_y, wrap_c; for(i=0; i<mb_block_count; i++) skip_dct[i]=s->skipdct; if(s->adaptive_quant){ const int last_qp= s->qscale; const int mb_xy= mb_x + mb_y*s->mb_stride; s->lambda= s->lambda_table[mb_xy]; update_qscale(s); if(!(s->flags&CODEC_FLAG_QP_RD)){ s->qscale= s->current_picture_ptr->qscale_table[mb_xy]; s->dquant= s->qscale - last_qp; if(s->out_format==FMT_H263){ s->dquant= av_clip(s->dquant, -2, 2); if(s->codec_id==CODEC_ID_MPEG4){ if(!s->mb_intra){ if(s->pict_type == FF_B_TYPE){ if(s->dquant&1 || s->mv_dir&MV_DIRECT) s->dquant= 0; } if(s->mv_type==MV_TYPE_8X8) s->dquant=0; } } } } ff_set_qscale(s, last_qp + s->dquant); }else if(s->flags&CODEC_FLAG_QP_RD) ff_set_qscale(s, s->qscale + s->dquant); wrap_y = s->linesize; wrap_c = s->uvlinesize; ptr_y = s->new_picture.data[0] + (mb_y * 16 * wrap_y) + mb_x * 16; ptr_cb = s->new_picture.data[1] + (mb_y * mb_block_height * wrap_c) + mb_x * 8; ptr_cr = s->new_picture.data[2] + (mb_y * mb_block_height * wrap_c) + mb_x * 8; if(mb_x*16+16 > s->width || mb_y*16+16 > s->height){ uint8_t *ebuf= s->edge_emu_buffer + 32; ff_emulated_edge_mc(ebuf , ptr_y , wrap_y,16,16,mb_x*16,mb_y*16, s->width , s->height); ptr_y= ebuf; ff_emulated_edge_mc(ebuf+18*wrap_y , ptr_cb, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1); ptr_cb= ebuf+18*wrap_y; ff_emulated_edge_mc(ebuf+18*wrap_y+8, ptr_cr, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1); ptr_cr= ebuf+18*wrap_y+8; } if (s->mb_intra) { if(s->flags&CODEC_FLAG_INTERLACED_DCT){ int progressive_score, interlaced_score; s->interlaced_dct=0; progressive_score= s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y, 8) +s->dsp.ildct_cmp[4](s, ptr_y + wrap_y*8, NULL, wrap_y, 8) - 400; if(progressive_score > 0){ interlaced_score = s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y*2, 8) +s->dsp.ildct_cmp[4](s, ptr_y + wrap_y , NULL, wrap_y*2, 8); if(progressive_score > interlaced_score){ s->interlaced_dct=1; dct_offset= wrap_y; wrap_y<<=1; if (s->chroma_format == CHROMA_422) wrap_c<<=1; } } } s->dsp.get_pixels(s->block[0], ptr_y , wrap_y); s->dsp.get_pixels(s->block[1], ptr_y + 8, wrap_y); s->dsp.get_pixels(s->block[2], ptr_y + dct_offset , wrap_y); s->dsp.get_pixels(s->block[3], ptr_y + dct_offset + 8, wrap_y); if(s->flags&CODEC_FLAG_GRAY){ skip_dct[4]= 1; skip_dct[5]= 1; }else{ s->dsp.get_pixels(s->block[4], ptr_cb, wrap_c); s->dsp.get_pixels(s->block[5], ptr_cr, wrap_c); if(!s->chroma_y_shift){ s->dsp.get_pixels(s->block[6], ptr_cb + (dct_offset>>1), wrap_c); s->dsp.get_pixels(s->block[7], ptr_cr + (dct_offset>>1), wrap_c); } } }else{ op_pixels_func (*op_pix)[4]; qpel_mc_func (*op_qpix)[16]; uint8_t *dest_y, *dest_cb, *dest_cr; dest_y = s->dest[0]; dest_cb = s->dest[1]; dest_cr = s->dest[2]; if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){ op_pix = s->dsp.put_pixels_tab; op_qpix= s->dsp.put_qpel_pixels_tab; }else{ op_pix = s->dsp.put_no_rnd_pixels_tab; op_qpix= s->dsp.put_no_rnd_qpel_pixels_tab; } if (s->mv_dir & MV_DIR_FORWARD) { MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix); op_pix = s->dsp.avg_pixels_tab; op_qpix= s->dsp.avg_qpel_pixels_tab; } if (s->mv_dir & MV_DIR_BACKWARD) { MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix); } if(s->flags&CODEC_FLAG_INTERLACED_DCT){ int progressive_score, interlaced_score; s->interlaced_dct=0; progressive_score= s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y, 8) +s->dsp.ildct_cmp[0](s, dest_y + wrap_y*8, ptr_y + wrap_y*8, wrap_y, 8) - 400; if(s->avctx->ildct_cmp == FF_CMP_VSSE) progressive_score -= 400; if(progressive_score>0){ interlaced_score = s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y*2, 8) +s->dsp.ildct_cmp[0](s, dest_y + wrap_y , ptr_y + wrap_y , wrap_y*2, 8); if(progressive_score > interlaced_score){ s->interlaced_dct=1; dct_offset= wrap_y; wrap_y<<=1; if (s->chroma_format == CHROMA_422) wrap_c<<=1; } } } s->dsp.diff_pixels(s->block[0], ptr_y , dest_y , wrap_y); s->dsp.diff_pixels(s->block[1], ptr_y + 8, dest_y + 8, wrap_y); s->dsp.diff_pixels(s->block[2], ptr_y + dct_offset , dest_y + dct_offset , wrap_y); s->dsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8, dest_y + dct_offset + 8, wrap_y); if(s->flags&CODEC_FLAG_GRAY){ skip_dct[4]= 1; skip_dct[5]= 1; }else{ s->dsp.diff_pixels(s->block[4], ptr_cb, dest_cb, wrap_c); s->dsp.diff_pixels(s->block[5], ptr_cr, dest_cr, wrap_c); if(!s->chroma_y_shift){ s->dsp.diff_pixels(s->block[6], ptr_cb + (dct_offset>>1), dest_cb + (dct_offset>>1), wrap_c); s->dsp.diff_pixels(s->block[7], ptr_cr + (dct_offset>>1), dest_cr + (dct_offset>>1), wrap_c); } } if(s->current_picture.mc_mb_var[s->mb_stride*mb_y+ mb_x]<2*s->qscale*s->qscale){ if(s->dsp.sad[1](NULL, ptr_y , dest_y , wrap_y, 8) < 20*s->qscale) skip_dct[0]= 1; if(s->dsp.sad[1](NULL, ptr_y + 8, dest_y + 8, wrap_y, 8) < 20*s->qscale) skip_dct[1]= 1; if(s->dsp.sad[1](NULL, ptr_y +dct_offset , dest_y +dct_offset , wrap_y, 8) < 20*s->qscale) skip_dct[2]= 1; if(s->dsp.sad[1](NULL, ptr_y +dct_offset+ 8, dest_y +dct_offset+ 8, wrap_y, 8) < 20*s->qscale) skip_dct[3]= 1; if(s->dsp.sad[1](NULL, ptr_cb , dest_cb , wrap_c, 8) < 20*s->qscale) skip_dct[4]= 1; if(s->dsp.sad[1](NULL, ptr_cr , dest_cr , wrap_c, 8) < 20*s->qscale) skip_dct[5]= 1; if(!s->chroma_y_shift){ if(s->dsp.sad[1](NULL, ptr_cb +(dct_offset>>1), dest_cb +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[6]= 1; if(s->dsp.sad[1](NULL, ptr_cr +(dct_offset>>1), dest_cr +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[7]= 1; } } } if(s->avctx->quantizer_noise_shaping){ if(!skip_dct[0]) get_visual_weight(weight[0], ptr_y , wrap_y); if(!skip_dct[1]) get_visual_weight(weight[1], ptr_y + 8, wrap_y); if(!skip_dct[2]) get_visual_weight(weight[2], ptr_y + dct_offset , wrap_y); if(!skip_dct[3]) get_visual_weight(weight[3], ptr_y + dct_offset + 8, wrap_y); if(!skip_dct[4]) get_visual_weight(weight[4], ptr_cb , wrap_c); if(!skip_dct[5]) get_visual_weight(weight[5], ptr_cr , wrap_c); if(!s->chroma_y_shift){ if(!skip_dct[6]) get_visual_weight(weight[6], ptr_cb + (dct_offset>>1), wrap_c); if(!skip_dct[7]) get_visual_weight(weight[7], ptr_cr + (dct_offset>>1), wrap_c); } memcpy(orig[0], s->block[0], sizeof(DCTELEM)*64*mb_block_count); } assert(s->out_format!=FMT_MJPEG || s->qscale==8); { for(i=0;i<mb_block_count;i++) { if(!skip_dct[i]){ int overflow; s->block_last_index[i] = s->dct_quantize(s, s->block[i], i, s->qscale, &overflow); if (overflow) clip_coeffs(s, s->block[i], s->block_last_index[i]); }else s->block_last_index[i]= -1; } if(s->avctx->quantizer_noise_shaping){ for(i=0;i<mb_block_count;i++) { if(!skip_dct[i]){ s->block_last_index[i] = dct_quantize_refine(s, s->block[i], weight[i], orig[i], i, s->qscale); } } } if(s->luma_elim_threshold && !s->mb_intra) for(i=0; i<4; i++) dct_single_coeff_elimination(s, i, s->luma_elim_threshold); if(s->chroma_elim_threshold && !s->mb_intra) for(i=4; i<mb_block_count; i++) dct_single_coeff_elimination(s, i, s->chroma_elim_threshold); if(s->flags & CODEC_FLAG_CBP_RD){ for(i=0;i<mb_block_count;i++) { if(s->block_last_index[i] == -1) s->coded_score[i]= INT_MAX/256; } } } if((s->flags&CODEC_FLAG_GRAY) && s->mb_intra){ s->block_last_index[4]= s->block_last_index[5]= 0; s->block[4][0]= s->block[5][0]= (1024 + s->c_dc_scale/2)/ s->c_dc_scale; } if(s->alternate_scan && s->dct_quantize != dct_quantize_c){ for(i=0; i<mb_block_count; i++){ int j; if(s->block_last_index[i]>0){ for(j=63; j>0; j--){ if(s->block[i][ s->intra_scantable.permutated[j] ]) break; } s->block_last_index[i]= j; } } } switch(s->codec_id){ case CODEC_ID_MPEG1VIDEO: case CODEC_ID_MPEG2VIDEO: if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) mpeg1_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MPEG4: if (ENABLE_MPEG4_ENCODER) mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MSMPEG4V2: case CODEC_ID_MSMPEG4V3: case CODEC_ID_WMV1: if (ENABLE_MSMPEG4_ENCODER) msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_WMV2: if (ENABLE_WMV2_ENCODER) ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_H261: if (ENABLE_H261_ENCODER) ff_h261_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_H263: case CODEC_ID_H263P: case CODEC_ID_FLV1: case CODEC_ID_RV10: case CODEC_ID_RV20: if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER || ENABLE_FLV_ENCODER || ENABLE_RV10_ENCODER || ENABLE_RV20_ENCODER) h263_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MJPEG: if (ENABLE_MJPEG_ENCODER) ff_mjpeg_encode_mb(s, s->block); break; default: assert(0); } } libavcodec/mpegvideo_enc.c:1646: error: Uninitialized Value The value read from skip_dct[_] was never initialized. libavcodec/mpegvideo_enc.c:1646:17: 1644. if(!s->chroma_y_shift){ /* 422 */ 1645. if(!skip_dct[6]) get_visual_weight(weight[6], ptr_cb + (dct_offset>>1), wrap_c); 1646. if(!skip_dct[7]) get_visual_weight(weight[7], ptr_cr + (dct_offset>>1), wrap_c); ^ 1647. } 1648. memcpy(orig[0], s->block[0], sizeof(DCTELEM)*64*mb_block_count);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L1646
d2a_code_trace_data_42264
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); } apps/s_server.c:2639: error: BUFFER_OVERRUN_L3 Offset: [199, 8191] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace apps/s_server.c:2639:9: Call 2637. BIO_printf(bio_s_out, "Client certificate\n"); 2638. PEM_write_bio_X509(bio_s_out, peer); 2639. X509_NAME_oneline(X509_get_subject_name(peer), buf, sizeof buf); ^ 2640. BIO_printf(bio_s_out, "subject=%s\n", buf); 2641. X509_NAME_oneline(X509_get_issuer_name(peer), buf, sizeof buf); 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: [199, 8191] 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_42265
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; } crypto/sm2/sm2_sign.c:117: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul`. Showing all 19 steps of the trace crypto/sm2/sm2_sign.c:112:14: Call 110. 111. for (;;) { 112. if (!BN_priv_rand_range(k, order)) { ^ 113. SM2err(SM2_F_SM2_SIG_GEN, ERR_R_INTERNAL_ERROR); 114. goto done; crypto/bn/bn_rand.c:184:12: Call 182. int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) 183. { 184. return bnrand_range(PRIVATE, r, range); ^ 185. } 186. crypto/bn/bn_rand.c:113:1: Parameter `r->top` 111. 112. /* random number r: 0 <= r < range */ 113. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range) 114. { 115. int n; crypto/sm2/sm2_sign.c:117:14: Call 115. } 116. 117. if (!EC_POINT_mul(group, kG, k, NULL, NULL, ctx) ^ 118. || !EC_POINT_get_affine_coordinates_GFp(group, kG, x1, NULL, 119. ctx) crypto/ec/ec_lib.c:956:1: Parameter `g_scalar->top` 954. } 955. 956. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, 957. const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx) 958. { crypto/ec/ec_lib.c:967:12: Call 965. scalars[0] = p_scalar; 966. 967. return EC_POINTs_mul(group, r, g_scalar, ^ 968. (point != NULL 969. && p_scalar != NULL), points, scalars, ctx); crypto/ec/ec_lib.c:918:1: Parameter `scalar->top` 916. */ 917. 918. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 919. size_t num, const EC_POINT *points[], 920. const BIGNUM *scalars[], BN_CTX *ctx) crypto/ec/ec_lib.c:950:15: Call 948. else 949. /* use default */ 950. ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx); ^ 951. 952. 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)) { 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:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c: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/793f19e47c69558e39c702da75c27e0509baf379/crypto/bn/bn_lib.c/#L291
d2a_code_trace_data_42266
static void char2_field_tests(void) { BN_CTX *ctx = NULL; BIGNUM *p, *a, *b; EC_GROUP *group; EC_GROUP *C2_K163 = NULL, *C2_K233 = NULL, *C2_K283 = NULL, *C2_K409 = NULL, *C2_K571 = NULL; EC_GROUP *C2_B163 = NULL, *C2_B233 = NULL, *C2_B283 = NULL, *C2_B409 = NULL, *C2_B571 = NULL; EC_POINT *P, *Q, *R; BIGNUM *x, *y, *z, *cof; unsigned char buf[100]; size_t i, len; int k; ctx = BN_CTX_new(); if (!ctx) ABORT; p = BN_new(); a = BN_new(); b = BN_new(); if (!p || !a || !b) ABORT; if (!BN_hex2bn(&p, "13")) ABORT; if (!BN_hex2bn(&a, "3")) ABORT; if (!BN_hex2bn(&b, "1")) ABORT; group = EC_GROUP_new(EC_GF2m_simple_method()); if (!group) ABORT; if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) ABORT; { EC_GROUP *tmp; tmp = EC_GROUP_new(EC_GROUP_method_of(group)); if (!tmp) ABORT; if (!EC_GROUP_copy(tmp, group)) ABORT; EC_GROUP_free(group); group = tmp; } if (!EC_GROUP_get_curve_GF2m(group, p, a, b, ctx)) ABORT; fprintf(stdout, "Curve defined by Weierstrass equation\n y^2 + x*y = x^3 + a*x^2 + b (mod 0x"); BN_print_fp(stdout, p); fprintf(stdout, ")\n a = 0x"); BN_print_fp(stdout, a); fprintf(stdout, "\n b = 0x"); BN_print_fp(stdout, b); fprintf(stdout, "\n(0x... means binary polynomial)\n"); P = EC_POINT_new(group); Q = EC_POINT_new(group); R = EC_POINT_new(group); if (!P || !Q || !R) ABORT; if (!EC_POINT_set_to_infinity(group, P)) ABORT; if (!EC_POINT_is_at_infinity(group, P)) ABORT; buf[0] = 0; if (!EC_POINT_oct2point(group, Q, buf, 1, ctx)) ABORT; if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT; if (!EC_POINT_is_at_infinity(group, P)) ABORT; x = BN_new(); y = BN_new(); z = BN_new(); cof = BN_new(); if (!x || !y || !z || !cof) ABORT; if (!BN_hex2bn(&x, "6")) ABORT; # ifdef OPENSSL_EC_BIN_PT_COMP if (!EC_POINT_set_compressed_coordinates_GF2m(group, Q, x, 1, ctx)) ABORT; # else if (!BN_hex2bn(&y, "8")) ABORT; if (!EC_POINT_set_affine_coordinates_GF2m(group, Q, x, y, ctx)) ABORT; # endif if (EC_POINT_is_on_curve(group, Q, ctx) <= 0) { # ifdef OPENSSL_EC_BIN_PT_COMP if (!EC_POINT_get_affine_coordinates_GF2m(group, Q, x, y, ctx)) ABORT; # endif fprintf(stderr, "Point is not on curve: x = 0x"); BN_print_fp(stderr, x); fprintf(stderr, ", y = 0x"); BN_print_fp(stderr, y); fprintf(stderr, "\n"); ABORT; } fprintf(stdout, "A cyclic subgroup:\n"); k = 100; do { if (k-- == 0) ABORT; if (EC_POINT_is_at_infinity(group, P)) fprintf(stdout, " point at infinity\n"); else { if (!EC_POINT_get_affine_coordinates_GF2m(group, P, x, y, ctx)) ABORT; fprintf(stdout, " x = 0x"); BN_print_fp(stdout, x); fprintf(stdout, ", y = 0x"); BN_print_fp(stdout, y); fprintf(stdout, "\n"); } if (!EC_POINT_copy(R, P)) ABORT; if (!EC_POINT_add(group, P, P, Q, ctx)) ABORT; } while (!EC_POINT_is_at_infinity(group, P)); if (!EC_POINT_add(group, P, Q, R, ctx)) ABORT; if (!EC_POINT_is_at_infinity(group, P)) ABORT; # ifdef OPENSSL_EC_BIN_PT_COMP len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf, sizeof buf, ctx); if (len == 0) ABORT; if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; fprintf(stdout, "Generator as octet string, compressed form:\n "); for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); # endif len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx); if (len == 0) ABORT; if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; fprintf(stdout, "\nGenerator as octet string, uncompressed form:\n "); for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); # ifdef OPENSSL_EC_BIN_PT_COMP len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx); if (len == 0) ABORT; if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; fprintf(stdout, "\nGenerator as octet string, hybrid form:\n "); for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); # endif fprintf(stdout, "\n"); if (!EC_POINT_invert(group, P, ctx)) ABORT; if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT; CHAR2_CURVE_TEST ("NIST curve K-163", "0800000000000000000000000000000000000000C9", "1", "1", "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8", "0289070FB05D38FF58321F2E800536D538CCDAA3D9", 1, "04000000000000000000020108A2E0CC0D99F8A5EF", "2", 163, C2_K163); CHAR2_CURVE_TEST ("NIST curve B-163", "0800000000000000000000000000000000000000C9", "1", "020A601907B8C953CA1481EB10512F78744A3205FD", "03F0EBA16286A2D57EA0991168D4994637E8343E36", "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1", 1, "040000000000000000000292FE77E70C12A4234C33", "2", 163, C2_B163); CHAR2_CURVE_TEST ("NIST curve K-233", "020000000000000000000000000000000000000004000000000000000001", "0", "1", "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126", "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3", 0, "008000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", "4", 233, C2_K233); CHAR2_CURVE_TEST ("NIST curve B-233", "020000000000000000000000000000000000000004000000000000000001", "000000000000000000000000000000000000000000000000000000000001", "0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD", "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B", "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052", 1, "01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", "2", 233, C2_B233); CHAR2_CURVE_TEST ("NIST curve K-283", "0800000000000000000000000000000000000000000000000000000000000000000010A1", "0", "1", "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836", "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259", 0, "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", "4", 283, C2_K283); CHAR2_CURVE_TEST ("NIST curve B-283", "0800000000000000000000000000000000000000000000000000000000000000000010A1", "000000000000000000000000000000000000000000000000000000000000000000000001", "027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5", "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053", "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4", 1, "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", "2", 283, C2_B283); CHAR2_CURVE_TEST ("NIST curve K-409", "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", "0", "1", "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746", "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B", 1, "007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", "4", 409, C2_K409); CHAR2_CURVE_TEST ("NIST curve B-409", "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F", "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7", "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706", 1, "010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", "2", 409, C2_B409); CHAR2_CURVE_TEST ("NIST curve K-571", "80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", "0", "1", "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972", "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3", 0, "020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", "4", 571, C2_K571); CHAR2_CURVE_TEST ("NIST curve B-571", "80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", "02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A", "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19", "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B", 1, "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", "2", 571, C2_B571); if (!EC_POINT_copy(Q, P)) ABORT; if (EC_POINT_is_at_infinity(group, Q)) ABORT; if (!EC_POINT_dbl(group, P, P, ctx)) ABORT; if (EC_POINT_is_on_curve(group, P, ctx) <= 0) ABORT; if (!EC_POINT_invert(group, Q, ctx)) ABORT; if (!EC_POINT_add(group, R, P, Q, ctx)) ABORT; if (!EC_POINT_add(group, R, R, Q, ctx)) ABORT; if (!EC_POINT_is_at_infinity(group, R)) ABORT; { const EC_POINT *points[3]; const BIGNUM *scalars[3]; if (EC_POINT_is_at_infinity(group, Q)) ABORT; points[0] = Q; points[1] = Q; points[2] = Q; if (!BN_add(y, z, BN_value_one())) ABORT; if (BN_is_odd(y)) ABORT; if (!BN_rshift1(y, y)) ABORT; scalars[0] = y; scalars[1] = y; fprintf(stdout, "combined multiplication ..."); fflush(stdout); if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT; if (!EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) ABORT; if (0 != EC_POINT_cmp(group, P, R, ctx)) ABORT; if (0 != EC_POINT_cmp(group, R, Q, ctx)) ABORT; fprintf(stdout, "."); fflush(stdout); if (!BN_pseudo_rand(y, BN_num_bits(y), 0, 0)) ABORT; if (!BN_add(z, z, y)) ABORT; BN_set_negative(z, 1); scalars[0] = y; scalars[1] = z; if (!EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ABORT; if (!EC_POINT_is_at_infinity(group, P)) ABORT; fprintf(stdout, "."); fflush(stdout); if (!BN_pseudo_rand(x, BN_num_bits(y) - 1, 0, 0)) ABORT; if (!BN_add(z, x, y)) ABORT; BN_set_negative(z, 1); scalars[0] = x; scalars[1] = y; scalars[2] = z; if (!EC_POINTs_mul(group, P, NULL, 3, points, scalars, ctx)) ABORT; if (!EC_POINT_is_at_infinity(group, P)) ABORT; fprintf(stdout, " ok\n\n"); } BN_CTX_free(ctx); BN_free(p); BN_free(a); BN_free(b); EC_GROUP_free(group); EC_POINT_free(P); EC_POINT_free(Q); EC_POINT_free(R); BN_free(x); BN_free(y); BN_free(z); BN_free(cof); EC_GROUP_free(C2_K163); EC_GROUP_free(C2_B163); EC_GROUP_free(C2_K233); EC_GROUP_free(C2_B233); EC_GROUP_free(C2_K283); EC_GROUP_free(C2_B283); EC_GROUP_free(C2_K409); EC_GROUP_free(C2_B409); EC_GROUP_free(C2_K571); EC_GROUP_free(C2_B571); } test/ectest.c:949: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 943, column 9 is not reachable after line 949, column 10. Showing all 106 steps of the trace test/ectest.c:924:1: start of procedure char2_field_tests() 922. # ifndef OPENSSL_NO_EC2M 923. 924. > static void char2_field_tests(void) 925. { 926. BN_CTX *ctx = NULL; test/ectest.c:926:5: 924. static void char2_field_tests(void) 925. { 926. > BN_CTX *ctx = NULL; 927. BIGNUM *p, *a, *b; 928. EC_GROUP *group; test/ectest.c:929:5: 927. BIGNUM *p, *a, *b; 928. EC_GROUP *group; 929. > EC_GROUP *C2_K163 = NULL, *C2_K233 = NULL, *C2_K283 = NULL, *C2_K409 = 930. NULL, *C2_K571 = NULL; 931. EC_GROUP *C2_B163 = NULL, *C2_B233 = NULL, *C2_B283 = NULL, *C2_B409 = test/ectest.c:931:5: 929. EC_GROUP *C2_K163 = NULL, *C2_K233 = NULL, *C2_K283 = NULL, *C2_K409 = 930. NULL, *C2_K571 = NULL; 931. > EC_GROUP *C2_B163 = NULL, *C2_B233 = NULL, *C2_B283 = NULL, *C2_B409 = 932. NULL, *C2_B571 = NULL; 933. EC_POINT *P, *Q, *R; test/ectest.c:939:5: 937. int k; 938. 939. > ctx = BN_CTX_new(); 940. if (!ctx) 941. ABORT; crypto/bn/bn_ctx.c:189:1: start of procedure BN_CTX_new() 187. 188. 189. > BN_CTX *BN_CTX_new(void) 190. { 191. BN_CTX *ret; crypto/bn/bn_ctx.c:193:9: 191. BN_CTX *ret; 192. 193. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_ctx.c:193:9: Taking false branch 191. BN_CTX *ret; 192. 193. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/bn/bn_ctx.c:198:5: 196. } 197. /* Initialise the structure */ 198. > BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. return ret; crypto/bn/bn_ctx.c:335:1: start of procedure BN_POOL_init() 333. /***********/ 334. 335. > static void BN_POOL_init(BN_POOL *p) 336. { 337. p->head = p->current = p->tail = NULL; crypto/bn/bn_ctx.c:337:5: 335. static void BN_POOL_init(BN_POOL *p) 336. { 337. > p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. } crypto/bn/bn_ctx.c:338:5: 336. { 337. p->head = p->current = p->tail = NULL; 338. > p->used = p->size = 0; 339. } 340. crypto/bn/bn_ctx.c:339:1: return from a call to BN_POOL_init 337. p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. > } 340. 341. static void BN_POOL_finish(BN_POOL *p) crypto/bn/bn_ctx.c:199:5: 197. /* Initialise the structure */ 198. BN_POOL_init(&ret->pool); 199. > BN_STACK_init(&ret->stack); 200. return ret; 201. } crypto/bn/bn_ctx.c:294:1: start of procedure BN_STACK_init() 292. /************/ 293. 294. > static void BN_STACK_init(BN_STACK *st) 295. { 296. st->indexes = NULL; crypto/bn/bn_ctx.c:296:5: 294. static void BN_STACK_init(BN_STACK *st) 295. { 296. > st->indexes = NULL; 297. st->depth = st->size = 0; 298. } crypto/bn/bn_ctx.c:297:5: 295. { 296. st->indexes = NULL; 297. > st->depth = st->size = 0; 298. } 299. crypto/bn/bn_ctx.c:298:1: return from a call to BN_STACK_init 296. st->indexes = NULL; 297. st->depth = st->size = 0; 298. > } 299. 300. static void BN_STACK_finish(BN_STACK *st) crypto/bn/bn_ctx.c:200:5: 198. BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. > return ret; 201. } 202. crypto/bn/bn_ctx.c:201:1: return from a call to BN_CTX_new 199. BN_STACK_init(&ret->stack); 200. return ret; 201. > } 202. 203. BN_CTX *BN_CTX_secure_new(void) test/ectest.c:940:10: Taking false branch 938. 939. ctx = BN_CTX_new(); 940. if (!ctx) ^ 941. ABORT; 942. test/ectest.c:943:5: 941. ABORT; 942. 943. > p = BN_new(); 944. a = BN_new(); 945. b = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/ectest.c:944:5: 942. 943. p = BN_new(); 944. > a = BN_new(); 945. b = BN_new(); 946. if (!p || !a || !b) crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/ectest.c:945:5: 943. p = BN_new(); 944. a = BN_new(); 945. > b = BN_new(); 946. if (!p || !a || !b) 947. ABORT; crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/ectest.c:946:10: Taking false branch 944. a = BN_new(); 945. b = BN_new(); 946. if (!p || !a || !b) ^ 947. ABORT; 948. test/ectest.c:946:16: Taking false branch 944. a = BN_new(); 945. b = BN_new(); 946. if (!p || !a || !b) ^ 947. ABORT; 948. test/ectest.c:946:22: Taking false branch 944. a = BN_new(); 945. b = BN_new(); 946. if (!p || !a || !b) ^ 947. ABORT; 948. test/ectest.c:949:10: Skipping BN_hex2bn(): empty list of specs 947. ABORT; 948. 949. if (!BN_hex2bn(&p, "13")) ^ 950. ABORT; 951. if (!BN_hex2bn(&a, "3"))
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/ectest.c/#L949
d2a_code_trace_data_42267
static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) { int smp = bd->block_length - 1; int32_t val = *bd->raw_samples; int32_t *dst = bd->raw_samples + 1; for (; smp; smp--) *dst++ = val; } libavcodec/alsdec.c:1124: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `read_decode_block`. libavcodec/alsdec.c:1083:28: Assignment 1081. unsigned int b; 1082. int ret; 1083. ALSBlockData bd[2] = { { 0 } }; ^ 1084. 1085. bd[0].ra_block = ra_frame; libavcodec/alsdec.c:1124:20: Call 1122. bd[1].raw_other = bd[0].raw_samples; 1123. 1124. if ((ret = read_decode_block(ctx, &bd[0])) < 0 || ^ 1125. (ret = read_decode_block(ctx, &bd[1])) < 0) 1126. goto fail; libavcodec/alsdec.c:1006:1: Parameter `bd->block_length` 1004. /** Read and decode block data successively. 1005. */ 1006. static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd) ^ 1007. { 1008. int ret; libavcodec/alsdec.c:1013:12: Call 1011. return ret; 1012. 1013. return decode_block(ctx, bd); ^ 1014. } 1015. libavcodec/alsdec.c:980:1: Parameter `bd->block_length` 978. /** Decode the block data. 979. */ 980. static int decode_block(ALSDecContext *ctx, ALSBlockData *bd) ^ 981. { 982. unsigned int smp; libavcodec/alsdec.c:987:9: Call 985. // read block type flag and read the samples accordingly 986. if (*bd->const_block) 987. decode_const_block_data(ctx, bd); ^ 988. else 989. ret = decode_var_block_data(ctx, bd); // always return 0 libavcodec/alsdec.c:577:1: <LHS trace> 575. /** Decode the block data for a constant block 576. */ 577. static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) ^ 578. { 579. int smp = bd->block_length - 1; libavcodec/alsdec.c:577:1: Parameter `bd->block_length` 575. /** Decode the block data for a constant block 576. */ 577. static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) ^ 578. { 579. int smp = bd->block_length - 1; libavcodec/alsdec.c:579:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `read_decode_block` 577. static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) 578. { 579. int smp = bd->block_length - 1; ^ 580. int32_t val = *bd->raw_samples; 581. int32_t *dst = bd->raw_samples + 1;
https://github.com/libav/libav/blob/582963a8156522582e55466be4a59974a8d909a5/libavcodec/alsdec.c/#L579
d2a_code_trace_data_42268
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:1895: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`. Showing all 13 steps of the trace ssl/statem/statem_clnt.c:1814:1: Parameter `s->initial_ctx->sessions->num_items` 1812. } 1813. 1814. > MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL *s, PACKET *pkt) 1815. { 1816. int al; ssl/statem/statem_clnt.c:1895:5: Call 1893. return MSG_PROCESS_CONTINUE_READING; 1894. f_err: 1895. ssl3_send_alert(s, SSL3_AL_FATAL, al); ^ 1896. err: 1897. ossl_statem_set_error(s); 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_42269
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1156: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_mont_consttime`. Showing all 32 steps of the trace test/bntest.c:1131:1: Parameter `ctx->stack.depth` 1129. * x86_64 cause a different code branch to be taken. 1130. */ 1131. > int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx) 1132. { 1133. BIGNUM *a, *p, *m, *d, *e; test/bntest.c:1147:10: Call 1145. BN_bntest_rand(a, 1024, 0, 0); 1146. BN_zero(p); 1147. if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) ^ 1148. return 0; 1149. if (!BN_is_one(d)) { crypto/bn/bn_exp.c:601:1: Parameter `ctx->stack.depth` 599. * http://www.daemonology.net/hyperthreading-considered-harmful/) 600. */ 601. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 602. const BIGNUM *m, BN_CTX *ctx, 603. BN_MONT_CTX *in_mont) test/bntest.c:1156:10: Call 1154. BN_bntest_rand(p, 1024, 0, 0); 1155. BN_zero(a); 1156. if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) ^ 1157. return 0; 1158. if (!BN_is_zero(d)) { crypto/bn/bn_exp.c:601:1: Parameter `ctx->stack.depth` 599. * http://www.daemonology.net/hyperthreading-considered-harmful/) 600. */ 601. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 602. const BIGNUM *m, BN_CTX *ctx, 603. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:641:5: Call 639. } 640. 641. BN_CTX_start(ctx); ^ 642. 643. /* 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:652:14: Call 650. if ((mont = BN_MONT_CTX_new()) == NULL) 651. goto err; 652. if (!BN_MONT_CTX_set(mont, m, ctx)) ^ 653. goto err; 654. } crypto/bn/bn_mont.c:247:1: Parameter `ctx->stack.depth` 245. } 246. 247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 248. { 249. int ret = 0; crypto/bn/bn_mont.c:255:5: Call 253. return 0; 254. 255. BN_CTX_start(ctx); ^ 256. if ((Ri = BN_CTX_get(ctx)) == NULL) 257. 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_mont.c:326:14: Call 324. tmod.top = buf[0] != 0 ? 1 : 0; 325. /* Ri = R^-1 mod N */ 326. if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 327. goto err; 328. 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:148:16: Call 146. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 147. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 148. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 149. } 150. crypto/bn/bn_gcd.c:455:1: Parameter `ctx->stack.depth` 453. * not contain branches that may leak sensitive information. 454. */ 455. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 456. const BIGNUM *a, const BIGNUM *n, 457. BN_CTX *ctx) crypto/bn/bn_gcd.c:466:5: Call 464. bn_check_top(n); 465. 466. BN_CTX_start(ctx); ^ 467. A = BN_CTX_get(ctx); 468. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:501:18: Call 499. bn_init(&local_B); 500. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 501. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 502. goto err; 503. /* 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: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_mont_consttime` 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_42270
static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size) { H264Context *h = s->priv_data; const uint8_t *buf_end = buf + buf_size; unsigned int pps_id; unsigned int slice_type; int state = -1, got_reset = 0; const uint8_t *ptr; int field_poc[2]; s->pict_type = AV_PICTURE_TYPE_I; s->key_frame = 0; s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; h->avctx = avctx; ff_h264_reset_sei(h); if (!buf_size) return 0; for (;;) { int src_length, dst_length, consumed; buf = avpriv_find_start_code(buf, buf_end, &state); if (buf >= buf_end) break; --buf; src_length = buf_end - buf; switch (state & 0x1f) { case NAL_SLICE: case NAL_IDR_SLICE: if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) { if (src_length > 60) src_length = 60; } else { if (src_length > 1000) src_length = 1000; } break; } ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); if (!ptr || dst_length < 0) break; init_get_bits(&h->gb, ptr, 8 * dst_length); switch (h->nal_unit_type) { case NAL_SPS: ff_h264_decode_seq_parameter_set(h); break; case NAL_PPS: ff_h264_decode_picture_parameter_set(h, h->gb.size_in_bits); break; case NAL_SEI: ff_h264_decode_sei(h); break; case NAL_IDR_SLICE: s->key_frame = 1; h->prev_frame_num = 0; h->prev_frame_num_offset = 0; h->prev_poc_msb = h->prev_poc_lsb = 0; case NAL_SLICE: get_ue_golomb(&h->gb); slice_type = get_ue_golomb_31(&h->gb); s->pict_type = golomb_to_pict_type[slice_type % 5]; if (h->sei_recovery_frame_cnt >= 0) { s->key_frame = 1; } pps_id = get_ue_golomb(&h->gb); if (pps_id >= MAX_PPS_COUNT) { av_log(h->avctx, AV_LOG_ERROR, "pps_id %u out of range\n", pps_id); return -1; } if (!h->pps_buffers[pps_id]) { av_log(h->avctx, AV_LOG_ERROR, "non-existing PPS %u referenced\n", pps_id); return -1; } h->pps = *h->pps_buffers[pps_id]; if (!h->sps_buffers[h->pps.sps_id]) { av_log(h->avctx, AV_LOG_ERROR, "non-existing SPS %u referenced\n", h->pps.sps_id); return -1; } h->sps = *h->sps_buffers[h->pps.sps_id]; h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num); avctx->profile = ff_h264_get_profile(&h->sps); avctx->level = h->sps.level_idc; if (h->sps.frame_mbs_only_flag) { h->picture_structure = PICT_FRAME; } else { if (get_bits1(&h->gb)) { h->picture_structure = PICT_TOP_FIELD + get_bits1(&h->gb); } else { h->picture_structure = PICT_FRAME; } } if (h->nal_unit_type == NAL_IDR_SLICE) get_ue_golomb(&h->gb); if (h->sps.poc_type == 0) { h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb); if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME) h->delta_poc_bottom = get_se_golomb(&h->gb); } if (h->sps.poc_type == 1 && !h->sps.delta_pic_order_always_zero_flag) { h->delta_poc[0] = get_se_golomb(&h->gb); if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME) h->delta_poc[1] = get_se_golomb(&h->gb); } field_poc[0] = field_poc[1] = INT_MAX; ff_init_poc(h, field_poc, &s->output_picture_number); if (h->nal_ref_idc && h->nal_unit_type != NAL_IDR_SLICE) { got_reset = scan_mmco_reset(s); if (got_reset < 0) return got_reset; } h->prev_frame_num = got_reset ? 0 : h->frame_num; h->prev_frame_num_offset = got_reset ? 0 : h->frame_num_offset; if (h->nal_ref_idc != 0) { if (!got_reset) { h->prev_poc_msb = h->poc_msb; h->prev_poc_lsb = h->poc_lsb; } else { h->prev_poc_msb = 0; h->prev_poc_lsb = h->picture_structure == PICT_BOTTOM_FIELD ? 0 : field_poc[0]; } } if (h->sps.pic_struct_present_flag) { switch (h->sei_pic_struct) { case SEI_PIC_STRUCT_TOP_FIELD: case SEI_PIC_STRUCT_BOTTOM_FIELD: s->repeat_pict = 0; break; case SEI_PIC_STRUCT_FRAME: case SEI_PIC_STRUCT_TOP_BOTTOM: case SEI_PIC_STRUCT_BOTTOM_TOP: s->repeat_pict = 1; break; case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: s->repeat_pict = 2; break; case SEI_PIC_STRUCT_FRAME_DOUBLING: s->repeat_pict = 3; break; case SEI_PIC_STRUCT_FRAME_TRIPLING: s->repeat_pict = 5; break; default: s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0; break; } } else { s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0; } if (h->picture_structure == PICT_FRAME) { s->picture_structure = AV_PICTURE_STRUCTURE_FRAME; if (h->sps.pic_struct_present_flag) { switch (h->sei_pic_struct) { case SEI_PIC_STRUCT_TOP_BOTTOM: case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: s->field_order = AV_FIELD_TT; break; case SEI_PIC_STRUCT_BOTTOM_TOP: case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: s->field_order = AV_FIELD_BB; break; default: s->field_order = AV_FIELD_PROGRESSIVE; break; } } else { if (field_poc[0] < field_poc[1]) s->field_order = AV_FIELD_TT; else if (field_poc[0] > field_poc[1]) s->field_order = AV_FIELD_BB; else s->field_order = AV_FIELD_PROGRESSIVE; } } else { if (h->picture_structure == PICT_TOP_FIELD) s->picture_structure = AV_PICTURE_STRUCTURE_TOP_FIELD; else s->picture_structure = AV_PICTURE_STRUCTURE_BOTTOM_FIELD; s->field_order = AV_FIELD_UNKNOWN; } return 0; } buf += consumed; } av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n"); return -1; } libavcodec/h264_parser.c:224: error: Null Dereference pointer `h->gb.buffer` last assigned on line 221 could be null and is dereferenced by call to `ff_h264_decode_seq_parameter_set()` at line 224, column 13. libavcodec/h264_parser.c:171:1: start of procedure parse_nal_units() 169. * @param buf_size size of the buffer. 170. */ 171. static inline int parse_nal_units(AVCodecParserContext *s, ^ 172. AVCodecContext *avctx, 173. const uint8_t *buf, int buf_size) libavcodec/h264_parser.c:175:5: 173. const uint8_t *buf, int buf_size) 174. { 175. H264Context *h = s->priv_data; ^ 176. const uint8_t *buf_end = buf + buf_size; 177. unsigned int pps_id; libavcodec/h264_parser.c:176:5: 174. { 175. H264Context *h = s->priv_data; 176. const uint8_t *buf_end = buf + buf_size; ^ 177. unsigned int pps_id; 178. unsigned int slice_type; libavcodec/h264_parser.c:179:5: 177. unsigned int pps_id; 178. unsigned int slice_type; 179. int state = -1, got_reset = 0; ^ 180. const uint8_t *ptr; 181. int field_poc[2]; libavcodec/h264_parser.c:184:5: 182. 183. /* set some sane default values */ 184. s->pict_type = AV_PICTURE_TYPE_I; ^ 185. s->key_frame = 0; 186. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; libavcodec/h264_parser.c:185:5: 183. /* set some sane default values */ 184. s->pict_type = AV_PICTURE_TYPE_I; 185. s->key_frame = 0; ^ 186. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; 187. libavcodec/h264_parser.c:186:5: 184. s->pict_type = AV_PICTURE_TYPE_I; 185. s->key_frame = 0; 186. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; ^ 187. 188. h->avctx = avctx; libavcodec/h264_parser.c:188:5: 186. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; 187. 188. h->avctx = avctx; ^ 189. ff_h264_reset_sei(h); 190. libavcodec/h264_parser.c:189:5: 187. 188. h->avctx = avctx; 189. ff_h264_reset_sei(h); ^ 190. 191. if (!buf_size) libavcodec/h264_sei.c:37:1: start of procedure ff_h264_reset_sei() 35. }; 36. 37. void ff_h264_reset_sei(H264Context *h) ^ 38. { 39. h->sei_recovery_frame_cnt = -1; libavcodec/h264_sei.c:39:5: 37. void ff_h264_reset_sei(H264Context *h) 38. { 39. h->sei_recovery_frame_cnt = -1; ^ 40. h->sei_dpb_output_delay = 0; 41. h->sei_cpb_removal_delay = -1; libavcodec/h264_sei.c:40:5: 38. { 39. h->sei_recovery_frame_cnt = -1; 40. h->sei_dpb_output_delay = 0; ^ 41. h->sei_cpb_removal_delay = -1; 42. h->sei_buffering_period_present = 0; libavcodec/h264_sei.c:41:5: 39. h->sei_recovery_frame_cnt = -1; 40. h->sei_dpb_output_delay = 0; 41. h->sei_cpb_removal_delay = -1; ^ 42. h->sei_buffering_period_present = 0; 43. h->sei_frame_packing_present = 0; libavcodec/h264_sei.c:42:5: 40. h->sei_dpb_output_delay = 0; 41. h->sei_cpb_removal_delay = -1; 42. h->sei_buffering_period_present = 0; ^ 43. h->sei_frame_packing_present = 0; 44. h->sei_display_orientation_present = 0; libavcodec/h264_sei.c:43:5: 41. h->sei_cpb_removal_delay = -1; 42. h->sei_buffering_period_present = 0; 43. h->sei_frame_packing_present = 0; ^ 44. h->sei_display_orientation_present = 0; 45. } libavcodec/h264_sei.c:44:5: 42. h->sei_buffering_period_present = 0; 43. h->sei_frame_packing_present = 0; 44. h->sei_display_orientation_present = 0; ^ 45. } 46. libavcodec/h264_sei.c:45:1: return from a call to ff_h264_reset_sei 43. h->sei_frame_packing_present = 0; 44. h->sei_display_orientation_present = 0; 45. } ^ 46. 47. static int decode_picture_timing(H264Context *h) libavcodec/h264_parser.c:191:10: Taking false branch 189. ff_h264_reset_sei(h); 190. 191. if (!buf_size) ^ 192. return 0; 193. libavcodec/h264_parser.c:393:5: Loop condition is true. Entering loop body 391. } 392. buf += consumed; 393. } ^ 394. /* didn't find a picture! */ 395. av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n"); libavcodec/h264_parser.c:196:9: Skipping avpriv_find_start_code(): empty list of specs 194. for (;;) { 195. int src_length, dst_length, consumed; 196. buf = avpriv_find_start_code(buf, buf_end, &state); ^ 197. if (buf >= buf_end) 198. break; libavcodec/h264_parser.c:197:13: Taking false branch 195. int src_length, dst_length, consumed; 196. buf = avpriv_find_start_code(buf, buf_end, &state); 197. if (buf >= buf_end) ^ 198. break; 199. --buf; libavcodec/h264_parser.c:199:9: 197. if (buf >= buf_end) 198. break; 199. --buf; ^ 200. src_length = buf_end - buf; 201. switch (state & 0x1f) { libavcodec/h264_parser.c:200:9: 198. break; 199. --buf; 200. src_length = buf_end - buf; ^ 201. switch (state & 0x1f) { 202. case NAL_SLICE: libavcodec/h264_parser.c:201:9: 199. --buf; 200. src_length = buf_end - buf; 201. switch (state & 0x1f) { ^ 202. case NAL_SLICE: 203. case NAL_IDR_SLICE: libavcodec/h264_parser.c:202:9: Switch condition is true. Entering switch case 200. src_length = buf_end - buf; 201. switch (state & 0x1f) { 202. case NAL_SLICE: ^ 203. case NAL_IDR_SLICE: 204. // Do not walk the whole buffer just to decode slice header libavcodec/h264_parser.c:205:17: Taking false branch 203. case NAL_IDR_SLICE: 204. // Do not walk the whole buffer just to decode slice header 205. if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) { ^ 206. /* IDR or disposable slice 207. * No need to decode many bytes because MMCOs shall not be present. */ libavcodec/h264_parser.c:205:52: Taking false branch 203. case NAL_IDR_SLICE: 204. // Do not walk the whole buffer just to decode slice header 205. if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) { ^ 206. /* IDR or disposable slice 207. * No need to decode many bytes because MMCOs shall not be present. */ libavcodec/h264_parser.c:212:21: Taking false branch 210. } else { 211. /* To decode up to MMCOs */ 212. if (src_length > 1000) ^ 213. src_length = 1000; 214. } libavcodec/h264_parser.c:217:9: Skipping ff_h264_decode_nal(): empty list of specs 215. break; 216. } 217. ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); ^ 218. if (!ptr || dst_length < 0) 219. break; libavcodec/h264_parser.c:218:14: Taking false branch 216. } 217. ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); 218. if (!ptr || dst_length < 0) ^ 219. break; 220. libavcodec/h264_parser.c:218:21: Taking false branch 216. } 217. ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); 218. if (!ptr || dst_length < 0) ^ 219. break; 220. libavcodec/h264_parser.c:221:9: 219. break; 220. 221. init_get_bits(&h->gb, ptr, 8 * dst_length); ^ 222. switch (h->nal_unit_type) { 223. case NAL_SPS: libavcodec/get_bits.h:375:1: start of procedure init_get_bits() 373. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. 374. */ 375. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, ^ 376. int bit_size) 377. { libavcodec/get_bits.h:379:5: 377. { 378. int buffer_size; 379. int ret = 0; ^ 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { libavcodec/get_bits.h:381:9: Taking true branch 379. int ret = 0; 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { ^ 382. buffer_size = bit_size = 0; 383. buffer = NULL; libavcodec/get_bits.h:382:9: 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 382. buffer_size = bit_size = 0; ^ 383. buffer = NULL; 384. ret = AVERROR_INVALIDDATA; libavcodec/get_bits.h:383:9: 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 382. buffer_size = bit_size = 0; 383. buffer = NULL; ^ 384. ret = AVERROR_INVALIDDATA; 385. } libavcodec/get_bits.h:384:9: 382. buffer_size = bit_size = 0; 383. buffer = NULL; 384. ret = AVERROR_INVALIDDATA; ^ 385. } 386. libavcodec/get_bits.h:387:5: 385. } 386. 387. buffer_size = (bit_size + 7) >> 3; ^ 388. 389. s->buffer = buffer; libavcodec/get_bits.h:389:5: 387. buffer_size = (bit_size + 7) >> 3; 388. 389. s->buffer = buffer; ^ 390. s->size_in_bits = bit_size; 391. #if !UNCHECKED_BITSTREAM_READER libavcodec/get_bits.h:390:5: 388. 389. s->buffer = buffer; 390. s->size_in_bits = bit_size; ^ 391. #if !UNCHECKED_BITSTREAM_READER 392. s->size_in_bits_plus8 = bit_size + 8; libavcodec/get_bits.h:392:5: 390. s->size_in_bits = bit_size; 391. #if !UNCHECKED_BITSTREAM_READER 392. s->size_in_bits_plus8 = bit_size + 8; ^ 393. #endif 394. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:394:5: 392. s->size_in_bits_plus8 = bit_size + 8; 393. #endif 394. s->buffer_end = buffer + buffer_size; ^ 395. s->index = 0; 396. libavcodec/get_bits.h:395:5: 393. #endif 394. s->buffer_end = buffer + buffer_size; 395. s->index = 0; ^ 396. 397. return ret; libavcodec/get_bits.h:397:5: 395. s->index = 0; 396. 397. return ret; ^ 398. } 399. libavcodec/get_bits.h:398:1: return from a call to init_get_bits 396. 397. return ret; 398. } ^ 399. 400. /** libavcodec/h264_parser.c:222:9: 220. 221. init_get_bits(&h->gb, ptr, 8 * dst_length); 222. switch (h->nal_unit_type) { ^ 223. case NAL_SPS: 224. ff_h264_decode_seq_parameter_set(h); libavcodec/h264_parser.c:223:9: Switch condition is true. Entering switch case 221. init_get_bits(&h->gb, ptr, 8 * dst_length); 222. switch (h->nal_unit_type) { 223. case NAL_SPS: ^ 224. ff_h264_decode_seq_parameter_set(h); 225. break; libavcodec/h264_parser.c:224:13: 222. switch (h->nal_unit_type) { 223. case NAL_SPS: 224. ff_h264_decode_seq_parameter_set(h); ^ 225. break; 226. case NAL_PPS: libavcodec/h264_ps.c:299:1: start of procedure ff_h264_decode_seq_parameter_set() 297. } 298. 299. int ff_h264_decode_seq_parameter_set(H264Context *h) ^ 300. { 301. int profile_idc, level_idc, constraint_set_flags = 0; libavcodec/h264_ps.c:301:5: 299. int ff_h264_decode_seq_parameter_set(H264Context *h) 300. { 301. int profile_idc, level_idc, constraint_set_flags = 0; ^ 302. unsigned int sps_id; 303. int i, log2_max_frame_num_minus4; libavcodec/h264_ps.c:306:5: Skipping get_bits(): empty list of specs 304. SPS *sps; 305. 306. profile_idc = get_bits(&h->gb, 8); ^ 307. constraint_set_flags |= get_bits1(&h->gb) << 0; // constraint_set0_flag 308. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag libavcodec/h264_ps.c:307:5: 305. 306. profile_idc = get_bits(&h->gb, 8); 307. constraint_set_flags |= get_bits1(&h->gb) << 0; // constraint_set0_flag ^ 308. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag 309. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:308:5: 306. profile_idc = get_bits(&h->gb, 8); 307. constraint_set_flags |= get_bits1(&h->gb) << 0; // constraint_set0_flag 308. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag ^ 309. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag 310. constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:309:5: 307. constraint_set_flags |= get_bits1(&h->gb) << 0; // constraint_set0_flag 308. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag 309. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag ^ 310. constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag 311. constraint_set_flags |= get_bits1(&h->gb) << 4; // constraint_set4_flag libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:310:5: 308. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag 309. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag 310. constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag ^ 311. constraint_set_flags |= get_bits1(&h->gb) << 4; // constraint_set4_flag 312. constraint_set_flags |= get_bits1(&h->gb) << 5; // constraint_set5_flag libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:311:5: 309. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag 310. constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag 311. constraint_set_flags |= get_bits1(&h->gb) << 4; // constraint_set4_flag ^ 312. constraint_set_flags |= get_bits1(&h->gb) << 5; // constraint_set5_flag 313. skip_bits(&h->gb, 2); // reserved_zero_2bits libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:312:5: 310. constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag 311. constraint_set_flags |= get_bits1(&h->gb) << 4; // constraint_set4_flag 312. constraint_set_flags |= get_bits1(&h->gb) << 5; // constraint_set5_flag ^ 313. skip_bits(&h->gb, 2); // reserved_zero_2bits 314. level_idc = get_bits(&h->gb, 8); libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7;
https://github.com/libav/libav/blob/b16699f2da9c1d41eff852ec3a0c81f74fd44421/libavcodec/h264_parser.c/#L224
d2a_code_trace_data_42271
static inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } test/packettest.c:321: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 252):unsigned64 by call to `PACKET_forward`. Showing all 16 steps of the trace test/packettest.c:317:17: Call 315. PACKET pkt; 316. 317. if ( !PACKET_buf_init(&pkt, buf, BUF_LEN) ^ 318. || !PACKET_forward(&pkt, 1) 319. || !PACKET_get_bytes(&pkt, &byte, 1) ssl/packet_locl.h:109:1: Parameter `pkt->remaining` 107. * is being used. 108. */ 109. > static inline int PACKET_buf_init(PACKET *pkt, unsigned char *buf, size_t len) 110. { 111. /* Sanity check for negative values. */ test/packettest.c:318:17: Call 316. 317. if ( !PACKET_buf_init(&pkt, buf, BUF_LEN) 318. || !PACKET_forward(&pkt, 1) ^ 319. || !PACKET_get_bytes(&pkt, &byte, 1) 320. || byte[0] != 4 ssl/packet_locl.h:426:8: Parameter `len` 424. 425. /* Move the current reading position forward |len| bytes */ 426. __owur static inline int PACKET_forward(PACKET *pkt, size_t len) ^ 427. { 428. if (PACKET_remaining(pkt) < len) test/packettest.c:319:17: Call 317. if ( !PACKET_buf_init(&pkt, buf, BUF_LEN) 318. || !PACKET_forward(&pkt, 1) 319. || !PACKET_get_bytes(&pkt, &byte, 1) ^ 320. || byte[0] != 4 321. || !PACKET_forward(&pkt, BUF_LEN - 3) ssl/packet_locl.h:320:8: Parameter `pkt->remaining` 318. * freed 319. */ 320. __owur static inline int PACKET_get_bytes(PACKET *pkt, unsigned char **data, ^ 321. size_t len) 322. { ssl/packet_locl.h:323:10: Call 321. size_t len) 322. { 323. if (!PACKET_peek_bytes(pkt, data, len)) ^ 324. return 0; 325. ssl/packet_locl.h:303:8: Parameter `len` 301. * underlying buffer gets freed 302. */ 303. __owur static inline int PACKET_peek_bytes(const PACKET *pkt, unsigned char **data, ^ 304. size_t len) 305. { test/packettest.c:321:17: Call 319. || !PACKET_get_bytes(&pkt, &byte, 1) 320. || byte[0] != 4 321. || !PACKET_forward(&pkt, BUF_LEN - 3) ^ 322. || !PACKET_get_bytes(&pkt, &byte, 1) 323. || byte[0] != 0xfe) { ssl/packet_locl.h:426:8: Parameter `len` 424. 425. /* Move the current reading position forward |len| bytes */ 426. __owur static inline int PACKET_forward(PACKET *pkt, size_t len) ^ 427. { 428. if (PACKET_remaining(pkt) < len) ssl/packet_locl.h:431:5: Call 429. return 0; 430. 431. packet_forward(pkt, len); ^ 432. 433. return 1; ssl/packet_locl.h:79:1: <LHS trace> 77. 78. /* Internal unchecked shorthand; don't use outside this file. */ 79. > static inline void packet_forward(PACKET *pkt, size_t len) 80. { 81. pkt->curr += len; ssl/packet_locl.h:79:1: Parameter `pkt->remaining` 77. 78. /* Internal unchecked shorthand; don't use outside this file. */ 79. > static inline void packet_forward(PACKET *pkt, size_t len) 80. { 81. pkt->curr += len; ssl/packet_locl.h:79:1: <RHS trace> 77. 78. /* Internal unchecked shorthand; don't use outside this file. */ 79. > static inline void packet_forward(PACKET *pkt, size_t len) 80. { 81. pkt->curr += len; ssl/packet_locl.h:79:1: Parameter `len` 77. 78. /* Internal unchecked shorthand; don't use outside this file. */ 79. > static inline void packet_forward(PACKET *pkt, size_t len) 80. { 81. pkt->curr += len; ssl/packet_locl.h:82:5: Binary operation: ([0, +oo] - 252):unsigned64 by call to `PACKET_forward` 80. { 81. pkt->curr += len; 82. pkt->remaining -= len; ^ 83. } 84.
https://github.com/openssl/openssl/blob/20218b58b51b55189ada91807459d6bd64f5c986/ssl/packet_locl.h/#L82
d2a_code_trace_data_42272
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:1104: error: Uninitialized Value The value read from ref[_] was never initialized. libavcodec/h264.c:1104:20: 1102. || (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1 1103. && (h->x264_build>33 || !h->x264_build)))){ 1104. if(ref[0] > 0) ^ 1105. a= pack16to32(mv[0][0],mv[0][1]); 1106. if(ref[1] > 0)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1104
d2a_code_trace_data_42273
static char * ngx_http_fastcgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { ngx_http_fastcgi_loc_conf_t *flcf = conf; ngx_url_t u; ngx_str_t *value, *url; ngx_uint_t n; ngx_http_core_loc_conf_t *clcf; ngx_http_script_compile_t sc; if (flcf->upstream.upstream || flcf->fastcgi_lengths) { return "is duplicate"; } clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); clcf->handler = ngx_http_fastcgi_handler; value = cf->args->elts; url = &value[1]; n = ngx_http_script_variables_count(url); if (n) { ngx_memzero(&sc, sizeof(ngx_http_script_compile_t)); sc.cf = cf; sc.source = url; sc.lengths = &flcf->fastcgi_lengths; sc.values = &flcf->fastcgi_values; sc.variables = n; sc.complete_lengths = 1; sc.complete_values = 1; if (ngx_http_script_compile(&sc) != NGX_OK) { return NGX_CONF_ERROR; } return NGX_CONF_OK; } ngx_memzero(&u, sizeof(ngx_url_t)); u.url = value[1]; u.no_resolve = 1; flcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0); if (flcf->upstream.upstream == NULL) { return NGX_CONF_ERROR; } if (clcf->name.data[clcf->name.len - 1] == '/') { clcf->auto_redirect = 1; } return NGX_CONF_OK; } src/http/modules/ngx_http_fastcgi_module.c:2441: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64. src/http/modules/ngx_http_fastcgi_module.c:2431:5: <LHS trace> 2429. } 2430. 2431. ngx_memzero(&u, sizeof(ngx_url_t)); ^ 2432. 2433. u.url = value[1]; src/http/modules/ngx_http_fastcgi_module.c:2431:5: Unknown value from: __infer_skip 2429. } 2430. 2431. ngx_memzero(&u, sizeof(ngx_url_t)); ^ 2432. 2433. u.url = value[1]; src/http/modules/ngx_http_fastcgi_module.c:2436:31: Call 2434. u.no_resolve = 1; 2435. 2436. flcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0); ^ 2437. if (flcf->upstream.upstream == NULL) { 2438. return NGX_CONF_ERROR; src/http/ngx_http_upstream.c:3902:1: Parameter `*u->url.data` 3900. 3901. 3902. ngx_http_upstream_srv_conf_t * ^ 3903. ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags) 3904. { src/http/modules/ngx_http_fastcgi_module.c:2441:9: Binary operation: ([0, +oo] - 1):unsigned64 2439. } 2440. 2441. if (clcf->name.data[clcf->name.len - 1] == '/') { ^ 2442. clcf->auto_redirect = 1; 2443. }
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/http/modules/ngx_http_fastcgi_module.c/#L2441
d2a_code_trace_data_42274
int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy) { int rv, start_idx, i; if (x == NULL) { x = sk_X509_value(sk, 0); start_idx = 1; } else start_idx = 0; rv = ssl_security_cert(s, NULL, x, vfy, 1); if (rv != 1) return rv; for (i = start_idx; i < sk_X509_num(sk); i++) { x = sk_X509_value(sk, i); rv = ssl_security_cert(s, NULL, x, vfy, 0); if (rv != 1) return rv; } return 1; } ssl/t1_lib.c:4077: error: NULL_DEREFERENCE pointer `null` is dereferenced by call to `ssl_security_cert()` at line 4077, column 10. Showing all 11 steps of the trace ssl/t1_lib.c:4068:1: start of procedure ssl_security_cert_chain() 4066. */ 4067. 4068. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy) 4069. { 4070. int rv, start_idx, i; ssl/t1_lib.c:4071:9: Taking true branch 4069. { 4070. int rv, start_idx, i; 4071. if (x == NULL) { ^ 4072. x = sk_X509_value(sk, 0); 4073. start_idx = 1; ssl/t1_lib.c:4072:9: 4070. int rv, start_idx, i; 4071. if (x == NULL) { 4072. > x = sk_X509_value(sk, 0); 4073. start_idx = 1; 4074. } else include/openssl/x509.h:97:1: start of procedure sk_X509_value() 95. typedef struct x509_cinf_st X509_CINF; 96. 97. > DEFINE_STACK_OF(X509) 98. 99. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:265:1: start of procedure OPENSSL_sk_value() 263. } 264. 265. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) 266. { 267. if (st == NULL || i < 0 || i >= st->num) crypto/stack/stack.c:267:9: Taking true branch 265. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) 266. { 267. if (st == NULL || i < 0 || i >= st->num) ^ 268. return NULL; 269. return (void *)st->data[i]; crypto/stack/stack.c:268:9: 266. { 267. if (st == NULL || i < 0 || i >= st->num) 268. > return NULL; 269. return (void *)st->data[i]; 270. } crypto/stack/stack.c:270:1: return from a call to OPENSSL_sk_value 268. return NULL; 269. return (void *)st->data[i]; 270. > } 271. 272. void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data) include/openssl/x509.h:97:1: return from a call to sk_X509_value 95. typedef struct x509_cinf_st X509_CINF; 96. 97. > DEFINE_STACK_OF(X509) 98. 99. /* This is used for a table of trust checking functions */ ssl/t1_lib.c:4073:9: 4071. if (x == NULL) { 4072. x = sk_X509_value(sk, 0); 4073. > start_idx = 1; 4074. } else 4075. start_idx = 0; ssl/t1_lib.c:4077:5: 4075. start_idx = 0; 4076. 4077. > rv = ssl_security_cert(s, NULL, x, vfy, 1); 4078. if (rv != 1) 4079. return rv;
https://github.com/openssl/openssl/blob/de451856f08364ad6c6659b6eacbe820edc2aab9/ssl/t1_lib.c/#L4077
d2a_code_trace_data_42275
int dsa_paramgen_check_g(DSA *dsa) { BN_CTX *ctx; BIGNUM *tmp; BN_MONT_CTX *mont = NULL; int rv = -1; ctx = BN_CTX_new(); if (ctx == NULL) return -1; BN_CTX_start(ctx); if (BN_cmp(dsa->g, BN_value_one()) <= 0) return 0; if (BN_cmp(dsa->g, dsa->p) >= 0) return 0; tmp = BN_CTX_get(ctx); if (!tmp) goto err; if ((mont = BN_MONT_CTX_new()) == NULL) goto err; if (!BN_MONT_CTX_set(mont, dsa->p, ctx)) goto err; if (!BN_mod_exp_mont(tmp, dsa->g, dsa->q, dsa->p, ctx, mont)) goto err; if (!BN_cmp(tmp, BN_value_one())) rv = 1; else rv = 0; err: BN_CTX_end(ctx); BN_MONT_CTX_free(mont); BN_CTX_free(ctx); return rv; } crypto/dsa/dsa_gen.c:658: error: MEMORY_LEAK memory dynamically allocated to `return` by call to `BN_CTX_new()` at line 653, column 11 is not reachable after line 658, column 9. Showing all 76 steps of the trace crypto/dsa/dsa_gen.c:647:1: start of procedure dsa_paramgen_check_g() 645. } 646. 647. > int dsa_paramgen_check_g(DSA *dsa) 648. { 649. BN_CTX *ctx; crypto/dsa/dsa_gen.c:651:5: 649. BN_CTX *ctx; 650. BIGNUM *tmp; 651. > BN_MONT_CTX *mont = NULL; 652. int rv = -1; 653. ctx = BN_CTX_new(); crypto/dsa/dsa_gen.c:652:5: 650. BIGNUM *tmp; 651. BN_MONT_CTX *mont = NULL; 652. > int rv = -1; 653. ctx = BN_CTX_new(); 654. if (ctx == NULL) crypto/dsa/dsa_gen.c:653:5: 651. BN_MONT_CTX *mont = NULL; 652. int rv = -1; 653. > ctx = BN_CTX_new(); 654. if (ctx == NULL) 655. return -1; crypto/bn/bn_ctx.c:189:1: start of procedure BN_CTX_new() 187. 188. 189. > BN_CTX *BN_CTX_new(void) 190. { 191. BN_CTX *ret; crypto/bn/bn_ctx.c:193:9: 191. BN_CTX *ret; 192. 193. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_ctx.c:193:9: Taking false branch 191. BN_CTX *ret; 192. 193. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/bn/bn_ctx.c:198:5: 196. } 197. /* Initialise the structure */ 198. > BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. return ret; crypto/bn/bn_ctx.c:335:1: start of procedure BN_POOL_init() 333. /***********/ 334. 335. > static void BN_POOL_init(BN_POOL *p) 336. { 337. p->head = p->current = p->tail = NULL; crypto/bn/bn_ctx.c:337:5: 335. static void BN_POOL_init(BN_POOL *p) 336. { 337. > p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. } crypto/bn/bn_ctx.c:338:5: 336. { 337. p->head = p->current = p->tail = NULL; 338. > p->used = p->size = 0; 339. } 340. crypto/bn/bn_ctx.c:339:1: return from a call to BN_POOL_init 337. p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. > } 340. 341. static void BN_POOL_finish(BN_POOL *p) crypto/bn/bn_ctx.c:199:5: 197. /* Initialise the structure */ 198. BN_POOL_init(&ret->pool); 199. > BN_STACK_init(&ret->stack); 200. return ret; 201. } crypto/bn/bn_ctx.c:294:1: start of procedure BN_STACK_init() 292. /************/ 293. 294. > static void BN_STACK_init(BN_STACK *st) 295. { 296. st->indexes = NULL; crypto/bn/bn_ctx.c:296:5: 294. static void BN_STACK_init(BN_STACK *st) 295. { 296. > st->indexes = NULL; 297. st->depth = st->size = 0; 298. } crypto/bn/bn_ctx.c:297:5: 295. { 296. st->indexes = NULL; 297. > st->depth = st->size = 0; 298. } 299. crypto/bn/bn_ctx.c:298:1: return from a call to BN_STACK_init 296. st->indexes = NULL; 297. st->depth = st->size = 0; 298. > } 299. 300. static void BN_STACK_finish(BN_STACK *st) crypto/bn/bn_ctx.c:200:5: 198. BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. > return ret; 201. } 202. crypto/bn/bn_ctx.c:201:1: return from a call to BN_CTX_new 199. BN_STACK_init(&ret->stack); 200. return ret; 201. > } 202. 203. BN_CTX *BN_CTX_secure_new(void) crypto/dsa/dsa_gen.c:654:9: Taking false branch 652. int rv = -1; 653. ctx = BN_CTX_new(); 654. if (ctx == NULL) ^ 655. return -1; 656. BN_CTX_start(ctx); crypto/dsa/dsa_gen.c:656:5: 654. if (ctx == NULL) 655. return -1; 656. > BN_CTX_start(ctx); 657. if (BN_cmp(dsa->g, BN_value_one()) <= 0) 658. return 0; crypto/bn/bn_ctx.c:236:1: start of procedure BN_CTX_start() 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_ctx.c:240:9: Taking false branch 238. CTXDBG_ENTRY("BN_CTX_start", ctx); 239. /* If we're already overflowing ... */ 240. if (ctx->err_stack || ctx->too_many) ^ 241. ctx->err_stack++; 242. /* (Try to) get a new frame pointer */ crypto/bn/bn_ctx.c:240:27: Taking false branch 238. CTXDBG_ENTRY("BN_CTX_start", ctx); 239. /* If we're already overflowing ... */ 240. if (ctx->err_stack || ctx->too_many) ^ 241. ctx->err_stack++; 242. /* (Try to) get a new frame pointer */ crypto/bn/bn_ctx.c:243:15: 241. ctx->err_stack++; 242. /* (Try to) get a new frame pointer */ 243. > else if (!BN_STACK_push(&ctx->stack, ctx->used)) { 244. BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES); 245. ctx->err_stack++; crypto/bn/bn_ctx.c:307:1: start of procedure BN_STACK_push() 305. 306. 307. > static int BN_STACK_push(BN_STACK *st, unsigned int idx) 308. { 309. if (st->depth == st->size) { crypto/bn/bn_ctx.c:309:9: Taking true branch 307. static int BN_STACK_push(BN_STACK *st, unsigned int idx) 308. { 309. if (st->depth == st->size) { ^ 310. /* Need to expand */ 311. unsigned int newsize = crypto/bn/bn_ctx.c:312:13: Condition is false 310. /* Need to expand */ 311. unsigned int newsize = 312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES; ^ 313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize); 314. if (newitems == NULL) crypto/bn/bn_ctx.c:311:9: 309. if (st->depth == st->size) { 310. /* Need to expand */ 311. > unsigned int newsize = 312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES; 313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize); crypto/bn/bn_ctx.c:313:9: 311. unsigned int newsize = 312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES; 313. > unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize); 314. if (newitems == NULL) 315. return 0; crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/bn/bn_ctx.c:314:13: Taking false branch 312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES; 313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize); 314. if (newitems == NULL) ^ 315. return 0; 316. if (st->depth) crypto/bn/bn_ctx.c:316:13: Taking false branch 314. if (newitems == NULL) 315. return 0; 316. if (st->depth) ^ 317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth); 318. OPENSSL_free(st->indexes); crypto/bn/bn_ctx.c:318:9: 316. if (st->depth) 317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth); 318. > OPENSSL_free(st->indexes); 319. st->indexes = newitems; 320. st->size = newsize; crypto/mem.c:234:1: start of procedure CRYPTO_free() 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: 243. } 244. #else 245. > free(str); 246. #endif 247. } crypto/mem.c:247:1: return from a call to CRYPTO_free 245. free(str); 246. #endif 247. > } 248. 249. void CRYPTO_clear_free(void *str, size_t num) crypto/bn/bn_ctx.c:319:9: 317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth); 318. OPENSSL_free(st->indexes); 319. > st->indexes = newitems; 320. st->size = newsize; 321. } crypto/bn/bn_ctx.c:320:9: 318. OPENSSL_free(st->indexes); 319. st->indexes = newitems; 320. > st->size = newsize; 321. } 322. st->indexes[(st->depth)++] = idx; crypto/bn/bn_ctx.c:322:5: 320. st->size = newsize; 321. } 322. > st->indexes[(st->depth)++] = idx; 323. return 1; 324. } crypto/bn/bn_ctx.c:323:5: 321. } 322. st->indexes[(st->depth)++] = idx; 323. > return 1; 324. } 325. crypto/bn/bn_ctx.c:324:1: return from a call to BN_STACK_push 322. st->indexes[(st->depth)++] = idx; 323. return 1; 324. > } 325. 326. static unsigned int BN_STACK_pop(BN_STACK *st) crypto/bn/bn_ctx.c:243:15: Taking false branch 241. ctx->err_stack++; 242. /* (Try to) get a new frame pointer */ 243. else if (!BN_STACK_push(&ctx->stack, ctx->used)) { ^ 244. BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES); 245. ctx->err_stack++; crypto/bn/bn_ctx.c:240:5: 238. CTXDBG_ENTRY("BN_CTX_start", ctx); 239. /* If we're already overflowing ... */ 240. > if (ctx->err_stack || ctx->too_many) 241. ctx->err_stack++; 242. /* (Try to) get a new frame pointer */ crypto/bn/bn_ctx.c:248:1: return from a call to BN_CTX_start 246. } 247. CTXDBG_EXIT(ctx); 248. > } 249. 250. void BN_CTX_end(BN_CTX *ctx) crypto/dsa/dsa_gen.c:657:9: 655. return -1; 656. BN_CTX_start(ctx); 657. > if (BN_cmp(dsa->g, BN_value_one()) <= 0) 658. return 0; 659. if (BN_cmp(dsa->g, dsa->p) >= 0) crypto/bn/bn_lib.c:134:1: start of procedure BN_value_one() 132. #endif 133. 134. > const BIGNUM *BN_value_one(void) 135. { 136. static const BN_ULONG data_one = 1L; crypto/bn/bn_lib.c:136:5: 134. const BIGNUM *BN_value_one(void) 135. { 136. > static const BN_ULONG data_one = 1L; 137. static const BIGNUM const_one = 138. { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA }; crypto/bn/bn_lib.c:137:5: 135. { 136. static const BN_ULONG data_one = 1L; 137. > static const BIGNUM const_one = 138. { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA }; 139. crypto/bn/bn_lib.c:140:5: 138. { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA }; 139. 140. > return (&const_one); 141. } 142. crypto/bn/bn_lib.c:141:1: return from a call to BN_value_one 139. 140. return (&const_one); 141. > } 142. 143. int BN_num_bits_word(BN_ULONG l) crypto/dsa/dsa_gen.c:657:9: Taking true branch 655. return -1; 656. BN_CTX_start(ctx); 657. if (BN_cmp(dsa->g, BN_value_one()) <= 0) ^ 658. return 0; 659. if (BN_cmp(dsa->g, dsa->p) >= 0) crypto/dsa/dsa_gen.c:658:9: 656. BN_CTX_start(ctx); 657. if (BN_cmp(dsa->g, BN_value_one()) <= 0) 658. > return 0; 659. if (BN_cmp(dsa->g, dsa->p) >= 0) 660. return 0;
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/dsa/dsa_gen.c/#L658
d2a_code_trace_data_42276
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecdsa_ossl.c:382: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 13 steps of the trace crypto/ec/ecdsa_ossl.c:337:5: Call 335. return -1; 336. } 337. BN_CTX_start(ctx); ^ 338. u1 = BN_CTX_get(ctx); 339. u2 = 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/ec/ecdsa_ossl.c:382:10: Call 380. } 381. /* u1 = m * tmp mod order */ 382. if (!BN_mod_mul(u1, m, u2, order, ctx)) { ^ 383. ECerr(EC_F_OSSL_ECDSA_VERIFY_SIG, ERR_R_BN_LIB); 384. goto err; crypto/bn/bn_mod.c:203:5: Call 201. bn_check_top(m); 202. 203. BN_CTX_start(ctx); ^ 204. if ((t = BN_CTX_get(ctx)) == NULL) 205. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mod.c:218:5: Call 216. ret = 1; 217. err: 218. BN_CTX_end(ctx); ^ 219. return ret; 220. } crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 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_42277
int BUF_MEM_grow_clean(BUF_MEM *str, size_t len) { char *ret; size_t n; if (str->length >= len) { memset(&str->data[len],0,str->length-len); str->length=len; return(len); } if (str->max >= len) { memset(&str->data[str->length],0,len-str->length); str->length=len; return(len); } if (len > LIMIT_BEFORE_EXPANSION) { BUFerr(BUF_F_BUF_MEM_GROW_CLEAN,ERR_R_MALLOC_FAILURE); return 0; } n=(len+3)/3*4; if (str->data == NULL) ret=OPENSSL_malloc(n); else ret=OPENSSL_realloc_clean(str->data,str->max,n); if (ret == NULL) { BUFerr(BUF_F_BUF_MEM_GROW_CLEAN,ERR_R_MALLOC_FAILURE); len=0; } else { str->data=ret; str->max=n; memset(&str->data[str->length],0,len-str->length); str->length=len; } return(len); } ssl/s3_srvr.c:431: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 10):unsigned64 by call to `ssl3_send_server_certificate`. Showing all 13 steps of the trace ssl/s3_srvr.c:213:1: Parameter `s->init_buf->length` 211. ssl3_get_server_method) 212. 213. > int ssl3_accept(SSL *s) 214. { 215. BUF_MEM *buf; ssl/s3_srvr.c:431:9: Call 429. && !(s->s3->tmp.new_cipher->algorithm_auth & SSL_aKRB5)) 430. { 431. ret=ssl3_send_server_certificate(s); ^ 432. if (ret <= 0) goto end; 433. #ifndef OPENSSL_NO_TLSEXT ssl/s3_srvr.c:3461:1: Parameter `s->init_buf->length` 3459. } 3460. 3461. > int ssl3_send_server_certificate(SSL *s) 3462. { 3463. CERT_PKEY *cpk; ssl/s3_srvr.c:3479:8: Call 3477. } 3478. 3479. if (!ssl3_output_cert_chain(s,cpk)) ^ 3480. { 3481. SSLerr(SSL_F_SSL3_SEND_SERVER_CERTIFICATE,ERR_R_INTERNAL_ERROR); ssl/s3_both.c:323:1: Parameter `s->init_buf->length` 321. } 322. 323. > unsigned long ssl3_output_cert_chain(SSL *s, CERT_PKEY *cpk) 324. { 325. unsigned char *p; ssl/s3_both.c:328:7: Call 326. unsigned long l = 3 + SSL_HM_HEADER_LENGTH(s); 327. 328. if (!ssl_add_cert_chain(s, cpk, &l)) ^ 329. return 0; 330. ssl/ssl_cert.c:1114:1: Parameter `s->init_buf->length` 1112. 1113. /* Add certificate chain to internal SSL BUF_MEM strcuture */ 1114. > int ssl_add_cert_chain(SSL *s, CERT_PKEY *cpk, unsigned long *l) 1115. { 1116. BUF_MEM *buf = s->init_buf; ssl/ssl_cert.c:1124:7: Call 1122. 1123. /* TLSv1 sends a chain with nothing in it, instead of an alert */ 1124. if (!BUF_MEM_grow_clean(buf,10)) ^ 1125. { 1126. SSLerr(SSL_F_SSL_ADD_CERT_CHAIN,ERR_R_BUF_LIB); crypto/buffer/buffer.c:139:1: <LHS trace> 137. } 138. 139. > int BUF_MEM_grow_clean(BUF_MEM *str, size_t len) 140. { 141. char *ret; crypto/buffer/buffer.c:139:1: Parameter `len` 137. } 138. 139. > int BUF_MEM_grow_clean(BUF_MEM *str, size_t len) 140. { 141. char *ret; crypto/buffer/buffer.c:139:1: <RHS trace> 137. } 138. 139. > int BUF_MEM_grow_clean(BUF_MEM *str, size_t len) 140. { 141. char *ret; crypto/buffer/buffer.c:139:1: Parameter `len` 137. } 138. 139. > int BUF_MEM_grow_clean(BUF_MEM *str, size_t len) 140. { 141. char *ret; crypto/buffer/buffer.c:146:3: Binary operation: ([0, +oo] - 10):unsigned64 by call to `ssl3_send_server_certificate` 144. if (str->length >= len) 145. { 146. memset(&str->data[len],0,str->length-len); ^ 147. str->length=len; 148. return(len);
https://github.com/openssl/openssl/blob/66f96fe2d519147097c118d4bf60704c69ed0635/crypto/buffer/buffer.c/#L146
d2a_code_trace_data_42278
static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit) { ASFContext *asf = s->priv_data; AVPacket pkt1, *pkt = &pkt1; ASFStream *asf_st; int64_t pts; int64_t pos= *ppos; int i; int64_t start_pos[s->nb_streams]; for(i=0; i<s->nb_streams; i++){ start_pos[i]= pos; } pos= (pos+asf->packet_size-1-s->data_offset)/asf->packet_size*asf->packet_size+ s->data_offset; *ppos= pos; url_fseek(s->pb, pos, SEEK_SET); asf_reset_header(s); for(;;){ if (av_read_frame(s, pkt) < 0){ av_log(s, AV_LOG_INFO, "asf_read_pts failed\n"); return AV_NOPTS_VALUE; } pts= pkt->pts; av_free_packet(pkt); if(pkt->flags&PKT_FLAG_KEY){ i= pkt->stream_index; asf_st= s->streams[i]->priv_data; pos= asf_st->packet_pos; av_add_index_entry(s->streams[i], pos, pts, pkt->size, pos - start_pos[i] + 1, AVINDEX_KEYFRAME); start_pos[i]= asf_st->packet_pos + 1; if(pkt->stream_index == stream_index) break; } } *ppos= pos; return pts; } libavformat/asf.c:992: error: Uninitialized Value The value read from pts was never initialized. libavformat/asf.c:992:5: 990. //printf("found keyframe at %"PRId64" stream %d stamp:%"PRId64"\n", *ppos, stream_index, pts); 991. 992. return pts; ^ 993. } 994.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/asf.c/#L992
d2a_code_trace_data_42279
static ngx_int_t ngx_http_fastcgi_process_header(ngx_http_request_t *r) { u_char *p, *msg, *start, *last, *part_start, *part_end; size_t size; ngx_str_t *status_line, *pattern; ngx_int_t rc, status; ngx_buf_t buf; ngx_uint_t i; ngx_table_elt_t *h; ngx_http_upstream_t *u; ngx_http_fastcgi_ctx_t *f; ngx_http_upstream_header_t *hh; ngx_http_fastcgi_loc_conf_t *flcf; ngx_http_fastcgi_split_part_t *part; ngx_http_upstream_main_conf_t *umcf; f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module); umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); u = r->upstream; for ( ;; ) { if (f->state < ngx_http_fastcgi_st_data) { f->pos = u->buffer.pos; f->last = u->buffer.last; rc = ngx_http_fastcgi_process_record(r, f); u->buffer.pos = f->pos; u->buffer.last = f->last; if (rc == NGX_AGAIN) { return NGX_AGAIN; } if (rc == NGX_ERROR) { return NGX_HTTP_UPSTREAM_INVALID_HEADER; } if (f->type != NGX_HTTP_FASTCGI_STDOUT && f->type != NGX_HTTP_FASTCGI_STDERR) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "upstream sent unexpected FastCGI record: %d", f->type); return NGX_HTTP_UPSTREAM_INVALID_HEADER; } if (f->type == NGX_HTTP_FASTCGI_STDOUT && f->length == 0) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "upstream closed prematurely FastCGI stdout"); return NGX_HTTP_UPSTREAM_INVALID_HEADER; } } if (f->state == ngx_http_fastcgi_st_padding) { if (u->buffer.pos + f->padding < u->buffer.last) { f->state = ngx_http_fastcgi_st_version; u->buffer.pos += f->padding; continue; } if (u->buffer.pos + f->padding == u->buffer.last) { f->state = ngx_http_fastcgi_st_version; u->buffer.pos = u->buffer.last; return NGX_AGAIN; } f->padding -= u->buffer.last - u->buffer.pos; u->buffer.pos = u->buffer.last; return NGX_AGAIN; } if (f->type == NGX_HTTP_FASTCGI_STDERR) { if (f->length) { msg = u->buffer.pos; if (u->buffer.pos + f->length <= u->buffer.last) { u->buffer.pos += f->length; f->length = 0; f->state = ngx_http_fastcgi_st_padding; } else { f->length -= u->buffer.last - u->buffer.pos; u->buffer.pos = u->buffer.last; } for (p = u->buffer.pos - 1; msg < p; p--) { if (*p != LF && *p != CR && *p != '.' && *p != ' ') { break; } } p++; ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "FastCGI sent in stderr: \"%*s\"", p - msg, msg); flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module); if (flcf->catch_stderr) { pattern = flcf->catch_stderr->elts; for (i = 0; i < flcf->catch_stderr->nelts; i++) { if (ngx_strnstr(msg, (char *) pattern[i].data, p - msg) != NULL) { return NGX_HTTP_UPSTREAM_INVALID_HEADER; } } } if (u->buffer.pos == u->buffer.last) { if (!f->fastcgi_stdout) { u->buffer.pos = u->buffer.start; u->buffer.last = u->buffer.start; } return NGX_AGAIN; } } else { f->state = ngx_http_fastcgi_st_version; } continue; } f->fastcgi_stdout = 1; start = u->buffer.pos; if (u->buffer.pos + f->length < u->buffer.last) { last = u->buffer.last; u->buffer.last = u->buffer.pos + f->length; } else { last = NULL; } for ( ;; ) { part_start = u->buffer.pos; part_end = u->buffer.last; rc = ngx_http_parse_header_line(r, &u->buffer, 1); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http fastcgi parser: %d", rc); if (rc == NGX_AGAIN) { break; } if (rc == NGX_OK) { h = ngx_list_push(&u->headers_in.headers); if (h == NULL) { return NGX_ERROR; } if (f->split_parts && f->split_parts->nelts) { part = f->split_parts->elts; size = u->buffer.pos - part_start; for (i = 0; i < f->split_parts->nelts; i++) { size += part[i].end - part[i].start; } p = ngx_pnalloc(r->pool, size); if (p == NULL) { return NGX_ERROR; } buf.pos = p; for (i = 0; i < f->split_parts->nelts; i++) { p = ngx_cpymem(p, part[i].start, part[i].end - part[i].start); } p = ngx_cpymem(p, part_start, u->buffer.pos - part_start); buf.last = p; f->split_parts->nelts = 0; rc = ngx_http_parse_header_line(r, &buf, 1); h->key.len = r->header_name_end - r->header_name_start; h->key.data = r->header_name_start; h->key.data[h->key.len] = '\0'; h->value.len = r->header_end - r->header_start; h->value.data = r->header_start; h->value.data[h->value.len] = '\0'; h->lowcase_key = ngx_pnalloc(r->pool, h->key.len); if (h->lowcase_key == NULL) { return NGX_ERROR; } } else { h->key.len = r->header_name_end - r->header_name_start; h->value.len = r->header_end - r->header_start; h->key.data = ngx_pnalloc(r->pool, h->key.len + 1 + h->value.len + 1 + h->key.len); if (h->key.data == NULL) { return NGX_ERROR; } h->value.data = h->key.data + h->key.len + 1; h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1; ngx_cpystrn(h->key.data, r->header_name_start, h->key.len + 1); ngx_cpystrn(h->value.data, r->header_start, h->value.len + 1); } h->hash = r->header_hash; if (h->key.len == r->lowcase_index) { ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len); } else { ngx_strlow(h->lowcase_key, h->key.data, h->key.len); } hh = ngx_hash_find(&umcf->headers_in_hash, h->hash, h->lowcase_key, h->key.len); if (hh && hh->handler(r, h, hh->offset) != NGX_OK) { return NGX_ERROR; } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http fastcgi header: \"%V: %V\"", &h->key, &h->value); if (u->buffer.pos < u->buffer.last) { continue; } break; } if (rc == NGX_HTTP_PARSE_HEADER_DONE) { ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http fastcgi header done"); if (u->headers_in.status) { status_line = &u->headers_in.status->value; status = ngx_atoi(status_line->data, 3); if (status == NGX_ERROR) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "upstream sent invalid status \"%V\"", status_line); return NGX_HTTP_UPSTREAM_INVALID_HEADER; } u->headers_in.status_n = status; u->headers_in.status_line = *status_line; } else if (u->headers_in.location) { u->headers_in.status_n = 302; u->headers_in.status_line.len = sizeof("302 Moved Temporarily") - 1; u->headers_in.status_line.data = (u_char *) "302 Moved Temporarily"; } else { u->headers_in.status_n = 200; u->headers_in.status_line.len = sizeof("200 OK") - 1; u->headers_in.status_line.data = (u_char *) "200 OK"; } if (u->state) { u->state->status = u->headers_in.status_n; } break; } ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "upstream sent invalid header"); return NGX_HTTP_UPSTREAM_INVALID_HEADER; } if (last) { u->buffer.last = last; } f->length -= u->buffer.pos - start; if (f->length == 0) { if (f->padding) { f->state = ngx_http_fastcgi_st_padding; } else { f->state = ngx_http_fastcgi_st_version; } } if (rc == NGX_HTTP_PARSE_HEADER_DONE) { return NGX_OK; } if (rc == NGX_OK) { continue; } ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upstream split a header line in FastCGI records"); if (f->split_parts == NULL) { f->split_parts = ngx_array_create(r->pool, 1, sizeof(ngx_http_fastcgi_split_part_t)); if (f->split_parts == NULL) { return NGX_ERROR; } } part = ngx_array_push(f->split_parts); part->start = part_start; part->end = part_end; if (u->buffer.pos < u->buffer.last) { continue; } return NGX_AGAIN; } } src/http/modules/ngx_http_fastcgi_module.c:1440: error: Uninitialized Value The value read from part_start was never initialized. src/http/modules/ngx_http_fastcgi_module.c:1440:9: 1438. part = ngx_array_push(f->split_parts); 1439. 1440. part->start = part_start; ^ 1441. part->end = part_end; 1442.
https://github.com/nginx/nginx/blob/e5b2d3c6b2a132bbbbac0249566f0da7ff12bc39/src/http/modules/ngx_http_fastcgi_module.c/#L1440
d2a_code_trace_data_42280
static int decode_mb_cabac(H264Context *h) { MpegEncContext * const s = &h->s; const int mb_xy= s->mb_x + s->mb_y*s->mb_stride; int mb_type, partition_count, cbp = 0; int dct8x8_allowed= h->pps.transform_8x8_mode; s->dsp.clear_blocks(h->mb); tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y); if( h->slice_type != FF_I_TYPE && h->slice_type != FF_SI_TYPE ) { int skip; if( FRAME_MBAFF && s->mb_x==0 && (s->mb_y&1)==0 ) predict_field_decoding_flag(h); if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped ) skip = h->next_mb_skipped; else skip = decode_cabac_mb_skip( h, s->mb_x, s->mb_y ); if( skip ) { if( FRAME_MBAFF && (s->mb_y&1)==0 ){ s->current_picture.mb_type[mb_xy] = MB_TYPE_SKIP; h->next_mb_skipped = decode_cabac_mb_skip( h, s->mb_x, s->mb_y+1 ); if(h->next_mb_skipped) predict_field_decoding_flag(h); else h->mb_mbaff = h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h); } decode_mb_skip(h); h->cbp_table[mb_xy] = 0; h->chroma_pred_mode_table[mb_xy] = 0; h->last_qscale_diff = 0; return 0; } } if(FRAME_MBAFF){ if( (s->mb_y&1) == 0 ) h->mb_mbaff = h->mb_field_decoding_flag = decode_cabac_field_decoding_flag(h); }else h->mb_field_decoding_flag= (s->picture_structure!=PICT_FRAME); h->prev_mb_skipped = 0; compute_mb_neighbors(h); if( ( mb_type = decode_cabac_mb_type( h ) ) < 0 ) { av_log( h->s.avctx, AV_LOG_ERROR, "decode_cabac_mb_type failed\n" ); return -1; } if( h->slice_type == FF_B_TYPE ) { if( mb_type < 23 ){ partition_count= b_mb_type_info[mb_type].partition_count; mb_type= b_mb_type_info[mb_type].type; }else{ mb_type -= 23; goto decode_intra_mb; } } else if( h->slice_type == FF_P_TYPE ) { if( mb_type < 5) { partition_count= p_mb_type_info[mb_type].partition_count; mb_type= p_mb_type_info[mb_type].type; } else { mb_type -= 5; goto decode_intra_mb; } } else { assert(h->slice_type == FF_I_TYPE); decode_intra_mb: partition_count = 0; cbp= i_mb_type_info[mb_type].cbp; h->intra16x16_pred_mode= i_mb_type_info[mb_type].pred_mode; mb_type= i_mb_type_info[mb_type].type; } if(MB_FIELD) mb_type |= MB_TYPE_INTERLACED; h->slice_table[ mb_xy ]= h->slice_num; if(IS_INTRA_PCM(mb_type)) { const uint8_t *ptr; unsigned int x, y; ptr= h->cabac.bytestream; if(h->cabac.low&0x1) ptr--; if(CABAC_BITS==16){ if(h->cabac.low&0x1FF) ptr--; } for(y=0; y<16; y++){ const int index= 4*(y&3) + 32*((y>>2)&1) + 128*(y>>3); for(x=0; x<16; x++){ tprintf(s->avctx, "LUMA ICPM LEVEL (%3d)\n", *ptr); h->mb[index + (x&3) + 16*((x>>2)&1) + 64*(x>>3)]= *ptr++; } } for(y=0; y<8; y++){ const int index= 256 + 4*(y&3) + 32*(y>>2); for(x=0; x<8; x++){ tprintf(s->avctx, "CHROMA U ICPM LEVEL (%3d)\n", *ptr); h->mb[index + (x&3) + 16*(x>>2)]= *ptr++; } } for(y=0; y<8; y++){ const int index= 256 + 64 + 4*(y&3) + 32*(y>>2); for(x=0; x<8; x++){ tprintf(s->avctx, "CHROMA V ICPM LEVEL (%3d)\n", *ptr); h->mb[index + (x&3) + 16*(x>>2)]= *ptr++; } } ff_init_cabac_decoder(&h->cabac, ptr, h->cabac.bytestream_end - ptr); h->cbp_table[mb_xy] = 0x1ef; h->chroma_pred_mode_table[mb_xy] = 0; s->current_picture.qscale_table[mb_xy]= 0; h->chroma_qp[0] = get_chroma_qp(h, 0, 0); h->chroma_qp[1] = get_chroma_qp(h, 1, 0); memset(h->non_zero_count[mb_xy], 16, 16); s->current_picture.mb_type[mb_xy]= mb_type; return 0; } if(MB_MBAFF){ h->ref_count[0] <<= 1; h->ref_count[1] <<= 1; } fill_caches(h, mb_type, 0); if( IS_INTRA( mb_type ) ) { int i, pred_mode; if( IS_INTRA4x4( mb_type ) ) { if( dct8x8_allowed && decode_cabac_mb_transform_size( h ) ) { mb_type |= MB_TYPE_8x8DCT; for( i = 0; i < 16; i+=4 ) { int pred = pred_intra_mode( h, i ); int mode = decode_cabac_mb_intra4x4_pred_mode( h, pred ); fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 ); } } else { for( i = 0; i < 16; i++ ) { int pred = pred_intra_mode( h, i ); h->intra4x4_pred_mode_cache[ scan8[i] ] = decode_cabac_mb_intra4x4_pred_mode( h, pred ); } } write_back_intra_pred_mode(h); if( check_intra4x4_pred_mode(h) < 0 ) return -1; } else { h->intra16x16_pred_mode= check_intra_pred_mode( h, h->intra16x16_pred_mode ); if( h->intra16x16_pred_mode < 0 ) return -1; } h->chroma_pred_mode_table[mb_xy] = pred_mode = decode_cabac_mb_chroma_pre_mode( h ); pred_mode= check_intra_pred_mode( h, pred_mode ); if( pred_mode < 0 ) return -1; h->chroma_pred_mode= pred_mode; } else if( partition_count == 4 ) { int i, j, sub_partition_count[4], list, ref[2][4]; if( h->slice_type == FF_B_TYPE ) { for( i = 0; i < 4; i++ ) { h->sub_mb_type[i] = decode_cabac_b_mb_sub_type( h ); sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; h->sub_mb_type[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].type; } if( IS_DIRECT(h->sub_mb_type[0] | h->sub_mb_type[1] | h->sub_mb_type[2] | h->sub_mb_type[3]) ) { pred_direct_motion(h, &mb_type); h->ref_cache[0][scan8[4]] = h->ref_cache[1][scan8[4]] = h->ref_cache[0][scan8[12]] = h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE; if( h->ref_count[0] > 1 || h->ref_count[1] > 1 ) { for( i = 0; i < 4; i++ ) if( IS_DIRECT(h->sub_mb_type[i]) ) fill_rectangle( &h->direct_cache[scan8[4*i]], 2, 2, 8, 1, 1 ); } } } else { for( i = 0; i < 4; i++ ) { h->sub_mb_type[i] = decode_cabac_p_mb_sub_type( h ); sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; h->sub_mb_type[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].type; } } for( list = 0; list < h->list_count; list++ ) { for( i = 0; i < 4; i++ ) { if(IS_DIRECT(h->sub_mb_type[i])) continue; if(IS_DIR(h->sub_mb_type[i], 0, list)){ if( h->ref_count[list] > 1 ) ref[list][i] = decode_cabac_mb_ref( h, list, 4*i ); else ref[list][i] = 0; } else { ref[list][i] = -1; } h->ref_cache[list][ scan8[4*i]+1 ]= h->ref_cache[list][ scan8[4*i]+8 ]=h->ref_cache[list][ scan8[4*i]+9 ]= ref[list][i]; } } if(dct8x8_allowed) dct8x8_allowed = get_dct8x8_allowed(h); for(list=0; list<h->list_count; list++){ for(i=0; i<4; i++){ h->ref_cache[list][ scan8[4*i] ]=h->ref_cache[list][ scan8[4*i]+1 ]; if(IS_DIRECT(h->sub_mb_type[i])){ fill_rectangle(h->mvd_cache[list][scan8[4*i]], 2, 2, 8, 0, 4); continue; } if(IS_DIR(h->sub_mb_type[i], 0, list) && !IS_DIRECT(h->sub_mb_type[i])){ const int sub_mb_type= h->sub_mb_type[i]; const int block_width= (sub_mb_type & (MB_TYPE_16x16|MB_TYPE_16x8)) ? 2 : 1; for(j=0; j<sub_partition_count[i]; j++){ int mpx, mpy; int mx, my; const int index= 4*i + block_width*j; int16_t (* mv_cache)[2]= &h->mv_cache[list][ scan8[index] ]; int16_t (* mvd_cache)[2]= &h->mvd_cache[list][ scan8[index] ]; pred_motion(h, index, block_width, list, h->ref_cache[list][ scan8[index] ], &mpx, &mpy); mx = mpx + decode_cabac_mb_mvd( h, list, index, 0 ); my = mpy + decode_cabac_mb_mvd( h, list, index, 1 ); tprintf(s->avctx, "final mv:%d %d\n", mx, my); if(IS_SUB_8X8(sub_mb_type)){ mv_cache[ 1 ][0]= mv_cache[ 8 ][0]= mv_cache[ 9 ][0]= mx; mv_cache[ 1 ][1]= mv_cache[ 8 ][1]= mv_cache[ 9 ][1]= my; mvd_cache[ 1 ][0]= mvd_cache[ 8 ][0]= mvd_cache[ 9 ][0]= mx - mpx; mvd_cache[ 1 ][1]= mvd_cache[ 8 ][1]= mvd_cache[ 9 ][1]= my - mpy; }else if(IS_SUB_8X4(sub_mb_type)){ mv_cache[ 1 ][0]= mx; mv_cache[ 1 ][1]= my; mvd_cache[ 1 ][0]= mx - mpx; mvd_cache[ 1 ][1]= my - mpy; }else if(IS_SUB_4X8(sub_mb_type)){ mv_cache[ 8 ][0]= mx; mv_cache[ 8 ][1]= my; mvd_cache[ 8 ][0]= mx - mpx; mvd_cache[ 8 ][1]= my - mpy; } mv_cache[ 0 ][0]= mx; mv_cache[ 0 ][1]= my; mvd_cache[ 0 ][0]= mx - mpx; mvd_cache[ 0 ][1]= my - mpy; } }else{ uint32_t *p= (uint32_t *)&h->mv_cache[list][ scan8[4*i] ][0]; uint32_t *pd= (uint32_t *)&h->mvd_cache[list][ scan8[4*i] ][0]; p[0] = p[1] = p[8] = p[9] = 0; pd[0]= pd[1]= pd[8]= pd[9]= 0; } } } } else if( IS_DIRECT(mb_type) ) { pred_direct_motion(h, &mb_type); fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 4); fill_rectangle(h->mvd_cache[1][scan8[0]], 4, 4, 8, 0, 4); dct8x8_allowed &= h->sps.direct_8x8_inference_flag; } else { int list, mx, my, i, mpx, mpy; if(IS_16X16(mb_type)){ for(list=0; list<h->list_count; list++){ if(IS_DIR(mb_type, 0, list)){ const int ref = h->ref_count[list] > 1 ? decode_cabac_mb_ref( h, list, 0 ) : 0; fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, ref, 1); }else fill_rectangle(&h->ref_cache[list][ scan8[0] ], 4, 4, 8, (uint8_t)LIST_NOT_USED, 1); } for(list=0; list<h->list_count; list++){ if(IS_DIR(mb_type, 0, list)){ pred_motion(h, 0, 4, list, h->ref_cache[list][ scan8[0] ], &mpx, &mpy); mx = mpx + decode_cabac_mb_mvd( h, list, 0, 0 ); my = mpy + decode_cabac_mb_mvd( h, list, 0, 1 ); tprintf(s->avctx, "final mv:%d %d\n", mx, my); fill_rectangle(h->mvd_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx-mpx,my-mpy), 4); fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4); }else fill_rectangle(h->mv_cache[list][ scan8[0] ], 4, 4, 8, 0, 4); } } else if(IS_16X8(mb_type)){ for(list=0; list<h->list_count; list++){ for(i=0; i<2; i++){ if(IS_DIR(mb_type, i, list)){ const int ref= h->ref_count[list] > 1 ? decode_cabac_mb_ref( h, list, 8*i ) : 0; fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, ref, 1); }else fill_rectangle(&h->ref_cache[list][ scan8[0] + 16*i ], 4, 2, 8, (LIST_NOT_USED&0xFF), 1); } } for(list=0; list<h->list_count; list++){ for(i=0; i<2; i++){ if(IS_DIR(mb_type, i, list)){ pred_16x8_motion(h, 8*i, list, h->ref_cache[list][scan8[0] + 16*i], &mpx, &mpy); mx = mpx + decode_cabac_mb_mvd( h, list, 8*i, 0 ); my = mpy + decode_cabac_mb_mvd( h, list, 8*i, 1 ); tprintf(s->avctx, "final mv:%d %d\n", mx, my); fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx-mpx,my-mpy), 4); fill_rectangle(h->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx,my), 4); }else{ fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 4); fill_rectangle(h-> mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 4); } } } }else{ assert(IS_8X16(mb_type)); for(list=0; list<h->list_count; list++){ for(i=0; i<2; i++){ if(IS_DIR(mb_type, i, list)){ const int ref= h->ref_count[list] > 1 ? decode_cabac_mb_ref( h, list, 4*i ) : 0; fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, ref, 1); }else fill_rectangle(&h->ref_cache[list][ scan8[0] + 2*i ], 2, 4, 8, (LIST_NOT_USED&0xFF), 1); } } for(list=0; list<h->list_count; list++){ for(i=0; i<2; i++){ if(IS_DIR(mb_type, i, list)){ pred_8x16_motion(h, i*4, list, h->ref_cache[list][ scan8[0] + 2*i ], &mpx, &mpy); mx = mpx + decode_cabac_mb_mvd( h, list, 4*i, 0 ); my = mpy + decode_cabac_mb_mvd( h, list, 4*i, 1 ); tprintf(s->avctx, "final mv:%d %d\n", mx, my); fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx-mpx,my-mpy), 4); fill_rectangle(h->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx,my), 4); }else{ fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 4); fill_rectangle(h-> mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 4); } } } } } if( IS_INTER( mb_type ) ) { h->chroma_pred_mode_table[mb_xy] = 0; write_back_motion( h, mb_type ); } if( !IS_INTRA16x16( mb_type ) ) { cbp = decode_cabac_mb_cbp_luma( h ); cbp |= decode_cabac_mb_cbp_chroma( h ) << 4; } h->cbp_table[mb_xy] = h->cbp = cbp; if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) { if( decode_cabac_mb_transform_size( h ) ) mb_type |= MB_TYPE_8x8DCT; } s->current_picture.mb_type[mb_xy]= mb_type; if( cbp || IS_INTRA16x16( mb_type ) ) { const uint8_t *scan, *scan8x8, *dc_scan; const uint32_t *qmul; int dqp; if(IS_INTERLACED(mb_type)){ scan8x8= s->qscale ? h->field_scan8x8 : h->field_scan8x8_q0; scan= s->qscale ? h->field_scan : h->field_scan_q0; dc_scan= luma_dc_field_scan; }else{ scan8x8= s->qscale ? h->zigzag_scan8x8 : h->zigzag_scan8x8_q0; scan= s->qscale ? h->zigzag_scan : h->zigzag_scan_q0; dc_scan= luma_dc_zigzag_scan; } h->last_qscale_diff = dqp = decode_cabac_mb_dqp( h ); if( dqp == INT_MIN ){ av_log(h->s.avctx, AV_LOG_ERROR, "cabac decode of qscale diff failed at %d %d\n", s->mb_x, s->mb_y); return -1; } s->qscale += dqp; if(((unsigned)s->qscale) > 51){ if(s->qscale<0) s->qscale+= 52; else s->qscale-= 52; } h->chroma_qp[0] = get_chroma_qp(h, 0, s->qscale); h->chroma_qp[1] = get_chroma_qp(h, 1, s->qscale); if( IS_INTRA16x16( mb_type ) ) { int i; decode_cabac_residual( h, h->mb, 0, 0, dc_scan, NULL, 16); if( cbp&15 ) { qmul = h->dequant4_coeff[0][s->qscale]; for( i = 0; i < 16; i++ ) { decode_cabac_residual(h, h->mb + 16*i, 1, i, scan + 1, qmul, 15); } } else { fill_rectangle(&h->non_zero_count_cache[scan8[0]], 4, 4, 8, 0, 1); } } else { int i8x8, i4x4; for( i8x8 = 0; i8x8 < 4; i8x8++ ) { if( cbp & (1<<i8x8) ) { if( IS_8x8DCT(mb_type) ) { decode_cabac_residual(h, h->mb + 64*i8x8, 5, 4*i8x8, scan8x8, h->dequant8_coeff[IS_INTRA( mb_type ) ? 0:1][s->qscale], 64); } else { qmul = h->dequant4_coeff[IS_INTRA( mb_type ) ? 0:3][s->qscale]; for( i4x4 = 0; i4x4 < 4; i4x4++ ) { const int index = 4*i8x8 + i4x4; decode_cabac_residual(h, h->mb + 16*index, 2, index, scan, qmul, 16); } } } else { uint8_t * const nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ]; nnz[0] = nnz[1] = nnz[8] = nnz[9] = 0; } } } if( cbp&0x30 ){ int c; for( c = 0; c < 2; c++ ) { decode_cabac_residual(h, h->mb + 256 + 16*4*c, 3, c, chroma_dc_scan, NULL, 4); } } if( cbp&0x20 ) { int c, i; for( c = 0; c < 2; c++ ) { qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]]; for( i = 0; i < 4; i++ ) { const int index = 16 + 4 * c + i; decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, qmul, 15); } } } else { uint8_t * const nnz= &h->non_zero_count_cache[0]; nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] = nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0; } } else { uint8_t * const nnz= &h->non_zero_count_cache[0]; fill_rectangle(&nnz[scan8[0]], 4, 4, 8, 0, 1); nnz[ scan8[16]+0 ] = nnz[ scan8[16]+1 ] =nnz[ scan8[16]+8 ] =nnz[ scan8[16]+9 ] = nnz[ scan8[20]+0 ] = nnz[ scan8[20]+1 ] =nnz[ scan8[20]+8 ] =nnz[ scan8[20]+9 ] = 0; h->last_qscale_diff = 0; } s->current_picture.qscale_table[mb_xy]= s->qscale; write_back_non_zero_count(h); if(MB_MBAFF){ h->ref_count[0] >>= 1; h->ref_count[1] >>= 1; } return 0; } libavcodec/h264.c:5853: error: Buffer Overrun L1 Offset: 9 Size: 1. libavcodec/h264.c:5716:5: <Length trace> 5714. } 5715. 5716. fill_caches(h, mb_type, 0); ^ 5717. 5718. if( IS_INTRA( mb_type ) ) { libavcodec/h264.c:5716:5: Call 5714. } 5715. 5716. fill_caches(h, mb_type, 0); ^ 5717. 5718. if( IS_INTRA( mb_type ) ) { libavcodec/h264.c:79:1: Parameter `h->mvd_cache[*][*][*]` 77. 78. 79. static void fill_caches(H264Context *h, int mb_type, int for_deblock){ ^ 80. MpegEncContext * const s = &h->s; 81. const int mb_xy= s->mb_x + s->mb_y*s->mb_stride; libavcodec/h264.c:5851:21: Assignment 5849. }else{ 5850. uint32_t *p= (uint32_t *)&h->mv_cache[list][ scan8[4*i] ][0]; 5851. uint32_t *pd= (uint32_t *)&h->mvd_cache[list][ scan8[4*i] ][0]; ^ 5852. p[0] = p[1] = p[8] = p[9] = 0; 5853. pd[0]= pd[1]= pd[8]= pd[9]= 0; libavcodec/h264.c:5853:42: Array access: Offset: 9 Size: 1 5851. uint32_t *pd= (uint32_t *)&h->mvd_cache[list][ scan8[4*i] ][0]; 5852. p[0] = p[1] = p[8] = p[9] = 0; 5853. pd[0]= pd[1]= pd[8]= pd[9]= 0; ^ 5854. } 5855. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L5853
d2a_code_trace_data_42281
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/ec/ec_mult.c:196: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, +oo] by call to `BN_mul`. Showing all 19 steps of the trace crypto/ec/ec_mult.c:188:19: Call 186. EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME); 187. 188. cardinality = BN_CTX_get(ctx); ^ 189. lambda = BN_CTX_get(ctx); 190. k = 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/ec/ec_mult.c:196:10: Call 194. } 195. 196. if (!BN_mul(cardinality, group->order, group->cofactor, ctx)) { ^ 197. ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); 198. goto err; 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:602:9: Call 600. } 601. #endif /* BN_RECURSION */ 602. if (bn_wexpand(rr, top) == NULL) ^ 603. goto err; 604. rr->top = top; 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_42282
int ec_key_simple_check_key(const EC_KEY *eckey) { int ok = 0; BN_CTX *ctx = NULL; const BIGNUM *order = NULL; EC_POINT *point = NULL; if (eckey == NULL || eckey->group == NULL || eckey->pub_key == NULL) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_PASSED_NULL_PARAMETER); return 0; } if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key)) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_POINT_AT_INFINITY); goto err; } if ((ctx = BN_CTX_new()) == NULL) goto err; if ((point = EC_POINT_new(eckey->group)) == NULL) goto err; if (EC_POINT_is_on_curve(eckey->group, eckey->pub_key, ctx) <= 0) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_POINT_IS_NOT_ON_CURVE); goto err; } order = eckey->group->order; if (BN_is_zero(order)) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_INVALID_GROUP_ORDER); goto err; } if (!EC_POINT_mul(eckey->group, point, NULL, eckey->pub_key, order, ctx)) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_EC_LIB); goto err; } if (!EC_POINT_is_at_infinity(eckey->group, point)) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_WRONG_ORDER); goto err; } if (eckey->priv_key != NULL) { if (BN_cmp(eckey->priv_key, order) >= 0) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_WRONG_ORDER); goto err; } if (!EC_POINT_mul(eckey->group, point, eckey->priv_key, NULL, NULL, ctx)) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_EC_LIB); goto err; } if (EC_POINT_cmp(eckey->group, point, eckey->pub_key, ctx) != 0) { ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_INVALID_PRIVATE_KEY); goto err; } } ok = 1; err: BN_CTX_free(ctx); EC_POINT_free(point); return ok; } crypto/ec/ec_key.c:332: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 287 could be null and is dereferenced by call to `BN_CTX_free()` at line 332, column 5. Showing all 34 steps of the trace crypto/ec/ec_key.c:270:1: start of procedure ec_key_simple_check_key() 268. } 269. 270. > int ec_key_simple_check_key(const EC_KEY *eckey) 271. { 272. int ok = 0; crypto/ec/ec_key.c:272:5: 270. int ec_key_simple_check_key(const EC_KEY *eckey) 271. { 272. > int ok = 0; 273. BN_CTX *ctx = NULL; 274. const BIGNUM *order = NULL; crypto/ec/ec_key.c:273:5: 271. { 272. int ok = 0; 273. > BN_CTX *ctx = NULL; 274. const BIGNUM *order = NULL; 275. EC_POINT *point = NULL; crypto/ec/ec_key.c:274:5: 272. int ok = 0; 273. BN_CTX *ctx = NULL; 274. > const BIGNUM *order = NULL; 275. EC_POINT *point = NULL; 276. crypto/ec/ec_key.c:275:5: 273. BN_CTX *ctx = NULL; 274. const BIGNUM *order = NULL; 275. > EC_POINT *point = NULL; 276. 277. if (eckey == NULL || eckey->group == NULL || eckey->pub_key == NULL) { crypto/ec/ec_key.c:277:9: Taking false branch 275. EC_POINT *point = NULL; 276. 277. if (eckey == NULL || eckey->group == NULL || eckey->pub_key == NULL) { ^ 278. ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_PASSED_NULL_PARAMETER); 279. return 0; crypto/ec/ec_key.c:277:26: Taking false branch 275. EC_POINT *point = NULL; 276. 277. if (eckey == NULL || eckey->group == NULL || eckey->pub_key == NULL) { ^ 278. ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_PASSED_NULL_PARAMETER); 279. return 0; crypto/ec/ec_key.c:277:50: Taking false branch 275. EC_POINT *point = NULL; 276. 277. if (eckey == NULL || eckey->group == NULL || eckey->pub_key == NULL) { ^ 278. ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, ERR_R_PASSED_NULL_PARAMETER); 279. return 0; crypto/ec/ec_key.c:282:9: 280. } 281. 282. > if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key)) { 283. ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_POINT_AT_INFINITY); 284. goto err; crypto/ec/ec_lib.c:824:1: start of procedure EC_POINT_is_at_infinity() 822. } 823. 824. > int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) 825. { 826. if (group->meth->is_at_infinity == 0) { crypto/ec/ec_lib.c:826:9: Taking false branch 824. int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) 825. { 826. if (group->meth->is_at_infinity == 0) { ^ 827. ECerr(EC_F_EC_POINT_IS_AT_INFINITY, 828. ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); crypto/ec/ec_lib.c:831:9: Taking true branch 829. return 0; 830. } 831. if (group->meth != point->meth) { ^ 832. ECerr(EC_F_EC_POINT_IS_AT_INFINITY, EC_R_INCOMPATIBLE_OBJECTS); 833. return 0; crypto/ec/ec_lib.c:832:9: Skipping ERR_put_error(): empty list of specs 830. } 831. if (group->meth != point->meth) { 832. ECerr(EC_F_EC_POINT_IS_AT_INFINITY, EC_R_INCOMPATIBLE_OBJECTS); ^ 833. return 0; 834. } crypto/ec/ec_lib.c:833:9: 831. if (group->meth != point->meth) { 832. ECerr(EC_F_EC_POINT_IS_AT_INFINITY, EC_R_INCOMPATIBLE_OBJECTS); 833. > return 0; 834. } 835. return group->meth->is_at_infinity(group, point); crypto/ec/ec_lib.c:836:1: return from a call to EC_POINT_is_at_infinity 834. } 835. return group->meth->is_at_infinity(group, point); 836. > } 837. 838. /* crypto/ec/ec_key.c:282:9: Taking false branch 280. } 281. 282. if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key)) { ^ 283. ECerr(EC_F_EC_KEY_SIMPLE_CHECK_KEY, EC_R_POINT_AT_INFINITY); 284. goto err; crypto/ec/ec_key.c:287:9: Taking true branch 285. } 286. 287. if ((ctx = BN_CTX_new()) == NULL) ^ 288. goto err; 289. if ((point = EC_POINT_new(eckey->group)) == NULL) crypto/ec/ec_key.c:331:2: 329. } 330. ok = 1; 331. > err: 332. BN_CTX_free(ctx); 333. EC_POINT_free(point); crypto/ec/ec_key.c:332:5: 330. ok = 1; 331. err: 332. > BN_CTX_free(ctx); 333. EC_POINT_free(point); 334. return ok; crypto/bn/bn_ctx.c:157:1: start of procedure BN_CTX_free() 155. } 156. 157. > void BN_CTX_free(BN_CTX *ctx) 158. { 159. #ifdef BN_CTX_DEBUG crypto/bn/bn_ctx.c:174:5: 172. } 173. #endif 174. > BN_STACK_finish(&ctx->stack); 175. BN_POOL_finish(&ctx->pool); 176. OPENSSL_free(ctx); crypto/bn/bn_ctx.c:243:1: start of procedure BN_STACK_finish() 241. } 242. 243. > static void BN_STACK_finish(BN_STACK *st) 244. { 245. OPENSSL_free(st->indexes); crypto/bn/bn_ctx.c:245:5: 243. static void BN_STACK_finish(BN_STACK *st) 244. { 245. > OPENSSL_free(st->indexes); 246. st->indexes = NULL; 247. } crypto/mem.c:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:298:30: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); ^ 300. return; 301. } crypto/mem.c:300:9: 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); 300. > return; 301. } 302. crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/bn/bn_ctx.c:246:5: 244. { 245. OPENSSL_free(st->indexes); 246. > st->indexes = NULL; 247. } 248. crypto/bn/bn_ctx.c:247:1: return from a call to BN_STACK_finish 245. OPENSSL_free(st->indexes); 246. st->indexes = NULL; 247. > } 248. 249. crypto/bn/bn_ctx.c:175:5: 173. #endif 174. BN_STACK_finish(&ctx->stack); 175. > BN_POOL_finish(&ctx->pool); 176. OPENSSL_free(ctx); 177. } crypto/bn/bn_ctx.c:284:1: start of procedure BN_POOL_finish() 282. } 283. 284. > static void BN_POOL_finish(BN_POOL *p) 285. { 286. unsigned int loop; crypto/bn/bn_ctx.c:289:12: Loop condition is false. Leaving loop 287. BIGNUM *bn; 288. 289. while (p->head) { ^ 290. for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++) 291. if (bn->d)
https://github.com/openssl/openssl/blob/98c03302fb7b855647aa14022f61f5fb272e514a/crypto/ec/ec_key.c/#L332
d2a_code_trace_data_42283
int BN_set_word(BIGNUM *a, BN_ULONG w) { bn_check_top(a); if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) return 0; a->neg = 0; a->d[0] = w; a->top = (w ? 1 : 0); a->flags &= ~BN_FLG_FIXED_TOP; bn_check_top(a); return 1; } crypto/ec/ecp_smpl.c:852: error: BUFFER_OVERRUN_L3 Offset: 0 Size: [0, 8388607] by call to `BN_mod_sub_quick`. Showing all 15 steps of the trace crypto/ec/ecp_smpl.c:823:10: Call 821. 822. BN_CTX_start(ctx); 823. n0 = BN_CTX_get(ctx); ^ 824. n1 = BN_CTX_get(ctx); 825. n2 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c: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/ec/ecp_smpl.c:852:14: Call 850. if (!BN_mod_add_quick(n0, a->X, n1, p)) 851. goto err; 852. if (!BN_mod_sub_quick(n2, a->X, n1, p)) ^ 853. goto err; 854. if (!field_mul(group, n1, n0, n2, ctx)) crypto/bn/bn_mod.c:116:1: Parameter `*r->d` 114. * less than m 115. */ 116. > int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 117. const BIGNUM *m) 118. { crypto/bn/bn_mod.c:119:10: Call 117. const BIGNUM *m) 118. { 119. if (!BN_sub(r, a, b)) ^ 120. return 0; 121. if (r->neg) 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:65:13: Call 63. } else { 64. r_neg = 0; 65. BN_zero(r); ^ 66. ret = 1; 67. } crypto/bn/bn_lib.c:359:1: <Length trace> 357. } 358. 359. > int BN_set_word(BIGNUM *a, BN_ULONG w) 360. { 361. bn_check_top(a); crypto/bn/bn_lib.c:359:1: Parameter `*a->d` 357. } 358. 359. > int BN_set_word(BIGNUM *a, BN_ULONG w) 360. { 361. bn_check_top(a); crypto/bn/bn_lib.c:362:9: Call 360. { 361. bn_check_top(a); 362. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 363. return 0; 364. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `*a->d` 658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 659. 660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 661. { 662. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_lib.c:365:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_mod_sub_quick` 363. return 0; 364. a->neg = 0; 365. a->d[0] = w; ^ 366. a->top = (w ? 1 : 0); 367. a->flags &= ~BN_FLG_FIXED_TOP;
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_lib.c/#L365
d2a_code_trace_data_42284
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecp_smpl.c:188: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`. Showing all 10 steps of the trace crypto/ec/ecp_smpl.c:154:5: Call 152. } 153. 154. BN_CTX_start(ctx); ^ 155. tmp_a = BN_CTX_get(ctx); 156. if (tmp_a == 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/ec/ecp_smpl.c:188:5: Call 186. 187. err: 188. BN_CTX_end(ctx); ^ 189. BN_CTX_free(new_ctx); 190. return ret; crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_42285
int test_kron(BIO *bp, BN_CTX *ctx) { BN_GENCB cb; BIGNUM *a, *b, *r, *t; int i; int legendre, kronecker; int ret = 0; a = BN_new(); b = BN_new(); r = BN_new(); t = BN_new(); if (a == NULL || b == NULL || r == NULL || t == NULL) goto err; BN_GENCB_set(&cb, genprime_cb, NULL); if (!BN_generate_prime_ex(b, 512, 0, NULL, NULL, &cb)) goto err; b->neg = rand_neg(); putc('\n', stderr); for (i = 0; i < num0; i++) { if (!BN_bntest_rand(a, 512, 0, 0)) goto err; a->neg = rand_neg(); if (!BN_copy(t, b)) goto err; t->neg = 0; if (!BN_sub_word(t, 1)) goto err; if (!BN_rshift1(t, t)) goto err; b->neg = 0; if (!BN_mod_exp_recp(r, a, t, b, ctx)) goto err; b->neg = 1; if (BN_is_word(r, 1)) legendre = 1; else if (BN_is_zero(r)) legendre = 0; else { if (!BN_add_word(r, 1)) goto err; if (0 != BN_ucmp(r, b)) { fprintf(stderr, "Legendre symbol computation failed\n"); goto err; } legendre = -1; } kronecker = BN_kronecker(a, b, ctx); if (kronecker < -1) goto err; if (a->neg && b->neg) kronecker = -kronecker; if (legendre != kronecker) { fprintf(stderr, "legendre != kronecker; a = "); BN_print_fp(stderr, a); fprintf(stderr, ", b = "); BN_print_fp(stderr, b); fprintf(stderr, "\n"); goto err; } putc('.', stderr); fflush(stderr); } putc('\n', stderr); fflush(stderr); ret = 1; err: BN_free(a); BN_free(b); BN_free(r); BN_free(t); return ret; } test/bntest.c:1735: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 1653, column 9 is not reachable after line 1735, column 5. Showing all 142 steps of the trace test/bntest.c:1643:1: start of procedure test_kron() 1641. } 1642. 1643. > int test_kron(BIO *bp, BN_CTX *ctx) 1644. { 1645. BN_GENCB cb; test/bntest.c:1649:5: 1647. int i; 1648. int legendre, kronecker; 1649. > int ret = 0; 1650. 1651. a = BN_new(); test/bntest.c:1651:5: 1649. int ret = 0; 1650. 1651. > a = BN_new(); 1652. b = BN_new(); 1653. r = 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:1652:5: 1650. 1651. a = BN_new(); 1652. > b = BN_new(); 1653. r = BN_new(); 1654. t = 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:1653:5: 1651. a = BN_new(); 1652. b = BN_new(); 1653. > r = BN_new(); 1654. t = BN_new(); 1655. if (a == NULL || b == NULL || r == NULL || t == NULL) crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1654:5: 1652. b = BN_new(); 1653. r = BN_new(); 1654. > t = BN_new(); 1655. if (a == NULL || b == NULL || r == NULL || t == NULL) 1656. goto err; 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:1655:9: Taking false branch 1653. r = BN_new(); 1654. t = BN_new(); 1655. if (a == NULL || b == NULL || r == NULL || t == NULL) ^ 1656. goto err; 1657. test/bntest.c:1655:22: Taking false branch 1653. r = BN_new(); 1654. t = BN_new(); 1655. if (a == NULL || b == NULL || r == NULL || t == NULL) ^ 1656. goto err; 1657. test/bntest.c:1655:35: Taking false branch 1653. r = BN_new(); 1654. t = BN_new(); 1655. if (a == NULL || b == NULL || r == NULL || t == NULL) ^ 1656. goto err; 1657. test/bntest.c:1655:48: Taking false branch 1653. r = BN_new(); 1654. t = BN_new(); 1655. if (a == NULL || b == NULL || r == NULL || t == NULL) ^ 1656. goto err; 1657. test/bntest.c:1658:5: 1656. goto err; 1657. 1658. > BN_GENCB_set(&cb, genprime_cb, NULL); 1659. 1660. /* crypto/bn/bn_lib.c:981:1: start of procedure BN_GENCB_set() 979. 980. /* Populate a BN_GENCB structure with a "new"-style callback */ 981. > void BN_GENCB_set(BN_GENCB *gencb, int (*callback) (int, int, BN_GENCB *), 982. void *cb_arg) 983. { crypto/bn/bn_lib.c:984:5: 982. void *cb_arg) 983. { 984. > BN_GENCB *tmp_gencb = gencb; 985. tmp_gencb->ver = 2; 986. tmp_gencb->arg = cb_arg; crypto/bn/bn_lib.c:985:5: 983. { 984. BN_GENCB *tmp_gencb = gencb; 985. > tmp_gencb->ver = 2; 986. tmp_gencb->arg = cb_arg; 987. tmp_gencb->cb.cb_2 = callback; crypto/bn/bn_lib.c:986:5: 984. BN_GENCB *tmp_gencb = gencb; 985. tmp_gencb->ver = 2; 986. > tmp_gencb->arg = cb_arg; 987. tmp_gencb->cb.cb_2 = callback; 988. } crypto/bn/bn_lib.c:987:5: 985. tmp_gencb->ver = 2; 986. tmp_gencb->arg = cb_arg; 987. > tmp_gencb->cb.cb_2 = callback; 988. } 989. crypto/bn/bn_lib.c:988:1: return from a call to BN_GENCB_set 986. tmp_gencb->arg = cb_arg; 987. tmp_gencb->cb.cb_2 = callback; 988. > } 989. 990. void *BN_GENCB_get_arg(BN_GENCB *cb) test/bntest.c:1670:10: Taking true branch 1668. */ 1669. 1670. if (!BN_generate_prime_ex(b, 512, 0, NULL, NULL, &cb)) ^ 1671. goto err; 1672. b->neg = rand_neg(); test/bntest.c:1732:2: 1730. fflush(stderr); 1731. ret = 1; 1732. > err: 1733. BN_free(a); 1734. BN_free(b); test/bntest.c:1733:5: 1731. ret = 1; 1732. err: 1733. > BN_free(a); 1734. BN_free(b); 1735. BN_free(r); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:1734:5: 1732. err: 1733. BN_free(a); 1734. > BN_free(b); 1735. BN_free(r); 1736. BN_free(t); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:1735:5: 1733. BN_free(a); 1734. BN_free(b); 1735. > BN_free(r); 1736. BN_free(t); 1737. return ret; crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L1735
d2a_code_trace_data_42286
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ int i; InternalBuffer *buf, *last; assert(pic->type==FF_BUFFER_TYPE_INTERNAL); assert(s->internal_buffer_count); buf = NULL; for(i=0; i<s->internal_buffer_count; i++){ buf= &((InternalBuffer*)s->internal_buffer)[i]; if(buf->data[0] == pic->data[0]) break; } assert(i < s->internal_buffer_count); s->internal_buffer_count--; last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; FFSWAP(InternalBuffer, *buf, *last); for(i=0; i<4; i++){ pic->data[i]=NULL; } if(s->debug&FF_DEBUG_BUFFERS) av_log(s, AV_LOG_DEBUG, "default_release_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count); } libavcodec/utils.c:367: error: Null Dereference pointer `buf` last assigned on line 357 could be null and is dereferenced at line 367, column 5. libavcodec/utils.c:350:1: start of procedure avcodec_default_release_buffer() 348. } 349. 350. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ ^ 351. int i; 352. InternalBuffer *buf, *last; libavcodec/utils.c:354:5: 352. InternalBuffer *buf, *last; 353. 354. assert(pic->type==FF_BUFFER_TYPE_INTERNAL); ^ 355. assert(s->internal_buffer_count); 356. libavcodec/utils.c:355:5: 353. 354. assert(pic->type==FF_BUFFER_TYPE_INTERNAL); 355. assert(s->internal_buffer_count); ^ 356. 357. buf = NULL; /* avoids warning */ libavcodec/utils.c:357:5: 355. assert(s->internal_buffer_count); 356. 357. buf = NULL; /* avoids warning */ ^ 358. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize 359. buf= &((InternalBuffer*)s->internal_buffer)[i]; libavcodec/utils.c:358:9: 356. 357. buf = NULL; /* avoids warning */ 358. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize ^ 359. buf= &((InternalBuffer*)s->internal_buffer)[i]; 360. if(buf->data[0] == pic->data[0]) libavcodec/utils.c:358:14: Loop condition is false. Leaving loop 356. 357. buf = NULL; /* avoids warning */ 358. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize ^ 359. buf= &((InternalBuffer*)s->internal_buffer)[i]; 360. if(buf->data[0] == pic->data[0]) libavcodec/utils.c:363:5: 361. break; 362. } 363. assert(i < s->internal_buffer_count); ^ 364. s->internal_buffer_count--; 365. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; libavcodec/utils.c:364:5: 362. } 363. assert(i < s->internal_buffer_count); 364. s->internal_buffer_count--; ^ 365. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; 366. libavcodec/utils.c:365:5: 363. assert(i < s->internal_buffer_count); 364. s->internal_buffer_count--; 365. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; ^ 366. 367. FFSWAP(InternalBuffer, *buf, *last); libavcodec/utils.c:367:5: 365. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; 366. 367. FFSWAP(InternalBuffer, *buf, *last); ^ 368. 369. for(i=0; i<4; i++){
https://github.com/libav/libav/blob/c22b4468a6e87ccaf1630d83f12f6817f9e7eff7/libavcodec/utils.c/#L367
d2a_code_trace_data_42287
int RAND_poll(void) { int ret = 0; RAND_POOL *pool = NULL; const RAND_METHOD *meth = RAND_get_rand_method(); if (meth == RAND_OpenSSL()) { RAND_DRBG *drbg = RAND_DRBG_get0_master(); if (drbg == NULL) return 0; rand_drbg_lock(drbg); ret = rand_drbg_restart(drbg, NULL, 0, 0); rand_drbg_unlock(drbg); return ret; } else { pool = rand_pool_new(RAND_DRBG_STRENGTH, RAND_DRBG_STRENGTH / 8, RAND_POOL_MAX_LENGTH); if (pool == NULL) return 0; if (rand_pool_acquire_entropy(pool) == 0) goto err; if (meth->add == NULL || meth->add(rand_pool_buffer(pool), rand_pool_length(pool), (rand_pool_entropy(pool) / 8.0)) == 0) goto err; ret = 1; } err: rand_pool_free(pool); return ret; } crypto/rand/rand_lib.c:408: error: NULL_DEREFERENCE pointer `meth` last assigned on line 382 could be null and is dereferenced at line 408, column 13. Showing all 24 steps of the trace crypto/rand/rand_lib.c:376:1: start of procedure RAND_poll() 374. * configurable via the --with-rand-seed configure option. 375. */ 376. > int RAND_poll(void) 377. { 378. int ret = 0; crypto/rand/rand_lib.c:378:5: 376. int RAND_poll(void) 377. { 378. > int ret = 0; 379. 380. RAND_POOL *pool = NULL; crypto/rand/rand_lib.c:380:5: 378. int ret = 0; 379. 380. > RAND_POOL *pool = NULL; 381. 382. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:382:5: 380. RAND_POOL *pool = NULL; 381. 382. > const RAND_METHOD *meth = RAND_get_rand_method(); 383. 384. if (meth == RAND_OpenSSL()) { 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:384:9: 382. const RAND_METHOD *meth = RAND_get_rand_method(); 383. 384. > if (meth == RAND_OpenSSL()) { 385. /* fill random pool and seed the master DRBG */ 386. RAND_DRBG *drbg = RAND_DRBG_get0_master(); crypto/rand/drbg_lib.c:1228:1: start of procedure RAND_OpenSSL() 1226. }; 1227. 1228. > RAND_METHOD *RAND_OpenSSL(void) 1229. { 1230. return &rand_meth; crypto/rand/drbg_lib.c:1230:5: 1228. RAND_METHOD *RAND_OpenSSL(void) 1229. { 1230. > return &rand_meth; 1231. } crypto/rand/drbg_lib.c:1231:1: return from a call to RAND_OpenSSL 1229. { 1230. return &rand_meth; 1231. > } crypto/rand/rand_lib.c:384:9: Taking false branch 382. const RAND_METHOD *meth = RAND_get_rand_method(); 383. 384. if (meth == RAND_OpenSSL()) { ^ 385. /* fill random pool and seed the master DRBG */ 386. RAND_DRBG *drbg = RAND_DRBG_get0_master(); crypto/rand/rand_lib.c:399:9: Skipping rand_pool_new(): empty list of specs 397. } else { 398. /* fill random pool and seed the current legacy RNG */ 399. pool = rand_pool_new(RAND_DRBG_STRENGTH, ^ 400. RAND_DRBG_STRENGTH / 8, 401. RAND_POOL_MAX_LENGTH); crypto/rand/rand_lib.c:402:13: Taking false branch 400. RAND_DRBG_STRENGTH / 8, 401. RAND_POOL_MAX_LENGTH); 402. if (pool == NULL) ^ 403. return 0; 404. crypto/rand/rand_lib.c:405:13: Taking false branch 403. return 0; 404. 405. if (rand_pool_acquire_entropy(pool) == 0) ^ 406. goto err; 407. crypto/rand/rand_lib.c:408:13: 406. goto err; 407. 408. > if (meth->add == NULL 409. || meth->add(rand_pool_buffer(pool), 410. rand_pool_length(pool),
https://github.com/openssl/openssl/blob/95658c32436017aeeef3d8598957071baf6769a9/crypto/rand/rand_lib.c/#L408
d2a_code_trace_data_42288
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ec2_smpl.c:608: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end`. Showing all 9 steps of the trace crypto/ec/ec2_smpl.c:553:1: Parameter `ctx->stack.depth` 551. * y^2 + x*y = x^3 + a*x^2 + b. 552. */ 553. > int ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, 554. BN_CTX *ctx) 555. { crypto/ec/ec2_smpl.c:579:5: Call 577. } 578. 579. BN_CTX_start(ctx); ^ 580. y2 = BN_CTX_get(ctx); 581. lh = 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/ec/ec2_smpl.c:608:5: Call 606. 607. err: 608. BN_CTX_end(ctx); ^ 609. BN_CTX_free(new_ctx); 610. return ret; crypto/bn/bn_ctx.c:195:1: Parameter `ctx->stack.depth` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <LHS trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end` 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/a8ea8018fa187e22fb4989450b550589e20f62c2/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_42289
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:136: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_add_quick`. Showing all 23 steps of the trace crypto/dsa/dsa_ossl.c:92:10: Call 90. 91. redo: 92. if (!dsa_sign_setup(dsa, ctx, &kinv, &ret->r, dgst, dlen)) ^ 93. goto err; 94. crypto/dsa/dsa_ossl.c:175:1: Parameter `(*rp)->top` 173. } 174. 175. > static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, 176. BIGNUM **kinvp, BIGNUM **rp, 177. const unsigned char *dgst, int dlen) crypto/dsa/dsa_ossl.c:136:10: Call 134. 135. /* s : = (blind * priv_key * r) + (blind * m) mod q */ 136. if (!BN_mod_add_quick(ret->s, tmp, blindm, dsa->q)) ^ 137. goto err; 138. crypto/bn/bn_mod.c:94:1: Parameter `r->top` 92. } 93. 94. > int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 95. const BIGNUM *m) 96. { crypto/bn/bn_mod.c:97:15: Call 95. const BIGNUM *m) 96. { 97. int ret = bn_mod_add_fixed_top(r, a, b, m); ^ 98. 99. if (ret) crypto/bn/bn_mod.c:48:1: Parameter `r->top` 46. * move depending on whether or not subtraction borrowed. 47. */ 48. > int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 49. const BIGNUM *m) 50. { crypto/bn/bn_mod.c:56:9: Call 54. const BN_ULONG *ap, *bp; 55. 56. if (bn_wexpand(r, mtop) == NULL) ^ 57. return 0; 58. crypto/bn/bn_lib.c:948:1: Parameter `a->top` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:245:1: Parameter `b->top` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `words` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:224:13: Call 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/mem.c:228:1: Parameter `num` 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:17: Call 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/mem.c:230:5: Assignment 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:235:5: Assignment 233. if (ret != NULL) 234. memset(ret, 0, num); 235. return ret; ^ 236. } 237. crypto/bn/bn_lib.c:224:9: Assignment 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_add_quick` 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/793f19e47c69558e39c702da75c27e0509baf379/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_42290
static int epzs_motion_search4(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d, dmin; int map_generation; const int penalty_factor= c->penalty_factor; const int size=1; const int h=8; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON int flags= c->flags; LOAD_COMMON2 cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; map_generation= update_map_generation(c); dmin = 1000000; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) }else{ CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) } if(dmin>64*4){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1164: error: Uninitialized Value The value read from xmin was never initialized. libavcodec/motion_est_template.c:1164:9: 1162. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) 1163. }else{ 1164. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) ^ 1165. //FIXME try some early stop 1166. CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1164
d2a_code_trace_data_42291
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) { int i, j, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l, tmp; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_RSHIFT, BN_R_INVALID_SHIFT); return 0; } nw = n / BN_BITS2; rb = n % BN_BITS2; lb = BN_BITS2 - rb; if (nw >= a->top || a->top == 0) { BN_zero(r); return (1); } i = (BN_num_bits(a) - n + (BN_BITS2 - 1)) / BN_BITS2; if (r != a) { r->neg = a->neg; if (bn_wexpand(r, i) == NULL) return (0); } else { if (n == 0) return 1; } f = &(a->d[nw]); t = r->d; j = a->top - nw; r->top = i; if (rb == 0) { for (i = j; i != 0; i--) *(t++) = *(f++); } else { l = *(f++); for (i = j - 1; i != 0; i--) { tmp = (l >> rb) & BN_MASK2; l = *(f++); *(t++) = (tmp | (l << lb)) & BN_MASK2; } if ((l = (l >> rb) & BN_MASK2)) *(t) = l; } bn_check_top(r); return (1); } crypto/rsa/rsa_ossl.c:667: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div`. Showing all 15 steps of the trace crypto/rsa/rsa_ossl.c:610:9: Call 608. goto err; 609. } 610. BN_with_flags(p, rsa->p, BN_FLG_CONSTTIME); ^ 611. BN_with_flags(q, rsa->q, BN_FLG_CONSTTIME); 612. crypto/bn/bn_lib.c:949:1: Parameter `*b->d` 947. } 948. 949. > void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags) 950. { 951. dest->d = b->d; crypto/bn/bn_lib.c:951:5: Assignment 949. void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags) 950. { 951. dest->d = b->d; ^ 952. dest->top = b->top; 953. dest->dmax = b->dmax; crypto/rsa/rsa_ossl.c:663:13: Call 661. } 662. /* We MUST free dmq1 before any further use of rsa->dmq1 */ 663. BN_free(dmq1); ^ 664. } 665. crypto/bn/bn_lib.c:198:1: Parameter `*a->d` 196. } 197. 198. > void BN_free(BIGNUM *a) 199. { 200. if (a == NULL) crypto/rsa/rsa_ossl.c:667:14: Call 665. 666. /* compute I mod p */ 667. if (!BN_mod(r1, c, rsa->p, ctx)) { ^ 668. BN_free(c); 669. goto err; crypto/bn/bn_div.c:140:1: Parameter `*dv->d` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/bn/bn_div.c:258:10: Call 256. /* Setup to 'res' */ 257. res->neg = (num->neg ^ divisor->neg); 258. if (!bn_wexpand(res, (loop + 1))) ^ 259. goto err; 260. res->top = loop - no_branch; crypto/bn/bn_lib.c:1014:1: Parameter `*a->d` 1012. } 1013. 1014. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 1015. { 1016. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_div.c:409:9: Call 407. */ 408. int neg = num->neg; 409. BN_rshift(rm, snum, norm_shift); ^ 410. if (!BN_is_zero(rm)) 411. rm->neg = neg; crypto/bn/bn_shift.c:120:1: <Length trace> 118. } 119. 120. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 121. { 122. int i, j, nw, lb, rb; crypto/bn/bn_shift.c:120:1: Parameter `*a->d` 118. } 119. 120. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 121. { 122. int i, j, nw, lb, rb; crypto/bn/bn_shift.c:151:5: Assignment 149. } 150. 151. f = &(a->d[nw]); ^ 152. t = r->d; 153. j = a->top - nw; crypto/bn/bn_shift.c:160:15: Assignment 158. *(t++) = *(f++); 159. } else { 160. l = *(f++); ^ 161. for (i = j - 1; i != 0; i--) { 162. tmp = (l >> rb) & BN_MASK2; crypto/bn/bn_shift.c:163:17: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div` 161. for (i = j - 1; i != 0; i--) { 162. tmp = (l >> rb) & BN_MASK2; 163. l = *(f++); ^ 164. *(t++) = (tmp | (l << lb)) & BN_MASK2; 165. }
https://github.com/openssl/openssl/blob/ec772a817afc0f788c38006f623204a7d76221ec/crypto/bn/bn_shift.c/#L163
d2a_code_trace_data_42292
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } test/exptest.c:161: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont`. Showing all 23 steps of the trace test/exptest.c:159:10: Call 157. BN_rand(m, NUM_BITS + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD); 158. 159. if (!TEST_true(BN_mod(a, a, m, ctx)) ^ 160. || !TEST_true(BN_mod(b, b, m, ctx)) 161. || !TEST_true(BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL)) crypto/bn/bn_div.c:140:1: Parameter `rm->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. { test/exptest.c:161:13: Call 159. if (!TEST_true(BN_mod(a, a, m, ctx)) 160. || !TEST_true(BN_mod(b, b, m, ctx)) 161. || !TEST_true(BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL)) ^ 162. || !TEST_true(BN_mod_exp_recp(r_recp, a, b, m, ctx)) 163. || !TEST_true(BN_mod_exp_simple(r_simple, a, b, m, ctx)) crypto/bn/bn_exp.c:291:1: Parameter `a->top` 289. } 290. 291. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 292. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 293. { crypto/bn/bn_exp.c:303:16: Call 301. 302. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 303. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 304. } 305. crypto/bn/bn_exp.c:591:1: Parameter `a->top` 589. * http://www.daemonology.net/hyperthreading-considered-harmful/) 590. */ 591. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 592. const BIGNUM *m, BN_CTX *ctx, 593. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:748:17: Call 746. if (!BN_to_montgomery(&am, &am, mont, ctx)) 747. goto err; 748. } else if (!BN_to_montgomery(&am, a, mont, ctx)) ^ 749. goto err; 750. crypto/bn/bn_lib.c:877:1: Parameter `a->top` 875. } 876. 877. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 878. BN_CTX *ctx) 879. { crypto/bn/bn_lib.c:880:12: Call 878. BN_CTX *ctx) 879. { 880. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 881. } 882. crypto/bn/bn_mont.c:26:1: Parameter `a->top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:53:14: Call 51. bn_check_top(tmp); 52. if (a == b) { 53. if (!BN_sqr(tmp, a, ctx)) ^ 54. goto err; 55. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:105:1: <Offset trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `n` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:116:5: Assignment 114. rp[0] = rp[max - 1] = 0; 115. rp++; 116. j = n; ^ 117. 118. if (--j > 0) { crypto/bn/bn_sqr.c:118:9: Assignment 116. j = n; 117. 118. if (--j > 0) { ^ 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:105:1: <Length trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `*r` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:113:5: Assignment 111. max = n * 2; 112. ap = a; 113. rp = r; ^ 114. rp[0] = rp[max - 1] = 0; 115. rp++; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp = r; 114. rp[0] = rp[max - 1] = 0; 115. rp++; ^ 116. j = n; 117. crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont` 118. if (--j > 0) { 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 121. rp += 2; 122. }
https://github.com/openssl/openssl/blob/c784a838e0947fcca761ee62def7d077dc06d37f/crypto/bn/bn_sqr.c/#L120
d2a_code_trace_data_42293
static void cpContigBufToSeparateBuf(uint8* out, uint8* in, uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp, int bytes_per_sample ) { while (rows-- > 0) { uint32 j = cols; while (j-- > 0) { int n = bytes_per_sample; while( n-- ) { *out++ = *in++; } in += (spp-1) * bytes_per_sample; } out += outskew; in += inskew; } } tools/tiffcp.c:1087: error: Integer Overflow L2 ([0, `cols`] - 1):unsigned32. tools/tiffcp.c:1080:1: <LHS trace> 1078. } 1079. 1080. static void ^ 1081. cpContigBufToSeparateBuf(uint8* out, uint8* in, 1082. uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp, tools/tiffcp.c:1080:1: Parameter `cols` 1078. } 1079. 1080. static void ^ 1081. cpContigBufToSeparateBuf(uint8* out, uint8* in, 1082. uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp, tools/tiffcp.c:1086:3: Assignment 1084. { 1085. while (rows-- > 0) { 1086. uint32 j = cols; ^ 1087. while (j-- > 0) 1088. { tools/tiffcp.c:1087:10: Binary operation: ([0, cols] - 1):unsigned32 1085. while (rows-- > 0) { 1086. uint32 j = cols; 1087. while (j-- > 0) ^ 1088. { 1089. int n = bytes_per_sample;
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/tools/tiffcp.c/#L1087
d2a_code_trace_data_42294
int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx) { BN_CTX *new_ctx = NULL; const EC_POINT *generator = NULL; EC_POINT *tmp = NULL; size_t totalnum; size_t blocksize = 0, numblocks = 0; size_t pre_points_per_block = 0; size_t i, j; int k; int r_is_inverted = 0; int r_is_at_infinity = 1; size_t *wsize = NULL; signed char **wNAF = NULL; size_t *wNAF_len = NULL; size_t max_len = 0; size_t num_val; EC_POINT **val = NULL; EC_POINT **v; EC_POINT ***val_sub = NULL; const EC_PRE_COMP *pre_comp = NULL; int num_scalar = 0; int ret = 0; if (!ec_point_is_compat(r, group)) { ECerr(EC_F_EC_WNAF_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } if ((scalar == NULL) && (num == 0)) { return EC_POINT_set_to_infinity(group, r); } if (!BN_is_zero(group->order) && !BN_is_zero(group->cofactor)) { if ((scalar != NULL) && (num == 0)) { return ec_scalar_mul_ladder(group, r, scalar, NULL, ctx); } if ((scalar == NULL) && (num == 1)) { return ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx); } } for (i = 0; i < num; i++) { if (!ec_point_is_compat(points[i], group)) { ECerr(EC_F_EC_WNAF_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } } if (ctx == NULL) { ctx = new_ctx = BN_CTX_new(); if (ctx == NULL) goto err; } if (scalar != NULL) { generator = EC_GROUP_get0_generator(group); if (generator == NULL) { ECerr(EC_F_EC_WNAF_MUL, EC_R_UNDEFINED_GENERATOR); goto err; } pre_comp = group->pre_comp.ec; if (pre_comp && pre_comp->numblocks && (EC_POINT_cmp(group, generator, pre_comp->points[0], ctx) == 0)) { blocksize = pre_comp->blocksize; numblocks = (BN_num_bits(scalar) / blocksize) + 1; if (numblocks > pre_comp->numblocks) numblocks = pre_comp->numblocks; pre_points_per_block = (size_t)1 << (pre_comp->w - 1); if (pre_comp->num != (pre_comp->numblocks * pre_points_per_block)) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); goto err; } } else { pre_comp = NULL; numblocks = 1; num_scalar = 1; } } totalnum = num + numblocks; wsize = OPENSSL_malloc(totalnum * sizeof(wsize[0])); wNAF_len = OPENSSL_malloc(totalnum * sizeof(wNAF_len[0])); wNAF = OPENSSL_malloc((totalnum + 1) * sizeof(wNAF[0])); val_sub = OPENSSL_malloc(totalnum * sizeof(val_sub[0])); if (wNAF != NULL) wNAF[0] = NULL; if (wsize == NULL || wNAF_len == NULL || wNAF == NULL || val_sub == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); goto err; } num_val = 0; for (i = 0; i < num + num_scalar; i++) { size_t bits; bits = i < num ? BN_num_bits(scalars[i]) : BN_num_bits(scalar); wsize[i] = EC_window_bits_for_scalar_size(bits); num_val += (size_t)1 << (wsize[i] - 1); wNAF[i + 1] = NULL; wNAF[i] = bn_compute_wNAF((i < num ? scalars[i] : scalar), wsize[i], &wNAF_len[i]); if (wNAF[i] == NULL) goto err; if (wNAF_len[i] > max_len) max_len = wNAF_len[i]; } if (numblocks) { if (pre_comp == NULL) { if (num_scalar != 1) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); goto err; } } else { signed char *tmp_wNAF = NULL; size_t tmp_len = 0; if (num_scalar != 0) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); goto err; } wsize[num] = pre_comp->w; tmp_wNAF = bn_compute_wNAF(scalar, wsize[num], &tmp_len); if (!tmp_wNAF) goto err; if (tmp_len <= max_len) { numblocks = 1; totalnum = num + 1; wNAF[num] = tmp_wNAF; wNAF[num + 1] = NULL; wNAF_len[num] = tmp_len; val_sub[num] = pre_comp->points; } else { signed char *pp; EC_POINT **tmp_points; if (tmp_len < numblocks * blocksize) { numblocks = (tmp_len + blocksize - 1) / blocksize; if (numblocks > pre_comp->numblocks) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); OPENSSL_free(tmp_wNAF); goto err; } totalnum = num + numblocks; } pp = tmp_wNAF; tmp_points = pre_comp->points; for (i = num; i < totalnum; i++) { if (i < totalnum - 1) { wNAF_len[i] = blocksize; if (tmp_len < blocksize) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); OPENSSL_free(tmp_wNAF); goto err; } tmp_len -= blocksize; } else wNAF_len[i] = tmp_len; wNAF[i + 1] = NULL; wNAF[i] = OPENSSL_malloc(wNAF_len[i]); if (wNAF[i] == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); OPENSSL_free(tmp_wNAF); goto err; } memcpy(wNAF[i], pp, wNAF_len[i]); if (wNAF_len[i] > max_len) max_len = wNAF_len[i]; if (*tmp_points == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); OPENSSL_free(tmp_wNAF); goto err; } val_sub[i] = tmp_points; tmp_points += pre_points_per_block; pp += blocksize; } OPENSSL_free(tmp_wNAF); } } } val = OPENSSL_malloc((num_val + 1) * sizeof(val[0])); if (val == NULL) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); goto err; } val[num_val] = NULL; v = val; for (i = 0; i < num + num_scalar; i++) { val_sub[i] = v; for (j = 0; j < ((size_t)1 << (wsize[i] - 1)); j++) { *v = EC_POINT_new(group); if (*v == NULL) goto err; v++; } } if (!(v == val + num_val)) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_INTERNAL_ERROR); goto err; } if ((tmp = EC_POINT_new(group)) == NULL) goto err; for (i = 0; i < num + num_scalar; i++) { if (i < num) { if (!EC_POINT_copy(val_sub[i][0], points[i])) goto err; } else { if (!EC_POINT_copy(val_sub[i][0], generator)) goto err; } if (wsize[i] > 1) { if (!EC_POINT_dbl(group, tmp, val_sub[i][0], ctx)) goto err; for (j = 1; j < ((size_t)1 << (wsize[i] - 1)); j++) { if (!EC_POINT_add (group, val_sub[i][j], val_sub[i][j - 1], tmp, ctx)) goto err; } } } if (!EC_POINTs_make_affine(group, num_val, val, ctx)) goto err; r_is_at_infinity = 1; for (k = max_len - 1; k >= 0; k--) { if (!r_is_at_infinity) { if (!EC_POINT_dbl(group, r, r, ctx)) goto err; } for (i = 0; i < totalnum; i++) { if (wNAF_len[i] > (size_t)k) { int digit = wNAF[i][k]; int is_neg; if (digit) { is_neg = digit < 0; if (is_neg) digit = -digit; if (is_neg != r_is_inverted) { if (!r_is_at_infinity) { if (!EC_POINT_invert(group, r, ctx)) goto err; } r_is_inverted = !r_is_inverted; } if (r_is_at_infinity) { if (!EC_POINT_copy(r, val_sub[i][digit >> 1])) goto err; r_is_at_infinity = 0; } else { if (!EC_POINT_add (group, r, r, val_sub[i][digit >> 1], ctx)) goto err; } } } } } if (r_is_at_infinity) { if (!EC_POINT_set_to_infinity(group, r)) goto err; } else { if (r_is_inverted) if (!EC_POINT_invert(group, r, ctx)) goto err; } ret = 1; err: BN_CTX_free(new_ctx); EC_POINT_free(tmp); OPENSSL_free(wsize); OPENSSL_free(wNAF_len); if (wNAF != NULL) { signed char **w; for (w = wNAF; *w != NULL; w++) OPENSSL_free(*w); OPENSSL_free(wNAF); } if (val != NULL) { for (v = val; *v != NULL; v++) EC_POINT_clear_free(*v); OPENSSL_free(val); } OPENSSL_free(val_sub); return ret; } test/ectest.c:924: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, 8]):unsigned64 by call to `EC_POINTs_mul`. Showing all 13 steps of the trace test/ectest.c:890:13: Call 888. 889. if (!TEST_int_eq(EC_GROUP_get_degree(group), test->degree) 890. || !group_order_tests(group) ^ 891. || !TEST_ptr(variable = EC_GROUP_new(EC_GROUP_method_of(group))) 892. || !TEST_true(EC_GROUP_copy(variable, group))) test/ectest.c:52:13: Call 50. || !TEST_true(EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) 51. || !TEST_true(EC_POINT_is_at_infinity(group, Q)) 52. || !TEST_true(EC_GROUP_precompute_mult(group, ctx)) ^ 53. || !TEST_true(EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) 54. || !TEST_true(EC_POINT_is_at_infinity(group, Q)) crypto/ec/ec_lib.c:949:16: Call 947. if (group->meth->mul == 0) 948. /* use default */ 949. return ec_wNAF_precompute_mult(group, ctx); ^ 950. 951. if (group->meth->precompute_mult != 0) crypto/ec/ec_mult.c:874:5: Assignment 872. * efficiency. 873. */ 874. blocksize = 8; ^ 875. w = 4; 876. if (EC_window_bits_for_scalar_size(bits) > w) { crypto/ec/ec_mult.c:955:5: Assignment 953. 954. pre_comp->group = group; 955. pre_comp->blocksize = blocksize; ^ 956. pre_comp->numblocks = numblocks; 957. pre_comp->w = w; test/ectest.c:924:14: Call 922. 923. /* z is still the group order */ 924. if (!TEST_true(EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx)) ^ 925. || !TEST_true(EC_POINTs_mul(group, R, z, 2, points, scalars, ctx)) 926. || !TEST_int_eq(0, EC_POINT_cmp(group, P, R, ctx)) crypto/ec/ec_lib.c:918:1: Parameter `group->pre_comp.ec->blocksize` 916. */ 917. 918. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 919. size_t num, const EC_POINT *points[], 920. const BIGNUM *scalars[], BN_CTX *ctx) crypto/ec/ec_lib.c:924:16: Call 922. if (group->meth->mul == 0) 923. /* use default */ 924. return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx); ^ 925. 926. return group->meth->mul(group, r, scalar, num, points, scalars, ctx); crypto/ec/ec_mult.c:401:1: <LHS trace> 399. * in the addition if scalar != NULL 400. */ 401. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 402. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 403. BN_CTX *ctx) crypto/ec/ec_mult.c:401:1: Parameter `group->pre_comp.ec->numblocks` 399. * in the addition if scalar != NULL 400. */ 401. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 402. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 403. BN_CTX *ctx) crypto/ec/ec_mult.c:401:1: <RHS trace> 399. * in the addition if scalar != NULL 400. */ 401. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 402. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 403. BN_CTX *ctx) crypto/ec/ec_mult.c:401:1: Parameter `group->pre_comp.ec->numblocks` 399. * in the addition if scalar != NULL 400. */ 401. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 402. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 403. BN_CTX *ctx) crypto/ec/ec_mult.c:638:25: Binary operation: ([0, +oo] - [0, 8]):unsigned64 by call to `EC_POINTs_mul` 636. goto err; 637. } 638. tmp_len -= blocksize; ^ 639. } else 640. /*
https://github.com/openssl/openssl/blob/66b0bca887eb4ad1f5758e56c45905fb3fc36667/crypto/ec/ec_mult.c/#L638
d2a_code_trace_data_42295
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)) { SSLerr(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 { SSLerr(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 -1; } SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); SSL3_BUFFER_sub_left(&wb[currbuf], tmpwrit); } } ssl/record/rec_layer_d1.c:441: 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:338:1: Parameter `s->rlayer.numwpipes` 336. * none of our business 337. */ 338. > int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, 339. size_t len, int peek, size_t *readbytes) 340. { ssl/record/rec_layer_d1.c:433:9: Call 431. 432. /* Check for timeout */ 433. if (dtls1_handle_timeout(s) > 0) ^ 434. goto start; 435. ssl/d1_lib.c:365:1: Parameter `s->rlayer.numwpipes` 363. } 364. 365. > int dtls1_handle_timeout(SSL *s) 366. { 367. /* if no timer is expired, don't do anything */ ssl/record/rec_layer_d1.c:439:16: Call 437. if ((SSL3_RECORD_get_length(rr) == 0) 438. || (s->rlayer.rstate == SSL_ST_READ_BODY)) { 439. iret = dtls1_get_record(s); ^ 440. if (iret <= 0) { 441. iret = dtls1_read_failed(s, iret); ssl/record/ssl3_record.c:1523:1: Parameter `s->rlayer.numwpipes` 1521. */ 1522. /* used only by dtls1_read_bytes */ 1523. > int dtls1_get_record(SSL *s) 1524. { 1525. int ssl_major, ssl_minor; ssl/record/ssl3_record.c:1541:10: Call 1539. * This is a non-blocking operation. 1540. */ 1541. if (!dtls1_process_buffered_records(s)) ^ 1542. return -1; 1543. ssl/record/rec_layer_d1.c:229:1: Parameter `s->rlayer.numwpipes` 227. &((s)->rlayer.d->unprocessed_rcds)) 228. 229. > int dtls1_process_buffered_records(SSL *s) 230. { 231. pitem *item; ssl/record/rec_layer_d1.c:441:20: Call 439. iret = dtls1_get_record(s); 440. if (iret <= 0) { 441. iret = dtls1_read_failed(s, iret); ^ 442. /* anything other than a timeout is an error */ 443. if (iret <= 0) ssl/statem/statem_dtls.c:908:1: Parameter `s->rlayer.numwpipes` 906. #endif 907. 908. > int dtls1_read_failed(SSL *s, int code) 909. { 910. if (code > 0) { ssl/statem/statem_dtls.c:934:12: Call 932. } 933. 934. return dtls1_handle_timeout(s); ^ 935. } 936. ssl/d1_lib.c:365:1: Parameter `s->rlayer.numwpipes` 363. } 364. 365. > int dtls1_handle_timeout(SSL *s) 366. { 367. /* if no timer is expired, don't do anything */ ssl/d1_lib.c:389:12: Call 387. 388. dtls1_start_timer(s); 389. return dtls1_retransmit_buffered_messages(s); ^ 390. } 391. ssl/statem/statem_dtls.c:952:1: Parameter `s->rlayer.numwpipes` 950. } 951. 952. > int dtls1_retransmit_buffered_messages(SSL *s) 953. { 954. pqueue *sent = s->d1->sent_messages; ssl/statem/statem_dtls.c:964:13: Call 962. for (item = pqueue_next(&iter); item != NULL; item = pqueue_next(&iter)) { 963. frag = (hm_fragment *)item->data; 964. if (dtls1_retransmit_message(s, (unsigned short) ^ 965. dtls1_get_queue_priority 966. (frag->msg_header.seq, ssl/statem/statem_dtls.c:1038:1: Parameter `s->rlayer.numwpipes` 1036. } 1037. 1038. > int dtls1_retransmit_message(SSL *s, unsigned short seq, int *found) 1039. { 1040. int ret; ssl/statem/statem_dtls.c:1100:11: Call 1098. saved_retransmit_state.epoch); 1099. 1100. ret = dtls1_do_write(s, frag->msg_header.is_ccs ? ^ 1101. SSL3_RT_CHANGE_CIPHER_SPEC : SSL3_RT_HANDSHAKE); 1102. 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:235:15: Call 233. } 234. 235. ret = dtls1_write_bytes(s, type, &s->init_buf->data[s->init_off], len, ^ 236. &written); 237. if (ret < 0) { ssl/record/rec_layer_d1.c:974:1: Parameter `s->rlayer.numwpipes` 972. * not all data has been sent or non-blocking IO. 973. */ 974. > int dtls1_write_bytes(SSL *s, int type, const void *buf, size_t len, 975. size_t *written) 976. { ssl/record/rec_layer_d1.c:981:9: Call 979. OPENSSL_assert(len <= SSL3_RT_MAX_PLAIN_LENGTH); 980. s->rwstate = SSL_NOTHING; 981. i = do_dtls1_write(s, type, buf, len, 0, written); ^ 982. return i; 983. } ssl/record/rec_layer_d1.c:985:1: Parameter `s->rlayer.numwpipes` 983. } 984. 985. > int do_dtls1_write(SSL *s, int type, const unsigned char *buf, 986. size_t len, int create_empty_fragment, size_t *written) 987. { ssl/record/rec_layer_d1.c:1181:12: Call 1179. 1180. /* we now just need to write the buffer */ 1181. return ssl3_write_pending(s, type, buf, len, written); ^ 1182. err: 1183. return -1; ssl/record/rec_layer_s3.c:905:1: <LHS trace> 903. * <0 Failure (may be retryable) 904. */ 905. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 906. size_t *written) 907. { ssl/record/rec_layer_s3.c:905:1: Parameter `s->rlayer.numwpipes` 903. * <0 Failure (may be retryable) 904. */ 905. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 906. size_t *written) 907. { ssl/record/rec_layer_s3.c:924:16: Binary operation: ([0, max(1, s->rlayer.numwpipes)] - 1):unsigned64 by call to `dtls1_read_failed` 922. /* Loop until we find a buffer we haven't written out yet */ 923. if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0 924. && currbuf < s->rlayer.numwpipes - 1) { ^ 925. currbuf++; 926. continue;
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/record/rec_layer_s3.c/#L924
d2a_code_trace_data_42296
int ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb, AVStream *st, RMStream *ast, AVPacket *pkt) { RMDemuxContext *rm = s->priv_data; assert (rm->audio_pkt_cnt > 0); if (ast->deint_id == DEINT_ID_VBRF || ast->deint_id == DEINT_ID_VBRS) av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]); else { av_new_packet(pkt, st->codec->block_align); memcpy(pkt->data, ast->pkt.data + st->codec->block_align * (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt), st->codec->block_align); } rm->audio_pkt_cnt--; if ((pkt->pts = ast->audiotimestamp) != AV_NOPTS_VALUE) { ast->audiotimestamp = AV_NOPTS_VALUE; pkt->flags = AV_PKT_FLAG_KEY; } else pkt->flags = 0; pkt->stream_index = st->index; return rm->audio_pkt_cnt; } libavformat/rmdec.c:826: error: Null Dereference pointer `pkt->data` last assigned on line 825 could be null and is dereferenced by call to `memcpy()` at line 826, column 9. libavformat/rmdec.c:813:1: start of procedure ff_rm_retrieve_cache() 811. } 812. 813. int ^ 814. ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb, 815. AVStream *st, RMStream *ast, AVPacket *pkt) libavformat/rmdec.c:817:5: 815. AVStream *st, RMStream *ast, AVPacket *pkt) 816. { 817. RMDemuxContext *rm = s->priv_data; ^ 818. 819. assert (rm->audio_pkt_cnt > 0); libavformat/rmdec.c:819:5: 817. RMDemuxContext *rm = s->priv_data; 818. 819. assert (rm->audio_pkt_cnt > 0); ^ 820. 821. if (ast->deint_id == DEINT_ID_VBRF || libavformat/rmdec.c:821:9: Taking false branch 819. assert (rm->audio_pkt_cnt > 0); 820. 821. if (ast->deint_id == DEINT_ID_VBRF || ^ 822. ast->deint_id == DEINT_ID_VBRS) 823. av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]); libavformat/rmdec.c:822:9: Taking false branch 820. 821. if (ast->deint_id == DEINT_ID_VBRF || 822. ast->deint_id == DEINT_ID_VBRS) ^ 823. av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]); 824. else { libavformat/rmdec.c:825:9: 823. av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub_packet_cnt - rm->audio_pkt_cnt]); 824. else { 825. av_new_packet(pkt, st->codec->block_align); ^ 826. memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this 827. (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt), libavcodec/avpacket.c:60:1: start of procedure av_new_packet() 58. } 59. 60. int av_new_packet(AVPacket *pkt, int size) ^ 61. { 62. uint8_t *data= NULL; libavcodec/avpacket.c:62:5: 60. int av_new_packet(AVPacket *pkt, int size) 61. { 62. uint8_t *data= NULL; ^ 63. if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE) 64. data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); libavcodec/avpacket.c:63:8: Taking true branch 61. { 62. uint8_t *data= NULL; 63. if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE) ^ 64. data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); 65. if (data){ libavcodec/avpacket.c:64:9: 62. uint8_t *data= NULL; 63. if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE) 64. data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); ^ 65. if (data){ 66. memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(size_t size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(size_t size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking true branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:73:9: 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) 73. return NULL; ^ 74. 75. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavcodec/avpacket.c:65:9: Taking false branch 63. if((unsigned)size < (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE) 64. data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); 65. if (data){ ^ 66. memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); 67. }else libavcodec/avpacket.c:68:9: 66. memset(data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE); 67. }else 68. size=0; ^ 69. 70. av_init_packet(pkt); libavcodec/avpacket.c:70:5: 68. size=0; 69. 70. av_init_packet(pkt); ^ 71. pkt->data = data; 72. pkt->size = size; libavcodec/avpacket.c:46:1: start of procedure av_init_packet() 44. } 45. 46. void av_init_packet(AVPacket *pkt) ^ 47. { 48. pkt->pts = AV_NOPTS_VALUE; libavcodec/avpacket.c:48:5: 46. void av_init_packet(AVPacket *pkt) 47. { 48. pkt->pts = AV_NOPTS_VALUE; ^ 49. pkt->dts = AV_NOPTS_VALUE; 50. pkt->pos = -1; libavcodec/avpacket.c:49:5: 47. { 48. pkt->pts = AV_NOPTS_VALUE; 49. pkt->dts = AV_NOPTS_VALUE; ^ 50. pkt->pos = -1; 51. pkt->duration = 0; libavcodec/avpacket.c:50:5: 48. pkt->pts = AV_NOPTS_VALUE; 49. pkt->dts = AV_NOPTS_VALUE; 50. pkt->pos = -1; ^ 51. pkt->duration = 0; 52. pkt->convergence_duration = 0; libavcodec/avpacket.c:51:5: 49. pkt->dts = AV_NOPTS_VALUE; 50. pkt->pos = -1; 51. pkt->duration = 0; ^ 52. pkt->convergence_duration = 0; 53. pkt->flags = 0; libavcodec/avpacket.c:52:5: 50. pkt->pos = -1; 51. pkt->duration = 0; 52. pkt->convergence_duration = 0; ^ 53. pkt->flags = 0; 54. pkt->stream_index = 0; libavcodec/avpacket.c:53:5: 51. pkt->duration = 0; 52. pkt->convergence_duration = 0; 53. pkt->flags = 0; ^ 54. pkt->stream_index = 0; 55. pkt->destruct= NULL; libavcodec/avpacket.c:54:5: 52. pkt->convergence_duration = 0; 53. pkt->flags = 0; 54. pkt->stream_index = 0; ^ 55. pkt->destruct= NULL; 56. pkt->side_data = NULL; libavcodec/avpacket.c:55:5: 53. pkt->flags = 0; 54. pkt->stream_index = 0; 55. pkt->destruct= NULL; ^ 56. pkt->side_data = NULL; 57. pkt->side_data_elems = 0; libavcodec/avpacket.c:56:5: 54. pkt->stream_index = 0; 55. pkt->destruct= NULL; 56. pkt->side_data = NULL; ^ 57. pkt->side_data_elems = 0; 58. } libavcodec/avpacket.c:57:5: 55. pkt->destruct= NULL; 56. pkt->side_data = NULL; 57. pkt->side_data_elems = 0; ^ 58. } 59. libavcodec/avpacket.c:58:1: return from a call to av_init_packet 56. pkt->side_data = NULL; 57. pkt->side_data_elems = 0; 58. } ^ 59. 60. int av_new_packet(AVPacket *pkt, int size) libavcodec/avpacket.c:71:5: 69. 70. av_init_packet(pkt); 71. pkt->data = data; ^ 72. pkt->size = size; 73. pkt->destruct = av_destruct_packet; libavcodec/avpacket.c:72:5: 70. av_init_packet(pkt); 71. pkt->data = data; 72. pkt->size = size; ^ 73. pkt->destruct = av_destruct_packet; 74. if(!data) libavcodec/avpacket.c:73:5: 71. pkt->data = data; 72. pkt->size = size; 73. pkt->destruct = av_destruct_packet; ^ 74. if(!data) 75. return AVERROR(ENOMEM); libavcodec/avpacket.c:74:9: Taking true branch 72. pkt->size = size; 73. pkt->destruct = av_destruct_packet; 74. if(!data) ^ 75. return AVERROR(ENOMEM); 76. return 0; libavcodec/avpacket.c:75:9: 73. pkt->destruct = av_destruct_packet; 74. if(!data) 75. return AVERROR(ENOMEM); ^ 76. return 0; 77. } libavcodec/avpacket.c:77:1: return from a call to av_new_packet 75. return AVERROR(ENOMEM); 76. return 0; 77. } ^ 78. 79. void av_shrink_packet(AVPacket *pkt, int size) libavformat/rmdec.c:826:9: 824. else { 825. av_new_packet(pkt, st->codec->block_align); 826. memcpy(pkt->data, ast->pkt.data + st->codec->block_align * //FIXME avoid this ^ 827. (ast->sub_packet_h * ast->audio_framesize / st->codec->block_align - rm->audio_pkt_cnt), 828. st->codec->block_align);
https://github.com/libav/libav/blob/f06068bbd6ed1f831dee0b0ee46e00ebe42ec1e2/libavformat/rmdec.c/#L826
d2a_code_trace_data_42297
static int save_avio_options(AVFormatContext *s) { HLSContext *c = s->priv_data; const char *opts[] = { "headers", "user_agent", NULL }, **opt = opts; uint8_t *buf; int ret = 0; while (*opt) { if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) { ret = av_dict_set(&c->avio_opts, *opt, buf, AV_DICT_DONT_STRDUP_VAL); if (ret < 0) return ret; } opt++; } return ret; } libavformat/hls.c:495: error: Memory Leak memory dynamically allocated to `buf` by call to `av_opt_get()` at line 485, column 13 is not reachable after line 495, column 1. libavformat/hls.c:477:1: start of procedure save_avio_options() 475. } 476. 477. static int save_avio_options(AVFormatContext *s) ^ 478. { 479. HLSContext *c = s->priv_data; libavformat/hls.c:479:5: 477. static int save_avio_options(AVFormatContext *s) 478. { 479. HLSContext *c = s->priv_data; ^ 480. const char *opts[] = { "headers", "user_agent", NULL }, **opt = opts; 481. uint8_t *buf; libavformat/hls.c:480:5: 478. { 479. HLSContext *c = s->priv_data; 480. const char *opts[] = { "headers", "user_agent", NULL }, **opt = opts; ^ 481. uint8_t *buf; 482. int ret = 0; libavformat/hls.c:482:5: 480. const char *opts[] = { "headers", "user_agent", NULL }, **opt = opts; 481. uint8_t *buf; 482. int ret = 0; ^ 483. 484. while (*opt) { libavformat/hls.c:484:12: Loop condition is true. Entering loop body 482. int ret = 0; 483. 484. while (*opt) { ^ 485. if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) { 486. ret = av_dict_set(&c->avio_opts, *opt, buf, libavformat/hls.c:485:13: 483. 484. while (*opt) { 485. if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) { ^ 486. ret = av_dict_set(&c->avio_opts, *opt, buf, 487. AV_DICT_DONT_STRDUP_VAL); libavutil/opt.c:330:1: start of procedure av_opt_get() 328. } 329. 330. int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val) ^ 331. { 332. void *dst, *target_obj; libavutil/opt.c:333:5: Skipping av_opt_find2(): empty list of specs 331. { 332. void *dst, *target_obj; 333. const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj); ^ 334. uint8_t *bin, buf[128]; 335. int len, i, ret; libavutil/opt.c:337:10: Taking false branch 335. int len, i, ret; 336. 337. if (!o || !target_obj) ^ 338. return AVERROR_OPTION_NOT_FOUND; 339. libavutil/opt.c:337:16: Taking false branch 335. int len, i, ret; 336. 337. if (!o || !target_obj) ^ 338. return AVERROR_OPTION_NOT_FOUND; 339. libavutil/opt.c:340:5: 338. return AVERROR_OPTION_NOT_FOUND; 339. 340. dst = (uint8_t*)target_obj + o->offset; ^ 341. 342. buf[0] = 0; libavutil/opt.c:342:5: 340. dst = (uint8_t*)target_obj + o->offset; 341. 342. buf[0] = 0; ^ 343. switch (o->type) { 344. case AV_OPT_TYPE_FLAGS: ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);break; libavutil/opt.c:343:5: 341. 342. buf[0] = 0; 343. switch (o->type) { ^ 344. case AV_OPT_TYPE_FLAGS: ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);break; 345. case AV_OPT_TYPE_INT: ret = snprintf(buf, sizeof(buf), "%d" , *(int *)dst);break; libavutil/opt.c:344:5: Switch condition is false. Skipping switch case 342. buf[0] = 0; 343. switch (o->type) { 344. case AV_OPT_TYPE_FLAGS: ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);break; ^ 345. case AV_OPT_TYPE_INT: ret = snprintf(buf, sizeof(buf), "%d" , *(int *)dst);break; 346. case AV_OPT_TYPE_INT64: ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break; libavutil/opt.c:345:5: Switch condition is false. Skipping switch case 343. switch (o->type) { 344. case AV_OPT_TYPE_FLAGS: ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);break; 345. case AV_OPT_TYPE_INT: ret = snprintf(buf, sizeof(buf), "%d" , *(int *)dst);break; ^ 346. case AV_OPT_TYPE_INT64: ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break; 347. case AV_OPT_TYPE_FLOAT: ret = snprintf(buf, sizeof(buf), "%f" , *(float *)dst);break; libavutil/opt.c:346:5: Switch condition is false. Skipping switch case 344. case AV_OPT_TYPE_FLAGS: ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);break; 345. case AV_OPT_TYPE_INT: ret = snprintf(buf, sizeof(buf), "%d" , *(int *)dst);break; 346. case AV_OPT_TYPE_INT64: ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break; ^ 347. case AV_OPT_TYPE_FLOAT: ret = snprintf(buf, sizeof(buf), "%f" , *(float *)dst);break; 348. case AV_OPT_TYPE_DOUBLE: ret = snprintf(buf, sizeof(buf), "%f" , *(double *)dst);break; libavutil/opt.c:347:5: Switch condition is false. Skipping switch case 345. case AV_OPT_TYPE_INT: ret = snprintf(buf, sizeof(buf), "%d" , *(int *)dst);break; 346. case AV_OPT_TYPE_INT64: ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break; 347. case AV_OPT_TYPE_FLOAT: ret = snprintf(buf, sizeof(buf), "%f" , *(float *)dst);break; ^ 348. case AV_OPT_TYPE_DOUBLE: ret = snprintf(buf, sizeof(buf), "%f" , *(double *)dst);break; 349. case AV_OPT_TYPE_RATIONAL: ret = snprintf(buf, sizeof(buf), "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break; libavutil/opt.c:348:5: Switch condition is false. Skipping switch case 346. case AV_OPT_TYPE_INT64: ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break; 347. case AV_OPT_TYPE_FLOAT: ret = snprintf(buf, sizeof(buf), "%f" , *(float *)dst);break; 348. case AV_OPT_TYPE_DOUBLE: ret = snprintf(buf, sizeof(buf), "%f" , *(double *)dst);break; ^ 349. case AV_OPT_TYPE_RATIONAL: ret = snprintf(buf, sizeof(buf), "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break; 350. case AV_OPT_TYPE_STRING: libavutil/opt.c:349:5: Switch condition is false. Skipping switch case 347. case AV_OPT_TYPE_FLOAT: ret = snprintf(buf, sizeof(buf), "%f" , *(float *)dst);break; 348. case AV_OPT_TYPE_DOUBLE: ret = snprintf(buf, sizeof(buf), "%f" , *(double *)dst);break; 349. case AV_OPT_TYPE_RATIONAL: ret = snprintf(buf, sizeof(buf), "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break; ^ 350. case AV_OPT_TYPE_STRING: 351. if (*(uint8_t**)dst) libavutil/opt.c:350:5: Switch condition is true. Entering switch case 348. case AV_OPT_TYPE_DOUBLE: ret = snprintf(buf, sizeof(buf), "%f" , *(double *)dst);break; 349. case AV_OPT_TYPE_RATIONAL: ret = snprintf(buf, sizeof(buf), "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break; 350. case AV_OPT_TYPE_STRING: ^ 351. if (*(uint8_t**)dst) 352. *out_val = av_strdup(*(uint8_t**)dst); libavutil/opt.c:351:13: Taking false branch 349. case AV_OPT_TYPE_RATIONAL: ret = snprintf(buf, sizeof(buf), "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break; 350. case AV_OPT_TYPE_STRING: 351. if (*(uint8_t**)dst) ^ 352. *out_val = av_strdup(*(uint8_t**)dst); 353. else libavutil/opt.c:354:13: 352. *out_val = av_strdup(*(uint8_t**)dst); 353. else 354. *out_val = av_strdup(""); ^ 355. return *out_val ? 0 : AVERROR(ENOMEM); 356. case AV_OPT_TYPE_BINARY: libavutil/mem.c:219:1: start of procedure av_strdup() 217. } 218. 219. char *av_strdup(const char *s) ^ 220. { 221. char *ptr = NULL; libavutil/mem.c:221:5: 219. char *av_strdup(const char *s) 220. { 221. char *ptr = NULL; ^ 222. if (s) { 223. int len = strlen(s) + 1; libavutil/mem.c:222:9: Taking true branch 220. { 221. char *ptr = NULL; 222. if (s) { ^ 223. int len = strlen(s) + 1; 224. ptr = av_realloc(NULL, len); libavutil/mem.c:223:9: 221. char *ptr = NULL; 222. if (s) { 223. int len = strlen(s) + 1; ^ 224. ptr = av_realloc(NULL, len); 225. if (ptr) libavutil/mem.c:224:9: 222. if (s) { 223. int len = strlen(s) + 1; 224. ptr = av_realloc(NULL, len); ^ 225. if (ptr) 226. memcpy(ptr, s, len); libavutil/mem.c:117:1: start of procedure av_realloc() 115. } 116. 117. void *av_realloc(void *ptr, size_t size) ^ 118. { 119. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:124:9: Taking false branch 122. 123. /* let's disallow possibly ambiguous cases */ 124. if (size > (INT_MAX - 16)) ^ 125. return NULL; 126. libavutil/mem.c:136:5: 134. return _aligned_realloc(ptr, size, 32); 135. #else 136. return realloc(ptr, size); ^ 137. #endif 138. } libavutil/mem.c:138:1: return from a call to av_realloc 136. return realloc(ptr, size); 137. #endif 138. } ^ 139. 140. int av_reallocp(void *ptr, size_t size) libavutil/mem.c:225:13: Taking true branch 223. int len = strlen(s) + 1; 224. ptr = av_realloc(NULL, len); 225. if (ptr) ^ 226. memcpy(ptr, s, len); 227. } libavutil/mem.c:226:13: 224. ptr = av_realloc(NULL, len); 225. if (ptr) 226. memcpy(ptr, s, len); ^ 227. } 228. return ptr; libavutil/mem.c:228:5: 226. memcpy(ptr, s, len); 227. } 228. return ptr; ^ 229. } 230. libavutil/mem.c:229:1: return from a call to av_strdup 227. } 228. return ptr; 229. } ^ 230. 231. char *av_strndup(const char *s, size_t len) libavutil/opt.c:355:16: Condition is true 353. else 354. *out_val = av_strdup(""); 355. return *out_val ? 0 : AVERROR(ENOMEM); ^ 356. case AV_OPT_TYPE_BINARY: 357. len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *)); libavutil/opt.c:355:9: 353. else 354. *out_val = av_strdup(""); 355. return *out_val ? 0 : AVERROR(ENOMEM); ^ 356. case AV_OPT_TYPE_BINARY: 357. len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *)); libavutil/opt.c:374:1: return from a call to av_opt_get 372. *out_val = av_strdup(buf); 373. return *out_val ? 0 : AVERROR(ENOMEM); 374. } ^ 375. 376. static int get_number(void *obj, const char *name, double *num, int *den, int64_t *intnum, libavformat/hls.c:485:13: Taking true branch 483. 484. while (*opt) { 485. if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) { ^ 486. ret = av_dict_set(&c->avio_opts, *opt, buf, 487. AV_DICT_DONT_STRDUP_VAL); libavformat/hls.c:486:13: 484. while (*opt) { 485. if (av_opt_get(s->pb, *opt, AV_OPT_SEARCH_CHILDREN, &buf) >= 0) { 486. ret = av_dict_set(&c->avio_opts, *opt, buf, ^ 487. AV_DICT_DONT_STRDUP_VAL); 488. if (ret < 0) libavutil/dict.c:68:1: start of procedure av_dict_set() 66. } 67. 68. int av_dict_set(AVDictionary **pm, const char *key, const char *value, ^ 69. int flags) 70. { libavutil/dict.c:71:5: 69. int flags) 70. { 71. AVDictionary *m = *pm; ^ 72. AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags); 73. char *oldval = NULL; libavutil/dict.c:72:5: Skipping av_dict_get(): empty list of specs 70. { 71. AVDictionary *m = *pm; 72. AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags); ^ 73. char *oldval = NULL; 74. int allocated = !!m; libavutil/dict.c:73:5: 71. AVDictionary *m = *pm; 72. AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags); 73. char *oldval = NULL; ^ 74. int allocated = !!m; 75. libavutil/dict.c:74:23: Condition is false 72. AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags); 73. char *oldval = NULL; 74. int allocated = !!m; ^ 75. 76. if (!m) libavutil/dict.c:74:21: 72. AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags); 73. char *oldval = NULL; 74. int allocated = !!m; ^ 75. 76. if (!m) libavutil/dict.c:74:5: 72. AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags); 73. char *oldval = NULL; 74. int allocated = !!m; ^ 75. 76. if (!m) libavutil/dict.c:76:10: Taking false branch 74. int allocated = !!m; 75. 76. if (!m) ^ 77. m = *pm = av_mallocz(sizeof(*m)); 78. if (!m) libavutil/dict.c:78:10: Taking false branch 76. if (!m) 77. m = *pm = av_mallocz(sizeof(*m)); 78. if (!m) ^ 79. return AVERROR(ENOMEM); 80. libavutil/dict.c:81:9: Taking false branch 79. return AVERROR(ENOMEM); 80. 81. if (tag) { ^ 82. if (flags & AV_DICT_DONT_OVERWRITE) { 83. if (flags & AV_DICT_DONT_STRDUP_KEY) av_free(key); libavutil/dict.c:94:9: 92. *tag = m->elems[--m->count]; 93. } else { 94. int ret = av_reallocp_array(&m->elems, ^ 95. m->count + 1, sizeof(*m->elems)); 96. if (ret < 0) { libavutil/mem.c:168:1: start of procedure av_reallocp_array() 166. } 167. 168. int av_reallocp_array(void *ptr, size_t nmemb, size_t size) ^ 169. { 170. void *val; libavutil/mem.c:172:10: Taking false branch 170. void *val; 171. 172. if (!size || nmemb >= INT_MAX / size) ^ 173. return AVERROR(ENOMEM); 174. if (!nmemb) { libavutil/mem.c:172:18: Taking true branch 170. void *val; 171. 172. if (!size || nmemb >= INT_MAX / size) ^ 173. return AVERROR(ENOMEM); 174. if (!nmemb) { libavutil/mem.c:173:9: 171. 172. if (!size || nmemb >= INT_MAX / size) 173. return AVERROR(ENOMEM); ^ 174. if (!nmemb) { 175. av_freep(ptr); libavutil/mem.c:188:1: return from a call to av_reallocp_array 186. memcpy(ptr, &val, sizeof(val)); 187. return 0; 188. } ^ 189. 190. void av_free(void *ptr) libavutil/dict.c:96:13: Taking true branch 94. int ret = av_reallocp_array(&m->elems, 95. m->count + 1, sizeof(*m->elems)); 96. if (ret < 0) { ^ 97. if (allocated) 98. av_freep(pm); libavutil/dict.c:97:17: Taking true branch 95. m->count + 1, sizeof(*m->elems)); 96. if (ret < 0) { 97. if (allocated) ^ 98. av_freep(pm); 99. libavutil/dict.c:98:17: Skipping av_freep(): empty list of specs 96. if (ret < 0) { 97. if (allocated) 98. av_freep(pm); ^ 99. 100. return ret; libavutil/dict.c:100:13: 98. av_freep(pm); 99. 100. return ret; ^ 101. } 102. } libavutil/dict.c:126:1: return from a call to av_dict_set 124. 125. return 0; 126. } ^ 127. 128. static int parse_key_value_pair(AVDictionary **pm, const char **buf, libavformat/hls.c:488:17: Taking true branch 486. ret = av_dict_set(&c->avio_opts, *opt, buf, 487. AV_DICT_DONT_STRDUP_VAL); 488. if (ret < 0) ^ 489. return ret; 490. } libavformat/hls.c:489:17: 487. AV_DICT_DONT_STRDUP_VAL); 488. if (ret < 0) 489. return ret; ^ 490. } 491. opt++; libavformat/hls.c:495:1: return from a call to save_avio_options 493. 494. return ret; 495. } ^ 496. 497. static int hls_read_header(AVFormatContext *s)
https://github.com/libav/libav/blob/611ba89b896a5286b6d8ad9bfdbb8b4f5c11df9c/libavformat/hls.c/#L495
d2a_code_trace_data_42298
void ssl3_cbc_digest_record( const EVP_MD_CTX *ctx, unsigned char* md_out, size_t* md_out_size, const unsigned char header[13], const unsigned char *data, size_t data_plus_mac_size, size_t data_plus_mac_plus_padding_size, const unsigned char *mac_secret, unsigned mac_secret_length, char is_sslv3) { union { double align; unsigned char c[sizeof(LARGEST_DIGEST_CTX)]; } md_state; void (*md_final_raw)(void *ctx, unsigned char *md_out); void (*md_transform)(void *ctx, const unsigned char *block); unsigned md_size, md_block_size = 64; unsigned sslv3_pad_length = 40, header_length, variance_blocks, len, max_mac_bytes, num_blocks, num_starting_blocks, k, mac_end_offset, c, index_a, index_b; unsigned int bits; unsigned char length_bytes[MAX_HASH_BIT_COUNT_BYTES]; unsigned char hmac_pad[MAX_HASH_BLOCK_SIZE]; unsigned char first_block[MAX_HASH_BLOCK_SIZE]; unsigned char mac_out[EVP_MAX_MD_SIZE]; unsigned i, j, md_out_size_u; EVP_MD_CTX md_ctx; unsigned md_length_size = 8; char length_is_big_endian = 1; OPENSSL_assert(data_plus_mac_plus_padding_size < 1024*1024); switch (EVP_MD_CTX_type(ctx)) { case NID_md5: MD5_Init((MD5_CTX*)md_state.c); md_final_raw = tls1_md5_final_raw; md_transform = (void(*)(void *ctx, const unsigned char *block)) MD5_Transform; md_size = 16; sslv3_pad_length = 48; length_is_big_endian = 0; break; case NID_sha1: SHA1_Init((SHA_CTX*)md_state.c); md_final_raw = tls1_sha1_final_raw; md_transform = (void(*)(void *ctx, const unsigned char *block)) SHA1_Transform; md_size = 20; break; #ifndef OPENSSL_NO_SHA256 case NID_sha224: SHA224_Init((SHA256_CTX*)md_state.c); md_final_raw = tls1_sha256_final_raw; md_transform = (void(*)(void *ctx, const unsigned char *block)) SHA256_Transform; md_size = 224/8; break; case NID_sha256: SHA256_Init((SHA256_CTX*)md_state.c); md_final_raw = tls1_sha256_final_raw; md_transform = (void(*)(void *ctx, const unsigned char *block)) SHA256_Transform; md_size = 32; break; #endif #ifndef OPENSSL_NO_SHA512 case NID_sha384: SHA384_Init((SHA512_CTX*)md_state.c); md_final_raw = tls1_sha512_final_raw; md_transform = (void(*)(void *ctx, const unsigned char *block)) SHA512_Transform; md_size = 384/8; md_block_size = 128; md_length_size = 16; break; case NID_sha512: SHA512_Init((SHA512_CTX*)md_state.c); md_final_raw = tls1_sha512_final_raw; md_transform = (void(*)(void *ctx, const unsigned char *block)) SHA512_Transform; md_size = 64; md_block_size = 128; md_length_size = 16; break; #endif default: OPENSSL_assert(0); if (md_out_size) *md_out_size = -1; return; } OPENSSL_assert(md_length_size <= MAX_HASH_BIT_COUNT_BYTES); OPENSSL_assert(md_block_size <= MAX_HASH_BLOCK_SIZE); OPENSSL_assert(md_size <= EVP_MAX_MD_SIZE); header_length = 13; if (is_sslv3) { header_length = mac_secret_length + sslv3_pad_length + 8 + 1 + 2 ; } variance_blocks = is_sslv3 ? 2 : 6; len = data_plus_mac_plus_padding_size + header_length; max_mac_bytes = len - md_size - 1; num_blocks = (max_mac_bytes + 1 + md_length_size + md_block_size - 1) / md_block_size; num_starting_blocks = 0; k = 0; mac_end_offset = data_plus_mac_size + header_length - md_size; c = mac_end_offset % md_block_size; index_a = mac_end_offset / md_block_size; index_b = (mac_end_offset + md_length_size) / md_block_size; if (num_blocks > variance_blocks + (is_sslv3 ? 1 : 0)) { num_starting_blocks = num_blocks - variance_blocks; k = md_block_size*num_starting_blocks; } bits = 8*mac_end_offset; if (!is_sslv3) { bits += 8*md_block_size; memset(hmac_pad, 0, md_block_size); OPENSSL_assert(mac_secret_length <= sizeof(hmac_pad)); memcpy(hmac_pad, mac_secret, mac_secret_length); for (i = 0; i < md_block_size; i++) hmac_pad[i] ^= 0x36; md_transform(md_state.c, hmac_pad); } if (length_is_big_endian) { memset(length_bytes,0,md_length_size-4); length_bytes[md_length_size-4] = (unsigned char)(bits>>24); length_bytes[md_length_size-3] = (unsigned char)(bits>>16); length_bytes[md_length_size-2] = (unsigned char)(bits>>8); length_bytes[md_length_size-1] = (unsigned char)bits; } else { memset(length_bytes,0,md_length_size); length_bytes[md_length_size-5] = (unsigned char)(bits>>24); length_bytes[md_length_size-6] = (unsigned char)(bits>>16); length_bytes[md_length_size-7] = (unsigned char)(bits>>8); length_bytes[md_length_size-8] = (unsigned char)bits; } if (k > 0) { if (is_sslv3) { unsigned overhang = header_length-md_block_size; md_transform(md_state.c, header); memcpy(first_block, header + md_block_size, overhang); memcpy(first_block + overhang, data, md_block_size-overhang); md_transform(md_state.c, first_block); for (i = 1; i < k/md_block_size - 1; i++) md_transform(md_state.c, data + md_block_size*i - overhang); } else { memcpy(first_block, header, 13); memcpy(first_block+13, data, md_block_size-13); md_transform(md_state.c, first_block); for (i = 1; i < k/md_block_size; i++) md_transform(md_state.c, data + md_block_size*i - 13); } } memset(mac_out, 0, sizeof(mac_out)); for (i = num_starting_blocks; i <= num_starting_blocks+variance_blocks; i++) { unsigned char block[MAX_HASH_BLOCK_SIZE]; unsigned char is_block_a = constant_time_eq_8(i, index_a); unsigned char is_block_b = constant_time_eq_8(i, index_b); for (j = 0; j < md_block_size; j++) { unsigned char b = 0, is_past_c, is_past_cp1; if (k < header_length) b = header[k]; else if (k < data_plus_mac_plus_padding_size + header_length) b = data[k-header_length]; k++; is_past_c = is_block_a & constant_time_ge(j, c); is_past_cp1 = is_block_a & constant_time_ge(j, c+1); b = (b&~is_past_c) | (0x80&is_past_c); b = b&~is_past_cp1; b &= ~is_block_b | is_block_a; if (j >= md_block_size - md_length_size) { b = (b&~is_block_b) | (is_block_b&length_bytes[j-(md_block_size-md_length_size)]); } block[j] = b; } md_transform(md_state.c, block); md_final_raw(md_state.c, block); for (j = 0; j < md_size; j++) mac_out[j] |= block[j]&is_block_b; } EVP_MD_CTX_init(&md_ctx); EVP_DigestInit_ex(&md_ctx, ctx->digest, NULL ); if (is_sslv3) { memset(hmac_pad, 0x5c, sslv3_pad_length); EVP_DigestUpdate(&md_ctx, mac_secret, mac_secret_length); EVP_DigestUpdate(&md_ctx, hmac_pad, sslv3_pad_length); EVP_DigestUpdate(&md_ctx, mac_out, md_size); } else { for (i = 0; i < md_block_size; i++) hmac_pad[i] ^= 0x6a; EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size); EVP_DigestUpdate(&md_ctx, mac_out, md_size); } EVP_DigestFinal(&md_ctx, md_out, &md_out_size_u); if (md_out_size) *md_out_size = md_out_size_u; EVP_MD_CTX_cleanup(&md_ctx); } ssl/t1_enc.c:1037: error: INTEGER_OVERFLOW_L2 ([13, +oo] - [16, 64]):unsigned64 by call to `ssl3_cbc_digest_record`. Showing all 7 steps of the trace ssl/t1_enc.c:971:1: Parameter `ssl->s3->read_mac_secret_size` 969. } 970. 971. > int tls1_mac(SSL *ssl, unsigned char *md, int send) 972. { 973. SSL3_RECORD *rec; ssl/t1_enc.c:1037:3: Call 1035. * data we are hashing because that gives an attacker a 1036. * timing-oracle. */ 1037. ssl3_cbc_digest_record( ^ 1038. mac_ctx, 1039. md, &md_size, ssl/s3_cbc.c:433:1: <LHS trace> 431. * a padding byte and MAC. (If the padding was invalid, it might contain the 432. * padding too. ) */ 433. > void ssl3_cbc_digest_record( 434. const EVP_MD_CTX *ctx, 435. unsigned char* md_out, ssl/s3_cbc.c:433:1: Parameter `data_plus_mac_size` 431. * a padding byte and MAC. (If the padding was invalid, it might contain the 432. * padding too. ) */ 433. > void ssl3_cbc_digest_record( 434. const EVP_MD_CTX *ctx, 435. unsigned char* md_out, ssl/s3_cbc.c:476:4: <RHS trace> 474. md_final_raw = tls1_md5_final_raw; 475. md_transform = (void(*)(void *ctx, const unsigned char *block)) MD5_Transform; 476. md_size = 16; ^ 477. sslv3_pad_length = 48; 478. length_is_big_endian = 0; ssl/s3_cbc.c:476:4: Assignment 474. md_final_raw = tls1_md5_final_raw; 475. md_transform = (void(*)(void *ctx, const unsigned char *block)) MD5_Transform; 476. md_size = 16; ^ 477. sslv3_pad_length = 48; 478. length_is_big_endian = 0; ssl/s3_cbc.c:581:2: Binary operation: ([13, +oo] - [16, 64]):unsigned64 by call to `ssl3_cbc_digest_record` 579. /* mac_end_offset is the index just past the end of the data to be 580. * MACed. */ 581. mac_end_offset = data_plus_mac_size + header_length - md_size; ^ 582. /* c is the index of the 0x80 byte in the final hash block that 583. * contains application data. */
https://github.com/openssl/openssl/blob/f93a41877d8d7a287debb7c63d7b646abaaf269c/ssl/s3_cbc.c/#L581
d2a_code_trace_data_42299
void ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) { ngx_connection_t *c; ngx_http_request_t *pr; ngx_http_core_loc_conf_t *clcf; c = r->connection; ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0, "http finalize request: %d, \"%V?%V\" a:%d, c:%d", rc, &r->uri, &r->args, r == c->data, r->main->count); if (rc == NGX_DONE) { ngx_http_finalize_connection(r); return; } if (rc == NGX_OK && r->filter_finalize) { c->error = 1; } if (rc == NGX_DECLINED) { r->content_handler = NULL; r->write_event_handler = ngx_http_core_run_phases; ngx_http_core_run_phases(r); return; } if (r != r->main && r->post_subrequest) { rc = r->post_subrequest->handler(r, r->post_subrequest->data, rc); } if (rc == NGX_ERROR || rc == NGX_HTTP_REQUEST_TIME_OUT || rc == NGX_HTTP_CLIENT_CLOSED_REQUEST || c->error) { if (ngx_http_post_action(r) == NGX_OK) { return; } if (r->main->blocked) { r->write_event_handler = ngx_http_request_finalizer; } ngx_http_terminate_request(r, rc); return; } if (rc >= NGX_HTTP_SPECIAL_RESPONSE || rc == NGX_HTTP_CREATED || rc == NGX_HTTP_NO_CONTENT) { if (rc == NGX_HTTP_CLOSE) { ngx_http_terminate_request(r, rc); return; } if (r == r->main) { if (c->read->timer_set) { ngx_del_timer(c->read); } if (c->write->timer_set) { ngx_del_timer(c->write); } } c->read->handler = ngx_http_request_handler; c->write->handler = ngx_http_request_handler; ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc)); return; } if (r != r->main) { if (r->buffered || r->postponed) { if (ngx_http_set_write_handler(r) != NGX_OK) { ngx_http_terminate_request(r, 0); } return; } pr = r->parent; if (r == c->data) { r->main->count--; if (!r->logged) { clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); if (clcf->log_subrequest) { ngx_http_log_request(r); } r->logged = 1; } else { ngx_log_error(NGX_LOG_ALERT, c->log, 0, "subrequest: \"%V?%V\" logged again", &r->uri, &r->args); } r->done = 1; if (pr->postponed && pr->postponed->request == r) { pr->postponed = pr->postponed->next; } c->data = pr; } else { ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "http finalize non-active request: \"%V?%V\"", &r->uri, &r->args); r->write_event_handler = ngx_http_request_finalizer; if (r->waited) { r->done = 1; } } if (ngx_http_post_request(pr, NULL) != NGX_OK) { r->main->count++; ngx_http_terminate_request(r, 0); return; } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "http wake parent request: \"%V?%V\"", &pr->uri, &pr->args); return; } if (r->buffered || c->buffered || r->postponed || r->blocked) { if (ngx_http_set_write_handler(r) != NGX_OK) { ngx_http_terminate_request(r, 0); } return; } if (r != c->data) { ngx_log_error(NGX_LOG_ALERT, c->log, 0, "http finalize non-active request: \"%V?%V\"", &r->uri, &r->args); return; } r->done = 1; r->write_event_handler = ngx_http_request_empty_handler; if (!r->post_action) { r->request_complete = 1; } if (ngx_http_post_action(r) == NGX_OK) { return; } if (c->read->timer_set) { ngx_del_timer(c->read); } if (c->write->timer_set) { c->write->delayed = 0; ngx_del_timer(c->write); } if (c->read->eof) { ngx_http_close_request(r, 0); return; } ngx_http_finalize_connection(r); } src/http/ngx_http_upstream.c:637: error: Integer Overflow L2 ([0, `r->main->count` + 3] - 1):unsigned32 by call to `ngx_http_upstream_connect`. src/http/ngx_http_upstream.c:505:1: Parameter `r->main->count` 503. 504. 505. static void ^ 506. ngx_http_upstream_init_request(ngx_http_request_t *r) 507. { src/http/ngx_http_upstream.c:637:13: Call 635. } 636. 637. ngx_http_upstream_connect(r, u); ^ 638. 639. return; src/http/ngx_http_upstream.c:1303:1: Parameter `r->main->count` 1301. 1302. 1303. static void ^ 1304. ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u) 1305. { src/http/ngx_http_upstream.c:1343:9: Call 1341. if (rc == NGX_BUSY) { 1342. ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no live upstreams"); 1343. ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_NOLIVE); ^ 1344. return; 1345. } src/http/ngx_http_upstream.c:3778:1: Parameter `r->main->count` 3776. 3777. 3778. static void ^ 3779. ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u, 3780. ngx_uint_t ft_type) src/http/ngx_http_upstream.c:3847:9: Call 3845. 3846. if (r->connection->error) { 3847. ngx_http_upstream_finalize_request(r, u, ^ 3848. NGX_HTTP_CLIENT_CLOSED_REQUEST); 3849. return; src/http/ngx_http_upstream.c:3923:1: Parameter `r->main->count` 3921. 3922. 3923. static void ^ 3924. ngx_http_upstream_finalize_request(ngx_http_request_t *r, 3925. ngx_http_upstream_t *u, ngx_int_t rc) src/http/ngx_http_upstream.c:3934:9: Call 3932. if (u->cleanup == NULL) { 3933. /* the request was already finalized */ 3934. ngx_http_finalize_request(r, NGX_DONE); ^ 3935. return; 3936. } src/http/ngx_http_request.c:2249:1: <LHS trace> 2247. 2248. 2249. void ^ 2250. ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) 2251. { src/http/ngx_http_request.c:2249:1: Parameter `r->main->count` 2247. 2248. 2249. void ^ 2250. ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) 2251. { src/http/ngx_http_request.c:2340:13: Binary operation: ([0, r->main->count + 3] - 1):unsigned32 by call to `ngx_http_upstream_connect` 2338. if (r == c->data) { 2339. 2340. r->main->count--; ^ 2341. 2342. if (!r->logged) {
https://github.com/nginx/nginx/blob/0d3b15729ce1340098f098a1e3342f13183fdde2/src/http/ngx_http_request.c/#L2340
d2a_code_trace_data_42300
static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, X509 **pissuer, int *pcrl_score) { X509 *crl_issuer = NULL; X509_NAME *cnm = X509_CRL_get_issuer(crl); int cidx = ctx->error_depth; int i; if (cidx != sk_X509_num(ctx->chain) - 1) cidx++; crl_issuer = sk_X509_value(ctx->chain, cidx); if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; *pissuer = crl_issuer; return; } } for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { crl_issuer = sk_X509_value(ctx->chain, cidx); if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) continue; if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_SAME_PATH; *pissuer = crl_issuer; return; } } if (!(ctx->param->flags & X509_V_FLAG_EXTENDED_CRL_SUPPORT)) return; for (i = 0; i < sk_X509_num(ctx->untrusted); i++) { crl_issuer = sk_X509_value(ctx->untrusted, i); if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) continue; if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { *pissuer = crl_issuer; *pcrl_score |= CRL_SCORE_AKID; return; } } } crypto/x509/x509_vfy.c:1075: error: NULL_DEREFERENCE pointer `crl_issuer` last assigned on line 1074 could be null and is dereferenced by call to `X509_get_subject_name()` at line 1075, column 27. Showing all 52 steps of the trace crypto/x509/x509_vfy.c:1052:1: start of procedure crl_akid_check() 1050. } 1051. 1052. > static void crl_akid_check(X509_STORE_CTX *ctx, X509_CRL *crl, 1053. X509 **pissuer, int *pcrl_score) 1054. { crypto/x509/x509_vfy.c:1055:5: 1053. X509 **pissuer, int *pcrl_score) 1054. { 1055. > X509 *crl_issuer = NULL; 1056. X509_NAME *cnm = X509_CRL_get_issuer(crl); 1057. int cidx = ctx->error_depth; crypto/x509/x509_vfy.c:1056:5: 1054. { 1055. X509 *crl_issuer = NULL; 1056. > X509_NAME *cnm = X509_CRL_get_issuer(crl); 1057. int cidx = ctx->error_depth; 1058. int i; crypto/x509/x509cset.c:156:1: start of procedure X509_CRL_get_issuer() 154. } 155. 156. > X509_NAME *X509_CRL_get_issuer(X509_CRL *crl) 157. { 158. return crl->crl.issuer; crypto/x509/x509cset.c:158:5: 156. X509_NAME *X509_CRL_get_issuer(X509_CRL *crl) 157. { 158. > return crl->crl.issuer; 159. } 160. crypto/x509/x509cset.c:159:1: return from a call to X509_CRL_get_issuer 157. { 158. return crl->crl.issuer; 159. > } 160. 161. STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(X509_CRL *crl) crypto/x509/x509_vfy.c:1057:5: 1055. X509 *crl_issuer = NULL; 1056. X509_NAME *cnm = X509_CRL_get_issuer(crl); 1057. > int cidx = ctx->error_depth; 1058. int i; 1059. crypto/x509/x509_vfy.c:1060:9: 1058. int i; 1059. 1060. > if (cidx != sk_X509_num(ctx->chain) - 1) 1061. cidx++; 1062. include/openssl/x509.h:170:1: start of procedure sk_X509_num() 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ 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 true branch 317. int sk_num(const _STACK *st) 318. { 319. if (st == NULL) ^ 320. return -1; 321. return st->num; crypto/stack/stack.c:320:9: 318. { 319. if (st == NULL) 320. > return -1; 321. return st->num; 322. } 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) include/openssl/x509.h:170:1: return from a call to sk_X509_num 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:1060:9: Taking true branch 1058. int i; 1059. 1060. if (cidx != sk_X509_num(ctx->chain) - 1) ^ 1061. cidx++; 1062. crypto/x509/x509_vfy.c:1061:9: 1059. 1060. if (cidx != sk_X509_num(ctx->chain) - 1) 1061. > cidx++; 1062. 1063. crl_issuer = sk_X509_value(ctx->chain, cidx); crypto/x509/x509_vfy.c:1063:5: 1061. cidx++; 1062. 1063. > crl_issuer = sk_X509_value(ctx->chain, cidx); 1064. 1065. if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { include/openssl/x509.h:170:1: start of procedure sk_X509_value() 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ 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 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) include/openssl/x509.h:170:1: return from a call to sk_X509_value 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:1065:9: 1063. crl_issuer = sk_X509_value(ctx->chain, cidx); 1064. 1065. > if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { 1066. if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { 1067. *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; crypto/x509v3/v3_purp.c:813:1: start of procedure X509_check_akid() 811. } 812. 813. > int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) 814. { 815. crypto/x509v3/v3_purp.c:816:10: Taking false branch 814. { 815. 816. if (!akid) ^ 817. return X509_V_OK; 818. crypto/x509v3/v3_purp.c:820:9: Taking false branch 818. 819. /* Check key ids (if present) */ 820. if (akid->keyid && issuer->skid && ^ 821. ASN1_OCTET_STRING_cmp(akid->keyid, issuer->skid)) 822. return X509_V_ERR_AKID_SKID_MISMATCH; crypto/x509v3/v3_purp.c:824:9: Taking false branch 822. return X509_V_ERR_AKID_SKID_MISMATCH; 823. /* Check serial number */ 824. if (akid->serial && ^ 825. ASN1_INTEGER_cmp(X509_get_serialNumber(issuer), akid->serial)) 826. return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; crypto/x509v3/v3_purp.c:828:9: Taking false branch 826. return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; 827. /* Check issuer name */ 828. if (akid->issuer) { ^ 829. /* 830. * Ugh, for some peculiar reason AKID includes SEQUENCE OF crypto/x509v3/v3_purp.c:849:5: 847. return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH; 848. } 849. > return X509_V_OK; 850. } 851. crypto/x509v3/v3_purp.c:850:1: return from a call to X509_check_akid 848. } 849. return X509_V_OK; 850. > } 851. 852. uint32_t X509_get_extension_flags(X509 *x) crypto/x509/x509_vfy.c:1065:9: Taking true branch 1063. crl_issuer = sk_X509_value(ctx->chain, cidx); 1064. 1065. if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { ^ 1066. if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { 1067. *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; crypto/x509/x509_vfy.c:1066:13: Taking false branch 1064. 1065. if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { 1066. if (*pcrl_score & CRL_SCORE_ISSUER_NAME) { ^ 1067. *pcrl_score |= CRL_SCORE_AKID | CRL_SCORE_ISSUER_CERT; 1068. *pissuer = crl_issuer; crypto/x509/x509_vfy.c:1073:10: 1071. } 1072. 1073. > for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { 1074. crl_issuer = sk_X509_value(ctx->chain, cidx); 1075. if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) crypto/x509/x509_vfy.c:1073:18: 1071. } 1072. 1073. > for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { 1074. crl_issuer = sk_X509_value(ctx->chain, cidx); 1075. if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) include/openssl/x509.h:170:1: start of procedure sk_X509_num() 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ 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 true branch 317. int sk_num(const _STACK *st) 318. { 319. if (st == NULL) ^ 320. return -1; 321. return st->num; crypto/stack/stack.c:320:9: 318. { 319. if (st == NULL) 320. > return -1; 321. return st->num; 322. } 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) include/openssl/x509.h:170:1: return from a call to sk_X509_num 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:1073:18: Loop condition is true. Entering loop body 1071. } 1072. 1073. for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { ^ 1074. crl_issuer = sk_X509_value(ctx->chain, cidx); 1075. if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) crypto/x509/x509_vfy.c:1074:9: 1072. 1073. for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { 1074. > crl_issuer = sk_X509_value(ctx->chain, cidx); 1075. if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) 1076. continue; include/openssl/x509.h:170:1: start of procedure sk_X509_value() 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ 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 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) include/openssl/x509.h:170:1: return from a call to sk_X509_value 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:1075:13: 1073. for (cidx++; cidx < sk_X509_num(ctx->chain); cidx++) { 1074. crl_issuer = sk_X509_value(ctx->chain, cidx); 1075. > if (X509_NAME_cmp(X509_get_subject_name(crl_issuer), cnm)) 1076. continue; 1077. if (X509_check_akid(crl_issuer, crl->akid) == X509_V_OK) { crypto/x509/x509_cmp.c:149:1: start of procedure X509_get_subject_name() 147. #endif 148. 149. > X509_NAME *X509_get_subject_name(X509 *a) 150. { 151. return (a->cert_info.subject); crypto/x509/x509_cmp.c:151:5: 149. X509_NAME *X509_get_subject_name(X509 *a) 150. { 151. > return (a->cert_info.subject); 152. } 153.
https://github.com/openssl/openssl/blob/25be7a0feacdbd3326774f0da8aaeb966c1f57f8/crypto/x509/x509_vfy.c/#L1075
d2a_code_trace_data_42301
static int opt_vstats(const char *opt, const char *arg) { char filename[40]; time_t today2 = time(NULL); struct tm *today = localtime(&today2); snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, today->tm_sec); return opt_vstats_file(opt, filename); } avconv.c:4342: error: Null Dereference pointer `today` last assigned on line 4340 could be null and is dereferenced at line 4342, column 69. avconv.c:4336:1: start of procedure opt_vstats() 4334. } 4335. 4336. static int opt_vstats(const char *opt, const char *arg) ^ 4337. { 4338. char filename[40]; avconv.c:4339:5: 4337. { 4338. char filename[40]; 4339. time_t today2 = time(NULL); ^ 4340. struct tm *today = localtime(&today2); 4341. avconv.c:4340:5: 4338. char filename[40]; 4339. time_t today2 = time(NULL); 4340. struct tm *today = localtime(&today2); ^ 4341. 4342. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, avconv.c:4342:5: 4340. struct tm *today = localtime(&today2); 4341. 4342. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 4343. today->tm_sec); 4344. return opt_vstats_file(opt, filename);
https://github.com/libav/libav/blob/13f6917ca91dfdc0fd785235b2dae891a9604859/avconv.c/#L4342
d2a_code_trace_data_42302
IMPLEMENT_new_ctx(ctr, CTR, 192) providers/common/ciphers/aes.c:319: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 319 could be null and is dereferenced at line 319, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:319:1: start of procedure aes_192_ctr_newctx() 317. IMPLEMENT_new_params(ctr, CTR) 318. IMPLEMENT_new_ctx(ctr, CTR, 256) 319. > IMPLEMENT_new_ctx(ctr, CTR, 192) 320. IMPLEMENT_new_ctx(ctr, CTR, 128) 321. crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE) crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking false branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) providers/common/ciphers/aes.c:319:1: 317. IMPLEMENT_new_params(ctr, CTR) 318. IMPLEMENT_new_ctx(ctr, CTR, 256) 319. > IMPLEMENT_new_ctx(ctr, CTR, 192) 320. IMPLEMENT_new_ctx(ctr, CTR, 128) 321.
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L319
d2a_code_trace_data_42303
static int img_write_packet(AVFormatContext *s, AVPacket *pkt) { VideoData *img = s->priv_data; ByteIOContext *pb[3]; char filename[1024]; AVCodecContext *codec= s->streams[ pkt->stream_index ]->codec; int i; if (!img->is_pipe) { if (av_get_frame_filename(filename, sizeof(filename), img->path, img->img_number) < 0 && img->img_number>1) return AVERROR(EIO); for(i=0; i<3; i++){ if (url_fopen(&pb[i], filename, URL_WRONLY) < 0) return AVERROR(EIO); if(codec->codec_id != CODEC_ID_RAWVIDEO) break; filename[ strlen(filename) - 1 ]= 'U' + i; } } else { pb[0] = s->pb; } if(codec->codec_id == CODEC_ID_RAWVIDEO){ int ysize = codec->width * codec->height; put_buffer(pb[0], pkt->data , ysize); put_buffer(pb[1], pkt->data + ysize, (pkt->size - ysize)/2); put_buffer(pb[2], pkt->data + ysize +(pkt->size - ysize)/2, (pkt->size - ysize)/2); put_flush_packet(pb[1]); put_flush_packet(pb[2]); url_fclose(pb[1]); url_fclose(pb[2]); }else{ put_buffer(pb[0], pkt->data, pkt->size); } put_flush_packet(pb[0]); if (!img->is_pipe) { url_fclose(pb[0]); } img->img_number++; return 0; } libavformat/img2.c:349: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64. libavformat/img2.c:331:1: <LHS trace> 329. } 330. 331. static int img_write_packet(AVFormatContext *s, AVPacket *pkt) ^ 332. { 333. VideoData *img = s->priv_data; libavformat/img2.c:331:1: Array declaration 329. } 330. 331. static int img_write_packet(AVFormatContext *s, AVPacket *pkt) ^ 332. { 333. VideoData *img = s->priv_data; libavformat/img2.c:349:13: Binary operation: ([0, +oo] - 1):unsigned64 347. if(codec->codec_id != CODEC_ID_RAWVIDEO) 348. break; 349. filename[ strlen(filename) - 1 ]= 'U' + i; ^ 350. } 351. } else {
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/img2.c/#L349
d2a_code_trace_data_42304
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/ec/ec_pmeth.c:261: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `EC_KEY_dup`. Showing all 19 steps of the trace crypto/ec/ec_pmeth.c:217:1: Parameter `ctx->pkey->pkey.ec->group->cofactor->top` 215. #endif 216. 217. > static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) 218. { 219. EC_PKEY_CTX *dctx = ctx->data; crypto/ec/ec_pmeth.c:258:17: Call 256. return -2; 257. /* If cofactor is 1 cofactor mode does nothing */ 258. if (BN_is_one(ec_key->group->cofactor)) ^ 259. return 1; 260. if (!dctx->co_key) { crypto/bn/bn_lib.c:857:1: Parameter `a->top` 855. } 856. 857. > int BN_is_one(const BIGNUM *a) 858. { 859. return BN_abs_is_word(a, 1) && !a->neg; crypto/bn/bn_lib.c:859:12: Call 857. int BN_is_one(const BIGNUM *a) 858. { 859. return BN_abs_is_word(a, 1) && !a->neg; ^ 860. } 861. crypto/bn/bn_lib.c:847:1: Parameter `a->top` 845. } 846. 847. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 848. { 849. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/ec/ec_pmeth.c:261:32: Call 259. return 1; 260. if (!dctx->co_key) { 261. dctx->co_key = EC_KEY_dup(ec_key); ^ 262. if (!dctx->co_key) 263. return 0; crypto/ec/ec_key.c:149:1: Parameter `ec_key->group->cofactor->top` 147. } 148. 149. > EC_KEY *EC_KEY_dup(const EC_KEY *ec_key) 150. { 151. EC_KEY *ret = EC_KEY_new_method(ec_key->engine); crypto/ec/ec_key.c:156:9: Call 154. return NULL; 155. 156. if (EC_KEY_copy(ret, ec_key) == NULL) { ^ 157. EC_KEY_free(ret); 158. return NULL; crypto/ec/ec_key.c:72:1: Parameter `src->group->cofactor->top` 70. } 71. 72. > EC_KEY *EC_KEY_copy(EC_KEY *dest, const EC_KEY *src) 73. { 74. if (dest == NULL || src == NULL) { crypto/ec/ec_key.c:97:14: Call 95. if (dest->group == NULL) 96. return NULL; 97. if (!EC_GROUP_copy(dest->group, src->group)) ^ 98. return NULL; 99. crypto/ec/ec_lib.c:130:1: Parameter `src->cofactor->top` 128. } 129. 130. > int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src) 131. { 132. if (dest->meth->group_copy == 0) { crypto/ec/ec_lib.c:206:14: Call 204. if (!BN_copy(dest->order, src->order)) 205. return 0; 206. if (!BN_copy(dest->cofactor, src->cofactor)) ^ 207. return 0; 208. } crypto/bn/bn_lib.c:323:1: <Offset trace> 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:323:1: Parameter `b->top` 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:323:1: <Length trace> 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:323:1: Parameter `*a->d` 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:329:9: Call 327. if (a == b) 328. return a; 329. if (bn_wexpand(a, b->top) == NULL) ^ 330. return NULL; 331. crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:333:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `EC_KEY_dup` 331. 332. if (b->top > 0) 333. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); ^ 334. 335. a->top = b->top;
https://github.com/openssl/openssl/blob/05eec39505ba8af6f3c1558a26c565987707cd37/crypto/bn/bn_lib.c/#L333
d2a_code_trace_data_42305
static const char *skip_space(const char *s) { while (ossl_isspace(*s)) s++; return s; } test/property_test.c:243: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, 11] by call to `ossl_method_store_add`. Showing all 25 steps of the trace test/property_test.c:229:9: Array declaration 227. char *impl; 228. } impls[] = { 229. { 6, "position=1", "a" }, ^ 230. { 6, "position=2", "b" }, 231. { 6, "position=3", "c" }, test/property_test.c:243:14: Call 241. 242. for (i = 0; i < OSSL_NELEM(impls); i++) 243. if (!TEST_true(ossl_method_store_add(store, impls[i].nid, impls[i].prop, ^ 244. impls[i].impl, NULL))) { 245. 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:322:1: Parameter `*defn` 320. } 321. 322. > OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn) 323. { 324. PROPERTY_DEFINITION *prop = NULL; crypto/property/property_parse.c:327:5: Assignment 325. OSSL_PROPERTY_LIST *res = NULL; 326. STACK_OF(PROPERTY_DEFINITION) *sk; 327. const char *s = defn; ^ 328. int done; 329. crypto/property/property_parse.c:333:9: Call 331. return NULL; 332. 333. s = skip_space(s); ^ 334. done = *s == '\0'; 335. 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:333:5: Assignment 331. return NULL; 332. 333. s = skip_space(s); ^ 334. done = *s == '\0'; 335. while (!done) { crypto/property/property_parse.c:341:14: Call 339. memset(&prop->v, 0, sizeof(prop->v)); 340. prop->optional = 0; 341. if (!parse_name(ctx, &s, 1, &prop->name_idx)) ^ 342. goto err; 343. 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:348:13: Call 346. goto err; 347. } 348. if (match_ch(&s, '=')) { ^ 349. if (!parse_value(ctx, &s, prop, 1)) { 350. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, 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:349:18: Call 347. } 348. if (match_ch(&s, '=')) { 349. if (!parse_value(ctx, &s, prop, 1)) { ^ 350. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); 351. goto err; crypto/property/property_parse.c:247:1: Parameter `**t` 245. } 246. 247. > static int parse_value(OPENSSL_CTX *ctx, const char *t[], 248. PROPERTY_DEFINITION *res, int create) 249. { crypto/property/property_parse.c:250:5: Assignment 248. PROPERTY_DEFINITION *res, int create) 249. { 250. const char *s = *t; ^ 251. int r = 0; 252. crypto/property/property_parse.c:254:9: Assignment 252. 253. if (*s == '"' || *s == '\'') { 254. s++; ^ 255. r = parse_string(ctx, &s, s[-1], res, create); 256. } else if (*s == '+') { crypto/property/property_parse.c:255:13: Call 253. if (*s == '"' || *s == '\'') { 254. s++; 255. r = parse_string(ctx, &s, s[-1], res, create); ^ 256. } else if (*s == '+') { 257. s++; crypto/property/property_parse.c:186:1: Parameter `**t` 184. } 185. 186. > static int parse_string(OPENSSL_CTX *ctx, const char *t[], char delim, 187. PROPERTY_DEFINITION *res, const int create) 188. { crypto/property/property_parse.c:190:5: Assignment 188. { 189. char v[1000]; 190. const char *s = *t; ^ 191. size_t i = 0; 192. int err = 0; crypto/property/property_parse.c:207:10: Call 205. } 206. v[i] = '\0'; 207. *t = skip_space(s + 1); ^ 208. if (err) 209. PROPerr(PROP_F_PARSE_STRING, PROP_R_STRING_TOO_LONG); 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, 11] 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/bddf965d29cb4a9c4d6eeb94aa96dfa47d0cfa5d/crypto/property/property_parse.c/#L54
d2a_code_trace_data_42306
static void filter_mb_mbaff_edgecv( 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]] + 1; tc[1] = tc0_table[index_a][bS[1*bsi]] + 1; tc[2] = tc0_table[index_a][bS[2*bsi]] + 1; tc[3] = tc0_table[index_a][bS[3*bsi]] + 1; h->h264dsp.h264_h_loop_filter_chroma_mbaff(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_h_loop_filter_chroma_mbaff_intra(pix, stride, alpha, beta); } } libavcodec/h264_loopfilter.c:722: error: Buffer Overrun L2 Offset: [1, 4] Size: 4 by call to `filter_mb_mbaff_edgecv`. 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:722:21: Call 720. filter_mb_mbaff_edgev ( h, img_cr + 8*uvlinesize, uvlinesize, bS+4, 1, rqp[1] ); 721. }else{ 722. filter_mb_mbaff_edgecv( h, img_cb, uvlinesize, bS , 1, bqp[0] ); ^ 723. filter_mb_mbaff_edgecv( h, img_cb + 4*uvlinesize, uvlinesize, bS+4, 1, bqp[1] ); 724. filter_mb_mbaff_edgecv( h, img_cr, uvlinesize, bS , 1, rqp[0] ); libavcodec/h264_loopfilter.c:158:1: <Offset trace> 156. } 157. } 158. static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) { ^ 159. const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); 160. int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; libavcodec/h264_loopfilter.c:158:1: Parameter `*bS` 156. } 157. } 158. static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) { ^ 159. const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); 160. 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:167:17: Array access: Offset: [1, 4] Size: 4 by call to `filter_mb_mbaff_edgecv` 165. if( bS[0] < 4 ) { 166. int8_t tc[4]; 167. tc[0] = tc0_table[index_a][bS[0*bsi]] + 1; ^ 168. tc[1] = tc0_table[index_a][bS[1*bsi]] + 1; 169. tc[2] = tc0_table[index_a][bS[2*bsi]] + 1;
https://github.com/libav/libav/blob/ecf026f1aa8ffe170b5b8c577cae56a405ebafc8/libavcodec/h264_loopfilter.c/#L167
d2a_code_trace_data_42307
static int execute_cert_test(CT_TEST_FIXTURE *fixture) { int success = 0; X509 *cert = NULL, *issuer = NULL; STACK_OF(SCT) *scts = NULL; SCT *sct = NULL; char expected_sct_text[CT_TEST_MAX_FILE_SIZE]; int sct_text_len = 0; unsigned char *tls_sct_list = NULL; size_t tls_sct_list_len = 0; CT_POLICY_EVAL_CTX *ct_policy_ctx = CT_POLICY_EVAL_CTX_new(); if (fixture->sct_text_file != NULL) { sct_text_len = read_text_file(fixture->sct_dir, fixture->sct_text_file, expected_sct_text, CT_TEST_MAX_FILE_SIZE - 1); if (!TEST_int_ge(sct_text_len, 0)) goto end; expected_sct_text[sct_text_len] = '\0'; } CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE( ct_policy_ctx, fixture->ctlog_store); CT_POLICY_EVAL_CTX_set_time(ct_policy_ctx, fixture->epoch_time_in_ms); if (fixture->certificate_file != NULL) { int sct_extension_index; int i; X509_EXTENSION *sct_extension = NULL; if (!TEST_ptr(cert = load_pem_cert(fixture->certs_dir, fixture->certificate_file))) goto end; CT_POLICY_EVAL_CTX_set1_cert(ct_policy_ctx, cert); if (fixture->issuer_file != NULL) { if (!TEST_ptr(issuer = load_pem_cert(fixture->certs_dir, fixture->issuer_file))) goto end; CT_POLICY_EVAL_CTX_set1_issuer(ct_policy_ctx, issuer); } sct_extension_index = X509_get_ext_by_NID(cert, NID_ct_precert_scts, -1); sct_extension = X509_get_ext(cert, sct_extension_index); if (fixture->expected_sct_count > 0) { if (!TEST_ptr(sct_extension)) goto end; if (fixture->sct_text_file && !compare_extension_printout(sct_extension, expected_sct_text)) goto end; scts = X509V3_EXT_d2i(sct_extension); for (i = 0; i < sk_SCT_num(scts); ++i) { SCT *sct_i = sk_SCT_value(scts, i); if (!TEST_int_eq(SCT_get_source(sct_i), SCT_SOURCE_X509V3_EXTENSION)) { goto end; } } if (fixture->test_validity) { if (!assert_validity(fixture, scts, ct_policy_ctx)) goto end; } } else if (!TEST_ptr_null(sct_extension)) { goto end; } } if (fixture->tls_sct_list != NULL) { const unsigned char *p = fixture->tls_sct_list; if (!TEST_ptr(o2i_SCT_LIST(&scts, &p, fixture->tls_sct_list_len))) goto end; if (fixture->test_validity && cert != NULL) { if (!assert_validity(fixture, scts, ct_policy_ctx)) goto end; } if (fixture->sct_text_file && !compare_sct_list_printout(scts, expected_sct_text)) { goto end; } tls_sct_list_len = i2o_SCT_LIST(scts, &tls_sct_list); if (!TEST_mem_eq(fixture->tls_sct_list, fixture->tls_sct_list_len, tls_sct_list, tls_sct_list_len)) goto end; } success = 1; end: X509_free(cert); X509_free(issuer); SCT_LIST_free(scts); SCT_free(sct); CT_POLICY_EVAL_CTX_free(ct_policy_ctx); OPENSSL_free(tls_sct_list); return success; } test/ct_test.c:317: error: NULL_DEREFERENCE pointer `&scts` last assigned on line 242 could be null and is dereferenced by call to `o2i_SCT_LIST()` at line 317, column 14. Showing all 39 steps of the trace test/ct_test.c:238:1: start of procedure execute_cert_test() 236. } 237. 238. > static int execute_cert_test(CT_TEST_FIXTURE *fixture) 239. { 240. int success = 0; test/ct_test.c:240:5: 238. static int execute_cert_test(CT_TEST_FIXTURE *fixture) 239. { 240. > int success = 0; 241. X509 *cert = NULL, *issuer = NULL; 242. STACK_OF(SCT) *scts = NULL; test/ct_test.c:241:5: 239. { 240. int success = 0; 241. > X509 *cert = NULL, *issuer = NULL; 242. STACK_OF(SCT) *scts = NULL; 243. SCT *sct = NULL; test/ct_test.c:242:5: 240. int success = 0; 241. X509 *cert = NULL, *issuer = NULL; 242. > STACK_OF(SCT) *scts = NULL; 243. SCT *sct = NULL; 244. char expected_sct_text[CT_TEST_MAX_FILE_SIZE]; test/ct_test.c:243:5: 241. X509 *cert = NULL, *issuer = NULL; 242. STACK_OF(SCT) *scts = NULL; 243. > SCT *sct = NULL; 244. char expected_sct_text[CT_TEST_MAX_FILE_SIZE]; 245. int sct_text_len = 0; test/ct_test.c:245:5: 243. SCT *sct = NULL; 244. char expected_sct_text[CT_TEST_MAX_FILE_SIZE]; 245. > int sct_text_len = 0; 246. unsigned char *tls_sct_list = NULL; 247. size_t tls_sct_list_len = 0; test/ct_test.c:246:5: 244. char expected_sct_text[CT_TEST_MAX_FILE_SIZE]; 245. int sct_text_len = 0; 246. > unsigned char *tls_sct_list = NULL; 247. size_t tls_sct_list_len = 0; 248. CT_POLICY_EVAL_CTX *ct_policy_ctx = CT_POLICY_EVAL_CTX_new(); test/ct_test.c:247:5: 245. int sct_text_len = 0; 246. unsigned char *tls_sct_list = NULL; 247. > size_t tls_sct_list_len = 0; 248. CT_POLICY_EVAL_CTX *ct_policy_ctx = CT_POLICY_EVAL_CTX_new(); 249. test/ct_test.c:248:5: Skipping CT_POLICY_EVAL_CTX_new(): empty list of specs 246. unsigned char *tls_sct_list = NULL; 247. size_t tls_sct_list_len = 0; 248. CT_POLICY_EVAL_CTX *ct_policy_ctx = CT_POLICY_EVAL_CTX_new(); ^ 249. 250. if (fixture->sct_text_file != NULL) { test/ct_test.c:250:9: Taking false branch 248. CT_POLICY_EVAL_CTX *ct_policy_ctx = CT_POLICY_EVAL_CTX_new(); 249. 250. if (fixture->sct_text_file != NULL) { ^ 251. sct_text_len = read_text_file(fixture->sct_dir, fixture->sct_text_file, 252. expected_sct_text, test/ct_test.c:260:5: 258. } 259. 260. > CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE( 261. ct_policy_ctx, fixture->ctlog_store); 262. crypto/ct/ct_policy.c:69:1: start of procedure CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE() 67. } 68. 69. > void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, 70. CTLOG_STORE *log_store) 71. { crypto/ct/ct_policy.c:72:5: 70. CTLOG_STORE *log_store) 71. { 72. > ctx->log_store = log_store; 73. } 74. crypto/ct/ct_policy.c:73:1: return from a call to CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE 71. { 72. ctx->log_store = log_store; 73. > } 74. 75. void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms) test/ct_test.c:263:5: 261. ct_policy_ctx, fixture->ctlog_store); 262. 263. > CT_POLICY_EVAL_CTX_set_time(ct_policy_ctx, fixture->epoch_time_in_ms); 264. 265. if (fixture->certificate_file != NULL) { crypto/ct/ct_policy.c:75:1: start of procedure CT_POLICY_EVAL_CTX_set_time() 73. } 74. 75. > void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms) 76. { 77. ctx->epoch_time_in_ms = time_in_ms; crypto/ct/ct_policy.c:77:5: 75. void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms) 76. { 77. > ctx->epoch_time_in_ms = time_in_ms; 78. } 79. crypto/ct/ct_policy.c:78:1: return from a call to CT_POLICY_EVAL_CTX_set_time 76. { 77. ctx->epoch_time_in_ms = time_in_ms; 78. > } 79. 80. X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx) test/ct_test.c:265:9: Taking false branch 263. CT_POLICY_EVAL_CTX_set_time(ct_policy_ctx, fixture->epoch_time_in_ms); 264. 265. if (fixture->certificate_file != NULL) { ^ 266. int sct_extension_index; 267. int i; test/ct_test.c:314:9: Taking true branch 312. } 313. 314. if (fixture->tls_sct_list != NULL) { ^ 315. const unsigned char *p = fixture->tls_sct_list; 316. test/ct_test.c:315:9: 313. 314. if (fixture->tls_sct_list != NULL) { 315. > const unsigned char *p = fixture->tls_sct_list; 316. 317. if (!TEST_ptr(o2i_SCT_LIST(&scts, &p, fixture->tls_sct_list_len))) test/ct_test.c:317:14: 315. const unsigned char *p = fixture->tls_sct_list; 316. 317. > if (!TEST_ptr(o2i_SCT_LIST(&scts, &p, fixture->tls_sct_list_len))) 318. goto end; 319. crypto/ct/ct_oct.c:257:1: start of procedure o2i_SCT_LIST() 255. } 256. 257. > STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, 258. size_t len) 259. { crypto/ct/ct_oct.c:260:5: 258. size_t len) 259. { 260. > STACK_OF(SCT) *sk = NULL; 261. size_t list_len, sct_len; 262. crypto/ct/ct_oct.c:263:9: Taking false branch 261. size_t list_len, sct_len; 262. 263. if (len < 2 || len > MAX_SCT_LIST_SIZE) { ^ 264. CTerr(CT_F_O2I_SCT_LIST, CT_R_SCT_LIST_INVALID); 265. return NULL; crypto/ct/ct_oct.c:263:20: Taking false branch 261. size_t list_len, sct_len; 262. 263. if (len < 2 || len > MAX_SCT_LIST_SIZE) { ^ 264. CTerr(CT_F_O2I_SCT_LIST, CT_R_SCT_LIST_INVALID); 265. return NULL; crypto/ct/ct_oct.c:268:5: 266. } 267. 268. > n2s(*pp, list_len); 269. if (list_len != len - 2) { 270. CTerr(CT_F_O2I_SCT_LIST, CT_R_SCT_LIST_INVALID); crypto/ct/ct_oct.c:269:9: Taking false branch 267. 268. n2s(*pp, list_len); 269. if (list_len != len - 2) { ^ 270. CTerr(CT_F_O2I_SCT_LIST, CT_R_SCT_LIST_INVALID); 271. return NULL; crypto/ct/ct_oct.c:274:9: Taking false branch 272. } 273. 274. if (a == NULL || *a == NULL) { ^ 275. sk = sk_SCT_new_null(); 276. if (sk == NULL) crypto/ct/ct_oct.c:274:22: Taking false branch 272. } 273. 274. if (a == NULL || *a == NULL) { ^ 275. sk = sk_SCT_new_null(); 276. if (sk == NULL) crypto/ct/ct_oct.c:282:9: 280. 281. /* Use the given stack, but empty it first. */ 282. > sk = *a; 283. while ((sct = sk_SCT_pop(sk)) != NULL) 284. SCT_free(sct); crypto/ct/ct_oct.c:283:16: 281. /* Use the given stack, but empty it first. */ 282. sk = *a; 283. > while ((sct = sk_SCT_pop(sk)) != NULL) 284. SCT_free(sct); 285. } include/openssl/ct.h:58:1: start of procedure sk_SCT_pop() 56. } sct_validation_status_t; 57. 58. > DEFINE_STACK_OF(SCT) 59. DEFINE_STACK_OF(CTLOG) 60. crypto/stack/stack.c:344:1: start of procedure OPENSSL_sk_pop() 342. } 343. 344. > void *OPENSSL_sk_pop(OPENSSL_STACK *st) 345. { 346. if (st == NULL || st->num == 0) crypto/stack/stack.c:346:9: Taking false branch 344. void *OPENSSL_sk_pop(OPENSSL_STACK *st) 345. { 346. if (st == NULL || st->num == 0) ^ 347. return NULL; 348. return internal_delete(st, st->num - 1); crypto/stack/stack.c:346:23: Taking false branch 344. void *OPENSSL_sk_pop(OPENSSL_STACK *st) 345. { 346. if (st == NULL || st->num == 0) ^ 347. return NULL; 348. return internal_delete(st, st->num - 1); crypto/stack/stack.c:348:5: 346. if (st == NULL || st->num == 0) 347. return NULL; 348. > return internal_delete(st, st->num - 1); 349. } 350. crypto/stack/stack.c:256:1: start of procedure internal_delete() 254. } 255. 256. > static ossl_inline void *internal_delete(OPENSSL_STACK *st, int loc) 257. { 258. const void *ret = st->data[loc]; crypto/stack/stack.c:258:5: 256. static ossl_inline void *internal_delete(OPENSSL_STACK *st, int loc) 257. { 258. > const void *ret = st->data[loc]; 259. 260. if (loc != st->num - 1)
https://github.com/openssl/openssl/blob/c3612970465d0a13f2fc5b47bc28ca18516a699d/test/ct_test.c/#L317
d2a_code_trace_data_42308
static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret, i, type, size, pts, flags, is_audio, next, pos; AVStream *st = NULL; for(;;){ pos = url_ftell(s->pb); url_fskip(s->pb, 4); type = get_byte(s->pb); size = get_be24(s->pb); pts = get_be24(s->pb); pts |= get_byte(s->pb) << 24; if (url_feof(s->pb)) return AVERROR(EIO); url_fskip(s->pb, 3); flags = 0; if(size == 0) continue; next= size + url_ftell(s->pb); if (type == FLV_TAG_TYPE_AUDIO) { is_audio=1; flags = get_byte(s->pb); } else if (type == FLV_TAG_TYPE_VIDEO) { is_audio=0; flags = get_byte(s->pb); } else { if (type == FLV_TAG_TYPE_META && size > 13+1+4) flv_read_metabody(s, next); else av_log(s, AV_LOG_ERROR, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags); url_fseek(s->pb, next, SEEK_SET); continue; } for(i=0;i<s->nb_streams;i++) { st = s->streams[i]; if (st->id == is_audio) break; } if(i == s->nb_streams){ av_log(NULL, AV_LOG_ERROR, "invalid stream\n"); st= create_stream(s, is_audio); } if( (st->discard >= AVDISCARD_NONKEY && !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY || is_audio)) ||(st->discard >= AVDISCARD_BIDIR && ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_DISP_INTER && !is_audio)) || st->discard >= AVDISCARD_ALL ){ url_fseek(s->pb, next, SEEK_SET); continue; } if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY) av_add_index_entry(st, pos, pts, size, 0, AVINDEX_KEYFRAME); break; } if(!url_is_streamed(s->pb) && s->duration==AV_NOPTS_VALUE){ int size; const int pos= url_ftell(s->pb); const int fsize= url_fsize(s->pb); url_fseek(s->pb, fsize-4, SEEK_SET); size= get_be32(s->pb); url_fseek(s->pb, fsize-3-size, SEEK_SET); if(size == get_be24(s->pb) + 11){ s->duration= get_be24(s->pb) * (int64_t)AV_TIME_BASE / 1000; } url_fseek(s->pb, pos, SEEK_SET); } if(is_audio){ if(!st->codec->sample_rate || !st->codec->bits_per_sample || (!st->codec->codec_id && !st->codec->codec_tag)) { st->codec->channels = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1; if((flags & FLV_AUDIO_CODECID_MASK) == FLV_CODECID_NELLYMOSER_8HZ_MONO) st->codec->sample_rate= 8000; else st->codec->sample_rate = (44100 << ((flags & FLV_AUDIO_SAMPLERATE_MASK) >> FLV_AUDIO_SAMPLERATE_OFFSET) >> 3); st->codec->bits_per_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8; flv_set_audio_codec(s, st, flags & FLV_AUDIO_CODECID_MASK); } }else{ size -= flv_set_video_codec(s, st, flags & FLV_VIDEO_CODECID_MASK); } ret= av_get_packet(s->pb, pkt, size - 1); if (ret <= 0) { return AVERROR(EIO); } pkt->size = ret; pkt->pts = pts; pkt->stream_index = st->index; if (is_audio || ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)) pkt->flags |= PKT_FLAG_KEY; return ret; } libavformat/flvdec.c:355: error: Uninitialized Value The value read from flags was never initialized. libavformat/flvdec.c:355:16: 353. if(!st->codec->sample_rate || !st->codec->bits_per_sample || (!st->codec->codec_id && !st->codec->codec_tag)) { 354. st->codec->channels = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1; 355. if((flags & FLV_AUDIO_CODECID_MASK) == FLV_CODECID_NELLYMOSER_8HZ_MONO) ^ 356. st->codec->sample_rate= 8000; 357. else
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/flvdec.c/#L355
d2a_code_trace_data_42309
int ASYNC_init_thread(size_t max_size, size_t init_size) { async_pool *pool; size_t curr_size = 0; if (init_size > max_size) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_INVALID_POOL_SIZE); return 0; } if (!OPENSSL_init_crypto(OPENSSL_INIT_ASYNC, NULL)) { return 0; } if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ASYNC)) { return 0; } pool = OPENSSL_zalloc(sizeof *pool); if (pool == NULL) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); return 0; } pool->jobs = sk_ASYNC_JOB_new_null(); if (pool->jobs == NULL) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); OPENSSL_free(pool); return 0; } pool->max_size = max_size; while (init_size--) { ASYNC_JOB *job; job = async_job_new(); if (job == NULL || !async_fibre_makecontext(&job->fibrectx)) { async_job_free(job); break; } job->funcargs = NULL; sk_ASYNC_JOB_push(pool->jobs, job); curr_size++; } pool->curr_size = curr_size; if (!CRYPTO_THREAD_set_local(&poolkey, pool)) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ASYNC_R_FAILED_TO_SET_POOL); goto err; } return 1; err: async_free_pool_internal(pool); return 0; } crypto/async/async.c:158: error: INTEGER_OVERFLOW_L1 ([-oo, 0] - 1):unsigned64 by call to `ASYNC_init_thread`. Showing all 4 steps of the trace crypto/async/async.c:158:13: Call 156. * no max size and no pre-created jobs 157. */ 158. if (ASYNC_init_thread(0, 0) == 0) ^ 159. return NULL; 160. pool = (async_pool *)CRYPTO_THREAD_get_local(&poolkey); crypto/async/async.c:362:1: <LHS trace> 360. } 361. 362. > int ASYNC_init_thread(size_t max_size, size_t init_size) 363. { 364. async_pool *pool; crypto/async/async.c:362:1: Parameter `init_size` 360. } 361. 362. > int ASYNC_init_thread(size_t max_size, size_t init_size) 363. { 364. async_pool *pool; crypto/async/async.c:395:12: Binary operation: ([-oo, 0] - 1):unsigned64 by call to `ASYNC_init_thread` 393. 394. /* Pre-create jobs as required */ 395. while (init_size--) { ^ 396. ASYNC_JOB *job; 397. job = async_job_new();
https://github.com/openssl/openssl/blob/224905f8aaeac7fd81a49dc160a843c5fff60e6e/crypto/async/async.c/#L395
d2a_code_trace_data_42310
static int tree_evaluate(X509_POLICY_TREE *tree) { int ret, i; X509_POLICY_LEVEL *curr = tree->levels + 1; const X509_POLICY_CACHE *cache; for (i = 1; i < tree->nlevel; i++, curr++) { cache = policy_cache_set(curr->cert); if (!tree_link_nodes(curr, cache)) return 0; if (!(curr->flags & X509_V_FLAG_INHIBIT_ANY) && !tree_link_any(curr, cache, tree)) return 0; tree_print("before tree_prune()", tree, curr); ret = tree_prune(tree, curr); if (ret != 1) return ret; } return 1; } crypto/x509v3/pcy_tree.c:614: error: NULL_DEREFERENCE pointer `cache` last assigned on line 613 could be null and is dereferenced by call to `tree_link_nodes()` at line 614, column 14. Showing all 46 steps of the trace crypto/x509v3/pcy_tree.c:606:1: start of procedure tree_evaluate() 604. } 605. 606. > static int tree_evaluate(X509_POLICY_TREE *tree) 607. { 608. int ret, i; crypto/x509v3/pcy_tree.c:609:5: 607. { 608. int ret, i; 609. > X509_POLICY_LEVEL *curr = tree->levels + 1; 610. const X509_POLICY_CACHE *cache; 611. crypto/x509v3/pcy_tree.c:612:10: 610. const X509_POLICY_CACHE *cache; 611. 612. > for (i = 1; i < tree->nlevel; i++, curr++) { 613. cache = policy_cache_set(curr->cert); 614. if (!tree_link_nodes(curr, cache)) crypto/x509v3/pcy_tree.c:612:17: Loop condition is true. Entering loop body 610. const X509_POLICY_CACHE *cache; 611. 612. for (i = 1; i < tree->nlevel; i++, curr++) { ^ 613. cache = policy_cache_set(curr->cert); 614. if (!tree_link_nodes(curr, cache)) crypto/x509v3/pcy_tree.c:613:9: 611. 612. for (i = 1; i < tree->nlevel; i++, curr++) { 613. > cache = policy_cache_set(curr->cert); 614. if (!tree_link_nodes(curr, cache)) 615. return 0; crypto/x509v3/pcy_cache.c:224:1: start of procedure policy_cache_set() 222. } 223. 224. > const X509_POLICY_CACHE *policy_cache_set(X509 *x) 225. { 226. crypto/x509v3/pcy_cache.c:227:9: Taking true branch 225. { 226. 227. if (x->policy_cache == NULL) { ^ 228. CRYPTO_w_lock(CRYPTO_LOCK_X509); 229. policy_cache_new(x); crypto/x509v3/pcy_cache.c:228:9: 226. 227. if (x->policy_cache == NULL) { 228. > CRYPTO_w_lock(CRYPTO_LOCK_X509); 229. policy_cache_new(x); 230. CRYPTO_w_unlock(CRYPTO_LOCK_X509); crypto/lock.c:414:1: start of procedure CRYPTO_lock() 412. } 413. 414. > void CRYPTO_lock(int mode, int type, const char *file, int line) 415. { 416. #ifdef LOCK_DEBUG crypto/lock.c:441:9: Taking false branch 439. } 440. #endif 441. if (type < 0) { ^ 442. if (dynlock_lock_callback != NULL) { 443. struct CRYPTO_dynlock_value *pointer crypto/lock.c:452:16: Taking true branch 450. CRYPTO_destroy_dynlockid(type); 451. } 452. } else if (locking_callback != NULL) ^ 453. locking_callback(mode, type, file, line); 454. } crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer 451. } 452. } else if (locking_callback != NULL) 453. locking_callback(mode, type, file, line); ^ 454. } 455. crypto/lock.c:441:5: 439. } 440. #endif 441. > if (type < 0) { 442. if (dynlock_lock_callback != NULL) { 443. struct CRYPTO_dynlock_value *pointer crypto/lock.c:454:1: return from a call to CRYPTO_lock 452. } else if (locking_callback != NULL) 453. locking_callback(mode, type, file, line); 454. > } 455. 456. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, crypto/x509v3/pcy_cache.c:229:9: 227. if (x->policy_cache == NULL) { 228. CRYPTO_w_lock(CRYPTO_LOCK_X509); 229. > policy_cache_new(x); 230. CRYPTO_w_unlock(CRYPTO_LOCK_X509); 231. } crypto/x509v3/pcy_cache.c:123:1: start of procedure policy_cache_new() 121. } 122. 123. > static int policy_cache_new(X509 *x) 124. { 125. X509_POLICY_CACHE *cache; crypto/x509v3/pcy_cache.c:126:5: 124. { 125. X509_POLICY_CACHE *cache; 126. > ASN1_INTEGER *ext_any = NULL; 127. POLICY_CONSTRAINTS *ext_pcons = NULL; 128. CERTIFICATEPOLICIES *ext_cpols = NULL; crypto/x509v3/pcy_cache.c:127:5: 125. X509_POLICY_CACHE *cache; 126. ASN1_INTEGER *ext_any = NULL; 127. > POLICY_CONSTRAINTS *ext_pcons = NULL; 128. CERTIFICATEPOLICIES *ext_cpols = NULL; 129. POLICY_MAPPINGS *ext_pmaps = NULL; crypto/x509v3/pcy_cache.c:128:5: 126. ASN1_INTEGER *ext_any = NULL; 127. POLICY_CONSTRAINTS *ext_pcons = NULL; 128. > CERTIFICATEPOLICIES *ext_cpols = NULL; 129. POLICY_MAPPINGS *ext_pmaps = NULL; 130. int i; crypto/x509v3/pcy_cache.c:129:5: 127. POLICY_CONSTRAINTS *ext_pcons = NULL; 128. CERTIFICATEPOLICIES *ext_cpols = NULL; 129. > POLICY_MAPPINGS *ext_pmaps = NULL; 130. int i; 131. cache = OPENSSL_malloc(sizeof(*cache)); crypto/x509v3/pcy_cache.c:131:5: 129. POLICY_MAPPINGS *ext_pmaps = NULL; 130. int i; 131. > cache = OPENSSL_malloc(sizeof(*cache)); 132. if (cache == NULL) 133. return 0; crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/x509v3/pcy_cache.c:132:9: Taking true branch 130. int i; 131. cache = OPENSSL_malloc(sizeof(*cache)); 132. if (cache == NULL) ^ 133. return 0; 134. cache->anyPolicy = NULL; crypto/x509v3/pcy_cache.c:133:9: 131. cache = OPENSSL_malloc(sizeof(*cache)); 132. if (cache == NULL) 133. > return 0; 134. cache->anyPolicy = NULL; 135. cache->data = NULL; crypto/x509v3/pcy_cache.c:213:1: return from a call to policy_cache_new 211. return 1; 212. 213. > } 214. 215. void policy_cache_free(X509_POLICY_CACHE *cache) crypto/x509v3/pcy_cache.c:230:9: 228. CRYPTO_w_lock(CRYPTO_LOCK_X509); 229. policy_cache_new(x); 230. > CRYPTO_w_unlock(CRYPTO_LOCK_X509); 231. } 232. crypto/lock.c:414:1: start of procedure CRYPTO_lock() 412. } 413. 414. > void CRYPTO_lock(int mode, int type, const char *file, int line) 415. { 416. #ifdef LOCK_DEBUG crypto/lock.c:441:9: Taking false branch 439. } 440. #endif 441. if (type < 0) { ^ 442. if (dynlock_lock_callback != NULL) { 443. struct CRYPTO_dynlock_value *pointer crypto/lock.c:452:16: Taking true branch 450. CRYPTO_destroy_dynlockid(type); 451. } 452. } else if (locking_callback != NULL) ^ 453. locking_callback(mode, type, file, line); 454. } crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer 451. } 452. } else if (locking_callback != NULL) 453. locking_callback(mode, type, file, line); ^ 454. } 455. crypto/lock.c:441:5: 439. } 440. #endif 441. > if (type < 0) { 442. if (dynlock_lock_callback != NULL) { 443. struct CRYPTO_dynlock_value *pointer crypto/lock.c:454:1: return from a call to CRYPTO_lock 452. } else if (locking_callback != NULL) 453. locking_callback(mode, type, file, line); 454. > } 455. 456. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, crypto/x509v3/pcy_cache.c:233:5: 231. } 232. 233. > return x->policy_cache; 234. 235. } crypto/x509v3/pcy_cache.c:235:1: return from a call to policy_cache_set 233. return x->policy_cache; 234. 235. > } 236. 237. X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, crypto/x509v3/pcy_tree.c:614:14: 612. for (i = 1; i < tree->nlevel; i++, curr++) { 613. cache = policy_cache_set(curr->cert); 614. > if (!tree_link_nodes(curr, cache)) 615. return 0; 616. crypto/x509v3/pcy_tree.c:321:1: start of procedure tree_link_nodes() 319. */ 320. 321. > static int tree_link_nodes(X509_POLICY_LEVEL *curr, 322. const X509_POLICY_CACHE *cache) 323. { crypto/x509v3/pcy_tree.c:327:10: 325. X509_POLICY_DATA *data; 326. 327. > for (i = 0; i < sk_X509_POLICY_DATA_num(cache->data); i++) { 328. data = sk_X509_POLICY_DATA_value(cache->data, i); 329. /* Look for matching nodes in previous level */ crypto/x509v3/pcy_tree.c:327:17: 325. X509_POLICY_DATA *data; 326. 327. > for (i = 0; i < sk_X509_POLICY_DATA_num(cache->data); i++) { 328. data = sk_X509_POLICY_DATA_value(cache->data, i); 329. /* Look for matching nodes in previous level */
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/x509v3/pcy_tree.c/#L614
d2a_code_trace_data_42311
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/ec/ecp_smpl.c:1033: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_add_quick`. Showing all 18 steps of the trace crypto/ec/ecp_smpl.c:976:10: Call 974. 975. BN_CTX_start(ctx); 976. rh = BN_CTX_get(ctx); ^ 977. tmp = BN_CTX_get(ctx); 978. Z4 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:366:15: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/bn/bn_lib.c:366:5: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/ec/ecp_smpl.c:1033:14: Call 1031. 1032. /* rh := (rh + a)*X */ 1033. if (!BN_mod_add_quick(rh, rh, group->a, p)) ^ 1034. goto err; 1035. if (!field_mul(group, rh, rh, point->X, ctx)) crypto/bn/bn_mod.c:93:1: Parameter `*r->d` 91. } 92. 93. > int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 94. const BIGNUM *m) 95. { crypto/bn/bn_mod.c:96:15: Call 94. const BIGNUM *m) 95. { 96. int ret = bn_mod_add_fixed_top(r, a, b, m); ^ 97. 98. if (ret) crypto/bn/bn_mod.c:48:1: Parameter `*r->d` 46. * move depending on whether or not subtraction borrowed. 47. */ 48. > int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 49. const BIGNUM *m) 50. { crypto/bn/bn_mod.c:56:9: Call 54. const BN_ULONG *ap, *bp; 55. 56. if (bn_wexpand(r, mtop) == NULL) ^ 57. return 0; 58. crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:245:1: Parameter `*b->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_mod_add_quick` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_42312
static void dct32(INTFLOAT *out, const INTFLOAT *tab) { INTFLOAT tmp0, tmp1; INTFLOAT val0 , val1 , val2 , val3 , val4 , val5 , val6 , val7 , val8 , val9 , val10, val11, val12, val13, val14, val15, val16, val17, val18, val19, val20, val21, val22, val23, val24, val25, val26, val27, val28, val29, val30, val31; BF0( 0, 31, COS0_0 , 1); BF0(15, 16, COS0_15, 5); BF( 0, 15, COS1_0 , 1); BF(16, 31,-COS1_0 , 1); BF0( 7, 24, COS0_7 , 1); BF0( 8, 23, COS0_8 , 1); BF( 7, 8, COS1_7 , 4); BF(23, 24,-COS1_7 , 4); BF( 0, 7, COS2_0 , 1); BF( 8, 15,-COS2_0 , 1); BF(16, 23, COS2_0 , 1); BF(24, 31,-COS2_0 , 1); BF0( 3, 28, COS0_3 , 1); BF0(12, 19, COS0_12, 2); BF( 3, 12, COS1_3 , 1); BF(19, 28,-COS1_3 , 1); BF0( 4, 27, COS0_4 , 1); BF0(11, 20, COS0_11, 2); BF( 4, 11, COS1_4 , 1); BF(20, 27,-COS1_4 , 1); BF( 3, 4, COS2_3 , 3); BF(11, 12,-COS2_3 , 3); BF(19, 20, COS2_3 , 3); BF(27, 28,-COS2_3 , 3); BF( 0, 3, COS3_0 , 1); BF( 4, 7,-COS3_0 , 1); BF( 8, 11, COS3_0 , 1); BF(12, 15,-COS3_0 , 1); BF(16, 19, COS3_0 , 1); BF(20, 23,-COS3_0 , 1); BF(24, 27, COS3_0 , 1); BF(28, 31,-COS3_0 , 1); BF0( 1, 30, COS0_1 , 1); BF0(14, 17, COS0_14, 3); BF( 1, 14, COS1_1 , 1); BF(17, 30,-COS1_1 , 1); BF0( 6, 25, COS0_6 , 1); BF0( 9, 22, COS0_9 , 1); BF( 6, 9, COS1_6 , 2); BF(22, 25,-COS1_6 , 2); BF( 1, 6, COS2_1 , 1); BF( 9, 14,-COS2_1 , 1); BF(17, 22, COS2_1 , 1); BF(25, 30,-COS2_1 , 1); BF0( 2, 29, COS0_2 , 1); BF0(13, 18, COS0_13, 3); BF( 2, 13, COS1_2 , 1); BF(18, 29,-COS1_2 , 1); BF0( 5, 26, COS0_5 , 1); BF0(10, 21, COS0_10, 1); BF( 5, 10, COS1_5 , 2); BF(21, 26,-COS1_5 , 2); BF( 2, 5, COS2_2 , 1); BF(10, 13,-COS2_2 , 1); BF(18, 21, COS2_2 , 1); BF(26, 29,-COS2_2 , 1); BF( 1, 2, COS3_1 , 2); BF( 5, 6,-COS3_1 , 2); BF( 9, 10, COS3_1 , 2); BF(13, 14,-COS3_1 , 2); BF(17, 18, COS3_1 , 2); BF(21, 22,-COS3_1 , 2); BF(25, 26, COS3_1 , 2); BF(29, 30,-COS3_1 , 2); BF1( 0, 1, 2, 3); BF2( 4, 5, 6, 7); BF1( 8, 9, 10, 11); BF2(12, 13, 14, 15); BF1(16, 17, 18, 19); BF2(20, 21, 22, 23); BF1(24, 25, 26, 27); BF2(28, 29, 30, 31); ADD( 8, 12); ADD(12, 10); ADD(10, 14); ADD(14, 9); ADD( 9, 13); ADD(13, 11); ADD(11, 15); out[ 0] = val0; out[16] = val1; out[ 8] = val2; out[24] = val3; out[ 4] = val4; out[20] = val5; out[12] = val6; out[28] = val7; out[ 2] = val8; out[18] = val9; out[10] = val10; out[26] = val11; out[ 6] = val12; out[22] = val13; out[14] = val14; out[30] = val15; ADD(24, 28); ADD(28, 26); ADD(26, 30); ADD(30, 25); ADD(25, 29); ADD(29, 27); ADD(27, 31); out[ 1] = val16 + val24; out[17] = val17 + val25; out[ 9] = val18 + val26; out[25] = val19 + val27; out[ 5] = val20 + val28; out[21] = val21 + val29; out[13] = val22 + val30; out[29] = val23 + val31; out[ 3] = val24 + val20; out[19] = val25 + val21; out[11] = val26 + val22; out[27] = val27 + val23; out[ 7] = val28 + val18; out[23] = val29 + val19; out[15] = val30 + val17; out[31] = val31; } libavcodec/mpc.c:54: error: Buffer Overrun L2 Offset: [6+min(0, `c->synth_buf_offset[*]`), 7+max(511, `c->synth_buf_offset[*]`)] (⇐ [min(0, `c->synth_buf_offset[*]`), 1+max(511, `c->synth_buf_offset[*]`)] + 6) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:45:1: Parameter `c->synth_buf[*]` 43. * Process decoded Musepack data and produce PCM 44. */ 45. static void mpc_synth(MPCContext *c, int16_t *out) ^ 46. { 47. int dither_state = 0; libavcodec/mpc.c:54:13: Call 52. samples_ptr = samples + ch; 53. for(i = 0; i < SAMPLES_PER_BAND; i++) { 54. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 55. ff_mpa_synth_window, &dither_state, 56. samples_ptr, 2, libavcodec/mpegaudiodec.c:705:1: Parameter `*synth_buf_ptr` 703. /* XXX: optimize by avoiding ring buffer usage */ 704. #if !CONFIG_FLOAT 705. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 706. MPA_INT *window, int *dither_state, 707. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:718:5: Assignment 716. 717. offset = *synth_buf_offset; 718. synth_buf = synth_buf_ptr + offset; ^ 719. 720. #if FRAC_BITS <= 15 libavcodec/mpegaudiodec.c:728:5: Call 726. } 727. #else 728. dct32(synth_buf, sb_samples); ^ 729. #endif 730. libavcodec/dct32.c:106:1: <Length trace> 104. 105. /* DCT32 without 1/sqrt(2) coef zero scaling. */ 106. static void dct32(INTFLOAT *out, const INTFLOAT *tab) ^ 107. { 108. INTFLOAT tmp0, tmp1; libavcodec/dct32.c:106:1: Parameter `*out` 104. 105. /* DCT32 without 1/sqrt(2) coef zero scaling. */ 106. static void dct32(INTFLOAT *out, const INTFLOAT *tab) ^ 107. { 108. INTFLOAT tmp0, tmp1; libavcodec/dct32.c:238:5: Array access: Offset: [6+min(0, c->synth_buf_offset[*]), 7+max(511, c->synth_buf_offset[*])] (⇐ [min(0, c->synth_buf_offset[*]), 1+max(511, c->synth_buf_offset[*])] + 6) Size: 2 by call to `ff_mpa_synth_filter` 236. out[10] = val10; 237. out[26] = val11; 238. out[ 6] = val12; ^ 239. out[22] = val13; 240. out[14] = val14;
https://github.com/libav/libav/blob/63e8d9760f23a4edf81e9ae58c4f6d3baa6ff4dd/libavcodec/dct32.c/#L238
d2a_code_trace_data_42313
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_crpt.c:132: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `rsa_get_public_exp`. Showing all 18 steps of the trace crypto/rsa/rsa_crpt.c:111:1: Parameter `in_ctx->stack.depth` 109. } 110. 111. > BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx) 112. { 113. BIGNUM *e; crypto/rsa/rsa_crpt.c:124:5: Call 122. } 123. 124. BN_CTX_start(ctx); ^ 125. e = BN_CTX_get(ctx); 126. if (e == 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/rsa/rsa_crpt.c:132:13: Call 130. 131. if (rsa->e == NULL) { 132. e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx); ^ 133. if (e == NULL) { 134. RSAerr(RSA_F_RSA_SETUP_BLINDING, RSA_R_NO_PUBLIC_EXPONENT); crypto/rsa/rsa_crpt.c:83:1: Parameter `ctx->stack.depth` 81. } 82. 83. > static BIGNUM *rsa_get_public_exp(const BIGNUM *d, const BIGNUM *p, 84. const BIGNUM *q, BN_CTX *ctx) 85. { crypto/rsa/rsa_crpt.c:91:5: Call 89. return NULL; 90. 91. BN_CTX_start(ctx); ^ 92. r0 = BN_CTX_get(ctx); 93. r1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/rsa/rsa_crpt.c:102:10: Call 100. if (!BN_sub(r2, q, BN_value_one())) 101. goto err; 102. if (!BN_mul(r0, r1, r2, ctx)) ^ 103. goto err; 104. crypto/bn/bn_mul.c:523:5: Call 521. top = al + bl; 522. 523. BN_CTX_start(ctx); ^ 524. if ((r == a) || (r == b)) { 525. 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:608:5: Call 606. err: 607. bn_check_top(r); 608. BN_CTX_end(ctx); ^ 609. return (ret); 610. } 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 `rsa_get_public_exp` 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/aa048aef0b9146f90c06333dedfc105d1f9e2c22/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_42314
static int internal_verify(X509_STORE_CTX *ctx) { int ok=0,n; X509 *xs,*xi; EVP_PKEY *pkey=NULL; int (*cb)(int xok,X509_STORE_CTX *xctx); cb=ctx->verify_cb; n=sk_X509_num(ctx->chain); ctx->error_depth=n-1; n--; xi=sk_X509_value(ctx->chain,n); if (ctx->check_issued(ctx, xi, xi)) xs=xi; else { if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN && n == 0) { xs = xi; goto check_cert; } if (n <= 0) { ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE; ctx->current_cert=xi; ok=cb(0,ctx); goto end; } else { n--; ctx->error_depth=n; xs=sk_X509_value(ctx->chain,n); } } while (n >= 0) { ctx->error_depth=n; if (!xs->valid && (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE))) { if ((pkey=X509_get_pubkey(xi)) == NULL) { ctx->error=X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY; ctx->current_cert=xi; ok=(*cb)(0,ctx); if (!ok) goto end; } else if (X509_verify(xs,pkey) <= 0) { ctx->error=X509_V_ERR_CERT_SIGNATURE_FAILURE; ctx->current_cert=xs; ok=(*cb)(0,ctx); if (!ok) { EVP_PKEY_free(pkey); goto end; } } EVP_PKEY_free(pkey); pkey=NULL; } xs->valid = 1; check_cert: ok = check_cert_time(ctx, xs); if (!ok) goto end; ctx->current_issuer=xi; ctx->current_cert=xs; ok=(*cb)(1,ctx); if (!ok) goto end; n--; if (n >= 0) { xi=xs; xs=sk_X509_value(ctx->chain,n); } } ok=1; end: return ok; } crypto/x509/x509_vfy.c:1785: error: NULL_DEREFERENCE pointer `xs` last assigned on line 1772 could be null and is dereferenced at line 1785, column 8. Showing all 36 steps of the trace crypto/x509/x509_vfy.c:1738:1: start of procedure internal_verify() 1736. } 1737. 1738. > static int internal_verify(X509_STORE_CTX *ctx) 1739. { 1740. int ok=0,n; crypto/x509/x509_vfy.c:1740:2: 1738. static int internal_verify(X509_STORE_CTX *ctx) 1739. { 1740. > int ok=0,n; 1741. X509 *xs,*xi; 1742. EVP_PKEY *pkey=NULL; crypto/x509/x509_vfy.c:1742:2: 1740. int ok=0,n; 1741. X509 *xs,*xi; 1742. > EVP_PKEY *pkey=NULL; 1743. int (*cb)(int xok,X509_STORE_CTX *xctx); 1744. crypto/x509/x509_vfy.c:1745:2: 1743. int (*cb)(int xok,X509_STORE_CTX *xctx); 1744. 1745. > cb=ctx->verify_cb; 1746. 1747. n=sk_X509_num(ctx->chain); crypto/x509/x509_vfy.c:1747:4: Condition is true 1745. cb=ctx->verify_cb; 1746. 1747. n=sk_X509_num(ctx->chain); ^ 1748. ctx->error_depth=n-1; 1749. n--; crypto/x509/x509_vfy.c:1747:2: 1745. cb=ctx->verify_cb; 1746. 1747. > n=sk_X509_num(ctx->chain); 1748. ctx->error_depth=n-1; 1749. n--; crypto/stack/stack.c:294:1: start of procedure sk_num() 292. } 293. 294. > int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; crypto/stack/stack.c:296:5: Taking false branch 294. int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; ^ 297. return st->num; 298. } crypto/stack/stack.c:297:2: 295. { 296. if(st == NULL) return -1; 297. > return st->num; 298. } 299. crypto/stack/stack.c:298:1: return from a call to sk_num 296. if(st == NULL) return -1; 297. return st->num; 298. > } 299. 300. void *sk_value(const _STACK *st, int i) crypto/x509/x509_vfy.c:1748:2: 1746. 1747. n=sk_X509_num(ctx->chain); 1748. > ctx->error_depth=n-1; 1749. n--; 1750. xi=sk_X509_value(ctx->chain,n); crypto/x509/x509_vfy.c:1749:2: 1747. n=sk_X509_num(ctx->chain); 1748. ctx->error_depth=n-1; 1749. > n--; 1750. xi=sk_X509_value(ctx->chain,n); 1751. crypto/x509/x509_vfy.c:1750:5: Condition is true 1748. ctx->error_depth=n-1; 1749. n--; 1750. xi=sk_X509_value(ctx->chain,n); ^ 1751. 1752. if (ctx->check_issued(ctx, xi, xi)) crypto/x509/x509_vfy.c:1750:2: 1748. ctx->error_depth=n-1; 1749. n--; 1750. > xi=sk_X509_value(ctx->chain,n); 1751. 1752. if (ctx->check_issued(ctx, xi, xi)) crypto/stack/stack.c:300:1: start of procedure sk_value() 298. } 299. 300. > void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:302:6: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:13: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:24: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:303:2: 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. > return st->data[i]; 304. } 305. crypto/stack/stack.c:304:1: return from a call to sk_value 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. > } 305. 306. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:1752:6: Taking false branch 1750. xi=sk_X509_value(ctx->chain,n); 1751. 1752. if (ctx->check_issued(ctx, xi, xi)) ^ 1753. xs=xi; 1754. else crypto/x509/x509_vfy.c:1756:7: Taking false branch 1754. else 1755. { 1756. if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN && n == 0) ^ 1757. { 1758. xs = xi; crypto/x509/x509_vfy.c:1761:7: Taking false branch 1759. goto check_cert; 1760. } 1761. if (n <= 0) ^ 1762. { 1763. ctx->error=X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE; crypto/x509/x509_vfy.c:1770:4: 1768. else 1769. { 1770. > n--; 1771. ctx->error_depth=n; 1772. xs=sk_X509_value(ctx->chain,n); crypto/x509/x509_vfy.c:1771:4: 1769. { 1770. n--; 1771. > ctx->error_depth=n; 1772. xs=sk_X509_value(ctx->chain,n); 1773. } crypto/x509/x509_vfy.c:1772:7: Condition is true 1770. n--; 1771. ctx->error_depth=n; 1772. xs=sk_X509_value(ctx->chain,n); ^ 1773. } 1774. } crypto/x509/x509_vfy.c:1772:4: 1770. n--; 1771. ctx->error_depth=n; 1772. > xs=sk_X509_value(ctx->chain,n); 1773. } 1774. } crypto/stack/stack.c:300:1: start of procedure sk_value() 298. } 299. 300. > void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:302:6: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:13: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:24: Taking true branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:39: 300. void *sk_value(const _STACK *st, int i) 301. { 302. > if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. } crypto/stack/stack.c:304:1: return from a call to sk_value 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. > } 305. 306. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:1777:9: Loop condition is true. Entering loop body 1775. 1776. /* ctx->error=0; not needed */ 1777. while (n >= 0) ^ 1778. { 1779. ctx->error_depth=n; crypto/x509/x509_vfy.c:1779:3: 1777. while (n >= 0) 1778. { 1779. > ctx->error_depth=n; 1780. 1781. /* Skip signature check for self signed certificates unless crypto/x509/x509_vfy.c:1785:8: Taking false branch 1783. * just wastes time. 1784. */ 1785. if (!xs->valid && (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE))) ^ 1786. { 1787. if ((pkey=X509_get_pubkey(xi)) == NULL)
https://github.com/openssl/openssl/blob/cbb67448277232c8403f96edad4931c4203e7746/crypto/x509/x509_vfy.c/#L1785
d2a_code_trace_data_42315
void BF_set_key(BF_KEY *key, int len, const unsigned char *data) #ifdef OPENSSL_FIPS { fips_cipher_abort(BLOWFISH); private_BF_set_key(key, len, data); } void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data) #endif { int i; BF_LONG *p,ri,in[2]; const unsigned char *d,*end; memcpy(key,&bf_init,sizeof(BF_KEY)); p=key->P; if (len > ((BF_ROUNDS+2)*4)) len=(BF_ROUNDS+2)*4; d=data; end= &(data[len]); for (i=0; i<(BF_ROUNDS+2); i++) { ri= *(d++); if (d >= end) d=data; ri<<=8; ri|= *(d++); if (d >= end) d=data; ri<<=8; ri|= *(d++); if (d >= end) d=data; ri<<=8; ri|= *(d++); if (d >= end) d=data; p[i]^=ri; } in[0]=0L; in[1]=0L; for (i=0; i<(BF_ROUNDS+2); i+=2) { BF_encrypt(in,key); p[i ]=in[0]; p[i+1]=in[1]; } p=key->S; for (i=0; i<4*256; i+=2) { BF_encrypt(in,key); p[i ]=in[0]; p[i+1]=in[1]; } } crypto/bf/bftest.c:374: error: BUFFER_OVERRUN_L2 Offset: [min(72, `bf_key.strlen`), 72] Size: 16 by call to `BF_set_key`. Showing all 7 steps of the trace crypto/bf/bftest.c:82:1: Array declaration 80. #endif 81. 82. > static char *bf_key[2]={ 83. "abcdefghijklmnopqrstuvwxyz", 84. "Who is John Galt?" crypto/bf/bftest.c:374:3: Call 372. ebcdic2ascii(bf_key[n], bf_key[n], strlen(bf_key[n])); 373. #endif 374. BF_set_key(&key,strlen(bf_key[n]),(unsigned char *)bf_key[n]); ^ 375. 376. data[0]=bf_plain[n][0]; crypto/bf/bf_skey.c:66:1: <Offset trace> 64. #include "bf_pi.h" 65. 66. > void BF_set_key(BF_KEY *key, int len, const unsigned char *data) 67. #ifdef OPENSSL_FIPS 68. { crypto/bf/bf_skey.c:66:1: Parameter `len` 64. #include "bf_pi.h" 65. 66. > void BF_set_key(BF_KEY *key, int len, const unsigned char *data) 67. #ifdef OPENSSL_FIPS 68. { crypto/bf/bf_skey.c:66:1: <Length trace> 64. #include "bf_pi.h" 65. 66. > void BF_set_key(BF_KEY *key, int len, const unsigned char *data) 67. #ifdef OPENSSL_FIPS 68. { crypto/bf/bf_skey.c:66:1: Parameter `*data` 64. #include "bf_pi.h" 65. 66. > void BF_set_key(BF_KEY *key, int len, const unsigned char *data) 67. #ifdef OPENSSL_FIPS 68. { crypto/bf/bf_skey.c:86:2: Array access: Offset: [min(72, bf_key.strlen), 72] Size: 16 by call to `BF_set_key` 84. 85. d=data; 86. end= &(data[len]); ^ 87. for (i=0; i<(BF_ROUNDS+2); i++) 88. {
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/bf/bf_skey.c/#L86
d2a_code_trace_data_42316
static int opt_streamid(const char *opt, const char *arg) { int idx; char *p; char idx_str[16]; strncpy(idx_str, arg, sizeof(idx_str)); idx_str[sizeof(idx_str)-1] = '\0'; p = strchr(idx_str, ':'); if (!p) { fprintf(stderr, "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", arg, opt); ffmpeg_exit(1); } *p++ = '\0'; idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); return 0; } ffmpeg.c:3682: error: Null Dereference pointer `streamid_map` last assigned on line 3681 could be null and is dereferenced at line 3682, column 5. ffmpeg.c:3664:1: start of procedure opt_streamid() 3662. 3663. /* arg format is "output-stream-index:streamid-value". */ 3664. static int opt_streamid(const char *opt, const char *arg) ^ 3665. { 3666. int idx; ffmpeg.c:3670:5: 3668. char idx_str[16]; 3669. 3670. strncpy(idx_str, arg, sizeof(idx_str)); ^ 3671. idx_str[sizeof(idx_str)-1] = '\0'; 3672. p = strchr(idx_str, ':'); ffmpeg.c:3671:5: 3669. 3670. strncpy(idx_str, arg, sizeof(idx_str)); 3671. idx_str[sizeof(idx_str)-1] = '\0'; ^ 3672. p = strchr(idx_str, ':'); 3673. if (!p) { ffmpeg.c:3672:5: 3670. strncpy(idx_str, arg, sizeof(idx_str)); 3671. idx_str[sizeof(idx_str)-1] = '\0'; 3672. p = strchr(idx_str, ':'); ^ 3673. if (!p) { 3674. fprintf(stderr, ffmpeg.c:3673:10: Taking false branch 3671. idx_str[sizeof(idx_str)-1] = '\0'; 3672. p = strchr(idx_str, ':'); 3673. if (!p) { ^ 3674. fprintf(stderr, 3675. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n", ffmpeg.c:3679:5: 3677. ffmpeg_exit(1); 3678. } 3679. *p++ = '\0'; ^ 3680. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); 3681. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); ffmpeg.c:3680:5: Skipping parse_number_or_die(): empty list of specs 3678. } 3679. *p++ = '\0'; 3680. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); ^ 3681. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); 3682. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); ffmpeg.c:3681:5: 3679. *p++ = '\0'; 3680. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); 3681. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); ^ 3682. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); 3683. return 0; ffmpeg.c:575:1: start of procedure grow_array() 573. 574. /* similar to ff_dynarray_add() and av_fast_realloc() */ 575. static void *grow_array(void *array, int elem_size, int *size, int new_size) ^ 576. { 577. if (new_size >= INT_MAX / elem_size) { ffmpeg.c:577:9: Taking false branch 575. static void *grow_array(void *array, int elem_size, int *size, int new_size) 576. { 577. if (new_size >= INT_MAX / elem_size) { ^ 578. fprintf(stderr, "Array too big.\n"); 579. ffmpeg_exit(1); ffmpeg.c:581:9: Taking true branch 579. ffmpeg_exit(1); 580. } 581. if (*size < new_size) { ^ 582. uint8_t *tmp = av_realloc(array, new_size*elem_size); 583. if (!tmp) { ffmpeg.c:582:9: 580. } 581. if (*size < new_size) { 582. uint8_t *tmp = av_realloc(array, new_size*elem_size); ^ 583. if (!tmp) { 584. fprintf(stderr, "Could not alloc buffer.\n"); libavutil/mem.c:119:1: start of procedure av_realloc() 117. } 118. 119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) ^ 120. { 121. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:126:8: Taking true branch 124. 125. /* let's disallow possible ambiguous cases */ 126. if(size > (INT_MAX-16) ) ^ 127. return NULL; 128. libavutil/mem.c:127:9: 125. /* let's disallow possible ambiguous cases */ 126. if(size > (INT_MAX-16) ) 127. return NULL; ^ 128. 129. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:137:1: return from a call to av_realloc 135. return realloc(ptr, size); 136. #endif 137. } ^ 138. 139. void av_free(void *ptr) ffmpeg.c:583:14: Taking true branch 581. if (*size < new_size) { 582. uint8_t *tmp = av_realloc(array, new_size*elem_size); 583. if (!tmp) { ^ 584. fprintf(stderr, "Could not alloc buffer.\n"); 585. ffmpeg_exit(1); ffmpeg.c:584:13: 582. uint8_t *tmp = av_realloc(array, new_size*elem_size); 583. if (!tmp) { 584. fprintf(stderr, "Could not alloc buffer.\n"); ^ 585. ffmpeg_exit(1); 586. } ffmpeg.c:585:13: Skipping ffmpeg_exit(): empty list of specs 583. if (!tmp) { 584. fprintf(stderr, "Could not alloc buffer.\n"); 585. ffmpeg_exit(1); ^ 586. } 587. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); ffmpeg.c:587:9: 585. ffmpeg_exit(1); 586. } 587. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); ^ 588. *size = new_size; 589. return tmp; ffmpeg.c:588:9: 586. } 587. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); 588. *size = new_size; ^ 589. return tmp; 590. } ffmpeg.c:589:9: 587. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); 588. *size = new_size; 589. return tmp; ^ 590. } 591. return array; ffmpeg.c:592:1: return from a call to grow_array 590. } 591. return array; 592. } ^ 593. 594. static void choose_sample_fmt(AVStream *st, AVCodec *codec) ffmpeg.c:3682:5: Skipping parse_number_or_die(): empty list of specs 3680. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1); 3681. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1); 3682. streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX); ^ 3683. return 0; 3684. }
https://github.com/libav/libav/blob/2d777bb7a20041ac0564ffef85bf40619af8ccd1/ffmpeg.c/#L3682
d2a_code_trace_data_42317
static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { DH *dh = NULL; DH_PKEY_CTX *dctx = ctx->data; BN_GENCB *pcb; int ret; if (dctx->rfc5114_param) { switch (dctx->rfc5114_param) { case 1: dh = DH_get_1024_160(); break; case 2: dh = DH_get_2048_224(); break; case 3: dh = DH_get_2048_256(); break; default: return -2; } EVP_PKEY_assign(pkey, EVP_PKEY_DHX, dh); return 1; } if (ctx->pkey_gencb) { pcb = BN_GENCB_new(); if (pcb == NULL) return 0; evp_pkey_set_cb_translate(pcb, ctx); } else pcb = NULL; #ifndef OPENSSL_NO_DSA if (dctx->use_dsa) { DSA *dsa_dh; dsa_dh = dsa_dh_generate(dctx, pcb); BN_GENCB_free(pcb); if (dsa_dh == NULL) return 0; dh = DSA_dup_DH(dsa_dh); DSA_free(dsa_dh); if (!dh) return 0; EVP_PKEY_assign(pkey, EVP_PKEY_DHX, dh); return 1; } #endif dh = DH_new(); if (dh == NULL) { BN_GENCB_free(pcb); return 0; } ret = DH_generate_parameters_ex(dh, dctx->prime_len, dctx->generator, pcb); BN_GENCB_free(pcb); if (ret) EVP_PKEY_assign_DH(pkey, dh); else DH_free(dh); return ret; } crypto/dh/dh_pmeth.c:367: error: MEMORY_LEAK memory dynamically allocated by call to `DH_get_2048_256()` at line 361, column 18 is not reachable after line 367, column 9. Showing all 126 steps of the trace crypto/dh/dh_pmeth.c:344:1: start of procedure pkey_dh_paramgen() 342. #endif 343. 344. > static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) 345. { 346. DH *dh = NULL; crypto/dh/dh_pmeth.c:346:5: 344. static int pkey_dh_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) 345. { 346. > DH *dh = NULL; 347. DH_PKEY_CTX *dctx = ctx->data; 348. BN_GENCB *pcb; crypto/dh/dh_pmeth.c:347:5: 345. { 346. DH *dh = NULL; 347. > DH_PKEY_CTX *dctx = ctx->data; 348. BN_GENCB *pcb; 349. int ret; crypto/dh/dh_pmeth.c:350:9: Taking true branch 348. BN_GENCB *pcb; 349. int ret; 350. if (dctx->rfc5114_param) { ^ 351. switch (dctx->rfc5114_param) { 352. case 1: crypto/dh/dh_pmeth.c:351:9: 349. int ret; 350. if (dctx->rfc5114_param) { 351. > switch (dctx->rfc5114_param) { 352. case 1: 353. dh = DH_get_1024_160(); crypto/dh/dh_pmeth.c:352:9: Switch condition is false. Skipping switch case 350. if (dctx->rfc5114_param) { 351. switch (dctx->rfc5114_param) { 352. case 1: ^ 353. dh = DH_get_1024_160(); 354. break; crypto/dh/dh_pmeth.c:356:9: Switch condition is false. Skipping switch case 354. break; 355. 356. case 2: ^ 357. dh = DH_get_2048_224(); 358. break; crypto/dh/dh_pmeth.c:360:9: Switch condition is true. Entering switch case 358. break; 359. 360. case 3: ^ 361. dh = DH_get_2048_256(); 362. break; crypto/dh/dh_pmeth.c:361:13: 359. 360. case 3: 361. > dh = DH_get_2048_256(); 362. break; 363. crypto/dh/dh_rfc5114.c:90:1: start of procedure DH_get_2048_256() 88. make_dh(1024_160) 89. make_dh(2048_224) 90. > make_dh(2048_256) crypto/dh/dh_rfc5114.c:90:1: Taking false branch 88. make_dh(1024_160) 89. make_dh(2048_224) 90. > make_dh(2048_256) crypto/bn/bn_lib.c:410:1: start of procedure BN_dup() 408. } 409. 410. > BIGNUM *BN_dup(const BIGNUM *a) 411. { 412. BIGNUM *t; crypto/bn/bn_lib.c:414:9: Taking false branch 412. BIGNUM *t; 413. 414. if (a == NULL) ^ 415. return NULL; 416. bn_check_top(a); crypto/bn/bn_lib.c:418:9: 416. bn_check_top(a); 417. 418. > t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:418:9: Condition is false 416. bn_check_top(a); 417. 418. t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); ^ 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) crypto/bn/bn_lib.c:418:5: 416. bn_check_top(a); 417. 418. > t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:419:9: Taking false branch 417. 418. t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) ^ 420. return NULL; 421. if (!BN_copy(t, a)) { crypto/bn/bn_lib.c:421:10: Taking false branch 419. if (t == NULL) 420. return NULL; 421. if (!BN_copy(t, a)) { ^ 422. BN_free(t); 423. return NULL; crypto/bn/bn_lib.c:426:5: 424. } 425. bn_check_top(t); 426. > return t; 427. } 428. crypto/bn/bn_lib.c:427:1: return from a call to BN_dup 425. bn_check_top(t); 426. return t; 427. > } 428. 429. BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) crypto/dh/dh_rfc5114.c:90:1: 88. make_dh(1024_160) 89. make_dh(2048_224) 90. > make_dh(2048_256) crypto/bn/bn_lib.c:410:1: start of procedure BN_dup() 408. } 409. 410. > BIGNUM *BN_dup(const BIGNUM *a) 411. { 412. BIGNUM *t; crypto/bn/bn_lib.c:414:9: Taking false branch 412. BIGNUM *t; 413. 414. if (a == NULL) ^ 415. return NULL; 416. bn_check_top(a); crypto/bn/bn_lib.c:418:9: 416. bn_check_top(a); 417. 418. > t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:418:9: Condition is false 416. bn_check_top(a); 417. 418. t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); ^ 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) crypto/bn/bn_lib.c:418:5: 416. bn_check_top(a); 417. 418. > t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:419:9: Taking false branch 417. 418. t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) ^ 420. return NULL; 421. if (!BN_copy(t, a)) { crypto/bn/bn_lib.c:421:10: Taking false branch 419. if (t == NULL) 420. return NULL; 421. if (!BN_copy(t, a)) { ^ 422. BN_free(t); 423. return NULL; crypto/bn/bn_lib.c:426:5: 424. } 425. bn_check_top(t); 426. > return t; 427. } 428. crypto/bn/bn_lib.c:427:1: return from a call to BN_dup 425. bn_check_top(t); 426. return t; 427. > } 428. 429. BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) crypto/dh/dh_rfc5114.c:90:1: 88. make_dh(1024_160) 89. make_dh(2048_224) 90. > make_dh(2048_256) crypto/bn/bn_lib.c:410:1: start of procedure BN_dup() 408. } 409. 410. > BIGNUM *BN_dup(const BIGNUM *a) 411. { 412. BIGNUM *t; crypto/bn/bn_lib.c:414:9: Taking false branch 412. BIGNUM *t; 413. 414. if (a == NULL) ^ 415. return NULL; 416. bn_check_top(a); crypto/bn/bn_lib.c:418:9: 416. bn_check_top(a); 417. 418. > t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:418:9: Condition is false 416. bn_check_top(a); 417. 418. t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); ^ 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) crypto/bn/bn_lib.c:418:5: 416. bn_check_top(a); 417. 418. > t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) 420. return NULL; crypto/bn/bn_lib.c:419:9: Taking false branch 417. 418. t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new(); 419. if (t == NULL) ^ 420. return NULL; 421. if (!BN_copy(t, a)) { crypto/bn/bn_lib.c:421:10: Taking false branch 419. if (t == NULL) 420. return NULL; 421. if (!BN_copy(t, a)) { ^ 422. BN_free(t); 423. return NULL; crypto/bn/bn_lib.c:426:5: 424. } 425. bn_check_top(t); 426. > return t; 427. } 428. crypto/bn/bn_lib.c:427:1: return from a call to BN_dup 425. bn_check_top(t); 426. return t; 427. > } 428. 429. BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) crypto/dh/dh_rfc5114.c:90:1: Taking false branch 88. make_dh(1024_160) 89. make_dh(2048_224) 90. > make_dh(2048_256) crypto/dh/dh_rfc5114.c:90:1: Taking false branch 88. make_dh(1024_160) 89. make_dh(2048_224) 90. > make_dh(2048_256) crypto/dh/dh_rfc5114.c:90:1: Taking false branch 88. make_dh(1024_160) 89. make_dh(2048_224) 90. > make_dh(2048_256) crypto/dh/dh_rfc5114.c:90:1: return from a call to DH_get_2048_256 88. make_dh(1024_160) 89. make_dh(2048_224) 90. > make_dh(2048_256) crypto/dh/dh_pmeth.c:367:9: 365. return -2; 366. } 367. > EVP_PKEY_assign(pkey, EVP_PKEY_DHX, dh); 368. return 1; 369. } crypto/evp/p_lib.c:270:1: start of procedure EVP_PKEY_assign() 268. } 269. 270. > int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) 271. { 272. if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) crypto/evp/p_lib.c:272:9: Taking false branch 270. int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) 271. { 272. if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) ^ 273. return 0; 274. pkey->pkey.ptr = key; crypto/evp/p_lib.c:272:26: 270. int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) 271. { 272. > if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) 273. return 0; 274. pkey->pkey.ptr = key; crypto/evp/p_lib.c:260:1: start of procedure EVP_PKEY_set_type() 258. } 259. 260. > int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) 261. { 262. return pkey_set_type(pkey, type, NULL, -1); crypto/evp/p_lib.c:262:5: Skipping pkey_set_type(): empty list of specs 260. int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) 261. { 262. return pkey_set_type(pkey, type, NULL, -1); ^ 263. } 264. crypto/evp/p_lib.c:263:1: return from a call to EVP_PKEY_set_type 261. { 262. return pkey_set_type(pkey, type, NULL, -1); 263. > } 264. 265. int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len) crypto/evp/p_lib.c:272:26: Taking true branch 270. int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) 271. { 272. if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) ^ 273. return 0; 274. pkey->pkey.ptr = key; crypto/evp/p_lib.c:273:9: 271. { 272. if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) 273. > return 0; 274. pkey->pkey.ptr = key; 275. return (key != NULL); crypto/evp/p_lib.c:276:1: return from a call to EVP_PKEY_assign 274. pkey->pkey.ptr = key; 275. return (key != NULL); 276. > } 277. 278. void *EVP_PKEY_get0(EVP_PKEY *pkey)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/dh/dh_pmeth.c/#L367
d2a_code_trace_data_42318
static int createCroppedImage(struct image_data *image, struct crop_mask *crop, unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr) { tsize_t cropsize; unsigned char *read_buff = NULL; unsigned char *crop_buff = NULL; unsigned char *new_buff = NULL; static tsize_t prev_cropsize = 0; read_buff = *read_buff_ptr; crop_buff = read_buff; *crop_buff_ptr = read_buff; crop->combined_width = image->width; crop->combined_length = image->length; cropsize = crop->bufftotal; crop_buff = *crop_buff_ptr; if (!crop_buff) { crop_buff = (unsigned char *)_TIFFmalloc(cropsize); *crop_buff_ptr = crop_buff; _TIFFmemset(crop_buff, 0, cropsize); prev_cropsize = cropsize; } else { if (prev_cropsize < cropsize) { new_buff = _TIFFrealloc(crop_buff, cropsize); if (!new_buff) { free (crop_buff); crop_buff = (unsigned char *)_TIFFmalloc(cropsize); } else crop_buff = new_buff; _TIFFmemset(crop_buff, 0, cropsize); } } if (!crop_buff) { TIFFError("createCroppedImage", "Unable to allocate/reallocate crop buffer"); return (-1); } *crop_buff_ptr = crop_buff; if (crop->crop_mode & CROP_INVERT) { switch (crop->photometric) { case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: image->photometric = crop->photometric; break; case INVERT_DATA_ONLY: case INVERT_DATA_AND_TAG: if (invertImage(image->photometric, image->spp, image->bps, crop->combined_width, crop->combined_length, crop_buff)) { TIFFError("createCroppedImage", "Failed to invert colorspace for image or cropped selection"); return (-1); } if (crop->photometric == INVERT_DATA_AND_TAG) { switch (image->photometric) { case PHOTOMETRIC_MINISWHITE: image->photometric = PHOTOMETRIC_MINISBLACK; break; case PHOTOMETRIC_MINISBLACK: image->photometric = PHOTOMETRIC_MINISWHITE; break; default: break; } } break; default: break; } } if (crop->crop_mode & CROP_MIRROR) { if (mirrorImage(image->spp, image->bps, crop->mirror, crop->combined_width, crop->combined_length, crop_buff)) { TIFFError("createCroppedImage", "Failed to mirror image or cropped selection %s", (crop->rotation == MIRROR_HORIZ) ? "horizontally" : "vertically"); return (-1); } } if (crop->crop_mode & CROP_ROTATE) { if (rotateImage(crop->rotation, image, &crop->combined_width, &crop->combined_length, crop_buff_ptr)) { TIFFError("createCroppedImage", "Failed to rotate image or cropped selection by %d degrees", crop->rotation); return (-1); } } if (crop_buff == read_buff) *read_buff_ptr = NULL; return (0); } tools/tiffcrop.c:7626: error: Null Dereference pointer `crop_buff` last assigned on line 7624 could be null and is dereferenced by call to `_TIFFmemset()` at line 7626, column 5. tools/tiffcrop.c:7602:1: start of procedure createCroppedImage() 7600. * the most optimized path when no Zones or Regions are required. 7601. */ 7602. static int ^ 7603. createCroppedImage(struct image_data *image, struct crop_mask *crop, 7604. unsigned char **read_buff_ptr, unsigned char **crop_buff_ptr) tools/tiffcrop.c:7607:3: 7605. { 7606. tsize_t cropsize; 7607. unsigned char *read_buff = NULL; ^ 7608. unsigned char *crop_buff = NULL; 7609. unsigned char *new_buff = NULL; tools/tiffcrop.c:7608:3: 7606. tsize_t cropsize; 7607. unsigned char *read_buff = NULL; 7608. unsigned char *crop_buff = NULL; ^ 7609. unsigned char *new_buff = NULL; 7610. static tsize_t prev_cropsize = 0; tools/tiffcrop.c:7609:3: 7607. unsigned char *read_buff = NULL; 7608. unsigned char *crop_buff = NULL; 7609. unsigned char *new_buff = NULL; ^ 7610. static tsize_t prev_cropsize = 0; 7611. tools/tiffcrop.c:7610:3: 7608. unsigned char *crop_buff = NULL; 7609. unsigned char *new_buff = NULL; 7610. static tsize_t prev_cropsize = 0; ^ 7611. 7612. read_buff = *read_buff_ptr; tools/tiffcrop.c:7612:3: 7610. static tsize_t prev_cropsize = 0; 7611. 7612. read_buff = *read_buff_ptr; ^ 7613. 7614. /* process full image, no crop buffer needed */ tools/tiffcrop.c:7615:3: 7613. 7614. /* process full image, no crop buffer needed */ 7615. crop_buff = read_buff; ^ 7616. *crop_buff_ptr = read_buff; 7617. crop->combined_width = image->width; tools/tiffcrop.c:7616:3: 7614. /* process full image, no crop buffer needed */ 7615. crop_buff = read_buff; 7616. *crop_buff_ptr = read_buff; ^ 7617. crop->combined_width = image->width; 7618. crop->combined_length = image->length; tools/tiffcrop.c:7617:3: 7615. crop_buff = read_buff; 7616. *crop_buff_ptr = read_buff; 7617. crop->combined_width = image->width; ^ 7618. crop->combined_length = image->length; 7619. tools/tiffcrop.c:7618:3: 7616. *crop_buff_ptr = read_buff; 7617. crop->combined_width = image->width; 7618. crop->combined_length = image->length; ^ 7619. 7620. cropsize = crop->bufftotal; tools/tiffcrop.c:7620:3: 7618. crop->combined_length = image->length; 7619. 7620. cropsize = crop->bufftotal; ^ 7621. crop_buff = *crop_buff_ptr; 7622. if (!crop_buff) tools/tiffcrop.c:7621:3: 7619. 7620. cropsize = crop->bufftotal; 7621. crop_buff = *crop_buff_ptr; ^ 7622. if (!crop_buff) 7623. { tools/tiffcrop.c:7622:8: Taking true branch 7620. cropsize = crop->bufftotal; 7621. crop_buff = *crop_buff_ptr; 7622. if (!crop_buff) ^ 7623. { 7624. crop_buff = (unsigned char *)_TIFFmalloc(cropsize); tools/tiffcrop.c:7624:5: 7622. if (!crop_buff) 7623. { 7624. crop_buff = (unsigned char *)_TIFFmalloc(cropsize); ^ 7625. *crop_buff_ptr = crop_buff; 7626. _TIFFmemset(crop_buff, 0, cropsize); 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:7625:5: 7623. { 7624. crop_buff = (unsigned char *)_TIFFmalloc(cropsize); 7625. *crop_buff_ptr = crop_buff; ^ 7626. _TIFFmemset(crop_buff, 0, cropsize); 7627. prev_cropsize = cropsize; tools/tiffcrop.c:7626:5: 7624. crop_buff = (unsigned char *)_TIFFmalloc(cropsize); 7625. *crop_buff_ptr = crop_buff; 7626. _TIFFmemset(crop_buff, 0, cropsize); ^ 7627. prev_cropsize = cropsize; 7628. } 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/#L7626
d2a_code_trace_data_42319
static int test_early_data_replay_int(int idx, int usecb, int confopt) { SSL_CTX *cctx = NULL, *sctx = NULL; SSL *clientssl = NULL, *serverssl = NULL; int testresult = 0; SSL_SESSION *sess = NULL; size_t readbytes, written; unsigned char buf[20]; allow_ed_cb_called = 0; if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), TLS1_VERSION, 0, &sctx, &cctx, cert, privkey))) return 0; if (usecb > 0) { if (confopt == 0) { SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY); } else { SSL_CONF_CTX *confctx = SSL_CONF_CTX_new(); if (!TEST_ptr(confctx)) goto end; SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE | SSL_CONF_FLAG_SERVER); SSL_CONF_CTX_set_ssl_ctx(confctx, sctx); if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"), 2)) { SSL_CONF_CTX_free(confctx); goto end; } SSL_CONF_CTX_free(confctx); } SSL_CTX_set_allow_early_data_cb(sctx, allow_early_data_cb, &usecb); } if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, &serverssl, &sess, idx))) goto end; if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) || !TEST_true(SSL_session_reused(clientssl))) goto end; SSL_shutdown(clientssl); SSL_shutdown(serverssl); SSL_free(serverssl); SSL_free(clientssl); serverssl = clientssl = NULL; if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, NULL)) || !TEST_true(SSL_set_session(clientssl, sess))) goto end; if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), &written)) || !TEST_size_t_eq(written, strlen(MSG1))) goto end; if (usecb <= 1) { if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), &readbytes), SSL_READ_EARLY_DATA_FINISH) || !TEST_int_eq(SSL_get_early_data_status(serverssl), SSL_EARLY_DATA_REJECTED)) goto end; } else { if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), &readbytes), SSL_READ_EARLY_DATA_SUCCESS) || !TEST_mem_eq(MSG1, strlen(MSG1), buf, readbytes) || !TEST_int_gt(SSL_connect(clientssl), 0) || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), &readbytes), SSL_READ_EARLY_DATA_FINISH) || !TEST_int_eq(SSL_get_early_data_status(serverssl), SSL_EARLY_DATA_ACCEPTED)) goto end; } if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) || !TEST_int_eq(SSL_session_reused(clientssl), (usecb > 0) ? 1 : 0) || !TEST_int_eq(allow_ed_cb_called, usecb > 0 ? 1 : 0)) goto end; testresult = 1; end: SSL_SESSION_free(sess); SSL_SESSION_free(clientpsk); SSL_SESSION_free(serverpsk); clientpsk = serverpsk = NULL; SSL_free(serverssl); SSL_free(clientssl); SSL_CTX_free(sctx); SSL_CTX_free(cctx); return testresult; } test/sslapitest.c:2735: error: MEMORY_LEAK memory dynamically allocated by call to `SSL_CONF_CTX_new()` at line 2726, column 37 is not reachable after line 2735, column 17. Showing all 70 steps of the trace test/sslapitest.c:2706:1: start of procedure test_early_data_replay_int() 2704. * confopt == 1: Configure anti-replay using SSL_CONF 2705. */ 2706. > static int test_early_data_replay_int(int idx, int usecb, int confopt) 2707. { 2708. SSL_CTX *cctx = NULL, *sctx = NULL; test/sslapitest.c:2708:5: 2706. static int test_early_data_replay_int(int idx, int usecb, int confopt) 2707. { 2708. > SSL_CTX *cctx = NULL, *sctx = NULL; 2709. SSL *clientssl = NULL, *serverssl = NULL; 2710. int testresult = 0; test/sslapitest.c:2709:5: 2707. { 2708. SSL_CTX *cctx = NULL, *sctx = NULL; 2709. > SSL *clientssl = NULL, *serverssl = NULL; 2710. int testresult = 0; 2711. SSL_SESSION *sess = NULL; test/sslapitest.c:2710:5: 2708. SSL_CTX *cctx = NULL, *sctx = NULL; 2709. SSL *clientssl = NULL, *serverssl = NULL; 2710. > int testresult = 0; 2711. SSL_SESSION *sess = NULL; 2712. size_t readbytes, written; test/sslapitest.c:2711:5: 2709. SSL *clientssl = NULL, *serverssl = NULL; 2710. int testresult = 0; 2711. > SSL_SESSION *sess = NULL; 2712. size_t readbytes, written; 2713. unsigned char buf[20]; test/sslapitest.c:2715:5: 2713. unsigned char buf[20]; 2714. 2715. > allow_ed_cb_called = 0; 2716. 2717. if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), test/sslapitest.c:2717:10: 2715. allow_ed_cb_called = 0; 2716. 2717. > if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), 2718. TLS1_VERSION, 0, &sctx, 2719. &cctx, cert, privkey))) ssl/methods.c:49:1: start of procedure TLS_server_method() 47. * TLS/SSLv3 server methods 48. */ 49. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0, 50. TLS_server_method, 51. ossl_statem_accept, ssl/methods.c:49:1: return from a call to TLS_server_method 47. * TLS/SSLv3 server methods 48. */ 49. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0, 50. TLS_server_method, 51. ossl_statem_accept, ssl/methods.c:82:1: start of procedure TLS_client_method() 80. * TLS/SSLv3 client methods 81. */ 82. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0, 83. TLS_client_method, 84. ssl_undefined_function, ssl/methods.c:82:1: return from a call to TLS_client_method 80. * TLS/SSLv3 client methods 81. */ 82. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0, 83. TLS_client_method, 84. ssl_undefined_function, test/sslapitest.c:2717:10: Condition is true 2715. allow_ed_cb_called = 0; 2716. 2717. if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), ^ 2718. TLS1_VERSION, 0, &sctx, 2719. &cctx, cert, privkey))) test/testutil/tests.c:237:1: start of procedure test_true() 235. } 236. 237. > int test_true(const char *file, int line, const char *s, int b) 238. { 239. if (b) test/testutil/tests.c:239:9: Taking true branch 237. int test_true(const char *file, int line, const char *s, int b) 238. { 239. if (b) ^ 240. return 1; 241. test_fail_message(NULL, file, line, "bool", s, "true", "==", "false"); test/testutil/tests.c:240:9: 238. { 239. if (b) 240. > return 1; 241. test_fail_message(NULL, file, line, "bool", s, "true", "==", "false"); 242. return 0; test/testutil/tests.c:243:1: return from a call to test_true 241. test_fail_message(NULL, file, line, "bool", s, "true", "==", "false"); 242. return 0; 243. > } 244. 245. int test_false(const char *file, int line, const char *s, int b) test/sslapitest.c:2717:10: Taking false branch 2715. allow_ed_cb_called = 0; 2716. 2717. if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), ^ 2718. TLS1_VERSION, 0, &sctx, 2719. &cctx, cert, privkey))) test/sslapitest.c:2722:9: Taking true branch 2720. return 0; 2721. 2722. if (usecb > 0) { ^ 2723. if (confopt == 0) { 2724. SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY); test/sslapitest.c:2723:13: Taking false branch 2721. 2722. if (usecb > 0) { 2723. if (confopt == 0) { ^ 2724. SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY); 2725. } else { test/sslapitest.c:2726:13: 2724. SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY); 2725. } else { 2726. > SSL_CONF_CTX *confctx = SSL_CONF_CTX_new(); 2727. 2728. if (!TEST_ptr(confctx)) ssl/ssl_conf.c:873:1: start of procedure SSL_CONF_CTX_new() 871. } 872. 873. > SSL_CONF_CTX *SSL_CONF_CTX_new(void) 874. { 875. SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret)); ssl/ssl_conf.c:875:5: 873. SSL_CONF_CTX *SSL_CONF_CTX_new(void) 874. { 875. > SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret)); 876. 877. return ret; crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking true branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:234:9: 232. FAILTEST(); 233. if (ret != NULL) 234. > memset(ret, 0, num); 235. return ret; 236. } crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) ssl/ssl_conf.c:877:5: 875. SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret)); 876. 877. > return ret; 878. } 879. ssl/ssl_conf.c:878:1: return from a call to SSL_CONF_CTX_new 876. 877. return ret; 878. > } 879. 880. int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx) test/sslapitest.c:2728:18: 2726. SSL_CONF_CTX *confctx = SSL_CONF_CTX_new(); 2727. 2728. > if (!TEST_ptr(confctx)) 2729. goto end; 2730. SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE test/testutil/tests.c:229:1: start of procedure test_ptr() 227. } 228. 229. > int test_ptr(const char *file, int line, const char *s, const void *p) 230. { 231. if (p != NULL) test/testutil/tests.c:231:9: Taking true branch 229. int test_ptr(const char *file, int line, const char *s, const void *p) 230. { 231. if (p != NULL) ^ 232. return 1; 233. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:232:9: 230. { 231. if (p != NULL) 232. > return 1; 233. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 234. return 0; test/testutil/tests.c:235:1: return from a call to test_ptr 233. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 234. return 0; 235. > } 236. 237. int test_true(const char *file, int line, const char *s, int b) test/sslapitest.c:2728:18: Taking false branch 2726. SSL_CONF_CTX *confctx = SSL_CONF_CTX_new(); 2727. 2728. if (!TEST_ptr(confctx)) ^ 2729. goto end; 2730. SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE test/sslapitest.c:2730:13: 2728. if (!TEST_ptr(confctx)) 2729. goto end; 2730. > SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE 2731. | SSL_CONF_FLAG_SERVER); 2732. SSL_CONF_CTX_set_ssl_ctx(confctx, sctx); ssl/ssl_conf.c:925:1: start of procedure SSL_CONF_CTX_set_flags() 923. } 924. 925. > unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags) 926. { 927. cctx->flags |= flags; ssl/ssl_conf.c:927:5: 925. unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags) 926. { 927. > cctx->flags |= flags; 928. return cctx->flags; 929. } ssl/ssl_conf.c:928:5: 926. { 927. cctx->flags |= flags; 928. > return cctx->flags; 929. } 930. ssl/ssl_conf.c:929:1: return from a call to SSL_CONF_CTX_set_flags 927. cctx->flags |= flags; 928. return cctx->flags; 929. > } 930. 931. unsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, unsigned int flags) test/sslapitest.c:2732:13: 2730. SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE 2731. | SSL_CONF_FLAG_SERVER); 2732. > SSL_CONF_CTX_set_ssl_ctx(confctx, sctx); 2733. if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"), 2734. 2)) { ssl/ssl_conf.c:973:1: start of procedure SSL_CONF_CTX_set_ssl_ctx() 971. } 972. 973. > void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx) 974. { 975. cctx->ctx = ctx; ssl/ssl_conf.c:975:5: 973. void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx) 974. { 975. > cctx->ctx = ctx; 976. cctx->ssl = NULL; 977. if (ctx) { ssl/ssl_conf.c:976:5: 974. { 975. cctx->ctx = ctx; 976. > cctx->ssl = NULL; 977. if (ctx) { 978. cctx->poptions = &ctx->options; ssl/ssl_conf.c:977:9: Taking true branch 975. cctx->ctx = ctx; 976. cctx->ssl = NULL; 977. if (ctx) { ^ 978. cctx->poptions = &ctx->options; 979. cctx->min_version = &ctx->min_proto_version; ssl/ssl_conf.c:978:9: 976. cctx->ssl = NULL; 977. if (ctx) { 978. > cctx->poptions = &ctx->options; 979. cctx->min_version = &ctx->min_proto_version; 980. cctx->max_version = &ctx->max_proto_version; ssl/ssl_conf.c:979:9: 977. if (ctx) { 978. cctx->poptions = &ctx->options; 979. > cctx->min_version = &ctx->min_proto_version; 980. cctx->max_version = &ctx->max_proto_version; 981. cctx->pcert_flags = &ctx->cert->cert_flags; ssl/ssl_conf.c:980:9: 978. cctx->poptions = &ctx->options; 979. cctx->min_version = &ctx->min_proto_version; 980. > cctx->max_version = &ctx->max_proto_version; 981. cctx->pcert_flags = &ctx->cert->cert_flags; 982. cctx->pvfy_flags = &ctx->verify_mode; ssl/ssl_conf.c:981:9: 979. cctx->min_version = &ctx->min_proto_version; 980. cctx->max_version = &ctx->max_proto_version; 981. > cctx->pcert_flags = &ctx->cert->cert_flags; 982. cctx->pvfy_flags = &ctx->verify_mode; 983. } else { ssl/ssl_conf.c:982:9: 980. cctx->max_version = &ctx->max_proto_version; 981. cctx->pcert_flags = &ctx->cert->cert_flags; 982. > cctx->pvfy_flags = &ctx->verify_mode; 983. } else { 984. cctx->poptions = NULL; ssl/ssl_conf.c:977:5: 975. cctx->ctx = ctx; 976. cctx->ssl = NULL; 977. > if (ctx) { 978. cctx->poptions = &ctx->options; 979. cctx->min_version = &ctx->min_proto_version; ssl/ssl_conf.c:990:1: return from a call to SSL_CONF_CTX_set_ssl_ctx 988. cctx->pvfy_flags = NULL; 989. } 990. > } test/sslapitest.c:2733:18: Skipping SSL_CONF_cmd(): empty list of specs 2731. | SSL_CONF_FLAG_SERVER); 2732. SSL_CONF_CTX_set_ssl_ctx(confctx, sctx); 2733. if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"), ^ 2734. 2)) { 2735. SSL_CONF_CTX_free(confctx); test/testutil/tests.c:209:1: start of procedure test_int_eq() 207. DEFINE_COMPARISON(type, name, ge, >=, fmt) 208. 209. > DEFINE_COMPARISONS(int, int, "%d") 210. DEFINE_COMPARISONS(unsigned int, uint, "%u") 211. DEFINE_COMPARISONS(char, char, "%c") test/testutil/tests.c:209:1: Taking false branch 207. DEFINE_COMPARISON(type, name, ge, >=, fmt) 208. 209. > DEFINE_COMPARISONS(int, int, "%d") 210. DEFINE_COMPARISONS(unsigned int, uint, "%u") 211. DEFINE_COMPARISONS(char, char, "%c") test/testutil/tests.c:209:1: return from a call to test_int_eq 207. DEFINE_COMPARISON(type, name, ge, >=, fmt) 208. 209. > DEFINE_COMPARISONS(int, int, "%d") 210. DEFINE_COMPARISONS(unsigned int, uint, "%u") 211. DEFINE_COMPARISONS(char, char, "%c") test/sslapitest.c:2733:18: Taking true branch 2731. | SSL_CONF_FLAG_SERVER); 2732. SSL_CONF_CTX_set_ssl_ctx(confctx, sctx); 2733. if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"), ^ 2734. 2)) { 2735. SSL_CONF_CTX_free(confctx); test/sslapitest.c:2735:17: Skipping SSL_CONF_CTX_free(): empty list of specs 2733. if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"), 2734. 2)) { 2735. SSL_CONF_CTX_free(confctx); ^ 2736. goto end; 2737. }
https://github.com/openssl/openssl/blob/cc8926ec8fcecae89ceab91ef753de93e49568f9/test/sslapitest.c/#L2735
d2a_code_trace_data_42320
static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col) { int c0, c1, c2, c3, a0, a1, a2, a3; const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; a0 = col[8*0]; a1 = col[8*1]; a2 = col[8*2]; a3 = col[8*3]; c0 = (a0 + a2)*C3 + (1 << (C_SHIFT - 1)); c2 = (a0 - a2)*C3 + (1 << (C_SHIFT - 1)); c1 = a1 * C1 + a3 * C2; c3 = a1 * C2 - a3 * C1; dest[0] = cm[dest[0] + ((c0 + c1) >> C_SHIFT)]; dest += line_size; dest[0] = cm[dest[0] + ((c2 + c3) >> C_SHIFT)]; dest += line_size; dest[0] = cm[dest[0] + ((c2 - c3) >> C_SHIFT)]; dest += line_size; dest[0] = cm[dest[0] + ((c0 - c1) >> C_SHIFT)]; } libavcodec/wmv2.c:70: error: Buffer Overrun L1 Offset: [29, 36] (⇐ [5, 12] + 24) Size: 6 by call to `wmv2_add_block`. libavcodec/wmv2.c:70:5: Call 68. 69. wmv2_add_block(w, block1[4], dest_cb , s->uvlinesize, 4); 70. wmv2_add_block(w, block1[5], dest_cr , s->uvlinesize, 5); ^ 71. } 72. libavcodec/wmv2.c:35:1: Parameter `n` 33. } 34. 35. static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){ ^ 36. MpegEncContext * const s= &w->s; 37. libavcodec/wmv2.c:45:9: Call 43. case 1: 44. ff_simple_idct84_add(dst , stride, block1); 45. ff_simple_idct84_add(dst + 4*stride, stride, w->abt_block2[n]); ^ 46. memset(w->abt_block2[n], 0, 64*sizeof(DCTELEM)); 47. break; libavcodec/simple_idct.c:558:1: Parameter `*block` 556. } 557. 558. void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block) ^ 559. { 560. int i; libavcodec/simple_idct.c:569:9: Call 567. /* IDCT4 and store */ 568. for(i=0;i<8;i++) { 569. idct4col_add(dest + i, line_size, block + i); ^ 570. } 571. } libavcodec/simple_idct.c:511:1: <Length trace> 509. #define C3 C_FIX(0.5) 510. #define C_SHIFT (4+1+12) 511. static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col) ^ 512. { 513. int c0, c1, c2, c3, a0, a1, a2, a3; libavcodec/simple_idct.c:511:1: Parameter `*col` 509. #define C3 C_FIX(0.5) 510. #define C_SHIFT (4+1+12) 511. static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col) ^ 512. { 513. int c0, c1, c2, c3, a0, a1, a2, a3; libavcodec/simple_idct.c:519:10: Array access: Offset: [29, 36] (⇐ [5, 12] + 24) Size: 6 by call to `wmv2_add_block` 517. a1 = col[8*1]; 518. a2 = col[8*2]; 519. a3 = col[8*3]; ^ 520. c0 = (a0 + a2)*C3 + (1 << (C_SHIFT - 1)); 521. c2 = (a0 - a2)*C3 + (1 << (C_SHIFT - 1));
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/simple_idct.c/#L519
d2a_code_trace_data_42321
int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *), int (*cmp_func) (const char *, const char *), void (*free_func) (const char *, int, const char *)) { int ret; int i; NAME_FUNCS *name_funcs; if (name_funcs_stack == NULL) { CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); name_funcs_stack = sk_NAME_FUNCS_new_null(); CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); } if (name_funcs_stack == NULL) { return (0); } ret = names_type_num; names_type_num++; for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); if (name_funcs == NULL) { OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE); return (0); } name_funcs->hash_func = lh_strhash; name_funcs->cmp_func = OPENSSL_strcmp; CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); } name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret); if (hash_func != NULL) name_funcs->hash_func = hash_func; if (cmp_func != NULL) name_funcs->cmp_func = cmp_func; if (free_func != NULL) name_funcs->free_func = free_func; return (ret); } crypto/objects/o_names.c:97: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_zalloc()` at line 85, column 22 is not reachable after line 97, column 18. Showing all 179 steps of the trace crypto/objects/o_names.c:64:1: start of procedure OBJ_NAME_new_index() 62. } 63. 64. > int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *), 65. int (*cmp_func) (const char *, const char *), 66. void (*free_func) (const char *, int, const char *)) crypto/objects/o_names.c:72:9: Taking true branch 70. NAME_FUNCS *name_funcs; 71. 72. if (name_funcs_stack == NULL) { ^ 73. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 74. name_funcs_stack = sk_NAME_FUNCS_new_null(); crypto/objects/o_names.c:73:9: 71. 72. if (name_funcs_stack == NULL) { 73. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 74. name_funcs_stack = sk_NAME_FUNCS_new_null(); 75. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:74:9: 72. if (name_funcs_stack == NULL) { 73. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 74. > name_funcs_stack = sk_NAME_FUNCS_new_null(); 75. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 76. } crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_new_null() 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) crypto/stack/stack.c:145:1: start of procedure sk_new_null() 143. } 144. 145. > _STACK *sk_new_null(void) 146. { 147. return sk_new((int (*)(const void *, const void *))0); crypto/stack/stack.c:147:5: 145. _STACK *sk_new_null(void) 146. { 147. > return sk_new((int (*)(const void *, const void *))0); 148. } 149. crypto/stack/stack.c:150:1: start of procedure sk_new() 148. } 149. 150. > _STACK *sk_new(int (*c) (const void *, const void *)) 151. { 152. _STACK *ret; crypto/stack/stack.c:154:9: 152. _STACK *ret; 153. 154. > if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == 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/stack/stack.c:154:9: Taking false branch 152. _STACK *ret; 153. 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) ^ 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) crypto/stack/stack.c:156:9: 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. > if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) 157. goto err; 158. ret->comp = c; 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/stack/stack.c:156:9: Taking false branch 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) ^ 157. goto err; 158. ret->comp = c; crypto/stack/stack.c:158:5: 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) 157. goto err; 158. > ret->comp = c; 159. ret->num_alloc = MIN_NODES; 160. return (ret); crypto/stack/stack.c:159:5: 157. goto err; 158. ret->comp = c; 159. > ret->num_alloc = MIN_NODES; 160. return (ret); 161. crypto/stack/stack.c:160:5: 158. ret->comp = c; 159. ret->num_alloc = MIN_NODES; 160. > return (ret); 161. 162. err: crypto/stack/stack.c:165:1: return from a call to sk_new 163. OPENSSL_free(ret); 164. return (NULL); 165. > } 166. 167. int sk_insert(_STACK *st, void *data, int loc) crypto/stack/stack.c:148:1: return from a call to sk_new_null 146. { 147. return sk_new((int (*)(const void *, const void *))0); 148. > } 149. 150. _STACK *sk_new(int (*c) (const void *, const void *)) crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_new_null 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) crypto/objects/o_names.c:75:9: 73. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 74. name_funcs_stack = sk_NAME_FUNCS_new_null(); 75. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 76. } 77. if (name_funcs_stack == NULL) { crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:77:9: Taking false branch 75. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 76. } 77. if (name_funcs_stack == NULL) { ^ 78. /* ERROR */ 79. return (0); crypto/objects/o_names.c:81:5: 79. return (0); 80. } 81. > ret = names_type_num; 82. names_type_num++; 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { crypto/objects/o_names.c:82:5: 80. } 81. ret = names_type_num; 82. > names_type_num++; 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); crypto/objects/o_names.c:83:10: 81. ret = names_type_num; 82. names_type_num++; 83. > for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_num() 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) 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/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_num 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) crypto/objects/o_names.c:83:51: Loop condition is true. Entering loop body 81. ret = names_type_num; 82. names_type_num++; 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { ^ 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); crypto/objects/o_names.c:84:9: 82. names_type_num++; 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { 84. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); 86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:85:9: 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. > name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); 86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 87. if (name_funcs == 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/objects/o_names.c:86:9: 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); 86. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 87. if (name_funcs == NULL) { 88. OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:87:13: Taking false branch 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); 86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 87. if (name_funcs == NULL) { ^ 88. OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE); 89. return (0); crypto/objects/o_names.c:91:9: 89. return (0); 90. } 91. > name_funcs->hash_func = lh_strhash; 92. name_funcs->cmp_func = OPENSSL_strcmp; 93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); crypto/objects/o_names.c:92:9: 90. } 91. name_funcs->hash_func = lh_strhash; 92. > name_funcs->cmp_func = OPENSSL_strcmp; 93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); crypto/objects/o_names.c:93:9: 91. name_funcs->hash_func = lh_strhash; 92. name_funcs->cmp_func = OPENSSL_strcmp; 93. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); 95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:94:9: 92. name_funcs->cmp_func = OPENSSL_strcmp; 93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 94. > sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); 95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 96. } crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_push() 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) 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 false 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:181:10: Taking true branch 179. st->num_alloc *= 2; 180. } 181. if ((loc >= (int)st->num) || (loc < 0)) ^ 182. st->data[st->num] = data; 183. else { crypto/stack/stack.c:182:9: 180. } 181. if ((loc >= (int)st->num) || (loc < 0)) 182. > st->data[st->num] = data; 183. else { 184. memmove(&(st->data[loc + 1]), crypto/stack/stack.c:188:5: 186. st->data[loc] = data; 187. } 188. > st->num++; 189. st->sorted = 0; 190. return (st->num); crypto/stack/stack.c:189:5: 187. } 188. st->num++; 189. > st->sorted = 0; 190. return (st->num); 191. } crypto/stack/stack.c:190:5: 188. st->num++; 189. st->sorted = 0; 190. > return (st->num); 191. } 192. 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/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_push 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) crypto/objects/o_names.c:95:9: 93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); 95. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 96. } 97. name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:83:71: 81. ret = names_type_num; 82. names_type_num++; 83. > for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); crypto/objects/o_names.c:83:51: Loop condition is true. Entering loop body 81. ret = names_type_num; 82. names_type_num++; 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { ^ 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); crypto/objects/o_names.c:84:9: 82. names_type_num++; 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { 84. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); 86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:85:9: 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. > name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); 86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 87. if (name_funcs == 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/objects/o_names.c:86:9: 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); 86. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 87. if (name_funcs == NULL) { 88. OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:87:13: Taking false branch 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); 86. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 87. if (name_funcs == NULL) { ^ 88. OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE); 89. return (0); crypto/objects/o_names.c:91:9: 89. return (0); 90. } 91. > name_funcs->hash_func = lh_strhash; 92. name_funcs->cmp_func = OPENSSL_strcmp; 93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); crypto/objects/o_names.c:92:9: 90. } 91. name_funcs->hash_func = lh_strhash; 92. > name_funcs->cmp_func = OPENSSL_strcmp; 93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); crypto/objects/o_names.c:93:9: 91. name_funcs->hash_func = lh_strhash; 92. name_funcs->cmp_func = OPENSSL_strcmp; 93. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); 95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:94:9: 92. name_funcs->cmp_func = OPENSSL_strcmp; 93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 94. > sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); 95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 96. } crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_push() 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) 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 false 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:181:10: Taking true branch 179. st->num_alloc *= 2; 180. } 181. if ((loc >= (int)st->num) || (loc < 0)) ^ 182. st->data[st->num] = data; 183. else { crypto/stack/stack.c:182:9: 180. } 181. if ((loc >= (int)st->num) || (loc < 0)) 182. > st->data[st->num] = data; 183. else { 184. memmove(&(st->data[loc + 1]), crypto/stack/stack.c:188:5: 186. st->data[loc] = data; 187. } 188. > st->num++; 189. st->sorted = 0; 190. return (st->num); crypto/stack/stack.c:189:5: 187. } 188. st->num++; 189. > st->sorted = 0; 190. return (st->num); 191. } crypto/stack/stack.c:190:5: 188. st->num++; 189. st->sorted = 0; 190. > return (st->num); 191. } 192. 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/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_push 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) crypto/objects/o_names.c:95:9: 93. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 94. sk_NAME_FUNCS_push(name_funcs_stack, name_funcs); 95. > CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 96. } 97. name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret); crypto/mem_dbg.c:206:1: start of procedure CRYPTO_mem_ctrl() 204. #endif 205. 206. > int CRYPTO_mem_ctrl(int mode) 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem_dbg.c:209:5: 207. { 208. #ifdef OPENSSL_NO_CRYPTO_MDEBUG 209. > return mode - mode; 210. #else 211. int ret = mh_mode; crypto/mem_dbg.c:275:1: return from a call to CRYPTO_mem_ctrl 273. return (ret); 274. #endif 275. > } 276. 277. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/objects/o_names.c:83:71: 81. ret = names_type_num; 82. names_type_num++; 83. > for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); crypto/objects/o_names.c:83:51: Loop condition is false. Leaving loop 81. ret = names_type_num; 82. names_type_num++; 83. for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) { ^ 84. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE); 85. name_funcs = OPENSSL_zalloc(sizeof(*name_funcs)); crypto/objects/o_names.c:97:5: 95. CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE); 96. } 97. > name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret); 98. if (hash_func != NULL) 99. name_funcs->hash_func = hash_func; crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_value() 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS) 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/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_value 2. 3. typedef struct name_funcs_st NAME_FUNCS; 4. > DEFINE_STACK_OF(NAME_FUNCS)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/objects/o_names.c/#L97
d2a_code_trace_data_42322
static void perform_idle_server_maintenance(int child_bucket, int num_buckets) { int i, j; int idle_thread_count = 0; worker_score *ws; process_score *ps; int free_length = 0; int free_slots[MAX_SPAWN_RATE]; int last_non_dead = -1; int active_thread_count = 0; for (i = 0; i < server_limit; ++i) { int status = SERVER_DEAD; int child_threads_active = 0; if (i >= retained->max_daemons_limit && free_length == retained->idle_spawn_rate[child_bucket]) { break; } ps = &ap_scoreboard_image->parent[i]; if (ps->pid != 0) { for (j = 0; j < threads_per_child; j++) { ws = &ap_scoreboard_image->servers[i][j]; status = ws->status; if (status <= SERVER_READY && !ps->quiescing && !ps->not_accepting && ps->generation == retained->my_generation && ps->bucket == child_bucket) { ++idle_thread_count; } if (status >= SERVER_READY && status < SERVER_GRACEFUL) { ++child_threads_active; } } last_non_dead = i; } active_thread_count += child_threads_active; if (!ps->pid && free_length < retained->idle_spawn_rate[child_bucket]) free_slots[free_length++] = i; else if (child_threads_active == threads_per_child) had_healthy_child = 1; } if (retained->sick_child_detected) { if (had_healthy_child) { retained->sick_child_detected = 0; } else { shutdown_pending = 1; child_fatal = 1; ap_log_error(APLOG_MARK, APLOG_ALERT, 0, ap_server_conf, APLOGNO(02324) "A resource shortage or other unrecoverable failure " "was encountered before any child process initialized " "successfully... httpd is exiting!"); return; } } retained->max_daemons_limit = last_non_dead + 1; if (idle_thread_count > max_spare_threads / num_buckets) { if (retained->total_daemons <= active_daemons_limit && retained->total_daemons < server_limit) { ap_mpm_podx_signal(all_buckets[child_bucket].pod, AP_MPM_PODX_GRACEFUL); retained->idle_spawn_rate[child_bucket] = 1; active_daemons--; } else { ap_log_error(APLOG_MARK, APLOG_TRACE5, 0, ap_server_conf, "Not shutting down child: total daemons %d / " "active limit %d / ServerLimit %d", retained->total_daemons, active_daemons_limit, server_limit); } } else if (idle_thread_count < min_spare_threads / num_buckets) { if (active_thread_count >= max_workers) { if (!retained->maxclients_reported) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(00484) "server reached MaxRequestWorkers setting, " "consider raising the MaxRequestWorkers " "setting"); retained->maxclients_reported = 1; } retained->idle_spawn_rate[child_bucket] = 1; } else if (free_length == 0) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO() "scoreboard is full, not at MaxRequestWorkers." "Increase ServerLimit."); retained->idle_spawn_rate[child_bucket] = 1; } else { if (free_length > retained->idle_spawn_rate[child_bucket]) { free_length = retained->idle_spawn_rate[child_bucket]; } if (retained->idle_spawn_rate[child_bucket] >= 8) { ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf, APLOGNO(00486) "server seems busy, (you may need " "to increase StartServers, ThreadsPerChild " "or Min/MaxSpareThreads), " "spawning %d children, there are around %d idle " "threads, %d active children, and %d children " "that are shutting down", free_length, idle_thread_count, active_daemons, retained->total_daemons); } for (i = 0; i < free_length; ++i) { ap_log_error(APLOG_MARK, APLOG_TRACE5, 0, ap_server_conf, "Spawning new child: slot %d active / " "total daemons: %d/%d", free_slots[i], active_daemons, retained->total_daemons); make_child(ap_server_conf, free_slots[i], child_bucket); } if (retained->hold_off_on_exponential_spawning) { --retained->hold_off_on_exponential_spawning; } else if (retained->idle_spawn_rate[child_bucket] < MAX_SPAWN_RATE / num_buckets) { retained->idle_spawn_rate[child_bucket] *= 2; } } } else { retained->idle_spawn_rate[child_bucket] = 1; } } server/mpm/event/event.c:3085: error: UNINITIALIZED_VALUE The value read from free_slots[_] was never initialized. server/mpm/event/event.c:3085:17: 3083. free_slots[i], active_daemons, 3084. retained->total_daemons); 3085. make_child(ap_server_conf, free_slots[i], child_bucket); ^ 3086. } 3087. /* the next time around we want to spawn twice as many if this
https://github.com/apache/httpd/blob/31857a5cfabcd44d6a3299a20f7455a72db13ae5/server/mpm/event/event.c/#L3085
d2a_code_trace_data_42323
static av_always_inline int cmp_direct_inline(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, int qpel){ MotionEstContext * const c= &s->me; const int stride= c->stride; 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; 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; return d; } libavcodec/motion_est.c:612: error: Buffer Overrun L1 Offset: [8, 11] (⇐ [0, 3] + 8) Size: 4 by call to `epzs_motion_search4`. libavcodec/motion_est.c:576:9: Assignment 574. init_mv4_ref(c); 575. 576. for(block=0; block<4; block++){ ^ 577. int mx4, my4; 578. int pred_x4, pred_y4; libavcodec/motion_est.c:612:17: Call 610. P_MV1[1]= my; 611. 612. dmin4 = epzs_motion_search4(s, &mx4, &my4, P, block, block, s->p_mv_table, (1<<16)>>shift); ^ 613. 614. dmin4= c->sub_motion_search(s, &mx4, &my4, dmin4, block, block, size, h); libavcodec/motion_est_template.c:992:1: Parameter `ref_index` 990. } 991. 992. static int epzs_motion_search4(MpegEncContext * s, ^ 993. int *mx_ptr, int *my_ptr, int P[10][2], 994. int src_index, int ref_index, int16_t (*last_mv)[2], libavcodec/motion_est_template.c:1042:11: Call 1040. } 1041. 1042. dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); ^ 1043. 1044. *mx_ptr= best[0]; libavcodec/motion_est_template.c:832:1: Parameter `ref_index` 830. } 831. 832. static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin, ^ 833. int src_index, int ref_index, int const penalty_factor, 834. int size, int h, int flags){ libavcodec/motion_est_template.c:843:25: Call 841. return small_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); 842. else if(c->dia_size>1024) 843. return full_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); ^ 844. else if(c->dia_size>768) 845. return umh_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); libavcodec/motion_est_template.c:621:1: Parameter `ref_index` 619. } 620. 621. static int full_search(MpegEncContext * s, int *best, int dmin, ^ 622. int src_index, int ref_index, int const penalty_factor, 623. int size, int h, int flags) libavcodec/motion_est_template.c:645:5: Call 643. y= best[1]; 644. d= dmin; 645. CHECK_CLIPPED_MV(x , y); ^ 646. CHECK_CLIPPED_MV(x+1, y); 647. CHECK_CLIPPED_MV(x, y+1); libavcodec/motion_est.c:252:1: Parameter `ref_index` 250. against a proposed motion-compensated prediction of that block 251. */ 252. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 253. const int size, const int h, int ref_index, int src_index, 254. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ libavcodec/motion_est.c:261:16: Call 259. }else if(av_builtin_constant_p(subx) && av_builtin_constant_p(suby) 260. && subx==0 && suby==0){ 261. return cmp_fpel_internal(s,x,y,size,h,ref_index,src_index, cmp_func, chroma_cmp_func,flags); ^ 262. }else{ 263. return cmp_internal(s,x,y,subx,suby,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags); libavcodec/motion_est.c:229:1: Parameter `ref_index` 227. } 228. 229. static int cmp_fpel_internal(MpegEncContext *s, const int x, const int y, ^ 230. const int size, const int h, int ref_index, int src_index, 231. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ libavcodec/motion_est.c:233:16: Call 231. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ 232. if(flags&FLAG_DIRECT){ 233. return cmp_direct_inline(s,x,y,0,0,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, flags&FLAG_QPEL); ^ 234. }else{ 235. return cmp_inline(s,x,y,0,0,size,h,ref_index,src_index, cmp_func, chroma_cmp_func, 0, flags&FLAG_CHROMA); libavcodec/motion_est.c:105:1: <Length trace> 103. } 104. 105. static av_always_inline int cmp_direct_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 106. const int size, const int h, int ref_index, int src_index, 107. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel){ libavcodec/motion_est.c:105:1: Parameter `ref_index` 103. } 104. 105. static av_always_inline int cmp_direct_inline(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 106. const int size, const int h, int ref_index, int src_index, 107. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, int qpel){ libavcodec/motion_est.c:112:5: Assignment 110. const int hx= subx + (x<<(1+qpel)); 111. const int hy= suby + (y<<(1+qpel)); 112. uint8_t * const * const ref= c->ref[ref_index]; ^ 113. uint8_t * const * const src= c->src[src_index]; 114. int d; libavcodec/motion_est.c:168:50: Array access: Offset: [8, 11] (⇐ [0, 3] + 8) Size: 4 by call to `epzs_motion_search4` 166. 167. c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16); 168. c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16); ^ 169. } 170. }
https://github.com/libav/libav/blob/483321fe789566dcb27b6387c00ea16dd86bc587/libavcodec/motion_est.c/#L168
d2a_code_trace_data_42324
static int opt_metadata(const char *opt, const char *arg) { char *mid= strchr(arg, '='); if(!mid){ fprintf(stderr, "Missing =\n"); ffmpeg_exit(1); } *mid++= 0; av_dict_set(&metadata, arg, mid, 0); return 0; } ffmpeg.c:2865: error: Null Dereference pointer `mid` last assigned on line 2865 could be null and is dereferenced at line 2865, column 5. ffmpeg.c:2857:1: start of procedure opt_metadata() 2855. } 2856. 2857. static int opt_metadata(const char *opt, const char *arg) ^ 2858. { 2859. char *mid= strchr(arg, '='); ffmpeg.c:2859:5: 2857. static int opt_metadata(const char *opt, const char *arg) 2858. { 2859. char *mid= strchr(arg, '='); ^ 2860. 2861. if(!mid){ ffmpeg.c:2861:9: Taking true branch 2859. char *mid= strchr(arg, '='); 2860. 2861. if(!mid){ ^ 2862. fprintf(stderr, "Missing =\n"); 2863. ffmpeg_exit(1); ffmpeg.c:2862:9: 2860. 2861. if(!mid){ 2862. fprintf(stderr, "Missing =\n"); ^ 2863. ffmpeg_exit(1); 2864. } ffmpeg.c:2863:9: Skipping ffmpeg_exit(): empty list of specs 2861. if(!mid){ 2862. fprintf(stderr, "Missing =\n"); 2863. ffmpeg_exit(1); ^ 2864. } 2865. *mid++= 0; ffmpeg.c:2865:5: 2863. ffmpeg_exit(1); 2864. } 2865. *mid++= 0; ^ 2866. 2867. av_dict_set(&metadata, arg, mid, 0);
https://github.com/libav/libav/blob/eb97dbb05a990266b04830ea8e179e0428656b98/ffmpeg.c/#L2865
d2a_code_trace_data_42325
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:285: 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:285:12: Call 283. conf = ngx_http_get_module_loc_conf(r, ngx_http_userid_filter_module); 284. 285. return ngx_http_userid_variable(r, v, &conf->name, ctx->uid_set); ^ 286. } 287. 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_42326
void *lh_delete(LHASH *lh, const void *data) { unsigned long hash; LHASH_NODE *nn,**rn; void *ret; lh->error=0; rn=getrn(lh,data,&hash); if (*rn == NULL) { lh->num_no_delete++; return(NULL); } else { nn= *rn; *rn=nn->next; ret=nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes))) contract(lh); return(ret); } ssl/bio_ssl.c:442: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_dup`. Showing all 18 steps of the trace ssl/bio_ssl.c:441:4: Call 439. dbio=(BIO *)ptr; 440. if (((BIO_SSL *)dbio->ptr)->ssl != NULL) 441. SSL_free(((BIO_SSL *)dbio->ptr)->ssl); ^ 442. ((BIO_SSL *)dbio->ptr)->ssl=SSL_dup(ssl); 443. ((BIO_SSL *)dbio->ptr)->renegotiate_count= ssl/ssl_lib.c:472:1: Parameter `s->ctx->sessions->num_items` 470. } 471. 472. > void SSL_free(SSL *s) 473. { 474. int i; ssl/bio_ssl.c:442:31: Call 440. if (((BIO_SSL *)dbio->ptr)->ssl != NULL) 441. SSL_free(((BIO_SSL *)dbio->ptr)->ssl); 442. ((BIO_SSL *)dbio->ptr)->ssl=SSL_dup(ssl); ^ 443. ((BIO_SSL *)dbio->ptr)->renegotiate_count= 444. ((BIO_SSL *)b->ptr)->renegotiate_count; ssl/ssl_lib.c:2254:1: Parameter `s->ctx->sessions->num_items` 2252. } 2253. 2254. > SSL *SSL_dup(SSL *s) 2255. { 2256. STACK_OF(X509_NAME) *sk; ssl/ssl_lib.c:2261:11: Call 2259. int i; 2260. 2261. if ((ret=SSL_new(SSL_get_SSL_CTX(s))) == NULL) ^ 2262. return(NULL); 2263. ssl/ssl_lib.c:264:1: Parameter `ctx->sessions->num_items` 262. } 263. 264. > SSL *SSL_new(SSL_CTX *ctx) 265. { 266. SSL *s; ssl/ssl_lib.c:2378:20: Call 2376. { 2377. err: 2378. if (ret != NULL) SSL_free(ret); ^ 2379. ret=NULL; 2380. } ssl/ssl_lib.c:472:1: Parameter `s->ctx->sessions->num_items` 470. } 471. 472. > void SSL_free(SSL *s) 473. { 474. int i; ssl/ssl_lib.c:521:3: Call 519. if (s->session != NULL) 520. { 521. ssl_clear_bad_session(s); ^ 522. SSL_SESSION_free(s->session); 523. } ssl/ssl_sess.c:843:1: Parameter `s->ctx->sessions->num_items` 841. } 842. 843. > int ssl_clear_bad_session(SSL *s) 844. { 845. if ( (s->session != NULL) && ssl/ssl_sess.c:849:3: Call 847. !(SSL_in_init(s) || SSL_in_before(s))) 848. { 849. SSL_CTX_remove_session(s->ctx,s->session); ^ 850. return(1); 851. } ssl/ssl_sess.c:614:1: Parameter `ctx->sessions->num_items` 612. } 613. 614. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 615. { 616. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:616:9: Call 614. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 615. { 616. return remove_session_lock(ctx, c, 1); ^ 617. } 618. ssl/ssl_sess.c:619:1: Parameter `ctx->sessions->num_items` 617. } 618. 619. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 620. { 621. SSL_SESSION *r; ssl/ssl_sess.c:630:21: Call 628. { 629. ret=1; 630. r=(SSL_SESSION *)lh_delete(ctx->sessions,c); ^ 631. SSL_SESSION_list_remove(ctx,c); 632. } crypto/lhash/lhash.c:217:1: <LHS trace> 215. } 216. 217. > void *lh_delete(LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:217:1: Parameter `lh->num_items` 215. } 216. 217. > void *lh_delete(LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:240:2: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_dup` 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/02756aa8ba36af6e718d7a07c4e6bd8ad12e7ba1/crypto/lhash/lhash.c/#L240
d2a_code_trace_data_42327
static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, long max) { const unsigned char *p = *pp; unsigned long ret = 0; int i; if (max-- < 1) return 0; if (*p == 0x80) { *inf = 1; p++; } else { *inf = 0; i = *p & 0x7f; if (*p++ & 0x80) { if (max < i + 1) return 0; while (i > 0 && *p == 0) { p++; i--; } if (i > (int)sizeof(long)) return 0; while (i > 0) { ret <<= 8; ret |= *p++; i--; } if (ret > LONG_MAX) return 0; } else ret = i; } *pp = p; *rl = (long)ret; return 1; } crypto/pem/pem_pkey.c:217: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, +oo] by call to `d2i_DHxparams`. Showing all 29 steps of the trace crypto/pem/pem_pkey.c:212:10: Call 210. DH *ret = NULL; 211. 212. if (!PEM_bytes_read_bio(&data, &len, &nm, PEM_STRING_DHPARAMS, bp, cb, u)) ^ 213. return NULL; 214. p = data; crypto/pem/pem_lib.c:275:1: Parameter `**pdata` 273. } 274. 275. > int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, 276. const char *name, BIO *bp, pem_password_cb *cb, 277. void *u) { crypto/pem/pem_lib.c:278:12: Call 276. const char *name, BIO *bp, pem_password_cb *cb, 277. void *u) { 278. return pem_bytes_read_bio_flags(pdata, plen, pnm, name, bp, cb, u, ^ 279. PEM_FLAG_EAY_COMPATIBLE); 280. } crypto/pem/pem_lib.c:232:1: Parameter `**pdata` 230. } 231. 232. > static int pem_bytes_read_bio_flags(unsigned char **pdata, long *plen, 233. char **pnm, const char *name, BIO *bp, 234. pem_password_cb *cb, void *u, crypto/pem/pem_pkey.c:214:5: Assignment 212. if (!PEM_bytes_read_bio(&data, &len, &nm, PEM_STRING_DHPARAMS, bp, cb, u)) 213. return NULL; 214. p = data; ^ 215. 216. if (strcmp(nm, PEM_STRING_DHXPARAMS) == 0) crypto/pem/pem_pkey.c:217:15: Call 215. 216. if (strcmp(nm, PEM_STRING_DHXPARAMS) == 0) 217. ret = d2i_DHxparams(x, &p, len); ^ 218. else 219. ret = d2i_DHparams(x, &p, len); crypto/dh/dh_asn1.c:81:1: Parameter `**pp` 79. /* Application public function: read in X9.42 DH parameters into DH structure */ 80. 81. > DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length) 82. { 83. int_dhx942_dh *dhx = NULL; crypto/dh/dh_asn1.c:88:11: Call 86. if (dh == NULL) 87. return NULL; 88. dhx = d2i_int_dhx(NULL, pp, length); ^ 89. if (dhx == NULL) { 90. DH_free(dh); crypto/dh/dh_asn1.c:77:1: Parameter `**in` 75. int i2d_int_dhx(const int_dhx942_dh *a, unsigned char **pp); 76. 77. > IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(int_dhx942_dh, DHxparams, int_dhx) 78. 79. /* Application public function: read in X9.42 DH parameters into DH structure */ crypto/dh/dh_asn1.c:77:1: Call 75. int i2d_int_dhx(const int_dhx942_dh *a, unsigned char **pp); 76. 77. > IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(int_dhx942_dh, DHxparams, int_dhx) 78. 79. /* Application public function: read in X9.42 DH parameters into DH structure */ crypto/asn1/tasn_dec.c:105:1: Parameter `**in` 103. */ 104. 105. > ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval, 106. const unsigned char **in, long len, 107. const ASN1_ITEM *it) crypto/asn1/tasn_dec.c:114:9: Call 112. pval = &ptmpval; 113. asn1_tlc_clear_nc(&c); 114. if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0) ^ 115. return *pval; 116. return NULL; crypto/asn1/tasn_dec.c:119:1: Parameter `**in` 117. } 118. 119. > int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, 120. const ASN1_ITEM *it, 121. int tag, int aclass, char opt, ASN1_TLC *ctx) crypto/asn1/tasn_dec.c:124:10: Call 122. { 123. int rv; 124. rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0); ^ 125. if (rv <= 0) 126. ASN1_item_ex_free(pval, it); crypto/asn1/tasn_dec.c:135:1: Parameter `**in` 133. */ 134. 135. > static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in, 136. long len, const ASN1_ITEM *it, 137. int tag, int aclass, char opt, ASN1_TLC *ctx, crypto/asn1/tasn_dec.c:185:9: Assignment 183. 184. case ASN1_ITYPE_MSTRING: 185. p = *in; ^ 186. /* Just read in tag and class */ 187. ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, crypto/asn1/tasn_dec.c:187:15: Call 185. p = *in; 186. /* Just read in tag and class */ 187. ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, ^ 188. &p, len, -1, 0, 1, ctx); 189. if (!ret) { crypto/asn1/tasn_dec.c:1078:1: Parameter `**in` 1076. */ 1077. 1078. > static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, 1079. char *inf, char *cst, 1080. const unsigned char **in, long len, crypto/asn1/tasn_dec.c:1087:5: Assignment 1085. long plen; 1086. const unsigned char *p, *q; 1087. p = *in; ^ 1088. q = p; 1089. crypto/asn1/tasn_dec.c:1097:13: Call 1095. p += ctx->hdrlen; 1096. } else { 1097. i = ASN1_get_object(&p, &plen, &ptag, &pclass, len); ^ 1098. if (ctx) { 1099. ctx->ret = i; crypto/asn1/asn1_lib.c:44:1: Parameter `**pp` 42. } 43. 44. > int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, 45. int *pclass, long omax) 46. { crypto/asn1/asn1_lib.c:49:5: Assignment 47. int i, ret; 48. long l; 49. const unsigned char *p = *pp; ^ 50. int tag, xclass, inf; 51. long max = omax; crypto/asn1/asn1_lib.c:78:9: Assignment 76. } else { 77. tag = i; 78. p++; ^ 79. if (--max == 0) 80. goto err; crypto/asn1/asn1_lib.c:84:10: Call 82. *ptag = tag; 83. *pclass = xclass; 84. if (!asn1_get_length(&p, &inf, plength, max)) ^ 85. goto err; 86. crypto/asn1/asn1_lib.c:112:1: <Length trace> 110. * are stored most significant digit first. 111. */ 112. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, 113. long max) 114. { crypto/asn1/asn1_lib.c:112:1: Parameter `**pp` 110. * are stored most significant digit first. 111. */ 112. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, 113. long max) 114. { crypto/asn1/asn1_lib.c:115:5: Assignment 113. long max) 114. { 115. const unsigned char *p = *pp; ^ 116. unsigned long ret = 0; 117. int i; crypto/asn1/asn1_lib.c:127:14: Assignment 125. *inf = 0; 126. i = *p & 0x7f; 127. if (*p++ & 0x80) { ^ 128. if (max < i + 1) 129. return 0; crypto/asn1/asn1_lib.c:131:29: Array access: Offset: [2, +oo] Size: [1, +oo] by call to `d2i_DHxparams` 129. return 0; 130. /* Skip leading zeroes */ 131. while (i > 0 && *p == 0) { ^ 132. p++; 133. i--;
https://github.com/openssl/openssl/blob/bcf082d130a413a728a382bd6e6bfdbf2cedba45/crypto/asn1/asn1_lib.c/#L131
d2a_code_trace_data_42328
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ec_lib.c:1049: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_mont`. Showing all 34 steps of the trace crypto/ec/ec_lib.c:1020:1: Parameter `ctx->stack.depth` 1018. } 1019. 1020. > static int ec_field_inverse_mod_ord(const EC_GROUP *group, BIGNUM *r, 1021. const BIGNUM *x, BN_CTX *ctx) 1022. { crypto/ec/ec_lib.c:1033:5: Call 1031. return 0; 1032. 1033. BN_CTX_start(ctx); ^ 1034. if ((e = BN_CTX_get(ctx)) == NULL) 1035. 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/ec/ec_lib.c:1049:10: Call 1047. * No need for scatter-gather or BN_FLG_CONSTTIME. 1048. */ 1049. if (!BN_mod_exp_mont(r, x, e, group->order, ctx, group->mont_data)) ^ 1050. goto err; 1051. 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. { crypto/bn/bn_exp.c:310:16: Call 308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) { 310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 311. } 312. crypto/bn/bn_exp.c:596:1: Parameter `ctx->stack.depth` 594. * http://www.daemonology.net/hyperthreading-considered-harmful/) 595. */ 596. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 597. const BIGNUM *m, BN_CTX *ctx, 598. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:640:5: Call 638. } 639. 640. BN_CTX_start(ctx); ^ 641. 642. /* 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:651:14: Call 649. if ((mont = BN_MONT_CTX_new()) == NULL) 650. goto err; 651. if (!BN_MONT_CTX_set(mont, m, ctx)) ^ 652. goto err; 653. } crypto/bn/bn_mont.c:233:1: Parameter `ctx->stack.depth` 231. } 232. 233. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 234. { 235. int ret = 0; crypto/bn/bn_mont.c:241:5: Call 239. return 0; 240. 241. BN_CTX_start(ctx); ^ 242. if ((Ri = BN_CTX_get(ctx)) == NULL) 243. 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_mont.c:321:19: Call 319. if (BN_is_one(&tmod)) 320. BN_zero(Ri); 321. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 322. goto err; 323. 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:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c: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:190:5: Call 188. } 189. 190. BN_CTX_start(ctx); ^ 191. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 192. 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_div.c:410:5: Call 408. if (no_branch) 409. bn_correct_top(res); 410. BN_CTX_end(ctx); ^ 411. return 1; 412. 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: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_exp_mont` 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/b8c32081e02b7008a90d878eccce46da256dfe86/crypto/bn/bn_ctx.c/#L276
d2a_code_trace_data_42329
int test_div_recp(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; BN_RECP_CTX *recp; int i; recp = BN_RECP_CTX_new(); a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); for (i = 0; i < num0 + num1; i++) { if (i < num1) { BN_bntest_rand(a, 400, 0, 0); BN_copy(b, a); BN_lshift(a, a, i); BN_add_word(a, i); } else BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0); a->neg = rand_neg(); b->neg = rand_neg(); BN_RECP_CTX_set(recp, b, ctx); BN_div_recp(d, c, a, recp, ctx); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " / "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); if (!results) { BN_print(bp, a); BIO_puts(bp, " % "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, c); BIO_puts(bp, "\n"); } BN_mul(e, d, b, ctx); BN_add(d, e, c); BN_sub(d, d, a); if (!BN_is_zero(d)) { fprintf(stderr, "Reciprocal division test failed!\n"); fprintf(stderr, "a="); BN_print_fp(stderr, a); fprintf(stderr, "\nb="); BN_print_fp(stderr, b); fprintf(stderr, "\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); BN_RECP_CTX_free(recp); return (1); } test/bntest.c:630: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 580, column 9 is not reachable after line 630, column 5. Showing all 175 steps of the trace test/bntest.c:571:1: start of procedure test_div_recp() 569. } 570. 571. > int test_div_recp(BIO *bp, BN_CTX *ctx) 572. { 573. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:577:5: 575. int i; 576. 577. > recp = BN_RECP_CTX_new(); 578. a = BN_new(); 579. b = BN_new(); crypto/bn/bn_recp.c:70:1: start of procedure BN_RECP_CTX_new() 68. } 69. 70. > BN_RECP_CTX *BN_RECP_CTX_new(void) 71. { 72. BN_RECP_CTX *ret; crypto/bn/bn_recp.c:74:9: 72. BN_RECP_CTX *ret; 73. 74. > if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) 75. return (NULL); 76. crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/bn/bn_recp.c:74:9: Taking false branch 72. BN_RECP_CTX *ret; 73. 74. if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) ^ 75. return (NULL); 76. crypto/bn/bn_recp.c:77:5: 75. return (NULL); 76. 77. > BN_RECP_CTX_init(ret); 78. ret->flags = BN_FLG_MALLOCED; 79. return (ret); crypto/bn/bn_recp.c:62:1: start of procedure BN_RECP_CTX_init() 60. #include "bn_lcl.h" 61. 62. > void BN_RECP_CTX_init(BN_RECP_CTX *recp) 63. { 64. bn_init(&(recp->N)); crypto/bn/bn_recp.c:64:5: Skipping bn_init(): empty list of specs 62. void BN_RECP_CTX_init(BN_RECP_CTX *recp) 63. { 64. bn_init(&(recp->N)); ^ 65. bn_init(&(recp->Nr)); 66. recp->num_bits = 0; crypto/bn/bn_recp.c:65:5: Skipping bn_init(): empty list of specs 63. { 64. bn_init(&(recp->N)); 65. bn_init(&(recp->Nr)); ^ 66. recp->num_bits = 0; 67. recp->flags = 0; crypto/bn/bn_recp.c:66:5: 64. bn_init(&(recp->N)); 65. bn_init(&(recp->Nr)); 66. > recp->num_bits = 0; 67. recp->flags = 0; 68. } crypto/bn/bn_recp.c:67:5: 65. bn_init(&(recp->Nr)); 66. recp->num_bits = 0; 67. > recp->flags = 0; 68. } 69. crypto/bn/bn_recp.c:68:1: return from a call to BN_RECP_CTX_init 66. recp->num_bits = 0; 67. recp->flags = 0; 68. > } 69. 70. BN_RECP_CTX *BN_RECP_CTX_new(void) crypto/bn/bn_recp.c:78:5: 76. 77. BN_RECP_CTX_init(ret); 78. > ret->flags = BN_FLG_MALLOCED; 79. return (ret); 80. } crypto/bn/bn_recp.c:79:5: 77. BN_RECP_CTX_init(ret); 78. ret->flags = BN_FLG_MALLOCED; 79. > return (ret); 80. } 81. crypto/bn/bn_recp.c:80:1: return from a call to BN_RECP_CTX_new 78. ret->flags = BN_FLG_MALLOCED; 79. return (ret); 80. > } 81. 82. void BN_RECP_CTX_free(BN_RECP_CTX *recp) test/bntest.c:578:5: 576. 577. recp = BN_RECP_CTX_new(); 578. > a = BN_new(); 579. b = BN_new(); 580. 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:579:5: 577. recp = BN_RECP_CTX_new(); 578. a = BN_new(); 579. > b = BN_new(); 580. c = BN_new(); 581. 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:580:5: 578. a = BN_new(); 579. b = BN_new(); 580. > c = BN_new(); 581. d = BN_new(); 582. 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:581:5: 579. b = BN_new(); 580. c = BN_new(); 581. > d = BN_new(); 582. e = BN_new(); 583. 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:582:5: 580. c = BN_new(); 581. d = BN_new(); 582. > e = BN_new(); 583. 584. for (i = 0; i < num0 + num1; i++) { crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:584:10: 582. e = BN_new(); 583. 584. > for (i = 0; i < num0 + num1; i++) { 585. if (i < num1) { 586. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:584:17: Loop condition is false. Leaving loop 582. e = BN_new(); 583. 584. for (i = 0; i < num0 + num1; i++) { ^ 585. if (i < num1) { 586. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:628:5: 626. } 627. } 628. > BN_free(a); 629. BN_free(b); 630. BN_free(c); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:629:5: 627. } 628. BN_free(a); 629. > BN_free(b); 630. BN_free(c); 631. BN_free(d); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:630:5: 628. BN_free(a); 629. BN_free(b); 630. > BN_free(c); 631. BN_free(d); 632. BN_free(e); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L630
d2a_code_trace_data_42330
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; } libavcodec/mss4.c:623: error: Integer Overflow L2 ([1, 2147483616] + 32):signed32 by call to `av_frame_ref`. libavcodec/mss4.c:562:25: Assignment 560. } 561. c->pic->key_frame = (frame_type == INTRA_FRAME); 562. c->pic->pict_type = (frame_type == INTRA_FRAME) ? AV_PICTURE_TYPE_I ^ 563. : AV_PICTURE_TYPE_P; 564. if (frame_type == SKIP_FRAME) { libavcodec/mss4.c:562:5: Assignment 560. } 561. c->pic->key_frame = (frame_type == INTRA_FRAME); 562. c->pic->pict_type = (frame_type == INTRA_FRAME) ? AV_PICTURE_TYPE_I ^ 563. : AV_PICTURE_TYPE_P; 564. if (frame_type == SKIP_FRAME) { libavcodec/mss4.c:623:16: Call 621. } 622. 623. if ((ret = av_frame_ref(data, c->pic)) < 0) ^ 624. return ret; 625. libavutil/frame.c:174:1: Parameter `src->nb_samples` 172. } 173. 174. int av_frame_ref(AVFrame *dst, const AVFrame *src) ^ 175. { 176. int i, ret = 0; libavutil/frame.c:182:5: Assignment 180. dst->height = src->height; 181. dst->channel_layout = src->channel_layout; 182. dst->nb_samples = src->nb_samples; ^ 183. 184. ret = av_frame_copy_props(dst, src); libavutil/frame.c:190:15: Call 188. /* duplicate the frame data if it's not refcounted */ 189. if (!src->buf[0]) { 190. ret = av_frame_get_buffer(dst, 32); ^ 191. if (ret < 0) 192. return ret; libavutil/frame.c:161:1: Parameter `frame->nb_samples` 159. } 160. 161. int av_frame_get_buffer(AVFrame *frame, int align) ^ 162. { 163. if (frame->format < 0) libavutil/frame.c:169:16: Call 167. return get_video_buffer(frame, align); 168. else if (frame->nb_samples > 0 && frame->channel_layout) 169. return get_audio_buffer(frame, align); ^ 170. 171. return AVERROR(EINVAL); libavutil/frame.c:112:1: Parameter `frame->nb_samples` 110. } 111. 112. static int get_audio_buffer(AVFrame *frame, int align) ^ 113. { 114. int channels = av_get_channel_layout_nb_channels(frame->channel_layout); libavutil/frame.c:120:15: Call 118. 119. if (!frame->linesize[0]) { 120. ret = av_samples_get_buffer_size(&frame->linesize[0], channels, ^ 121. frame->nb_samples, frame->format, 122. 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 `av_frame_ref` 122. return AVERROR(EINVAL); 123. align = 1; 124. nb_samples = FFALIGN(nb_samples, 32); ^ 125. } 126.
https://github.com/libav/libav/blob/0e830094ad0dc251613a0aa3234d9c5c397e02e6/libavutil/samplefmt.c/#L124
d2a_code_trace_data_42331
int BN_num_bits_word(BN_ULONG l) { static const unsigned char bits[256] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; #if defined(SIXTY_FOUR_BIT_LONG) if (l & 0xffffffff00000000L) { if (l & 0xffff000000000000L) { if (l & 0xff00000000000000L) { return (bits[(int)(l >> 56)] + 56); } else return (bits[(int)(l >> 48)] + 48); } else { if (l & 0x0000ff0000000000L) { return (bits[(int)(l >> 40)] + 40); } else return (bits[(int)(l >> 32)] + 32); } } else #else # ifdef SIXTY_FOUR_BIT if (l & 0xffffffff00000000LL) { if (l & 0xffff000000000000LL) { if (l & 0xff00000000000000LL) { return (bits[(int)(l >> 56)] + 56); } else return (bits[(int)(l >> 48)] + 48); } else { if (l & 0x0000ff0000000000LL) { return (bits[(int)(l >> 40)] + 40); } else return (bits[(int)(l >> 32)] + 32); } } else # endif #endif { #if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG) if (l & 0xffff0000L) { if (l & 0xff000000L) return (bits[(int)(l >> 24L)] + 24); else return (bits[(int)(l >> 16L)] + 16); } else #endif { #if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG) if (l & 0xff00L) return (bits[(int)(l >> 8)] + 8); else #endif return (bits[(int)(l)]); } } } test/bntest.c:1282: error: BUFFER_OVERRUN_L2 Offset: [0, 18446744073709551615] Size: 256 by call to `BN_div_word`. Showing all 14 steps of the trace test/bntest.c:1263:10: Call 1261. goto err; 1262. 1263. if (!TEST_true(BN_div(ret, ret2, a, b, ctx)) ^ 1264. || !equalBN("A / B", quotient, ret) 1265. || !equalBN("A % B", remainder, ret2) crypto/bn/bn_div.c:137:1: Parameter `*dv->d` 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. { test/bntest.c:1275:14: Call 1273. * small enough. 1274. */ 1275. b_word = BN_get_word(b); ^ 1276. if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) { 1277. BN_ULONG remainder_word = BN_get_word(remainder); crypto/bn/bn_lib.c:377:9: Assignment 375. { 376. if (a->top > 1) 377. return BN_MASK2; ^ 378. else if (a->top == 1) 379. return a->d[0]; test/bntest.c:1275:5: Assignment 1273. * small enough. 1274. */ 1275. b_word = BN_get_word(b); ^ 1276. if (!BN_is_negative(b) && b_word != (BN_ULONG)-1) { 1277. BN_ULONG remainder_word = BN_get_word(remainder); test/bntest.c:1282:20: Call 1280. if (!TEST_ptr(BN_copy(ret, a))) 1281. goto err; 1282. ret_word = BN_div_word(ret, b_word); ^ 1283. if (ret_word != remainder_word) { 1284. #ifdef BN_DEC_FMT1 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:89:1: <Offset trace> 87. } 88. 89. > int BN_num_bits_word(BN_ULONG l) 90. { 91. static const unsigned char bits[256] = { crypto/bn/bn_lib.c:89:1: Parameter `l` 87. } 88. 89. > int BN_num_bits_word(BN_ULONG l) 90. { 91. static const unsigned char bits[256] = { crypto/bn/bn_lib.c:91:5: <Length trace> 89. int BN_num_bits_word(BN_ULONG l) 90. { 91. static const unsigned char bits[256] = { ^ 92. 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 93. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, crypto/bn/bn_lib.c:91:5: Array declaration 89. int BN_num_bits_word(BN_ULONG l) 90. { 91. static const unsigned char bits[256] = { ^ 92. 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 93. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, crypto/bn/bn_lib.c:114:25: Array access: Offset: [0, 18446744073709551615] Size: 256 by call to `BN_div_word` 112. if (l & 0xffff000000000000L) { 113. if (l & 0xff00000000000000L) { 114. return (bits[(int)(l >> 56)] + 56); ^ 115. } else 116. return (bits[(int)(l >> 48)] + 48);
https://github.com/openssl/openssl/blob/3c5a61dd0f9d9a9eac098419bcaf47d1c296ca81/crypto/bn/bn_lib.c/#L114
d2a_code_trace_data_42332
static void ff_rdft_calc_c(RDFTContext* s, FFTSample* data) { int i, i1, i2; FFTComplex ev, od; const int n = 1 << s->nbits; const float k1 = 0.5; const float k2 = 0.5 - s->inverse; const FFTSample *tcos = s->tcos; const FFTSample *tsin = s->tsin; if (!s->inverse) { ff_fft_permute(&s->fft, (FFTComplex*)data); ff_fft_calc(&s->fft, (FFTComplex*)data); } ev.re = data[0]; data[0] = ev.re+data[1]; data[1] = ev.re-data[1]; for (i = 1; i < (n>>2); i++) { i1 = 2*i; i2 = n-i1; ev.re = k1*(data[i1 ]+data[i2 ]); od.im = -k2*(data[i1 ]-data[i2 ]); ev.im = k1*(data[i1+1]-data[i2+1]); od.re = k2*(data[i1+1]+data[i2+1]); data[i1 ] = ev.re + od.re*tcos[i] - od.im*tsin[i]; data[i1+1] = ev.im + od.im*tcos[i] + od.re*tsin[i]; data[i2 ] = ev.re - od.re*tcos[i] + od.im*tsin[i]; data[i2+1] = -ev.im + od.im*tcos[i] + od.re*tsin[i]; } data[2*i+1]=s->sign_convention*data[2*i+1]; if (s->inverse) { data[0] *= k1; data[1] *= k1; ff_fft_permute(&s->fft, (FFTComplex*)data); ff_fft_calc(&s->fft, (FFTComplex*)data); } } libavcodec/qdm2.c:1918: error: Buffer Overrun L1 Offset: [2, +oo] (⇐ [0, `q->channels` - 1] + [2, +oo]) Size: 2 by call to `qdm2_calculate_fft`. libavcodec/qdm2.c:1886:1: Parameter `q->channels` 1884. 1885. 1886. static void qdm2_decode (QDM2Context *q, const uint8_t *in, int16_t *out) ^ 1887. { 1888. int ch, i; libavcodec/qdm2.c:1918:9: Call 1916. /* sound synthesis stage 1 (FFT) */ 1917. for (ch = 0; ch < q->channels; ch++) { 1918. qdm2_calculate_fft(q, ch, q->sub_packet); ^ 1919. 1920. if (!q->has_errors && q->sub_packet_list_C[0].packet != NULL) { libavcodec/qdm2.c:1585:1: Parameter `channel` 1583. 1584. 1585. static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet) ^ 1586. { 1587. const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f; libavcodec/qdm2.c:1591:5: Call 1589. q->fft.complex[channel][0].re *= 2.0f; 1590. q->fft.complex[channel][0].im = 0.0f; 1591. ff_rdft_calc(&q->rdft_ctx, (FFTSample *)q->fft.complex[channel]); ^ 1592. /* add samples to output buffer */ 1593. for (i = 0; i < ((q->fft_frame_size + 15) & ~15); i++) libavcodec/rdft.c:126:1: Parameter `*data` 124. } 125. 126. void ff_rdft_calc(RDFTContext *s, FFTSample *data) ^ 127. { 128. ff_rdft_calc_c(s, data); libavcodec/rdft.c:128:5: Call 126. void ff_rdft_calc(RDFTContext *s, FFTSample *data) 127. { 128. ff_rdft_calc_c(s, data); ^ 129. } 130. libavcodec/rdft.c:103:10: <Offset trace> 101. data[0] = ev.re+data[1]; 102. data[1] = ev.re-data[1]; 103. for (i = 1; i < (n>>2); i++) { ^ 104. i1 = 2*i; 105. i2 = n-i1; libavcodec/rdft.c:103:10: Assignment 101. data[0] = ev.re+data[1]; 102. data[1] = ev.re-data[1]; 103. for (i = 1; i < (n>>2); i++) { ^ 104. i1 = 2*i; 105. i2 = n-i1; libavcodec/rdft.c:104:9: Assignment 102. data[1] = ev.re-data[1]; 103. for (i = 1; i < (n>>2); i++) { 104. i1 = 2*i; ^ 105. i2 = n-i1; 106. /* Separate even and odd FFTs */ libavcodec/rdft.c:84:1: <Length trace> 82. * ref: http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM 83. */ 84. static void ff_rdft_calc_c(RDFTContext* s, FFTSample* data) ^ 85. { 86. int i, i1, i2; libavcodec/rdft.c:84:1: Parameter `*data` 82. * ref: http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM 83. */ 84. static void ff_rdft_calc_c(RDFTContext* s, FFTSample* data) ^ 85. { 86. int i, i1, i2; libavcodec/rdft.c:107:22: Array access: Offset: [2, +oo] (⇐ [0, q->channels - 1] + [2, +oo]) Size: 2 by call to `qdm2_calculate_fft` 105. i2 = n-i1; 106. /* Separate even and odd FFTs */ 107. ev.re = k1*(data[i1 ]+data[i2 ]); ^ 108. od.im = -k2*(data[i1 ]-data[i2 ]); 109. ev.im = k1*(data[i1+1]-data[i2+1]);
https://github.com/libav/libav/blob/b297129bdb0e779824db9b50440570212df58353/libavcodec/rdft.c/#L107
d2a_code_trace_data_42333
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_exp.c:1215: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_to_montgomery`. Showing all 22 steps of the trace 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. { crypto/bn/bn_exp.c:1189:5: Call 1187. } 1188. 1189. BN_CTX_start(ctx); ^ 1190. r = BN_CTX_get(ctx); 1191. t = 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:1190:9: Call 1188. 1189. BN_CTX_start(ctx); 1190. r = BN_CTX_get(ctx); ^ 1191. t = BN_CTX_get(ctx); 1192. 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_exp.c:1191:9: Call 1189. BN_CTX_start(ctx); 1190. r = BN_CTX_get(ctx); 1191. t = BN_CTX_get(ctx); ^ 1192. if (t == NULL) 1193. 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:1215:22: Call 1213. if ((next_w / w) != w) { /* overflow */ 1214. if (r_is_one) { 1215. if (!BN_TO_MONTGOMERY_WORD(r, w, mont)) ^ 1216. goto err; 1217. r_is_one = 0; crypto/bn/bn_lib.c:889:1: Parameter `ctx->stack.depth` 887. } 888. 889. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 890. BN_CTX *ctx) 891. { crypto/bn/bn_lib.c:892:12: Call 890. BN_CTX *ctx) 891. { 892. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 893. } 894. crypto/bn/bn_mont.c:26:1: Parameter `ctx->stack.depth` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:29:15: Call 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { 29. int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx); ^ 30. 31. bn_correct_top(r); crypto/bn/bn_mont.c:60:5: Call 58. return 0; 59. 60. BN_CTX_start(ctx); ^ 61. tmp = BN_CTX_get(ctx); 62. if (tmp == NULL) crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mont.c:83:5: Call 81. ret = 1; 82. err: 83. BN_CTX_end(ctx); ^ 84. return ret; 85. } crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_to_montgomery` 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_42334
void avfilter_unref_buffer(AVFilterBufferRef *ref) { if (!ref) return; if (!(--ref->buf->refcount)) ref->buf->free(ref->buf); if (ref->extended_data != ref->data) av_freep(&ref->extended_data); av_free(ref->video); av_free(ref->audio); av_free(ref); } libavfilter/vf_crop.c:320: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer`. libavfilter/vf_crop.c:320:5: Call 318. 319. crop->var_values[VAR_N] += 1.0; 320. avfilter_unref_buffer(link->cur_buf); ^ 321. ff_end_frame(link->dst->outputs[0]); 322. } libavfilter/buffer.c:74:1: <LHS trace> 72. } 73. 74. void avfilter_unref_buffer(AVFilterBufferRef *ref) ^ 75. { 76. if (!ref) libavfilter/buffer.c:74:1: Parameter `ref->buf->refcount` 72. } 73. 74. void avfilter_unref_buffer(AVFilterBufferRef *ref) ^ 75. { 76. if (!ref) libavfilter/buffer.c:78:11: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 76. if (!ref) 77. return; 78. if (!(--ref->buf->refcount)) ^ 79. ref->buf->free(ref->buf); 80. if (ref->extended_data != ref->data)
https://github.com/libav/libav/blob/533fd5b5b468131cfe164455783c351eb69af657/libavfilter/buffer.c/#L78
d2a_code_trace_data_42335
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } apps/s_time.c:422: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 16 steps of the trace apps/s_time.c:385:21: Call 383. 384. if (scon == NULL) 385. serverCon = SSL_new(ctx); ^ 386. else { 387. serverCon = scon; ssl/ssl_lib.c:518:1: Parameter `ctx->sessions->num_items` 516. } 517. 518. > SSL *SSL_new(SSL_CTX *ctx) 519. { 520. SSL *s; apps/s_time.c:422:13: Call 420. ERR_print_errors(bio_err); 421. if (scon == NULL) 422. SSL_free(serverCon); ^ 423. return NULL; 424. } ssl/ssl_lib.c:926:1: Parameter `s->initial_ctx->sessions->num_items` 924. } 925. 926. > void SSL_free(SSL *s) 927. { 928. int i; ssl/ssl_lib.c:963:9: Call 961. /* Make the next call work :-) */ 962. if (s->session != NULL) { 963. ssl_clear_bad_session(s); ^ 964. SSL_SESSION_free(s->session); 965. } ssl/ssl_sess.c:992:1: Parameter `s->initial_ctx->sessions->num_items` 990. } 991. 992. > int ssl_clear_bad_session(SSL *s) 993. { 994. if ((s->session != NULL) && ssl/ssl_sess.c:997:9: Call 995. !(s->shutdown & SSL_SENT_SHUTDOWN) && 996. !(SSL_in_init(s) || SSL_in_before(s))) { 997. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 998. return (1); 999. } else 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, +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/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_42336
void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]) { #ifdef POLY1305_ASM poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks; poly1305_emit_f poly1305_emit_p = ctx->func.emit; #endif size_t num; if ((num = ctx->num)) { ctx->data[num++] = 1; while (num < POLY1305_BLOCK_SIZE) ctx->data[num++] = 0; poly1305_blocks(ctx->opaque, ctx->data, POLY1305_BLOCK_SIZE, 0); } poly1305_emit(ctx->opaque, mac, ctx->nonce); memset(ctx, 0, sizeof(*ctx)); } crypto/evp/e_chacha20_poly1305.c:330: error: BUFFER_OVERRUN_L2 Offset: [1, 70+max(1, `ctx->cipher_data->num`)] Size: 16 by call to `Poly1305_Final`. Showing all 11 steps of the trace crypto/evp/e_chacha20_poly1305.c:233:1: Parameter `ctx->cipher_data->num` 231. } 232. 233. > static int chacha20_poly1305_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 234. const unsigned char *in, size_t len) 235. { crypto/evp/e_chacha20_poly1305.c:307:13: Call 305. 306. if (is_endian.little) { 307. Poly1305_Update(POLY1305_ctx(actx), ^ 308. (unsigned char *)&actx->len, POLY1305_BLOCK_SIZE); 309. } else { crypto/poly1305/poly1305.c:466:1: Parameter `len` 464. #endif 465. 466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 467. { 468. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:489:13: Assignment 487. /* Still not enough data to process a block. */ 488. memcpy(ctx->data + num, inp, len); 489. ctx->num = num + len; ^ 490. return; 491. } crypto/evp/e_chacha20_poly1305.c:330:9: Call 328. Poly1305_Update(POLY1305_ctx(actx), temp, POLY1305_BLOCK_SIZE); 329. } 330. Poly1305_Final(POLY1305_ctx(actx), ctx->encrypt ? actx->tag ^ 331. : temp); 332. actx->mac_inited = 0; crypto/poly1305/poly1305.c:508:1: <Offset trace> 506. } 507. 508. > void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]) 509. { 510. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:508:1: Parameter `ctx->num` 506. } 507. 508. > void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]) 509. { 510. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:516:10: Assignment 514. size_t num; 515. 516. if ((num = ctx->num)) { ^ 517. ctx->data[num++] = 1; /* pad bit */ 518. while (num < POLY1305_BLOCK_SIZE) crypto/poly1305/poly1305.c:508:1: <Length trace> 506. } 507. 508. > void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]) 509. { 510. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:508:1: Parameter `ctx->data[*]` 506. } 507. 508. > void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16]) 509. { 510. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:517:9: Array access: Offset: [1, 70+max(1, ctx->cipher_data->num)] Size: 16 by call to `Poly1305_Final` 515. 516. if ((num = ctx->num)) { 517. ctx->data[num++] = 1; /* pad bit */ ^ 518. while (num < POLY1305_BLOCK_SIZE) 519. ctx->data[num++] = 0;
https://github.com/openssl/openssl/blob/740b2b9a6cf31b02916a4d18f868e8a95934c083/crypto/poly1305/poly1305.c/#L517
d2a_code_trace_data_42337
PROXY_DECLARE(int) ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p) { char *addr = This->name; int i; if (addr[0] != '.') { return 0; } for (i = 0; apr_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i) { continue; } #if 0 if (addr[i] == ':') { ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, "@@@@ handle optional port in proxy_is_domainname()"); } #endif if (addr[i] != '\0') { return 0; } for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; --i) { addr[i] = '\0'; } This->matcher = proxy_match_domainname; return 1; } modules/proxy/mod_proxy.c:1657: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `ap_proxy_is_domainname`. modules/proxy/mod_proxy.c:1649:9: Call 1647. New->hostaddr = NULL; 1648. 1649. if (ap_proxy_is_ipaddr(New, parms->pool)) { ^ 1650. #if DEBUGGING 1651. ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, modules/proxy/proxy_util.c:413:1: Parameter `This->mask.s_addr` 411. 412. /* Return TRUE if addr represents an IP address (or an IP network address) */ 413. PROXY_DECLARE(int) ap_proxy_is_ipaddr(struct dirconn_entry *This, apr_pool_t *p) ^ 414. { 415. const char *addr = This->name; modules/proxy/mod_proxy.c:1657:14: Call 1655. #endif 1656. } 1657. else if (ap_proxy_is_domainname(New, parms->pool)) { ^ 1658. ap_str_tolower(New->name); 1659. #if DEBUGGING modules/proxy/proxy_util.c:622:1: <LHS trace> 620. 621. /* Return TRUE if addr represents a domain name */ 622. PROXY_DECLARE(int) ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p) ^ 623. { 624. char *addr = This->name; modules/proxy/proxy_util.c:622:1: Parameter `This->name->strlen` 620. 621. /* Return TRUE if addr represents a domain name */ 622. PROXY_DECLARE(int) ap_proxy_is_domainname(struct dirconn_entry *This, apr_pool_t *p) ^ 623. { 624. char *addr = This->name; modules/proxy/proxy_util.c:650:10: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ap_proxy_is_domainname` 648. 649. /* Strip trailing dots */ 650. for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; --i) { ^ 651. addr[i] = '\0'; 652. }
https://github.com/apache/httpd/blob/8b2ec33ac5d314be345814db08e194ffeda6beb0/modules/proxy/proxy_util.c/#L650
d2a_code_trace_data_42338
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/bio_ssl.c:82: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 14 steps of the trace ssl/bio_ssl.c:82:13: Call 80. if (BIO_get_shutdown(a)) { 81. if (BIO_get_init(a)) 82. SSL_free(bs->ssl); ^ 83. /* Clear all flags */ 84. BIO_clear_flags(a, ~0); ssl/ssl_lib.c:968:1: Parameter `s->session_ctx->sessions->num_items` 966. } 967. 968. > void SSL_free(SSL *s) 969. { 970. int i; ssl/ssl_lib.c:999:9: Call 997. /* Make the next call work :-) */ 998. if (s->session != NULL) { 999. ssl_clear_bad_session(s); ^ 1000. SSL_SESSION_free(s->session); 1001. } ssl/ssl_sess.c:1049:1: Parameter `s->session_ctx->sessions->num_items` 1047. } 1048. 1049. > int ssl_clear_bad_session(SSL *s) 1050. { 1051. if ((s->session != NULL) && ssl/ssl_sess.c:1054:9: Call 1052. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1053. !(SSL_in_init(s) || SSL_in_before(s))) { 1054. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1055. return (1); 1056. } else 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, +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/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_42339
int RAND_bytes(unsigned char *buf, int num) { const RAND_METHOD *meth = RAND_get_rand_method(); if (meth->bytes != NULL) return meth->bytes(buf, num); RANDerr(RAND_F_RAND_BYTES, RAND_R_FUNC_NOT_IMPLEMENTED); return -1; } crypto/rand/rand_lib.c:824: error: NULL_DEREFERENCE pointer `meth` last assigned on line 822 could be null and is dereferenced at line 824, column 9. Showing all 14 steps of the trace crypto/rand/rand_lib.c:820:1: start of procedure RAND_bytes() 818. } 819. 820. > int RAND_bytes(unsigned char *buf, int num) 821. { 822. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:822:5: 820. int RAND_bytes(unsigned char *buf, int num) 821. { 822. > const RAND_METHOD *meth = RAND_get_rand_method(); 823. 824. if (meth->bytes != NULL) crypto/rand/rand_lib.c:726:1: start of procedure RAND_get_rand_method() 724. } 725. 726. > const RAND_METHOD *RAND_get_rand_method(void) 727. { 728. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:728:5: 726. const RAND_METHOD *RAND_get_rand_method(void) 727. { 728. > const RAND_METHOD *tmp_meth = NULL; 729. 730. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:730:10: 728. const RAND_METHOD *tmp_meth = NULL; 729. 730. > if (!RUN_ONCE(&rand_init, do_rand_init)) 731. return NULL; 732. 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:730:10: Condition is false 728. const RAND_METHOD *tmp_meth = NULL; 729. 730. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 731. return NULL; 732. crypto/rand/rand_lib.c:730:10: Taking true branch 728. const RAND_METHOD *tmp_meth = NULL; 729. 730. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 731. return NULL; 732. crypto/rand/rand_lib.c:731:9: 729. 730. if (!RUN_ONCE(&rand_init, do_rand_init)) 731. > return NULL; 732. 733. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:754:1: return from a call to RAND_get_rand_method 752. CRYPTO_THREAD_unlock(rand_meth_lock); 753. return tmp_meth; 754. > } 755. 756. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:824:9: 822. const RAND_METHOD *meth = RAND_get_rand_method(); 823. 824. > if (meth->bytes != NULL) 825. return meth->bytes(buf, num); 826. RANDerr(RAND_F_RAND_BYTES, RAND_R_FUNC_NOT_IMPLEMENTED);
https://github.com/openssl/openssl/blob/9bba2c4c97a5fc5aea9e24223eebb85a15817e74/crypto/rand/rand_lib.c/#L824
d2a_code_trace_data_42340
static void truespeech_apply_twopoint_filter(TSContext *dec, int quart) { int16_t tmp[146 + 60], *ptr0, *ptr1; const int16_t *filter; int i, t, off; t = dec->offset2[quart]; if(t == 127){ memset(dec->newvec, 0, 60 * 2); return; } for(i = 0; i < 146; i++) tmp[i] = dec->filtbuf[i]; off = (t / 25) + dec->offset1[quart >> 1] + 18; ptr0 = tmp + 145 - off; ptr1 = tmp + 146; filter = (const int16_t*)ts_240 + (t % 25) * 2; for(i = 0; i < 60; i++){ t = (ptr0[0] * filter[0] + ptr0[1] * filter[1] + 0x2000) >> 14; ptr0++; dec->newvec[i] = t; ptr1[i] = t; } } libavcodec/truespeech.c:199: error: Buffer Overrun L3 Offset added: 120 Size: [0, +oo]. libavcodec/truespeech.c:191:1: <Length trace> 189. } 190. 191. static void truespeech_apply_twopoint_filter(TSContext *dec, int quart) ^ 192. { 193. int16_t tmp[146 + 60], *ptr0, *ptr1; libavcodec/truespeech.c:191:1: Parameter `dec->newvec[*]` 189. } 190. 191. static void truespeech_apply_twopoint_filter(TSContext *dec, int quart) ^ 192. { 193. int16_t tmp[146 + 60], *ptr0, *ptr1; libavcodec/truespeech.c:199:9: Array access: Offset added: 120 Size: [0, +oo] 197. t = dec->offset2[quart]; 198. if(t == 127){ 199. memset(dec->newvec, 0, 60 * 2); ^ 200. return; 201. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/truespeech.c/#L199
d2a_code_trace_data_42341
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_header_filter_module.c:498: error: Buffer Overrun L3 Offset: [0, 196613] Size: [0, +oo] by call to `ngx_http_time`. src/http/ngx_http_header_filter_module.c:430:5: Assignment 428. 429. /* "HTTP/1.x " */ 430. b->last = ngx_cpymem(b->last, "HTTP/1.1 ", sizeof("HTTP/1.x ") - 1); ^ 431. 432. /* status line */ src/http/ngx_http_header_filter_module.c:498:19: Call 496. b->last = ngx_cpymem(b->last, "Last-Modified: ", 497. sizeof("Last-Modified: ") - 1); 498. b->last = ngx_http_time(b->last, r->headers_out.last_modified_time); ^ 499. 500. *b->last++ = CR; *b->last++ = LF; src/core/ngx_times.c:154:1: Parameter `*buf` 152. 153. 154. u_char * ^ 155. ngx_http_time(u_char *buf, time_t t) 156. { src/core/ngx_times.c:161:12: Call 159. ngx_gmtime(t, &tm); 160. 161. return ngx_sprintf(buf, "%s, %02d %s %4d %02d:%02d:%02d GMT", ^ 162. week[tm.ngx_tm_wday], 163. tm.ngx_tm_mday, 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, 196613] Size: [0, +oo] by call to `ngx_http_time` 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_42342
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/bntest.c:421: error: BUFFER_OVERRUN_L2 Offset: [-15, 536870911] (⇐ [0, 1] + [-15, 536870910]) Size: 129 by call to `BN_hex2bn`. Showing all 7 steps of the trace test/bntest.c:421:5: Call 419. "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 420. "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); 421. BN_hex2bn(&n, ^ 422. "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 423. "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); 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:164:5: Assignment 162. goto err; 163. 164. j = i; /* least significant 'hex' */ ^ 165. m = 0; 166. h = 0; 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:171:17: Array access: Offset: [-15, 536870911] (⇐ [0, 1] + [-15, 536870910]) Size: 129 by call to `BN_hex2bn` 169. l = 0; 170. for (;;) { 171. c = a[j - m]; ^ 172. k = OPENSSL_hexchar2int(c); 173. if (k < 0)
https://github.com/openssl/openssl/blob/f91e026e38321d0c154f535ecd5af09e424e7f1b/crypto/bn/bn_print.c/#L171
d2a_code_trace_data_42343
int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, size_t len, size_t *secret_size) { static const unsigned char *salt[3] = { #ifndef CHARSET_EBCDIC (const unsigned char *)"A", (const unsigned char *)"BB", (const unsigned char *)"CCC", #else (const unsigned char *)"\x41", (const unsigned char *)"\x42\x42", (const unsigned char *)"\x43\x43\x43", #endif }; unsigned char buf[EVP_MAX_MD_SIZE]; EVP_MD_CTX *ctx = EVP_MD_CTX_new(); int i, ret = 1; unsigned int n; size_t ret_secret_size = 0; if (ctx == NULL) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_MALLOC_FAILURE); return 0; } for (i = 0; i < 3; i++) { if (EVP_DigestInit_ex(ctx, s->ctx->sha1, NULL) <= 0 || EVP_DigestUpdate(ctx, salt[i], strlen((const char *)salt[i])) <= 0 || EVP_DigestUpdate(ctx, p, len) <= 0 || EVP_DigestUpdate(ctx, &(s->s3->client_random[0]), SSL3_RANDOM_SIZE) <= 0 || EVP_DigestUpdate(ctx, &(s->s3->server_random[0]), SSL3_RANDOM_SIZE) <= 0 || EVP_DigestFinal_ex(ctx, buf, &n) <= 0 || EVP_DigestInit_ex(ctx, s->ctx->md5, NULL) <= 0 || EVP_DigestUpdate(ctx, p, len) <= 0 || EVP_DigestUpdate(ctx, buf, n) <= 0 || EVP_DigestFinal_ex(ctx, out, &n) <= 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_INTERNAL_ERROR); ret = 0; break; } out += n; ret_secret_size += n; } EVP_MD_CTX_free(ctx); OPENSSL_cleanse(buf, sizeof(buf)); if (ret) *secret_size = ret_secret_size; return ret; } ssl/s3_enc.c:520: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 487, column 23 is not reachable after line 520, column 5. Showing all 44 steps of the trace ssl/s3_enc.c:472:1: start of procedure ssl3_generate_master_secret() 470. } 471. 472. > int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, 473. size_t len, size_t *secret_size) 474. { ssl/s3_enc.c:475:5: 473. size_t len, size_t *secret_size) 474. { 475. > static const unsigned char *salt[3] = { 476. #ifndef CHARSET_EBCDIC 477. (const unsigned char *)"A", ssl/s3_enc.c:487:5: 485. }; 486. unsigned char buf[EVP_MAX_MD_SIZE]; 487. > EVP_MD_CTX *ctx = EVP_MD_CTX_new(); 488. int i, ret = 1; 489. unsigned int n; 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:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking true branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:234:9: 232. FAILTEST(); 233. if (ret != NULL) 234. > memset(ret, 0, num); 235. return ret; 236. } crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 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) ssl/s3_enc.c:488:5: 486. unsigned char buf[EVP_MAX_MD_SIZE]; 487. EVP_MD_CTX *ctx = EVP_MD_CTX_new(); 488. > int i, ret = 1; 489. unsigned int n; 490. size_t ret_secret_size = 0; ssl/s3_enc.c:490:5: 488. int i, ret = 1; 489. unsigned int n; 490. > size_t ret_secret_size = 0; 491. 492. if (ctx == NULL) { ssl/s3_enc.c:492:9: Taking false branch 490. size_t ret_secret_size = 0; 491. 492. if (ctx == NULL) { ^ 493. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_GENERATE_MASTER_SECRET, 494. ERR_R_MALLOC_FAILURE); ssl/s3_enc.c:497:10: 495. return 0; 496. } 497. > for (i = 0; i < 3; i++) { 498. if (EVP_DigestInit_ex(ctx, s->ctx->sha1, NULL) <= 0 499. || EVP_DigestUpdate(ctx, salt[i], ssl/s3_enc.c:497:17: Loop condition is true. Entering loop body 495. return 0; 496. } 497. for (i = 0; i < 3; i++) { ^ 498. if (EVP_DigestInit_ex(ctx, s->ctx->sha1, NULL) <= 0 499. || EVP_DigestUpdate(ctx, salt[i], ssl/s3_enc.c:498:13: Taking true branch 496. } 497. for (i = 0; i < 3; i++) { 498. if (EVP_DigestInit_ex(ctx, s->ctx->sha1, NULL) <= 0 ^ 499. || EVP_DigestUpdate(ctx, salt[i], 500. strlen((const char *)salt[i])) <= 0 ssl/s3_enc.c:512:13: 510. || EVP_DigestUpdate(ctx, buf, n) <= 0 511. || EVP_DigestFinal_ex(ctx, out, &n) <= 0) { 512. > SSLfatal(s, SSL_AD_INTERNAL_ERROR, 513. SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_INTERNAL_ERROR); 514. ret = 0; test/tls13secretstest.c:210:1: start of procedure ossl_statem_fatal() 208. } 209. 210. > void ossl_statem_fatal(SSL *s, int al, int func, int reason, const char *file, 211. int line) 212. { test/tls13secretstest.c:213:1: return from a call to ossl_statem_fatal 211. int line) 212. { 213. > } 214. 215. int ossl_statem_export_allowed(SSL *s) ssl/s3_enc.c:514:13: 512. SSLfatal(s, SSL_AD_INTERNAL_ERROR, 513. SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_INTERNAL_ERROR); 514. > ret = 0; 515. break; 516. } ssl/s3_enc.c:520:5: 518. ret_secret_size += n; 519. } 520. > EVP_MD_CTX_free(ctx); 521. 522. OPENSSL_cleanse(buf, sizeof(buf)); 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:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:298:30: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); ^ 300. return; 301. } crypto/mem.c:300:9: 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); 300. > return; 301. } 302. crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) 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/f39276fdff6ccc1c71bdb30a8050fa1c0bf6e20a/ssl/s3_enc.c/#L520
d2a_code_trace_data_42344
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/tls13encryptiontest.c:396: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 16 steps of the trace test/tls13encryptiontest.c:316:9: Call 314. } 315. 316. s = SSL_new(ctx); ^ 317. if (!TEST_ptr(s)) { 318. TEST_info("Failed creating SSL"); ssl/ssl_lib.c:522:1: Parameter `ctx->sessions->num_items` 520. } 521. 522. > SSL *SSL_new(SSL_CTX *ctx) 523. { 524. SSL *s; test/tls13encryptiontest.c:396:5: Call 394. OPENSSL_free(iv); 395. OPENSSL_free(seq); 396. SSL_free(s); ^ 397. SSL_CTX_free(ctx); 398. return ret; ssl/ssl_lib.c:968:1: Parameter `s->session_ctx->sessions->num_items` 966. } 967. 968. > void SSL_free(SSL *s) 969. { 970. int i; ssl/ssl_lib.c:999:9: Call 997. /* Make the next call work :-) */ 998. if (s->session != NULL) { 999. ssl_clear_bad_session(s); ^ 1000. SSL_SESSION_free(s->session); 1001. } ssl/ssl_sess.c:1049:1: Parameter `s->session_ctx->sessions->num_items` 1047. } 1048. 1049. > int ssl_clear_bad_session(SSL *s) 1050. { 1051. if ((s->session != NULL) && ssl/ssl_sess.c:1054:9: Call 1052. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1053. !(SSL_in_init(s) || SSL_in_before(s))) { 1054. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1055. return (1); 1056. } else 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, +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/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_42345
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; } ssl/tls_srp.c:306: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `SRP_Calc_client_key`. Showing all 26 steps of the trace ssl/tls_srp.c:279:1: Parameter `s->srp_ctx.N->top` 277. 278. /* client side */ 279. > int srp_generate_client_master_secret(SSL *s) 280. { 281. BIGNUM *x = NULL, *u = NULL, *K = NULL; ssl/tls_srp.c:289:9: Call 287. * Checks if b % n == 0 288. */ 289. if (SRP_Verify_B_mod_N(s->srp_ctx.B, s->srp_ctx.N) == 0 ^ 290. || (u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)) 291. == NULL crypto/srp/srp_lib.c:218:1: Parameter `N->top` 216. } 217. 218. > int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N) 219. { 220. BIGNUM *r; ssl/tls_srp.c:290:21: Call 288. */ 289. if (SRP_Verify_B_mod_N(s->srp_ctx.B, s->srp_ctx.N) == 0 290. || (u = SRP_Calc_u(s->srp_ctx.A, s->srp_ctx.B, s->srp_ctx.N)) ^ 291. == NULL 292. || s->srp_ctx.SRP_give_srp_client_pwd_callback == NULL) { crypto/srp/srp_lib.c:52:1: Parameter `N->top` 50. } 51. 52. > BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N) 53. { 54. /* u = SHA1(PAD(A) || PAD(B) ) -- tls-srp RFC 5054 */ crypto/srp/srp_lib.c:55:12: Call 53. { 54. /* u = SHA1(PAD(A) || PAD(B) ) -- tls-srp RFC 5054 */ 55. return srp_Calc_xy(A, B, N); ^ 56. } 57. crypto/srp/srp_lib.c:23:1: Parameter `N->top` 21. /* calculate = SHA1(PAD(x) || PAD(y)) */ 22. 23. > static BIGNUM *srp_Calc_xy(const BIGNUM *x, const BIGNUM *y, const BIGNUM *N) 24. { 25. unsigned char digest[SHA_DIGEST_LENGTH]; crypto/srp/srp_lib.c:27:16: Call 25. unsigned char digest[SHA_DIGEST_LENGTH]; 26. unsigned char *tmp = NULL; 27. int numN = BN_num_bytes(N); ^ 28. BIGNUM *res = NULL; 29. crypto/bn/bn_lib.c:140:9: Call 138. bn_check_top(a); 139. 140. if (BN_is_zero(a)) ^ 141. return 0; 142. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); crypto/bn/bn_lib.c:843:1: Parameter `a->top` 841. } 842. 843. > int BN_is_zero(const BIGNUM *a) 844. { 845. return a->top == 0; ssl/tls_srp.c:306:21: Call 304. } 305. if ((x = SRP_Calc_x(s->srp_ctx.s, s->srp_ctx.login, passwd)) == NULL 306. || (K = SRP_Calc_client_key(s->srp_ctx.N, s->srp_ctx.B, ^ 307. s->srp_ctx.g, x, 308. s->srp_ctx.a, u)) == NULL) { crypto/srp/srp_lib.c:176:1: Parameter `N->top` 174. } 175. 176. > BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g, 177. const BIGNUM *x, const BIGNUM *a, const BIGNUM *u) 178. { crypto/srp/srp_lib.c:191:10: Call 189. goto err; 190. 191. if (!BN_mod_exp(tmp, g, x, N, bn_ctx)) ^ 192. goto err; 193. if ((k = srp_Calc_k(N, g)) == NULL) crypto/bn/bn_exp.c:89:1: Parameter `m->top` 87. } 88. 89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 90. BN_CTX *ctx) 91. { crypto/bn/bn_exp.c:134:9: Call 132. 133. #ifdef MONT_MUL_MOD 134. if (BN_is_odd(m)) { ^ 135. # ifdef MONT_EXP_WORD 136. if (a->top == 1 && !a->neg crypto/bn/bn_lib.c:858:1: Parameter `a->top` 856. } 857. 858. > int BN_is_odd(const BIGNUM *a) 859. { 860. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_exp.c:149:15: Call 147. #ifdef RECP_MUL_MOD 148. { 149. ret = BN_mod_exp_recp(r, a, p, m, ctx); ^ 150. } 151. #else crypto/bn/bn_exp.c:161:1: Parameter `m->top` 159. } 160. 161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 162. const BIGNUM *m, BN_CTX *ctx) 163. { crypto/bn/bn_exp.c:200:14: Call 198. if (m->neg) { 199. /* ignore sign of 'm' */ 200. if (!BN_copy(aa, m)) ^ 201. goto err; 202. aa->neg = 0; crypto/bn/bn_lib.c:281:1: <Offset trace> 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: Parameter `b->top` 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: <Length trace> 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: Parameter `*a->d` 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:287:9: Call 285. if (a == b) 286. return a; 287. if (bn_wexpand(a, b->top) == NULL) ^ 288. return NULL; 289. crypto/bn/bn_lib.c:939:1: Parameter `*a->d` 937. } 938. 939. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 940. { 941. 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 `SRP_Calc_client_key` 289. 290. if (b->top > 0) 291. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); ^ 292. 293. a->neg = b->neg;
https://github.com/openssl/openssl/blob/ea09abc80892920ee5db4de82bed7a193b5896f0/crypto/bn/bn_lib.c/#L291
d2a_code_trace_data_42346
IMPLEMENT_new_ctx(cfb8, CFB, 192) providers/common/ciphers/aes.c:313: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 313 could be null and is dereferenced at line 313, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:313:1: start of procedure aes_192_cfb8_newctx() 311. IMPLEMENT_new_ctx(cfb1, CFB, 128) 312. IMPLEMENT_new_ctx(cfb8, CFB, 256) 313. > IMPLEMENT_new_ctx(cfb8, CFB, 192) 314. IMPLEMENT_new_ctx(cfb8, CFB, 128) 315. crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE) crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking false branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) providers/common/ciphers/aes.c:313:1: 311. IMPLEMENT_new_ctx(cfb1, CFB, 128) 312. IMPLEMENT_new_ctx(cfb8, CFB, 256) 313. > IMPLEMENT_new_ctx(cfb8, CFB, 192) 314. IMPLEMENT_new_ctx(cfb8, CFB, 128) 315.
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L313
d2a_code_trace_data_42347
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bntest.c:1384: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_div`. Showing all 15 steps of the trace crypto/bn/bntest.c:1360:1: Parameter `ctx->stack.depth` 1358. } 1359. 1360. > int test_gf2m_mod_div(BIO *bp,BN_CTX *ctx) 1361. { 1362. BIGNUM *a,*b[2],*c,*d,*e,*f; crypto/bn/bntest.c:1384:4: Call 1382. for (j=0; j < 2; j++) 1383. { 1384. BN_GF2m_mod_div(d, a, c, b[j], ctx); ^ 1385. BN_GF2m_mod_mul(e, d, c, b[j], ctx); 1386. BN_GF2m_mod_div(f, a, e, b[j], ctx); crypto/bn/bn_gf2m.c:678:1: Parameter `ctx->stack.depth` 676. * or y, x could equal y. 677. */ 678. > int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x, const BIGNUM *p, BN_CTX *ctx) 679. { 680. BIGNUM *xinv = NULL; crypto/bn/bn_gf2m.c:687:2: Call 685. bn_check_top(p); 686. 687. BN_CTX_start(ctx); ^ 688. xinv = BN_CTX_get(ctx); 689. if (xinv == 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/bn/bn_gf2m.c:691:7: Call 689. if (xinv == NULL) goto err; 690. 691. if (!BN_GF2m_mod_inv(xinv, x, p, ctx)) goto err; ^ 692. if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx)) goto err; 693. bn_check_top(r); crypto/bn/bn_gf2m.c:525:1: Parameter `ctx->stack.depth` 523. * of Elliptic Curve Cryptography Over Binary Fields". 524. */ 525. > int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 526. { 527. BIGNUM *b, *c, *u, *v, *tmp; crypto/bn/bn_gf2m.c:533:2: Call 531. bn_check_top(p); 532. 533. BN_CTX_start(ctx); ^ 534. 535. if ((b = BN_CTX_get(ctx))==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/bn/bn_gf2m.c:645:4: Call 643. 644. err: 645. BN_CTX_end(ctx); ^ 646. return ret; 647. } 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_GF2m_mod_div` 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/0b59755f434eca1ed621974ae9f95663dcdcac35/crypto/bn/bn_ctx.c/#L355
d2a_code_trace_data_42348
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/bn/bn_prime.c:210: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rshift`. Showing all 14 steps of the trace crypto/bn/bn_prime.c:197:10: Call 195. 196. /* compute A1 := a - 1 */ 197. if (!BN_copy(A1, a)) ^ 198. goto err; 199. if (!BN_sub_word(A1, 1)) crypto/bn/bn_lib.c:323:1: Parameter `a->top` 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_prime.c:210:10: Call 208. while (!BN_is_bit_set(A1, k)) 209. k++; 210. if (!BN_rshift(A1_odd, A1, k)) ^ 211. goto err; 212. crypto/bn/bn_shift.c:122:1: Parameter `*r->d` 120. } 121. 122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 123. { 124. int i, j, nw, lb, rb; crypto/bn/bn_shift.c:145:13: Call 143. i = (BN_num_bits(a) - n + (BN_BITS2 - 1)) / BN_BITS2; 144. if (r != a) { 145. if (bn_wexpand(r, i) == NULL) ^ 146. return (0); 147. 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_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:284:1: Parameter `*b->d` 282. */ 283. 284. > BIGNUM *bn_expand2(BIGNUM *b, int words) 285. { 286. bn_check_top(b); crypto/bn/bn_lib.c:289:23: Call 287. 288. if (words > b->dmax) { 289. BN_ULONG *a = bn_expand_internal(b, words); ^ 290. if (!a) 291. return NULL; crypto/bn/bn_lib.c:246:1: <Offset trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `b->top` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: <Length trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `*b->d` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:271:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rshift` 269. assert(b->top <= words); 270. if (b->top > 0) 271. memcpy(a, b->d, sizeof(*a) * b->top); ^ 272. 273. return a;
https://github.com/openssl/openssl/blob/757264207ad8650a89ea903d48ad89f61d56ea9c/crypto/bn/bn_lib.c/#L271
d2a_code_trace_data_42349
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:1170: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:1170:9: 1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) 1169. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) 1170. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, ^ 1171. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1172. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1170
d2a_code_trace_data_42350
static void opt_vstats (void) { char filename[40]; time_t today2 = time(NULL); struct tm *today = localtime(&today2); snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, today->tm_sec); opt_vstats_file(filename); } ffmpeg.c:4155: error: Null Dereference pointer `today` last assigned on line 4153 could be null and is dereferenced at line 4155, column 69. ffmpeg.c:4149:1: start of procedure opt_vstats() 4147. } 4148. 4149. static void opt_vstats (void) ^ 4150. { 4151. char filename[40]; ffmpeg.c:4152:5: 4150. { 4151. char filename[40]; 4152. time_t today2 = time(NULL); ^ 4153. struct tm *today = localtime(&today2); 4154. ffmpeg.c:4153:5: 4151. char filename[40]; 4152. time_t today2 = time(NULL); 4153. struct tm *today = localtime(&today2); ^ 4154. 4155. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ffmpeg.c:4155:5: 4153. struct tm *today = localtime(&today2); 4154. 4155. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 4156. today->tm_sec); 4157. opt_vstats_file(filename);
https://github.com/libav/libav/blob/5da116a3fde9013846bd7b385cdde5ce2951869c/ffmpeg.c/#L4155
d2a_code_trace_data_42351
static int sab_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; Minima minima[MAX_SAB_SIZE]; const int minima_count= FFABS(c->dia_size); int i, j; 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(j=i=0; i<ME_MAP_SIZE && j<MAX_SAB_SIZE; i++){ uint32_t key= map[i]; key += (1<<(ME_MAP_MV_BITS-1)) + (1<<(2*ME_MAP_MV_BITS-1)); if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue; minima[j].height= score_map[i]; minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS; minima[j].y= key & ((1<<ME_MAP_MV_BITS)-1); minima[j].x-= (1<<(ME_MAP_MV_BITS-1)); minima[j].y-= (1<<(ME_MAP_MV_BITS-1)); if( minima[j].x > xmax || minima[j].x < xmin || minima[j].y > ymax || minima[j].y < ymin) continue; minima[j].checked=0; if(minima[j].x || minima[j].y) minima[j].height+= (mv_penalty[((minima[j].x)<<shift)-pred_x] + mv_penalty[((minima[j].y)<<shift)-pred_y])*penalty_factor; j++; } qsort(minima, j, sizeof(Minima), minima_cmp); for(; j<minima_count; j++){ minima[j].height=256*256*256*64; minima[j].checked=0; minima[j].x= minima[j].y=0; } for(i=0; i<minima_count; i++){ const int x= minima[i].x; const int y= minima[i].y; int d; if(minima[i].checked) continue; if( x >= xmax || x <= xmin || y >= ymax || y <= ymin) continue; SAB_CHECK_MV(x-1, y) SAB_CHECK_MV(x+1, y) SAB_CHECK_MV(x , y-1) SAB_CHECK_MV(x , y+1) minima[i].checked= 1; } best[0]= minima[0].x; best[1]= minima[0].y; dmin= minima[0].height; if( best[0] < xmax && best[0] > xmin && best[1] < ymax && best[1] > ymin){ int d; CHECK_MV(best[0]-1, best[1]) CHECK_MV(best[0]+1, best[1]) CHECK_MV(best[0], best[1]-1) CHECK_MV(best[0], best[1]+1) } return dmin; } libavcodec/motion_est_template.c:890: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:890:9: 888. CHECK_MV(best[0]-1, best[1]) 889. CHECK_MV(best[0]+1, best[1]) 890. CHECK_MV(best[0], best[1]-1) ^ 891. CHECK_MV(best[0], best[1]+1) 892. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L890
d2a_code_trace_data_42352
static void unpack_input(const unsigned char *input, unsigned int *output) { unsigned int outbuffer[28]; unsigned short inbuffer[10]; unsigned int x; unsigned int *ptr; for (x=0;x<20;x+=2) inbuffer[x/2]=(input[x]<<8)+input[x+1]; ptr=outbuffer; *(ptr++)=27; *(ptr++)=(inbuffer[0]>>10)&0x3f; *(ptr++)=(inbuffer[0]>>5)&0x1f; *(ptr++)=inbuffer[0]&0x1f; *(ptr++)=(inbuffer[1]>>12)&0xf; *(ptr++)=(inbuffer[1]>>8)&0xf; *(ptr++)=(inbuffer[1]>>5)&7; *(ptr++)=(inbuffer[1]>>2)&7; *(ptr++)=((inbuffer[1]<<1)&6)|((inbuffer[2]>>15)&1); *(ptr++)=(inbuffer[2]>>12)&7; *(ptr++)=(inbuffer[2]>>10)&3; *(ptr++)=(inbuffer[2]>>5)&0x1f; *(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3); *(ptr++)=(inbuffer[3]>>6)&0xff; *(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1); *(ptr++)=(inbuffer[4]>>8)&0x7f; *(ptr++)=(inbuffer[4]>>1)&0x7f; *(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f); *(ptr++)=(inbuffer[5]>>2)&0x7f; *(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f); *(ptr++)=(inbuffer[6]>>4)&0x7f; *(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf); *(ptr++)=(inbuffer[7]>>5)&0x7f; *(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3); *(ptr++)=(inbuffer[8]>>7)&0x7f; *(ptr++)=((inbuffer[8]<<1)&0xfe)|((inbuffer[9]>>15)&1); *(ptr++)=(inbuffer[9]>>8)&0x7f; *(ptr++)=(inbuffer[9]>>1)&0x7f; *(output++)=outbuffer[11]; for (x=1;x<11;*(output++)=outbuffer[x++]); ptr=outbuffer+12; for (x=0;x<16;x+=4) { *(output++)=ptr[x]; *(output++)=ptr[x+2]; *(output++)=ptr[x+3]; *(output++)=ptr[x+1]; } } libavcodec/ra144.c:289: error: Uninitialized Value The value read from inbuffer[_] was never initialized. libavcodec/ra144.c:289:3: 287. *(ptr++)=(inbuffer[6]>>4)&0x7f; 288. *(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf); 289. *(ptr++)=(inbuffer[7]>>5)&0x7f; ^ 290. *(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3); 291. *(ptr++)=(inbuffer[8]>>7)&0x7f;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L289
d2a_code_trace_data_42353
static void imdct36(int *out, int *buf, int *in, int *win) { int i, j, t0, t1, t2, t3, s0, s1, s2, s3; int tmp[18], *tmp1, *in1; for(i=17;i>=1;i--) in[i] += in[i-1]; for(i=17;i>=3;i-=2) in[i] += in[i-2]; for(j=0;j<2;j++) { tmp1 = tmp + j; in1 = in + j; #if 0 int64_t t0, t1, t2, t3; t2 = in1[2*4] + in1[2*8] - in1[2*2]; t3 = (in1[2*0] + (int64_t)(in1[2*6]>>1))<<32; t1 = in1[2*0] - in1[2*6]; tmp1[ 6] = t1 - (t2>>1); tmp1[16] = t1 + t2; t0 = MUL64(2*(in1[2*2] + in1[2*4]), C2); t1 = MUL64( in1[2*4] - in1[2*8] , -2*C8); t2 = MUL64(2*(in1[2*2] + in1[2*8]), -C4); tmp1[10] = (t3 - t0 - t2) >> 32; tmp1[ 2] = (t3 + t0 + t1) >> 32; tmp1[14] = (t3 + t2 - t1) >> 32; tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3); t2 = MUL64(2*(in1[2*1] + in1[2*5]), C1); t3 = MUL64( in1[2*5] - in1[2*7] , -2*C7); t0 = MUL64(2*in1[2*3], C3); t1 = MUL64(2*(in1[2*1] + in1[2*7]), -C5); tmp1[ 0] = (t2 + t3 + t0) >> 32; tmp1[12] = (t2 + t1 - t0) >> 32; tmp1[ 8] = (t3 - t1 - t0) >> 32; #else t2 = in1[2*4] + in1[2*8] - in1[2*2]; t3 = in1[2*0] + (in1[2*6]>>1); t1 = in1[2*0] - in1[2*6]; tmp1[ 6] = t1 - (t2>>1); tmp1[16] = t1 + t2; t0 = MULH(2*(in1[2*2] + in1[2*4]), C2); t1 = MULH( in1[2*4] - in1[2*8] , -2*C8); t2 = MULH(2*(in1[2*2] + in1[2*8]), -C4); tmp1[10] = t3 - t0 - t2; tmp1[ 2] = t3 + t0 + t1; tmp1[14] = t3 + t2 - t1; tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3); t2 = MULH(2*(in1[2*1] + in1[2*5]), C1); t3 = MULH( in1[2*5] - in1[2*7] , -2*C7); t0 = MULH(2*in1[2*3], C3); t1 = MULH(2*(in1[2*1] + in1[2*7]), -C5); tmp1[ 0] = t2 + t3 + t0; tmp1[12] = t2 + t1 - t0; tmp1[ 8] = t3 - t1 - t0; #endif } i = 0; for(j=0;j<4;j++) { t0 = tmp[i]; t1 = tmp[i + 2]; s0 = t1 + t0; s2 = t1 - t0; t2 = tmp[i + 1]; t3 = tmp[i + 3]; s1 = MULH(2*(t3 + t2), icos36h[j]); s3 = MULL(t3 - t2, icos36[8 - j]); t0 = s0 + s1; t1 = s0 - s1; out[(9 + j)*SBLIMIT] = MULH(t1, win[9 + j]) + buf[9 + j]; out[(8 - j)*SBLIMIT] = MULH(t1, win[8 - j]) + buf[8 - j]; buf[9 + j] = MULH(t0, win[18 + 9 + j]); buf[8 - j] = MULH(t0, win[18 + 8 - j]); t0 = s2 + s3; t1 = s2 - s3; out[(9 + 8 - j)*SBLIMIT] = MULH(t1, win[9 + 8 - j]) + buf[9 + 8 - j]; out[( j)*SBLIMIT] = MULH(t1, win[ j]) + buf[ j]; buf[9 + 8 - j] = MULH(t0, win[18 + 9 + 8 - j]); buf[ + j] = MULH(t0, win[18 + j]); i += 4; } s0 = tmp[16]; s1 = MULH(2*tmp[17], icos36h[4]); t0 = s0 + s1; t1 = s0 - s1; out[(9 + 4)*SBLIMIT] = MULH(t1, win[9 + 4]) + buf[9 + 4]; out[(8 - 4)*SBLIMIT] = MULH(t1, win[8 - 4]) + buf[8 - 4]; buf[9 + 4] = MULH(t0, win[18 + 9 + 4]); buf[8 - 4] = MULH(t0, win[18 + 8 - 4]); } libavcodec/mpegaudiodec.c:2278: error: Buffer Overrun L1 Offset: [448, 545] (⇐ [0, 1] + [448, 544]) Size: 32 by call to `compute_imdct`. libavcodec/mpegaudiodec.c:2015:1: Parameter `s->sb_samples[*][*][*]` 2013. 2014. /* main layer3 decoding function */ 2015. static int mp_decode_layer3(MPADecodeContext *s) ^ 2016. { 2017. int nb_granules, main_data_begin, private_bits; libavcodec/mpegaudiodec.c:2278:13: Call 2276. sample_dump(1, g->sb_hybrid, 576); 2277. #endif 2278. compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]); ^ 2279. #if defined(DEBUG) 2280. sample_dump(2, &s->sb_samples[ch][18 * gr][0], 576); libavcodec/mpegaudiodec.c:1881:1: Parameter `*sb_samples` 1879. } 1880. 1881. static void compute_imdct(MPADecodeContext *s, ^ 1882. GranuleDef *g, 1883. int32_t *sb_samples, libavcodec/mpegaudiodec.c:1915:9: Assignment 1913. for(j=0;j<mdct_long_end;j++) { 1914. /* apply window & overlap with previous buffer */ 1915. out_ptr = sb_samples + j; ^ 1916. /* select window */ 1917. if (g->switch_point && j < 2) libavcodec/mpegaudiodec.c:1923:9: Call 1921. /* select frequency inversion */ 1922. win = win1 + ((4 * 36) & -(j & 1)); 1923. imdct36(out_ptr, buf, ptr, win); ^ 1924. out_ptr += 18*SBLIMIT; 1925. ptr += 18; libavcodec/mpegaudiodec.c:1085:9: <Offset trace> 1083. 1084. i = 0; 1085. for(j=0;j<4;j++) { ^ 1086. t0 = tmp[i]; 1087. t1 = tmp[i + 2]; libavcodec/mpegaudiodec.c:1085:9: Assignment 1083. 1084. i = 0; 1085. for(j=0;j<4;j++) { ^ 1086. t0 = tmp[i]; 1087. t1 = tmp[i + 2]; libavcodec/mpegaudiodec.c:1014:1: <Length trace> 1012. 1013. /* using Lee like decomposition followed by hand coded 9 points DCT */ 1014. static void imdct36(int *out, int *buf, int *in, int *win) ^ 1015. { 1016. int i, j, t0, t1, t2, t3, s0, s1, s2, s3; libavcodec/mpegaudiodec.c:1014:1: Parameter `*out` 1012. 1013. /* using Lee like decomposition followed by hand coded 9 points DCT */ 1014. static void imdct36(int *out, int *buf, int *in, int *win) ^ 1015. { 1016. int i, j, t0, t1, t2, t3, s0, s1, s2, s3; libavcodec/mpegaudiodec.c:1105:9: Array access: Offset: [448, 545] (⇐ [0, 1] + [448, 544]) Size: 32 by call to `compute_imdct` 1103. t0 = s2 + s3; 1104. t1 = s2 - s3; 1105. out[(9 + 8 - j)*SBLIMIT] = MULH(t1, win[9 + 8 - j]) + buf[9 + 8 - j]; ^ 1106. out[( j)*SBLIMIT] = MULH(t1, win[ j]) + buf[ j]; 1107. buf[9 + 8 - j] = MULH(t0, win[18 + 9 + 8 - j]);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L1105