id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_41954
static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale, int flags, int size, int h) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d; int dmin; int map_generation; int penalty_factor; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y*ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON LOAD_COMMON2 if(c->pre_pass){ penalty_factor= c->pre_penalty_factor; cmpf= s->dsp.me_pre_cmp[size]; chroma_cmpf= s->dsp.me_pre_cmp[size+1]; }else{ penalty_factor= c->penalty_factor; cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; } map_generation= update_map_generation(c); assert(cmpf); dmin= cmp(s, 0, 0, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags); map[0]= map_generation; score_map[0]= dmin; if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0) dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) }else{ if(dmin<((h*h*s->avctx->mv0_threshold)>>8) && ( P_LEFT[0] |P_LEFT[1] |P_TOP[0] |P_TOP[1] |P_TOPRIGHT[0]|P_TOPRIGHT[1])==0){ *mx_ptr= 0; *my_ptr= 0; c->skip=1; return dmin; } CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift) CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1) CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1) CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) ) CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) ) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift) CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) } if(dmin>h*h*4){ if(c->pre_pass){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16) if(!s->first_slice_line) CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) }else{ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } } if(c->avctx->last_predictor_count){ const int count= c->avctx->last_predictor_count; const int xstart= FFMAX(0, s->mb_x - count); const int ystart= FFMAX(0, s->mb_y - count); const int xend= FFMIN(s->mb_width , s->mb_x + count + 1); const int yend= FFMIN(s->mb_height, s->mb_y + count + 1); int mb_y; for(mb_y=ystart; mb_y<yend; mb_y++){ int mb_x; for(mb_x=xstart; mb_x<xend; mb_x++){ const int xy= mb_x + 1 + (mb_y + 1)*ref_mv_stride; int mx= (last_mv[xy][0]*ref_mv_scale + (1<<15))>>16; int my= (last_mv[xy][1]*ref_mv_scale + (1<<15))>>16; if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue; CHECK_MV(mx,my) } } } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1044: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1044:9: 1042. if (s->first_slice_line) { 1043. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) 1044. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, ^ 1045. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1046. }else{
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1044
d2a_code_trace_data_41955
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/dsa/dsa_ossl.c:191: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_mul`. Showing all 32 steps of the trace crypto/dsa/dsa_ossl.c:187:7: Call 185. 186. /* Compute s = inv(k) (m + xr) mod q */ 187. if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */ ^ 188. if (!BN_add(s, &xr, &m)) goto err; /* s = m + xr */ 189. if (BN_cmp(s,dsa->q) > 0) crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:198:2: Call 196. ret=1; 197. err: 198. BN_CTX_end(ctx); ^ 199. return(ret); 200. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:191:7: Call 189. if (BN_cmp(s,dsa->q) > 0) 190. if (!BN_sub(s,s,dsa->q)) goto err; 191. if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err; ^ 192. 193. ret=DSA_SIG_new(); crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:198:2: Call 196. ret=1; 197. err: 198. BN_CTX_end(ctx); ^ 199. return(ret); 200. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:187:7: Call 185. 186. /* Compute s = inv(k) (m + xr) mod q */ 187. if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */ ^ 188. if (!BN_add(s, &xr, &m)) goto err; /* s = m + xr */ 189. if (BN_cmp(s,dsa->q) > 0) crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:198:2: Call 196. ret=1; 197. err: 198. BN_CTX_end(ctx); ^ 199. return(ret); 200. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:191:7: Call 189. if (BN_cmp(s,dsa->q) > 0) 190. if (!BN_sub(s,s,dsa->q)) goto err; 191. if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err; ^ 192. 193. ret=DSA_SIG_new(); crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:191:10: Call 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) 191. { if (!BN_sqr(t,a,ctx)) goto err; } ^ 192. else 193. { if (!BN_mul(t,a,b,ctx)) goto err; } crypto/bn/bn_sqr.c:65:1: Parameter `ctx->stack.depth` 63. /* r must not be a */ 64. /* I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 */ 65. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 66. { 67. int max,al; crypto/bn/bn_sqr.c:83:2: Call 81. } 82. 83. BN_CTX_start(ctx); ^ 84. rr=(a != r) ? r : BN_CTX_get(ctx); 85. tmp=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_sqr.c:153:2: Call 151. bn_check_top(rr); 152. bn_check_top(tmp); 153. BN_CTX_end(ctx); ^ 154. return(ret); 155. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:277:21: Call 275. else 276. { 277. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 278. /* Does this stack frame have anything to release? */ 279. if(fp < ctx->used) crypto/bn/bn_ctx.c:351:1: <LHS trace> 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:351:1: Parameter `st->depth` 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_mul` 351. static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; ^ 354. } 355.
https://github.com/openssl/openssl/blob/1588a3cae72e60071f1f8a89dbd1356bc08581fc/crypto/bn/bn_ctx.c/#L353
d2a_code_trace_data_41956
int test_mont(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *A, *B; BIGNUM *n; int i; BN_MONT_CTX *mont; a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); A = BN_new(); B = BN_new(); n = BN_new(); mont = BN_MONT_CTX_new(); if (mont == NULL) return 0; BN_zero(n); if (BN_MONT_CTX_set(mont, n, ctx)) { fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n"); return 0; } BN_set_word(n, 16); if (BN_MONT_CTX_set(mont, n, ctx)) { fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n"); return 0; } BN_bntest_rand(a, 100, 0, 0); BN_bntest_rand(b, 100, 0, 0); for (i = 0; i < num2; i++) { int bits = (200 * (i + 1)) / num2; if (bits == 0) continue; BN_bntest_rand(n, bits, 0, 1); BN_MONT_CTX_set(mont, n, ctx); BN_nnmod(a, a, n, ctx); BN_nnmod(b, b, n, ctx); BN_to_montgomery(A, a, mont, ctx); BN_to_montgomery(B, b, mont, ctx); BN_mod_mul_montgomery(c, A, B, mont, ctx); BN_from_montgomery(A, c, mont, ctx); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " * "); BN_print(bp, b); BIO_puts(bp, " % "); BN_print(bp, &mont->N); BIO_puts(bp, " - "); } BN_print(bp, A); BIO_puts(bp, "\n"); } BN_mod_mul(d, a, b, n, ctx); BN_sub(d, d, A); if (!BN_is_zero(d)) { fprintf(stderr, "Montgomery multiplication test failed!\n"); return 0; } } BN_MONT_CTX_free(mont); BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(A); BN_free(B); BN_free(n); return (1); } test/bntest.c:812: error: MEMORY_LEAK memory dynamically allocated by call to `BN_MONT_CTX_new()` at line 800, column 12 is not reachable after line 812, column 17. Showing all 204 steps of the trace test/bntest.c:785:1: start of procedure test_mont() 783. } 784. 785. > int test_mont(BIO *bp, BN_CTX *ctx) 786. { 787. BIGNUM *a, *b, *c, *d, *A, *B; test/bntest.c:792:5: 790. BN_MONT_CTX *mont; 791. 792. > a = BN_new(); 793. b = BN_new(); 794. 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:793:5: 791. 792. a = BN_new(); 793. > b = BN_new(); 794. c = BN_new(); 795. 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:794:5: 792. a = BN_new(); 793. b = BN_new(); 794. > c = BN_new(); 795. d = BN_new(); 796. A = 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:795:5: 793. b = BN_new(); 794. c = BN_new(); 795. > d = BN_new(); 796. A = BN_new(); 797. 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/bntest.c:796:5: 794. c = BN_new(); 795. d = BN_new(); 796. > A = BN_new(); 797. B = BN_new(); 798. n = 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:797:5: 795. d = BN_new(); 796. A = BN_new(); 797. > B = BN_new(); 798. n = BN_new(); 799. 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:798:5: 796. A = BN_new(); 797. B = BN_new(); 798. > n = BN_new(); 799. 800. mont = BN_MONT_CTX_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:800:5: 798. n = BN_new(); 799. 800. > mont = BN_MONT_CTX_new(); 801. if (mont == NULL) 802. return 0; crypto/bn/bn_mont.c:315:1: start of procedure BN_MONT_CTX_new() 313. } 314. 315. > BN_MONT_CTX *BN_MONT_CTX_new(void) 316. { 317. BN_MONT_CTX *ret; crypto/bn/bn_mont.c:319:9: 317. BN_MONT_CTX *ret; 318. 319. > if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) 320. return (NULL); 321. 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_mont.c:319:9: Taking false branch 317. BN_MONT_CTX *ret; 318. 319. if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) ^ 320. return (NULL); 321. crypto/bn/bn_mont.c:322:5: 320. return (NULL); 321. 322. > BN_MONT_CTX_init(ret); 323. ret->flags = BN_FLG_MALLOCED; 324. return (ret); crypto/bn/bn_mont.c:327:1: start of procedure BN_MONT_CTX_init() 325. } 326. 327. > void BN_MONT_CTX_init(BN_MONT_CTX *ctx) 328. { 329. ctx->ri = 0; crypto/bn/bn_mont.c:329:5: 327. void BN_MONT_CTX_init(BN_MONT_CTX *ctx) 328. { 329. > ctx->ri = 0; 330. bn_init(&(ctx->RR)); 331. bn_init(&(ctx->N)); crypto/bn/bn_mont.c:330:5: Skipping bn_init(): empty list of specs 328. { 329. ctx->ri = 0; 330. bn_init(&(ctx->RR)); ^ 331. bn_init(&(ctx->N)); 332. bn_init(&(ctx->Ni)); crypto/bn/bn_mont.c:331:5: Skipping bn_init(): empty list of specs 329. ctx->ri = 0; 330. bn_init(&(ctx->RR)); 331. bn_init(&(ctx->N)); ^ 332. bn_init(&(ctx->Ni)); 333. ctx->n0[0] = ctx->n0[1] = 0; crypto/bn/bn_mont.c:332:5: Skipping bn_init(): empty list of specs 330. bn_init(&(ctx->RR)); 331. bn_init(&(ctx->N)); 332. bn_init(&(ctx->Ni)); ^ 333. ctx->n0[0] = ctx->n0[1] = 0; 334. ctx->flags = 0; crypto/bn/bn_mont.c:333:5: 331. bn_init(&(ctx->N)); 332. bn_init(&(ctx->Ni)); 333. > ctx->n0[0] = ctx->n0[1] = 0; 334. ctx->flags = 0; 335. } crypto/bn/bn_mont.c:334:5: 332. bn_init(&(ctx->Ni)); 333. ctx->n0[0] = ctx->n0[1] = 0; 334. > ctx->flags = 0; 335. } 336. crypto/bn/bn_mont.c:335:1: return from a call to BN_MONT_CTX_init 333. ctx->n0[0] = ctx->n0[1] = 0; 334. ctx->flags = 0; 335. > } 336. 337. void BN_MONT_CTX_free(BN_MONT_CTX *mont) crypto/bn/bn_mont.c:323:5: 321. 322. BN_MONT_CTX_init(ret); 323. > ret->flags = BN_FLG_MALLOCED; 324. return (ret); 325. } crypto/bn/bn_mont.c:324:5: 322. BN_MONT_CTX_init(ret); 323. ret->flags = BN_FLG_MALLOCED; 324. > return (ret); 325. } 326. crypto/bn/bn_mont.c:325:1: return from a call to BN_MONT_CTX_new 323. ret->flags = BN_FLG_MALLOCED; 324. return (ret); 325. > } 326. 327. void BN_MONT_CTX_init(BN_MONT_CTX *ctx) test/bntest.c:801:9: Taking false branch 799. 800. mont = BN_MONT_CTX_new(); 801. if (mont == NULL) ^ 802. return 0; 803. test/bntest.c:804:5: 802. return 0; 803. 804. > BN_zero(n); 805. if (BN_MONT_CTX_set(mont, n, ctx)) { 806. fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n"); crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is false 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:805:9: Taking false branch 803. 804. BN_zero(n); 805. if (BN_MONT_CTX_set(mont, n, ctx)) { ^ 806. fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n"); 807. return 0; test/bntest.c:810:5: 808. } 809. 810. > BN_set_word(n, 16); 811. if (BN_MONT_CTX_set(mont, n, ctx)) { 812. fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n"); crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is true 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:811:9: Taking true branch 809. 810. BN_set_word(n, 16); 811. if (BN_MONT_CTX_set(mont, n, ctx)) { ^ 812. fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n"); 813. return 0; test/bntest.c:812:9: 810. BN_set_word(n, 16); 811. if (BN_MONT_CTX_set(mont, n, ctx)) { 812. > fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n"); 813. return 0; 814. }
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L812
d2a_code_trace_data_41957
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_x931g.c:158: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_X931_generate_Xpq`. Showing all 12 steps of the trace crypto/rsa/rsa_x931g.c:153:5: Call 151. goto error; 152. 153. BN_CTX_start(ctx); ^ 154. Xp = BN_CTX_get(ctx); 155. Xq = 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_x931g.c:158:10: Call 156. if (Xq == NULL) 157. goto error; 158. if (!BN_X931_generate_Xpq(Xp, Xq, bits, ctx)) ^ 159. goto error; 160. crypto/bn/bn_x931p.c:160:1: Parameter `ctx->stack.depth` 158. */ 159. 160. > int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx) 161. { 162. BIGNUM *t; crypto/bn/bn_x931p.c:179:5: Call 177. goto err; 178. 179. BN_CTX_start(ctx); ^ 180. t = BN_CTX_get(ctx); 181. if (t == NULL) crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_x931p.c:193:5: Call 191. } 192. 193. BN_CTX_end(ctx); ^ 194. 195. if (i < 1000) 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_X931_generate_Xpq` 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/a055a8815587f402d700093dea0dec6bf34631a3/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_41958
static void dequant_lsps(double *lsps, int num, const uint16_t *values, const uint16_t *sizes, int n_stages, const uint8_t *table, const double *mul_q, const double *base_q) { int n, m; memset(lsps, 0, num * sizeof(*lsps)); for (n = 0; n < n_stages; n++) { const uint8_t *t_off = &table[values[n] * num]; double base = base_q[n], mul = mul_q[n]; for (m = 0; m < num; m++) lsps[m] += base + mul * t_off[m]; table += sizes[n] * num; } } libavcodec/wmavoice.c:1791: error: Buffer Overrun L1 Offset: [7, 11] (⇐ 7 + [0, 4]) Size: 3 by call to `dequant_lsp16r`. libavcodec/wmavoice.c:1734:1: Array declaration 1732. * fully parse the superframe 1733. */ 1734. static int synth_superframe(AVCodecContext *ctx, AVFrame *frame, ^ 1735. int *got_frame_ptr) 1736. { libavcodec/wmavoice.c:1791:13: Call 1789. dequant_lsp10r(gb, lsps[2], prev_lsps, a1, a2, s->lsp_q_mode); 1790. } else /* s->lsps == 16 */ 1791. dequant_lsp16r(gb, lsps[2], prev_lsps, a1, a2, s->lsp_q_mode); ^ 1792. 1793. for (n = 0; n < s->lsps; n++) { libavcodec/wmavoice.c:950:1: Parameter `*i_lsps` 948. * generate LSPs for the other frames from them (residual coding). 949. */ 950. static void dequant_lsp16r(GetBitContext *gb, ^ 951. double *i_lsps, const double *old, 952. double *a1, double *a2, int q_mode) libavcodec/wmavoice.c:966:5: Call 964. int n; 965. 966. dequant_lsp16i(gb, i_lsps); ^ 967. 968. interpol = get_bits(gb, 5); libavcodec/wmavoice.c:917:1: Parameter `*lsps` 915. * Parse 16 independently-coded LSPs. 916. */ 917. static void dequant_lsp16i(GetBitContext *gb, double *lsps) ^ 918. { 919. static const uint16_t vec_sizes[5] = { 256, 64, 128, 64, 128 }; libavcodec/wmavoice.c:940:5: Call 938. dequant_lsps( lsps, 5, v, vec_sizes, 2, 939. wmavoice_dq_lsp16i1, mul_lsf, base_lsf); 940. dequant_lsps(&lsps[5], 5, &v[2], &vec_sizes[2], 2, ^ 941. wmavoice_dq_lsp16i2, &mul_lsf[2], &base_lsf[2]); 942. dequant_lsps(&lsps[10], 6, &v[4], &vec_sizes[4], 1, libavcodec/wmavoice.c:823:1: <Offset trace> 821. * @param base_q base (lowest) LSF values 822. */ 823. static void dequant_lsps(double *lsps, int num, ^ 824. const uint16_t *values, 825. const uint16_t *sizes, libavcodec/wmavoice.c:823:1: Parameter `num` 821. * @param base_q base (lowest) LSF values 822. */ 823. static void dequant_lsps(double *lsps, int num, ^ 824. const uint16_t *values, 825. const uint16_t *sizes, libavcodec/wmavoice.c:823:1: <Length trace> 821. * @param base_q base (lowest) LSF values 822. */ 823. static void dequant_lsps(double *lsps, int num, ^ 824. const uint16_t *values, 825. const uint16_t *sizes, libavcodec/wmavoice.c:823:1: Parameter `*lsps` 821. * @param base_q base (lowest) LSF values 822. */ 823. static void dequant_lsps(double *lsps, int num, ^ 824. const uint16_t *values, 825. const uint16_t *sizes, libavcodec/wmavoice.c:838:13: Array access: Offset: [7, 11] (⇐ 7 + [0, 4]) Size: 3 by call to `dequant_lsp16r` 836. 837. for (m = 0; m < num; m++) 838. lsps[m] += base + mul * t_off[m]; ^ 839. 840. table += sizes[n] * num;
https://github.com/libav/libav/blob/c6507946d428ee082676d5917fbb3eb0d1d7eb2e/libavcodec/wmavoice.c/#L838
d2a_code_trace_data_41959
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/statem_clnt.c:3120: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->ext.npn_len` + `pkt->written` + 2]):unsigned64 by call to `WPACKET_sub_allocate_bytes__`. Showing all 16 steps of the trace ssl/statem/statem_clnt.c:3111:1: Parameter `pkt->written` 3109. 3110. #ifndef OPENSSL_NO_NEXTPROTONEG 3111. > int tls_construct_next_proto(SSL *s, WPACKET *pkt) 3112. { 3113. size_t len, padding_len; ssl/statem/statem_clnt.c:3119:10: Call 3117. padding_len = 32 - ((len + 2) % 32); 3118. 3119. if (!WPACKET_sub_memcpy_u8(pkt, s->ext.npn, len) ^ 3120. || !WPACKET_sub_allocate_bytes_u8(pkt, padding_len, &padding)) { 3121. SSLerr(SSL_F_TLS_CONSTRUCT_NEXT_PROTO, ERR_R_INTERNAL_ERROR); ssl/packet.c:345:1: Parameter `lenbytes` 343. } 344. 345. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len, 346. size_t lenbytes) 347. { ssl/packet.c:348:10: Call 346. size_t lenbytes) 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 349. || !WPACKET_memcpy(pkt, src, len) 350. || !WPACKET_close(pkt)) ssl/packet.c:252:1: Parameter `pkt->written` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/statem/statem_clnt.c:3120:17: Call 3118. 3119. if (!WPACKET_sub_memcpy_u8(pkt, s->ext.npn, len) 3120. || !WPACKET_sub_allocate_bytes_u8(pkt, padding_len, &padding)) { ^ 3121. SSLerr(SSL_F_TLS_CONSTRUCT_NEXT_PROTO, ERR_R_INTERNAL_ERROR); 3122. goto err; ssl/packet.c:28:10: Call 26. unsigned char **allocbytes, size_t lenbytes) 27. { 28. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 29. || !WPACKET_allocate_bytes(pkt, len, allocbytes) 30. || !WPACKET_close(pkt)) ssl/packet.c:252:1: Parameter `pkt->buf->length` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/packet.c:29:17: Call 27. { 28. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) 29. || !WPACKET_allocate_bytes(pkt, len, allocbytes) ^ 30. || !WPACKET_close(pkt)) 31. return 0; ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:49:36: Binary operation: ([0, +oo] - [0, s->ext.npn_len + pkt->written + 2]):unsigned64 by call to `WPACKET_sub_allocate_bytes__` 47. return 0; 48. 49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 50. size_t newlen; 51. size_t reflen;
https://github.com/openssl/openssl/blob/f61c5ca6ca183bf0a51651857e3efb02a98889ad/ssl/packet.c/#L49
d2a_code_trace_data_41960
static int client_hello_select_server_ctx(SSL *s, void *arg, int ignore) { const char *servername; const unsigned char *p; size_t len, remaining; HANDSHAKE_EX_DATA *ex_data = (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p, &remaining) || remaining <= 2) return 0; len = (*(p++) << 8); len += *(p++); if (len + 2 != remaining) return 0; remaining = len; if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) return 0; remaining--; if (remaining <= 2) return 0; len = (*(p++) << 8); len += *(p++); if (len + 2 > remaining) return 0; remaining = len; servername = (const char *)p; if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { SSL_CTX *new_ctx = arg; SSL_set_SSL_CTX(s, new_ctx); SSL_clear_options(s, 0xFFFFFFFFL); SSL_set_options(s, SSL_CTX_get_options(new_ctx)); ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; return 1; } else if (len == strlen("server1") && strncmp(servername, "server1", len) == 0) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return 1; } else if (ignore) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return 1; } return 0; } test/handshake_helper.c:197: error: NULL_DEREFERENCE pointer `ex_data` last assigned on line 145 could be null and is dereferenced at line 197, column 9. Showing all 28 steps of the trace test/handshake_helper.c:140:1: start of procedure client_hello_select_server_ctx() 138. } 139. 140. > static int client_hello_select_server_ctx(SSL *s, void *arg, int ignore) 141. { 142. const char *servername; test/handshake_helper.c:145:5: 143. const unsigned char *p; 144. size_t len, remaining; 145. > HANDSHAKE_EX_DATA *ex_data = 146. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 147. ssl/ssl_lib.c:3889:1: start of procedure SSL_get_ex_data() 3887. } 3888. 3889. > void *SSL_get_ex_data(const SSL *s, int idx) 3890. { 3891. return (CRYPTO_get_ex_data(&s->ex_data, idx)); ssl/ssl_lib.c:3891:5: 3889. void *SSL_get_ex_data(const SSL *s, int idx) 3890. { 3891. > return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3892. } 3893. crypto/ex_data.c:394:1: start of procedure CRYPTO_get_ex_data() 392. * particular index in the class used by this variable 393. */ 394. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 395. { 396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:396:9: Taking true branch 394. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 395. { 396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 397. return NULL; 398. return sk_void_value(ad->sk, idx); crypto/ex_data.c:397:9: 395. { 396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 397. > return NULL; 398. return sk_void_value(ad->sk, idx); 399. } crypto/ex_data.c:399:1: return from a call to CRYPTO_get_ex_data 397. return NULL; 398. return sk_void_value(ad->sk, idx); 399. > } ssl/ssl_lib.c:3892:1: return from a call to SSL_get_ex_data 3890. { 3891. return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3892. > } 3893. 3894. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) test/handshake_helper.c:152:10: Taking false branch 150. * was written, so parsing the normal case is a bit complex. 151. */ 152. if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p, ^ 153. &remaining) || 154. remaining <= 2) test/handshake_helper.c:154:9: Taking false branch 152. if (!SSL_client_hello_get0_ext(s, TLSEXT_TYPE_server_name, &p, 153. &remaining) || 154. remaining <= 2) ^ 155. return 0; 156. /* Extract the length of the supplied list of names. */ test/handshake_helper.c:157:5: 155. return 0; 156. /* Extract the length of the supplied list of names. */ 157. > len = (*(p++) << 8); 158. len += *(p++); 159. if (len + 2 != remaining) test/handshake_helper.c:158:5: 156. /* Extract the length of the supplied list of names. */ 157. len = (*(p++) << 8); 158. > len += *(p++); 159. if (len + 2 != remaining) 160. return 0; test/handshake_helper.c:159:9: Taking false branch 157. len = (*(p++) << 8); 158. len += *(p++); 159. if (len + 2 != remaining) ^ 160. return 0; 161. remaining = len; test/handshake_helper.c:161:5: 159. if (len + 2 != remaining) 160. return 0; 161. > remaining = len; 162. /* 163. * The list in practice only has a single element, so we only consider test/handshake_helper.c:166:9: Taking false branch 164. * the first one. 165. */ 166. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) ^ 167. return 0; 168. remaining--; test/handshake_helper.c:166:27: Taking false branch 164. * the first one. 165. */ 166. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) ^ 167. return 0; 168. remaining--; test/handshake_helper.c:168:5: 166. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) 167. return 0; 168. > remaining--; 169. /* Now we can finally pull out the byte array with the actual hostname. */ 170. if (remaining <= 2) test/handshake_helper.c:170:9: Taking false branch 168. remaining--; 169. /* Now we can finally pull out the byte array with the actual hostname. */ 170. if (remaining <= 2) ^ 171. return 0; 172. len = (*(p++) << 8); test/handshake_helper.c:172:5: 170. if (remaining <= 2) 171. return 0; 172. > len = (*(p++) << 8); 173. len += *(p++); 174. if (len + 2 > remaining) test/handshake_helper.c:173:5: 171. return 0; 172. len = (*(p++) << 8); 173. > len += *(p++); 174. if (len + 2 > remaining) 175. return 0; test/handshake_helper.c:174:9: Taking false branch 172. len = (*(p++) << 8); 173. len += *(p++); 174. if (len + 2 > remaining) ^ 175. return 0; 176. remaining = len; test/handshake_helper.c:176:5: 174. if (len + 2 > remaining) 175. return 0; 176. > remaining = len; 177. servername = (const char *)p; 178. test/handshake_helper.c:177:5: 175. return 0; 176. remaining = len; 177. > servername = (const char *)p; 178. 179. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { test/handshake_helper.c:179:9: Taking false branch 177. servername = (const char *)p; 178. 179. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { ^ 180. SSL_CTX *new_ctx = arg; 181. SSL_set_SSL_CTX(s, new_ctx); test/handshake_helper.c:192:16: Taking false branch 190. ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; 191. return 1; 192. } else if (len == strlen("server1") && ^ 193. strncmp(servername, "server1", len) == 0) { 194. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; test/handshake_helper.c:196:16: Taking true branch 194. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 195. return 1; 196. } else if (ignore) { ^ 197. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 198. return 1; test/handshake_helper.c:197:9: 195. return 1; 196. } else if (ignore) { 197. > ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 198. return 1; 199. }
https://github.com/openssl/openssl/blob/f1b97da1fd90cf3935eafedc8df0d0165cb75f2f/test/handshake_helper.c/#L197
d2a_code_trace_data_41961
static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe) { H264BSFContext *ctx = bsfc->priv_data; uint8_t unit_type; uint32_t nal_size, cumul_size = 0; if (!avctx->extradata || avctx->extradata_size < 6) { *poutbuf = (uint8_t*) buf; *poutbuf_size = buf_size; return 0; } if (!ctx->sps_pps_data) { uint16_t unit_size; uint32_t total_size = 0; uint8_t *out = NULL, unit_nb, sps_done = 0; const uint8_t *extradata = avctx->extradata+4; static const uint8_t nalu_header[4] = {0, 0, 0, 1}; ctx->length_size = (*extradata++ & 0x3) + 1; if (ctx->length_size == 3) return AVERROR(EINVAL); unit_nb = *extradata++ & 0x1f; if (!unit_nb) { unit_nb = *extradata++; sps_done++; } while (unit_nb--) { unit_size = AV_RB16(extradata); total_size += unit_size+4; if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { av_free(out); return AVERROR(EINVAL); } out = av_realloc(out, total_size); if (!out) return AVERROR(ENOMEM); memcpy(out+total_size-unit_size-4, nalu_header, 4); memcpy(out+total_size-unit_size, extradata+2, unit_size); extradata += 2+unit_size; if (!unit_nb && !sps_done++) unit_nb = *extradata++; } ctx->sps_pps_data = out; ctx->size = total_size; ctx->first_idr = 1; } *poutbuf_size = 0; *poutbuf = NULL; do { if (ctx->length_size == 1) nal_size = buf[0]; else if (ctx->length_size == 2) nal_size = AV_RB16(buf); else nal_size = AV_RB32(buf); buf += ctx->length_size; unit_type = *buf & 0x1f; if (ctx->first_idr && unit_type == 5) { alloc_and_copy(poutbuf, poutbuf_size, ctx->sps_pps_data, ctx->size, buf, nal_size); ctx->first_idr = 0; } else { alloc_and_copy(poutbuf, poutbuf_size, NULL, 0, buf, nal_size); if (!ctx->first_idr && unit_type == 1) ctx->first_idr = 1; } buf += nal_size; cumul_size += nal_size + ctx->length_size; } while (cumul_size < buf_size); return 1; } libavcodec/h264_mp4toannexb_bsf.c:91: error: Memory Leak memory dynamically allocated by call to `av_realloc()` at line 91, column 19 is not reachable after line 91, column 13. libavcodec/h264_mp4toannexb_bsf.c:49:1: start of procedure h264_mp4toannexb_filter() 47. } 48. 49. static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, ^ 50. AVCodecContext *avctx, const char *args, 51. uint8_t **poutbuf, int *poutbuf_size, libavcodec/h264_mp4toannexb_bsf.c:54:5: 52. const uint8_t *buf, int buf_size, 53. int keyframe) { 54. H264BSFContext *ctx = bsfc->priv_data; ^ 55. uint8_t unit_type; 56. uint32_t nal_size, cumul_size = 0; libavcodec/h264_mp4toannexb_bsf.c:56:5: 54. H264BSFContext *ctx = bsfc->priv_data; 55. uint8_t unit_type; 56. uint32_t nal_size, cumul_size = 0; ^ 57. 58. /* nothing to filter */ libavcodec/h264_mp4toannexb_bsf.c:59:10: Taking false branch 57. 58. /* nothing to filter */ 59. if (!avctx->extradata || avctx->extradata_size < 6) { ^ 60. *poutbuf = (uint8_t*) buf; 61. *poutbuf_size = buf_size; libavcodec/h264_mp4toannexb_bsf.c:59:30: Taking false branch 57. 58. /* nothing to filter */ 59. if (!avctx->extradata || avctx->extradata_size < 6) { ^ 60. *poutbuf = (uint8_t*) buf; 61. *poutbuf_size = buf_size; libavcodec/h264_mp4toannexb_bsf.c:66:10: Taking true branch 64. 65. /* retrieve sps and pps NAL units from extradata */ 66. if (!ctx->sps_pps_data) { ^ 67. uint16_t unit_size; 68. uint32_t total_size = 0; libavcodec/h264_mp4toannexb_bsf.c:68:9: 66. if (!ctx->sps_pps_data) { 67. uint16_t unit_size; 68. uint32_t total_size = 0; ^ 69. uint8_t *out = NULL, unit_nb, sps_done = 0; 70. const uint8_t *extradata = avctx->extradata+4; libavcodec/h264_mp4toannexb_bsf.c:69:9: 67. uint16_t unit_size; 68. uint32_t total_size = 0; 69. uint8_t *out = NULL, unit_nb, sps_done = 0; ^ 70. const uint8_t *extradata = avctx->extradata+4; 71. static const uint8_t nalu_header[4] = {0, 0, 0, 1}; libavcodec/h264_mp4toannexb_bsf.c:70:9: 68. uint32_t total_size = 0; 69. uint8_t *out = NULL, unit_nb, sps_done = 0; 70. const uint8_t *extradata = avctx->extradata+4; ^ 71. static const uint8_t nalu_header[4] = {0, 0, 0, 1}; 72. libavcodec/h264_mp4toannexb_bsf.c:71:9: 69. uint8_t *out = NULL, unit_nb, sps_done = 0; 70. const uint8_t *extradata = avctx->extradata+4; 71. static const uint8_t nalu_header[4] = {0, 0, 0, 1}; ^ 72. 73. /* retrieve length coded size */ libavcodec/h264_mp4toannexb_bsf.c:74:9: 72. 73. /* retrieve length coded size */ 74. ctx->length_size = (*extradata++ & 0x3) + 1; ^ 75. if (ctx->length_size == 3) 76. return AVERROR(EINVAL); libavcodec/h264_mp4toannexb_bsf.c:75:13: Taking false branch 73. /* retrieve length coded size */ 74. ctx->length_size = (*extradata++ & 0x3) + 1; 75. if (ctx->length_size == 3) ^ 76. return AVERROR(EINVAL); 77. libavcodec/h264_mp4toannexb_bsf.c:79:9: 77. 78. /* retrieve sps and pps unit(s) */ 79. unit_nb = *extradata++ & 0x1f; /* number of sps unit(s) */ ^ 80. if (!unit_nb) { 81. unit_nb = *extradata++; /* number of pps unit(s) */ libavcodec/h264_mp4toannexb_bsf.c:80:14: Taking false branch 78. /* retrieve sps and pps unit(s) */ 79. unit_nb = *extradata++ & 0x1f; /* number of sps unit(s) */ 80. if (!unit_nb) { ^ 81. unit_nb = *extradata++; /* number of pps unit(s) */ 82. sps_done++; libavcodec/h264_mp4toannexb_bsf.c:84:16: Loop condition is true. Entering loop body 82. sps_done++; 83. } 84. while (unit_nb--) { ^ 85. unit_size = AV_RB16(extradata); 86. total_size += unit_size+4; libavcodec/h264_mp4toannexb_bsf.c:85:13: 83. } 84. while (unit_nb--) { 85. unit_size = AV_RB16(extradata); ^ 86. total_size += unit_size+4; 87. if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { libavcodec/h264_mp4toannexb_bsf.c:86:13: 84. while (unit_nb--) { 85. unit_size = AV_RB16(extradata); 86. total_size += unit_size+4; ^ 87. if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { 88. av_free(out); libavcodec/h264_mp4toannexb_bsf.c:87:17: Taking false branch 85. unit_size = AV_RB16(extradata); 86. total_size += unit_size+4; 87. if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { ^ 88. av_free(out); 89. return AVERROR(EINVAL); libavcodec/h264_mp4toannexb_bsf.c:91:13: 89. return AVERROR(EINVAL); 90. } 91. out = av_realloc(out, total_size); ^ 92. if (!out) 93. return AVERROR(ENOMEM); libavutil/mem.c:94:1: start of procedure av_realloc() 92. } 93. 94. void *av_realloc(void *ptr, unsigned int size) ^ 95. { 96. #ifdef CONFIG_MEMALIGN_HACK libavutil/mem.c:101:8: Taking false branch 99. 100. /* let's disallow possible ambiguous cases */ 101. if(size > (INT_MAX-16) ) ^ 102. return NULL; 103. libavutil/mem.c:110:5: 108. return (char*)realloc((char*)ptr - diff, size + diff) + diff; 109. #else 110. return realloc(ptr, size); ^ 111. #endif 112. } libavutil/mem.c:112:1: return from a call to av_realloc 110. return realloc(ptr, size); 111. #endif 112. } ^ 113. 114. void av_free(void *ptr) libavcodec/h264_mp4toannexb_bsf.c:92:18: Taking false branch 90. } 91. out = av_realloc(out, total_size); 92. if (!out) ^ 93. return AVERROR(ENOMEM); 94. memcpy(out+total_size-unit_size-4, nalu_header, 4); libavcodec/h264_mp4toannexb_bsf.c:94:13: 92. if (!out) 93. return AVERROR(ENOMEM); 94. memcpy(out+total_size-unit_size-4, nalu_header, 4); ^ 95. memcpy(out+total_size-unit_size, extradata+2, unit_size); 96. extradata += 2+unit_size; libavcodec/h264_mp4toannexb_bsf.c:95:13: 93. return AVERROR(ENOMEM); 94. memcpy(out+total_size-unit_size-4, nalu_header, 4); 95. memcpy(out+total_size-unit_size, extradata+2, unit_size); ^ 96. extradata += 2+unit_size; 97. libavcodec/h264_mp4toannexb_bsf.c:96:13: 94. memcpy(out+total_size-unit_size-4, nalu_header, 4); 95. memcpy(out+total_size-unit_size, extradata+2, unit_size); 96. extradata += 2+unit_size; ^ 97. 98. if (!unit_nb && !sps_done++) libavcodec/h264_mp4toannexb_bsf.c:98:18: Taking false branch 96. extradata += 2+unit_size; 97. 98. if (!unit_nb && !sps_done++) ^ 99. unit_nb = *extradata++; /* number of pps unit(s) */ 100. } libavcodec/h264_mp4toannexb_bsf.c:84:16: Loop condition is true. Entering loop body 82. sps_done++; 83. } 84. while (unit_nb--) { ^ 85. unit_size = AV_RB16(extradata); 86. total_size += unit_size+4; libavcodec/h264_mp4toannexb_bsf.c:85:13: 83. } 84. while (unit_nb--) { 85. unit_size = AV_RB16(extradata); ^ 86. total_size += unit_size+4; 87. if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { libavcodec/h264_mp4toannexb_bsf.c:86:13: 84. while (unit_nb--) { 85. unit_size = AV_RB16(extradata); 86. total_size += unit_size+4; ^ 87. if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { 88. av_free(out); libavcodec/h264_mp4toannexb_bsf.c:87:17: Taking false branch 85. unit_size = AV_RB16(extradata); 86. total_size += unit_size+4; 87. if (extradata+2+unit_size > avctx->extradata+avctx->extradata_size) { ^ 88. av_free(out); 89. return AVERROR(EINVAL); libavcodec/h264_mp4toannexb_bsf.c:91:13: 89. return AVERROR(EINVAL); 90. } 91. out = av_realloc(out, total_size); ^ 92. if (!out) 93. return AVERROR(ENOMEM); libavutil/mem.c:94:1: start of procedure av_realloc() 92. } 93. 94. void *av_realloc(void *ptr, unsigned int size) ^ 95. { 96. #ifdef CONFIG_MEMALIGN_HACK libavutil/mem.c:101:8: Taking true branch 99. 100. /* let's disallow possible ambiguous cases */ 101. if(size > (INT_MAX-16) ) ^ 102. return NULL; 103. libavutil/mem.c:102:9: 100. /* let's disallow possible ambiguous cases */ 101. if(size > (INT_MAX-16) ) 102. return NULL; ^ 103. 104. #ifdef CONFIG_MEMALIGN_HACK libavutil/mem.c:112:1: return from a call to av_realloc 110. return realloc(ptr, size); 111. #endif 112. } ^ 113. 114. void av_free(void *ptr)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264_mp4toannexb_bsf.c/#L91
d2a_code_trace_data_41962
ssize_t ngx_parse_size(ngx_str_t *line) { u_char unit; size_t len; ssize_t size; ngx_int_t scale; len = line->len; unit = line->data[len - 1]; switch (unit) { case 'K': case 'k': len--; scale = 1024; break; case 'M': case 'm': len--; scale = 1024 * 1024; break; default: scale = 1; } size = ngx_atosz(line->data, len); if (size == NGX_ERROR) { return NGX_ERROR; } size *= scale; return size; } src/http/ngx_http_file_cache.c:1409: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64 by call to `ngx_parse_size`. src/http/ngx_http_file_cache.c:1399:28: Unknown value from: strchr 1397. name.data = value[i].data + 10; 1398. 1399. p = (u_char *) ngx_strchr(name.data, ':'); ^ 1400. 1401. if (p) { src/http/ngx_http_file_cache.c:1399:13: Assignment 1397. name.data = value[i].data + 10; 1398. 1399. p = (u_char *) ngx_strchr(name.data, ':'); ^ 1400. 1401. if (p) { src/http/ngx_http_file_cache.c:1404:17: Assignment 1402. name.len = p - name.data; 1403. 1404. p++; ^ 1405. 1406. s.len = value[i].data + value[i].len - p; src/http/ngx_http_file_cache.c:1406:17: Assignment 1404. p++; 1405. 1406. s.len = value[i].data + value[i].len - p; ^ 1407. s.data = p; 1408. src/http/ngx_http_file_cache.c:1409:24: Call 1407. s.data = p; 1408. 1409. size = ngx_parse_size(&s); ^ 1410. if (size > 8191) { 1411. continue; src/core/ngx_parse.c:11:1: <LHS trace> 9. 10. 11. ssize_t ^ 12. ngx_parse_size(ngx_str_t *line) 13. { src/core/ngx_parse.c:11:1: Parameter `line->len` 9. 10. 11. ssize_t ^ 12. ngx_parse_size(ngx_str_t *line) 13. { src/core/ngx_parse.c:19:5: Assignment 17. ngx_int_t scale; 18. 19. len = line->len; ^ 20. unit = line->data[len - 1]; 21. src/core/ngx_parse.c:20:12: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_parse_size` 18. 19. len = line->len; 20. unit = line->data[len - 1]; ^ 21. 22. switch (unit) {
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_parse.c/#L20
d2a_code_trace_data_41963
void CRYPTO_free(void *str) { #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (call_malloc_debug) { CRYPTO_mem_debug_free(str, 0); free(str); CRYPTO_mem_debug_free(str, 1); } else { free(str); } #else free(str); #endif } crypto/x509/x509_vpm.c:122: error: USE_AFTER_FREE call to `sk_OPENSSL_STRING_free()` eventually accesses memory that was invalidated by call to `free()` on line 119 indirectly during the call to `sk_OPENSSL_STRING_push()`. Showing all 22 steps of the trace crypto/x509/x509_vpm.c:114:23: invalidation part of the trace starts here 112. 113. if (vpm->hosts == NULL && 114. (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { ^ 115. OPENSSL_free(copy); 116. return 0; crypto/x509/x509_vpm.c:114:23: passed as argument to `sk_OPENSSL_STRING_new_null` 112. 113. if (vpm->hosts == NULL && 114. (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { ^ 115. OPENSSL_free(copy); 116. return 0; crypto/x509/x509_vpm.c:114:23: return from call to `sk_OPENSSL_STRING_new_null` 112. 113. if (vpm->hosts == NULL && 114. (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { ^ 115. OPENSSL_free(copy); 116. return 0; crypto/x509/x509_vpm.c:114:10: assigned 112. 113. if (vpm->hosts == NULL && 114. (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { ^ 115. OPENSSL_free(copy); 116. return 0; crypto/x509/x509_vpm.c:119:10: when calling `sk_OPENSSL_STRING_push` here 117. } 118. 119. if (!sk_OPENSSL_STRING_push(vpm->hosts, copy)) { ^ 120. OPENSSL_free(copy); 121. if (sk_OPENSSL_STRING_num(vpm->hosts) == 0) { include/openssl/safestack.h:214:1: parameter `sk` of sk_OPENSSL_STRING_push 212. * dealt with in the autogenerated macros below. 213. */ 214. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char) 215. 216. /* include/openssl/safestack.h:214:1: when calling `sk_push` here 212. * dealt with in the autogenerated macros below. 213. */ 214. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char) 215. 216. /* crypto/stack/stack.c:259:1: parameter `st` of sk_push 257. } 258. 259. > int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); crypto/stack/stack.c:261:13: when calling `sk_insert` here 259. int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); ^ 262. } 263. crypto/stack/stack.c:167:1: parameter `st` of sk_insert 165. } 166. 167. > int sk_insert(_STACK *st, void *data, int loc) 168. { 169. char **s; crypto/stack/stack.c:174:13: when calling `CRYPTO_realloc` here 172. return 0; 173. if (st->num_alloc <= st->num + 1) { 174. s = OPENSSL_realloc((char *)st->data, ^ 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); 176. if (s == NULL) crypto/mem.c:166:1: parameter `str` of CRYPTO_realloc 164. } 165. 166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 167. { 168. if (str == NULL) crypto/mem.c:172:9: when calling `CRYPTO_free` here 170. 171. if (num == 0) { 172. CRYPTO_free(str); ^ 173. return NULL; 174. } crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: was invalidated by call to `free()` 243. } 244. #else 245. free(str); ^ 246. #endif 247. } crypto/x509/x509_vpm.c:114:23: use-after-lifetime part of the trace starts here 112. 113. if (vpm->hosts == NULL && 114. (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { ^ 115. OPENSSL_free(copy); 116. return 0; crypto/x509/x509_vpm.c:114:23: passed as argument to `sk_OPENSSL_STRING_new_null` 112. 113. if (vpm->hosts == NULL && 114. (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { ^ 115. OPENSSL_free(copy); 116. return 0; crypto/x509/x509_vpm.c:114:23: return from call to `sk_OPENSSL_STRING_new_null` 112. 113. if (vpm->hosts == NULL && 114. (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { ^ 115. OPENSSL_free(copy); 116. return 0; crypto/x509/x509_vpm.c:114:10: assigned 112. 113. if (vpm->hosts == NULL && 114. (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { ^ 115. OPENSSL_free(copy); 116. return 0; crypto/x509/x509_vpm.c:122:13: when calling `sk_OPENSSL_STRING_free` here 120. OPENSSL_free(copy); 121. if (sk_OPENSSL_STRING_num(vpm->hosts) == 0) { 122. sk_OPENSSL_STRING_free(vpm->hosts); ^ 123. vpm->hosts = NULL; 124. } crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: invalid access occurs here 243. } 244. #else 245. free(str); ^ 246. #endif 247. }
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/mem.c/#L245
d2a_code_trace_data_41964
char *make_revocation_str(int rev_type, char *rev_arg) { char *reason = NULL, *other = NULL, *str; ASN1_OBJECT *otmp; ASN1_UTCTIME *revtm = NULL; int i; switch (rev_type) { case REV_NONE: break; case REV_CRL_REASON: for (i = 0; i < 8; i++) { if (!strcasecmp(rev_arg, crl_reasons[i])) { reason = crl_reasons[i]; break; } } if (reason == NULL) { BIO_printf(bio_err, "Unknown CRL reason %s\n", rev_arg); return NULL; } break; case REV_HOLD: otmp = OBJ_txt2obj(rev_arg, 0); ASN1_OBJECT_free(otmp); if (otmp == NULL) { BIO_printf(bio_err, "Invalid object identifier %s\n", rev_arg); return NULL; } reason = "holdInstruction"; other = rev_arg; break; case REV_KEY_COMPROMISE: case REV_CA_COMPROMISE: if (!ASN1_GENERALIZEDTIME_set_string(NULL, rev_arg)) { BIO_printf(bio_err, "Invalid time format %s. Need YYYYMMDDHHMMSSZ\n", rev_arg); return NULL; } other = rev_arg; if (rev_type == REV_KEY_COMPROMISE) reason = "keyTime"; else reason = "CAkeyTime"; break; } revtm = X509_gmtime_adj(NULL, 0); i = revtm->length + 1; if (reason) i += strlen(reason) + 1; if (other) i += strlen(other) + 1; str = OPENSSL_malloc(i); if (!str) return NULL; strcpy(str, (char *)revtm->data); if (reason) { strcat(str, ","); strcat(str, reason); } if (other) { strcat(str, ","); strcat(str, other); } ASN1_UTCTIME_free(revtm); return str; } apps/ca.c:2939: error: NULL_DEREFERENCE pointer `revtm` last assigned on line 2937 could be null and is dereferenced at line 2939, column 6. Showing all 41 steps of the trace apps/ca.c:2875:1: start of procedure make_revocation_str() 2873. */ 2874. 2875. > char *make_revocation_str(int rev_type, char *rev_arg) 2876. { 2877. char *reason = NULL, *other = NULL, *str; apps/ca.c:2877:2: 2875. char *make_revocation_str(int rev_type, char *rev_arg) 2876. { 2877. > char *reason = NULL, *other = NULL, *str; 2878. ASN1_OBJECT *otmp; 2879. ASN1_UTCTIME *revtm = NULL; apps/ca.c:2879:2: 2877. char *reason = NULL, *other = NULL, *str; 2878. ASN1_OBJECT *otmp; 2879. > ASN1_UTCTIME *revtm = NULL; 2880. int i; 2881. switch (rev_type) apps/ca.c:2881:2: 2879. ASN1_UTCTIME *revtm = NULL; 2880. int i; 2881. > switch (rev_type) 2882. { 2883. case REV_NONE: apps/ca.c:2883:2: Switch condition is false. Skipping switch case 2881. switch (rev_type) 2882. { 2883. case REV_NONE: ^ 2884. break; 2885. apps/ca.c:2886:2: Switch condition is false. Skipping switch case 2884. break; 2885. 2886. case REV_CRL_REASON: ^ 2887. for (i = 0; i < 8; i++) 2888. { apps/ca.c:2902:2: Switch condition is false. Skipping switch case 2900. break; 2901. 2902. case REV_HOLD: ^ 2903. /* Argument is an OID */ 2904. apps/ca.c:2918:2: Switch condition is true. Entering switch case 2916. break; 2917. 2918. case REV_KEY_COMPROMISE: ^ 2919. case REV_CA_COMPROMISE: 2920. apps/ca.c:2922:8: 2920. 2921. /* Argument is the key compromise time */ 2922. > if (!ASN1_GENERALIZEDTIME_set_string(NULL, rev_arg)) 2923. { 2924. BIO_printf(bio_err, "Invalid time format %s. Need YYYYMMDDHHMMSSZ\n", rev_arg); crypto/asn1/a_gentm.c:184:1: start of procedure ASN1_GENERALIZEDTIME_set_string() 182. } 183. 184. > int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str) 185. { 186. ASN1_GENERALIZEDTIME t; crypto/asn1/a_gentm.c:188:2: 186. ASN1_GENERALIZEDTIME t; 187. 188. > t.type=V_ASN1_GENERALIZEDTIME; 189. t.length=strlen(str); 190. t.data=(unsigned char *)str; crypto/asn1/a_gentm.c:189:2: 187. 188. t.type=V_ASN1_GENERALIZEDTIME; 189. > t.length=strlen(str); 190. t.data=(unsigned char *)str; 191. if (ASN1_GENERALIZEDTIME_check(&t)) crypto/asn1/a_gentm.c:190:2: 188. t.type=V_ASN1_GENERALIZEDTIME; 189. t.length=strlen(str); 190. > t.data=(unsigned char *)str; 191. if (ASN1_GENERALIZEDTIME_check(&t)) 192. { crypto/asn1/a_gentm.c:191:6: Taking true branch 189. t.length=strlen(str); 190. t.data=(unsigned char *)str; 191. if (ASN1_GENERALIZEDTIME_check(&t)) ^ 192. { 193. if (s != NULL) crypto/asn1/a_gentm.c:193:7: Taking false branch 191. if (ASN1_GENERALIZEDTIME_check(&t)) 192. { 193. if (s != NULL) ^ 194. { 195. ASN1_STRING_set((ASN1_STRING *)s, crypto/asn1/a_gentm.c:199:3: 197. s->type=V_ASN1_GENERALIZEDTIME; 198. } 199. > return(1); 200. } 201. else crypto/asn1/a_gentm.c:203:2: return from a call to ASN1_GENERALIZEDTIME_set_string 201. else 202. return(0); 203. } ^ 204. 205. ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, apps/ca.c:2922:8: Taking false branch 2920. 2921. /* Argument is the key compromise time */ 2922. if (!ASN1_GENERALIZEDTIME_set_string(NULL, rev_arg)) ^ 2923. { 2924. BIO_printf(bio_err, "Invalid time format %s. Need YYYYMMDDHHMMSSZ\n", rev_arg); apps/ca.c:2927:3: 2925. return NULL; 2926. } 2927. > other = rev_arg; 2928. if (rev_type == REV_KEY_COMPROMISE) 2929. reason = "keyTime"; apps/ca.c:2928:7: Taking true branch 2926. } 2927. other = rev_arg; 2928. if (rev_type == REV_KEY_COMPROMISE) ^ 2929. reason = "keyTime"; 2930. else apps/ca.c:2929:4: 2927. other = rev_arg; 2928. if (rev_type == REV_KEY_COMPROMISE) 2929. > reason = "keyTime"; 2930. else 2931. reason = "CAkeyTime"; apps/ca.c:2937:2: 2935. } 2936. 2937. > revtm = X509_gmtime_adj(NULL, 0); 2938. 2939. i = revtm->length + 1; crypto/x509/x509_vfy.c:832:1: start of procedure X509_gmtime_adj() 830. } 831. 832. > ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj) 833. { 834. return X509_time_adj(s, adj, NULL); crypto/x509/x509_vfy.c:834:2: 832. ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj) 833. { 834. > return X509_time_adj(s, adj, NULL); 835. } 836. crypto/x509/x509_vfy.c:837:1: start of procedure X509_time_adj() 835. } 836. 837. > ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *in_tm) 838. { 839. time_t t; crypto/x509/x509_vfy.c:840:2: 838. { 839. time_t t; 840. > int type = -1; 841. 842. if (in_tm) t = *in_tm; crypto/x509/x509_vfy.c:842:6: Taking false branch 840. int type = -1; 841. 842. if (in_tm) t = *in_tm; ^ 843. else time(&t); 844. crypto/x509/x509_vfy.c:843:7: 841. 842. if (in_tm) t = *in_tm; 843. > else time(&t); 844. 845. t+=adj; crypto/x509/x509_vfy.c:845:2: 843. else time(&t); 844. 845. > t+=adj; 846. if (s) type = s->type; 847. if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t); crypto/x509/x509_vfy.c:846:6: Taking false branch 844. 845. t+=adj; 846. if (s) type = s->type; ^ 847. if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t); 848. if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t); crypto/x509/x509_vfy.c:847:6: Taking false branch 845. t+=adj; 846. if (s) type = s->type; 847. if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t); ^ 848. if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t); 849. return ASN1_TIME_set(s, t); crypto/x509/x509_vfy.c:848:6: Taking false branch 846. if (s) type = s->type; 847. if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t); 848. if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t); ^ 849. return ASN1_TIME_set(s, t); 850. } crypto/x509/x509_vfy.c:849:2: 847. if (type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t); 848. if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t); 849. > return ASN1_TIME_set(s, t); 850. } 851. crypto/asn1/a_time.c:101:1: start of procedure ASN1_TIME_set() 99. 100. 101. > ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) 102. { 103. struct tm *ts; crypto/asn1/a_time.c:106:2: Skipping OPENSSL_gmtime(): empty list of specs 104. struct tm data; 105. 106. ts=OPENSSL_gmtime(&t,&data); ^ 107. if (ts == NULL) 108. return NULL; crypto/asn1/a_time.c:107:6: Taking true branch 105. 106. ts=OPENSSL_gmtime(&t,&data); 107. if (ts == NULL) ^ 108. return NULL; 109. if((ts->tm_year >= 50) && (ts->tm_year < 150)) crypto/asn1/a_time.c:108:3: 106. ts=OPENSSL_gmtime(&t,&data); 107. if (ts == NULL) 108. > return NULL; 109. if((ts->tm_year >= 50) && (ts->tm_year < 150)) 110. return ASN1_UTCTIME_set(s, t); crypto/asn1/a_time.c:112:2: return from a call to ASN1_TIME_set 110. return ASN1_UTCTIME_set(s, t); 111. return ASN1_GENERALIZEDTIME_set(s,t); 112. } ^ 113. 114. int ASN1_TIME_check(ASN1_TIME *t) crypto/x509/x509_vfy.c:850:2: return from a call to X509_time_adj 848. if (type == V_ASN1_GENERALIZEDTIME) return ASN1_GENERALIZEDTIME_set(s, t); 849. return ASN1_TIME_set(s, t); 850. } ^ 851. 852. int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain) crypto/x509/x509_vfy.c:835:1: return from a call to X509_gmtime_adj 833. { 834. return X509_time_adj(s, adj, NULL); 835. > } 836. 837. ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *in_tm) apps/ca.c:2939:2: 2937. revtm = X509_gmtime_adj(NULL, 0); 2938. 2939. > i = revtm->length + 1; 2940. 2941. if (reason) i += strlen(reason) + 1;
https://github.com/openssl/openssl/blob/64ad04eb2d464069dc6e3684b928d64b3560db8a/apps/ca.c/#L2939
d2a_code_trace_data_41965
static void mov_create_chapter_track(AVFormatContext *s, int tracknum) { MOVMuxContext *mov = s->priv_data; MOVTrack *track = &mov->tracks[tracknum]; AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY }; int i, len; track->mode = mov->mode; track->tag = MKTAG('t','e','x','t'); track->timescale = MOV_TIMESCALE; track->enc = avcodec_alloc_context3(NULL); track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; for (i = 0; i < s->nb_chapters; i++) { AVChapter *c = s->chapters[i]; AVDictionaryEntry *t; int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE}); pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE}); pkt.duration = end - pkt.dts; if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { len = strlen(t->value); pkt.size = len+2; pkt.data = av_malloc(pkt.size); AV_WB16(pkt.data, len); memcpy(pkt.data+2, t->value, len); ff_mov_write_packet(s, &pkt); av_freep(&pkt.data); } } } libavformat/movenc.c:2122: error: Null Dereference pointer `pkt.data` last assigned on line 2121 could be null and is dereferenced at line 2122, column 13. libavformat/movenc.c:2097:1: start of procedure mov_create_chapter_track() 2095. // QuickTime chapters involve an additional text track with the chapter names 2096. // as samples, and a tref pointing from the other tracks to the chapter one. 2097. static void mov_create_chapter_track(AVFormatContext *s, int tracknum) ^ 2098. { 2099. MOVMuxContext *mov = s->priv_data; libavformat/movenc.c:2099:5: 2097. static void mov_create_chapter_track(AVFormatContext *s, int tracknum) 2098. { 2099. MOVMuxContext *mov = s->priv_data; ^ 2100. MOVTrack *track = &mov->tracks[tracknum]; 2101. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY }; libavformat/movenc.c:2100:5: 2098. { 2099. MOVMuxContext *mov = s->priv_data; 2100. MOVTrack *track = &mov->tracks[tracknum]; ^ 2101. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY }; 2102. int i, len; libavformat/movenc.c:2101:5: 2099. MOVMuxContext *mov = s->priv_data; 2100. MOVTrack *track = &mov->tracks[tracknum]; 2101. AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY }; ^ 2102. int i, len; 2103. libavformat/movenc.c:2104:5: 2102. int i, len; 2103. 2104. track->mode = mov->mode; ^ 2105. track->tag = MKTAG('t','e','x','t'); 2106. track->timescale = MOV_TIMESCALE; libavformat/movenc.c:2105:5: 2103. 2104. track->mode = mov->mode; 2105. track->tag = MKTAG('t','e','x','t'); ^ 2106. track->timescale = MOV_TIMESCALE; 2107. track->enc = avcodec_alloc_context3(NULL); libavformat/movenc.c:2106:5: 2104. track->mode = mov->mode; 2105. track->tag = MKTAG('t','e','x','t'); 2106. track->timescale = MOV_TIMESCALE; ^ 2107. track->enc = avcodec_alloc_context3(NULL); 2108. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; libavformat/movenc.c:2107:5: 2105. track->tag = MKTAG('t','e','x','t'); 2106. track->timescale = MOV_TIMESCALE; 2107. track->enc = avcodec_alloc_context3(NULL); ^ 2108. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; 2109. libavcodec/options.c:576:1: start of procedure avcodec_alloc_context3() 574. } 575. 576. AVCodecContext *avcodec_alloc_context3(AVCodec *codec){ ^ 577. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); 578. libavcodec/options.c:577:5: 575. 576. AVCodecContext *avcodec_alloc_context3(AVCodec *codec){ 577. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); ^ 578. 579. if(avctx==NULL) return NULL; libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(size_t size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(size_t size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking false branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:114:5: 112. ptr = malloc(size); 113. #endif 114. return ptr; ^ 115. } 116. libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavcodec/options.c:579:8: Taking false branch 577. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); 578. 579. if(avctx==NULL) return NULL; ^ 580. 581. if(avcodec_get_context_defaults3(avctx, codec) < 0){ libavcodec/options.c:581:8: Taking false branch 579. if(avctx==NULL) return NULL; 580. 581. if(avcodec_get_context_defaults3(avctx, codec) < 0){ ^ 582. av_free(avctx); 583. return NULL; libavcodec/options.c:586:5: 584. } 585. 586. return avctx; ^ 587. } 588. libavcodec/options.c:587:1: return from a call to avcodec_alloc_context3 585. 586. return avctx; 587. } ^ 588. 589. #if FF_API_ALLOC_CONTEXT libavformat/movenc.c:2108:5: 2106. track->timescale = MOV_TIMESCALE; 2107. track->enc = avcodec_alloc_context3(NULL); 2108. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; ^ 2109. 2110. for (i = 0; i < s->nb_chapters; i++) { libavformat/movenc.c:2110:10: 2108. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; 2109. 2110. for (i = 0; i < s->nb_chapters; i++) { ^ 2111. AVChapter *c = s->chapters[i]; 2112. AVDictionaryEntry *t; libavformat/movenc.c:2110:17: Loop condition is true. Entering loop body 2108. track->enc->codec_type = AVMEDIA_TYPE_SUBTITLE; 2109. 2110. for (i = 0; i < s->nb_chapters; i++) { ^ 2111. AVChapter *c = s->chapters[i]; 2112. AVDictionaryEntry *t; libavformat/movenc.c:2111:9: 2109. 2110. for (i = 0; i < s->nb_chapters; i++) { 2111. AVChapter *c = s->chapters[i]; ^ 2112. AVDictionaryEntry *t; 2113. libavformat/movenc.c:2114:9: 2112. AVDictionaryEntry *t; 2113. 2114. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE}); ^ 2115. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE}); 2116. pkt.duration = end - pkt.dts; libavutil/mathematics.c:133:1: start of procedure av_rescale_q() 131. } 132. 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ ^ 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; libavutil/mathematics.c:134:5: 132. 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 134. int64_t b= bq.num * (int64_t)cq.den; ^ 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); libavutil/mathematics.c:135:5: 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; ^ 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 137. } libavutil/mathematics.c:136:5: Skipping av_rescale_rnd(): empty list of specs 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); ^ 137. } 138. libavutil/mathematics.c:137:1: return from a call to av_rescale_q 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 137. } ^ 138. 139. int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){ libavformat/movenc.c:2115:9: 2113. 2114. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE}); 2115. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE}); ^ 2116. pkt.duration = end - pkt.dts; 2117. libavutil/mathematics.c:133:1: start of procedure av_rescale_q() 131. } 132. 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ ^ 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; libavutil/mathematics.c:134:5: 132. 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 134. int64_t b= bq.num * (int64_t)cq.den; ^ 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); libavutil/mathematics.c:135:5: 133. int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq){ 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; ^ 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 137. } libavutil/mathematics.c:136:5: Skipping av_rescale_rnd(): empty list of specs 134. int64_t b= bq.num * (int64_t)cq.den; 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); ^ 137. } 138. libavutil/mathematics.c:137:1: return from a call to av_rescale_q 135. int64_t c= cq.num * (int64_t)bq.den; 136. return av_rescale_rnd(a, b, c, AV_ROUND_NEAR_INF); 137. } ^ 138. 139. int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b){ libavformat/movenc.c:2116:9: 2114. int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,MOV_TIMESCALE}); 2115. pkt.pts = pkt.dts = av_rescale_q(c->start, c->time_base, (AVRational){1,MOV_TIMESCALE}); 2116. pkt.duration = end - pkt.dts; ^ 2117. 2118. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { libavformat/movenc.c:2118:14: Taking true branch 2116. pkt.duration = end - pkt.dts; 2117. 2118. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { ^ 2119. len = strlen(t->value); 2120. pkt.size = len+2; libavformat/movenc.c:2119:13: 2117. 2118. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { 2119. len = strlen(t->value); ^ 2120. pkt.size = len+2; 2121. pkt.data = av_malloc(pkt.size); libavformat/movenc.c:2120:13: 2118. if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { 2119. len = strlen(t->value); 2120. pkt.size = len+2; ^ 2121. pkt.data = av_malloc(pkt.size); 2122. AV_WB16(pkt.data, len); libavformat/movenc.c:2121:13: 2119. len = strlen(t->value); 2120. pkt.size = len+2; 2121. pkt.data = av_malloc(pkt.size); ^ 2122. AV_WB16(pkt.data, len); 2123. memcpy(pkt.data+2, t->value, len); 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) libavformat/movenc.c:2122:13: 2120. pkt.size = len+2; 2121. pkt.data = av_malloc(pkt.size); 2122. AV_WB16(pkt.data, len); ^ 2123. memcpy(pkt.data+2, t->value, len); 2124. ff_mov_write_packet(s, &pkt); libavutil/bswap.h:58:1: start of procedure av_bswap16() 56. 57. #ifndef av_bswap16 58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x) ^ 59. { 60. x= (x>>8) | (x<<8); libavutil/bswap.h:60:5: 58. static av_always_inline av_const uint16_t av_bswap16(uint16_t x) 59. { 60. x= (x>>8) | (x<<8); ^ 61. return x; 62. } libavutil/bswap.h:61:5: 59. { 60. x= (x>>8) | (x<<8); 61. return x; ^ 62. } 63. #endif libavutil/bswap.h:62:1: return from a call to av_bswap16 60. x= (x>>8) | (x<<8); 61. return x; 62. } ^ 63. #endif 64.
https://github.com/libav/libav/blob/0884dd5a1b87aff6c8a06e6492dece5cef8f3978/libavformat/movenc.c/#L2122
d2a_code_trace_data_41966
int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm) { char *v; int gmt=0; int i; int y=0,M=0,d=0,h=0,m=0,s=0; i=tm->length; v=(char *)tm->data; if (i < 12) goto err; if (v[i-1] == 'Z') gmt=1; for (i=0; i<12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y= (v[0]-'0')*1000+(v[1]-'0')*100 + (v[2]-'0')*10+(v[3]-'0'); M= (v[4]-'0')*10+(v[5]-'0'); if ((M > 12) || (M < 1)) goto err; d= (v[6]-'0')*10+(v[7]-'0'); h= (v[8]-'0')*10+(v[9]-'0'); m= (v[10]-'0')*10+(v[11]-'0'); if ( (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) s= (v[12]-'0')*10+(v[13]-'0'); if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s", mon[M-1],d,h,m,s,y,(gmt)?" GMT":"") <= 0) return(0); else return(1); err: BIO_write(bp,"Bad time value",14); return(0); } crypto/asn1/t_crl.c:125: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`. Showing all 13 steps of the trace crypto/asn1/t_crl.c:99:4: Call 97. BIO_printf(out, "%8sSignature Algorithm: %s\n", "", 98. (i == NID_undef) ? "NONE" : OBJ_nid2ln(i)); 99. p=X509_NAME_oneline(X509_CRL_get_issuer(x),NULL,0); ^ 100. BIO_printf(out,"%8sIssuer: %s\n","",p); 101. OPENSSL_free(p); crypto/x509/x509_obj.c:66:1: Parameter `*buf` 64. #include <openssl/buffer.h> 65. 66. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 67. { 68. X509_NAME_ENTRY *ne; crypto/asn1/t_crl.c:123:3: Call 121. r = sk_X509_REVOKED_value(rev, i); 122. BIO_printf(out," Serial Number: "); 123. i2a_ASN1_INTEGER(out,r->serialNumber); ^ 124. BIO_printf(out,"\n Revocation Date: "); 125. ASN1_TIME_print(out,r->revocationDate); crypto/asn1/f_int.c:64:1: Parameter `*a->data` 62. #include <openssl/asn1.h> 63. 64. > int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) 65. { 66. int i,n=0; crypto/asn1/t_crl.c:125:3: Call 123. i2a_ASN1_INTEGER(out,r->serialNumber); 124. BIO_printf(out,"\n Revocation Date: "); 125. ASN1_TIME_print(out,r->revocationDate); ^ 126. BIO_printf(out,"\n"); 127. X509V3_extensions_print(out, "CRL entry extensions", crypto/asn1/t_x509.c:361:1: Parameter `*tm->data` 359. } 360. 361. > int ASN1_TIME_print(BIO *bp, ASN1_TIME *tm) 362. { 363. if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm); crypto/asn1/t_x509.c:365:12: Call 363. if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm); 364. if(tm->type == V_ASN1_GENERALIZEDTIME) 365. return ASN1_GENERALIZEDTIME_print(bp, tm); ^ 366. BIO_write(bp,"Bad time value",14); 367. return(0); crypto/asn1/t_x509.c:376:1: <Offset trace> 374. }; 375. 376. > int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm) 377. { 378. char *v; crypto/asn1/t_x509.c:376:1: Parameter `*tm->data` 374. }; 375. 376. > int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm) 377. { 378. char *v; crypto/asn1/t_x509.c:391:2: Assignment 389. if ((v[i] > '9') || (v[i] < '0')) goto err; 390. y= (v[0]-'0')*1000+(v[1]-'0')*100 + (v[2]-'0')*10+(v[3]-'0'); 391. M= (v[4]-'0')*10+(v[5]-'0'); ^ 392. if ((M > 12) || (M < 1)) goto err; 393. d= (v[6]-'0')*10+(v[7]-'0'); crypto/asn1/t_x509.c:370:1: <Length trace> 368. } 369. 370. > static const char *mon[12]= 371. { 372. "Jan","Feb","Mar","Apr","May","Jun", crypto/asn1/t_x509.c:370:1: Array declaration 368. } 369. 370. > static const char *mon[12]= 371. { 372. "Jan","Feb","Mar","Apr","May","Jun", crypto/asn1/t_x509.c:401:3: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print` 399. 400. if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s", 401. mon[M-1],d,h,m,s,y,(gmt)?" GMT":"") <= 0) ^ 402. return(0); 403. else
https://github.com/openssl/openssl/blob/a8b728445c6d2d3f1d3ef568b8bff2b651aa0b52/crypto/asn1/t_x509.c/#L401
d2a_code_trace_data_41967
static void ngx_http_set_keepalive(ngx_http_request_t *r) { int tcp_nodelay; ngx_int_t i; ngx_buf_t *b, *f; ngx_event_t *rev, *wev; ngx_connection_t *c; ngx_http_connection_t *hc; ngx_http_core_srv_conf_t *cscf; ngx_http_core_loc_conf_t *clcf; c = r->connection; rev = c->read; clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler"); if (r->discard_body) { r->write_event_handler = ngx_http_request_empty_handler; r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000); ngx_add_timer(rev, clcf->lingering_timeout); return; } c->log->action = "closing request"; hc = r->http_connection; b = r->header_in; if (b->pos < b->last) { if (b != c->buffer) { cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); if (hc->free == NULL) { hc->free = ngx_palloc(c->pool, cscf->large_client_header_buffers.num * sizeof(ngx_buf_t *)); if (hc->free == NULL) { ngx_http_close_request(r, 0); return; } } for (i = 0; i < hc->nbusy - 1; i++) { f = hc->busy[i]; hc->free[hc->nfree++] = f; f->pos = f->start; f->last = f->start; } hc->busy[0] = b; hc->nbusy = 1; } } ngx_http_request_done(r, 0); c->data = hc; ngx_add_timer(rev, clcf->keepalive_timeout); if (ngx_handle_read_event(rev, 0) != NGX_OK) { ngx_http_close_connection(c); return; } wev = c->write; wev->handler = ngx_http_empty_handler; if (b->pos < b->last) { ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "pipelined request"); #if (NGX_STAT_STUB) ngx_atomic_fetch_add(ngx_stat_reading, 1); #endif hc->pipeline = 1; c->log->action = "reading client pipelined request line"; rev->handler = ngx_http_init_request; ngx_post_event(rev, &ngx_posted_events); return; } hc->pipeline = 0; if (ngx_pfree(c->pool, r) == NGX_OK) { hc->request = NULL; } b = c->buffer; if (ngx_pfree(c->pool, b->start) == NGX_OK) { b->pos = NULL; } else { b->pos = b->start; b->last = b->start; } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc free: %p %d", hc->free, hc->nfree); if (hc->free) { for (i = 0; i < hc->nfree; i++) { ngx_pfree(c->pool, hc->free[i]->start); hc->free[i] = NULL; } hc->nfree = 0; } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc busy: %p %d", hc->busy, hc->nbusy); if (hc->busy) { for (i = 0; i < hc->nbusy; i++) { ngx_pfree(c->pool, hc->busy[i]->start); hc->busy[i] = NULL; } hc->nbusy = 0; } #if (NGX_HTTP_SSL) if (c->ssl) { ngx_ssl_free_buffer(c); } #endif rev->handler = ngx_http_keepalive_handler; if (wev->active && (ngx_event_flags & NGX_USE_LEVEL_EVENT)) { if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) != NGX_OK) { ngx_http_close_connection(c); return; } } c->log->action = "keepalive"; if (c->tcp_nopush == NGX_TCP_NOPUSH_SET) { if (ngx_tcp_push(c->fd) == -1) { ngx_connection_error(c, ngx_socket_errno, ngx_tcp_push_n " failed"); ngx_http_close_connection(c); return; } c->tcp_nopush = NGX_TCP_NOPUSH_UNSET; tcp_nodelay = ngx_tcp_nodelay_and_tcp_nopush ? 1 : 0; } else { tcp_nodelay = 1; } if (tcp_nodelay && clcf->tcp_nodelay && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) { ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay"); if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY, (const void *) &tcp_nodelay, sizeof(int)) == -1) { #if (NGX_SOLARIS) c->log_error = NGX_ERROR_IGNORE_EINVAL; #endif ngx_connection_error(c, ngx_socket_errno, "setsockopt(TCP_NODELAY) failed"); c->log_error = NGX_ERROR_INFO; ngx_http_close_connection(c); return; } c->tcp_nodelay = NGX_TCP_NODELAY_SET; } #if 0 r->http_state = NGX_HTTP_KEEPALIVE_STATE; #endif c->idle = 1; if (rev->ready) { ngx_post_event(rev, &ngx_posted_events); } } src/http/ngx_http_request.c:1011: error: Buffer Overrun L3 Offset: [2, +oo] Size: [0, +oo] by call to `ngx_http_process_request_header`. src/http/ngx_http_request.c:1009:13: Assignment 1007. r->request_length += r->header_in->pos - r->header_in->start; 1008. 1009. r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE; ^ 1010. 1011. rc = ngx_http_process_request_header(r); src/http/ngx_http_request.c:1011:18: Call 1009. r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE; 1010. 1011. rc = ngx_http_process_request_header(r); ^ 1012. 1013. if (rc != NGX_OK) { src/http/ngx_http_request.c:1415:1: Parameter `r->http_connection->nfree` 1413. 1414. 1415. static ngx_int_t ^ 1416. ngx_http_process_request_header(ngx_http_request_t *r) 1417. { src/http/ngx_http_request.c:1422:9: Call 1420. == NGX_ERROR) 1421. { 1422. ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); ^ 1423. return NGX_ERROR; 1424. } src/http/ngx_http_request.c:1806:1: Parameter `r->http_connection->nfree` 1804. 1805. 1806. void ^ 1807. ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) 1808. { src/http/ngx_http_request.c:1997:9: Call 1995. && clcf->keepalive_timeout > 0) 1996. { 1997. ngx_http_set_keepalive(r); ^ 1998. return; 1999. src/http/ngx_http_request.c:2225:1: <Offset trace> 2223. 2224. 2225. static void ^ 2226. ngx_http_set_keepalive(ngx_http_request_t *r) 2227. { src/http/ngx_http_request.c:2225:1: Parameter `r->http_connection->nfree` 2223. 2224. 2225. static void ^ 2226. ngx_http_set_keepalive(ngx_http_request_t *r) 2227. { src/http/ngx_http_request.c:2225:1: <Length trace> 2223. 2224. 2225. static void ^ 2226. ngx_http_set_keepalive(ngx_http_request_t *r) 2227. { src/http/ngx_http_request.c:2225:1: Parameter `*r->http_connection->free` 2223. 2224. 2225. static void ^ 2226. ngx_http_set_keepalive(ngx_http_request_t *r) 2227. { src/http/ngx_http_request.c:2284:17: Array access: Offset: [2, +oo] Size: [0, +oo] by call to `ngx_http_process_request_header` 2282. for (i = 0; i < hc->nbusy - 1; i++) { 2283. f = hc->busy[i]; 2284. hc->free[hc->nfree++] = f; ^ 2285. f->pos = f->start; 2286. f->last = f->start;
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/http/ngx_http_request.c/#L2284
d2a_code_trace_data_41968
ngx_int_t ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key, void *value, ngx_uint_t flags) { size_t len; u_char *p; ngx_str_t *name; ngx_uint_t i, k, n, skip, last; ngx_array_t *keys, *hwc; ngx_hash_key_t *hk; last = key->len; if (flags & NGX_HASH_WILDCARD_KEY) { n = 0; for (i = 0; i < key->len; i++) { if (key->data[i] == '*') { if (++n > 1) { return NGX_DECLINED; } } if (key->data[i] == '.' && key->data[i + 1] == '.') { return NGX_DECLINED; } } if (key->len > 1 && key->data[0] == '.') { skip = 1; goto wildcard; } if (key->len > 2) { if (key->data[0] == '*' && key->data[1] == '.') { skip = 2; goto wildcard; } if (key->data[i - 2] == '.' && key->data[i - 1] == '*') { skip = 0; last -= 2; goto wildcard; } } if (n) { return NGX_DECLINED; } } k = 0; for (i = 0; i < last; i++) { if (!(flags & NGX_HASH_READONLY_KEY)) { key->data[i] = ngx_tolower(key->data[i]); } k = ngx_hash(k, key->data[i]); } k %= ha->hsize; name = ha->keys_hash[k].elts; if (name) { for (i = 0; i < ha->keys_hash[k].nelts; i++) { if (last != name[i].len) { continue; } if (ngx_strncmp(key->data, name[i].data, last) == 0) { return NGX_BUSY; } } } else { if (ngx_array_init(&ha->keys_hash[k], ha->temp_pool, 4, sizeof(ngx_str_t)) != NGX_OK) { return NGX_ERROR; } } name = ngx_array_push(&ha->keys_hash[k]); if (name == NULL) { return NGX_ERROR; } *name = *key; hk = ngx_array_push(&ha->keys); if (hk == NULL) { return NGX_ERROR; } hk->key = *key; hk->key_hash = ngx_hash_key(key->data, last); hk->value = value; return NGX_OK; wildcard: k = ngx_hash_strlow(&key->data[skip], &key->data[skip], last - skip); k %= ha->hsize; if (skip == 1) { name = ha->keys_hash[k].elts; if (name) { len = last - skip; for (i = 0; i < ha->keys_hash[k].nelts; i++) { if (len != name[i].len) { continue; } if (ngx_strncmp(&key->data[1], name[i].data, len) == 0) { return NGX_BUSY; } } } else { if (ngx_array_init(&ha->keys_hash[k], ha->temp_pool, 4, sizeof(ngx_str_t)) != NGX_OK) { return NGX_ERROR; } } name = ngx_array_push(&ha->keys_hash[k]); if (name == NULL) { return NGX_ERROR; } name->len = last - 1; name->data = ngx_pnalloc(ha->temp_pool, name->len); if (name->data == NULL) { return NGX_ERROR; } ngx_memcpy(name->data, &key->data[1], name->len); } if (skip) { p = ngx_pnalloc(ha->temp_pool, last); if (p == NULL) { return NGX_ERROR; } len = 0; n = 0; for (i = last - 1; i; i--) { if (key->data[i] == '.') { ngx_memcpy(&p[n], &key->data[i + 1], len); n += len; p[n++] = '.'; len = 0; continue; } len++; } if (len) { ngx_memcpy(&p[n], &key->data[1], len); n += len; } p[n] = '\0'; hwc = &ha->dns_wc_head; keys = &ha->dns_wc_head_hash[k]; } else { last++; p = ngx_pnalloc(ha->temp_pool, last); if (p == NULL) { return NGX_ERROR; } ngx_cpystrn(p, key->data, last); hwc = &ha->dns_wc_tail; keys = &ha->dns_wc_tail_hash[k]; } hk = ngx_array_push(hwc); if (hk == NULL) { return NGX_ERROR; } hk->key.len = last - 1; hk->key.data = p; hk->key_hash = 0; hk->value = value; name = keys->elts; if (name) { len = last - skip; for (i = 0; i < keys->nelts; i++) { if (len != name[i].len) { continue; } if (ngx_strncmp(key->data + skip, name[i].data, len) == 0) { return NGX_BUSY; } } } else { if (ngx_array_init(keys, ha->temp_pool, 4, sizeof(ngx_str_t)) != NGX_OK) { return NGX_ERROR; } } name = ngx_array_push(keys); if (name == NULL) { return NGX_ERROR; } name->len = last - skip; name->data = ngx_pnalloc(ha->temp_pool, name->len); if (name->data == NULL) { return NGX_ERROR; } ngx_memcpy(name->data, key->data + skip, name->len); return NGX_OK; } src/http/modules/ngx_http_ssi_filter_module.c:2654: error: Buffer Overrun L3 Offset added: [-3, +oo] (⇐ [0, 2] + [-3, +oo]) Size: [8, +oo] by call to `ngx_http_add_variable`. src/http/modules/ngx_http_ssi_filter_module.c:2654:15: Call 2652. 2653. for (v = ngx_http_ssi_vars; v->name.len; v++) { 2654. var = ngx_http_add_variable(cf, &v->name, v->flags); ^ 2655. if (var == NULL) { 2656. return NGX_ERROR; src/http/ngx_http_variables.c:257:1: Parameter `name->len` 255. 256. 257. ngx_http_variable_t * ^ 258. ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags) 259. { src/http/modules/ngx_http_ssi_filter_module.c:2654:15: Call 2652. 2653. for (v = ngx_http_ssi_vars; v->name.len; v++) { 2654. var = ngx_http_add_variable(cf, &v->name, v->flags); ^ 2655. if (var == NULL) { 2656. return NGX_ERROR; src/http/ngx_http_variables.c:257:1: Parameter `name->len` 255. 256. 257. ngx_http_variable_t * ^ 258. ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags) 259. { src/http/ngx_http_variables.c:292:5: Assignment 290. } 291. 292. v->name.len = name->len; ^ 293. v->name.data = ngx_pnalloc(cf->pool, name->len); 294. if (v->name.data == NULL) { src/http/ngx_http_variables.c:306:10: Call 304. v->index = 0; 305. 306. rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v, 0); ^ 307. 308. if (rc == NGX_ERROR) { src/core/ngx_hash.c:749:13: <Offset trace> 747. 748. if (key->len > 1 && key->data[0] == '.') { 749. skip = 1; ^ 750. goto wildcard; 751. } src/core/ngx_hash.c:749:13: Assignment 747. 748. if (key->len > 1 && key->data[0] == '.') { 749. skip = 1; ^ 750. goto wildcard; 751. } src/core/ngx_hash.c:974:5: Assignment 972. } 973. 974. name->len = last - skip; ^ 975. name->data = ngx_pnalloc(ha->temp_pool, name->len); 976. if (name->data == NULL) { src/core/ngx_hash.c:713:1: <Length trace> 711. 712. 713. ngx_int_t ^ 714. ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key, void *value, 715. ngx_uint_t flags) src/core/ngx_hash.c:713:1: Parameter `*key->data` 711. 712. 713. ngx_int_t ^ 714. ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key, void *value, 715. ngx_uint_t flags) src/core/ngx_hash.c:980:5: Array access: Offset added: [-3, +oo] (⇐ [0, 2] + [-3, +oo]) Size: [8, +oo] by call to `ngx_http_add_variable` 978. } 979. 980. ngx_memcpy(name->data, key->data + skip, name->len); ^ 981. 982. return NGX_OK;
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_hash.c/#L980
d2a_code_trace_data_41969
static void BN_POOL_release(BN_POOL *p, unsigned int num) { unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; p->used -= num; while (num--) { bn_check_top(p->current->vals + offset); if (offset == 0) { offset = BN_CTX_POOL_SIZE - 1; p->current = p->current->prev; } else offset--; } } crypto/rsa/rsa_crpt.c:154: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse`. Showing all 38 steps of the trace crypto/rsa/rsa_crpt.c:151:10: Call 149. if (!BN_sub(r2, q, BN_value_one())) 150. goto err; 151. if (!BN_mul(r0, r1, r2, ctx)) ^ 152. goto err; 153. crypto/bn/bn_mul.c:883:1: Parameter `ctx->pool.used` 881. #endif /* BN_RECURSION */ 882. 883. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 884. { 885. int ret = 0; crypto/rsa/rsa_crpt.c:154:11: Call 152. goto err; 153. 154. ret = BN_mod_inverse(NULL, d, r0, ctx); ^ 155. err: 156. BN_CTX_end(ctx); crypto/bn/bn_gcd.c:226:1: Parameter `ctx->pool.used` 224. BN_CTX *ctx); 225. 226. > BIGNUM *BN_mod_inverse(BIGNUM *in, 227. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 228. { crypto/bn/bn_gcd.c:231:10: Call 229. BIGNUM *rv; 230. int noinv; 231. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 232. if (noinv) 233. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:237:1: Parameter `ctx->pool.used` 235. } 236. 237. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 238. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 239. int *pnoinv) crypto/bn/bn_gcd.c:250:16: Call 248. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 249. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 250. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 251. } 252. crypto/bn/bn_gcd.c:557:1: Parameter `ctx->pool.used` 555. * not contain branches that may leak sensitive information. 556. */ 557. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 558. const BIGNUM *a, const BIGNUM *n, 559. BN_CTX *ctx) crypto/bn/bn_gcd.c:569:9: Call 567. 568. BN_CTX_start(ctx); 569. A = BN_CTX_get(ctx); ^ 570. B = BN_CTX_get(ctx); 571. X = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_gcd.c:570:9: Call 568. BN_CTX_start(ctx); 569. A = BN_CTX_get(ctx); 570. B = BN_CTX_get(ctx); ^ 571. X = BN_CTX_get(ctx); 572. D = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_gcd.c:571:9: Call 569. A = BN_CTX_get(ctx); 570. B = BN_CTX_get(ctx); 571. X = BN_CTX_get(ctx); ^ 572. D = BN_CTX_get(ctx); 573. M = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_gcd.c:572:9: Call 570. B = BN_CTX_get(ctx); 571. X = BN_CTX_get(ctx); 572. D = BN_CTX_get(ctx); ^ 573. M = BN_CTX_get(ctx); 574. Y = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_gcd.c:573:9: Call 571. X = BN_CTX_get(ctx); 572. D = BN_CTX_get(ctx); 573. M = BN_CTX_get(ctx); ^ 574. Y = BN_CTX_get(ctx); 575. T = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_gcd.c:574:9: Call 572. D = BN_CTX_get(ctx); 573. M = BN_CTX_get(ctx); 574. Y = BN_CTX_get(ctx); ^ 575. T = BN_CTX_get(ctx); 576. if (T == NULL) crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_gcd.c:575:9: Call 573. M = BN_CTX_get(ctx); 574. Y = BN_CTX_get(ctx); 575. T = BN_CTX_get(ctx); ^ 576. if (T == NULL) 577. goto err; crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_gcd.c:603:18: Call 601. BN_init(&local_B); 602. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 603. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 604. goto err; 605. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:119:1: Parameter `ctx->pool.used` 117. #include "bn_lcl.h" 118. 119. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 120. { 121. /* crypto/bn/bn_mod.c:126:11: Call 124. */ 125. 126. if (!(BN_mod(r, m, d, ctx))) ^ 127. return 0; 128. if (!r->neg) crypto/bn/bn_div.c:189:1: Parameter `ctx->pool.used` 187. * If 'dv' or 'rm' is NULL, the respective value is not returned. 188. */ 189. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 190. BN_CTX *ctx) 191. { crypto/bn/bn_div.c:243:11: Call 241. 242. BN_CTX_start(ctx); 243. tmp = BN_CTX_get(ctx); ^ 244. snum = BN_CTX_get(ctx); 245. sdiv = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_div.c:244:12: Call 242. BN_CTX_start(ctx); 243. tmp = BN_CTX_get(ctx); 244. snum = BN_CTX_get(ctx); ^ 245. sdiv = BN_CTX_get(ctx); 246. if (dv == NULL) crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_div.c:245:12: Call 243. tmp = BN_CTX_get(ctx); 244. snum = BN_CTX_get(ctx); 245. sdiv = BN_CTX_get(ctx); ^ 246. if (dv == NULL) 247. res = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used` 265. } 266. 267. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 268. { 269. BIGNUM *ret; crypto/bn/bn_div.c:469:5: Call 467. if (no_branch) 468. bn_correct_top(res); 469. BN_CTX_end(ctx); ^ 470. return (1); 471. err: crypto/bn/bn_ctx.c:250:1: Parameter `ctx->pool.used` 248. } 249. 250. > void BN_CTX_end(BN_CTX *ctx) 251. { 252. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:259:13: Call 257. /* Does this stack frame have anything to release? */ 258. if (fp < ctx->used) 259. BN_POOL_release(&ctx->pool, ctx->used - fp); ^ 260. ctx->used = fp; 261. /* Unjam "too_many" in case "get" had failed */ crypto/bn/bn_ctx.c:395:1: <LHS trace> 393. } 394. 395. > static void BN_POOL_release(BN_POOL *p, unsigned int num) 396. { 397. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; crypto/bn/bn_ctx.c:395:1: Parameter `p->used` 393. } 394. 395. > static void BN_POOL_release(BN_POOL *p, unsigned int num) 396. { 397. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; crypto/bn/bn_ctx.c:397:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse` 395. static void BN_POOL_release(BN_POOL *p, unsigned int num) 396. { 397. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; ^ 398. 399. p->used -= num;
https://github.com/openssl/openssl/blob/e113c9c59dcb419dd00525cec431edb854a6c897/crypto/bn/bn_ctx.c/#L397
d2a_code_trace_data_41970
void avformat_close_input(AVFormatContext **ps) { AVFormatContext *s = *ps; AVIOContext *pb = s->pb; if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO)) pb = NULL; flush_packet_queue(s); if (s->iformat) { if (s->iformat->read_close) s->iformat->read_close(s); } avformat_free_context(s); *ps = NULL; avio_close(pb); } libavformat/utils.c:2729: error: Null Dereference pointer `pb` last assigned on line 2716 could be null and is dereferenced by call to `avio_close()` at line 2729, column 5. libavformat/utils.c:2709:1: start of procedure avformat_close_input() 2707. #endif 2708. 2709. void avformat_close_input(AVFormatContext **ps) ^ 2710. { 2711. AVFormatContext *s = *ps; libavformat/utils.c:2711:5: 2709. void avformat_close_input(AVFormatContext **ps) 2710. { 2711. AVFormatContext *s = *ps; ^ 2712. AVIOContext *pb = s->pb; 2713. libavformat/utils.c:2712:5: 2710. { 2711. AVFormatContext *s = *ps; 2712. AVIOContext *pb = s->pb; ^ 2713. 2714. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || libavformat/utils.c:2714:10: Taking true branch 2712. AVIOContext *pb = s->pb; 2713. 2714. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || ^ 2715. (s->flags & AVFMT_FLAG_CUSTOM_IO)) 2716. pb = NULL; libavformat/utils.c:2714:24: Taking false branch 2712. AVIOContext *pb = s->pb; 2713. 2714. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || ^ 2715. (s->flags & AVFMT_FLAG_CUSTOM_IO)) 2716. pb = NULL; libavformat/utils.c:2715:10: Taking true branch 2713. 2714. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || 2715. (s->flags & AVFMT_FLAG_CUSTOM_IO)) ^ 2716. pb = NULL; 2717. libavformat/utils.c:2716:9: 2714. if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || 2715. (s->flags & AVFMT_FLAG_CUSTOM_IO)) 2716. pb = NULL; ^ 2717. 2718. flush_packet_queue(s); libavformat/utils.c:2718:5: Skipping flush_packet_queue(): empty list of specs 2716. pb = NULL; 2717. 2718. flush_packet_queue(s); ^ 2719. 2720. if (s->iformat) { libavformat/utils.c:2720:9: Taking true branch 2718. flush_packet_queue(s); 2719. 2720. if (s->iformat) { ^ 2721. if (s->iformat->read_close) 2722. s->iformat->read_close(s); libavformat/utils.c:2721:13: Taking true branch 2719. 2720. if (s->iformat) { 2721. if (s->iformat->read_close) ^ 2722. s->iformat->read_close(s); 2723. } libavformat/utils.c:2722:13: Skipping __function_pointer__(): unresolved function pointer 2720. if (s->iformat) { 2721. if (s->iformat->read_close) 2722. s->iformat->read_close(s); ^ 2723. } 2724. libavformat/utils.c:2725:5: Skipping avformat_free_context(): empty list of specs 2723. } 2724. 2725. avformat_free_context(s); ^ 2726. 2727. *ps = NULL; libavformat/utils.c:2727:5: 2725. avformat_free_context(s); 2726. 2727. *ps = NULL; ^ 2728. 2729. avio_close(pb); libavformat/utils.c:2729:5: 2727. *ps = NULL; 2728. 2729. avio_close(pb); ^ 2730. } 2731. libavformat/aviobuf.c:757:1: start of procedure avio_close() 755. } 756. 757. int avio_close(AVIOContext *s) ^ 758. { 759. URLContext *h; libavformat/aviobuf.c:761:10: Taking false branch 759. URLContext *h; 760. 761. if (!s) ^ 762. return 0; 763. libavformat/aviobuf.c:764:5: 762. return 0; 763. 764. avio_flush(s); ^ 765. h = s->opaque; 766. av_freep(&s->buffer); libavformat/aviobuf.c:174:1: start of procedure avio_flush() 172. } 173. 174. void avio_flush(AVIOContext *s) ^ 175. { 176. flush_buffer(s); libavformat/aviobuf.c:176:5: 174. void avio_flush(AVIOContext *s) 175. { 176. flush_buffer(s); ^ 177. s->must_flush = 0; 178. } libavformat/aviobuf.c:120:1: start of procedure flush_buffer() 118. } 119. 120. static void flush_buffer(AVIOContext *s) ^ 121. { 122. if (s->buf_ptr > s->buffer) { libavformat/aviobuf.c:122:9: 120. static void flush_buffer(AVIOContext *s) 121. { 122. if (s->buf_ptr > s->buffer) { ^ 123. if (s->write_packet && !s->error){ 124. int ret= s->write_packet(s->opaque, s->buffer, s->buf_ptr - s->buffer);
https://github.com/libav/libav/blob/1cc569dddadfedabe970ce7408dba7ddf381e98b/libavformat/utils.c/#L2729
d2a_code_trace_data_41971
int MAIN(int argc, char **argv) { ENGINE *e; unsigned char *buf=NULL,*buf2=NULL; int mret=1; long count,rsa_count,save_count=0; int i,j,k; #ifndef OPENSSL_NO_RSA unsigned rsa_num; #endif unsigned char md[EVP_MAX_MD_SIZE]; #ifndef OPENSSL_NO_MD2 unsigned char md2[MD2_DIGEST_LENGTH]; #endif #ifndef OPENSSL_NO_MDC2 unsigned char mdc2[MDC2_DIGEST_LENGTH]; #endif #ifndef OPENSSL_NO_MD4 unsigned char md4[MD4_DIGEST_LENGTH]; #endif #ifndef OPENSSL_NO_MD5 unsigned char md5[MD5_DIGEST_LENGTH]; unsigned char hmac[MD5_DIGEST_LENGTH]; #endif #ifndef OPENSSL_NO_SHA unsigned char sha[SHA_DIGEST_LENGTH]; #endif #ifndef OPENSSL_NO_RIPEMD unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; #endif #ifndef OPENSSL_NO_RC4 RC4_KEY rc4_ks; #endif #ifndef OPENSSL_NO_RC5 RC5_32_KEY rc5_ks; #endif #ifndef OPENSSL_NO_RC2 RC2_KEY rc2_ks; #endif #ifndef OPENSSL_NO_IDEA IDEA_KEY_SCHEDULE idea_ks; #endif #ifndef OPENSSL_NO_BF BF_KEY bf_ks; #endif #ifndef OPENSSL_NO_CAST CAST_KEY cast_ks; #endif static unsigned char key16[16]= {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0, 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; unsigned char iv[8]; #ifndef OPENSSL_NO_DES DES_cblock *buf_as_des_cblock = NULL; static des_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; static des_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; static des_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; DES_key_schedule sch; DES_key_schedule sch2; DES_key_schedule sch3; #endif #define D_MD2 0 #define D_MDC2 1 #define D_MD4 2 #define D_MD5 3 #define D_HMAC 4 #define D_SHA1 5 #define D_RMD160 6 #define D_RC4 7 #define D_CBC_DES 8 #define D_EDE3_DES 9 #define D_CBC_IDEA 10 #define D_CBC_RC2 11 #define D_CBC_RC5 12 #define D_CBC_BF 13 #define D_CBC_CAST 14 #define D_EVP 15 double d; long c[ALGOR_NUM][SIZE_NUM]; #define R_DSA_512 0 #define R_DSA_1024 1 #define R_DSA_2048 2 #define R_RSA_512 0 #define R_RSA_1024 1 #define R_RSA_2048 2 #define R_RSA_4096 3 #ifndef OPENSSL_NO_RSA RSA *rsa_key[RSA_NUM]; long rsa_c[RSA_NUM][2]; static unsigned int rsa_bits[RSA_NUM]={512,1024,2048,4096}; static unsigned char *rsa_data[RSA_NUM]= {test512,test1024,test2048,test4096}; static int rsa_data_length[RSA_NUM]={ sizeof(test512),sizeof(test1024), sizeof(test2048),sizeof(test4096)}; #endif #ifndef OPENSSL_NO_DSA DSA *dsa_key[DSA_NUM]; long dsa_c[DSA_NUM][2]; static unsigned int dsa_bits[DSA_NUM]={512,1024,2048}; #endif int rsa_doit[RSA_NUM]; int dsa_doit[DSA_NUM]; int doit[ALGOR_NUM]; int pr_header=0; const EVP_CIPHER *evp_cipher=NULL; const EVP_MD *evp_md=NULL; int decrypt=0; #ifdef HAVE_FORK int multi=0; #endif #ifndef TIMES usertime=-1; #endif apps_startup(); memset(results, 0, sizeof(results)); #ifndef OPENSSL_NO_DSA memset(dsa_key,0,sizeof(dsa_key)); #endif if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); #ifndef OPENSSL_NO_RSA memset(rsa_key,0,sizeof(rsa_key)); for (i=0; i<RSA_NUM; i++) rsa_key[i]=NULL; #endif if ((buf=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL) { BIO_printf(bio_err,"out of memory\n"); goto end; } #ifndef OPENSSL_NO_DES buf_as_des_cblock = (des_cblock *)buf; #endif if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL) { BIO_printf(bio_err,"out of memory\n"); goto end; } memset(c,0,sizeof(c)); memset(iv,0,sizeof(iv)); for (i=0; i<ALGOR_NUM; i++) doit[i]=0; for (i=0; i<RSA_NUM; i++) rsa_doit[i]=0; for (i=0; i<DSA_NUM; i++) dsa_doit[i]=0; j=0; argc--; argv++; while (argc) { if ((argc > 0) && (strcmp(*argv,"-elapsed") == 0)) { usertime = 0; j--; } else if ((argc > 0) && (strcmp(*argv,"-evp") == 0)) { argc--; argv++; if(argc == 0) { BIO_printf(bio_err,"no EVP given\n"); goto end; } evp_cipher=EVP_get_cipherbyname(*argv); if(!evp_cipher) { evp_md=EVP_get_digestbyname(*argv); } if(!evp_cipher && !evp_md) { BIO_printf(bio_err,"%s is an unknown cipher or digest\n",*argv); goto end; } doit[D_EVP]=1; } else if (argc > 0 && !strcmp(*argv,"-decrypt")) { decrypt=1; j--; } else if ((argc > 0) && (strcmp(*argv,"-engine") == 0)) { argc--; argv++; if(argc == 0) { BIO_printf(bio_err,"no engine given\n"); goto end; } e = setup_engine(bio_err, *argv, 0); j--; } #ifdef HAVE_FORK else if ((argc > 0) && (strcmp(*argv,"-multi") == 0)) { argc--; argv++; if(argc == 0) { BIO_printf(bio_err,"no multi count given\n"); goto end; } multi=atoi(argv[0]); if(multi <= 0) { BIO_printf(bio_err,"bad multi count\n"); goto end; } j--; } #endif else if (argc > 0 && !strcmp(*argv,"-mr")) { mr=1; j--; } else #ifndef OPENSSL_NO_MD2 if (strcmp(*argv,"md2") == 0) doit[D_MD2]=1; else #endif #ifndef OPENSSL_NO_MDC2 if (strcmp(*argv,"mdc2") == 0) doit[D_MDC2]=1; else #endif #ifndef OPENSSL_NO_MD4 if (strcmp(*argv,"md4") == 0) doit[D_MD4]=1; else #endif #ifndef OPENSSL_NO_MD5 if (strcmp(*argv,"md5") == 0) doit[D_MD5]=1; else #endif #ifndef OPENSSL_NO_MD5 if (strcmp(*argv,"hmac") == 0) doit[D_HMAC]=1; else #endif #ifndef OPENSSL_NO_SHA if (strcmp(*argv,"sha1") == 0) doit[D_SHA1]=1; else if (strcmp(*argv,"sha") == 0) doit[D_SHA1]=1; else #endif #ifndef OPENSSL_NO_RIPEMD if (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1; else if (strcmp(*argv,"rmd160") == 0) doit[D_RMD160]=1; else if (strcmp(*argv,"ripemd160") == 0) doit[D_RMD160]=1; else #endif #ifndef OPENSSL_NO_RC4 if (strcmp(*argv,"rc4") == 0) doit[D_RC4]=1; else #endif #ifndef OPENSSL_NO_DES if (strcmp(*argv,"des-cbc") == 0) doit[D_CBC_DES]=1; else if (strcmp(*argv,"des-ede3") == 0) doit[D_EDE3_DES]=1; else #endif #ifndef OPENSSL_NO_RSA #if 0 if (strcmp(*argv,"rsaref") == 0) { RSA_set_default_openssl_method(RSA_PKCS1_RSAref()); j--; } else #endif #ifndef RSA_NULL if (strcmp(*argv,"openssl") == 0) { RSA_set_default_method(RSA_PKCS1_SSLeay()); j--; } else #endif #endif if (strcmp(*argv,"dsa512") == 0) dsa_doit[R_DSA_512]=2; else if (strcmp(*argv,"dsa1024") == 0) dsa_doit[R_DSA_1024]=2; else if (strcmp(*argv,"dsa2048") == 0) dsa_doit[R_DSA_2048]=2; else if (strcmp(*argv,"rsa512") == 0) rsa_doit[R_RSA_512]=2; else if (strcmp(*argv,"rsa1024") == 0) rsa_doit[R_RSA_1024]=2; else if (strcmp(*argv,"rsa2048") == 0) rsa_doit[R_RSA_2048]=2; else if (strcmp(*argv,"rsa4096") == 0) rsa_doit[R_RSA_4096]=2; else #ifndef OPENSSL_NO_RC2 if (strcmp(*argv,"rc2-cbc") == 0) doit[D_CBC_RC2]=1; else if (strcmp(*argv,"rc2") == 0) doit[D_CBC_RC2]=1; else #endif #ifndef OPENSSL_NO_RC5 if (strcmp(*argv,"rc5-cbc") == 0) doit[D_CBC_RC5]=1; else if (strcmp(*argv,"rc5") == 0) doit[D_CBC_RC5]=1; else #endif #ifndef OPENSSL_NO_IDEA if (strcmp(*argv,"idea-cbc") == 0) doit[D_CBC_IDEA]=1; else if (strcmp(*argv,"idea") == 0) doit[D_CBC_IDEA]=1; else #endif #ifndef OPENSSL_NO_BF if (strcmp(*argv,"bf-cbc") == 0) doit[D_CBC_BF]=1; else if (strcmp(*argv,"blowfish") == 0) doit[D_CBC_BF]=1; else if (strcmp(*argv,"bf") == 0) doit[D_CBC_BF]=1; else #endif #ifndef OPENSSL_NO_CAST if (strcmp(*argv,"cast-cbc") == 0) doit[D_CBC_CAST]=1; else if (strcmp(*argv,"cast") == 0) doit[D_CBC_CAST]=1; else if (strcmp(*argv,"cast5") == 0) doit[D_CBC_CAST]=1; else #endif #ifndef OPENSSL_NO_DES if (strcmp(*argv,"des") == 0) { doit[D_CBC_DES]=1; doit[D_EDE3_DES]=1; } else #endif #ifndef OPENSSL_NO_RSA if (strcmp(*argv,"rsa") == 0) { rsa_doit[R_RSA_512]=1; rsa_doit[R_RSA_1024]=1; rsa_doit[R_RSA_2048]=1; rsa_doit[R_RSA_4096]=1; } else #endif #ifndef OPENSSL_NO_DSA if (strcmp(*argv,"dsa") == 0) { dsa_doit[R_DSA_512]=1; dsa_doit[R_DSA_1024]=1; } else #endif { BIO_printf(bio_err,"Error: bad option or value\n"); BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"Available values:\n"); #ifndef OPENSSL_NO_MD2 BIO_printf(bio_err,"md2 "); #endif #ifndef OPENSSL_NO_MDC2 BIO_printf(bio_err,"mdc2 "); #endif #ifndef OPENSSL_NO_MD4 BIO_printf(bio_err,"md4 "); #endif #ifndef OPENSSL_NO_MD5 BIO_printf(bio_err,"md5 "); #ifndef OPENSSL_NO_HMAC BIO_printf(bio_err,"hmac "); #endif #endif #ifndef OPENSSL_NO_SHA1 BIO_printf(bio_err,"sha1 "); #endif #ifndef OPENSSL_NO_RIPEMD160 BIO_printf(bio_err,"rmd160"); #endif #if !defined(OPENSSL_NO_MD2) || !defined(OPENSSL_NO_MDC2) || \ !defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \ !defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160) BIO_printf(bio_err,"\n"); #endif #ifndef OPENSSL_NO_IDEA BIO_printf(bio_err,"idea-cbc "); #endif #ifndef OPENSSL_NO_RC2 BIO_printf(bio_err,"rc2-cbc "); #endif #ifndef OPENSSL_NO_RC5 BIO_printf(bio_err,"rc5-cbc "); #endif #ifndef OPENSSL_NO_BF BIO_printf(bio_err,"bf-cbc"); #endif #if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_RC2) || \ !defined(OPENSSL_NO_BF) || !defined(OPENSSL_NO_RC5) BIO_printf(bio_err,"\n"); #endif BIO_printf(bio_err,"des-cbc des-ede3 "); #ifndef OPENSSL_NO_RC4 BIO_printf(bio_err,"rc4"); #endif BIO_printf(bio_err,"\n"); #ifndef OPENSSL_NO_RSA BIO_printf(bio_err,"rsa512 rsa1024 rsa2048 rsa4096\n"); #endif #ifndef OPENSSL_NO_DSA BIO_printf(bio_err,"dsa512 dsa1024 dsa2048\n"); #endif #ifndef OPENSSL_NO_IDEA BIO_printf(bio_err,"idea "); #endif #ifndef OPENSSL_NO_RC2 BIO_printf(bio_err,"rc2 "); #endif #ifndef OPENSSL_NO_DES BIO_printf(bio_err,"des "); #endif #ifndef OPENSSL_NO_RSA BIO_printf(bio_err,"rsa "); #endif #ifndef OPENSSL_NO_BF BIO_printf(bio_err,"blowfish"); #endif #if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_RC2) || \ !defined(OPENSSL_NO_DES) || !defined(OPENSSL_NO_RSA) || \ !defined(OPENSSL_NO_BF) BIO_printf(bio_err,"\n"); #endif BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"Available options:\n"); #ifdef TIMES BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n"); #endif BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err,"-evp e use EVP e.\n"); BIO_printf(bio_err,"-decrypt time decryption instead of encryption (only EVP).\n"); BIO_printf(bio_err,"-mr produce machine readable output.\n"); #ifdef HAVE_FORK BIO_printf(bio_err,"-multi n run n benchmarks in parallel.\n"); #endif goto end; } argc--; argv++; j++; } #ifdef HAVE_FORK if(multi && do_multi(multi)) goto show_res; #endif if (j == 0) { for (i=0; i<ALGOR_NUM; i++) { if (i != D_EVP) doit[i]=1; } for (i=0; i<RSA_NUM; i++) rsa_doit[i]=1; for (i=0; i<DSA_NUM; i++) dsa_doit[i]=1; } for (i=0; i<ALGOR_NUM; i++) if (doit[i]) pr_header++; if (usertime == 0 && !mr) BIO_printf(bio_err,"You have chosen to measure elapsed time instead of user CPU time.\n"); if (usertime <= 0 && !mr) { BIO_printf(bio_err,"To get the most accurate results, try to run this\n"); BIO_printf(bio_err,"program when this computer is idle.\n"); } #ifndef OPENSSL_NO_RSA for (i=0; i<RSA_NUM; i++) { const unsigned char *p; p=rsa_data[i]; rsa_key[i]=d2i_RSAPrivateKey(NULL,&p,rsa_data_length[i]); if (rsa_key[i] == NULL) { BIO_printf(bio_err,"internal error loading RSA key number %d\n",i); goto end; } #if 0 else { BIO_printf(bio_err,mr ? "+RK:%d:" : "Loaded RSA key, %d bit modulus and e= 0x", BN_num_bits(rsa_key[i]->n)); BN_print(bio_err,rsa_key[i]->e); BIO_printf(bio_err,"\n"); } #endif } #endif #ifndef OPENSSL_NO_DSA dsa_key[0]=get_dsa512(); dsa_key[1]=get_dsa1024(); dsa_key[2]=get_dsa2048(); #endif #ifndef OPENSSL_NO_DES DES_set_key_unchecked(&key,&sch); DES_set_key_unchecked(&key2,&sch2); DES_set_key_unchecked(&key3,&sch3); #endif #ifndef OPENSSL_NO_IDEA idea_set_encrypt_key(key16,&idea_ks); #endif #ifndef OPENSSL_NO_RC4 RC4_set_key(&rc4_ks,16,key16); #endif #ifndef OPENSSL_NO_RC2 RC2_set_key(&rc2_ks,16,key16,128); #endif #ifndef OPENSSL_NO_RC5 RC5_32_set_key(&rc5_ks,16,key16,12); #endif #ifndef OPENSSL_NO_BF BF_set_key(&bf_ks,16,key16); #endif #ifndef OPENSSL_NO_CAST CAST_set_key(&cast_ks,16,key16); #endif #ifndef OPENSSL_NO_RSA memset(rsa_c,0,sizeof(rsa_c)); #endif #ifndef SIGALRM #ifndef OPENSSL_NO_DES BIO_printf(bio_err,"First we calculate the approximate speed ...\n"); count=10; do { long i; count*=2; Time_F(START); for (i=count; i; i--) DES_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock, &sch,DES_ENCRYPT); d=Time_F(STOP); } while (d <3); save_count=count; c[D_MD2][0]=count/10; c[D_MDC2][0]=count/10; c[D_MD4][0]=count; c[D_MD5][0]=count; c[D_HMAC][0]=count; c[D_SHA1][0]=count; c[D_RMD160][0]=count; c[D_RC4][0]=count*5; c[D_CBC_DES][0]=count; c[D_EDE3_DES][0]=count/3; c[D_CBC_IDEA][0]=count; c[D_CBC_RC2][0]=count; c[D_CBC_RC5][0]=count; c[D_CBC_BF][0]=count; c[D_CBC_CAST][0]=count; for (i=1; i<SIZE_NUM; i++) { c[D_MD2][i]=c[D_MD2][0]*4*lengths[0]/lengths[i]; c[D_MDC2][i]=c[D_MDC2][0]*4*lengths[0]/lengths[i]; c[D_MD4][i]=c[D_MD4][0]*4*lengths[0]/lengths[i]; c[D_MD5][i]=c[D_MD5][0]*4*lengths[0]/lengths[i]; c[D_HMAC][i]=c[D_HMAC][0]*4*lengths[0]/lengths[i]; c[D_SHA1][i]=c[D_SHA1][0]*4*lengths[0]/lengths[i]; c[D_RMD160][i]=c[D_RMD160][0]*4*lengths[0]/lengths[i]; } for (i=1; i<SIZE_NUM; i++) { long l0,l1; l0=(long)lengths[i-1]; l1=(long)lengths[i]; c[D_RC4][i]=c[D_RC4][i-1]*l0/l1; c[D_CBC_DES][i]=c[D_CBC_DES][i-1]*l0/l1; c[D_EDE3_DES][i]=c[D_EDE3_DES][i-1]*l0/l1; c[D_CBC_IDEA][i]=c[D_CBC_IDEA][i-1]*l0/l1; c[D_CBC_RC2][i]=c[D_CBC_RC2][i-1]*l0/l1; c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1; c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1; c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1; } #ifndef OPENSSL_NO_RSA rsa_c[R_RSA_512][0]=count/2000; rsa_c[R_RSA_512][1]=count/400; for (i=1; i<RSA_NUM; i++) { rsa_c[i][0]=rsa_c[i-1][0]/8; rsa_c[i][1]=rsa_c[i-1][1]/4; if ((rsa_doit[i] <= 1) && (rsa_c[i][0] == 0)) rsa_doit[i]=0; else { if (rsa_c[i][0] == 0) { rsa_c[i][0]=1; rsa_c[i][1]=20; } } } #endif #ifndef OPENSSL_NO_DSA dsa_c[R_DSA_512][0]=count/1000; dsa_c[R_DSA_512][1]=count/1000/2; for (i=1; i<DSA_NUM; i++) { dsa_c[i][0]=dsa_c[i-1][0]/4; dsa_c[i][1]=dsa_c[i-1][1]/4; if ((dsa_doit[i] <= 1) && (dsa_c[i][0] == 0)) dsa_doit[i]=0; else { if (dsa_c[i] == 0) { dsa_c[i][0]=1; dsa_c[i][1]=1; } } } #endif #define COND(d) (count < (d)) #define COUNT(d) (d) #else # error "You cannot disable DES on systems without SIGALRM." #endif #else #define COND(c) (run) #define COUNT(d) (count) signal(SIGALRM,sig_done); #endif #ifndef OPENSSL_NO_MD2 if (doit[D_MD2]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_MD2],c[D_MD2][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_MD2][j]); count++) EVP_Digest(buf,(unsigned long)lengths[j],&(md2[0]),NULL,EVP_md2(),NULL); d=Time_F(STOP); print_result(D_MD2,j,count,d); } } #endif #ifndef OPENSSL_NO_MDC2 if (doit[D_MDC2]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_MDC2],c[D_MDC2][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_MDC2][j]); count++) EVP_Digest(buf,(unsigned long)lengths[j],&(mdc2[0]),NULL,EVP_mdc2(),NULL); d=Time_F(STOP); print_result(D_MDC2,j,count,d); } } #endif #ifndef OPENSSL_NO_MD4 if (doit[D_MD4]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_MD4],c[D_MD4][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_MD4][j]); count++) EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md4[0]),NULL,EVP_md4(),NULL); d=Time_F(STOP); print_result(D_MD4,j,count,d); } } #endif #ifndef OPENSSL_NO_MD5 if (doit[D_MD5]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_MD5],c[D_MD5][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_MD5][j]); count++) EVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md5[0]),NULL,EVP_get_digestbyname("md5"),NULL); d=Time_F(STOP); print_result(D_MD5,j,count,d); } } #endif #if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_HMAC) if (doit[D_HMAC]) { HMAC_CTX hctx; HMAC_CTX_init(&hctx); HMAC_Init(&hctx,(unsigned char *)"This is a key...", 16,EVP_md5()); for (j=0; j<SIZE_NUM; j++) { print_message(names[D_HMAC],c[D_HMAC][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_HMAC][j]); count++) { HMAC_Init(&hctx,NULL,0,NULL); HMAC_Update(&hctx,buf,lengths[j]); HMAC_Final(&hctx,&(hmac[0]),NULL); } d=Time_F(STOP); print_result(D_HMAC,j,count,d); } HMAC_CTX_cleanup(&hctx); } #endif #ifndef OPENSSL_NO_SHA if (doit[D_SHA1]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_SHA1],c[D_SHA1][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_SHA1][j]); count++) EVP_Digest(buf,(unsigned long)lengths[j],&(sha[0]),NULL,EVP_sha1(),NULL); d=Time_F(STOP); print_result(D_SHA1,j,count,d); } } #endif #ifndef OPENSSL_NO_RIPEMD if (doit[D_RMD160]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_RMD160],c[D_RMD160][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_RMD160][j]); count++) EVP_Digest(buf,(unsigned long)lengths[j],&(rmd160[0]),NULL,EVP_ripemd160(),NULL); d=Time_F(STOP); print_result(D_RMD160,j,count,d); } } #endif #ifndef OPENSSL_NO_RC4 if (doit[D_RC4]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_RC4],c[D_RC4][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_RC4][j]); count++) RC4(&rc4_ks,(unsigned int)lengths[j], buf,buf); d=Time_F(STOP); print_result(D_RC4,j,count,d); } } #endif #ifndef OPENSSL_NO_DES if (doit[D_CBC_DES]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_DES],c[D_CBC_DES][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_DES][j]); count++) DES_ncbc_encrypt(buf,buf,lengths[j],&sch, &iv,DES_ENCRYPT); d=Time_F(STOP); print_result(D_CBC_DES,j,count,d); } } if (doit[D_EDE3_DES]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_EDE3_DES],c[D_EDE3_DES][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_EDE3_DES][j]); count++) DES_ede3_cbc_encrypt(buf,buf,lengths[j], &sch,&sch2,&sch3, &iv,DES_ENCRYPT); d=Time_F(STOP); print_result(D_EDE3_DES,j,count,d); } } #endif #ifndef OPENSSL_NO_IDEA if (doit[D_CBC_IDEA]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_IDEA],c[D_CBC_IDEA][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_IDEA][j]); count++) idea_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&idea_ks, iv,IDEA_ENCRYPT); d=Time_F(STOP); print_result(D_CBC_IDEA,j,count,d); } } #endif #ifndef OPENSSL_NO_RC2 if (doit[D_CBC_RC2]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_RC2],c[D_CBC_RC2][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_RC2][j]); count++) RC2_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&rc2_ks, iv,RC2_ENCRYPT); d=Time_F(STOP); print_result(D_CBC_RC2,j,count,d); } } #endif #ifndef OPENSSL_NO_RC5 if (doit[D_CBC_RC5]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_RC5],c[D_CBC_RC5][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_RC5][j]); count++) RC5_32_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&rc5_ks, iv,RC5_ENCRYPT); d=Time_F(STOP); print_result(D_CBC_RC5,j,count,d); } } #endif #ifndef OPENSSL_NO_BF if (doit[D_CBC_BF]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_BF],c[D_CBC_BF][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_BF][j]); count++) BF_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&bf_ks, iv,BF_ENCRYPT); d=Time_F(STOP); print_result(D_CBC_BF,j,count,d); } } #endif #ifndef OPENSSL_NO_CAST if (doit[D_CBC_CAST]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_CAST],c[D_CBC_CAST][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_CAST][j]); count++) CAST_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&cast_ks, iv,CAST_ENCRYPT); d=Time_F(STOP); print_result(D_CBC_CAST,j,count,d); } } #endif if (doit[D_EVP]) { for (j=0; j<SIZE_NUM; j++) { if (evp_cipher) { EVP_CIPHER_CTX ctx; int outl; names[D_EVP]=OBJ_nid2ln(evp_cipher->nid); print_message(names[D_EVP],save_count, lengths[j]); EVP_CIPHER_CTX_init(&ctx); if(decrypt) EVP_DecryptInit_ex(&ctx,evp_cipher,NULL,key16,iv); else EVP_EncryptInit_ex(&ctx,evp_cipher,NULL,key16,iv); Time_F(START); if(decrypt) for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++) EVP_DecryptUpdate(&ctx,buf,&outl,buf,lengths[j]); else for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++) EVP_EncryptUpdate(&ctx,buf,&outl,buf,lengths[j]); if(decrypt) EVP_DecryptFinal_ex(&ctx,buf,&outl); else EVP_EncryptFinal_ex(&ctx,buf,&outl); d=Time_F(STOP); } if (evp_md) { names[D_EVP]=OBJ_nid2ln(evp_md->type); print_message(names[D_EVP],save_count, lengths[j]); Time_F(START); for (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++) EVP_Digest(buf,lengths[j],&(md[0]),NULL,evp_md,NULL); d=Time_F(STOP); } print_result(D_EVP,j,count,d); } } RAND_pseudo_bytes(buf,36); #ifndef OPENSSL_NO_RSA for (j=0; j<RSA_NUM; j++) { int ret; if (!rsa_doit[j]) continue; ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]); if (ret == 0) { BIO_printf(bio_err,"RSA sign failure. No RSA sign will be done.\n"); ERR_print_errors(bio_err); rsa_count=1; } else { pkey_print_message("private","rsa", rsa_c[j][0],rsa_bits[j], RSA_SECONDS); Time_F(START); for (count=0,run=1; COND(rsa_c[j][0]); count++) { ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]); if (ret == 0) { BIO_printf(bio_err, "RSA sign failure\n"); ERR_print_errors(bio_err); count=1; break; } } d=Time_F(STOP); BIO_printf(bio_err,mr ? "+R1:%ld:%d:%.2f\n" : "%ld %d bit private RSA's in %.2fs\n", count,rsa_bits[j],d); rsa_results[j][0]=d/(double)count; rsa_count=count; } #if 1 ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]); if (ret <= 0) { BIO_printf(bio_err,"RSA verify failure. No RSA verify will be done.\n"); ERR_print_errors(bio_err); rsa_doit[j] = 0; } else { pkey_print_message("public","rsa", rsa_c[j][1],rsa_bits[j], RSA_SECONDS); Time_F(START); for (count=0,run=1; COND(rsa_c[j][1]); count++) { ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]); if (ret == 0) { BIO_printf(bio_err, "RSA verify failure\n"); ERR_print_errors(bio_err); count=1; break; } } d=Time_F(STOP); BIO_printf(bio_err,mr ? "+R2:%ld:%d:%.2f\n" : "%ld %d bit public RSA's in %.2fs\n", count,rsa_bits[j],d); rsa_results[j][1]=d/(double)count; } #endif if (rsa_count <= 1) { for (j++; j<RSA_NUM; j++) rsa_doit[j]=0; } } #endif RAND_pseudo_bytes(buf,20); #ifndef OPENSSL_NO_DSA if (RAND_status() != 1) { RAND_seed(rnd_seed, sizeof rnd_seed); rnd_fake = 1; } for (j=0; j<DSA_NUM; j++) { unsigned int kk; int ret; if (!dsa_doit[j]) continue; ret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2, &kk,dsa_key[j]); if (ret == 0) { BIO_printf(bio_err,"DSA sign failure. No DSA sign will be done.\n"); ERR_print_errors(bio_err); rsa_count=1; } else { pkey_print_message("sign","dsa", dsa_c[j][0],dsa_bits[j], DSA_SECONDS); Time_F(START); for (count=0,run=1; COND(dsa_c[j][0]); count++) { ret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2, &kk,dsa_key[j]); if (ret == 0) { BIO_printf(bio_err, "DSA sign failure\n"); ERR_print_errors(bio_err); count=1; break; } } d=Time_F(STOP); BIO_printf(bio_err,mr ? "+R3:%ld:%d:%.2f\n" : "%ld %d bit DSA signs in %.2fs\n", count,dsa_bits[j],d); dsa_results[j][0]=d/(double)count; rsa_count=count; } ret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2, kk,dsa_key[j]); if (ret <= 0) { BIO_printf(bio_err,"DSA verify failure. No DSA verify will be done.\n"); ERR_print_errors(bio_err); dsa_doit[j] = 0; } else { pkey_print_message("verify","dsa", dsa_c[j][1],dsa_bits[j], DSA_SECONDS); Time_F(START); for (count=0,run=1; COND(dsa_c[j][1]); count++) { ret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2, kk,dsa_key[j]); if (ret <= 0) { BIO_printf(bio_err, "DSA verify failure\n"); ERR_print_errors(bio_err); count=1; break; } } d=Time_F(STOP); BIO_printf(bio_err,mr ? "+R4:%ld:%d:%.2f\n" : "%ld %d bit DSA verify in %.2fs\n", count,dsa_bits[j],d); dsa_results[j][1]=d/(double)count; } if (rsa_count <= 1) { for (j++; j<DSA_NUM; j++) dsa_doit[j]=0; } } if (rnd_fake) RAND_cleanup(); #endif #ifdef HAVE_FORK show_res: #endif if(!mr) { fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_VERSION)); fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_BUILT_ON)); printf("options:"); printf("%s ",BN_options()); #ifndef OPENSSL_NO_MD2 printf("%s ",MD2_options()); #endif #ifndef OPENSSL_NO_RC4 printf("%s ",RC4_options()); #endif #ifndef OPENSSL_NO_DES printf("%s ",des_options()); #endif #ifndef OPENSSL_NO_IDEA printf("%s ",idea_options()); #endif #ifndef OPENSSL_NO_BF printf("%s ",BF_options()); #endif fprintf(stdout,"\n%s\n",SSLeay_version(SSLEAY_CFLAGS)); printf("available timing options: "); #ifdef TIMES printf("TIMES "); #endif #ifdef TIMEB printf("TIMEB "); #endif #ifdef USE_TOD printf("USE_TOD "); #endif #ifdef HZ #define as_string(s) (#s) printf("HZ=%g", HZ); # ifdef _SC_CLK_TCK printf(" [sysconf value]"); # endif #endif printf("\n"); printf("timing function used: %s%s%s%s%s%s%s\n", (ftime_used ? "ftime" : ""), (ftime_used + times_used > 1 ? "," : ""), (times_used ? "times" : ""), (ftime_used + times_used + gettimeofday_used > 1 ? "," : ""), (gettimeofday_used ? "gettimeofday" : ""), (ftime_used + times_used + gettimeofday_used + getrusage_used > 1 ? "," : ""), (getrusage_used ? "getrusage" : "")); } if (pr_header) { if(mr) fprintf(stdout,"+H"); else { fprintf(stdout,"The 'numbers' are in 1000s of bytes per second processed.\n"); fprintf(stdout,"type "); } for (j=0; j<SIZE_NUM; j++) fprintf(stdout,mr ? ":%d" : "%7d bytes",lengths[j]); fprintf(stdout,"\n"); } for (k=0; k<ALGOR_NUM; k++) { if (!doit[k]) continue; if(mr) fprintf(stdout,"+F:%d:%s",k,names[k]); else fprintf(stdout,"%-13s",names[k]); for (j=0; j<SIZE_NUM; j++) { if (results[k][j] > 10000 && !mr) fprintf(stdout," %11.2fk",results[k][j]/1e3); else fprintf(stdout,mr ? ":%.2f" : " %11.2f ",results[k][j]); } fprintf(stdout,"\n"); } #ifndef OPENSSL_NO_RSA j=1; for (k=0; k<RSA_NUM; k++) { if (!rsa_doit[k]) continue; if (j && !mr) { printf("%18ssign verify sign/s verify/s\n"," "); j=0; } if(mr) fprintf(stdout,"+F2:%u:%u:%f:%f\n", k,rsa_bits[k],rsa_results[k][0], rsa_results[k][1]); else fprintf(stdout,"rsa %4u bits %8.4fs %8.4fs %8.1f %8.1f\n", rsa_bits[k],rsa_results[k][0],rsa_results[k][1], 1.0/rsa_results[k][0],1.0/rsa_results[k][1]); } #endif #ifndef OPENSSL_NO_DSA j=1; for (k=0; k<DSA_NUM; k++) { if (!dsa_doit[k]) continue; if (j && !mr) { printf("%18ssign verify sign/s verify/s\n"," "); j=0; } if(mr) fprintf(stdout,"+F3:%u:%u:%f:%f\n", k,dsa_bits[k],dsa_results[k][0],dsa_results[k][1]); else fprintf(stdout,"dsa %4u bits %8.4fs %8.4fs %8.1f %8.1f\n", dsa_bits[k],dsa_results[k][0],dsa_results[k][1], 1.0/dsa_results[k][0],1.0/dsa_results[k][1]); } #endif mret=0; end: ERR_print_errors(bio_err); if (buf != NULL) OPENSSL_free(buf); if (buf2 != NULL) OPENSSL_free(buf2); #ifndef OPENSSL_NO_RSA for (i=0; i<RSA_NUM; i++) if (rsa_key[i] != NULL) RSA_free(rsa_key[i]); #endif #ifndef OPENSSL_NO_DSA for (i=0; i<DSA_NUM; i++) if (dsa_key[i] != NULL) DSA_free(dsa_key[i]); #endif apps_shutdown(); EXIT(mret); } apps/speed.c:1285: error: UNINITIALIZED_VALUE The value read from count was never initialized. Showing all 1 steps of the trace apps/speed.c:1285:4: 1283. d=Time_F(STOP); 1284. } 1285. > print_result(D_EVP,j,count,d); 1286. } 1287. }
https://github.com/openssl/openssl/blob/f3e24baddfdab36524ab8172edf0f7f4b15666be/apps/speed.c/#L1285
d2a_code_trace_data_41972
static void await_references(H264Context *h){ MpegEncContext * const s = &h->s; const int mb_xy= h->mb_xy; const int mb_type= s->current_picture.mb_type[mb_xy]; int refs[2][48]; int nrefs[2] = {0}; int ref, list; memset(refs, -1, sizeof(refs)); if(IS_16X16(mb_type)){ get_lowest_part_y(h, refs, 0, 16, 0, IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs); }else if(IS_16X8(mb_type)){ get_lowest_part_y(h, refs, 0, 8, 0, IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs); get_lowest_part_y(h, refs, 8, 8, 8, IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs); }else if(IS_8X16(mb_type)){ get_lowest_part_y(h, refs, 0, 16, 0, IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs); get_lowest_part_y(h, refs, 4, 16, 0, IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs); }else{ int i; assert(IS_8X8(mb_type)); for(i=0; i<4; i++){ const int sub_mb_type= h->sub_mb_type[i]; const int n= 4*i; int y_offset= (i&2)<<2; if(IS_SUB_8X8(sub_mb_type)){ get_lowest_part_y(h, refs, n , 8, y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); }else if(IS_SUB_8X4(sub_mb_type)){ get_lowest_part_y(h, refs, n , 4, y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); get_lowest_part_y(h, refs, n+2, 4, y_offset+4, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); }else if(IS_SUB_4X8(sub_mb_type)){ get_lowest_part_y(h, refs, n , 8, y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); get_lowest_part_y(h, refs, n+1, 8, y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); }else{ int j; assert(IS_SUB_4X4(sub_mb_type)); for(j=0; j<4; j++){ int sub_y_offset= y_offset + 2*(j&2); get_lowest_part_y(h, refs, n+j, 4, sub_y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); } } } } for(list=h->list_count-1; list>=0; list--){ for(ref=0; ref<48 && nrefs[list]; ref++){ int row = refs[list][ref]; if(row >= 0){ Picture *ref_pic = &h->ref_list[list][ref]; int ref_field = ref_pic->reference - 1; int ref_field_picture = ref_pic->field_picture; int pic_height = 16*s->mb_height >> ref_field_picture; row <<= MB_MBAFF; nrefs[list]--; if(!FIELD_PICTURE && ref_field_picture){ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN((row >> 1) - !(row&1), pic_height-1), 1); ff_thread_await_progress((AVFrame*)ref_pic, FFMIN((row >> 1) , pic_height-1), 0); }else if(FIELD_PICTURE && !ref_field_picture){ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row*2 + ref_field , pic_height-1), 0); }else if(FIELD_PICTURE){ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row, pic_height-1), ref_field); }else{ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row, pic_height-1), 0); } } } } } libavcodec/rv34.c:1495: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `ff_er_frame_end`. libavcodec/rv34.c:1495:9: Call 1493. if(r->loop_filter) 1494. r->loop_filter(r, s->mb_height - 1); 1495. ff_er_frame_end(s); ^ 1496. MPV_frame_end(s); 1497. if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { libavcodec/error_resilience.c:776:1: Parameter `s->list_count` 774. } 775. 776. void ff_er_frame_end(MpegEncContext *s){ ^ 777. int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error; 778. int distance; libavcodec/error_resilience.c:995:13: Call 993. s->mb_x= mb_x; 994. s->mb_y= mb_y; 995. decode_mb(s, 0/*FIXME h264 partitioned slices need this set*/); ^ 996. } 997. } libavcodec/error_resilience.c:43:1: Parameter `s->list_count` 41. #undef mb_intra 42. 43. static void decode_mb(MpegEncContext *s, int ref){ ^ 44. s->dest[0] = s->current_picture.data[0] + (s->mb_y * 16* s->linesize ) + s->mb_x * 16; 45. s->dest[1] = s->current_picture.data[1] + (s->mb_y * (16>>s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16>>s->chroma_x_shift); libavcodec/error_resilience.c:59:9: Call 57. fill_rectangle(h->mv_cache[0][ scan8[0] ], 4, 4, 8, pack16to32(s->mv[0][0][0],s->mv[0][0][1]), 4); 58. assert(!FRAME_MBAFF); 59. ff_h264_hl_decode_mb(h); ^ 60. }else{ 61. assert(ref==0); libavcodec/h264.c:1847:1: Parameter `h->list_count` 1845. } 1846. 1847. void ff_h264_hl_decode_mb(H264Context *h){ ^ 1848. MpegEncContext * const s = &h->s; 1849. const int mb_xy= h->mb_xy; libavcodec/h264.c:1854:9: Call 1852. 1853. if (is_complex) { 1854. hl_decode_mb_complex(h); ^ 1855. } else if (h->pixel_shift) { 1856. hl_decode_mb_simple_16(h); libavcodec/h264.c:1843:1: Parameter `h->list_count` 1841. * Process a macroblock; this handles edge cases, such as interlacing. 1842. */ 1843. static void av_noinline hl_decode_mb_complex(H264Context *h){ ^ 1844. hl_decode_mb_internal(h, 0, h->pixel_shift); 1845. } libavcodec/h264.c:1844:5: Call 1842. */ 1843. static void av_noinline hl_decode_mb_complex(H264Context *h){ 1844. hl_decode_mb_internal(h, 0, h->pixel_shift); ^ 1845. } 1846. libavcodec/h264.c:1541:1: Parameter `h->list_count` 1539. } 1540. 1541. static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, int pixel_shift){ ^ 1542. MpegEncContext * const s = &h->s; 1543. const int mb_x= s->mb_x; libavcodec/h264.c:1735:17: Call 1733. }else if(is_h264){ 1734. if (pixel_shift) { 1735. hl_motion_16(h, dest_y, dest_cb, dest_cr, ^ 1736. s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab, 1737. s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab, libavcodec/h264.c:762:1: Parameter `h->list_count` 760. } 761. hl_motion_fn(0, 8); 762. hl_motion_fn(1, 16); ^ 763. 764. static void free_tables(H264Context *h, int free_rbsp){ libavcodec/h264.c:762:1: Call 760. } 761. hl_motion_fn(0, 8); 762. hl_motion_fn(1, 16); ^ 763. 764. static void free_tables(H264Context *h, int free_rbsp){ libavcodec/h264.c:646:1: Parameter `h->list_count` 644. } 645. 646. static av_always_inline void hl_motion(H264Context *h, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, ^ 647. qpel_mc_func (*qpix_put)[16], h264_chroma_mc_func (*chroma_put), 648. qpel_mc_func (*qpix_avg)[16], h264_chroma_mc_func (*chroma_avg), libavcodec/h264.c:658:9: Call 656. 657. if(HAVE_PTHREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) 658. await_references(h); ^ 659. prefetch_motion(h, 0, pixel_shift); 660. libavcodec/h264.c:299:1: <LHS trace> 297. * @param h the H264 context 298. */ 299. static void await_references(H264Context *h){ ^ 300. MpegEncContext * const s = &h->s; 301. const int mb_xy= h->mb_xy; libavcodec/h264.c:299:1: Parameter `h->list_count` 297. * @param h the H264 context 298. */ 299. static void await_references(H264Context *h){ ^ 300. MpegEncContext * const s = &h->s; 301. const int mb_xy= h->mb_xy; libavcodec/h264.c:357:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ff_er_frame_end` 355. } 356. 357. for(list=h->list_count-1; list>=0; list--){ ^ 358. for(ref=0; ref<48 && nrefs[list]; ref++){ 359. int row = refs[list][ref];
https://github.com/libav/libav/blob/6a9c85944427e3c4355bce67d7f677ec69527bff/libavcodec/h264.c/#L357
d2a_code_trace_data_41973
void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks) #ifdef OPENSSL_FIPS { fips_cipher_abort(IDEA); private_idea_set_encrypt_key(key, ks); } void private_idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks) #endif { int i; register IDEA_INT *kt,*kf,r0,r1,r2; kt= &(ks->data[0][0]); n2s(key,kt[0]); n2s(key,kt[1]); n2s(key,kt[2]); n2s(key,kt[3]); n2s(key,kt[4]); n2s(key,kt[5]); n2s(key,kt[6]); n2s(key,kt[7]); kf=kt; kt+=8; for (i=0; i<6; i++) { r2= kf[1]; r1= kf[2]; *(kt++)= ((r2<<9) | (r1>>7))&0xffff; r0= kf[3]; *(kt++)= ((r1<<9) | (r0>>7))&0xffff; r1= kf[4]; *(kt++)= ((r0<<9) | (r1>>7))&0xffff; r0= kf[5]; *(kt++)= ((r1<<9) | (r0>>7))&0xffff; r1= kf[6]; *(kt++)= ((r0<<9) | (r1>>7))&0xffff; r0= kf[7]; *(kt++)= ((r1<<9) | (r0>>7))&0xffff; r1= kf[0]; if (i >= 5) break; *(kt++)= ((r0<<9) | (r1>>7))&0xffff; *(kt++)= ((r1<<9) | (r2>>7))&0xffff; kf+=8; } } crypto/idea/i_skey.c:95: error: BUFFER_OVERRUN_L1 Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: 6. Showing all 5 steps of the trace crypto/idea/i_skey.c:64:1: <Length trace> 62. 63. static IDEA_INT inverse(unsigned int xin); 64. > void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks) 65. #ifdef OPENSSL_FIPS 66. { crypto/idea/i_skey.c:64:1: Parameter `ks->data[*][*]` 62. 63. static IDEA_INT inverse(unsigned int xin); 64. > void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks) 65. #ifdef OPENSSL_FIPS 66. { crypto/idea/i_skey.c:76:2: Assignment 74. register IDEA_INT *kt,*kf,r0,r1,r2; 75. 76. kt= &(ks->data[0][0]); ^ 77. n2s(key,kt[0]); n2s(key,kt[1]); n2s(key,kt[2]); n2s(key,kt[3]); 78. n2s(key,kt[4]); n2s(key,kt[5]); n2s(key,kt[6]); n2s(key,kt[7]); crypto/idea/i_skey.c:80:2: Assignment 78. n2s(key,kt[4]); n2s(key,kt[5]); n2s(key,kt[6]); n2s(key,kt[7]); 79. 80. kf=kt; ^ 81. kt+=8; 82. for (i=0; i<6; i++) crypto/idea/i_skey.c:95:7: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: 6 93. r1= kf[6]; 94. *(kt++)= ((r0<<9) | (r1>>7))&0xffff; 95. r0= kf[7]; ^ 96. *(kt++)= ((r1<<9) | (r0>>7))&0xffff; 97. r1= kf[0];
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/idea/i_skey.c/#L95
d2a_code_trace_data_41974
int BN_num_bits_word(BN_ULONG l) { BN_ULONG x, mask; int bits = (l != 0); #if BN_BITS2 > 32 x = l >> 32; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 32 & mask; l ^= (x ^ l) & mask; #endif x = l >> 16; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 16 & mask; l ^= (x ^ l) & mask; x = l >> 8; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 8 & mask; l ^= (x ^ l) & mask; x = l >> 4; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 4 & mask; l ^= (x ^ l) & mask; x = l >> 2; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 2 & mask; l ^= (x ^ l) & mask; x = l >> 1; mask = (0 - x) & BN_MASK2; mask = (0 - (mask >> (BN_BITS2 - 1))); bits += 1 & mask; return bits; } crypto/bn/bn_prime.c:210: error: INTEGER_OVERFLOW_L2 (0 - [0, 18446744073709551615]):unsigned64 by call to `BN_mod_word`. Showing all 10 steps of the trace crypto/bn/bn_prime.c:210:28: Call 208. if (do_trial_division) { 209. for (i = 1; i < NUMPRIMES; i++) { 210. BN_ULONG mod = BN_mod_word(w, primes[i]); ^ 211. if (mod == (BN_ULONG)-1) 212. return -1; crypto/bn/bn_word.c:13:1: Parameter `w` 11. #include "bn_lcl.h" 12. 13. > BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) 14. { 15. #ifndef BN_LLONG crypto/bn/bn_word.c:35:15: Call 33. return (BN_ULONG)-1; 34. 35. ret = BN_div_word(tmp, w); ^ 36. BN_free(tmp); 37. crypto/bn/bn_word.c:61:1: Parameter `w` 59. } 60. 61. > BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) 62. { 63. BN_ULONG ret = 0; crypto/bn/bn_word.c:67:5: Assignment 65. 66. bn_check_top(a); 67. w &= BN_MASK2; ^ 68. 69. if (!w) crypto/bn/bn_word.c:76:20: Call 74. 75. /* normalize input (so bn_div_words doesn't complain) */ 76. j = BN_BITS2 - BN_num_bits_word(w); ^ 77. w <<= j; 78. if (!BN_lshift(a, a, j)) crypto/bn/bn_lib.c:90:1: <RHS trace> 88. } 89. 90. > int BN_num_bits_word(BN_ULONG l) 91. { 92. BN_ULONG x, mask; crypto/bn/bn_lib.c:90:1: Parameter `l` 88. } 89. 90. > int BN_num_bits_word(BN_ULONG l) 91. { 92. BN_ULONG x, mask; crypto/bn/bn_lib.c:96:5: Assignment 94. 95. #if BN_BITS2 > 32 96. x = l >> 32; ^ 97. mask = (0 - x) & BN_MASK2; 98. mask = (0 - (mask >> (BN_BITS2 - 1))); crypto/bn/bn_lib.c:97:5: Binary operation: (0 - [0, 18446744073709551615]):unsigned64 by call to `BN_mod_word` 95. #if BN_BITS2 > 32 96. x = l >> 32; 97. mask = (0 - x) & BN_MASK2; ^ 98. mask = (0 - (mask >> (BN_BITS2 - 1))); 99. bits += 32 & mask;
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_lib.c/#L97
d2a_code_trace_data_41975
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/srp/srp_vfy.c:730: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`. Showing all 31 steps of the trace crypto/srp/srp_vfy.c:730:10: Call 728. goto err; 729. 730. if (!BN_mod_exp(*verifier, g, x, N, bn_ctx)) { ^ 731. BN_clear_free(*verifier); 732. goto err; crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth` 87. } 88. 89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 90. BN_CTX *ctx) 91. { crypto/bn/bn_exp.c:149:15: Call 147. #ifdef RECP_MUL_MOD 148. { 149. ret = BN_mod_exp_recp(r, a, p, m, ctx); ^ 150. } 151. #else crypto/bn/bn_exp.c:161:1: Parameter `ctx->stack.depth` 159. } 160. 161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 162. const BIGNUM *m, BN_CTX *ctx) 163. { crypto/bn/bn_exp.c:191:5: Call 189. } 190. 191. BN_CTX_start(ctx); ^ 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_exp.c:192:10: Call 190. 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); ^ 193. val[0] = BN_CTX_get(ctx); 194. if (val[0] == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:193:14: Call 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); ^ 194. if (val[0] == NULL) 195. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:210:10: Call 208. } 209. 210. if (!BN_nnmod(val[0], a, m, ctx)) ^ 211. goto err; /* 1 */ 212. if (BN_is_zero(val[0])) { crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_exp.c:220:14: Call 218. window = BN_window_bits_for_exponent_size(bits); 219. if (window > 1) { 220. if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx)) ^ 221. goto err; /* 2 */ 222. j = 1 << (window - 1); crypto/bn/bn_recp.c:55:1: Parameter `ctx->stack.depth` 53. } 54. 55. > int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, 56. BN_RECP_CTX *recp, BN_CTX *ctx) 57. { crypto/bn/bn_recp.c:62:5: Call 60. const BIGNUM *ca; 61. 62. BN_CTX_start(ctx); ^ 63. if ((a = BN_CTX_get(ctx)) == NULL) 64. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_recp.c:63:14: Call 61. 62. BN_CTX_start(ctx); 63. if ((a = BN_CTX_get(ctx)) == NULL) ^ 64. goto err; 65. if (y != NULL) { crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_recp.c:77:11: Call 75. ca = x; /* Just do the mod */ 76. 77. ret = BN_div_recp(NULL, r, ca, recp, ctx); ^ 78. err: 79. BN_CTX_end(ctx); crypto/bn/bn_recp.c:90:5: Call 88. BIGNUM *a, *b, *d, *r; 89. 90. BN_CTX_start(ctx); ^ 91. d = (dv != NULL) ? dv : BN_CTX_get(ctx); 92. r = (rem != NULL) ? rem : BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_recp.c:101:13: Call 99. BN_zero(d); 100. if (!BN_copy(r, m)) { 101. BN_CTX_end(ctx); ^ 102. return 0; 103. } crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_41976
static inline uint64_t get_val(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1); bc->bits >>= n; #else uint64_t ret = bc->bits >> (64 - n); bc->bits <<= n; #endif bc->bits_left -= n; return ret; } libavcodec/alsdec.c:1201: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`. libavcodec/alsdec.c:1199:41: Call 1197. current->weighting[3] = als_weighting(bc, 1, 16); 1198. current->weighting[4] = als_weighting(bc, 1, 16); 1199. current->weighting[5] = als_weighting(bc, 1, 16); ^ 1200. 1201. current->time_diff_sign = bitstream_read_bit(bc); libavcodec/alsdec.c:1166:1: Parameter `k` 1164. } 1165. 1166. static inline int als_weighting(BitstreamContext *bc, int k, int off) ^ 1167. { 1168. int idx = av_clip(decode_rice(bc, k) + off, libavcodec/alsdec.c:1168:23: Call 1166. static inline int als_weighting(BitstreamContext *bc, int k, int off) 1167. { 1168. int idx = av_clip(decode_rice(bc, k) + off, ^ 1169. 0, FF_ARRAY_ELEMS(mcc_weightings) - 1); 1170. return mcc_weightings[idx]; libavcodec/alsdec.c:466:1: Parameter `bc->bits_left` 464. /** Read and decode a Rice codeword. 465. */ 466. static int32_t decode_rice(BitstreamContext *bc, unsigned int k) ^ 467. { 468. int max = bitstream_bits_left(bc) - k; libavcodec/alsdec.c:469:15: Call 467. { 468. int max = bitstream_bits_left(bc) - k; 469. int q = get_unary(bc, 0, max); ^ 470. int r = k ? bitstream_read_bit(bc) : !(q & 1); 471. libavcodec/unary.h:33:1: Parameter `bc->bits_left` 31. * @return Unary length/index 32. */ 33. static inline int get_unary(BitstreamContext *bc, int stop, int len) ^ 34. { 35. int i; libavcodec/alsdec.c:1201:44: Call 1199. current->weighting[5] = als_weighting(bc, 1, 16); 1200. 1201. current->time_diff_sign = bitstream_read_bit(bc); ^ 1202. current->time_diff_index = bitstream_read(bc, ctx->ltp_lag_length - 3) + 3; 1203. } libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/7ff018c1cb43a5fe5ee2049d325cdd785852067a/libavcodec/bitstream.h/#L139
d2a_code_trace_data_41977
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:1160: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1160:9: 1158. if (s->first_slice_line) { 1159. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) 1160. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, ^ 1161. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1162. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1160
d2a_code_trace_data_41978
DH *ssl_get_auto_dh(SSL *s) { int dh_secbits = 80; if (s->cert->dh_tmp_auto == 2) return DH_get_1024_160(); if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { if (s->s3->tmp.new_cipher->strength_bits == 256) dh_secbits = 128; else dh_secbits = 80; } else { CERT_PKEY *cpk = ssl_get_server_send_pkey(s); dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); } if (dh_secbits >= 128) { DH *dhp = DH_new(); BIGNUM *p, *g; if (dhp == NULL) return NULL; g = BN_new(); if (g != NULL) BN_set_word(g, 2); if (dh_secbits >= 192) p = BN_get_rfc3526_prime_8192(NULL); else p = BN_get_rfc3526_prime_3072(NULL); if (p == NULL || g == NULL || !DH_set0_pqg(dhp, p, NULL, g)) { DH_free(dhp); BN_free(p); BN_free(g); return NULL; } return dhp; } if (dh_secbits >= 112) return DH_get_2048_224(); return DH_get_1024_160(); } ssl/t1_lib.c:2158: error: NULL_DEREFERENCE pointer `cpk` last assigned on line 2157 could be null and is dereferenced at line 2158, column 45. Showing all 30 steps of the trace ssl/t1_lib.c:2146:1: start of procedure ssl_get_auto_dh() 2144. 2145. #ifndef OPENSSL_NO_DH 2146. > DH *ssl_get_auto_dh(SSL *s) 2147. { 2148. int dh_secbits = 80; ssl/t1_lib.c:2148:5: 2146. DH *ssl_get_auto_dh(SSL *s) 2147. { 2148. > int dh_secbits = 80; 2149. if (s->cert->dh_tmp_auto == 2) 2150. return DH_get_1024_160(); ssl/t1_lib.c:2149:9: Taking false branch 2147. { 2148. int dh_secbits = 80; 2149. if (s->cert->dh_tmp_auto == 2) ^ 2150. return DH_get_1024_160(); 2151. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ssl/t1_lib.c:2151:9: Taking false branch 2149. if (s->cert->dh_tmp_auto == 2) 2150. return DH_get_1024_160(); 2151. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ^ 2152. if (s->s3->tmp.new_cipher->strength_bits == 256) 2153. dh_secbits = 128; ssl/t1_lib.c:2157:9: 2155. dh_secbits = 80; 2156. } else { 2157. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 2158. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 2159. } ssl/ssl_lib.c:2850:1: start of procedure ssl_get_server_send_pkey() 2848. } 2849. 2850. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s) 2851. { 2852. CERT *c; ssl/ssl_lib.c:2855:5: 2853. int i; 2854. 2855. > c = s->cert; 2856. if (!s->s3 || !s->s3->tmp.new_cipher) 2857. return NULL; ssl/ssl_lib.c:2856:10: Taking false branch 2854. 2855. c = s->cert; 2856. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2857. return NULL; 2858. ssl_set_masks(s); ssl/ssl_lib.c:2856:20: Taking false branch 2854. 2855. c = s->cert; 2856. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2857. return NULL; 2858. ssl_set_masks(s); ssl/ssl_lib.c:2858:5: Skipping ssl_set_masks(): empty list of specs 2856. if (!s->s3 || !s->s3->tmp.new_cipher) 2857. return NULL; 2858. ssl_set_masks(s); ^ 2859. 2860. i = ssl_get_server_cert_index(s); ssl/ssl_lib.c:2860:5: 2858. ssl_set_masks(s); 2859. 2860. > i = ssl_get_server_cert_index(s); 2861. 2862. /* This may or may not be an error. */ ssl/ssl_lib.c:2823:1: start of procedure ssl_get_server_cert_index() 2821. #endif 2822. 2823. > static int ssl_get_server_cert_index(const SSL *s) 2824. { 2825. int idx; ssl/ssl_lib.c:2832:5: 2830. * forces the use of an RSA cert. This will need to change. 2831. */ 2832. > idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2833. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) 2834. idx = SSL_PKEY_RSA_SIGN; ssl/ssl_ciph.c:1893:1: start of procedure ssl_cipher_get_cert_index() 1891. 1892. /* For a cipher return the index corresponding to the certificate type */ 1893. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c) 1894. { 1895. uint32_t alg_a; ssl/ssl_ciph.c:1897:5: 1895. uint32_t alg_a; 1896. 1897. > alg_a = c->algorithm_auth; 1898. 1899. if (alg_a & SSL_aECDSA) ssl/ssl_ciph.c:1899:9: Taking false branch 1897. alg_a = c->algorithm_auth; 1898. 1899. if (alg_a & SSL_aECDSA) ^ 1900. return SSL_PKEY_ECC; 1901. else if (alg_a & SSL_aDSS) ssl/ssl_ciph.c:1901:14: Taking false branch 1899. if (alg_a & SSL_aECDSA) 1900. return SSL_PKEY_ECC; 1901. else if (alg_a & SSL_aDSS) ^ 1902. return SSL_PKEY_DSA_SIGN; 1903. else if (alg_a & SSL_aRSA) ssl/ssl_ciph.c:1903:14: Taking true branch 1901. else if (alg_a & SSL_aDSS) 1902. return SSL_PKEY_DSA_SIGN; 1903. else if (alg_a & SSL_aRSA) ^ 1904. return SSL_PKEY_RSA_ENC; 1905. else if (alg_a & SSL_aGOST12) ssl/ssl_ciph.c:1904:9: 1902. return SSL_PKEY_DSA_SIGN; 1903. else if (alg_a & SSL_aRSA) 1904. > return SSL_PKEY_RSA_ENC; 1905. else if (alg_a & SSL_aGOST12) 1906. return SSL_PKEY_GOST_EC; ssl/ssl_ciph.c:1911:1: return from a call to ssl_cipher_get_cert_index 1909. 1910. return -1; 1911. > } 1912. 1913. const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr) ssl/ssl_lib.c:2833:9: Taking true branch 2831. */ 2832. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2833. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) ^ 2834. idx = SSL_PKEY_RSA_SIGN; 2835. if (idx == SSL_PKEY_GOST_EC) { ssl/ssl_lib.c:2833:37: Taking false branch 2831. */ 2832. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2833. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) ^ 2834. idx = SSL_PKEY_RSA_SIGN; 2835. if (idx == SSL_PKEY_GOST_EC) { ssl/ssl_lib.c:2835:9: Taking false branch 2833. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) 2834. idx = SSL_PKEY_RSA_SIGN; 2835. if (idx == SSL_PKEY_GOST_EC) { ^ 2836. if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509) 2837. idx = SSL_PKEY_GOST12_512; ssl/ssl_lib.c:2845:9: Taking false branch 2843. idx = -1; 2844. } 2845. if (idx == -1) ^ 2846. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2847. return idx; ssl/ssl_lib.c:2847:5: 2845. if (idx == -1) 2846. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2847. > return idx; 2848. } 2849. ssl/ssl_lib.c:2848:1: return from a call to ssl_get_server_cert_index 2846. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2847. return idx; 2848. > } 2849. 2850. CERT_PKEY *ssl_get_server_send_pkey(SSL *s) ssl/ssl_lib.c:2863:9: Taking true branch 2861. 2862. /* This may or may not be an error. */ 2863. if (i < 0) ^ 2864. return NULL; 2865. ssl/ssl_lib.c:2864:9: 2862. /* This may or may not be an error. */ 2863. if (i < 0) 2864. > return NULL; 2865. 2866. /* May be NULL. */ ssl/ssl_lib.c:2868:1: return from a call to ssl_get_server_send_pkey 2866. /* May be NULL. */ 2867. return &c->pkeys[i]; 2868. > } 2869. 2870. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, ssl/t1_lib.c:2158:9: 2156. } else { 2157. CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 2158. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 2159. } 2160.
https://github.com/openssl/openssl/blob/4954fd13b3c71f0f74677b78533f1176e13de032/ssl/t1_lib.c/#L2158
d2a_code_trace_data_41979
static inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } ssl/s3_clnt.c:1071: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 32):unsigned64 by call to `PACKET_copy_bytes`. Showing all 14 steps of the trace ssl/s3_clnt.c:974:10: Call 972. } 973. 974. if (!PACKET_buf_init(&pkt, s->init_msg, n)) { ^ 975. al = SSL_AD_INTERNAL_ERROR; 976. SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, ERR_R_INTERNAL_ERROR); ssl/packet_locl.h:110:8: Parameter `pkt->remaining` 108. * is being used. 109. */ 110. __owur static inline int PACKET_buf_init(PACKET *pkt, unsigned char *buf, ^ 111. size_t len) 112. { ssl/s3_clnt.c:983:14: Call 981. unsigned int sversion; 982. 983. if (!PACKET_get_net_2(&pkt, &sversion)) { ^ 984. al = SSL_AD_DECODE_ERROR; 985. SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, SSL_R_LENGTH_MISMATCH); ssl/packet_locl.h:188:8: Parameter `pkt->remaining` 186. /* Equivalent of n2s */ 187. /* Get 2 bytes in network order from |pkt| and store the value in |*data| */ 188. __owur static inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data) ^ 189. { 190. if (!PACKET_peek_net_2(pkt, data)) ssl/packet_locl.h:190:10: Call 188. __owur static inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data) 189. { 190. if (!PACKET_peek_net_2(pkt, data)) ^ 191. return 0; 192. ssl/packet_locl.h:174:8: Parameter `pkt->remaining` 172. * |*data| 173. */ 174. __owur static inline int PACKET_peek_net_2(const PACKET *pkt, ^ 175. unsigned int *data) 176. { ssl/s3_clnt.c:1071:10: Call 1069. /* load the server hello data */ 1070. /* load the server random */ 1071. if (!PACKET_copy_bytes(&pkt, s->s3->server_random, SSL3_RANDOM_SIZE)) { ^ 1072. al = SSL_AD_DECODE_ERROR; 1073. SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, SSL_R_LENGTH_MISMATCH); ssl/packet_locl.h:359:8: Parameter `len` 357. * The caller is responsible for ensuring that |data| can hold |len| bytes. 358. */ 359. __owur static inline int PACKET_copy_bytes(PACKET *pkt, unsigned char *data, ^ 360. size_t len) 361. { ssl/packet_locl.h:365:5: Call 363. return 0; 364. 365. packet_forward(pkt, len); ^ 366. 367. return 1; ssl/packet_locl.h:80:1: <LHS trace> 78. 79. /* Internal unchecked shorthand; don't use outside this file. */ 80. > static inline void packet_forward(PACKET *pkt, size_t len) 81. { 82. pkt->curr += len; ssl/packet_locl.h:80:1: Parameter `pkt->remaining` 78. 79. /* Internal unchecked shorthand; don't use outside this file. */ 80. > static inline void packet_forward(PACKET *pkt, size_t len) 81. { 82. pkt->curr += len; ssl/packet_locl.h:80:1: <RHS trace> 78. 79. /* Internal unchecked shorthand; don't use outside this file. */ 80. > static inline void packet_forward(PACKET *pkt, size_t len) 81. { 82. pkt->curr += len; ssl/packet_locl.h:80:1: Parameter `len` 78. 79. /* Internal unchecked shorthand; don't use outside this file. */ 80. > static inline void packet_forward(PACKET *pkt, size_t len) 81. { 82. pkt->curr += len; ssl/packet_locl.h:83:5: Binary operation: ([0, +oo] - 32):unsigned64 by call to `PACKET_copy_bytes` 81. { 82. pkt->curr += len; 83. pkt->remaining -= len; ^ 84. } 85.
https://github.com/openssl/openssl/blob/f8e0a5573820bd7318782d4954c6643ff7e58102/ssl/packet_locl.h/#L83
d2a_code_trace_data_41980
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; } test/ct_test.c:525: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, 12] by call to `CTLOG_new_from_base64`. Showing all 31 steps of the trace test/ct_test.c:520:5: Array declaration 518. { 519. CTLOG *ctlogp = NULL; 520. const char notb64[] = "\01\02\03\04"; ^ 521. const char pad[] = "===="; 522. const char name[] = "name"; test/ct_test.c:525:10: Call 523. 524. /* We expect these to both fail! */ 525. if (!TEST_true(!CTLOG_new_from_base64(&ctlogp, notb64, name)) ^ 526. || !TEST_true(!CTLOG_new_from_base64(&ctlogp, pad, name))) 527. return 0; crypto/ct/ct_b64.c:135:1: Parameter `pkey_base64->strlen` 133. * -1 on internal (malloc) failure 134. */ 135. > int CTLOG_new_from_base64(CTLOG **ct_log, const char *pkey_base64, const char *name) 136. { 137. unsigned char *pkey_der = NULL; crypto/ct/ct_b64.c:147:20: Call 145. } 146. 147. pkey_der_len = ct_base64_decode(pkey_base64, &pkey_der); ^ 148. if (pkey_der_len < 0) { 149. CTerr(CT_F_CTLOG_NEW_FROM_BASE64, CT_R_LOG_CONF_INVALID_KEY); crypto/ct/ct_b64.c:24:1: Parameter `**out` 22. * the caller. Do not provide a pre-allocated string in |out|. 23. */ 24. > static int ct_base64_decode(const char *in, unsigned char **out) 25. { 26. size_t inlen = strlen(in); crypto/ct/ct_b64.c:153:5: Assignment 151. } 152. 153. p = pkey_der; ^ 154. pkey = d2i_PUBKEY(NULL, &p, pkey_der_len); 155. OPENSSL_free(pkey_der); crypto/ct/ct_b64.c:154:12: Call 152. 153. p = pkey_der; 154. pkey = d2i_PUBKEY(NULL, &p, pkey_der_len); ^ 155. OPENSSL_free(pkey_der); 156. if (pkey == NULL) { crypto/x509/x_pubkey.c:182:1: Parameter `**pp` 180. */ 181. 182. > EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length) 183. { 184. X509_PUBKEY *xpk; crypto/x509/x_pubkey.c:187:5: Assignment 185. EVP_PKEY *pktmp; 186. const unsigned char *q; 187. q = *pp; ^ 188. xpk = d2i_X509_PUBKEY(NULL, &q, length); 189. if (!xpk) crypto/x509/x_pubkey.c:188:11: Call 186. const unsigned char *q; 187. q = *pp; 188. xpk = d2i_X509_PUBKEY(NULL, &q, length); ^ 189. if (!xpk) 190. return NULL; crypto/x509/x_pubkey.c:58:1: Parameter `**in` 56. } ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY) 57. 58. > IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY) 59. 60. /* TODO should better be called X509_PUBKEY_set1 */ crypto/x509/x_pubkey.c:58:1: Call 56. } ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY) 57. 58. > IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY) 59. 60. /* TODO should better be called X509_PUBKEY_set1 */ 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, 12] by call to `CTLOG_new_from_base64` 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_41981
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/sslcorrupttest.c:238: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/sslcorrupttest.c:206:10: Call 204. 205. /* BIO is freed by create_ssl_connection on error */ 206. if (!create_ssl_objects(sctx, cctx, &server, &client, NULL, ^ 207. c_to_s_fbio)) { 208. printf("Unable to create SSL objects\n"); test/ssltestlib.c:579:21: Call 577. 578. if (*sssl == NULL) 579. serverssl = SSL_new(serverctx); ^ 580. else 581. serverssl = *sssl; ssl/ssl_lib.c:519:1: Parameter `ctx->sessions->num_items` 517. } 518. 519. > SSL *SSL_new(SSL_CTX *ctx) 520. { 521. SSL *s; test/sslcorrupttest.c:238:5: Call 236. testresult = 1; 237. end: 238. SSL_free(server); ^ 239. SSL_free(client); 240. SSL_CTX_free(sctx); ssl/ssl_lib.c:961:1: Parameter `s->initial_ctx->sessions->num_items` 959. } 960. 961. > void SSL_free(SSL *s) 962. { 963. int i; ssl/ssl_lib.c:991:9: Call 989. /* Make the next call work :-) */ 990. if (s->session != NULL) { 991. ssl_clear_bad_session(s); ^ 992. SSL_SESSION_free(s->session); 993. } ssl/ssl_sess.c:1009:1: Parameter `s->initial_ctx->sessions->num_items` 1007. } 1008. 1009. > int ssl_clear_bad_session(SSL *s) 1010. { 1011. if ((s->session != NULL) && ssl/ssl_sess.c:1014:9: Call 1012. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1013. !(SSL_in_init(s) || SSL_in_before(s))) { 1014. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1015. return (1); 1016. } else ssl/ssl_sess.c:698:1: Parameter `ctx->sessions->num_items` 696. } 697. 698. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 699. { 700. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:700:12: Call 698. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 699. { 700. return remove_session_lock(ctx, c, 1); ^ 701. } 702. ssl/ssl_sess.c:703:1: Parameter `ctx->sessions->num_items` 701. } 702. 703. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 704. { 705. SSL_SESSION *r; ssl/ssl_sess.c:713:17: Call 711. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 712. ret = 1; 713. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 714. SSL_SESSION_list_remove(ctx, c); 715. } ssl/ssl_locl.h:602:1: Parameter `lh->num_items` 600. }; 601. 602. > DEFINE_LHASH_OF(SSL_SESSION); 603. /* Needed in ssl_cert.c */ 604. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:602:1: Call 600. }; 601. 602. > DEFINE_LHASH_OF(SSL_SESSION); 603. /* Needed in ssl_cert.c */ 604. 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/6a69e8694af23dae1d1927813932f4296d133416/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_41982
static ngx_inline ngx_rbtree_node_t * ngx_rbtree_min(ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel) { while (node->left != sentinel) { node = node->left; } return node; } src/core/ngx_resolver.c:200: error: Use After Free call to `ngx_rbtree_min()` eventually accesses memory that was invalidated by call to `free()` on line 216 indirectly during the call to `ngx_resolver_free_node()`. src/core/ngx_resolver.c:192:1: invalidation part of the trace starts here 190. 191. 192. static void ^ 193. ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree) 194. { src/core/ngx_resolver.c:192:1: parameter `tree` of ngx_resolver_cleanup_tree 190. 191. 192. static void ^ 193. ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree) 194. { src/core/ngx_resolver.c:200:38: passed as argument to `ngx_rbtree_min` 198. while (tree->root != tree->sentinel) { 199. 200. rn = (ngx_resolver_node_t *) ngx_rbtree_min(tree->root, tree->sentinel); ^ 201. 202. ngx_queue_remove(&rn->queue); src/core/ngx_resolver.c:200:38: return from call to `ngx_rbtree_min` 198. while (tree->root != tree->sentinel) { 199. 200. rn = (ngx_resolver_node_t *) ngx_rbtree_min(tree->root, tree->sentinel); ^ 201. 202. ngx_queue_remove(&rn->queue); src/core/ngx_resolver.c:200:9: assigned 198. while (tree->root != tree->sentinel) { 199. 200. rn = (ngx_resolver_node_t *) ngx_rbtree_min(tree->root, tree->sentinel); ^ 201. 202. ngx_queue_remove(&rn->queue); src/core/ngx_resolver.c:216:9: when calling `ngx_resolver_free_node` here 214. ngx_rbtree_delete(tree, &rn->node); 215. 216. ngx_resolver_free_node(r, rn); ^ 217. } 218. } src/core/ngx_resolver.c:1954:1: parameter `rn` of ngx_resolver_free_node 1952. 1953. 1954. static void ^ 1955. ngx_resolver_free_node(ngx_resolver_t *r, ngx_resolver_node_t *rn) 1956. { src/core/ngx_resolver.c:1975:5: when calling `ngx_resolver_free_locked` here 1973. } 1974. 1975. ngx_resolver_free_locked(r, rn); ^ 1976. 1977. /* unlock alloc mutex */ src/core/ngx_resolver.c:2022:1: parameter `p` of ngx_resolver_free_locked 2020. 2021. 2022. static void ^ 2023. ngx_resolver_free_locked(ngx_resolver_t *r, void *p) 2024. { src/core/ngx_resolver.c:2025:5: was invalidated by call to `free()` 2023. ngx_resolver_free_locked(ngx_resolver_t *r, void *p) 2024. { 2025. ngx_free(p); ^ 2026. } 2027. src/core/ngx_resolver.c:192:1: use-after-lifetime part of the trace starts here 190. 191. 192. static void ^ 193. ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree) 194. { src/core/ngx_resolver.c:192:1: parameter `tree` of ngx_resolver_cleanup_tree 190. 191. 192. static void ^ 193. ngx_resolver_cleanup_tree(ngx_resolver_t *r, ngx_rbtree_t *tree) 194. { src/core/ngx_resolver.c:200:38: when calling `ngx_rbtree_min` here 198. while (tree->root != tree->sentinel) { 199. 200. rn = (ngx_resolver_node_t *) ngx_rbtree_min(tree->root, tree->sentinel); ^ 201. 202. ngx_queue_remove(&rn->queue); src/core/ngx_rbtree.h:72:1: parameter `node` of ngx_rbtree_min 70. 71. 72. static ngx_inline ngx_rbtree_node_t * ^ 73. ngx_rbtree_min(ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel) 74. { src/core/ngx_rbtree.h:75:12: invalid access occurs here 73. ngx_rbtree_min(ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel) 74. { 75. while (node->left != sentinel) { ^ 76. node = node->left; 77. }
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_rbtree.h/#L75
d2a_code_trace_data_41983
tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw_p, tsize_t raw_l ) { char ascii85[5]; tsize_t ascii85_l; int rc; uint32 val32; ascii85_l = 0; if ( raw_p ) { --raw_p; for ( ; raw_l > 3; raw_l -= 4 ) { val32 = *(++raw_p) << 24; val32 += *(++raw_p) << 16; val32 += *(++raw_p) << 8; val32 += *(++raw_p); if ( val32 == 0 ) { ascii85_p[ascii85_l] = 'z'; rc = 1; } else { ascii85[4] = (char) ((val32 % 85) + 33); val32 /= 85; ascii85[3] = (char) ((val32 % 85) + 33); val32 /= 85; ascii85[2] = (char) ((val32 % 85) + 33); val32 /= 85; ascii85[1] = (char) ((val32 % 85) + 33); ascii85[0] = (char) ((val32 / 85) + 33); _TIFFmemcpy( &ascii85_p[ascii85_l], ascii85, sizeof(ascii85) ); rc = sizeof(ascii85); } ascii85_l += rc; if ( (A85BREAKCNTR -= rc) <= 0 ) { ascii85_p[ascii85_l] = '\n'; ++ascii85_l; A85BREAKCNTR = A85BREAKLEN; } } if ( raw_l > 0 ) { tsize_t len; len = raw_l + 1; val32 = *++raw_p << 24; if ( --raw_l > 0 ) val32 += *(++raw_p) << 16; if ( --raw_l > 0 ) val32 += *(++raw_p) << 8; val32 /= 85; ascii85[3] = (char) ((val32 % 85) + 33); val32 /= 85; ascii85[2] = (char) ((val32 % 85) + 33); val32 /= 85; ascii85[1] = (char) ((val32 % 85) + 33); ascii85[0] = (char) ((val32 / 85) + 33); _TIFFmemcpy( &ascii85_p[ascii85_l], ascii85, len ); ascii85_l += len; } } if ( f_eod ) { ascii85_p[ascii85_l++] = '~'; ascii85_p[ascii85_l++] = '>'; ascii85_p[ascii85_l++] = '\n'; } return ( ascii85_l ); } tools/tiff2ps.c:1562: error: Buffer Overrun L3 Offset: [1, +oo] Size: [0, +oo] by call to `Ascii85EncodeBlock`. tools/tiff2ps.c:1431:2: Assignment 1429. #if defined( EXP_ASCII85ENCODER ) 1430. tsize_t ascii85_l; /* Length, in bytes, of ascii85_p[] data */ 1431. uint8 * ascii85_p = 0; /* Holds ASCII85 encoded data */ ^ 1432. #endif 1433. tools/tiff2ps.c:1562:16: Call 1560. if (ascii85) { 1561. #if defined( EXP_ASCII85ENCODER ) 1562. ascii85_l = Ascii85EncodeBlock(ascii85_p, 1, buf_data, byte_count ); ^ 1563. 1564. if ( ascii85_l > 0 ) tools/tiff2ps.c:2227:5: <Offset trace> 2225. uint32 val32; /* Unencoded 4 tuple */ 2226. 2227. ascii85_l = 0; /* Nothing written yet */ ^ 2228. 2229. if ( raw_p ) tools/tiff2ps.c:2227:5: Assignment 2225. uint32 val32; /* Unencoded 4 tuple */ 2226. 2227. ascii85_l = 0; /* Nothing written yet */ ^ 2228. 2229. if ( raw_p ) tools/tiff2ps.c:2264:13: Assignment 2262. } 2263. 2264. ascii85_l += rc; ^ 2265. 2266. if ( (A85BREAKCNTR -= rc) <= 0 ) tools/tiff2ps.c:2219:1: <Length trace> 2217. *****************************************************************************/ 2218. 2219. tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw_p, tsize_t raw_l ) ^ 2220. 2221. { tools/tiff2ps.c:2219:1: Parameter `*ascii85_p` 2217. *****************************************************************************/ 2218. 2219. tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw_p, tsize_t raw_l ) ^ 2220. 2221. { tools/tiff2ps.c:2268:17: Array access: Offset: [1, +oo] Size: [0, +oo] by call to `Ascii85EncodeBlock` 2266. if ( (A85BREAKCNTR -= rc) <= 0 ) 2267. { 2268. ascii85_p[ascii85_l] = '\n'; ^ 2269. ++ascii85_l; 2270. A85BREAKCNTR = A85BREAKLEN;
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/tools/tiff2ps.c/#L2268
d2a_code_trace_data_41984
static int tls_process_cke_rsa(SSL *s, PACKET *pkt, int *al) { #ifndef OPENSSL_NO_RSA unsigned char rand_premaster_secret[SSL_MAX_MASTER_KEY_LENGTH]; int decrypt_len; unsigned char decrypt_good, version_good; size_t j, padding_len; PACKET enc_premaster; RSA *rsa = NULL; unsigned char *rsa_decrypt = NULL; int ret = 0; rsa = EVP_PKEY_get0_RSA(s->cert->pkeys[SSL_PKEY_RSA].privatekey); if (rsa == NULL) { *al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_TLS_PROCESS_CKE_RSA, SSL_R_MISSING_RSA_CERTIFICATE); return 0; } if (s->version == SSL3_VERSION || s->version == DTLS1_BAD_VER) { enc_premaster = *pkt; } else { if (!PACKET_get_length_prefixed_2(pkt, &enc_premaster) || PACKET_remaining(pkt) != 0) { *al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_TLS_PROCESS_CKE_RSA, SSL_R_LENGTH_MISMATCH); return 0; } } if (RSA_size(rsa) < SSL_MAX_MASTER_KEY_LENGTH) { *al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_TLS_PROCESS_CKE_RSA, RSA_R_KEY_SIZE_TOO_SMALL); return 0; } rsa_decrypt = OPENSSL_malloc(RSA_size(rsa)); if (rsa_decrypt == NULL) { *al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_TLS_PROCESS_CKE_RSA, ERR_R_MALLOC_FAILURE); return 0; } if (ssl_randbytes(s, rand_premaster_secret, sizeof(rand_premaster_secret)) <= 0) goto err; decrypt_len = (int)RSA_private_decrypt((int)PACKET_remaining(&enc_premaster), PACKET_data(&enc_premaster), rsa_decrypt, rsa, RSA_NO_PADDING); if (decrypt_len < 0) goto err; if (decrypt_len < 11 + SSL_MAX_MASTER_KEY_LENGTH) { *al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_TLS_PROCESS_CKE_RSA, SSL_R_DECRYPTION_FAILED); goto err; } padding_len = decrypt_len - SSL_MAX_MASTER_KEY_LENGTH; decrypt_good = constant_time_eq_int_8(rsa_decrypt[0], 0) & constant_time_eq_int_8(rsa_decrypt[1], 2); for (j = 2; j < padding_len - 1; j++) { decrypt_good &= ~constant_time_is_zero_8(rsa_decrypt[j]); } decrypt_good &= constant_time_is_zero_8(rsa_decrypt[padding_len - 1]); version_good = constant_time_eq_8(rsa_decrypt[padding_len], (unsigned)(s->client_version >> 8)); version_good &= constant_time_eq_8(rsa_decrypt[padding_len + 1], (unsigned)(s->client_version & 0xff)); if (s->options & SSL_OP_TLS_ROLLBACK_BUG) { unsigned char workaround_good; workaround_good = constant_time_eq_8(rsa_decrypt[padding_len], (unsigned)(s->version >> 8)); workaround_good &= constant_time_eq_8(rsa_decrypt[padding_len + 1], (unsigned)(s->version & 0xff)); version_good |= workaround_good; } decrypt_good &= version_good; for (j = 0; j < sizeof(rand_premaster_secret); j++) { rsa_decrypt[padding_len + j] = constant_time_select_8(decrypt_good, rsa_decrypt[padding_len + j], rand_premaster_secret[j]); } if (!ssl_generate_master_secret(s, rsa_decrypt + padding_len, sizeof(rand_premaster_secret), 0)) { *al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_TLS_PROCESS_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } ret = 1; err: OPENSSL_free(rsa_decrypt); return ret; #else *al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_TLS_PROCESS_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; #endif } ssl/statem/statem_srvr.c:2753: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, +oo]. Showing all 11 steps of the trace ssl/statem/statem_srvr.c:2752:10: <Offset trace> 2750. decrypt_good = constant_time_eq_int_8(rsa_decrypt[0], 0) & 2751. constant_time_eq_int_8(rsa_decrypt[1], 2); 2752. for (j = 2; j < padding_len - 1; j++) { ^ 2753. decrypt_good &= ~constant_time_is_zero_8(rsa_decrypt[j]); 2754. } ssl/statem/statem_srvr.c:2752:10: Assignment 2750. decrypt_good = constant_time_eq_int_8(rsa_decrypt[0], 0) & 2751. constant_time_eq_int_8(rsa_decrypt[1], 2); 2752. for (j = 2; j < padding_len - 1; j++) { ^ 2753. decrypt_good &= ~constant_time_is_zero_8(rsa_decrypt[j]); 2754. } ssl/statem/statem_srvr.c:2707:19: <Length trace> 2705. } 2706. 2707. rsa_decrypt = OPENSSL_malloc(RSA_size(rsa)); ^ 2708. if (rsa_decrypt == NULL) { 2709. *al = SSL_AD_INTERNAL_ERROR; ssl/statem/statem_srvr.c:2707:19: Call 2705. } 2706. 2707. rsa_decrypt = OPENSSL_malloc(RSA_size(rsa)); ^ 2708. if (rsa_decrypt == NULL) { 2709. *al = SSL_AD_INTERNAL_ERROR; crypto/rsa/rsa_crpt.c:25:12: Call 23. int RSA_size(const RSA *r) 24. { 25. return BN_num_bytes(r->n); ^ 26. } 27. crypto/bn/bn_lib.c:167:9: Assignment 165. 166. if (BN_is_zero(a)) 167. return 0; ^ 168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); 169. } crypto/rsa/rsa_crpt.c:25:5: Assignment 23. int RSA_size(const RSA *r) 24. { 25. return BN_num_bytes(r->n); ^ 26. } 27. ssl/statem/statem_srvr.c:2707:19: Call 2705. } 2706. 2707. rsa_decrypt = OPENSSL_malloc(RSA_size(rsa)); ^ 2708. if (rsa_decrypt == NULL) { 2709. *al = SSL_AD_INTERNAL_ERROR; crypto/mem.c:177:9: Assignment 175. 176. if (num == 0) 177. return NULL; ^ 178. 179. FAILTEST(); ssl/statem/statem_srvr.c:2707:5: Assignment 2705. } 2706. 2707. rsa_decrypt = OPENSSL_malloc(RSA_size(rsa)); ^ 2708. if (rsa_decrypt == NULL) { 2709. *al = SSL_AD_INTERNAL_ERROR; ssl/statem/statem_srvr.c:2753:50: Array access: Offset: [2, +oo] Size: [1, +oo] 2751. constant_time_eq_int_8(rsa_decrypt[1], 2); 2752. for (j = 2; j < padding_len - 1; j++) { 2753. decrypt_good &= ~constant_time_is_zero_8(rsa_decrypt[j]); ^ 2754. } 2755. decrypt_good &= constant_time_is_zero_8(rsa_decrypt[padding_len - 1]);
https://github.com/openssl/openssl/blob/aa048aef0b9146f90c06333dedfc105d1f9e2c22/ssl/statem/statem_srvr.c/#L2753
d2a_code_trace_data_41985
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:2456: error: NULL_DEREFERENCE pointer `null` is dereferenced by call to `ssl_security_cert()` at line 2456, column 10. Showing all 11 steps of the trace ssl/t1_lib.c:2447:1: start of procedure ssl_security_cert_chain() 2445. */ 2446. 2447. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy) 2448. { 2449. int rv, start_idx, i; ssl/t1_lib.c:2450:9: Taking true branch 2448. { 2449. int rv, start_idx, i; 2450. if (x == NULL) { ^ 2451. x = sk_X509_value(sk, 0); 2452. start_idx = 1; ssl/t1_lib.c:2451:9: 2449. int rv, start_idx, i; 2450. if (x == NULL) { 2451. > x = sk_X509_value(sk, 0); 2452. start_idx = 1; 2453. } else include/openssl/x509.h:99:1: start of procedure sk_X509_value() 97. typedef struct x509_cinf_st X509_CINF; 98. 99. > DEFINE_STACK_OF(X509) 100. 101. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:385:1: start of procedure OPENSSL_sk_value() 383. } 384. 385. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) 386. { 387. if (st == NULL || i < 0 || i >= st->num) crypto/stack/stack.c:387:9: Taking true branch 385. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) 386. { 387. if (st == NULL || i < 0 || i >= st->num) ^ 388. return NULL; 389. return (void *)st->data[i]; crypto/stack/stack.c:388:9: 386. { 387. if (st == NULL || i < 0 || i >= st->num) 388. > return NULL; 389. return (void *)st->data[i]; 390. } crypto/stack/stack.c:390:1: return from a call to OPENSSL_sk_value 388. return NULL; 389. return (void *)st->data[i]; 390. > } 391. 392. void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data) include/openssl/x509.h:99:1: return from a call to sk_X509_value 97. typedef struct x509_cinf_st X509_CINF; 98. 99. > DEFINE_STACK_OF(X509) 100. 101. /* This is used for a table of trust checking functions */ ssl/t1_lib.c:2452:9: 2450. if (x == NULL) { 2451. x = sk_X509_value(sk, 0); 2452. > start_idx = 1; 2453. } else 2454. start_idx = 0; ssl/t1_lib.c:2456:5: 2454. start_idx = 0; 2455. 2456. > rv = ssl_security_cert(s, NULL, x, vfy, 1); 2457. if (rv != 1) 2458. return rv;
https://github.com/openssl/openssl/blob/1901516a4ba909fff12e0e7815aa2d499f4d6d67/ssl/t1_lib.c/#L2456
d2a_code_trace_data_41986
static inline void refill_32(BitstreamContext *bc) { if (bc->ptr >= bc->buffer_end) return; #ifdef BITSTREAM_READER_LE bc->bits = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits; #else bc->bits = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left); #endif bc->ptr += 4; bc->bits_left += 32; } libavcodec/wavpack.c:480: error: Integer Overflow L2 (32 - [-1+min(64, `s->bc_extra_bits.bits_left`), max(63, `s->bc_extra_bits.bits_left`)]):unsigned32 by call to `bitstream_read`. libavcodec/wavpack.c:435:1: Parameter `s->bc_extra_bits.bits_left` 433. } 434. 435. static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S) ^ 436. { 437. union { libavcodec/wavpack.c:480:26: Call 478. } else if (s->got_extra_bits && 479. (s->float_flag & WV_FLT_SHIFT_SENT)) { 480. S |= bitstream_read(&s->bc_extra_bits, shift); ^ 481. } 482. } libavcodec/bitstream.h:183:1: Parameter `n` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/bitstream.h:189:9: Call 187. 188. if (n > bc->bits_left) { 189. refill_32(bc); ^ 190. if (bc->bits_left < 32) 191. bc->bits_left = n; libavcodec/bitstream.h:60:1: <RHS trace> 58. } 59. 60. static inline void refill_32(BitstreamContext *bc) ^ 61. { 62. if (bc->ptr >= bc->buffer_end) libavcodec/bitstream.h:60:1: Parameter `bc->bits_left` 58. } 59. 60. static inline void refill_32(BitstreamContext *bc) ^ 61. { 62. if (bc->ptr >= bc->buffer_end) libavcodec/bitstream.h:68:5: Binary operation: (32 - [-1+min(64, s->bc_extra_bits.bits_left), max(63, s->bc_extra_bits.bits_left)]):unsigned32 by call to `bitstream_read` 66. bc->bits = (uint64_t)AV_RL32(bc->ptr) << bc->bits_left | bc->bits; 67. #else 68. bc->bits = bc->bits | (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_left); ^ 69. #endif 70. bc->ptr += 4;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L68
d2a_code_trace_data_41987
void ff_set_common_channel_layouts(AVFilterContext *ctx, AVFilterChannelLayouts *layouts) { SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts, ff_channel_layouts_ref, channel_layouts); } libavfilter/formats.c:373: error: Memory Leak memory dynamically allocated by call to `ff_channel_layouts_ref()` at line 373, column 5 is not reachable after line 373, column 5. libavfilter/formats.c:370:1: start of procedure ff_set_common_channel_layouts() 368. } 369. 370. void ff_set_common_channel_layouts(AVFilterContext *ctx, ^ 371. AVFilterChannelLayouts *layouts) 372. { libavfilter/formats.c:373:5: Loop condition is true. Entering loop body 371. AVFilterChannelLayouts *layouts) 372. { 373. SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts, ^ 374. ff_channel_layouts_ref, channel_layouts); 375. } libavfilter/formats.c:373:5: Taking true branch 371. AVFilterChannelLayouts *layouts) 372. { 373. SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts, ^ 374. ff_channel_layouts_ref, channel_layouts); 375. } libavfilter/formats.c:271:1: start of procedure ff_channel_layouts_ref() 269. } while (0) 270. 271. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref) ^ 272. { 273. FORMATS_REF(f, ref); libavfilter/formats.c:273:5: 271. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref) 272. { 273. FORMATS_REF(f, ref); ^ 274. } 275. 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) libavfilter/formats.c:273:5: Taking false branch 271. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref) 272. { 273. FORMATS_REF(f, ref); ^ 274. } 275. libavfilter/formats.c:273:5: Loop condition is false. Leaving loop 271. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref) 272. { 273. FORMATS_REF(f, ref); ^ 274. } 275. libavfilter/formats.c:274:1: return from a call to ff_channel_layouts_ref 272. { 273. FORMATS_REF(f, ref); 274. } ^ 275. 276. void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref) libavfilter/formats.c:373:5: Loop condition is true. Entering loop body 371. AVFilterChannelLayouts *layouts) 372. { 373. SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts, ^ 374. ff_channel_layouts_ref, channel_layouts); 375. } libavfilter/formats.c:373:5: Taking true branch 371. AVFilterChannelLayouts *layouts) 372. { 373. SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts, ^ 374. ff_channel_layouts_ref, channel_layouts); 375. } libavfilter/formats.c:271:1: start of procedure ff_channel_layouts_ref() 269. } while (0) 270. 271. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref) ^ 272. { 273. FORMATS_REF(f, ref); libavfilter/formats.c:273:5: 271. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref) 272. { 273. FORMATS_REF(f, ref); ^ 274. } 275. 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 true branch 122. 123. /* let's disallow possibly ambiguous cases */ 124. if (size > (INT_MAX - 16)) ^ 125. return NULL; 126. libavutil/mem.c:125:9: 123. /* let's disallow possibly ambiguous cases */ 124. if (size > (INT_MAX - 16)) 125. return NULL; ^ 126. 127. #if CONFIG_MEMALIGN_HACK 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) libavfilter/formats.c:273:5: Taking true branch 271. void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref) 272. { 273. FORMATS_REF(f, ref); ^ 274. } 275. libavfilter/formats.c:274:1: return from a call to ff_channel_layouts_ref 272. { 273. FORMATS_REF(f, ref); 274. } ^ 275. 276. void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
https://github.com/libav/libav/blob/83847cc8fa97e0fc637a0962bafb837acdb6eacc/libavfilter/formats.c/#L373
d2a_code_trace_data_41988
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; int ret; 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; 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; 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; 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_8(j, c); is_past_cp1 = is_block_a & constant_time_ge_8(j, c + 1); b = constant_time_select_8(is_past_c, 0x80, b); b = b & ~is_past_cp1; b &= ~is_block_b | is_block_a; if (j >= md_block_size - md_length_size) { b = constant_time_select_8(is_block_b, length_bytes[j - (md_block_size - md_length_size)], b); } 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); } ret = EVP_DigestFinal(&md_ctx, md_out, &md_out_size_u); if (ret && md_out_size) *md_out_size = md_out_size_u; EVP_MD_CTX_cleanup(&md_ctx); } ssl/record/ssl3_record.c:824: error: INTEGER_OVERFLOW_L2 ([13, +oo] - [16, 64]):unsigned64 by call to `ssl3_cbc_digest_record`. Showing all 7 steps of the trace ssl/record/ssl3_record.c:765:1: Parameter `ssl->rlayer.rrec.length` 763. } 764. 765. > int n_ssl3_mac(SSL *ssl, unsigned char *md, int send) 766. { 767. SSL3_RECORD *rec; ssl/record/ssl3_record.c:824:9: Call 822. 823. /* Final param == is SSLv3 */ 824. ssl3_cbc_digest_record(hash, ^ 825. md, &md_size, 826. header, rec->input, ssl/s3_cbc.c:176:1: <LHS trace> 174. * padding too. ) 175. */ 176. > void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, 177. unsigned char *md_out, 178. size_t *md_out_size, ssl/s3_cbc.c:176:1: Parameter `data_plus_mac_size` 174. * padding too. ) 175. */ 176. > void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, 177. unsigned char *md_out, 178. size_t *md_out_size, ssl/s3_cbc.c:224:9: <RHS trace> 222. md_transform = 223. (void (*)(void *ctx, const unsigned char *block))MD5_Transform; 224. md_size = 16; ^ 225. sslv3_pad_length = 48; 226. length_is_big_endian = 0; ssl/s3_cbc.c:224:9: Assignment 222. md_transform = 223. (void (*)(void *ctx, const unsigned char *block))MD5_Transform; 224. md_size = 16; ^ 225. sslv3_pad_length = 48; 226. length_is_big_endian = 0; ssl/s3_cbc.c:337:5: Binary operation: ([13, +oo] - [16, 64]):unsigned64 by call to `ssl3_cbc_digest_record` 335. * mac_end_offset is the index just past the end of the data to be MACed. 336. */ 337. mac_end_offset = data_plus_mac_size + header_length - md_size; ^ 338. /* 339. * c is the index of the 0x80 byte in the final hash block that contains
https://github.com/openssl/openssl/blob/747e16398d704a667cc99f8a0b1912c36b7de52d/ssl/s3_cbc.c/#L337
d2a_code_trace_data_41989
static inline uint64_t get_val(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1); bc->bits >>= n; #else uint64_t ret = bc->bits >> (64 - n); bc->bits <<= n; #endif bc->bits_left -= n; return ret; } libavcodec/mpc7.c:298: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `idx_to_quant`. libavcodec/mpc7.c:251:36: Call 249. t = bitstream_read_vlc(&bc, hdr_vlc.table, MPC7_HDR_BITS, 1) - 5; 250. if (t == 4) 251. bands[i].res[ch] = bitstream_read(&bc, 4); ^ 252. else bands[i].res[ch] = av_clip(bands[i-1].res[ch] + t, 0, 17); 253. } libavcodec/bitstream.h:183:1: Parameter `bc->bits_left` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/mpc7.c:298:13: Call 296. for(i = 0; i < BANDS; i++, off += SAMPLES_PER_BAND) 297. for(ch = 0; ch < 2; ch++) 298. idx_to_quant(c, &bc, bands[i].res[ch], c->Q[ch] + off); ^ 299. 300. ff_mpc_dequantize_and_synth(c, mb, (int16_t **)frame->extended_data, 2); libavcodec/mpc7.c:147:1: Parameter `bc->bits_left` 145. * Fill samples for given subband 146. */ 147. static inline void idx_to_quant(MPCContext *c, BitstreamContext *bc, int idx, int *dst) ^ 148. { 149. int i, i1, t; libavcodec/mpc7.c:157:14: Call 155. break; 156. case 1: 157. i1 = bitstream_read_bit(bc); ^ 158. for(i = 0; i < SAMPLES_PER_BAND/3; i++){ 159. t = bitstream_read_vlc(bc, quant_vlc[0][i1].table, 9, 2); libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `idx_to_quant` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
d2a_code_trace_data_41990
int ossl_init_thread_start(uint64_t opts) { struct thread_local_inits_st *locals; if (!OPENSSL_init_crypto(0, NULL)) return 0; locals = ossl_init_get_thread_local(1); if (locals == NULL) return 0; if (opts & OPENSSL_INIT_THREAD_ASYNC) { #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " "marking thread for async\n"); #endif locals->async = 1; } if (opts & OPENSSL_INIT_THREAD_ERR_STATE) { #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " "marking thread for err_state\n"); #endif locals->err_state = 1; } return 1; } crypto/init.c:384: error: MEMORY_LEAK memory dynamically allocated to `locals` by call to `ossl_init_get_thread_local()` at line 371, column 14 is not reachable after line 384, column 9. Showing all 40 steps of the trace crypto/init.c:364:1: start of procedure ossl_init_thread_start() 362. } 363. 364. > int ossl_init_thread_start(uint64_t opts) 365. { 366. struct thread_local_inits_st *locals; crypto/init.c:368:10: Taking false branch 366. struct thread_local_inits_st *locals; 367. 368. if (!OPENSSL_init_crypto(0, NULL)) ^ 369. return 0; 370. crypto/init.c:371:5: 369. return 0; 370. 371. > locals = ossl_init_get_thread_local(1); 372. 373. if (locals == NULL) crypto/init.c:41:1: start of procedure ossl_init_get_thread_local() 39. } 40. 41. > static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) 42. { 43. struct thread_local_inits_st *local = crypto/init.c:43:5: 41. static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) 42. { 43. > struct thread_local_inits_st *local = 44. CRYPTO_THREAD_get_local(&threadstopkey); 45. crypto/threads_pthread.c:121:1: start of procedure CRYPTO_THREAD_get_local() 119. } 120. 121. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 122. { 123. return pthread_getspecific(*key); crypto/threads_pthread.c:123:5: Skipping pthread_getspecific(): method has no implementation 121. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 122. { 123. return pthread_getspecific(*key); ^ 124. } 125. crypto/threads_pthread.c:124:1: return from a call to CRYPTO_THREAD_get_local 122. { 123. return pthread_getspecific(*key); 124. > } 125. 126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) crypto/init.c:46:9: Taking true branch 44. CRYPTO_THREAD_get_local(&threadstopkey); 45. 46. if (local == NULL && alloc) { ^ 47. local = OPENSSL_zalloc(sizeof(*local)); 48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { crypto/init.c:46:26: Taking true branch 44. CRYPTO_THREAD_get_local(&threadstopkey); 45. 46. if (local == NULL && alloc) { ^ 47. local = OPENSSL_zalloc(sizeof(*local)); 48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { crypto/init.c:47:9: 45. 46. if (local == NULL && alloc) { 47. > local = OPENSSL_zalloc(sizeof(*local)); 48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { 49. OPENSSL_free(local); crypto/mem.c:221:1: start of procedure CRYPTO_zalloc() 219. } 220. 221. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 222. { 223. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:223:5: 221. void *CRYPTO_zalloc(size_t num, const char *file, int line) 222. { 223. > void *ret = CRYPTO_malloc(num, file, line); 224. 225. 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:5: 202. 203. FAILTEST(); 204. > allow_customize = 0; 205. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 206. if (call_malloc_debug) { crypto/mem.c:214:5: 212. } 213. #else 214. > (void)(file); (void)(line); 215. ret = malloc(num); 216. #endif crypto/mem.c:214:19: 212. } 213. #else 214. > (void)(file); (void)(line); 215. ret = malloc(num); 216. #endif crypto/mem.c:215:5: 213. #else 214. (void)(file); (void)(line); 215. > ret = malloc(num); 216. #endif 217. crypto/mem.c:218:5: 216. #endif 217. 218. > return ret; 219. } 220. crypto/mem.c:219:1: return from a call to CRYPTO_malloc 217. 218. return ret; 219. > } 220. 221. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:226:9: Taking true branch 224. 225. FAILTEST(); 226. if (ret != NULL) ^ 227. memset(ret, 0, num); 228. return ret; crypto/mem.c:227:9: 225. FAILTEST(); 226. if (ret != NULL) 227. > memset(ret, 0, num); 228. return ret; 229. } crypto/mem.c:228:5: 226. if (ret != NULL) 227. memset(ret, 0, num); 228. > return ret; 229. } 230. crypto/mem.c:229:1: return from a call to CRYPTO_zalloc 227. memset(ret, 0, num); 228. return ret; 229. > } 230. 231. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/init.c:48:13: Taking true branch 46. if (local == NULL && alloc) { 47. local = OPENSSL_zalloc(sizeof(*local)); 48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { ^ 49. OPENSSL_free(local); 50. return NULL; crypto/init.c:48:31: 46. if (local == NULL && alloc) { 47. local = OPENSSL_zalloc(sizeof(*local)); 48. > if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { 49. OPENSSL_free(local); 50. return NULL; crypto/threads_pthread.c:126:1: start of procedure CRYPTO_THREAD_set_local() 124. } 125. 126. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 127. { 128. if (pthread_setspecific(*key, val) != 0) crypto/threads_pthread.c:128:9: Taking false branch 126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 127. { 128. if (pthread_setspecific(*key, val) != 0) ^ 129. return 0; 130. crypto/threads_pthread.c:131:5: 129. return 0; 130. 131. > return 1; 132. } 133. crypto/threads_pthread.c:132:1: return from a call to CRYPTO_THREAD_set_local 130. 131. return 1; 132. > } 133. 134. int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key) crypto/init.c:48:31: Taking false branch 46. if (local == NULL && alloc) { 47. local = OPENSSL_zalloc(sizeof(*local)); 48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { ^ 49. OPENSSL_free(local); 50. return NULL; crypto/init.c:53:10: Taking false branch 51. } 52. } 53. if (!alloc) { ^ 54. CRYPTO_THREAD_set_local(&threadstopkey, NULL); 55. } crypto/init.c:57:5: 55. } 56. 57. > return local; 58. } 59. crypto/init.c:58:1: return from a call to ossl_init_get_thread_local 56. 57. return local; 58. > } 59. 60. typedef struct ossl_init_stop_st OPENSSL_INIT_STOP; crypto/init.c:373:9: Taking false branch 371. locals = ossl_init_get_thread_local(1); 372. 373. if (locals == NULL) ^ 374. return 0; 375. crypto/init.c:376:9: Taking false branch 374. return 0; 375. 376. if (opts & OPENSSL_INIT_THREAD_ASYNC) { ^ 377. #ifdef OPENSSL_INIT_DEBUG 378. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " crypto/init.c:384:9: Taking false branch 382. } 383. 384. if (opts & OPENSSL_INIT_THREAD_ERR_STATE) { ^ 385. #ifdef OPENSSL_INIT_DEBUG 386. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
https://github.com/openssl/openssl/blob/63ab5ea13b671cb60dd4b7cfde2bcae9d14c5a60/crypto/init.c/#L384
d2a_code_trace_data_41991
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } r->neg = a->neg; nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } test/bntest.c:1859: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `BN_generate_prime_ex`. Showing all 18 steps of the trace test/bntest.c:1859:10: Call 1857. 1858. r = BN_new(); 1859. if (!BN_generate_prime_ex(r, bits, 0, NULL, NULL, NULL)) ^ 1860. goto err; 1861. if (BN_num_bits(r) != bits) { crypto/bn/bn_prime.c:101:1: Parameter `add->top` 99. } 100. 101. > int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, 102. const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb) 103. { crypto/bn/bn_prime.c:142:18: Call 140. goto err; 141. } else { 142. if (!bn_probable_prime_dh(ret, bits, add, rem, ctx)) ^ 143. goto err; 144. } crypto/bn/bn_prime.c:494:1: Parameter `add->top` 492. } 493. 494. > int bn_probable_prime_dh(BIGNUM *rnd, int bits, 495. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx) 496. { crypto/bn/bn_prime.c:509:10: Call 507. /* we need ((rnd-rem) % add) == 0 */ 508. 509. if (!BN_mod(t1, rnd, add, ctx)) ^ 510. goto err; 511. if (!BN_sub(rnd, rnd, t1)) crypto/bn/bn_div.c:205:31: Call 203. 204. /* First we normalise the numbers */ 205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); ^ 206. if (!(BN_lshift(sdiv, divisor, norm_shift))) 207. goto err; crypto/bn/bn_lib.c:167:9: Assignment 165. 166. if (BN_is_zero(a)) 167. return 0; ^ 168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); 169. } crypto/bn/bn_div.c:205:5: Assignment 203. 204. /* First we normalise the numbers */ 205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); ^ 206. if (!(BN_lshift(sdiv, divisor, norm_shift))) 207. goto err; crypto/bn/bn_div.c:206:11: Call 204. /* First we normalise the numbers */ 205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); 206. if (!(BN_lshift(sdiv, divisor, norm_shift))) ^ 207. goto err; 208. sdiv->neg = 0; crypto/bn/bn_shift.c:81:1: <Offset trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `n` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:96:5: Assignment 94. 95. r->neg = a->neg; 96. nw = n / BN_BITS2; ^ 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) 98. return (0); crypto/bn/bn_shift.c:81:1: <Length trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `*r->d` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:9: Call 95. r->neg = a->neg; 96. nw = n / BN_BITS2; 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 98. return (0); 99. lb = n % BN_BITS2; crypto/bn/bn_lib.c:1016:1: Parameter `*a->d` 1014. } 1015. 1016. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 1017. { 1018. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_shift.c:102:5: Assignment 100. rb = BN_BITS2 - lb; 101. f = a->d; 102. t = r->d; ^ 103. t[a->top + nw] = 0; 104. if (lb == 0) crypto/bn/bn_shift.c:110:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_generate_prime_ex` 108. for (i = a->top - 1; i >= 0; i--) { 109. l = f[i]; 110. t[nw + i + 1] |= (l >> rb) & BN_MASK2; ^ 111. t[nw + i] = (l << lb) & BN_MASK2; 112. }
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_shift.c/#L110
d2a_code_trace_data_41992
int BN_set_bit(BIGNUM *a, int n) { int i, j, k; if (n < 0) return 0; i = n / BN_BITS2; j = n % BN_BITS2; if (a->top <= i) { if (bn_wexpand(a, i + 1) == NULL) return (0); for (k = a->top; k < i + 1; k++) a->d[k] = 0; a->top = i + 1; } a->d[i] |= (((BN_ULONG)1) << j); bn_check_top(a); return (1); } test/bntest.c:191: error: BUFFER_OVERRUN_L3 Offset: [0, 49] Size: [0, 8388607] by call to `BN_set_bit`. Showing all 7 steps of the trace test/bntest.c:69:1: Assignment 67. } MPITEST; 68. 69. > static const int NUM0 = 100; /* number of tests */ 70. static const int NUM1 = 50; /* additional tests for some functions */ 71. static FILE *fp; test/bntest.c:191:17: Call 189. BN_bntest_rand(a, 512, 0, 0); 190. BN_copy(b, a); 191. if (BN_set_bit(a, i) == 0) ^ 192. return 0; 193. BN_add_word(b, i); crypto/bn/bn_lib.c:692:1: <Offset trace> 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: Parameter `a->top` 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: <Length trace> 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: Parameter `*a->d` 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:709:5: Array access: Offset: [0, 49] Size: [0, 8388607] by call to `BN_set_bit` 707. } 708. 709. a->d[i] |= (((BN_ULONG)1) << j); ^ 710. bn_check_top(a); 711. return (1);
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_lib.c/#L709
d2a_code_trace_data_41993
static ngx_int_t ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) { #if (NGX_HAVE_UNIX_DOMAIN) u_char *path, *uri, *last; size_t len; struct sockaddr_un *saun; len = u->url.len; path = u->url.data; path += 5; len -= 5; if (u->uri_part) { last = path + len; uri = ngx_strlchr(path, last, ':'); if (uri) { len = uri - path; uri++; u->uri.len = last - uri; u->uri.data = uri; } } if (len == 0) { u->err = "no path in the unix domain socket"; return NGX_ERROR; } u->host.len = len++; u->host.data = path; if (len > sizeof(saun->sun_path)) { u->err = "too long path in the unix domain socket"; return NGX_ERROR; } u->socklen = sizeof(struct sockaddr_un); saun = (struct sockaddr_un *) &u->sockaddr; saun->sun_family = AF_UNIX; (void) ngx_cpystrn((u_char *) saun->sun_path, path, len); u->addrs = ngx_pcalloc(pool, sizeof(ngx_peer_addr_t)); if (u->addrs == NULL) { return NGX_ERROR; } saun = ngx_pcalloc(pool, sizeof(struct sockaddr_un)); if (saun == NULL) { return NGX_ERROR; } u->family = AF_UNIX; u->naddrs = 1; saun->sun_family = AF_UNIX; (void) ngx_cpystrn((u_char *) saun->sun_path, path, len); u->addrs[0].sockaddr = (struct sockaddr *) saun; u->addrs[0].socklen = sizeof(struct sockaddr_un); u->addrs[0].name.len = len + 4; u->addrs[0].name.data = u->url.data; return NGX_OK; #else u->err = "the unix domain sockets are not supported on this platform"; return NGX_ERROR; #endif } src/http/modules/ngx_http_proxy_module.c:2612: error: Integer Overflow L2 ([0, +oo] - 5):unsigned64 by call to `ngx_http_upstream_add`. src/http/modules/ngx_http_proxy_module.c:2581:9: Assignment 2579. 2580. if (ngx_strncasecmp(url->data, (u_char *) "http://", 7) == 0) { 2581. add = 7; ^ 2582. port = 80; 2583. src/http/modules/ngx_http_proxy_module.c:2606:5: Assignment 2604. ngx_memzero(&u, sizeof(ngx_url_t)); 2605. 2606. u.url.len = url->len - add; ^ 2607. u.url.data = url->data + add; 2608. u.default_port = port; src/http/modules/ngx_http_proxy_module.c:2612:31: Call 2610. u.no_resolve = 1; 2611. 2612. plcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0); ^ 2613. if (plcf->upstream.upstream == NULL) { 2614. return NGX_CONF_ERROR; src/http/ngx_http_upstream.c:3902:1: Parameter `u->url.len` 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/ngx_http_upstream.c:3912:13: Call 3910. if (!(flags & NGX_HTTP_UPSTREAM_CREATE)) { 3911. 3912. if (ngx_parse_url(cf->pool, u) != NGX_OK) { ^ 3913. if (u->err) { 3914. ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, src/core/ngx_inet.c:285:1: Parameter `u->url.len` 283. 284. 285. ngx_int_t ^ 286. ngx_parse_url(ngx_pool_t *pool, ngx_url_t *u) 287. { src/core/ngx_inet.c:293:16: Call 291. 292. if (ngx_strncasecmp(p, (u_char *) "unix:", 5) == 0) { 293. return ngx_parse_unix_domain_url(pool, u); ^ 294. } 295. src/core/ngx_inet.c:309:1: <LHS trace> 307. 308. 309. static ngx_int_t ^ 310. ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) 311. { src/core/ngx_inet.c:309:1: Parameter `u->url.len` 307. 308. 309. static ngx_int_t ^ 310. ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u) 311. { src/core/ngx_inet.c:317:5: Assignment 315. struct sockaddr_un *saun; 316. 317. len = u->url.len; ^ 318. path = u->url.data; 319. src/core/ngx_inet.c:321:5: Binary operation: ([0, +oo] - 5):unsigned64 by call to `ngx_http_upstream_add` 319. 320. path += 5; 321. len -= 5; ^ 322. 323. if (u->uri_part) {
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_inet.c/#L321
d2a_code_trace_data_41994
static int check_chain_extensions(X509_STORE_CTX *ctx) { int i, ok = 0, must_be_ca, plen = 0; X509 *x; int (*cb) (int xok, X509_STORE_CTX *xctx); int proxy_path_length = 0; int purpose; int allow_proxy_certs; cb = ctx->verify_cb; must_be_ca = -1; if (ctx->parent) { allow_proxy_certs = 0; purpose = X509_PURPOSE_CRL_SIGN; } else { allow_proxy_certs = ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) allow_proxy_certs = 1; purpose = ctx->param->purpose; } for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { int ret; x = sk_X509_value(ctx->chain, i); if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) && (x->ex_flags & EXFLAG_CRITICAL)) { ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) { ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } ret = X509_check_ca(x); switch (must_be_ca) { case -1: if ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1) && (ret != 0)) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; case 0: if (ret != 0) { ret = 0; ctx->error = X509_V_ERR_INVALID_NON_CA; } else ret = 1; break; default: if ((ret == 0) || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1))) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; } if (ret == 0) { ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (ctx->param->purpose > 0) { ret = X509_check_purpose(x, purpose, must_be_ca > 0); if ((ret == 0) || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1))) { ctx->error = X509_V_ERR_INVALID_PURPOSE; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } } if ((i > 1) && !(x->ex_flags & EXFLAG_SI) && (x->ex_pathlen != -1) && (plen > (x->ex_pathlen + proxy_path_length + 1))) { ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (!(x->ex_flags & EXFLAG_SI)) plen++; if (x->ex_flags & EXFLAG_PROXY) { if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) { ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } proxy_path_length++; must_be_ca = 0; } else must_be_ca = 1; } ok = 1; end: return ok; } crypto/x509/x509_vfy.c:390: error: NULL_DEREFERENCE pointer `x` last assigned on line 380 could be null and is dereferenced at line 390, column 36. Showing all 24 steps of the trace crypto/x509/x509_vfy.c:340:1: start of procedure check_chain_extensions() 338. */ 339. 340. > static int check_chain_extensions(X509_STORE_CTX *ctx) 341. { 342. int i, ok = 0, must_be_ca, plen = 0; crypto/x509/x509_vfy.c:342:5: 340. static int check_chain_extensions(X509_STORE_CTX *ctx) 341. { 342. > int i, ok = 0, must_be_ca, plen = 0; 343. X509 *x; 344. int (*cb) (int xok, X509_STORE_CTX *xctx); crypto/x509/x509_vfy.c:345:5: 343. X509 *x; 344. int (*cb) (int xok, X509_STORE_CTX *xctx); 345. > int proxy_path_length = 0; 346. int purpose; 347. int allow_proxy_certs; crypto/x509/x509_vfy.c:348:5: 346. int purpose; 347. int allow_proxy_certs; 348. > cb = ctx->verify_cb; 349. 350. /*- crypto/x509/x509_vfy.c:359:5: 357. * all certificates in the chain except the leaf certificate. 358. */ 359. > must_be_ca = -1; 360. 361. /* CRL path validation */ crypto/x509/x509_vfy.c:362:9: Taking false branch 360. 361. /* CRL path validation */ 362. if (ctx->parent) { ^ 363. allow_proxy_certs = 0; 364. purpose = X509_PURPOSE_CRL_SIGN; crypto/x509/x509_vfy.c:367:17: Condition is true 365. } else { 366. allow_proxy_certs = 367. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); ^ 368. /* 369. * A hack to keep people who don't want to modify their software crypto/x509/x509_vfy.c:367:13: 365. } else { 366. allow_proxy_certs = 367. > ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 368. /* 369. * A hack to keep people who don't want to modify their software crypto/x509/x509_vfy.c:366:9: 364. purpose = X509_PURPOSE_CRL_SIGN; 365. } else { 366. > allow_proxy_certs = 367. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 368. /* crypto/x509/x509_vfy.c:372:13: Taking false branch 370. * happy 371. */ 372. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) ^ 373. allow_proxy_certs = 1; 374. purpose = ctx->param->purpose; crypto/x509/x509_vfy.c:374:9: 372. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) 373. allow_proxy_certs = 1; 374. > purpose = ctx->param->purpose; 375. } 376. crypto/x509/x509_vfy.c:378:10: 376. 377. /* Check all untrusted certificates */ 378. > for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { 379. int ret; 380. x = sk_X509_value(ctx->chain, i); crypto/x509/x509_vfy.c:378:17: Loop condition is true. Entering loop body 376. 377. /* Check all untrusted certificates */ 378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { ^ 379. int ret; 380. x = sk_X509_value(ctx->chain, i); crypto/x509/x509_vfy.c:380:13: Condition is true 378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { 379. int ret; 380. x = sk_X509_value(ctx->chain, i); ^ 381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 382. && (x->ex_flags & EXFLAG_CRITICAL)) { crypto/x509/x509_vfy.c:380:9: 378. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { 379. int ret; 380. > x = sk_X509_value(ctx->chain, i); 381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 382. && (x->ex_flags & EXFLAG_CRITICAL)) { crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:17: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:28: Taking true branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:327:9: 325. { 326. if (!st || (i < 0) || (i >= st->num)) 327. > return NULL; 328. return st->data[i]; 329. } crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:381:15: Taking false branch 379. int ret; 380. x = sk_X509_value(ctx->chain, i); 381. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) ^ 382. && (x->ex_flags & EXFLAG_CRITICAL)) { 383. ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; crypto/x509/x509_vfy.c:390:14: Taking true branch 388. goto end; 389. } 390. if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) { ^ 391. ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; 392. ctx->error_depth = i; crypto/x509/x509_vfy.c:390:36: 388. goto end; 389. } 390. > if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) { 391. ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; 392. ctx->error_depth = i;
https://github.com/openssl/openssl/blob/e29c73c93b88a4b7f492c7c8c7343223e7548612/crypto/x509/x509_vfy.c/#L390
d2a_code_trace_data_41995
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/cipherlist_test.c:170: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 16 steps of the trace test/cipherlist_test.c:148:10: Call 146. return 0; 147. 148. if (!TEST_ptr(ssl = SSL_new(ctx)) ^ 149. || !TEST_ptr(ciphers = SSL_get1_supported_ciphers(ssl))) 150. goto err; ssl/ssl_lib.c:494:1: Parameter `ctx->sessions->num_items` 492. } 493. 494. > SSL *SSL_new(SSL_CTX *ctx) 495. { 496. SSL *s; test/cipherlist_test.c:170:5: Call 168. err: 169. sk_SSL_CIPHER_free(ciphers); 170. SSL_free(ssl); ^ 171. return ret; 172. } ssl/ssl_lib.c:942:1: Parameter `s->session_ctx->sessions->num_items` 940. } 941. 942. > void SSL_free(SSL *s) 943. { 944. int i; ssl/ssl_lib.c:973:9: Call 971. /* Make the next call work :-) */ 972. if (s->session != NULL) { 973. ssl_clear_bad_session(s); ^ 974. SSL_SESSION_free(s->session); 975. } ssl/ssl_sess.c:1043:1: Parameter `s->session_ctx->sessions->num_items` 1041. } 1042. 1043. > int ssl_clear_bad_session(SSL *s) 1044. { 1045. if ((s->session != NULL) && ssl/ssl_sess.c:1048:9: Call 1046. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1047. !(SSL_in_init(s) || SSL_in_before(s))) { 1048. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1049. return (1); 1050. } else ssl/ssl_sess.c:707:1: Parameter `ctx->sessions->num_items` 705. } 706. 707. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 708. { 709. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:709:12: Call 707. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 708. { 709. return remove_session_lock(ctx, c, 1); ^ 710. } 711. ssl/ssl_sess.c:712:1: Parameter `ctx->sessions->num_items` 710. } 711. 712. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 713. { 714. SSL_SESSION *r; ssl/ssl_sess.c:722:17: Call 720. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 721. ret = 1; 722. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 723. SSL_SESSION_list_remove(ctx, c); 724. } ssl/ssl_locl.h:696:1: Parameter `lh->num_items` 694. } TLSEXT_INDEX; 695. 696. > DEFINE_LHASH_OF(SSL_SESSION); 697. /* Needed in ssl_cert.c */ 698. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:696:1: Call 694. } TLSEXT_INDEX; 695. 696. > DEFINE_LHASH_OF(SSL_SESSION); 697. /* Needed in ssl_cert.c */ 698. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:106:1: <LHS trace> 104. } 105. 106. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 107. { 108. unsigned long hash; crypto/lhash/lhash.c:106:1: Parameter `lh->num_items` 104. } 105. 106. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 107. { 108. unsigned long hash; crypto/lhash/lhash.c:126:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free` 124. } 125. 126. lh->num_items--; ^ 127. if ((lh->num_nodes > MIN_NODES) && 128. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/25ffeb11ea86bdc76db150c504550602a9acc9bc/crypto/lhash/lhash.c/#L126
d2a_code_trace_data_41996
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_mont.c:397: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_div`. Showing all 20 steps of the trace crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth` 261. } 262. 263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 264. { 265. int i, ret = 0; crypto/bn/bn_mont.c:271:5: Call 269. return 0; 270. 271. BN_CTX_start(ctx); ^ 272. if ((Ri = BN_CTX_get(ctx)) == NULL) 273. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mont.c:272:15: Call 270. 271. BN_CTX_start(ctx); 272. if ((Ri = BN_CTX_get(ctx)) == NULL) ^ 273. goto err; 274. R = &(mont->RR); /* grab RR as a temp */ crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mont.c:363:14: Call 361. goto err; /* Ri-- (mod word size) */ 362. } 363. if (!BN_div(Ri, NULL, Ri, &tmod, ctx)) ^ 364. goto err; 365. /* crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_mont.c:397:10: Call 395. if (!BN_set_bit(&(mont->RR), mont->ri * 2)) 396. goto err; 397. if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx)) ^ 398. goto err; 399. crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_div` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_41997
static int var_diamond_search(MpegEncContext * s, int *best, int dmin, int src_index, int ref_index, int const penalty_factor, int size, int h, int flags) { MotionEstContext * const c= &s->me; me_cmp_func cmpf, chroma_cmpf; int dia_size; LOAD_COMMON LOAD_COMMON2 int map_generation= c->map_generation; cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; for(dia_size=1; dia_size<=c->dia_size; dia_size++){ int dir, start, end; const int x= best[0]; const int y= best[1]; start= FFMAX(0, y + dia_size - ymax); end = FFMIN(dia_size, xmax - x + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x + dir , y + dia_size - dir); } start= FFMAX(0, x + dia_size - xmax); end = FFMIN(dia_size, y - ymin + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x + dia_size - dir, y - dir ); } start= FFMAX(0, -y + dia_size + ymin ); end = FFMIN(dia_size, x - xmin + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x - dir , y - dia_size + dir); } start= FFMAX(0, -x + dia_size + xmin ); end = FFMIN(dia_size, ymax - y + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x - dia_size + dir, y + dir ); } if(x!=best[0] || y!=best[1]) dia_size=0; #if 0 { int dx, dy, i; static int stats[8*8]; dx= FFABS(x-best[0]); dy= FFABS(y-best[1]); stats[dy*8 + dx] ++; if(256*256*256*64 % (stats[0]+1)==0){ for(i=0; i<64; i++){ if((i&7)==0) printf("\n"); printf("%6d ", stats[i]); } printf("\n"); } } #endif } return dmin; } libavcodec/motion_est_template.c:939: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:939:13: 937. 938. //check(x - dir,y - dia_size + dir,0, a2) 939. CHECK_MV(x - dir , y - dia_size + dir); ^ 940. } 941.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L939
d2a_code_trace_data_41998
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/dsa/dsa_ossl.c:380: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp2_mont`. Showing all 44 steps of the trace crypto/dsa/dsa_ossl.c:354:7: Call 352. /* Calculate W = inv(S) mod Q 353. * save W in u2 */ 354. if ((BN_mod_inverse(&u2,sig->s,dsa->q,ctx)) == NULL) goto err; ^ 355. 356. /* save M in u1 */ crypto/bn/bn_gcd.c:209:1: Parameter `ctx->stack.depth` 207. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); 208. 209. > BIGNUM *BN_mod_inverse(BIGNUM *in, 210. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 211. { crypto/bn/bn_gcd.c:224:2: Call 222. bn_check_top(n); 223. 224. BN_CTX_start(ctx); ^ 225. A = BN_CTX_get(ctx); 226. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:498:2: Call 496. err: 497. if ((ret == NULL) && (in == NULL)) BN_free(R); 498. BN_CTX_end(ctx); ^ 499. bn_check_top(ret); 500. return(ret); crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:365:7: Call 363. 364. /* u1 = M * w mod q */ 365. if (!BN_mod_mul(&u1,&u1,&u2,dsa->q,ctx)) goto err; ^ 366. 367. /* u2 = r * w mod q */ crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:198:2: Call 196. ret=1; 197. err: 198. BN_CTX_end(ctx); ^ 199. return(ret); 200. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:368:7: Call 366. 367. /* u2 = r * w mod q */ 368. if (!BN_mod_mul(&u2,sig->r,&u2,dsa->q,ctx)) goto err; ^ 369. 370. crypto/bn/bn_mod.c:178:1: Parameter `ctx->stack.depth` 176. 177. /* slow but works */ 178. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 179. BN_CTX *ctx) 180. { crypto/bn/bn_mod.c:188:2: Call 186. bn_check_top(m); 187. 188. BN_CTX_start(ctx); ^ 189. if ((t = BN_CTX_get(ctx)) == NULL) goto err; 190. if (a == b) crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:198:2: Call 196. ret=1; 197. err: 198. BN_CTX_end(ctx); ^ 199. return(ret); 200. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/dsa/dsa_ossl.c:380:2: Call 378. 379. 380. DSA_MOD_EXP(goto err, dsa, &t1, dsa->g, &u1, dsa->pub_key, &u2, dsa->p, ctx, mont); ^ 381. /* BN_copy(&u1,&t1); */ 382. /* let u1 = u1 mod q */ crypto/bn/bn_exp2.c:118:1: Parameter `ctx->stack.depth` 116. #define TABLE_SIZE 32 117. 118. > int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, 119. const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, 120. BN_CTX *ctx, BN_MONT_CTX *in_mont) crypto/bn/bn_exp2.c:151:2: Call 149. bits=(bits1 > bits2)?bits1:bits2; 150. 151. BN_CTX_start(ctx); ^ 152. d = BN_CTX_get(ctx); 153. r = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_exp2.c:163:8: Call 161. { 162. if ((mont=BN_MONT_CTX_new()) == NULL) goto err; 163. if (!BN_MONT_CTX_set(mont,m,ctx)) goto err; ^ 164. } 165. crypto/bn/bn_mont.c:355:1: Parameter `ctx->stack.depth` 353. } 354. 355. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 356. { 357. int ret = 0; crypto/bn/bn_mont.c:360:2: Call 358. BIGNUM *Ri,*R; 359. 360. BN_CTX_start(ctx); ^ 361. if((Ri = BN_CTX_get(ctx)) == NULL) goto err; 362. R= &(mont->RR); /* grab RR as a temp */ crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mont.c:421:8: Call 419. tmod.top = buf[0] != 0 ? 1 : 0; 420. /* Ri = R^-1 mod N*/ 421. if ((BN_mod_inverse(Ri,R,&tmod,ctx)) == NULL) ^ 422. goto err; 423. if (!BN_lshift(Ri,Ri,BN_BITS2)) goto err; /* R*Ri */ crypto/bn/bn_gcd.c:209:1: Parameter `ctx->stack.depth` 207. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); 208. 209. > BIGNUM *BN_mod_inverse(BIGNUM *in, 210. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 211. { crypto/bn/bn_gcd.c:218:10: Call 216. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) 217. { 218. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 219. } 220. crypto/bn/bn_gcd.c:507:1: Parameter `ctx->stack.depth` 505. * It does not contain branches that may leak sensitive information. 506. */ 507. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 508. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 509. { crypto/bn/bn_gcd.c:519:2: Call 517. bn_check_top(n); 518. 519. BN_CTX_start(ctx); ^ 520. A = BN_CTX_get(ctx); 521. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:548:8: Call 546. pB = &local_B; 547. BN_with_flags(pB, B, BN_FLG_CONSTTIME); 548. if (!BN_nnmod(B, pB, A, ctx)) goto err; ^ 549. } 550. sign = -1; crypto/bn/bn_mod.c:127:1: Parameter `ctx->stack.depth` 125. 126. 127. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 128. { 129. /* like BN_mod, but returns non-negative remainder crypto/bn/bn_mod.c:132:8: Call 130. * (i.e., 0 <= r < |d| always holds) */ 131. 132. if (!(BN_mod(r,m,d,ctx))) ^ 133. return 0; 134. if (!r->neg) crypto/bn/bn_div.c:181:1: Parameter `ctx->stack.depth` 179. * If 'dv' or 'rm' is NULL, the respective value is not returned. 180. */ 181. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 182. BN_CTX *ctx) 183. { crypto/bn/bn_div.c:226:2: Call 224. } 225. 226. BN_CTX_start(ctx); ^ 227. tmp=BN_CTX_get(ctx); 228. snum=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:441:2: Call 439. } 440. if (no_branch) bn_correct_top(res); 441. BN_CTX_end(ctx); ^ 442. return(1); 443. err: crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:277:21: Call 275. else 276. { 277. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 278. /* Does this stack frame have anything to release? */ 279. if(fp < ctx->used) crypto/bn/bn_ctx.c:351:1: <LHS trace> 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:351:1: Parameter `st->depth` 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp2_mont` 351. static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; ^ 354. } 355.
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/bn/bn_ctx.c/#L353
d2a_code_trace_data_41999
ssize_t ngx_parse_size(ngx_str_t *line) { u_char unit; size_t len; ssize_t size; ngx_int_t scale; len = line->len; unit = line->data[len - 1]; switch (unit) { case 'K': case 'k': len--; scale = 1024; break; case 'M': case 'm': len--; scale = 1024 * 1024; break; default: scale = 1; } size = ngx_atosz(line->data, len); if (size == NGX_ERROR) { return NGX_ERROR; } size *= scale; return size; } src/http/ngx_http_core_module.c:3338: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64 by call to `ngx_parse_size`. src/http/ngx_http_core_module.c:3335:13: Assignment 3333. 3334. if (ngx_strncmp(value[n].data, "rcvbuf=", 7) == 0) { 3335. size.len = value[n].len - 7; ^ 3336. size.data = value[n].data + 7; 3337. src/http/ngx_http_core_module.c:3338:31: Call 3336. size.data = value[n].data + 7; 3337. 3338. ls->conf.rcvbuf = ngx_parse_size(&size); ^ 3339. ls->conf.bind = 1; 3340. src/core/ngx_parse.c:11:1: <LHS trace> 9. 10. 11. ssize_t ^ 12. ngx_parse_size(ngx_str_t *line) 13. { src/core/ngx_parse.c:11:1: Parameter `line->len` 9. 10. 11. ssize_t ^ 12. ngx_parse_size(ngx_str_t *line) 13. { src/core/ngx_parse.c:19:5: Assignment 17. ngx_int_t scale; 18. 19. len = line->len; ^ 20. unit = line->data[len - 1]; 21. src/core/ngx_parse.c:20:12: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_parse_size` 18. 19. len = line->len; 20. unit = line->data[len - 1]; ^ 21. 22. switch (unit) {
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_parse.c/#L20
d2a_code_trace_data_42000
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } apps/crl.c:288: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print`. Showing all 11 steps of the trace apps/crl.c:256:9: Call 254. 255. X509_CRL_get0_signature(x, &sig, NULL); 256. corrupt_signature(sig); ^ 257. } 258. apps/apps.c:2587:1: Parameter `*signature->data` 2585. 2586. /* Corrupt a signature by modifying final byte */ 2587. > void corrupt_signature(const ASN1_STRING *signature) 2588. { 2589. unsigned char *s = signature->data; apps/crl.c:288:17: Call 286. if (lastupdate == i) { 287. BIO_printf(bio_out, "lastUpdate="); 288. ASN1_TIME_print(bio_out, X509_CRL_get0_lastUpdate(x)); ^ 289. BIO_printf(bio_out, "\n"); 290. } crypto/asn1/a_time.c:155:1: Parameter `*tm->data` 153. } 154. 155. > int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) 156. { 157. if (tm->type == V_ASN1_UTCTIME) crypto/asn1/a_time.c:160:16: Call 158. return ASN1_UTCTIME_print(bp, tm); 159. if (tm->type == V_ASN1_GENERALIZEDTIME) 160. return ASN1_GENERALIZEDTIME_print(bp, tm); ^ 161. BIO_write(bp, "Bad time value", 14); 162. return (0); crypto/asn1/a_gentm.c:224:1: <Offset trace> 222. }; 223. 224. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 225. { 226. char *v; crypto/asn1/a_gentm.c:224:1: Parameter `*tm->data` 222. }; 223. 224. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 225. { 226. char *v; crypto/asn1/a_gentm.c:245:5: Assignment 243. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 244. + (v[2] - '0') * 10 + (v[3] - '0'); 245. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 246. if ((M > 12) || (M < 1)) 247. goto err; crypto/asn1/a_gentm.c:219:1: <Length trace> 217. } 218. 219. > const char *_asn1_mon[12] = { 220. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 221. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:219:1: Array declaration 217. } 218. 219. > const char *_asn1_mon[12] = { 220. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 221. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:266:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_TIME_print` 264. 265. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 266. _asn1_mon[M - 1], d, h, m, s, f_len, f, y, ^ 267. (gmt) ? " GMT" : "") <= 0) 268. return (0);
https://github.com/openssl/openssl/blob/5a7ad1f08bfccbdad0f20920f9c284bba036fb70/crypto/asn1/a_gentm.c/#L266
d2a_code_trace_data_42001
static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, const int size, const int h, int ref_index, int src_index, me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ MotionEstContext * const c= &s->me; const int stride= c->stride; const int uvstride= c->uvstride; const int qpel= flags&FLAG_QPEL; const int chroma= flags&FLAG_CHROMA; const int dxy= subx + (suby<<(1+qpel)); const int hx= subx + (x<<(1+qpel)); const int hy= suby + (y<<(1+qpel)); uint8_t * const * const ref= c->ref[ref_index]; uint8_t * const * const src= c->src[src_index]; int d; if(flags&FLAG_DIRECT){ assert(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)); if(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)){ const int time_pp= s->pp_time; const int time_pb= s->pb_time; const int mask= 2*qpel+1; if(s->mv_type==MV_TYPE_8X8){ int i; for(i=0; i<4; i++){ int fx = c->direct_basis_mv[i][0] + hx; int fy = c->direct_basis_mv[i][1] + hy; int bx = hx ? fx - c->co_located_mv[i][0] : c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(qpel+4)); int by = hy ? fy - c->co_located_mv[i][1] : c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(qpel+4)); int fxy= (fx&mask) + ((fy&mask)<<(qpel+1)); int bxy= (bx&mask) + ((by&mask)<<(qpel+1)); uint8_t *dst= c->temp + 8*(i&1) + 8*stride*(i>>1); if(qpel){ c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride); c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride); }else{ c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8); c->hpel_avg[1][bxy](dst, ref[8] + (bx>>1) + (by>>1)*stride, stride, 8); } } }else{ int fx = c->direct_basis_mv[0][0] + hx; int fy = c->direct_basis_mv[0][1] + hy; int bx = hx ? fx - c->co_located_mv[0][0] : (c->co_located_mv[0][0]*(time_pb - time_pp)/time_pp); int by = hy ? fy - c->co_located_mv[0][1] : (c->co_located_mv[0][1]*(time_pb - time_pp)/time_pp); int fxy= (fx&mask) + ((fy&mask)<<(qpel+1)); int bxy= (bx&mask) + ((by&mask)<<(qpel+1)); if(qpel){ c->qpel_put[1][fxy](c->temp , ref[0] + (fx>>2) + (fy>>2)*stride , stride); c->qpel_put[1][fxy](c->temp + 8 , ref[0] + (fx>>2) + (fy>>2)*stride + 8 , stride); c->qpel_put[1][fxy](c->temp + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8*stride, stride); c->qpel_put[1][fxy](c->temp + 8 + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8 + 8*stride, stride); c->qpel_avg[1][bxy](c->temp , ref[8] + (bx>>2) + (by>>2)*stride , stride); c->qpel_avg[1][bxy](c->temp + 8 , ref[8] + (bx>>2) + (by>>2)*stride + 8 , stride); c->qpel_avg[1][bxy](c->temp + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8*stride, stride); c->qpel_avg[1][bxy](c->temp + 8 + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8 + 8*stride, stride); }else{ assert((fx>>1) + 16*s->mb_x >= -16); assert((fy>>1) + 16*s->mb_y >= -16); assert((fx>>1) + 16*s->mb_x <= s->width); assert((fy>>1) + 16*s->mb_y <= s->height); assert((bx>>1) + 16*s->mb_x >= -16); assert((by>>1) + 16*s->mb_y >= -16); assert((bx>>1) + 16*s->mb_x <= s->width); assert((by>>1) + 16*s->mb_y <= s->height); c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16); c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16); } } d = cmp_func(s, c->temp, src[0], stride, 16); }else d= 256*256*256*32; }else{ int uvdxy; if(dxy){ if(qpel){ c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); if(chroma){ int cx= hx/2; int cy= hy/2; cx= (cx>>1)|(cx&1); cy= (cy>>1)|(cy&1); uvdxy= (cx&1) + 2*(cy&1); } }else{ c->hpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride, h); if(chroma) uvdxy= dxy | (x&1) | (2*(y&1)); } d = cmp_func(s, c->temp, src[0], stride, h); }else{ d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h); if(chroma) uvdxy= (x&1) + 2*(y&1); } if(chroma){ uint8_t * const uvtemp= c->temp + 16*stride; c->hpel_put[size+1][uvdxy](uvtemp , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1); c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1); d += chroma_cmp_func(s, uvtemp , src[1], uvstride, h>>1); d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1); } } #if 0 if(full_pel){ const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1); score_map[index]= d; } d += (c->mv_penalty[hx - c->pred_x] + c->mv_penalty[hy - c->pred_y])*c->penalty_factor; #endif return d; } libavcodec/motion_est.c:1826: error: Buffer Overrun L1 Offset: 8 Size: 4 by call to `ff_get_mb_score`. libavcodec/motion_est.c:1826:15: Call 1824. 1825. if(c->avctx->me_sub_cmp != c->avctx->mb_cmp && !c->skip) 1826. dmin= ff_get_mb_score(s, mx, my, 0, 0, 0, 16, 1); ^ 1827. 1828. get_limits(s, 16*mb_x, 16*mb_y); //restore c->?min/max, maybe not needed libavcodec/motion_est_template.c:235:1: Parameter `ref_index` 233. } 234. 235. inline int ff_get_mb_score(MpegEncContext * s, int mx, int my, int src_index, ^ 236. int ref_index, int size, int h, int add_rate) 237. { libavcodec/motion_est_template.c:257:8: Call 255. // assert(c->avctx->me_sub_cmp != c->avctx->mb_cmp); 256. 257. d= cmp(s, mx>>(qpel+1), my>>(qpel+1), mx&mask, my&mask, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags); ^ 258. //FIXME check cbp before adding penalty for (0,0) vector 259. if(add_rate && (mx || my || size>0)) libavcodec/motion_est.c:108:1: <Length trace> 106. against a proposed motion-compensated prediction of that block 107. */ 108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 109. const int size, const int h, int ref_index, int src_index, 110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ libavcodec/motion_est.c:108:1: Parameter `ref_index` 106. against a proposed motion-compensated prediction of that block 107. */ 108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby, ^ 109. const int size, const int h, int ref_index, int src_index, 110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){ libavcodec/motion_est.c:119:5: Assignment 117. const int hx= subx + (x<<(1+qpel)); 118. const int hy= suby + (y<<(1+qpel)); 119. uint8_t * const * const ref= c->ref[ref_index]; ^ 120. uint8_t * const * const src= c->src[src_index]; 121. int d; libavcodec/motion_est.c:176:50: Array access: Offset: 8 Size: 4 by call to `ff_get_mb_score` 174. 175. c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16); 176. c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16); ^ 177. } 178. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L176
d2a_code_trace_data_42002
static int select_server_ctx(SSL *s, void *arg, int ignore) { const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); HANDSHAKE_EX_DATA *ex_data = (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); if (servername == NULL) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_NOACK; } if (strcmp(servername, "server2") == 0) { SSL_CTX *new_ctx = (SSL_CTX*)arg; SSL_set_SSL_CTX(s, new_ctx); SSL_clear_options(s, 0xFFFFFFFFL); SSL_set_options(s, SSL_CTX_get_options(new_ctx)); ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; return SSL_TLSEXT_ERR_OK; } else if (strcmp(servername, "server1") == 0) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_OK; } else if (ignore) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_NOACK; } else { return SSL_TLSEXT_ERR_ALERT_FATAL; } } test/handshake_helper.c:113: error: NULL_DEREFERENCE pointer `ex_data` last assigned on line 109 could be null and is dereferenced at line 113, column 9. Showing all 19 steps of the trace test/handshake_helper.c:106:1: start of procedure select_server_ctx() 104. * An empty SNI extension also returns SSL_TSLEXT_ERR_NOACK. 105. */ 106. > static int select_server_ctx(SSL *s, void *arg, int ignore) 107. { 108. const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); test/handshake_helper.c:108:5: 106. static int select_server_ctx(SSL *s, void *arg, int ignore) 107. { 108. > const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); 109. HANDSHAKE_EX_DATA *ex_data = 110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); ssl/ssl_lib.c:2597:1: start of procedure SSL_get_servername() 2595. */ 2596. 2597. > const char *SSL_get_servername(const SSL *s, const int type) 2598. { 2599. if (type != TLSEXT_NAMETYPE_host_name) ssl/ssl_lib.c:2599:9: Taking false branch 2597. const char *SSL_get_servername(const SSL *s, const int type) 2598. { 2599. if (type != TLSEXT_NAMETYPE_host_name) ^ 2600. return NULL; 2601. ssl/ssl_lib.c:2602:12: Condition is true 2600. return NULL; 2601. 2602. return s->session && !s->ext.hostname ? ^ 2603. s->session->ext.hostname : s->ext.hostname; 2604. } ssl/ssl_lib.c:2602:27: Condition is true 2600. return NULL; 2601. 2602. return s->session && !s->ext.hostname ? ^ 2603. s->session->ext.hostname : s->ext.hostname; 2604. } ssl/ssl_lib.c:2602:12: 2600. return NULL; 2601. 2602. > return s->session && !s->ext.hostname ? 2603. s->session->ext.hostname : s->ext.hostname; 2604. } ssl/ssl_lib.c:2602:5: 2600. return NULL; 2601. 2602. > return s->session && !s->ext.hostname ? 2603. s->session->ext.hostname : s->ext.hostname; 2604. } ssl/ssl_lib.c:2604:1: return from a call to SSL_get_servername 2602. return s->session && !s->ext.hostname ? 2603. s->session->ext.hostname : s->ext.hostname; 2604. > } 2605. 2606. int SSL_get_servername_type(const SSL *s) test/handshake_helper.c:109:5: 107. { 108. const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); 109. > HANDSHAKE_EX_DATA *ex_data = 110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 111. ssl/ssl_lib.c:4014:1: start of procedure SSL_get_ex_data() 4012. } 4013. 4014. > void *SSL_get_ex_data(const SSL *s, int idx) 4015. { 4016. return CRYPTO_get_ex_data(&s->ex_data, idx); ssl/ssl_lib.c:4016:5: 4014. void *SSL_get_ex_data(const SSL *s, int idx) 4015. { 4016. > return CRYPTO_get_ex_data(&s->ex_data, idx); 4017. } 4018. crypto/ex_data.c:393:1: start of procedure CRYPTO_get_ex_data() 391. * particular index in the class used by this variable 392. */ 393. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:395:9: Taking true branch 393. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 396. return NULL; 397. return sk_void_value(ad->sk, idx); crypto/ex_data.c:396:9: 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 396. > return NULL; 397. return sk_void_value(ad->sk, idx); 398. } crypto/ex_data.c:398:1: return from a call to CRYPTO_get_ex_data 396. return NULL; 397. return sk_void_value(ad->sk, idx); 398. > } ssl/ssl_lib.c:4017:1: return from a call to SSL_get_ex_data 4015. { 4016. return CRYPTO_get_ex_data(&s->ex_data, idx); 4017. > } 4018. 4019. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) test/handshake_helper.c:112:9: Taking true branch 110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 111. 112. if (servername == NULL) { ^ 113. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 114. return SSL_TLSEXT_ERR_NOACK; test/handshake_helper.c:113:9: 111. 112. if (servername == NULL) { 113. > ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 114. return SSL_TLSEXT_ERR_NOACK; 115. }
https://github.com/openssl/openssl/blob/e43e6b1951de931ca500c6964496e76651332f5e/test/handshake_helper.c/#L113
d2a_code_trace_data_42003
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } r->neg = a->neg; nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } test/bntest.c:278: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div`. Showing all 14 steps of the trace test/bntest.c:278:9: Call 276. a->neg = rand_neg(); 277. b->neg = rand_neg(); 278. BN_mod(c, a, b, ctx); ^ 279. BN_div(d, e, a, b, ctx); 280. BN_sub(e, e, c); 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/bntest.c:278:9: Call 276. a->neg = rand_neg(); 277. b->neg = rand_neg(); 278. BN_mod(c, a, b, ctx); ^ 279. BN_div(d, e, a, b, ctx); 280. BN_sub(e, e, c); crypto/bn/bn_div.c:140:1: Parameter `num->top` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/bn/bn_div.c:210:11: Call 208. sdiv->neg = 0; 209. norm_shift += BN_BITS2; 210. if (!(BN_lshift(snum, num, norm_shift))) ^ 211. goto err; 212. snum->neg = 0; crypto/bn/bn_shift.c:81:1: <Offset trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `n` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:96:5: Assignment 94. 95. r->neg = a->neg; 96. nw = n / BN_BITS2; ^ 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) 98. return (0); crypto/bn/bn_shift.c:81:1: <Length trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `*r->d` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:9: Call 95. r->neg = a->neg; 96. nw = n / BN_BITS2; 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 98. return (0); 99. lb = n % BN_BITS2; crypto/bn/bn_lib.c:1016:1: Parameter `*a->d` 1014. } 1015. 1016. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 1017. { 1018. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_shift.c:102:5: Assignment 100. rb = BN_BITS2 - lb; 101. f = a->d; 102. t = r->d; ^ 103. t[a->top + nw] = 0; 104. if (lb == 0) crypto/bn/bn_shift.c:110:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div` 108. for (i = a->top - 1; i >= 0; i--) { 109. l = f[i]; 110. t[nw + i + 1] |= (l >> rb) & BN_MASK2; ^ 111. t[nw + i] = (l << lb) & BN_MASK2; 112. }
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_shift.c/#L110
d2a_code_trace_data_42004
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_ossl.c:306: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `rsa_blinding_convert`. Showing all 27 steps of the trace crypto/rsa/rsa_ossl.c:255:5: Call 253. if ((ctx = BN_CTX_new()) == NULL) 254. goto err; 255. BN_CTX_start(ctx); ^ 256. f = BN_CTX_get(ctx); 257. ret = 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_ossl.c:306:14: Call 304. goto err; 305. } 306. if (!rsa_blinding_convert(blinding, f, unblind, ctx)) ^ 307. goto err; 308. } crypto/rsa/rsa_ossl.c:200:1: Parameter `ctx->stack.depth` 198. } 199. 200. > static int rsa_blinding_convert(BN_BLINDING *b, BIGNUM *f, BIGNUM *unblind, 201. BN_CTX *ctx) 202. { crypto/rsa/rsa_ossl.c:207:16: Call 205. * Local blinding: store the unblinding factor in BN_BLINDING. 206. */ 207. return BN_BLINDING_convert_ex(f, NULL, b, ctx); ^ 208. } else { 209. /* crypto/bn/bn_blind.c:130:1: Parameter `ctx->stack.depth` 128. } 129. 130. > int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx) 131. { 132. int ret = 1; crypto/bn/bn_blind.c:144:15: Call 142. /* Fresh blinding, doesn't need updating. */ 143. b->counter = 0; 144. else if (!BN_BLINDING_update(b, ctx)) ^ 145. return (0); 146. crypto/bn/bn_blind.c:94:1: Parameter `ctx->stack.depth` 92. } 93. 94. > int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx) 95. { 96. int ret = 0; crypto/bn/bn_blind.c:112:14: Call 110. goto err; 111. } else if (!(b->flags & BN_BLINDING_NO_UPDATE)) { 112. if (!BN_mod_mul(b->A, b->A, b->A, b->mod, ctx)) ^ 113. goto err; 114. if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx)) crypto/bn/bn_mod.c:73:1: Parameter `ctx->stack.depth` 71. 72. /* slow but works */ 73. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 74. BN_CTX *ctx) 75. { crypto/bn/bn_mod.c:83:5: Call 81. bn_check_top(m); 82. 83. BN_CTX_start(ctx); ^ 84. if ((t = BN_CTX_get(ctx)) == NULL) 85. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:87:14: Call 85. goto err; 86. if (a == b) { 87. if (!BN_sqr(t, a, ctx)) ^ 88. goto err; 89. } else { crypto/bn/bn_sqr.c:17:1: Parameter `ctx->stack.depth` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_mod.c:93:10: Call 91. goto err; 92. } 93. if (!BN_nnmod(r, t, m, ctx)) ^ 94. goto err; 95. bn_check_top(r); 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. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 195. 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:413:5: Call 411. if (no_branch) 412. bn_correct_top(res); 413. BN_CTX_end(ctx); ^ 414. return (1); 415. 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 `rsa_blinding_convert` 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_42005
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.c:354: 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.c:215:1: Parameter `s->initial_ctx->sessions->num_items` 213. * <=0: NBIO or error 214. */ 215. > static int state_machine(SSL *s, int server) 216. { 217. BUF_MEM *buf = NULL; ssl/statem/statem.c:354:17: Call 352. SSLerr(SSL_F_STATE_MACHINE, 353. SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); 354. ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); ^ 355. ossl_statem_set_error(s); 356. goto end; 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_42006
static void update(Real288_internal *glob) { int x,y; float buffer1[40],temp1[37]; float buffer2[8],temp2[11]; for (x=0,y=glob->phasep+5;x<40;buffer1[x++]=glob->output[(y++)%40]); co(36,40,35,buffer1,temp1,glob->st1a,glob->st1b,table1); if (pred(temp1,glob->st1,36)) colmult(glob->pr1,glob->st1,table1a,36); for (x=0,y=glob->phase+1;x<8;buffer2[x++]=glob->history[(y++)%8]); co(10,8,20,buffer2,temp2,glob->st2a,glob->st2b,table2); if (pred(temp2,glob->st2,10)) colmult(glob->pr2,glob->st2,table2a,10); } libavcodec/ra288.c:84: error: Buffer Overrun L3 Offset: [-7, 7] Size: 8. libavcodec/ra288.c:73:1: <Offset trace> 71. } 72. 73. static void update(Real288_internal *glob) ^ 74. { 75. int x,y; libavcodec/ra288.c:73:1: Parameter `glob->phase` 71. } 72. 73. static void update(Real288_internal *glob) ^ 74. { 75. int x,y; libavcodec/ra288.c:84:12: Assignment 82. colmult(glob->pr1,glob->st1,table1a,36); 83. 84. for (x=0,y=glob->phase+1;x<8;buffer2[x++]=glob->history[(y++)%8]); ^ 85. co(10,8,20,buffer2,temp2,glob->st2a,glob->st2b,table2); 86. if (pred(temp2,glob->st2,10)) libavcodec/ra288.c:73:1: <Length trace> 71. } 72. 73. static void update(Real288_internal *glob) ^ 74. { 75. int x,y; libavcodec/ra288.c:73:1: Parameter `glob->history[*]` 71. } 72. 73. static void update(Real288_internal *glob) ^ 74. { 75. int x,y; libavcodec/ra288.c:84:45: Array access: Offset: [-7, 7] Size: 8 82. colmult(glob->pr1,glob->st1,table1a,36); 83. 84. for (x=0,y=glob->phase+1;x<8;buffer2[x++]=glob->history[(y++)%8]); ^ 85. co(10,8,20,buffer2,temp2,glob->st2a,glob->st2b,table2); 86. if (pred(temp2,glob->st2,10))
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra288.c/#L84
d2a_code_trace_data_42007
static ossl_inline unsigned int constant_time_is_zero(unsigned int a) { return constant_time_msb(~a & (a - 1)); } crypto/rsa/rsa_oaep.c:188: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero`. Showing all 6 steps of the trace crypto/rsa/rsa_oaep.c:116:1: Parameter `*from` 114. } 115. 116. > int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, 117. const unsigned char *from, int flen, 118. int num, const unsigned char *param, crypto/rsa/rsa_oaep.c:180:9: Assignment 178. flen -= 1 & mask; 179. from -= 1 & mask; 180. *--em = *from & mask; ^ 181. } 182. crypto/rsa/rsa_oaep.c:188:12: Call 186. * Optimal Asymmetric Encryption Padding (OAEP) [...]", CRYPTO 2001). 187. */ 188. good = constant_time_is_zero(em[0]); ^ 189. 190. maskedseed = em + 1; include/internal/constant_time_locl.h:164:1: <LHS trace> 162. } 163. 164. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a) 165. { 166. return constant_time_msb(~a & (a - 1)); include/internal/constant_time_locl.h:164:1: Parameter `a` 162. } 163. 164. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a) 165. { 166. return constant_time_msb(~a & (a - 1)); include/internal/constant_time_locl.h:166:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero` 164. static ossl_inline unsigned int constant_time_is_zero(unsigned int a) 165. { 166. return constant_time_msb(~a & (a - 1)); ^ 167. } 168.
https://github.com/openssl/openssl/blob/4c2883a9bf59c5ee31e8e2e101b3894a16c06950/include/internal/constant_time_locl.h/#L166
d2a_code_trace_data_42008
int RAND_status(void) { const RAND_METHOD *meth = RAND_get_rand_method(); if (meth->status != NULL) return meth->status(); return 0; } crypto/rand/rand_lib.c:919: error: NULL_DEREFERENCE pointer `meth` last assigned on line 917 could be null and is dereferenced at line 919, column 9. Showing all 6 steps of the trace crypto/rand/rand_lib.c:915:1: start of procedure RAND_status() 913. #endif 914. 915. > int RAND_status(void) 916. { 917. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:917:5: 915. int RAND_status(void) 916. { 917. > const RAND_METHOD *meth = RAND_get_rand_method(); 918. 919. if (meth->status != NULL) crypto/rand/rand_lib.c:775:1: start of procedure RAND_get_rand_method() 773. #endif 774. 775. > const RAND_METHOD *RAND_get_rand_method(void) 776. { 777. #ifdef FIPS_MODE crypto/rand/rand_lib.c:778:5: 776. { 777. #ifdef FIPS_MODE 778. > return NULL; 779. #else 780. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:807:1: return from a call to RAND_get_rand_method 805. return tmp_meth; 806. #endif 807. > } 808. 809. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE) crypto/rand/rand_lib.c:919:9: 917. const RAND_METHOD *meth = RAND_get_rand_method(); 918. 919. > if (meth->status != NULL) 920. return meth->status(); 921. return 0;
https://github.com/openssl/openssl/blob/fa3eb248e29ca8031e6a14e8a2c6f3cd58b5450e/crypto/rand/rand_lib.c/#L919
d2a_code_trace_data_42009
static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], int dir[6], uint8_t *st[6], int zigzag_last_index[6]) { int i, n; memcpy(s->block_last_index, zigzag_last_index, sizeof(int)*6); for(n=0; n<6; n++){ int16_t *ac_val = s->ac_val[0][0] + s->block_index[n] * 16; st[n]= s->intra_scantable.permutated; if(dir[n]){ for(i=1; i<8; i++){ block[n][s->dsp.idct_permutation[i ]] = ac_val[i+8]; } }else{ for(i=1; i<8; i++){ block[n][s->dsp.idct_permutation[i<<3]]= ac_val[i ]; } } } } libavcodec/h263.c:487: error: Buffer Overrun L3 Offset added: 24 Size: [0, +oo]. libavcodec/h263.c:484:1: <Length trace> 482. } 483. 484. static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], int dir[6], uint8_t *st[6], int zigzag_last_index[6]) ^ 485. { 486. int i, n; libavcodec/h263.c:484:1: Parameter `s->block_last_index[*]` 482. } 483. 484. static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], int dir[6], uint8_t *st[6], int zigzag_last_index[6]) ^ 485. { 486. int i, n; libavcodec/h263.c:487:5: Array access: Offset added: 24 Size: [0, +oo] 485. { 486. int i, n; 487. memcpy(s->block_last_index, zigzag_last_index, sizeof(int)*6); ^ 488. 489. for(n=0; n<6; n++){
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h263.c/#L487
d2a_code_trace_data_42010
static int config_input_main(AVFilterLink *inlink) { OverlayContext *s = inlink->dst->priv; const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); av_image_fill_max_pixsteps(s->max_plane_step, NULL, pix_desc); s->hsub = pix_desc->log2_chroma_w; s->vsub = pix_desc->log2_chroma_h; return 0; } libavfilter/vf_overlay.c:120: error: Null Dereference pointer `pix_desc` last assigned on line 117 could be null and is dereferenced at line 120, column 15. libavfilter/vf_overlay.c:114:1: start of procedure config_input_main() 112. } 113. 114. static int config_input_main(AVFilterLink *inlink) ^ 115. { 116. OverlayContext *s = inlink->dst->priv; libavfilter/vf_overlay.c:116:5: 114. static int config_input_main(AVFilterLink *inlink) 115. { 116. OverlayContext *s = inlink->dst->priv; ^ 117. const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); 118. libavfilter/vf_overlay.c:117:5: 115. { 116. OverlayContext *s = inlink->dst->priv; 117. const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); ^ 118. 119. av_image_fill_max_pixsteps(s->max_plane_step, NULL, pix_desc); libavutil/pixdesc.c:1507:1: start of procedure av_pix_fmt_desc_get() 1505. } 1506. 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1509:9: Taking false branch 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1509:24: Taking true branch 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1510:9: 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1510. return NULL; ^ 1511. return &av_pix_fmt_descriptors[pix_fmt]; 1512. } libavutil/pixdesc.c:1512:1: return from a call to av_pix_fmt_desc_get 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; 1512. } ^ 1513. 1514. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) libavfilter/vf_overlay.c:119:5: Skipping av_image_fill_max_pixsteps(): empty list of specs 117. const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); 118. 119. av_image_fill_max_pixsteps(s->max_plane_step, NULL, pix_desc); ^ 120. s->hsub = pix_desc->log2_chroma_w; 121. s->vsub = pix_desc->log2_chroma_h; libavfilter/vf_overlay.c:120:5: 118. 119. av_image_fill_max_pixsteps(s->max_plane_step, NULL, pix_desc); 120. s->hsub = pix_desc->log2_chroma_w; ^ 121. s->vsub = pix_desc->log2_chroma_h; 122.
https://github.com/libav/libav/blob/de203abd71baae7f120313259b45cf935c85203e/libavfilter/vf_overlay.c/#L120
d2a_code_trace_data_42011
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:1266: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/sslapitest.c:1236:10: Call 1234. } 1235. 1236. if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, ^ 1237. &clientssl, NULL, NULL))) 1238. goto end; test/ssltestlib.c:559:15: Call 557. if (*sssl != NULL) 558. serverssl = *sssl; 559. else if (!TEST_ptr(serverssl = SSL_new(serverctx))) ^ 560. goto error; 561. if (*cssl != NULL) 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/sslapitest.c:1266:5: Call 1264. 1265. end: 1266. SSL_free(serverssl); ^ 1267. SSL_free(clientssl); 1268. SSL_CTX_free(sctx); 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_42012
static void opt_output_file(const char *filename) { AVFormatContext *oc; int err, use_video, use_audio, use_subtitle; int input_has_video, input_has_audio, input_has_subtitle; AVFormatParameters params, *ap = &params; AVOutputFormat *file_oformat; AVMetadataTag *tag = NULL; if (!strcmp(filename, "-")) filename = "pipe:"; oc = avformat_alloc_context(); if (!oc) { print_error(filename, AVERROR(ENOMEM)); ffmpeg_exit(1); } if (last_asked_format) { file_oformat = av_guess_format(last_asked_format, NULL, NULL); if (!file_oformat) { fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format); ffmpeg_exit(1); } last_asked_format = NULL; } else { file_oformat = av_guess_format(NULL, filename, NULL); if (!file_oformat) { fprintf(stderr, "Unable to find a suitable output format for '%s'\n", filename); ffmpeg_exit(1); } } oc->oformat = file_oformat; av_strlcpy(oc->filename, filename, sizeof(oc->filename)); if (!strcmp(file_oformat->name, "ffm") && av_strstart(filename, "http:", NULL)) { int err = read_ffserver_streams(oc, filename); if (err < 0) { print_error(filename, err); ffmpeg_exit(1); } } else { use_video = file_oformat->video_codec != CODEC_ID_NONE || video_stream_copy || video_codec_name; use_audio = file_oformat->audio_codec != CODEC_ID_NONE || audio_stream_copy || audio_codec_name; use_subtitle = file_oformat->subtitle_codec != CODEC_ID_NONE || subtitle_stream_copy || subtitle_codec_name; if (nb_input_files > 0) { check_audio_video_sub_inputs(&input_has_video, &input_has_audio, &input_has_subtitle); if (!input_has_video) use_video = 0; if (!input_has_audio) use_audio = 0; if (!input_has_subtitle) use_subtitle = 0; } if (audio_disable) use_audio = 0; if (video_disable) use_video = 0; if (subtitle_disable) use_subtitle = 0; if (use_video) new_video_stream(oc, nb_output_files); if (use_audio) new_audio_stream(oc, nb_output_files); if (use_subtitle) new_subtitle_stream(oc, nb_output_files); oc->timestamp = recording_timestamp; while ((tag = av_metadata_get(metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) av_metadata_set2(&oc->metadata, tag->key, tag->value, 0); av_metadata_free(&metadata); } output_files[nb_output_files++] = oc; if (oc->oformat->flags & AVFMT_NEEDNUMBER) { if (!av_filename_number_test(oc->filename)) { print_error(oc->filename, AVERROR_NUMEXPECTED); ffmpeg_exit(1); } } if (!(oc->oformat->flags & AVFMT_NOFILE)) { if (!file_overwrite && (strchr(filename, ':') == NULL || filename[1] == ':' || av_strstart(filename, "file:", NULL))) { if (url_exist(filename)) { if (!using_stdin) { fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename); fflush(stderr); if (!read_yesno()) { fprintf(stderr, "Not overwriting - exiting\n"); ffmpeg_exit(1); } } else { fprintf(stderr,"File '%s' already exists. Exiting.\n", filename); ffmpeg_exit(1); } } } if ((err = url_fopen(&oc->pb, filename, URL_WRONLY)) < 0) { print_error(filename, err); ffmpeg_exit(1); } } memset(ap, 0, sizeof(*ap)); if (av_set_parameters(oc, ap) < 0) { fprintf(stderr, "%s: Invalid encoding parameters\n", oc->filename); ffmpeg_exit(1); } oc->preload= (int)(mux_preload*AV_TIME_BASE); oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE); oc->loop_output = loop_output; oc->flags |= AVFMT_FLAG_NONBLOCK; set_context_opts(oc, avformat_opts, AV_OPT_FLAG_ENCODING_PARAM, NULL); nb_streamid_map = 0; av_freep(&forced_key_frames); } ffmpeg.c:3697: error: Null Dereference pointer `oc` last assigned on line 3675 could be null and is dereferenced at line 3697, column 5. ffmpeg.c:3663:1: start of procedure opt_output_file() 3661. } 3662. 3663. static void opt_output_file(const char *filename) ^ 3664. { 3665. AVFormatContext *oc; ffmpeg.c:3668:5: 3666. int err, use_video, use_audio, use_subtitle; 3667. int input_has_video, input_has_audio, input_has_subtitle; 3668. AVFormatParameters params, *ap = &params; ^ 3669. AVOutputFormat *file_oformat; 3670. AVMetadataTag *tag = NULL; ffmpeg.c:3670:5: 3668. AVFormatParameters params, *ap = &params; 3669. AVOutputFormat *file_oformat; 3670. AVMetadataTag *tag = NULL; ^ 3671. 3672. if (!strcmp(filename, "-")) ffmpeg.c:3672:10: Taking false branch 3670. AVMetadataTag *tag = NULL; 3671. 3672. if (!strcmp(filename, "-")) ^ 3673. filename = "pipe:"; 3674. ffmpeg.c:3675:5: 3673. filename = "pipe:"; 3674. 3675. oc = avformat_alloc_context(); ^ 3676. if (!oc) { 3677. print_error(filename, AVERROR(ENOMEM)); libavformat/options.c:82:1: start of procedure avformat_alloc_context() 80. } 81. 82. AVFormatContext *avformat_alloc_context(void) ^ 83. { 84. AVFormatContext *ic; libavformat/options.c:85:5: 83. { 84. AVFormatContext *ic; 85. ic = av_malloc(sizeof(AVFormatContext)); ^ 86. if (!ic) return ic; 87. avformat_get_context_defaults(ic); libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(FF_INTERNAL_MEM_TYPE size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(FF_INTERNAL_MEM_TYPE size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking false branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,16,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:116:5: 114. ptr = malloc(size); 115. #endif 116. return ptr; ^ 117. } 118. libavutil/mem.c:117:1: return from a call to av_malloc 115. #endif 116. return ptr; 117. } ^ 118. 119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) libavformat/options.c:86:10: Taking true branch 84. AVFormatContext *ic; 85. ic = av_malloc(sizeof(AVFormatContext)); 86. if (!ic) return ic; ^ 87. avformat_get_context_defaults(ic); 88. ic->av_class = &av_format_context_class; libavformat/options.c:86:14: 84. AVFormatContext *ic; 85. ic = av_malloc(sizeof(AVFormatContext)); 86. if (!ic) return ic; ^ 87. avformat_get_context_defaults(ic); 88. ic->av_class = &av_format_context_class; libavformat/options.c:90:1: return from a call to avformat_alloc_context 88. ic->av_class = &av_format_context_class; 89. return ic; 90. } ^ 91. 92. #if FF_API_ALLOC_FORMAT_CONTEXT ffmpeg.c:3676:10: Taking true branch 3674. 3675. oc = avformat_alloc_context(); 3676. if (!oc) { ^ 3677. print_error(filename, AVERROR(ENOMEM)); 3678. ffmpeg_exit(1); ffmpeg.c:3677:9: 3675. oc = avformat_alloc_context(); 3676. if (!oc) { 3677. print_error(filename, AVERROR(ENOMEM)); ^ 3678. ffmpeg_exit(1); 3679. } cmdutils.c:342:1: start of procedure print_error() 340. } 341. 342. void print_error(const char *filename, int err) ^ 343. { 344. char errbuf[128]; cmdutils.c:345:5: 343. { 344. char errbuf[128]; 345. const char *errbuf_ptr = errbuf; ^ 346. 347. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) cmdutils.c:347:9: 345. const char *errbuf_ptr = errbuf; 346. 347. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) ^ 348. errbuf_ptr = strerror(AVUNERROR(err)); 349. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); libavutil/error.c:22:1: start of procedure av_strerror() 20. #include "avstring.h" 21. 22. int av_strerror(int errnum, char *errbuf, size_t errbuf_size) ^ 23. { 24. int ret = 0; libavutil/error.c:24:5: 22. int av_strerror(int errnum, char *errbuf, size_t errbuf_size) 23. { 24. int ret = 0; ^ 25. const char *errstr = NULL; 26. libavutil/error.c:25:5: 23. { 24. int ret = 0; 25. const char *errstr = NULL; ^ 26. 27. switch (errnum) { libavutil/error.c:27:5: 25. const char *errstr = NULL; 26. 27. switch (errnum) { ^ 28. case AVERROR_EOF: errstr = "End of file"; break; 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; libavutil/error.c:28:5: Switch condition is false. Skipping switch case 26. 27. switch (errnum) { 28. case AVERROR_EOF: errstr = "End of file"; break; ^ 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; 30. case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; libavutil/error.c:29:5: Switch condition is false. Skipping switch case 27. switch (errnum) { 28. case AVERROR_EOF: errstr = "End of file"; break; 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; ^ 30. case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; 31. case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break; libavutil/error.c:30:5: Switch condition is false. Skipping switch case 28. case AVERROR_EOF: errstr = "End of file"; break; 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; 30. case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; ^ 31. case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break; 32. } libavutil/error.c:31:5: Switch condition is false. Skipping switch case 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; 30. case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; 31. case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break; ^ 32. } 33. libavutil/error.c:34:9: Taking false branch 32. } 33. 34. if (errstr) { ^ 35. av_strlcpy(errbuf, errstr, errbuf_size); 36. } else { libavutil/error.c:38:9: 36. } else { 37. #if HAVE_STRERROR_R 38. ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size); ^ 39. #else 40. ret = -1; libavutil/error.c:42:13: Taking false branch 40. ret = -1; 41. #endif 42. if (ret < 0) ^ 43. snprintf(errbuf, errbuf_size, "Error number %d occurred", errnum); 44. } libavutil/error.c:46:5: 44. } 45. 46. return ret; ^ 47. } libavutil/error.c:47:1: return from a call to av_strerror 45. 46. return ret; 47. } ^ cmdutils.c:347:9: Taking false branch 345. const char *errbuf_ptr = errbuf; 346. 347. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) ^ 348. errbuf_ptr = strerror(AVUNERROR(err)); 349. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); cmdutils.c:349:5: 347. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) 348. errbuf_ptr = strerror(AVUNERROR(err)); 349. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); ^ 350. } 351. cmdutils.c:350:1: return from a call to print_error 348. errbuf_ptr = strerror(AVUNERROR(err)); 349. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); 350. } ^ 351. 352. static int warned_cfg = 0; ffmpeg.c:3678:9: Skipping ffmpeg_exit(): empty list of specs 3676. if (!oc) { 3677. print_error(filename, AVERROR(ENOMEM)); 3678. ffmpeg_exit(1); ^ 3679. } 3680. ffmpeg.c:3681:9: Taking true branch 3679. } 3680. 3681. if (last_asked_format) { ^ 3682. file_oformat = av_guess_format(last_asked_format, NULL, NULL); 3683. if (!file_oformat) { ffmpeg.c:3682:9: Skipping av_guess_format(): empty list of specs 3680. 3681. if (last_asked_format) { 3682. file_oformat = av_guess_format(last_asked_format, NULL, NULL); ^ 3683. if (!file_oformat) { 3684. fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format); ffmpeg.c:3683:14: Taking false branch 3681. if (last_asked_format) { 3682. file_oformat = av_guess_format(last_asked_format, NULL, NULL); 3683. if (!file_oformat) { ^ 3684. fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format); 3685. ffmpeg_exit(1); ffmpeg.c:3687:9: 3685. ffmpeg_exit(1); 3686. } 3687. last_asked_format = NULL; ^ 3688. } else { 3689. file_oformat = av_guess_format(NULL, filename, NULL); ffmpeg.c:3697:5: 3695. } 3696. 3697. oc->oformat = file_oformat; ^ 3698. av_strlcpy(oc->filename, filename, sizeof(oc->filename)); 3699.
https://github.com/libav/libav/blob/129983408d0d064db656742a3d3d4c038420f48c/ffmpeg.c/#L3697
d2a_code_trace_data_42013
PUT_HEVC_QPEL_HV(1, 1) libavcodec/hevcdsp_template.c:983: error: Buffer Overrun L3 Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h1v1_10`. libavcodec/hevcdsp_template.c:983:1: Call 981. QPEL(12) 982. QPEL(8) 983. QPEL(4) ^ 984. 985. static inline void FUNC(put_hevc_epel_pixels)(int16_t *dst, ptrdiff_t dststride, libavcodec/hevcdsp_template.c:901:1: <Offset trace> 899. PUT_HEVC_QPEL_V(2) 900. PUT_HEVC_QPEL_V(3) 901. PUT_HEVC_QPEL_HV(1, 1) ^ 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) libavcodec/hevcdsp_template.c:901:1: Assignment 899. PUT_HEVC_QPEL_V(2) 900. PUT_HEVC_QPEL_V(3) 901. PUT_HEVC_QPEL_HV(1, 1) ^ 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) libavcodec/hevcdsp_template.c:901:1: <Length trace> 899. PUT_HEVC_QPEL_V(2) 900. PUT_HEVC_QPEL_V(3) 901. PUT_HEVC_QPEL_HV(1, 1) ^ 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) libavcodec/hevcdsp_template.c:901:1: Array declaration 899. PUT_HEVC_QPEL_V(2) 900. PUT_HEVC_QPEL_V(3) 901. PUT_HEVC_QPEL_HV(1, 1) ^ 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) libavcodec/hevcdsp_template.c:901:1: Assignment 899. PUT_HEVC_QPEL_V(2) 900. PUT_HEVC_QPEL_V(3) 901. PUT_HEVC_QPEL_HV(1, 1) ^ 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) libavcodec/hevcdsp_template.c:901:1: Array access: Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h1v1_10` 899. PUT_HEVC_QPEL_V(2) 900. PUT_HEVC_QPEL_V(3) 901. PUT_HEVC_QPEL_HV(1, 1) ^ 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3)
https://github.com/libav/libav/blob/688417399c69aadd4c287bdb0dec82ef8799011c/libavcodec/hevcdsp_template.c/#L901
d2a_code_trace_data_42014
void CRYPTO_free(void *str) { #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (call_malloc_debug) { CRYPTO_mem_debug_free(str, 0); free(str); CRYPTO_mem_debug_free(str, 1); } else { free(str); } #else free(str); #endif } crypto/async/async.c:331: error: USE_AFTER_FREE call to `async_job_free()` eventually accesses memory that was invalidated by call to `free()` on line 331 indirectly during the call to `async_job_free()`. Showing all 20 steps of the trace crypto/async/async.c:322:1: invalidation part of the trace starts here 320. } 321. 322. > static void async_empty_pool(async_pool *pool) 323. { 324. ASYNC_JOB *job; crypto/async/async.c:322:1: parameter `pool` of async_empty_pool 320. } 321. 322. > static void async_empty_pool(async_pool *pool) 323. { 324. ASYNC_JOB *job; crypto/async/async.c:330:15: passed as argument to `sk_ASYNC_JOB_pop` 328. 329. do { 330. job = sk_ASYNC_JOB_pop(pool->jobs); ^ 331. async_job_free(job); 332. } while (job); crypto/async/async.c:330:15: return from call to `sk_ASYNC_JOB_pop` 328. 329. do { 330. job = sk_ASYNC_JOB_pop(pool->jobs); ^ 331. async_job_free(job); 332. } while (job); crypto/async/async.c:330:9: assigned 328. 329. do { 330. job = sk_ASYNC_JOB_pop(pool->jobs); ^ 331. async_job_free(job); 332. } while (job); crypto/async/async.c:331:9: when calling `async_job_free` here 329. do { 330. job = sk_ASYNC_JOB_pop(pool->jobs); 331. async_job_free(job); ^ 332. } while (job); 333. } crypto/async/async.c:139:1: parameter `job` of async_job_free 137. } 138. 139. > static void async_job_free(ASYNC_JOB *job) 140. { 141. if (job != NULL) { crypto/async/async.c:146:9: when calling `CRYPTO_free` here 144. async_close_fd(job->wait_fd); 145. async_close_fd(job->wake_fd); 146. OPENSSL_free(job); ^ 147. } 148. } crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: was invalidated by call to `free()` 243. } 244. #else 245. free(str); ^ 246. #endif 247. } crypto/async/async.c:322:1: use-after-lifetime part of the trace starts here 320. } 321. 322. > static void async_empty_pool(async_pool *pool) 323. { 324. ASYNC_JOB *job; crypto/async/async.c:322:1: parameter `pool` of async_empty_pool 320. } 321. 322. > static void async_empty_pool(async_pool *pool) 323. { 324. ASYNC_JOB *job; crypto/async/async.c:330:15: passed as argument to `sk_ASYNC_JOB_pop` 328. 329. do { 330. job = sk_ASYNC_JOB_pop(pool->jobs); ^ 331. async_job_free(job); 332. } while (job); crypto/async/async.c:330:15: return from call to `sk_ASYNC_JOB_pop` 328. 329. do { 330. job = sk_ASYNC_JOB_pop(pool->jobs); ^ 331. async_job_free(job); 332. } while (job); crypto/async/async.c:330:9: assigned 328. 329. do { 330. job = sk_ASYNC_JOB_pop(pool->jobs); ^ 331. async_job_free(job); 332. } while (job); crypto/async/async.c:331:9: when calling `async_job_free` here 329. do { 330. job = sk_ASYNC_JOB_pop(pool->jobs); 331. async_job_free(job); ^ 332. } while (job); 333. } crypto/async/async.c:139:1: parameter `job` of async_job_free 137. } 138. 139. > static void async_job_free(ASYNC_JOB *job) 140. { 141. if (job != NULL) { crypto/async/async.c:146:9: when calling `CRYPTO_free` here 144. async_close_fd(job->wait_fd); 145. async_close_fd(job->wake_fd); 146. OPENSSL_free(job); ^ 147. } 148. } crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: invalid access occurs here 243. } 244. #else 245. free(str); ^ 246. #endif 247. }
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/mem.c/#L245
d2a_code_trace_data_42015
HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, SSL_CTX *client_ctx, const SSL_TEST_CTX *test_ctx) { SSL *server, *client; BIO *client_to_server, *server_to_client; HANDSHAKE_EX_DATA server_ex_data, client_ex_data; CTX_DATA client_ctx_data, server_ctx_data, server2_ctx_data; HANDSHAKE_RESULT *ret = HANDSHAKE_RESULT_new(); int client_turn = 1; peer_status_t client_status = PEER_RETRY, server_status = PEER_RETRY; handshake_status_t status = HANDSHAKE_RETRY; unsigned char* tick = NULL; size_t tick_len = 0; SSL_SESSION* sess = NULL; const unsigned char *proto = NULL; unsigned int proto_len = 0; memset(&server_ctx_data, 0, sizeof(server_ctx_data)); memset(&server2_ctx_data, 0, sizeof(server2_ctx_data)); memset(&client_ctx_data, 0, sizeof(client_ctx_data)); configure_handshake_ctx(server_ctx, server2_ctx, client_ctx, test_ctx, &server_ctx_data, &server2_ctx_data, &client_ctx_data); server = SSL_new(server_ctx); client = SSL_new(client_ctx); OPENSSL_assert(server != NULL && client != NULL); configure_handshake_ssl(server, client, test_ctx); memset(&server_ex_data, 0, sizeof(server_ex_data)); memset(&client_ex_data, 0, sizeof(client_ex_data)); ret->result = SSL_TEST_INTERNAL_ERROR; client_to_server = BIO_new(BIO_s_mem()); server_to_client = BIO_new(BIO_s_mem()); OPENSSL_assert(client_to_server != NULL && server_to_client != NULL); BIO_set_nbio(client_to_server, 1); BIO_set_nbio(server_to_client, 1); SSL_set_connect_state(client); SSL_set_accept_state(server); SSL_set_bio(client, server_to_client, client_to_server); OPENSSL_assert(BIO_up_ref(server_to_client) > 0); OPENSSL_assert(BIO_up_ref(client_to_server) > 0); SSL_set_bio(server, client_to_server, server_to_client); ex_data_idx = SSL_get_ex_new_index(0, "ex data", NULL, NULL, NULL); OPENSSL_assert(ex_data_idx >= 0); OPENSSL_assert(SSL_set_ex_data(server, ex_data_idx, &server_ex_data) == 1); OPENSSL_assert(SSL_set_ex_data(client, ex_data_idx, &client_ex_data) == 1); SSL_set_info_callback(server, &info_cb); SSL_set_info_callback(client, &info_cb); for(;;) { if (client_turn) { client_status = do_handshake_step(client); status = handshake_status(client_status, server_status, 1 ); } else { server_status = do_handshake_step(server); status = handshake_status(server_status, client_status, 0 ); } switch (status) { case HANDSHAKE_SUCCESS: ret->result = SSL_TEST_SUCCESS; goto err; case CLIENT_ERROR: ret->result = SSL_TEST_CLIENT_FAIL; goto err; case SERVER_ERROR: ret->result = SSL_TEST_SERVER_FAIL; goto err; case INTERNAL_ERROR: ret->result = SSL_TEST_INTERNAL_ERROR; goto err; case HANDSHAKE_RETRY: client_turn ^= 1; break; } } err: ret->server_alert_sent = server_ex_data.alert_sent; ret->server_alert_received = client_ex_data.alert_received; ret->client_alert_sent = client_ex_data.alert_sent; ret->client_alert_received = server_ex_data.alert_received; ret->server_protocol = SSL_version(server); ret->client_protocol = SSL_version(client); ret->servername = server_ex_data.servername; if ((sess = SSL_get0_session(client)) != NULL) SSL_SESSION_get0_ticket(sess, &tick, &tick_len); if (tick == NULL || tick_len == 0) ret->session_ticket = SSL_TEST_SESSION_TICKET_NO; else ret->session_ticket = SSL_TEST_SESSION_TICKET_YES; ret->session_ticket_do_not_call = server_ex_data.session_ticket_do_not_call; SSL_get0_next_proto_negotiated(client, &proto, &proto_len); ret->client_npn_negotiated = dup_str(proto, proto_len); SSL_get0_next_proto_negotiated(server, &proto, &proto_len); ret->server_npn_negotiated = dup_str(proto, proto_len); SSL_get0_alpn_selected(client, &proto, &proto_len); ret->client_alpn_negotiated = dup_str(proto, proto_len); SSL_get0_alpn_selected(server, &proto, &proto_len); ret->server_alpn_negotiated = dup_str(proto, proto_len); ctx_data_free_data(&server_ctx_data); ctx_data_free_data(&server2_ctx_data); ctx_data_free_data(&client_ctx_data); SSL_free(server); SSL_free(client); return ret; } test/handshake_helper.c:594: error: UNINITIALIZED_VALUE The value read from server_ex_data.alert_received was never initialized. Showing all 1 steps of the trace test/handshake_helper.c:594:5: 592. ret->server_alert_received = client_ex_data.alert_received; 593. ret->client_alert_sent = client_ex_data.alert_sent; 594. > ret->client_alert_received = server_ex_data.alert_received; 595. ret->server_protocol = SSL_version(server); 596. ret->client_protocol = SSL_version(client);
https://github.com/openssl/openssl/blob/70c22888c1648fe8652e77107f3c74bf2212de36/test/handshake_helper.c/#L594
d2a_code_trace_data_42016
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) { bn_check_top(b); if (a == b) return a; if (bn_wexpand(a, b->top) == NULL) return NULL; if (b->top > 0) memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); a->top = b->top; a->neg = b->neg; bn_check_top(a); return a; } test/sm2_internal_test.c:282: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul`. Showing all 19 steps of the trace test/sm2_internal_test.c:271:10: Call 269. BIGNUM *s = NULL; 270. 271. if (!TEST_true(BN_hex2bn(&priv, privkey_hex))) ^ 272. goto done; 273. crypto/bn/bn_print.c:166:5: Assignment 164. j = i; /* least significant 'hex' */ 165. m = 0; 166. h = 0; ^ 167. while (j > 0) { 168. m = (BN_BYTES * 2 <= j) ? BN_BYTES * 2 : j; crypto/bn/bn_print.c:184:5: Assignment 182. j -= BN_BYTES * 2; 183. } 184. ret->top = h; ^ 185. bn_correct_top(ret); 186. test/sm2_internal_test.c:282:17: Call 280. pt = EC_POINT_new(group); 281. if (!TEST_ptr(pt) 282. || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL)) ^ 283. || !TEST_true(EC_KEY_set_public_key(key, pt))) 284. goto done; crypto/ec/ec_lib.c:929:1: Parameter `g_scalar->top` 927. } 928. 929. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, 930. const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx) 931. { crypto/ec/ec_lib.c:940:12: Call 938. scalars[0] = p_scalar; 939. 940. return EC_POINTs_mul(group, r, g_scalar, ^ 941. (point != NULL 942. && 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: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:342:1: Parameter `scalar->top` 340. * in the addition if scalar != NULL 341. */ 342. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 343. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 344. BN_CTX *ctx) crypto/ec/ec_mult.c:393:16: Call 391. * constant time version. 392. */ 393. return ec_mul_consttime(group, r, scalar, NULL, ctx); ^ 394. } 395. if ((scalar == NULL) && (num == 1)) { crypto/ec/ec_mult.c:131:1: Parameter `scalar->top` 129. * Returns 1 on success, 0 otherwise. 130. */ 131. > static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r, 132. const BIGNUM *scalar, const EC_POINT *point, 133. BN_CTX *ctx) crypto/ec/ec_mult.c:179:10: Call 177. goto err; 178. 179. if (!BN_copy(k, scalar)) ^ 180. goto err; 181. crypto/bn/bn_lib.c:285:1: <Offset trace> 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_lib.c:285:1: Parameter `b->top` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_lib.c:285:1: <Length trace> 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_lib.c:285:1: Parameter `*a->d` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_lib.c:291:9: Call 289. if (a == b) 290. return a; 291. if (bn_wexpand(a, b->top) == NULL) ^ 292. return NULL; 293. crypto/bn/bn_lib.c:941:1: Parameter `*a->d` 939. } 940. 941. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 942. { 943. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:295:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul` 293. 294. if (b->top > 0) 295. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); ^ 296. 297. a->top = b->top;
https://github.com/openssl/openssl/blob/630fe1da888490b7dfef3fe0928b813ddff5d51a/crypto/bn/bn_lib.c/#L295
d2a_code_trace_data_42017
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_eay.c:672: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked`. Showing all 28 steps of the trace crypto/rsa/rsa_eay.c:645:2: Call 643. 644. if((ctx = BN_CTX_new()) == NULL) goto err; 645. BN_CTX_start(ctx); ^ 646. f = BN_CTX_get(ctx); 647. ret = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/rsa/rsa_eay.c:672:2: Call 670. } 671. 672. MONT_HELPER(rsa->_method_mod_n, ctx, rsa->n, rsa->flags & RSA_FLAG_CACHE_PUBLIC, goto err); ^ 673. 674. if (!rsa->meth->bn_mod_exp(ret,f,rsa->e,rsa->n,ctx, crypto/bn/bn_mont.c:530:1: Parameter `ctx->stack.depth` 528. } 529. 530. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, 531. const BIGNUM *mod, BN_CTX *ctx) 532. { crypto/bn/bn_mont.c:546:16: Call 544. { 545. ret = BN_MONT_CTX_new(); 546. if (ret && !BN_MONT_CTX_set(ret, mod, ctx)) ^ 547. BN_MONT_CTX_free(ret); 548. else crypto/bn/bn_mont.c:412:1: Parameter `ctx->stack.depth` 410. } 411. 412. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 413. { 414. int ret = 0; crypto/bn/bn_mont.c:417:2: Call 415. BIGNUM *Ri,*R; 416. 417. BN_CTX_start(ctx); ^ 418. if((Ri = BN_CTX_get(ctx)) == NULL) goto err; 419. R= &(mont->RR); /* grab RR as a temp */ crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mont.c:473:8: Call 471. tmod.top = buf[0] != 0 ? 1 : 0; 472. /* Ri = R^-1 mod N*/ 473. if ((BN_mod_inverse(Ri,R,&tmod,ctx)) == NULL) ^ 474. goto err; 475. if (!BN_lshift(Ri,Ri,BN_BITS2)) goto err; /* R*Ri */ crypto/bn/bn_gcd.c:208:1: Parameter `ctx->stack.depth` 206. static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 207. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); 208. > BIGNUM *BN_mod_inverse(BIGNUM *in, 209. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 210. { crypto/bn/bn_gcd.c:217:10: Call 215. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) 216. { 217. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 218. } 219. crypto/bn/bn_gcd.c:506:1: Parameter `ctx->stack.depth` 504. * It does not contain branches that may leak sensitive information. 505. */ 506. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 507. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 508. { crypto/bn/bn_gcd.c:518:2: Call 516. bn_check_top(n); 517. 518. BN_CTX_start(ctx); ^ 519. A = BN_CTX_get(ctx); 520. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:547:8: Call 545. pB = &local_B; 546. BN_with_flags(pB, B, BN_FLG_CONSTTIME); 547. if (!BN_nnmod(B, pB, A, ctx)) goto err; ^ 548. } 549. sign = -1; crypto/bn/bn_mod.c:127:1: Parameter `ctx->stack.depth` 125. 126. 127. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 128. { 129. /* like BN_mod, but returns non-negative remainder crypto/bn/bn_mod.c:132:8: Call 130. * (i.e., 0 <= r < |d| always holds) */ 131. 132. if (!(BN_mod(r,m,d,ctx))) ^ 133. return 0; 134. if (!r->neg) crypto/bn/bn_div.c:181:1: Parameter `ctx->stack.depth` 179. static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 180. const BIGNUM *divisor, BN_CTX *ctx); 181. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 182. BN_CTX *ctx) 183. { crypto/bn/bn_div.c:192:10: Call 190. if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0)) 191. { 192. return BN_div_no_branch(dv, rm, num, divisor, ctx); ^ 193. } 194. crypto/bn/bn_div.c:414:1: Parameter `ctx->stack.depth` 412. * branches that may leak sensitive information. 413. */ 414. > static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 415. const BIGNUM *divisor, BN_CTX *ctx) 416. { crypto/bn/bn_div.c:434:2: Call 432. } 433. 434. BN_CTX_start(ctx); ^ 435. tmp=BN_CTX_get(ctx); 436. snum=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:630:2: Call 628. } 629. bn_correct_top(res); 630. BN_CTX_end(ctx); ^ 631. return(1); 632. err: crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:277:21: Call 275. else 276. { 277. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 278. /* Does this stack frame have anything to release? */ 279. if(fp < ctx->used) crypto/bn/bn_ctx.c:351:1: <LHS trace> 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:351:1: Parameter `st->depth` 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked` 351. static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; ^ 354. } 355.
https://github.com/openssl/openssl/blob/56c7754cab3da9745e52e36b0bf998f8356fd6d5/crypto/bn/bn_ctx.c/#L353
d2a_code_trace_data_42018
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) { bn_check_top(b); if (a == b) return a; if (bn_wexpand(a, b->top) == NULL) return NULL; if (b->top > 0) memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); a->top = b->top; a->neg = b->neg; bn_check_top(a); return a; } test/srptest.c:150: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `SRP_create_verifier_BN`. Showing all 16 steps of the trace test/srptest.c:150:10: Call 148. BN_hex2bn(&s, "BEB25379D1A8581EB5A727673A2441EE"); 149. /* Set up server's password entry */ 150. if (!TEST_true(SRP_create_verifier_BN("alice", "password123", &s, &v, GN->N, ^ 151. GN->g))) 152. goto err; crypto/srp/srp_vfy.c:633:1: Parameter `N->top` 631. * BIGNUMS. 632. */ 633. > int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 634. BIGNUM **verifier, const BIGNUM *N, 635. const BIGNUM *g) crypto/srp/srp_vfy.c:664:10: Call 662. goto err; 663. 664. if (!BN_mod_exp(*verifier, g, x, N, bn_ctx)) { ^ 665. BN_clear_free(*verifier); 666. goto err; crypto/bn/bn_exp.c:91:1: Parameter `m->top` 89. } 90. 91. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 92. BN_CTX *ctx) 93. { crypto/bn/bn_exp.c:136:9: Call 134. 135. #ifdef MONT_MUL_MOD 136. if (BN_is_odd(m)) { ^ 137. # ifdef MONT_EXP_WORD 138. if (a->top == 1 && !a->neg crypto/bn/bn_lib.c:867:1: Parameter `a->top` 865. } 866. 867. > int BN_is_odd(const BIGNUM *a) 868. { 869. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_exp.c:149:15: Call 147. #ifdef RECP_MUL_MOD 148. { 149. ret = BN_mod_exp_recp(r, a, p, m, ctx); ^ 150. } 151. #else crypto/bn/bn_exp.c:161:1: Parameter `m->top` 159. } 160. 161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 162. const BIGNUM *m, BN_CTX *ctx) 163. { crypto/bn/bn_exp.c:198:14: Call 196. if (m->neg) { 197. /* ignore sign of 'm' */ 198. if (!BN_copy(aa, m)) ^ 199. goto err; 200. aa->neg = 0; crypto/bn/bn_lib.c:323:1: <Offset trace> 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:323:1: Parameter `b->top` 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:323:1: <Length trace> 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:323:1: Parameter `*a->d` 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:329:9: Call 327. if (a == b) 328. return a; 329. if (bn_wexpand(a, b->top) == NULL) ^ 330. return NULL; 331. crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:333:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `SRP_create_verifier_BN` 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/6ea3bca427b3e759939a63555821d0c4678dd79c/crypto/bn/bn_lib.c/#L333
d2a_code_trace_data_42019
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; return 1; } ssl/t1_reneg.c:58: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 7]):unsigned64 by call to `WPACKET_memcpy`. Showing all 12 steps of the trace ssl/t1_reneg.c:57:17: Call 55. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate) 56. || !WPACKET_start_sub_packet_u16(pkt) 57. || !WPACKET_start_sub_packet_u8(pkt) ^ 58. || !WPACKET_memcpy(pkt, s->s3->previous_client_finished, 59. s->s3->previous_client_finished_len) ssl/packet.c:224:1: Parameter `pkt->buf->length` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/t1_reneg.c:58:17: Call 56. || !WPACKET_start_sub_packet_u16(pkt) 57. || !WPACKET_start_sub_packet_u8(pkt) 58. || !WPACKET_memcpy(pkt, s->s3->previous_client_finished, ^ 59. s->s3->previous_client_finished_len) 60. || !WPACKET_memcpy(pkt, s->s3->previous_server_finished, ssl/packet.c:302:1: Parameter `pkt->written` 300. } 301. 302. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 303. { 304. unsigned char *dest; ssl/packet.c:309:10: Call 307. return 1; 308. 309. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 310. return 0; 311. ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 7]):unsigned64 by call to `WPACKET_memcpy` 44. return 0; 45. 46. if (pkt->buf->length - pkt->written < len) { ^ 47. size_t newlen; 48. size_t reflen;
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
d2a_code_trace_data_42020
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:4078: error: NULL_DEREFERENCE pointer `null` is dereferenced by call to `ssl_security_cert()` at line 4078, column 10. Showing all 11 steps of the trace ssl/t1_lib.c:4069:1: start of procedure ssl_security_cert_chain() 4067. */ 4068. 4069. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy) 4070. { 4071. int rv, start_idx, i; ssl/t1_lib.c:4072:9: Taking true branch 4070. { 4071. int rv, start_idx, i; 4072. if (x == NULL) { ^ 4073. x = sk_X509_value(sk, 0); 4074. start_idx = 1; ssl/t1_lib.c:4073:9: 4071. int rv, start_idx, i; 4072. if (x == NULL) { 4073. > x = sk_X509_value(sk, 0); 4074. start_idx = 1; 4075. } 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:4074:9: 4072. if (x == NULL) { 4073. x = sk_X509_value(sk, 0); 4074. > start_idx = 1; 4075. } else 4076. start_idx = 0; ssl/t1_lib.c:4078:5: 4076. start_idx = 0; 4077. 4078. > rv = ssl_security_cert(s, NULL, x, vfy, 1); 4079. if (rv != 1) 4080. return rv;
https://github.com/openssl/openssl/blob/c0f9e23c6b8d1076796987d5a84557d410682d85/ssl/t1_lib.c/#L4078
d2a_code_trace_data_42021
void TIFFSwabArrayOfShort(register uint16* wp, tmsize_t n) { register unsigned char* cp; register unsigned char t; assert(sizeof(uint16)==2); while (n-- > 0) { cp = (unsigned char*) wp; t = cp[1]; cp[1] = cp[0]; cp[0] = t; wp++; } } tools/thumbnail.c:616: error: Buffer Overrun L3 Offset: [1, +oo] (⇐ [0, +oo] + 1) Size: [0, +oo] by call to `TIFFWriteDirectory`. tools/thumbnail.c:563:1: Parameter `out->tif_dir.td_samplesperpixel` 561. } 562. 563. static int ^ 564. generateThumbnail(TIFF* in, TIFF* out) 565. { tools/thumbnail.c:615:13: Call 613. diroff[0] = 0UL; 614. TIFFSetField(out, TIFFTAG_SUBIFD, 1, diroff); 615. return (TIFFWriteEncodedStrip(out, 0, thumbnail, tnw*tnh) != -1 && ^ 616. TIFFWriteDirectory(out) != -1); 617. } libtiff/tif_write.c:183:1: Parameter `tif->tif_dir.td_samplesperpixel` 181. * NB: Image length must be setup before writing. 182. */ 183. tmsize_t ^ 184. TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc) 185. { tools/thumbnail.c:616:13: Call 614. TIFFSetField(out, TIFFTAG_SUBIFD, 1, diroff); 615. return (TIFFWriteEncodedStrip(out, 0, thumbnail, tnw*tnh) != -1 && 616. TIFFWriteDirectory(out) != -1); ^ 617. } 618. libtiff/tif_dirwrite.c:163:1: Parameter `tif->tif_dir.td_samplesperpixel` 161. * storage that's been changed. 162. */ 163. int ^ 164. TIFFWriteDirectory(TIFF* tif) 165. { libtiff/tif_dirwrite.c:166:9: Call 164. TIFFWriteDirectory(TIFF* tif) 165. { 166. return TIFFWriteDirectorySec(tif,TRUE,TRUE,NULL); ^ 167. } 168. libtiff/tif_dirwrite.c:345:1: Parameter `tif->tif_dir.td_samplesperpixel` 343. } 344. 345. static int ^ 346. TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff) 347. { libtiff/tif_dirwrite.c:443:10: Call 441. if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE)) 442. { 443. if (!TIFFWriteDirectoryTagShortPerSample(tif,&ndir,dir,TIFFTAG_BITSPERSAMPLE,tif->tif_dir.td_bitspersample)) ^ 444. goto bad; 445. } libtiff/tif_dirwrite.c:1070:1: Parameter `tif->tif_dir.td_samplesperpixel` 1068. } 1069. 1070. static int ^ 1071. TIFFWriteDirectoryTagShortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value) 1072. { libtiff/tif_dirwrite.c:1083:4: Call 1081. return(1); 1082. } 1083. m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint16)); ^ 1084. if (m==NULL) 1085. { libtiff/tif_unix.c:253:1: Parameter `s` 251. #endif 252. 253. void* ^ 254. _TIFFmalloc(tmsize_t s) 255. { libtiff/tif_unix.c:256:10: Array declaration 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_unix.c:256:2: Assignment 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_dirwrite.c:1083:2: Assignment 1081. return(1); 1082. } 1083. m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint16)); ^ 1084. if (m==NULL) 1085. { libtiff/tif_dirwrite.c:1091:4: Call 1089. for (na=m, nb=0; nb<tif->tif_dir.td_samplesperpixel; na++, nb++) 1090. *na=value; 1091. o=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,tag,tif->tif_dir.td_samplesperpixel,m); ^ 1092. _TIFFfree(m); 1093. return(o); libtiff/tif_dirwrite.c:1830:1: Parameter `*value` 1828. } 1829. 1830. static int ^ 1831. TIFFWriteDirectoryTagCheckedShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value) 1832. { libtiff/tif_dirwrite.c:1836:3: Call 1834. assert(sizeof(uint16)==2); 1835. if (tif->tif_flags&TIFF_SWAB) 1836. TIFFSwabArrayOfShort(value,count); ^ 1837. return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SHORT,count,count*2,value)); 1838. } libtiff/tif_swab.c:72:1: <Length trace> 70. 71. #ifndef TIFFSwabArrayOfShort 72. void ^ 73. TIFFSwabArrayOfShort(register uint16* wp, tmsize_t n) 74. { libtiff/tif_swab.c:72:1: Parameter `*wp` 70. 71. #ifndef TIFFSwabArrayOfShort 72. void ^ 73. TIFFSwabArrayOfShort(register uint16* wp, tmsize_t n) 74. { libtiff/tif_swab.c:80:3: Assignment 78. /* XXX unroll loop some */ 79. while (n-- > 0) { 80. cp = (unsigned char*) wp; ^ 81. t = cp[1]; cp[1] = cp[0]; cp[0] = t; 82. wp++; libtiff/tif_swab.c:81:7: Array access: Offset: [1, +oo] (⇐ [0, +oo] + 1) Size: [0, +oo] by call to `TIFFWriteDirectory` 79. while (n-- > 0) { 80. cp = (unsigned char*) wp; 81. t = cp[1]; cp[1] = cp[0]; cp[0] = t; ^ 82. wp++; 83. }
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L81
d2a_code_trace_data_42022
BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) { unsigned int i,m; unsigned int n; BN_ULONG l; if (ret == NULL) ret=BN_new(); if (ret == NULL) return(NULL); l=0; n=len; if (n == 0) { ret->top=0; return(ret); } if (bn_expand(ret,(int)(n+2)*8) == NULL) return(NULL); i=((n-1)/BN_BYTES)+1; m=((n-1)%(BN_BYTES)); ret->top=i; while (n-- > 0) { l=(l<<8L)| *(s++); if (m-- == 0) { ret->d[--i]=l; l=0; m=BN_BYTES-1; } } bn_fix_top(ret); return(ret); } apps/x509.c:998: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_bin2bn`. Showing all 10 steps of the trace apps/x509.c:961:5: Call 959. strcpy(buf,serialfile); 960. serial=BN_new(); 961. bs=ASN1_INTEGER_new(); ^ 962. if ((serial == NULL) || (bs == NULL)) 963. { crypto/asn1/a_int.c:64:10: Call 62. 63. ASN1_INTEGER *ASN1_INTEGER_new(void) 64. { return M_ASN1_INTEGER_new();} ^ 65. 66. void ASN1_INTEGER_free(ASN1_INTEGER *x) crypto/asn1/asn1_lib.c:374:2: Assignment 372. return(NULL); 373. } 374. ret->length=0; ^ 375. ret->type=type; 376. ret->data=NULL; apps/x509.c:990:8: Call 988. else 989. { 990. if (!a2i_ASN1_INTEGER(io,bs,buf2,1024)) ^ 991. { 992. BIO_printf(bio_err,"unable to load serial number from %s\n",buf); crypto/asn1/f_int.c:97:1: Parameter `bs->length` 95. } 96. 97. > int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) 98. { 99. int ret=0; apps/x509.c:998:11: Call 996. else 997. { 998. serial=BN_bin2bn(bs->data,bs->length,serial); ^ 999. if (serial == NULL) 1000. { crypto/bn/bn_lib.c:565:1: <LHS trace> 563. 564. /* ignore negative */ 565. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) 566. { 567. unsigned int i,m; crypto/bn/bn_lib.c:565:1: Parameter `len` 563. 564. /* ignore negative */ 565. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) 566. { 567. unsigned int i,m; crypto/bn/bn_lib.c:574:2: Assignment 572. if (ret == NULL) return(NULL); 573. l=0; 574. n=len; ^ 575. if (n == 0) 576. { crypto/bn/bn_lib.c:582:2: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_bin2bn` 580. if (bn_expand(ret,(int)(n+2)*8) == NULL) 581. return(NULL); 582. i=((n-1)/BN_BYTES)+1; ^ 583. m=((n-1)%(BN_BYTES)); 584. ret->top=i;
https://github.com/openssl/openssl/blob/0e1c06128adbfd2d88dc304db2262140bad045fd/crypto/bn/bn_lib.c/#L582
d2a_code_trace_data_42023
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/ct/ct_log.c:135: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, +oo] by call to `CTLOG_new_from_base64`. Showing all 30 steps of the trace crypto/ct/ct_log.c:135:12: Call 133. } 134. 135. return CTLOG_new_from_base64(ct_log, pkey_base64, description); ^ 136. } 137. crypto/ct/ct_b64.c:135:1: Parameter `pkey_base64->strlen` 133. * -1 on internal (malloc) failure 134. */ 135. > int CTLOG_new_from_base64(CTLOG **ct_log, const char *pkey_base64, const char *name) 136. { 137. unsigned char *pkey_der = NULL; crypto/ct/ct_b64.c:147:20: Call 145. } 146. 147. pkey_der_len = ct_base64_decode(pkey_base64, &pkey_der); ^ 148. if (pkey_der_len < 0) { 149. CTerr(CT_F_CTLOG_NEW_FROM_BASE64, CT_R_LOG_CONF_INVALID_KEY); crypto/ct/ct_b64.c:24:1: Parameter `**out` 22. * the caller. Do not provide a pre-allocated string in |out|. 23. */ 24. > static int ct_base64_decode(const char *in, unsigned char **out) 25. { 26. size_t inlen = strlen(in); crypto/ct/ct_b64.c:153:5: Assignment 151. } 152. 153. p = pkey_der; ^ 154. pkey = d2i_PUBKEY(NULL, &p, pkey_der_len); 155. OPENSSL_free(pkey_der); crypto/ct/ct_b64.c:154:12: Call 152. 153. p = pkey_der; 154. pkey = d2i_PUBKEY(NULL, &p, pkey_der_len); ^ 155. OPENSSL_free(pkey_der); 156. if (pkey == NULL) { crypto/x509/x_pubkey.c:181:1: Parameter `**pp` 179. */ 180. 181. > EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length) 182. { 183. X509_PUBKEY *xpk; crypto/x509/x_pubkey.c:186:5: Assignment 184. EVP_PKEY *pktmp; 185. const unsigned char *q; 186. q = *pp; ^ 187. xpk = d2i_X509_PUBKEY(NULL, &q, length); 188. if (!xpk) crypto/x509/x_pubkey.c:187:11: Call 185. const unsigned char *q; 186. q = *pp; 187. xpk = d2i_X509_PUBKEY(NULL, &q, length); ^ 188. if (!xpk) 189. return NULL; crypto/x509/x_pubkey.c:57:1: Parameter `**in` 55. } ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY) 56. 57. > IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY) 58. 59. int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) crypto/x509/x_pubkey.c:57:1: Call 55. } ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY) 56. 57. > IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY) 58. 59. int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) crypto/asn1/tasn_dec.c:95:1: Parameter `**in` 93. */ 94. 95. > ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval, 96. const unsigned char **in, long len, 97. const ASN1_ITEM *it) crypto/asn1/tasn_dec.c:104:9: Call 102. pval = &ptmpval; 103. asn1_tlc_clear_nc(&c); 104. if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0) ^ 105. return *pval; 106. return NULL; crypto/asn1/tasn_dec.c:109:1: Parameter `**in` 107. } 108. 109. > int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, 110. const ASN1_ITEM *it, 111. int tag, int aclass, char opt, ASN1_TLC *ctx) crypto/asn1/tasn_dec.c:114:10: Call 112. { 113. int rv; 114. rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx); ^ 115. if (rv <= 0) 116. ASN1_item_ex_free(pval, it); crypto/asn1/tasn_dec.c:125:1: Parameter `**in` 123. */ 124. 125. > static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in, 126. long len, const ASN1_ITEM *it, 127. int tag, int aclass, char opt, ASN1_TLC *ctx) crypto/asn1/tasn_dec.c:169:9: Assignment 167. 168. case ASN1_ITYPE_MSTRING: 169. p = *in; ^ 170. /* Just read in tag and class */ 171. ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, crypto/asn1/tasn_dec.c:171:15: Call 169. p = *in; 170. /* Just read in tag and class */ 171. ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, ^ 172. &p, len, -1, 0, 1, ctx); 173. if (!ret) { crypto/asn1/tasn_dec.c:1060:1: Parameter `**in` 1058. */ 1059. 1060. > static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, 1061. char *inf, char *cst, 1062. const unsigned char **in, long len, crypto/asn1/tasn_dec.c:1069:5: Assignment 1067. long plen; 1068. const unsigned char *p, *q; 1069. p = *in; ^ 1070. q = p; 1071. crypto/asn1/tasn_dec.c:1079:13: Call 1077. p += ctx->hdrlen; 1078. } else { 1079. i = ASN1_get_object(&p, &plen, &ptag, &pclass, len); ^ 1080. if (ctx) { 1081. 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 `CTLOG_new_from_base64` 129. return 0; 130. /* Skip leading zeroes */ 131. while (i > 0 && *p == 0) { ^ 132. p++; 133. i--;
https://github.com/openssl/openssl/blob/c784a838e0947fcca761ee62def7d077dc06d37f/crypto/asn1/asn1_lib.c/#L131
d2a_code_trace_data_42024
void CRYPTO_free(void *str) { #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (call_malloc_debug) { CRYPTO_mem_debug_free(str, 0); free(str); CRYPTO_mem_debug_free(str, 1); } else { free(str); } #else free(str); #endif } apps/crl2p7.c:142: error: USE_AFTER_FREE call to `sk_OPENSSL_STRING_free()` eventually accesses memory that was invalidated by call to `free()` on line 141 indirectly during the call to `sk_OPENSSL_STRING_push()`. Showing all 22 steps of the trace apps/crl2p7.c:139:32: invalidation part of the trace starts here 137. case OPT_CERTFILE: 138. if ((certflst == NULL) 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) ^ 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { apps/crl2p7.c:139:32: passed as argument to `sk_OPENSSL_STRING_new_null` 137. case OPT_CERTFILE: 138. if ((certflst == NULL) 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) ^ 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { apps/crl2p7.c:139:32: return from call to `sk_OPENSSL_STRING_new_null` 137. case OPT_CERTFILE: 138. if ((certflst == NULL) 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) ^ 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { apps/crl2p7.c:139:21: assigned 137. case OPT_CERTFILE: 138. if ((certflst == NULL) 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) ^ 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { apps/crl2p7.c:141:18: when calling `sk_OPENSSL_STRING_push` here 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { ^ 142. sk_OPENSSL_STRING_free(certflst); 143. goto end; include/openssl/safestack.h:214:1: parameter `sk` of sk_OPENSSL_STRING_push 212. * dealt with in the autogenerated macros below. 213. */ 214. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char) 215. 216. /* include/openssl/safestack.h:214:1: when calling `sk_push` here 212. * dealt with in the autogenerated macros below. 213. */ 214. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char) 215. 216. /* crypto/stack/stack.c:259:1: parameter `st` of sk_push 257. } 258. 259. > int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); crypto/stack/stack.c:261:13: when calling `sk_insert` here 259. int sk_push(_STACK *st, void *data) 260. { 261. return (sk_insert(st, data, st->num)); ^ 262. } 263. crypto/stack/stack.c:167:1: parameter `st` of sk_insert 165. } 166. 167. > int sk_insert(_STACK *st, void *data, int loc) 168. { 169. char **s; crypto/stack/stack.c:174:13: when calling `CRYPTO_realloc` here 172. return 0; 173. if (st->num_alloc <= st->num + 1) { 174. s = OPENSSL_realloc((char *)st->data, ^ 175. (unsigned int)sizeof(char *) * st->num_alloc * 2); 176. if (s == NULL) crypto/mem.c:166:1: parameter `str` of CRYPTO_realloc 164. } 165. 166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 167. { 168. if (str == NULL) crypto/mem.c:172:9: when calling `CRYPTO_free` here 170. 171. if (num == 0) { 172. CRYPTO_free(str); ^ 173. return NULL; 174. } crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: was invalidated by call to `free()` 243. } 244. #else 245. free(str); ^ 246. #endif 247. } apps/crl2p7.c:139:32: use-after-lifetime part of the trace starts here 137. case OPT_CERTFILE: 138. if ((certflst == NULL) 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) ^ 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { apps/crl2p7.c:139:32: passed as argument to `sk_OPENSSL_STRING_new_null` 137. case OPT_CERTFILE: 138. if ((certflst == NULL) 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) ^ 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { apps/crl2p7.c:139:32: return from call to `sk_OPENSSL_STRING_new_null` 137. case OPT_CERTFILE: 138. if ((certflst == NULL) 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) ^ 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { apps/crl2p7.c:139:21: assigned 137. case OPT_CERTFILE: 138. if ((certflst == NULL) 139. && (certflst = sk_OPENSSL_STRING_new_null()) == NULL) ^ 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { apps/crl2p7.c:142:17: when calling `sk_OPENSSL_STRING_free` here 140. goto end; 141. if (!sk_OPENSSL_STRING_push(certflst, opt_arg())) { 142. sk_OPENSSL_STRING_free(certflst); ^ 143. goto end; 144. } crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: invalid access occurs here 243. } 244. #else 245. free(str); ^ 246. #endif 247. }
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/mem.c/#L245
d2a_code_trace_data_42025
void CRYPTO_free(void *str, const char *file, int line) { if (free_impl != NULL && free_impl != &CRYPTO_free) { free_impl(str, file, line); return; } #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (call_malloc_debug) { CRYPTO_mem_debug_free(str, 0, file, line); free(str); CRYPTO_mem_debug_free(str, 1, file, line); } else { free(str); } #else free(str); #endif } test/stack_test.c:355: error: USE_AFTER_FREE call to `sk_SU_push()` eventually accesses memory that was invalidated by call to `free()` on line 355 indirectly during the call to `sk_SU_push()`. Showing all 24 steps of the trace test/stack_test.c:339:23: invalidation part of the trace starts here 337. static int test_SU_stack(void) 338. { 339. STACK_OF(SU) *s = sk_SU_new_null(); ^ 340. SU v[10]; 341. const int n = OSSL_NELEM(v); test/stack_test.c:339:23: passed as argument to `sk_SU_new_null` 337. static int test_SU_stack(void) 338. { 339. STACK_OF(SU) *s = sk_SU_new_null(); ^ 340. SU v[10]; 341. const int n = OSSL_NELEM(v); test/stack_test.c:339:23: return from call to `sk_SU_new_null` 337. static int test_SU_stack(void) 338. { 339. STACK_OF(SU) *s = sk_SU_new_null(); ^ 340. SU v[10]; 341. const int n = OSSL_NELEM(v); test/stack_test.c:339:5: assigned 337. static int test_SU_stack(void) 338. { 339. STACK_OF(SU) *s = sk_SU_new_null(); ^ 340. SU v[10]; 341. const int n = OSSL_NELEM(v); test/stack_test.c:355:9: when calling `sk_SU_push` here 353. goto end; 354. } 355. sk_SU_push(s, v + i); ^ 356. } 357. if (!TEST_int_eq(sk_SU_num(s), n)) test/stack_test.c:42:1: parameter `sk` of sk_SU_push 40. DEFINE_SPECIAL_STACK_OF_CONST(uchar, unsigned char) 41. DEFINE_STACK_OF(SS) 42. > DEFINE_STACK_OF_CONST(SU) 43. 44. static int int_compare(const int *const *a, const int *const *b) test/stack_test.c:42:1: when calling `OPENSSL_sk_push` here 40. DEFINE_SPECIAL_STACK_OF_CONST(uchar, unsigned char) 41. DEFINE_STACK_OF(SS) 42. > DEFINE_STACK_OF_CONST(SU) 43. 44. static int int_compare(const int *const *a, const int *const *b) crypto/stack/stack.c:307:1: parameter `st` of OPENSSL_sk_push 305. } 306. 307. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data) 308. { 309. if (st == NULL) crypto/stack/stack.c:311:12: when calling `OPENSSL_sk_insert` here 309. if (st == NULL) 310. return -1; 311. return OPENSSL_sk_insert(st, data, st->num); ^ 312. } 313. crypto/stack/stack.c:222:1: parameter `st` of OPENSSL_sk_insert 220. } 221. 222. > int OPENSSL_sk_insert(OPENSSL_STACK *st, const void *data, int loc) 223. { 224. if (st == NULL || st->num < 0 || st->num == max_nodes) crypto/stack/stack.c:227:10: when calling `sk_reserve` here 225. return 0; 226. 227. if (!sk_reserve(st, 1, 0)) ^ 228. return 0; 229. crypto/stack/stack.c:166:1: parameter `st` of sk_reserve 164. 165. /* internal STACK storage allocation */ 166. > static int sk_reserve(OPENSSL_STACK *st, int n, int exact) 167. { 168. const void **tmpdata; crypto/stack/stack.c:203:15: when calling `CRYPTO_realloc` here 201. } 202. 203. tmpdata = OPENSSL_realloc((void *)st->data, sizeof(void *) * num_alloc); ^ 204. if (tmpdata == NULL) 205. return 0; crypto/mem.c:208:1: parameter `str` of CRYPTO_realloc 206. } 207. 208. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 209. { 210. if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc) crypto/mem.c:218:9: when calling `CRYPTO_free` here 216. 217. if (num == 0) { 218. CRYPTO_free(str, file, line); ^ 219. return NULL; 220. } crypto/mem.c:265:1: parameter `str` of CRYPTO_free 263. } 264. 265. > void CRYPTO_free(void *str, const char *file, int line) 266. { 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:281:5: was invalidated by call to `free()` 279. } 280. #else 281. free(str); ^ 282. #endif 283. } test/stack_test.c:339:23: use-after-lifetime part of the trace starts here 337. static int test_SU_stack(void) 338. { 339. STACK_OF(SU) *s = sk_SU_new_null(); ^ 340. SU v[10]; 341. const int n = OSSL_NELEM(v); test/stack_test.c:339:23: passed as argument to `sk_SU_new_null` 337. static int test_SU_stack(void) 338. { 339. STACK_OF(SU) *s = sk_SU_new_null(); ^ 340. SU v[10]; 341. const int n = OSSL_NELEM(v); test/stack_test.c:339:23: return from call to `sk_SU_new_null` 337. static int test_SU_stack(void) 338. { 339. STACK_OF(SU) *s = sk_SU_new_null(); ^ 340. SU v[10]; 341. const int n = OSSL_NELEM(v); test/stack_test.c:339:5: assigned 337. static int test_SU_stack(void) 338. { 339. STACK_OF(SU) *s = sk_SU_new_null(); ^ 340. SU v[10]; 341. const int n = OSSL_NELEM(v); test/stack_test.c:355:9: when calling `sk_SU_push` here 353. goto end; 354. } 355. sk_SU_push(s, v + i); ^ 356. } 357. if (!TEST_int_eq(sk_SU_num(s), n)) crypto/mem.c:265:1: parameter `str` of CRYPTO_free 263. } 264. 265. > void CRYPTO_free(void *str, const char *file, int line) 266. { 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:281:5: invalid access occurs here 279. } 280. #else 281. free(str); ^ 282. #endif 283. }
https://github.com/openssl/openssl/blob/270a4bba49849de7f928f4fab186205abd132411/crypto/mem.c/#L281
d2a_code_trace_data_42026
static int describe_param_type(char *buf, size_t bufsz, const OSSL_PARAM *param) { const char *type_mod = ""; const char *type = NULL; int show_type_number = 0; int printed_len; switch (param->data_type) { case OSSL_PARAM_UNSIGNED_INTEGER: type_mod = "unsigned "; case OSSL_PARAM_INTEGER: type = "integer"; break; case OSSL_PARAM_UTF8_PTR: type_mod = "pointer to a "; case OSSL_PARAM_UTF8_STRING: type = "UTF8 encoded string"; break; case OSSL_PARAM_OCTET_PTR: type_mod = "pointer to an "; case OSSL_PARAM_OCTET_STRING: type = "octet string"; break; default: type = "unknown type"; show_type_number = 1; break; } printed_len = BIO_snprintf(buf, bufsz, "%s: ", param->key); if (printed_len > 0) { buf += printed_len; bufsz -= printed_len; } printed_len = BIO_snprintf(buf, bufsz, "%s%s", type_mod, type); if (printed_len > 0) { buf += printed_len; bufsz -= printed_len; } if (show_type_number) { printed_len = BIO_snprintf(buf, bufsz, " [%d]", param->data_type); if (printed_len > 0) { buf += printed_len; bufsz -= printed_len; } } if (param->data_size == 0) printed_len = BIO_snprintf(buf, bufsz, " (arbitrary size)"); else printed_len = BIO_snprintf(buf, bufsz, " (max %zu bytes large)", param->data_size); if (printed_len > 0) { buf += printed_len; bufsz -= printed_len; } *buf = '\0'; return 1; } apps/lib/app_params.c:90: error: INTEGER_OVERFLOW_L2 ([-6442450741, 200] - [1, 2147483647]):unsigned64 by call to `describe_param_type`. Showing all 11 steps of the trace apps/lib/app_params.c:90:13: Call 88. char buf[200]; /* This should be ample space */ 89. 90. describe_param_type(buf, sizeof(buf), pdefs); ^ 91. BIO_printf(bio_out, "%*s %s\n", indent, "", buf); 92. } apps/lib/app_params.c:13:1: <LHS trace> 11. #include "app_params.h" 12. 13. > static int describe_param_type(char *buf, size_t bufsz, const OSSL_PARAM *param) 14. { 15. const char *type_mod = ""; apps/lib/app_params.c:13:1: Parameter `bufsz` 11. #include "app_params.h" 12. 13. > static int describe_param_type(char *buf, size_t bufsz, const OSSL_PARAM *param) 14. { 15. const char *type_mod = ""; apps/lib/app_params.c:63:23: <RHS trace> 61. } 62. if (param->data_size == 0) 63. printed_len = BIO_snprintf(buf, bufsz, " (arbitrary size)"); ^ 64. else 65. printed_len = BIO_snprintf(buf, bufsz, " (max %zu bytes large)", apps/lib/app_params.c:63:23: Call 61. } 62. if (param->data_size == 0) 63. printed_len = BIO_snprintf(buf, bufsz, " (arbitrary size)"); ^ 64. else 65. printed_len = BIO_snprintf(buf, bufsz, " (max %zu bytes large)", crypto/bio/b_print.c:906:11: Call 904. va_start(args, format); 905. 906. ret = BIO_vsnprintf(buf, n, format, args); ^ 907. 908. va_end(args); crypto/bio/b_print.c:918:9: Assignment 916. 917. if (!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args)) 918. return -1; ^ 919. 920. if (truncated) crypto/bio/b_print.c:906:5: Assignment 904. va_start(args, format); 905. 906. ret = BIO_vsnprintf(buf, n, format, args); ^ 907. 908. va_end(args); crypto/bio/b_print.c:909:5: Assignment 907. 908. va_end(args); 909. return ret; ^ 910. } 911. apps/lib/app_params.c:63:9: Assignment 61. } 62. if (param->data_size == 0) 63. printed_len = BIO_snprintf(buf, bufsz, " (arbitrary size)"); ^ 64. else 65. printed_len = BIO_snprintf(buf, bufsz, " (max %zu bytes large)", apps/lib/app_params.c:69:9: Binary operation: ([-6442450741, 200] - [1, 2147483647]):unsigned64 by call to `describe_param_type` 67. if (printed_len > 0) { 68. buf += printed_len; 69. bufsz -= printed_len; ^ 70. } 71. *buf = '\0';
https://github.com/openssl/openssl/blob/2d9007587c5072a513c84f22db7be55767b4c63d/apps/lib/app_params.c/#L69
d2a_code_trace_data_42027
int tls_construct_client_verify(SSL *s) { unsigned char *p; EVP_PKEY *pkey; const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys]; EVP_MD_CTX *mctx; unsigned u = 0; unsigned long n = 0; long hdatalen = 0; void *hdata; mctx = EVP_MD_CTX_new(); if (mctx == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_MALLOC_FAILURE); goto err; } p = ssl_handshake_start(s); pkey = s->cert->key->privatekey; hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); if (hdatalen <= 0) { SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } if (SSL_USE_SIGALGS(s)) { if (!tls12_get_sigandhash(p, pkey, md)) { SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } p += 2; n = 2; } #ifdef SSL_DEBUG fprintf(stderr, "Using client alg %s\n", EVP_MD_name(md)); #endif if (!EVP_SignInit_ex(mctx, md, NULL) || !EVP_SignUpdate(mctx, hdata, hdatalen) || (s->version == SSL3_VERSION && !EVP_MD_CTX_ctrl(mctx, EVP_CTRL_SSL3_MASTER_SECRET, s->session->master_key_length, s->session->master_key)) || !EVP_SignFinal(mctx, p + 2, &u, pkey)) { SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_EVP_LIB); goto err; } #ifndef OPENSSL_NO_GOST { int pktype = EVP_PKEY_id(pkey); if (pktype == NID_id_GostR3410_2001 || pktype == NID_id_GostR3410_2012_256 || pktype == NID_id_GostR3410_2012_512) BUF_reverse(p + 2, NULL, u); } #endif s2n(u, p); n += u + 2; if (!ssl3_digest_cached_records(s, 0)) goto err; if (!ssl_set_handshake_header(s, SSL3_MT_CERTIFICATE_VERIFY, n)) { SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); goto err; } EVP_MD_CTX_free(mctx); return 1; err: EVP_MD_CTX_free(mctx); return 0; } ssl/statem/statem_clnt.c:2642: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 2584, column 12 is not reachable after line 2642, column 5. Showing all 50 steps of the trace ssl/statem/statem_clnt.c:2573:1: start of procedure tls_construct_client_verify() 2571. } 2572. 2573. > int tls_construct_client_verify(SSL *s) 2574. { 2575. unsigned char *p; ssl/statem/statem_clnt.c:2577:5: 2575. unsigned char *p; 2576. EVP_PKEY *pkey; 2577. > const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys]; 2578. EVP_MD_CTX *mctx; 2579. unsigned u = 0; ssl/statem/statem_clnt.c:2579:5: 2577. const EVP_MD *md = s->s3->tmp.md[s->cert->key - s->cert->pkeys]; 2578. EVP_MD_CTX *mctx; 2579. > unsigned u = 0; 2580. unsigned long n = 0; 2581. long hdatalen = 0; ssl/statem/statem_clnt.c:2580:5: 2578. EVP_MD_CTX *mctx; 2579. unsigned u = 0; 2580. > unsigned long n = 0; 2581. long hdatalen = 0; 2582. void *hdata; ssl/statem/statem_clnt.c:2581:5: 2579. unsigned u = 0; 2580. unsigned long n = 0; 2581. > long hdatalen = 0; 2582. void *hdata; 2583. ssl/statem/statem_clnt.c:2584:5: 2582. void *hdata; 2583. 2584. > mctx = EVP_MD_CTX_new(); 2585. if (mctx == NULL) { 2586. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_MALLOC_FAILURE); crypto/evp/digest.c:145:1: start of procedure EVP_MD_CTX_new() 143. } 144. 145. > EVP_MD_CTX *EVP_MD_CTX_new(void) 146. { 147. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:147:5: 145. EVP_MD_CTX *EVP_MD_CTX_new(void) 146. { 147. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 148. } 149. crypto/mem.c:146:1: start of procedure CRYPTO_zalloc() 144. } 145. 146. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 147. { 148. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:148:5: 146. void *CRYPTO_zalloc(size_t num, const char *file, int line) 147. { 148. > void *ret = CRYPTO_malloc(num, file, line); 149. 150. if (ret != NULL) crypto/mem.c:119:1: start of procedure CRYPTO_malloc() 117. } 118. 119. > void *CRYPTO_malloc(size_t num, const char *file, int line) 120. { 121. void *ret = NULL; crypto/mem.c:121:5: 119. void *CRYPTO_malloc(size_t num, const char *file, int line) 120. { 121. > void *ret = NULL; 122. 123. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:123:9: Taking false branch 121. void *ret = NULL; 122. 123. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 124. return malloc_impl(num, file, line); 125. crypto/mem.c:126:9: Taking false branch 124. return malloc_impl(num, file, line); 125. 126. if (num <= 0) ^ 127. return NULL; 128. crypto/mem.c:129:5: 127. return NULL; 128. 129. > allow_customize = 0; 130. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 131. if (call_malloc_debug) { crypto/mem.c:139:5: 137. } 138. #else 139. > osslargused(file); osslargused(line); 140. ret = malloc(num); 141. #endif crypto/mem.c:139:24: 137. } 138. #else 139. > osslargused(file); osslargused(line); 140. ret = malloc(num); 141. #endif crypto/mem.c:140:5: 138. #else 139. osslargused(file); osslargused(line); 140. > ret = malloc(num); 141. #endif 142. crypto/mem.c:143:5: 141. #endif 142. 143. > return ret; 144. } 145. crypto/mem.c:144:1: return from a call to CRYPTO_malloc 142. 143. return ret; 144. > } 145. 146. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:150:9: Taking true branch 148. void *ret = CRYPTO_malloc(num, file, line); 149. 150. if (ret != NULL) ^ 151. memset(ret, 0, num); 152. return ret; crypto/mem.c:151:9: 149. 150. if (ret != NULL) 151. > memset(ret, 0, num); 152. return ret; 153. } crypto/mem.c:152:5: 150. if (ret != NULL) 151. memset(ret, 0, num); 152. > return ret; 153. } 154. crypto/mem.c:153:1: return from a call to CRYPTO_zalloc 151. memset(ret, 0, num); 152. return ret; 153. > } 154. 155. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:148:1: return from a call to EVP_MD_CTX_new 146. { 147. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 148. > } 149. 150. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) ssl/statem/statem_clnt.c:2585:9: Taking false branch 2583. 2584. mctx = EVP_MD_CTX_new(); 2585. if (mctx == NULL) { ^ 2586. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_MALLOC_FAILURE); 2587. goto err; ssl/statem/statem_clnt.c:2590:5: 2588. } 2589. 2590. > p = ssl_handshake_start(s); 2591. pkey = s->cert->key->privatekey; 2592. ssl/statem/statem_clnt.c:2591:5: 2589. 2590. p = ssl_handshake_start(s); 2591. > pkey = s->cert->key->privatekey; 2592. 2593. hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); ssl/statem/statem_clnt.c:2593:5: 2591. pkey = s->cert->key->privatekey; 2592. 2593. > hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); 2594. if (hdatalen <= 0) { 2595. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); crypto/bio/bio_lib.c:389:1: start of procedure BIO_ctrl() 387. } 388. 389. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg) 390. { 391. long ret; crypto/bio/bio_lib.c:394:9: Taking false branch 392. long (*cb) (BIO *, int, const char *, int, long, long); 393. 394. if (b == NULL) ^ 395. return (0); 396. crypto/bio/bio_lib.c:397:10: Taking false branch 395. return (0); 396. 397. if ((b->method == NULL) || (b->method->ctrl == NULL)) { ^ 398. BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD); 399. return (-2); crypto/bio/bio_lib.c:397:33: Taking true branch 395. return (0); 396. 397. if ((b->method == NULL) || (b->method->ctrl == NULL)) { ^ 398. BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD); 399. return (-2); crypto/bio/bio_lib.c:398:9: Skipping ERR_put_error(): empty list of specs 396. 397. if ((b->method == NULL) || (b->method->ctrl == NULL)) { 398. BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD); ^ 399. return (-2); 400. } crypto/bio/bio_lib.c:399:9: 397. if ((b->method == NULL) || (b->method->ctrl == NULL)) { 398. BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD); 399. > return (-2); 400. } 401. crypto/bio/bio_lib.c:413:1: return from a call to BIO_ctrl 411. ret = cb(b, BIO_CB_CTRL | BIO_CB_RETURN, parg, cmd, larg, ret); 412. return (ret); 413. > } 414. 415. long BIO_callback_ctrl(BIO *b, int cmd, ssl/statem/statem_clnt.c:2594:9: Taking true branch 2592. 2593. hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); 2594. if (hdatalen <= 0) { ^ 2595. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); 2596. goto err; ssl/statem/statem_clnt.c:2595:9: Skipping ERR_put_error(): empty list of specs 2593. hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); 2594. if (hdatalen <= 0) { 2595. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); ^ 2596. goto err; 2597. } ssl/statem/statem_clnt.c:2641:2: 2639. EVP_MD_CTX_free(mctx); 2640. return 1; 2641. > err: 2642. EVP_MD_CTX_free(mctx); 2643. return 0; ssl/statem/statem_clnt.c:2642:5: 2640. return 1; 2641. err: 2642. > EVP_MD_CTX_free(mctx); 2643. return 0; 2644. } crypto/evp/digest.c:150:1: start of procedure EVP_MD_CTX_free() 148. } 149. 150. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 151. { 152. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:152:5: Skipping EVP_MD_CTX_reset(): empty list of specs 150. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 151. { 152. EVP_MD_CTX_reset(ctx); ^ 153. OPENSSL_free(ctx); 154. } crypto/evp/digest.c:153:5: 151. { 152. EVP_MD_CTX_reset(ctx); 153. > OPENSSL_free(ctx); 154. } 155. crypto/mem.c:210:1: start of procedure CRYPTO_free() 208. } 209. 210. > void CRYPTO_free(void *str, const char *file, int line) 211. { 212. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:212:9: Taking true branch 210. void CRYPTO_free(void *str, const char *file, int line) 211. { 212. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 213. free_impl(str, file, line); 214. return; crypto/mem.c:212:30: Taking true branch 210. void CRYPTO_free(void *str, const char *file, int line) 211. { 212. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 213. free_impl(str, file, line); 214. return; crypto/mem.c:213:9: Skipping __function_pointer__(): unresolved function pointer 211. { 212. if (free_impl != NULL && free_impl != &CRYPTO_free) { 213. free_impl(str, file, line); ^ 214. return; 215. } crypto/mem.c:214:9: 212. if (free_impl != NULL && free_impl != &CRYPTO_free) { 213. free_impl(str, file, line); 214. > return; 215. } 216. crypto/mem.c:228:1: return from a call to CRYPTO_free 226. free(str); 227. #endif 228. > } 229. 230. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:154:1: return from a call to EVP_MD_CTX_free 152. EVP_MD_CTX_reset(ctx); 153. OPENSSL_free(ctx); 154. > } 155. 156. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
https://github.com/openssl/openssl/blob/a4ccf06808422400a6a0673b452d388e95a455fd/ssl/statem/statem_clnt.c/#L2642
d2a_code_trace_data_42028
static unsigned constant_time_ge(unsigned a, unsigned b) { a -= b; return DUPLICATE_MSB_TO_ALL(~a); } ssl/s3_pkt.c:457: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, 34112]):unsigned32 by call to `ssl3_cbc_copy_mac`. Showing all 9 steps of the trace ssl/s3_pkt.c:284:1: Parameter `s->packet_length` 282. */ 283. /* used only by ssl3_read_bytes */ 284. > static int ssl3_get_record(SSL *s) 285. { 286. int ssl_major,ssl_minor,al; ssl/s3_pkt.c:457:4: Call 455. * */ 456. mac = mac_tmp; 457. ssl3_cbc_copy_mac(mac_tmp, rr, mac_size, orig_len); ^ 458. rr->length -= mac_size; 459. } ssl/s3_cbc.c:254:1: Parameter `orig_len` 252. #define CBC_MAC_ROTATE_IN_PLACE 253. 254. > void ssl3_cbc_copy_mac(unsigned char* out, 255. const SSL3_RECORD *rec, 256. unsigned md_size,unsigned orig_len) ssl/s3_cbc.c:300:29: Call 298. { 299. unsigned char mac_started = constant_time_ge(i, mac_start); 300. unsigned char mac_ended = constant_time_ge(i, mac_end); ^ 301. unsigned char b = rec->data[i]; 302. rotated_mac[j++] |= b & mac_started & ~mac_ended; ssl/s3_cbc.c:87:1: <LHS trace> 85. 86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */ 87. > static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ssl/s3_cbc.c:87:1: Parameter `a` 85. 86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */ 87. > static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ssl/s3_cbc.c:87:1: <RHS trace> 85. 86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */ 87. > static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ssl/s3_cbc.c:87:1: Parameter `b` 85. 86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */ 87. > static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ssl/s3_cbc.c:89:2: Binary operation: ([0, +oo] - [0, 34112]):unsigned32 by call to `ssl3_cbc_copy_mac` 87. static unsigned constant_time_ge(unsigned a, unsigned b) 88. { 89. a -= b; ^ 90. return DUPLICATE_MSB_TO_ALL(~a); 91. }
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/ssl/s3_cbc.c/#L89
d2a_code_trace_data_42029
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_exp.c:654: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_nnmod`. Showing all 20 steps of the trace crypto/bn/bn_exp.c:592:1: Parameter `ctx->stack.depth` 590. * http://www.daemonology.net/hyperthreading-considered-harmful/) 591. */ 592. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 593. const BIGNUM *m, BN_CTX *ctx, 594. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:636:5: Call 634. } 635. 636. BN_CTX_start(ctx); ^ 637. 638. /* 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:652:27: Call 650. 651. if (a->neg || BN_ucmp(a, m) >= 0) { 652. BIGNUM *reduced = BN_CTX_get(ctx); ^ 653. if (reduced == NULL 654. || !BN_nnmod(reduced, a, m, ctx)) { crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:654:17: Call 652. BIGNUM *reduced = BN_CTX_get(ctx); 653. if (reduced == NULL 654. || !BN_nnmod(reduced, a, m, ctx)) { ^ 655. goto err; 656. } crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_nnmod` 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_42030
static inline void mc_dir_part(AVSContext *h,Picture *pic, int chroma_height,int delta,int list,uint8_t *dest_y, uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset, int src_y_offset,qpel_mc_func *qpix_op, h264_chroma_mc_func chroma_op,cavs_vector *mv) { MpegEncContext * const s = &h->s; const int mx= mv->x + src_x_offset*8; const int my= mv->y + src_y_offset*8; const int luma_xy= (mx&3) + ((my&3)<<2); uint8_t * src_y = pic->f.data[0] + (mx >> 2) + (my >> 2) * h->l_stride; uint8_t * src_cb = pic->f.data[1] + (mx >> 3) + (my >> 3) * h->c_stride; uint8_t * src_cr = pic->f.data[2] + (mx >> 3) + (my >> 3) * h->c_stride; int extra_width= 0; int extra_height= extra_width; int emu=0; const int full_mx= mx>>2; const int full_my= my>>2; const int pic_width = 16*h->mb_width; const int pic_height = 16*h->mb_height; if(!pic->f.data[0]) return; if(mx&7) extra_width -= 3; if(my&7) extra_height -= 3; if( full_mx < 0-extra_width || full_my < 0-extra_height || full_mx + 16 > pic_width + extra_width || full_my + 16 > pic_height + extra_height){ s->dsp.emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*h->l_stride, h->l_stride, 16+5, 16+5 , full_mx-2, full_my-2, pic_width, pic_height); src_y= s->edge_emu_buffer + 2 + 2*h->l_stride; emu=1; } qpix_op[luma_xy](dest_y, src_y, h->l_stride); if(emu){ s->dsp.emulated_edge_mc(s->edge_emu_buffer, src_cb, h->c_stride, 9, 9 , (mx>>3), (my>>3), pic_width>>1, pic_height>>1); src_cb= s->edge_emu_buffer; } chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx&7, my&7); if(emu){ s->dsp.emulated_edge_mc(s->edge_emu_buffer, src_cr, h->c_stride, 9, 9 , (mx>>3), (my>>3), pic_width>>1, pic_height>>1); src_cr= s->edge_emu_buffer; } chroma_op(dest_cr, src_cr, h->c_stride, chroma_height, mx&7, my&7); } libavcodec/cavs.c:421: error: Buffer Overrun L2 Offset: [1, 16] (⇐ 1 + [0, 15]) Size: 2 by call to `mc_part_std`. libavcodec/cavs.c:413:1: Parameter `h->cdsp.put_cavs_qpel_pixels_tab[*]` 411. } 412. 413. void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type) { ^ 414. if(ff_cavs_partition_flags[mb_type] == 0){ // 16x16 415. mc_part_std(h, 8, 0, h->cy, h->cu, h->cv, 0, 0, libavcodec/cavs.c:421:9: Call 419. h->s.dsp.avg_h264_chroma_pixels_tab[0],&h->mv[MV_FWD_X0]); 420. }else{ 421. mc_part_std(h, 4, 0, h->cy, h->cu, h->cv, 0, 0, ^ 422. h->cdsp.put_cavs_qpel_pixels_tab[1], 423. h->s.dsp.put_h264_chroma_pixels_tab[1], libavcodec/cavs.c:380:1: Parameter `*qpix_put` 378. } 379. 380. static inline void mc_part_std(AVSContext *h,int chroma_height,int delta, ^ 381. uint8_t *dest_y,uint8_t *dest_cb,uint8_t *dest_cr, 382. int x_offset, int y_offset,qpel_mc_func *qpix_put, libavcodec/cavs.c:386:5: Assignment 384. h264_chroma_mc_func chroma_avg, cavs_vector *mv) 385. { 386. qpel_mc_func *qpix_op= qpix_put; ^ 387. h264_chroma_mc_func chroma_op= chroma_put; 388. libavcodec/cavs.c:397:9: Call 395. if(mv->ref >= 0){ 396. Picture *ref= &h->DPB[mv->ref]; 397. mc_dir_part(h, ref, chroma_height, delta, 0, ^ 398. dest_y, dest_cb, dest_cr, x_offset, y_offset, 399. qpix_op, chroma_op, mv); libavcodec/cavs.c:327:1: <Offset trace> 325. ****************************************************************************/ 326. 327. static inline void mc_dir_part(AVSContext *h,Picture *pic, ^ 328. int chroma_height,int delta,int list,uint8_t *dest_y, 329. uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset, libavcodec/cavs.c:327:1: Parameter `src_x_offset` 325. ****************************************************************************/ 326. 327. static inline void mc_dir_part(AVSContext *h,Picture *pic, ^ 328. int chroma_height,int delta,int list,uint8_t *dest_y, 329. uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset, libavcodec/cavs.c:334:5: Assignment 332. { 333. MpegEncContext * const s = &h->s; 334. const int mx= mv->x + src_x_offset*8; ^ 335. const int my= mv->y + src_y_offset*8; 336. const int luma_xy= (mx&3) + ((my&3)<<2); libavcodec/cavs.c:336:5: Assignment 334. const int mx= mv->x + src_x_offset*8; 335. const int my= mv->y + src_y_offset*8; 336. const int luma_xy= (mx&3) + ((my&3)<<2); ^ 337. uint8_t * src_y = pic->f.data[0] + (mx >> 2) + (my >> 2) * h->l_stride; 338. uint8_t * src_cb = pic->f.data[1] + (mx >> 3) + (my >> 3) * h->c_stride; libavcodec/cavs.c:327:1: <Length trace> 325. ****************************************************************************/ 326. 327. static inline void mc_dir_part(AVSContext *h,Picture *pic, ^ 328. int chroma_height,int delta,int list,uint8_t *dest_y, 329. uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset, libavcodec/cavs.c:327:1: Parameter `*qpix_op` 325. ****************************************************************************/ 326. 327. static inline void mc_dir_part(AVSContext *h,Picture *pic, ^ 328. int chroma_height,int delta,int list,uint8_t *dest_y, 329. uint8_t *dest_cb,uint8_t *dest_cr,int src_x_offset, libavcodec/cavs.c:363:5: Array access: Offset: [1, 16] (⇐ 1 + [0, 15]) Size: 2 by call to `mc_part_std` 361. } 362. 363. qpix_op[luma_xy](dest_y, src_y, h->l_stride); //FIXME try variable height perhaps? ^ 364. 365. if(emu){
https://github.com/libav/libav/blob/c265b77b115885fd5f1b7a3eeae49dcc95718edc/libavcodec/cavs.c/#L363
d2a_code_trace_data_42031
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; isxdigit((unsigned char)a[i]); i++) ; 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]; if ((c >= '0') && (c <= '9')) k = c - '0'; else if ((c >= 'a') && (c <= 'f')) k = c - 'a' + 10; else if ((c >= 'A') && (c <= 'F')) k = c - 'A' + 10; else 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); ret->neg = neg; *bn = ret; bn_check_top(ret); return (num); err: if (*bn == NULL) BN_free(ret); return (0); } crypto/ec/ectest.c:343: error: BUFFER_OVERRUN_L3 Offset: [-15, +oo] (⇐ [0, 1] + [-15, +oo]) Size: 2 by call to `BN_hex2bn`. Showing all 7 steps of the trace crypto/ec/ectest.c:343:10: Call 341. if (!BN_hex2bn(&p, "17")) 342. ABORT; 343. if (!BN_hex2bn(&a, "1")) ^ 344. ABORT; 345. if (!BN_hex2bn(&b, "1")) crypto/bn/bn_print.c:187:10: <Offset trace> 185. } 186. 187. for (i = 0; isxdigit((unsigned char)a[i]); i++) ; ^ 188. 189. num = i + neg; crypto/bn/bn_print.c:187:10: Assignment 185. } 186. 187. for (i = 0; isxdigit((unsigned char)a[i]); i++) ; ^ 188. 189. num = i + neg; crypto/bn/bn_print.c:206:5: Assignment 204. goto err; 205. 206. j = i; /* least significant 'hex' */ ^ 207. m = 0; 208. h = 0; crypto/bn/bn_print.c:172:1: <Length trace> 170. } 171. 172. > int BN_hex2bn(BIGNUM **bn, const char *a) 173. { 174. BIGNUM *ret = NULL; crypto/bn/bn_print.c:172:1: Parameter `*a` 170. } 171. 172. > int BN_hex2bn(BIGNUM **bn, const char *a) 173. { 174. BIGNUM *ret = NULL; crypto/bn/bn_print.c:213:17: Array access: Offset: [-15, +oo] (⇐ [0, 1] + [-15, +oo]) Size: 2 by call to `BN_hex2bn` 211. l = 0; 212. for (;;) { 213. c = a[j - m]; ^ 214. if ((c >= '0') && (c <= '9')) 215. k = c - '0';
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/crypto/bn/bn_print.c/#L213
d2a_code_trace_data_42032
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/srp/srp_lib.c:204: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_exp`. Showing all 32 steps of the trace 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:141:19: Call 139. && (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) { 140. BN_ULONG A = a->d[0]; 141. ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL); ^ 142. } else 143. # endif crypto/bn/bn_exp.c:1127:1: Parameter `m->top` 1125. } 1126. 1127. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, 1128. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 1129. { crypto/srp/srp_lib.c:193:14: Call 191. if (!BN_mod_exp(tmp, g, x, N, bn_ctx)) 192. goto err; 193. if ((k = srp_Calc_k(N, g)) == NULL) ^ 194. goto err; 195. if (!BN_mod_mul(tmp2, tmp, k, N, bn_ctx)) crypto/srp/srp_lib.c:46:1: Parameter `N->top` 44. } 45. 46. > static BIGNUM *srp_Calc_k(const BIGNUM *N, const BIGNUM *g) 47. { 48. /* k = SHA1(N | PAD(g)) -- tls-srp RFC 5054 */ crypto/srp/srp_lib.c:49:12: Call 47. { 48. /* k = SHA1(N | PAD(g)) -- tls-srp RFC 5054 */ 49. return srp_Calc_xy(N, g, N); ^ 50. } 51. 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; crypto/srp/srp_lib.c:195:10: Call 193. if ((k = srp_Calc_k(N, g)) == NULL) 194. goto err; 195. if (!BN_mod_mul(tmp2, tmp, k, N, bn_ctx)) ^ 196. goto err; 197. if (!BN_mod_sub(tmp, B, tmp2, N, bn_ctx)) crypto/bn/bn_mod.c:193:1: Parameter `m->top` 191. 192. /* slow but works */ 193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 194. BN_CTX *ctx) 195. { crypto/srp/srp_lib.c:197:10: Call 195. if (!BN_mod_mul(tmp2, tmp, k, N, bn_ctx)) 196. goto err; 197. if (!BN_mod_sub(tmp, B, tmp2, N, bn_ctx)) ^ 198. goto err; 199. if (!BN_mul(tmp3, u, x, bn_ctx)) crypto/bn/bn_mod.c:106:1: Parameter `m->top` 104. } 105. 106. > int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 107. BN_CTX *ctx) 108. { crypto/srp/srp_lib.c:204:23: Call 202. goto err; 203. K = BN_new(); 204. if (K != NULL && !BN_mod_exp(K, tmp, tmp2, N, bn_ctx)) { ^ 205. BN_free(K); 206. K = 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 `BN_mod_exp` 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_42033
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1713: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_recp`. Showing all 18 steps of the trace test/bntest.c:1665:1: Parameter `ctx->stack.depth` 1663. } 1664. 1665. > int test_kron(BIO *bp, BN_CTX *ctx) 1666. { 1667. BN_GENCB cb; test/bntest.c:1713:14: Call 1711. b->neg = 0; 1712. 1713. if (!BN_mod_exp_recp(r, a, t, b, ctx)) ^ 1714. goto err; 1715. b->neg = 1; crypto/bn/bn_exp.c:168:1: Parameter `ctx->stack.depth` 166. } 167. 168. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 169. const BIGNUM *m, BN_CTX *ctx) 170. { crypto/bn/bn_exp.c:196:5: Call 194. } 195. 196. BN_CTX_start(ctx); ^ 197. aa = BN_CTX_get(ctx); 198. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_exp.c:215:10: Call 213. } 214. 215. if (!BN_nnmod(val[0], a, m, ctx)) ^ 216. goto err; /* 1 */ 217. if (BN_is_zero(val[0])) { crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:193:5: Call 191. } 192. 193. BN_CTX_start(ctx); ^ 194. tmp = BN_CTX_get(ctx); 195. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:416:5: Call 414. if (no_branch) 415. bn_correct_top(res); 416. BN_CTX_end(ctx); ^ 417. return (1); 418. err: crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <Offset trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: <Length trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_recp` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_42034
static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], int dir[6], uint8_t *st[6], int zigzag_last_index[6]) { int score= 0; int i, n; int8_t * const qscale_table= s->current_picture.qscale_table; memcpy(zigzag_last_index, s->block_last_index, sizeof(int)*6); for(n=0; n<6; n++){ int16_t *ac_val, *ac_val1; score -= get_block_rate(s, block[n], s->block_last_index[n], s->intra_scantable.permutated); ac_val = s->ac_val[0][0] + s->block_index[n] * 16; ac_val1= ac_val; if(dir[n]){ const int xy= s->mb_x + s->mb_y*s->mb_stride - s->mb_stride; ac_val-= s->block_wrap[n]*16; if(s->mb_y==0 || s->qscale == qscale_table[xy] || n==2 || n==3){ for(i=1; i<8; i++){ const int level= block[n][s->dsp.idct_permutation[i ]]; block[n][s->dsp.idct_permutation[i ]] = level - ac_val[i+8]; ac_val1[i ]= block[n][s->dsp.idct_permutation[i<<3]]; ac_val1[i+8]= level; } }else{ for(i=1; i<8; i++){ const int level= block[n][s->dsp.idct_permutation[i ]]; block[n][s->dsp.idct_permutation[i ]] = level - ROUNDED_DIV(ac_val[i + 8]*qscale_table[xy], s->qscale); ac_val1[i ]= block[n][s->dsp.idct_permutation[i<<3]]; ac_val1[i+8]= level; } } st[n]= s->intra_h_scantable.permutated; }else{ const int xy= s->mb_x-1 + s->mb_y*s->mb_stride; ac_val-= 16; if(s->mb_x==0 || s->qscale == qscale_table[xy] || n==1 || n==3){ for(i=1; i<8; i++){ const int level= block[n][s->dsp.idct_permutation[i<<3]]; block[n][s->dsp.idct_permutation[i<<3]]= level - ac_val[i]; ac_val1[i ]= level; ac_val1[i+8]= block[n][s->dsp.idct_permutation[i ]]; } }else{ for(i=1; i<8; i++){ const int level= block[n][s->dsp.idct_permutation[i<<3]]; block[n][s->dsp.idct_permutation[i<<3]]= level - ROUNDED_DIV(ac_val[i]*qscale_table[xy], s->qscale); ac_val1[i ]= level; ac_val1[i+8]= block[n][s->dsp.idct_permutation[i ]]; } } st[n]= s->intra_v_scantable.permutated; } for(i=63; i>0; i--) if(block[n][ st[n][i] ]) break; s->block_last_index[n]= i; score += get_block_rate(s, block[n], s->block_last_index[n], st[n]); } return score < 0; } libavcodec/h263.c:419: error: Buffer Overrun L3 Offset added: 24 Size: [0, +oo]. libavcodec/h263.c:413:1: <Length trace> 411. } 412. 413. static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], int dir[6], uint8_t *st[6], int zigzag_last_index[6]) ^ 414. { 415. int score= 0; libavcodec/h263.c:413:1: Parameter `s->block_last_index[*]` 411. } 412. 413. static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], int dir[6], uint8_t *st[6], int zigzag_last_index[6]) ^ 414. { 415. int score= 0; libavcodec/h263.c:419:5: Array access: Offset added: 24 Size: [0, +oo] 417. int8_t * const qscale_table= s->current_picture.qscale_table; 418. 419. memcpy(zigzag_last_index, s->block_last_index, sizeof(int)*6); ^ 420. 421. for(n=0; n<6; n++){
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h263.c/#L419
d2a_code_trace_data_42035
static int check_image_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, const int linesizes[4]) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); int i; for (i = 0; i < 4; i++) { int plane = desc->comp[i].plane; if (!data[plane] || !linesizes[plane]) return 0; } return 1; } libswscale/swscale_unscaled.c:1167: error: Null Dereference pointer `desc` last assigned on line 1163 could be null and is dereferenced at line 1167, column 21. libswscale/swscale_unscaled.c:1160:1: start of procedure check_image_pointers() 1158. } 1159. 1160. static int check_image_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, ^ 1161. const int linesizes[4]) 1162. { libswscale/swscale_unscaled.c:1163:5: 1161. const int linesizes[4]) 1162. { 1163. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); ^ 1164. int i; 1165. libavutil/pixdesc.c:1626:1: start of procedure av_pix_fmt_desc_get() 1624. } 1625. 1626. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1627. { 1628. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1628:9: Taking false branch 1626. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1627. { 1628. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1629. return NULL; 1630. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1628:24: Taking true branch 1626. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1627. { 1628. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1629. return NULL; 1630. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1629:9: 1627. { 1628. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1629. return NULL; ^ 1630. return &av_pix_fmt_descriptors[pix_fmt]; 1631. } libavutil/pixdesc.c:1631:1: return from a call to av_pix_fmt_desc_get 1629. return NULL; 1630. return &av_pix_fmt_descriptors[pix_fmt]; 1631. } ^ 1632. 1633. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) libswscale/swscale_unscaled.c:1166:10: 1164. int i; 1165. 1166. for (i = 0; i < 4; i++) { ^ 1167. int plane = desc->comp[i].plane; 1168. if (!data[plane] || !linesizes[plane]) libswscale/swscale_unscaled.c:1166:17: Loop condition is true. Entering loop body 1164. int i; 1165. 1166. for (i = 0; i < 4; i++) { ^ 1167. int plane = desc->comp[i].plane; 1168. if (!data[plane] || !linesizes[plane]) libswscale/swscale_unscaled.c:1167:9: 1165. 1166. for (i = 0; i < 4; i++) { 1167. int plane = desc->comp[i].plane; ^ 1168. if (!data[plane] || !linesizes[plane]) 1169. return 0;
https://github.com/libav/libav/blob/ae81576414f2d2083d3118fb4abe1ebc5a7a4c54/libswscale/swscale_unscaled.c/#L1167
d2a_code_trace_data_42036
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/ssl_test.c:494: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `do_handshake`. Showing all 22 steps of the trace test/ssl_test.c:494:14: Call 492. goto err; 493. 494. result = do_handshake(server_ctx, server2_ctx, client_ctx, ^ 495. resume_server_ctx, resume_client_ctx, test_ctx); 496. test/handshake_helper.c:1711:1: Parameter `client_ctx->sessions->num_items` 1709. } 1710. 1711. > HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx, 1712. SSL_CTX *client_ctx, SSL_CTX *resume_server_ctx, 1713. SSL_CTX *resume_client_ctx, test/handshake_helper.c:1719:14: Call 1717. SSL_SESSION *session = NULL, *serv_sess = NULL; 1718. 1719. result = do_handshake_internal(server_ctx, server2_ctx, client_ctx, ^ 1720. test_ctx, &test_ctx->extra, 1721. NULL, NULL, &session, &serv_sess); test/handshake_helper.c:1396:1: Parameter `client_ctx->sessions->num_items` 1394. * parsing.) 1395. */ 1396. > static HANDSHAKE_RESULT *do_handshake_internal( 1397. SSL_CTX *server_ctx, SSL_CTX *server2_ctx, SSL_CTX *client_ctx, 1398. const SSL_TEST_CTX *test_ctx, const SSL_TEST_EXTRA_CONF *extra, test/handshake_helper.c:1446:10: Call 1444. goto err; 1445. } 1446. if (!create_peer(&client, client_ctx)) { ^ 1447. TEST_note("creating client context"); 1448. goto err; test/handshake_helper.c:755:1: Parameter `ctx->sessions->num_items` 753. } PEER; 754. 755. > static int create_peer(PEER *peer, SSL_CTX *ctx) 756. { 757. static const int peer_buffer_size = 64 * 1024; test/handshake_helper.c:761:10: Call 759. unsigned char *read_buf = NULL, *write_buf = NULL; 760. 761. if (!TEST_ptr(ssl = SSL_new(ctx)) ^ 762. || !TEST_ptr(write_buf = OPENSSL_zalloc(peer_buffer_size)) 763. || !TEST_ptr(read_buf = OPENSSL_zalloc(peer_buffer_size))) ssl/ssl_lib.c:669:1: Parameter `ctx->sessions->num_items` 667. } 668. 669. > SSL *SSL_new(SSL_CTX *ctx) 670. { 671. SSL *s; ssl/ssl_lib.c:813:10: Call 811. s->server = (ctx->method->ssl_accept == ssl_undefined_function) ? 0 : 1; 812. 813. if (!SSL_clear(s)) ^ 814. goto err; 815. ssl/ssl_lib.c:577:1: Parameter `s->session_ctx->sessions->num_items` 575. } 576. 577. > int SSL_clear(SSL *s) 578. { 579. if (s->method == NULL) { ssl/ssl_lib.c:584:9: Call 582. } 583. 584. if (ssl_clear_bad_session(s)) { ^ 585. SSL_SESSION_free(s->session); 586. s->session = NULL; ssl/ssl_sess.c:1139:1: Parameter `s->session_ctx->sessions->num_items` 1137. } 1138. 1139. > int ssl_clear_bad_session(SSL *s) 1140. { 1141. if ((s->session != NULL) && ssl/ssl_sess.c:1144:9: Call 1142. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1143. !(SSL_in_init(s) || SSL_in_before(s))) { 1144. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1145. return 1; 1146. } else ssl/ssl_sess.c:757:1: Parameter `ctx->sessions->num_items` 755. } 756. 757. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 758. { 759. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:759:12: Call 757. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 758. { 759. return remove_session_lock(ctx, c, 1); ^ 760. } 761. ssl/ssl_sess.c:762:1: Parameter `ctx->sessions->num_items` 760. } 761. 762. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 763. { 764. SSL_SESSION *r; ssl/ssl_sess.c:772:17: Call 770. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) { 771. ret = 1; 772. r = lh_SSL_SESSION_delete(ctx->sessions, r); ^ 773. SSL_SESSION_list_remove(ctx, r); 774. } ssl/ssl_locl.h:727:1: Parameter `lh->num_items` 725. } TLSEXT_INDEX; 726. 727. > DEFINE_LHASH_OF(SSL_SESSION); 728. /* Needed in ssl_cert.c */ 729. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:727:1: Call 725. } TLSEXT_INDEX; 726. 727. > DEFINE_LHASH_OF(SSL_SESSION); 728. /* Needed in ssl_cert.c */ 729. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:126:1: <LHS trace> 124. } 125. 126. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 127. { 128. unsigned long hash; crypto/lhash/lhash.c:126:1: Parameter `lh->num_items` 124. } 125. 126. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 127. { 128. unsigned long hash; crypto/lhash/lhash.c:146:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `do_handshake` 144. } 145. 146. lh->num_items--; ^ 147. if ((lh->num_nodes > MIN_NODES) && 148. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/41145c35bfee8f2b0822288fcb23a807d06d8e89/crypto/lhash/lhash.c/#L146
d2a_code_trace_data_42037
static int seq_parse_frame_data(SeqDemuxContext *seq, ByteIOContext *pb) { unsigned int offset_table[4], buffer_num[4]; TiertexSeqFrameBuffer *seq_buffer; int i, e, err; seq->current_frame_offs += SEQ_FRAME_SIZE; url_fseek(pb, seq->current_frame_offs, SEEK_SET); seq->current_audio_data_offs = get_le16(pb); if (seq->current_audio_data_offs != 0) { seq->current_audio_data_size = SEQ_AUDIO_BUFFER_SIZE * 2; } else { seq->current_audio_data_size = 0; } seq->current_pal_data_offs = get_le16(pb); if (seq->current_pal_data_offs != 0) { seq->current_pal_data_size = 768; } else { seq->current_pal_data_size = 0; } for (i = 0; i < 4; i++) buffer_num[i] = get_byte(pb); for (i = 0; i < 4; i++) offset_table[i] = get_le16(pb); for (i = 0; i < 3; i++) { if (offset_table[i] != 0) { for (e = i + 1; e < 4 && offset_table[e] == 0; e++); err = seq_fill_buffer(seq, pb, buffer_num[1 + i], offset_table[i], offset_table[e] - offset_table[i]); if (err != 0) return err; } } if (buffer_num[0] != 255) { if (buffer_num[0] >= SEQ_NUM_FRAME_BUFFERS) return AVERROR_INVALIDDATA; seq_buffer = &seq->frame_buffers[buffer_num[0]]; seq->current_video_data_size = seq_buffer->fill_size; seq->current_video_data_ptr = seq_buffer->data; seq_buffer->fill_size = 0; } else { seq->current_video_data_size = 0; seq->current_video_data_ptr = 0; } return 0; } libavformat/tiertexseq.c:159: error: Uninitialized Value The value read from buffer_num[_] was never initialized. libavformat/tiertexseq.c:159:19: 157. if (offset_table[i] != 0) { 158. for (e = i + 1; e < 4 && offset_table[e] == 0; e++); 159. err = seq_fill_buffer(seq, pb, buffer_num[1 + i], ^ 160. offset_table[i], 161. offset_table[e] - offset_table[i]);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/tiertexseq.c/#L159
d2a_code_trace_data_42038
static inline void dv_calc_mb_coordinates(const AVDVProfile *d, int chan, int seq, int slot, uint16_t *tbl) { static const uint8_t off[] = { 2, 6, 8, 0, 4 }; static const uint8_t shuf1[] = { 36, 18, 54, 0, 72 }; static const uint8_t shuf2[] = { 24, 12, 36, 0, 48 }; static const uint8_t shuf3[] = { 18, 9, 27, 0, 36 }; static const uint8_t l_start[] = {0, 4, 9, 13, 18, 22, 27, 31, 36, 40}; static const uint8_t l_start_shuffled[] = { 9, 4, 13, 0, 18 }; static const uint8_t serpent1[] = {0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2, 2, 1, 0, 0, 1, 2}; static const uint8_t serpent2[] = {0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5}; static const uint8_t remap[][2] = {{ 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 1}, { 0, 2}, { 0, 3}, {10, 0}, {10, 1}, {10, 2}, {10, 3}, {20, 0}, {20, 1}, {20, 2}, {20, 3}, {30, 0}, {30, 1}, {30, 2}, {30, 3}, {40, 0}, {40, 1}, {40, 2}, {40, 3}, {50, 0}, {50, 1}, {50, 2}, {50, 3}, {60, 0}, {60, 1}, {60, 2}, {60, 3}, {70, 0}, {70, 1}, {70, 2}, {70, 3}, { 0,64}, { 0,65}, { 0,66}, {10,64}, {10,65}, {10,66}, {20,64}, {20,65}, {20,66}, {30,64}, {30,65}, {30,66}, {40,64}, {40,65}, {40,66}, {50,64}, {50,65}, {50,66}, {60,64}, {60,65}, {60,66}, {70,64}, {70,65}, {70,66}, { 0,67}, {20,67}, {40,67}, {60,67}}; int i, k, m; int x, y, blk; for (m=0; m<5; m++) { switch (d->width) { case 1440: blk = (chan*11+seq)*27+slot; if (chan == 0 && seq == 11) { x = m*27+slot; if (x<90) { y = 0; } else { x = (x - 90)*2; y = 67; } } else { i = (4*chan + blk + off[m])%11; k = (blk/11)%27; x = shuf1[m] + (chan&1)*9 + k%9; y = (i*3+k/9)*2 + (chan>>1) + 1; } tbl[m] = (x<<1)|(y<<9); break; case 1280: blk = (chan*10+seq)*27+slot; i = (4*chan + (seq/5) + 2*blk + off[m])%10; k = (blk/5)%27; x = shuf1[m]+(chan&1)*9 + k%9; y = (i*3+k/9)*2 + (chan>>1) + 4; if (x >= 80) { x = remap[y][0]+((x-80)<<(y>59)); y = remap[y][1]; } tbl[m] = (x<<1)|(y<<9); break; case 960: blk = (chan*10+seq)*27+slot; i = (4*chan + (seq/5) + 2*blk + off[m])%10; k = (blk/5)%27 + (i&1)*3; x = shuf2[m] + k%6 + 6*(chan&1); y = l_start[i] + k/6 + 45*(chan>>1); tbl[m] = (x<<1)|(y<<9); break; case 720: switch (d->pix_fmt) { case AV_PIX_FMT_YUV422P: x = shuf3[m] + slot/3; y = serpent1[slot] + ((((seq + off[m]) % d->difseg_size)<<1) + chan)*3; tbl[m] = (x<<1)|(y<<8); break; case AV_PIX_FMT_YUV420P: x = shuf3[m] + slot/3; y = serpent1[slot] + ((seq + off[m]) % d->difseg_size)*3; tbl[m] = (x<<1)|(y<<9); break; case AV_PIX_FMT_YUV411P: i = (seq + off[m]) % d->difseg_size; k = slot + ((m==1||m==2)?3:0); x = l_start_shuffled[m] + k/6; y = serpent2[k] + i*6; if (x>21) y = y*2 - i*6; tbl[m] = (x<<2)|(y<<8); break; } default: break; } } } libavcodec/dvdec.c:353: error: Buffer Overrun L3 Offset: [-54, +oo] Size: 64 by call to `ff_dv_init_dynamic_tables`. libavcodec/dvdec.c:346:11: Call 344. const AVDVProfile *sys; 345. 346. sys = av_dv_frame_profile(s->sys, buf, buf_size); ^ 347. if (!sys || buf_size < sys->frame_size) { 348. av_log(avctx, AV_LOG_ERROR, "could not find dv frame profile\n"); libavcodec/dv_profile.c:267:1: Parameter `buf_size` 265. #endif /* CONFIG_DVPROFILE */ 266. 267. const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys, ^ 268. const uint8_t* frame, unsigned buf_size) 269. { libavcodec/dvdec.c:353:15: Call 351. 352. if (sys != s->sys) { 353. ret = ff_dv_init_dynamic_tables(s, sys); ^ 354. if (ret < 0) { 355. av_log(avctx, AV_LOG_ERROR, "Error initializing the work tables.\n"); libavcodec/dv.c:178:1: Parameter `d->n_difchan` 176. static const uint8_t dv_quant_areas[4] = { 6, 21, 43, 64 }; 177. 178. int ff_dv_init_dynamic_tables(DVVideoContext *ctx, const AVDVProfile *d) ^ 179. { 180. int j,i,c,s,p; libavcodec/dv.c:192:23: Call 190. if (!(DV_PROFILE_IS_1080i50(d) && c != 0 && s == 11) && 191. !(DV_PROFILE_IS_720p50(d) && s > 9)) { 192. dv_calc_mb_coordinates(d, c, s, j, &ctx->work_chunks[i].mb_coordinates[0]); ^ 193. ctx->work_chunks[i++].buf_offset = p; 194. } libavcodec/dv.c:54:1: <Offset trace> 52. RL_VLC_ELEM ff_dv_rl_vlc[1184]; 53. 54. static inline void dv_calc_mb_coordinates(const AVDVProfile *d, int chan, int seq, int slot, ^ 55. uint16_t *tbl) 56. { libavcodec/dv.c:54:1: Parameter `chan` 52. RL_VLC_ELEM ff_dv_rl_vlc[1184]; 53. 54. static inline void dv_calc_mb_coordinates(const AVDVProfile *d, int chan, int seq, int slot, ^ 55. uint16_t *tbl) 56. { libavcodec/dv.c:120:15: Assignment 118. 119. x = shuf1[m]+(chan&1)*9 + k%9; 120. y = (i*3+k/9)*2 + (chan>>1) + 4; ^ 121. 122. if (x >= 80) { libavcodec/dv.c:74:5: <Length trace> 72. 0, 1, 2, 3, 4, 5}; 73. 74. static const uint8_t remap[][2] = {{ 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, /* dummy */ ^ 75. { 0, 0}, { 0, 1}, { 0, 2}, { 0, 3}, {10, 0}, 76. {10, 1}, {10, 2}, {10, 3}, {20, 0}, {20, 1}, libavcodec/dv.c:74:5: Array declaration 72. 0, 1, 2, 3, 4, 5}; 73. 74. static const uint8_t remap[][2] = {{ 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, /* dummy */ ^ 75. { 0, 0}, { 0, 1}, { 0, 2}, { 0, 3}, {10, 0}, 76. {10, 1}, {10, 2}, {10, 3}, {20, 0}, {20, 1}, libavcodec/dv.c:123:23: Array access: Offset: [-54, +oo] Size: 64 by call to `ff_dv_init_dynamic_tables` 121. 122. if (x >= 80) { 123. x = remap[y][0]+((x-80)<<(y>59)); ^ 124. y = remap[y][1]; 125. }
https://github.com/libav/libav/blob/fbc0b8659967ea54a8472b5f795270d38bb085dd/libavcodec/dv.c/#L123
d2a_code_trace_data_42039
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:317: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_clear`. Showing all 12 steps of the trace ssl/bio_ssl.c:317:3: Call 315. SSL_set_accept_state(ssl); 316. 317. SSL_clear(ssl); ^ 318. 319. if (b->next_bio != NULL) ssl/ssl_lib.c:185:1: Parameter `s->ctx->sessions->num_items` 183. }; 184. 185. > int SSL_clear(SSL *s) 186. { 187. ssl/ssl_lib.c:194:6: Call 192. } 193. 194. if (ssl_clear_bad_session(s)) ^ 195. { 196. SSL_SESSION_free(s->session); ssl/ssl_sess.c:991:1: Parameter `s->ctx->sessions->num_items` 989. } 990. 991. > int ssl_clear_bad_session(SSL *s) 992. { 993. if ( (s->session != NULL) && ssl/ssl_sess.c:997:3: Call 995. !(SSL_in_init(s) || SSL_in_before(s))) 996. { 997. SSL_CTX_remove_session(s->ctx,s->session); ^ 998. return(1); 999. } ssl/ssl_sess.c:682:1: Parameter `ctx->sessions->num_items` 680. } 681. 682. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 683. { 684. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:684:9: Call 682. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 683. { 684. return remove_session_lock(ctx, c, 1); ^ 685. } 686. ssl/ssl_sess.c:687:1: Parameter `ctx->sessions->num_items` 685. } 686. 687. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 688. { 689. SSL_SESSION *r; ssl/ssl_sess.c:698:6: Call 696. { 697. ret=1; 698. r=lh_SSL_SESSION_delete(ctx->sessions,c); ^ 699. SSL_SESSION_list_remove(ctx,c); 700. } 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_clear` 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/789da2c73d875af59b14156b6295aa4bdfc4f424/crypto/lhash/lhash.c/#L240
d2a_code_trace_data_42040
static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){ AVFormatContext *s= nut->avf; ByteIOContext *bc = s->pb; int64_t end, tmp; nut->last_syncpoint_pos= url_ftell(bc)-8; end= get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE); end += url_ftell(bc); tmp= ff_get_v(bc); *back_ptr= nut->last_syncpoint_pos - 16*ff_get_v(bc); if(*back_ptr < 0) return -1; ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count], tmp / nut->time_base_count); if(skip_reserved(bc, end) || get_checksum(bc)){ av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n"); return -1; } *ts= tmp / s->nb_streams * av_q2d(nut->time_base[tmp % s->nb_streams])*AV_TIME_BASE; ff_nut_add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts); return 0; } libavformat/nutdec.c:465: error: Integer Overflow L1 ([-oo, -8] - [0, +oo]):unsigned64. libavformat/nutdec.c:459:30: <LHS trace> 457. int64_t end, tmp; 458. 459. nut->last_syncpoint_pos= url_ftell(bc)-8; ^ 460. 461. end= get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE); libavformat/nutdec.c:459:30: Call 457. int64_t end, tmp; 458. 459. nut->last_syncpoint_pos= url_ftell(bc)-8; ^ 460. 461. end= get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE); libavformat/aviobuf.c:186:12: Call 184. offset_t url_ftell(ByteIOContext *s) 185. { 186. return url_fseek(s, 0, SEEK_CUR); ^ 187. } 188. libavformat/aviobuf.c:133:9: Assignment 131. 132. if(!s) 133. return AVERROR(EINVAL); ^ 134. 135. pos = s->pos - (s->write_flag ? 0 : (s->buf_end - s->buffer)); libavformat/aviobuf.c:186:5: Assignment 184. offset_t url_ftell(ByteIOContext *s) 185. { 186. return url_fseek(s, 0, SEEK_CUR); ^ 187. } 188. libavformat/nutdec.c:459:5: Assignment 457. int64_t end, tmp; 458. 459. nut->last_syncpoint_pos= url_ftell(bc)-8; ^ 460. 461. end= get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE); libavformat/nutdec.c:465:45: <RHS trace> 463. 464. tmp= ff_get_v(bc); 465. *back_ptr= nut->last_syncpoint_pos - 16*ff_get_v(bc); ^ 466. if(*back_ptr < 0) 467. return -1; libavformat/nutdec.c:465:45: Call 463. 464. tmp= ff_get_v(bc); 465. *back_ptr= nut->last_syncpoint_pos - 16*ff_get_v(bc); ^ 466. if(*back_ptr < 0) 467. return -1; libavformat/aviobuf.c:506:5: Assignment 504. 505. uint64_t ff_get_v(ByteIOContext *bc){ 506. uint64_t val = 0; ^ 507. int tmp; 508. libavformat/aviobuf.c:511:9: Assignment 509. do{ 510. tmp = get_byte(bc); 511. val= (val<<7) + (tmp&127); ^ 512. }while(tmp&128); 513. return val; libavformat/aviobuf.c:513:5: Assignment 511. val= (val<<7) + (tmp&127); 512. }while(tmp&128); 513. return val; ^ 514. } 515. libavformat/nutdec.c:465:5: Binary operation: ([-oo, -8] - [0, +oo]):unsigned64 463. 464. tmp= ff_get_v(bc); 465. *back_ptr= nut->last_syncpoint_pos - 16*ff_get_v(bc); ^ 466. if(*back_ptr < 0) 467. return -1;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/nutdec.c/#L465
d2a_code_trace_data_42041
static int pcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) { PCMDecode *s = avctx->priv_data; int c, n; short *samples; const uint8_t *src, *src2[MAX_CHANNELS]; samples = data; src = buf; n= av_get_bits_per_sample(avctx->codec_id)/8; if(n && buf_size % n){ av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n"); return -1; } if(avctx->channels <= 0 || avctx->channels > MAX_CHANNELS){ av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n"); return -1; } buf_size= FFMIN(buf_size, *data_size/2); *data_size=0; n = buf_size/avctx->channels; for(c=0;c<avctx->channels;c++) src2[c] = &src[c*n]; switch(avctx->codec->id) { case CODEC_ID_PCM_S32LE: decode_to16(4, 1, 0, &src, &samples, buf_size); break; case CODEC_ID_PCM_S32BE: decode_to16(4, 0, 0, &src, &samples, buf_size); break; case CODEC_ID_PCM_U32LE: decode_to16(4, 1, 1, &src, &samples, buf_size); break; case CODEC_ID_PCM_U32BE: decode_to16(4, 0, 1, &src, &samples, buf_size); break; case CODEC_ID_PCM_S24LE: decode_to16(3, 1, 0, &src, &samples, buf_size); break; case CODEC_ID_PCM_S24BE: decode_to16(3, 0, 0, &src, &samples, buf_size); break; case CODEC_ID_PCM_U24LE: decode_to16(3, 1, 1, &src, &samples, buf_size); break; case CODEC_ID_PCM_U24BE: decode_to16(3, 0, 1, &src, &samples, buf_size); break; case CODEC_ID_PCM_S24DAUD: n = buf_size / 3; for(;n>0;n--) { uint32_t v = bytestream_get_be24(&src); v >>= 4; *samples++ = ff_reverse[(v >> 8) & 0xff] + (ff_reverse[v & 0xff] << 8); } break; case CODEC_ID_PCM_S16LE: n = buf_size >> 1; for(;n>0;n--) { *samples++ = bytestream_get_le16(&src); } break; case CODEC_ID_PCM_S16LE_PLANAR: for(n>>=1;n>0;n--) for(c=0;c<avctx->channels;c++) *samples++ = bytestream_get_le16(&src2[c]); src = src2[avctx->channels-1]; break; case CODEC_ID_PCM_S16BE: n = buf_size >> 1; for(;n>0;n--) { *samples++ = bytestream_get_be16(&src); } break; case CODEC_ID_PCM_U16LE: n = buf_size >> 1; for(;n>0;n--) { *samples++ = bytestream_get_le16(&src) - 0x8000; } break; case CODEC_ID_PCM_U16BE: n = buf_size >> 1; for(;n>0;n--) { *samples++ = bytestream_get_be16(&src) - 0x8000; } break; case CODEC_ID_PCM_S8: n = buf_size; for(;n>0;n--) { *samples++ = *src++ << 8; } break; case CODEC_ID_PCM_U8: n = buf_size; for(;n>0;n--) { *samples++ = ((int)*src++ - 128) << 8; } break; case CODEC_ID_PCM_ZORK: n = buf_size; for(;n>0;n--) { int x= *src++; if(x&128) x-= 128; else x = -x; *samples++ = x << 8; } break; case CODEC_ID_PCM_ALAW: case CODEC_ID_PCM_MULAW: n = buf_size; for(;n>0;n--) { *samples++ = s->table[*src++]; } break; default: return -1; } *data_size = (uint8_t *)samples - (uint8_t *)data; return src - buf; } libavcodec/pcm.c:447: error: Uninitialized Value The value read from src2[_] was never initialized. libavcodec/pcm.c:447:9: 445. for(c=0;c<avctx->channels;c++) 446. *samples++ = bytestream_get_le16(&src2[c]); 447. src = src2[avctx->channels-1]; ^ 448. break; 449. case CODEC_ID_PCM_S16BE:
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/pcm.c/#L447
d2a_code_trace_data_42042
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:891: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:891:9: 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. } 893. return dmin;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L891
d2a_code_trace_data_42043
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/ec/ecdsa_ossl.c:103: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `EC_POINT_mul`. Showing all 29 steps of the trace crypto/ec/ecdsa_ossl.c:77:10: Call 75. /* Preallocate space */ 76. order_bits = BN_num_bits(order); 77. if (!BN_set_bit(k, order_bits) ^ 78. || !BN_set_bit(r, order_bits) 79. || !BN_set_bit(X, order_bits)) crypto/bn/bn_lib.c:594:1: Parameter `a->top` 592. } 593. 594. > int BN_set_bit(BIGNUM *a, int n) 595. { 596. int i, j, k; crypto/ec/ecdsa_ossl.c:100:18: Call 98. } 99. } 100. } while (BN_is_zero(k)); ^ 101. 102. /* compute r the x-coordinate of generator * k */ crypto/bn/bn_lib.c:852:1: Parameter `a->top` 850. } 851. 852. > int BN_is_zero(const BIGNUM *a) 853. { 854. return a->top == 0; crypto/ec/ecdsa_ossl.c:103:14: Call 101. 102. /* compute r the x-coordinate of generator * k */ 103. if (!EC_POINT_mul(group, tmp_point, k, NULL, NULL, ctx)) { ^ 104. ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB); 105. goto err; crypto/ec/ec_lib.c:956:1: Parameter `r->X->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 `r->X->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 `r->X->top` 408. * in the addition if scalar != NULL 409. */ 410. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 411. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 412. BN_CTX *ctx) crypto/ec/ec_mult.c:453:20: Call 451. * always call the ladder version. 452. */ 453. return ec_scalar_mul_ladder(group, r, scalar, NULL, ctx); ^ 454. } 455. if ((scalar == NULL) && (num == 1)) { crypto/ec/ec_mult.c:139:1: Parameter `r->X->top` 137. * Returns 1 on success, 0 otherwise. 138. */ 139. > int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r, 140. const BIGNUM *scalar, const EC_POINT *point, 141. BN_CTX *ctx) crypto/ec/ec_mult.c:253:13: Call 251. || (bn_wexpand(s->Y, group_top) == NULL) 252. || (bn_wexpand(s->Z, group_top) == NULL) 253. || (bn_wexpand(r->X, group_top) == NULL) ^ 254. || (bn_wexpand(r->Y, group_top) == NULL) 255. || (bn_wexpand(r->Z, group_top) == NULL) crypto/bn/bn_lib.c: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 `EC_POINT_mul` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_42044
ngx_int_t ngx_http_internal_redirect(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args) { ngx_http_core_srv_conf_t *cscf; r->uri_changes--; if (r->uri_changes == 0) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "rewrite or internal redirection cycle " "while internally redirecting to \"%V\"", uri); r->main->count++; ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return NGX_DONE; } r->uri = *uri; if (args) { r->args = *args; } else { ngx_str_null(&r->args); } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "internal redirect: \"%V?%V\"", uri, &r->args); ngx_http_set_exten(r); ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); r->loc_conf = cscf->ctx->loc_conf; ngx_http_update_location_config(r); #if (NGX_HTTP_CACHE) r->cache = NULL; #endif r->internal = 1; r->valid_unparsed_uri = 0; r->add_uri_to_alias = 0; r->main->count++; ngx_http_handler(r); return NGX_DONE; } src/http/ngx_http_core_module.c:1287: error: Integer Overflow L2 ([0, -1+max(1, `r->uri_changes`)] - 1):unsigned32 by call to `ngx_http_finalize_request`. src/http/ngx_http_core_module.c:1161:1: Parameter `r->uri_changes` 1159. 1160. 1161. ngx_int_t ^ 1162. ngx_http_core_try_files_phase(ngx_http_request_t *r, 1163. ngx_http_phase_handler_t *ph) src/http/ngx_http_core_module.c:1279:24: Call 1277. 1278. if (path.data[0] == '@') { 1279. (void) ngx_http_named_location(r, &path); ^ 1280. 1281. } else { src/http/ngx_http_core_module.c:2519:1: Parameter `r->uri_changes` 2517. 2518. 2519. ngx_int_t ^ 2520. ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name) 2521. { src/http/ngx_http_core_module.c:2527:5: Assignment 2525. 2526. r->main->count++; 2527. r->uri_changes--; ^ 2528. 2529. if (r->uri_changes == 0) { src/http/ngx_http_core_module.c:1287:13: Call 1285. } 1286. 1287. ngx_http_finalize_request(r, NGX_DONE); ^ 1288. return NGX_OK; 1289. } src/http/ngx_http_request.c:1912:1: Parameter `r->uri_changes` 1910. 1911. 1912. void ^ 1913. ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) 1914. { src/http/ngx_http_request.c:1951:13: Call 1949. || c->error) 1950. { 1951. if (ngx_http_post_action(r) == NGX_OK) { ^ 1952. return; 1953. } src/http/ngx_http_request.c:2920:1: Parameter `r->uri_changes` 2918. 2919. 2920. static ngx_int_t ^ 2921. ngx_http_post_action(ngx_http_request_t *r) 2922. { src/http/ngx_http_request.c:2947:9: Call 2945. 2946. if (clcf->post_action.data[0] == '/') { 2947. ngx_http_internal_redirect(r, &clcf->post_action, NULL); ^ 2948. 2949. } else { src/http/ngx_http_core_module.c:2464:1: <LHS trace> 2462. 2463. 2464. ngx_int_t ^ 2465. ngx_http_internal_redirect(ngx_http_request_t *r, 2466. ngx_str_t *uri, ngx_str_t *args) src/http/ngx_http_core_module.c:2464:1: Parameter `r->uri_changes` 2462. 2463. 2464. ngx_int_t ^ 2465. ngx_http_internal_redirect(ngx_http_request_t *r, 2466. ngx_str_t *uri, ngx_str_t *args) src/http/ngx_http_core_module.c:2470:5: Binary operation: ([0, -1+max(1, r->uri_changes)] - 1):unsigned32 by call to `ngx_http_finalize_request` 2468. ngx_http_core_srv_conf_t *cscf; 2469. 2470. r->uri_changes--; ^ 2471. 2472. if (r->uri_changes == 0) {
https://github.com/nginx/nginx/blob/8cb7134f49bcdded469b3e72415b96794190257e/src/http/ngx_http_core_module.c/#L2470
d2a_code_trace_data_42045
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/h263dec.c:618: error: Integer Overflow L2 ([1, 2147483616] + 32):signed32 by call to `av_frame_ref`. libavcodec/h263dec.c:616:5: Unknown value from: __infer_skip 614. assert(s->current_picture.f.pict_type == 615. s->current_picture_ptr->f.pict_type); 616. assert(s->current_picture.f.pict_type == s->pict_type); ^ 617. if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { 618. if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0) libavcodec/h263dec.c:618:20: Call 616. assert(s->current_picture.f.pict_type == s->pict_type); 617. if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { 618. if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0) ^ 619. return ret; 620. ff_print_debug_info(s, s->current_picture_ptr); 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_42046
static char * ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf) { ngx_int_t rc, index; ngx_str_t *value, name; ngx_uint_t i, key; ngx_http_map_conf_ctx_t *ctx; ngx_http_variable_value_t *var, **vp; ctx = cf->ctx; value = cf->args->elts; if (cf->args->nelts == 1 && ngx_strcmp(value[0].data, "hostnames") == 0) { ctx->hostnames = 1; return NGX_CONF_OK; } else if (cf->args->nelts != 2) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid number of the map parameters"); return NGX_CONF_ERROR; } if (ngx_strcmp(value[0].data, "include") == 0) { return ngx_conf_include(cf, dummy, conf); } if (value[1].data[0] == '$') { name = value[1]; name.len--; name.data++; index = ngx_http_get_variable_index(ctx->cf, &name); if (index == NGX_ERROR) { return NGX_CONF_ERROR; } var = ctx->var_values.elts; for (i = 0; i < ctx->var_values.nelts; i++) { if (index == (ngx_int_t) var[i].data) { var = &var[i]; goto found; } } var = ngx_array_push(&ctx->var_values); if (var == NULL) { return NGX_CONF_ERROR; } var->valid = 0; var->no_cacheable = 0; var->not_found = 0; var->len = 0; var->data = (u_char *) index; goto found; } key = 0; for (i = 0; i < value[1].len; i++) { key = ngx_hash(key, value[1].data[i]); } key %= ctx->keys.hsize; vp = ctx->values_hash[key].elts; if (vp) { for (i = 0; i < ctx->values_hash[key].nelts; i++) { if (value[1].len != (size_t) vp[i]->len) { continue; } if (ngx_strncmp(value[1].data, vp[i]->data, value[1].len) == 0) { var = vp[i]; goto found; } } } else { if (ngx_array_init(&ctx->values_hash[key], cf->pool, 4, sizeof(ngx_http_variable_value_t *)) != NGX_OK) { return NGX_CONF_ERROR; } } var = ngx_palloc(ctx->keys.pool, sizeof(ngx_http_variable_value_t)); if (var == NULL) { return NGX_CONF_ERROR; } var->len = value[1].len; var->data = ngx_pstrdup(ctx->keys.pool, &value[1]); if (var->data == NULL) { return NGX_CONF_ERROR; } var->valid = 1; var->no_cacheable = 0; var->not_found = 0; vp = ngx_array_push(&ctx->values_hash[key]); if (vp == NULL) { return NGX_CONF_ERROR; } *vp = var; found: if (ngx_strcmp(value[0].data, "default") == 0) { if (ctx->default_value) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "duplicate default map parameter"); return NGX_CONF_ERROR; } ctx->default_value = var; return NGX_CONF_OK; } #if (NGX_PCRE) if (value[0].len && value[0].data[0] == '~') { ngx_regex_compile_t rc; ngx_http_map_regex_t *regex; u_char errstr[NGX_MAX_CONF_ERRSTR]; regex = ngx_array_push(&ctx->regexes); if (regex == NULL) { return NGX_CONF_ERROR; } value[0].len--; value[0].data++; ngx_memzero(&rc, sizeof(ngx_regex_compile_t)); if (value[0].data[0] == '*') { value[0].len--; value[0].data++; rc.options = NGX_REGEX_CASELESS; } rc.pattern = value[0]; rc.err.len = NGX_MAX_CONF_ERRSTR; rc.err.data = errstr; regex->regex = ngx_http_regex_compile(ctx->cf, &rc); if (regex->regex == NULL) { return NGX_CONF_ERROR; } regex->value = var; return NGX_CONF_OK; } #endif if (value[0].len && value[0].data[0] == '\\') { value[0].len--; value[0].data++; } rc = ngx_hash_add_key(&ctx->keys, &value[0], var, (ctx->hostnames) ? NGX_HASH_WILDCARD_KEY : 0); if (rc == NGX_OK) { return NGX_CONF_OK; } if (rc == NGX_DECLINED) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid hostname or wildcard \"%V\"", &value[0]); } if (rc == NGX_BUSY) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "conflicting parameter \"%V\"", &value[0]); } return NGX_CONF_ERROR; } src/http/modules/ngx_http_map_module.c:516: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64. src/http/modules/ngx_http_map_module.c:393:9: <LHS trace> 391. } 392. 393. if (ngx_strcmp(value[0].data, "include") == 0) { ^ 394. return ngx_conf_include(cf, dummy, conf); 395. } src/http/modules/ngx_http_map_module.c:393:9: Unknown value from: strcmp 391. } 392. 393. if (ngx_strcmp(value[0].data, "include") == 0) { ^ 394. return ngx_conf_include(cf, dummy, conf); 395. } src/http/modules/ngx_http_map_module.c:510:9: Assignment 508. } 509. 510. value[0].len--; ^ 511. value[0].data++; 512. src/http/modules/ngx_http_map_module.c:516:13: Binary operation: ([0, +oo] - 1):unsigned64 514. 515. if (value[0].data[0] == '*') { 516. value[0].len--; ^ 517. value[0].data++; 518. rc.options = NGX_REGEX_CASELESS;
https://github.com/nginx/nginx/blob/7ee8de668c4a3d337eb3997a258e4e40adaf069c/src/http/modules/ngx_http_map_module.c/#L516
d2a_code_trace_data_42047
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return NULL; } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return ret; } ssl/ssl_sess.c:731: error: INTEGER_OVERFLOW_L2 ([0, 1+max(0, `ctx->sessions->num_items`)] - 1):unsigned64 by call to `remove_session_lock`. Showing all 13 steps of the trace ssl/ssl_sess.c:665:1: Parameter `ctx->sessions->num_items` 663. } 664. 665. > int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c) 666. { 667. int ret = 0; ssl/ssl_sess.c:681:9: Call 679. 680. CRYPTO_THREAD_write_lock(ctx->lock); 681. s = lh_SSL_SESSION_insert(ctx->sessions, c); ^ 682. 683. /* ssl/ssl_locl.h:728:1: Parameter `lh->num_items` 726. } TLSEXT_INDEX; 727. 728. > DEFINE_LHASH_OF(SSL_SESSION); 729. /* Needed in ssl_cert.c */ 730. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:728:1: Call 726. } TLSEXT_INDEX; 727. 728. > DEFINE_LHASH_OF(SSL_SESSION); 729. /* Needed in ssl_cert.c */ 730. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:94:1: Parameter `lh->num_items` 92. } 93. 94. > void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data) 95. { 96. unsigned long hash; ssl/ssl_sess.c:731:22: Call 729. if (SSL_CTX_sess_get_cache_size(ctx) > 0) { 730. while (SSL_CTX_sess_number(ctx) > SSL_CTX_sess_get_cache_size(ctx)) { 731. if (!remove_session_lock(ctx, ctx->session_cache_tail, 0)) ^ 732. break; 733. else ssl/ssl_sess.c:747:1: Parameter `ctx->sessions->num_items` 745. } 746. 747. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 748. { 749. SSL_SESSION *r; ssl/ssl_sess.c:757:17: Call 755. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) { 756. ret = 1; 757. r = lh_SSL_SESSION_delete(ctx->sessions, r); ^ 758. SSL_SESSION_list_remove(ctx, r); 759. } ssl/ssl_locl.h:728:1: Parameter `lh->num_items` 726. } TLSEXT_INDEX; 727. 728. > DEFINE_LHASH_OF(SSL_SESSION); 729. /* Needed in ssl_cert.c */ 730. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:728:1: Call 726. } TLSEXT_INDEX; 727. 728. > DEFINE_LHASH_OF(SSL_SESSION); 729. /* Needed in ssl_cert.c */ 730. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:126:1: <LHS trace> 124. } 125. 126. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 127. { 128. unsigned long hash; crypto/lhash/lhash.c:126:1: Parameter `lh->num_items` 124. } 125. 126. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 127. { 128. unsigned long hash; crypto/lhash/lhash.c:146:5: Binary operation: ([0, 1+max(0, ctx->sessions->num_items)] - 1):unsigned64 by call to `remove_session_lock` 144. } 145. 146. lh->num_items--; ^ 147. if ((lh->num_nodes > MIN_NODES) && 148. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/b5ee517794cf546dc7e3d5a82b400955a7381053/crypto/lhash/lhash.c/#L146
d2a_code_trace_data_42048
static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track) { MOVStts *ctts_entries; uint32_t entries = 0; uint32_t atom_size; int i; ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); ctts_entries[0].count = 1; ctts_entries[0].duration = track->cluster[0].cts; for (i = 1; i < track->entry; i++) { if (track->cluster[i].cts == ctts_entries[entries].duration) { ctts_entries[entries].count++; } else { entries++; ctts_entries[entries].duration = track->cluster[i].cts; ctts_entries[entries].count = 1; } } entries++; atom_size = 16 + (entries * 8); avio_wb32(pb, atom_size); ffio_wfourcc(pb, "ctts"); avio_wb32(pb, 0); avio_wb32(pb, entries); for (i = 0; i < entries; i++) { avio_wb32(pb, ctts_entries[i].count); avio_wb32(pb, ctts_entries[i].duration); } av_free(ctts_entries); return atom_size; } libavformat/movenc.c:1136: error: Null Dereference pointer `ctts_entries` last assigned on line 1135 could be null and is dereferenced at line 1136, column 5. libavformat/movenc.c:1128:1: start of procedure mov_write_ctts_tag() 1126. } 1127. 1128. static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track) ^ 1129. { 1130. MOVStts *ctts_entries; libavformat/movenc.c:1131:5: 1129. { 1130. MOVStts *ctts_entries; 1131. uint32_t entries = 0; ^ 1132. uint32_t atom_size; 1133. int i; libavformat/movenc.c:1135:5: 1133. int i; 1134. 1135. ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */ ^ 1136. ctts_entries[0].count = 1; 1137. ctts_entries[0].duration = track->cluster[0].cts; libavutil/mem.c:62:1: start of procedure av_malloc() 60. * linker will do it automatically. */ 61. 62. void *av_malloc(size_t size) ^ 63. { 64. void *ptr = NULL; libavutil/mem.c:64:5: 62. void *av_malloc(size_t size) 63. { 64. void *ptr = NULL; ^ 65. #if CONFIG_MEMALIGN_HACK 66. long diff; libavutil/mem.c:70:9: Taking true branch 68. 69. /* let's disallow possibly ambiguous cases */ 70. if (size > (INT_MAX - 32) || !size) ^ 71. return NULL; 72. libavutil/mem.c:71:9: 69. /* let's disallow possibly ambiguous cases */ 70. if (size > (INT_MAX - 32) || !size) 71. return NULL; ^ 72. 73. #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) libavformat/movenc.c:1136:5: 1134. 1135. ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */ 1136. ctts_entries[0].count = 1; ^ 1137. ctts_entries[0].duration = track->cluster[0].cts; 1138. for (i = 1; i < track->entry; i++) {
https://github.com/libav/libav/blob/558b20d729bc296d8e6a69f03cd509ad26a4827d/libavformat/movenc.c/#L1136
d2a_code_trace_data_42049
static char *make_config_name(void) { const char *t; size_t len; char *p; if ((t = getenv("OPENSSL_CONF")) != NULL) return OPENSSL_strdup(t); t = X509_get_default_cert_area(); len = strlen(t) + 1 + strlen(OPENSSL_CONF) + 1; p = app_malloc(len, "config filename buffer"); strcpy(p, t); #ifndef OPENSSL_SYS_VMS strcat(p, "/"); #endif strcat(p, OPENSSL_CONF); return p; } apps/openssl.c:111: error: NULL_DEREFERENCE pointer `p` last assigned on line 110 could be null and is dereferenced by call to `strcpy()` at line 111, column 5. Showing all 25 steps of the trace apps/openssl.c:99:1: start of procedure make_config_name() 97. } 98. 99. > static char *make_config_name(void) 100. { 101. const char *t; apps/openssl.c:105:9: Taking false branch 103. char *p; 104. 105. if ((t = getenv("OPENSSL_CONF")) != NULL) ^ 106. return OPENSSL_strdup(t); 107. apps/openssl.c:108:5: 106. return OPENSSL_strdup(t); 107. 108. > t = X509_get_default_cert_area(); 109. len = strlen(t) + 1 + strlen(OPENSSL_CONF) + 1; 110. p = app_malloc(len, "config filename buffer"); crypto/x509/x509_def.c:20:1: start of procedure X509_get_default_cert_area() 18. } 19. 20. > const char *X509_get_default_cert_area(void) 21. { 22. return X509_CERT_AREA; crypto/x509/x509_def.c:22:5: 20. const char *X509_get_default_cert_area(void) 21. { 22. > return X509_CERT_AREA; 23. } 24. crypto/x509/x509_def.c:23:1: return from a call to X509_get_default_cert_area 21. { 22. return X509_CERT_AREA; 23. > } 24. 25. const char *X509_get_default_cert_dir(void) apps/openssl.c:109:5: 107. 108. t = X509_get_default_cert_area(); 109. > len = strlen(t) + 1 + strlen(OPENSSL_CONF) + 1; 110. p = app_malloc(len, "config filename buffer"); 111. strcpy(p, t); apps/openssl.c:110:5: 108. t = X509_get_default_cert_area(); 109. len = strlen(t) + 1 + strlen(OPENSSL_CONF) + 1; 110. > p = app_malloc(len, "config filename buffer"); 111. strcpy(p, t); 112. #ifndef OPENSSL_SYS_VMS test/testutil/apps_mem.c:14:1: start of procedure app_malloc() 12. /* shim that avoids sucking in too much from apps/apps.c */ 13. 14. > void* app_malloc(int sz, const char *what) 15. { 16. void *vp = OPENSSL_malloc(sz); test/testutil/apps_mem.c:16:5: 14. void* app_malloc(int sz, const char *what) 15. { 16. > void *vp = OPENSSL_malloc(sz); 17. 18. return vp; crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking true 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:197:32: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) test/testutil/apps_mem.c:18:5: 16. void *vp = OPENSSL_malloc(sz); 17. 18. > return vp; 19. } test/testutil/apps_mem.c:19:1: return from a call to app_malloc 17. 18. return vp; 19. > } apps/openssl.c:111:5: 109. len = strlen(t) + 1 + strlen(OPENSSL_CONF) + 1; 110. p = app_malloc(len, "config filename buffer"); 111. > strcpy(p, t); 112. #ifndef OPENSSL_SYS_VMS 113. strcat(p, "/");
https://github.com/openssl/openssl/blob/ce506d27ab5e7d17dfe3fe649768a0d19b6c86ee/apps/openssl.c/#L111
d2a_code_trace_data_42050
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; return 1; } ssl/t1_lib.c:1080: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + `s->tlsext_hostname->strlen` + 28]):unsigned64 by call to `WPACKET_memcpy`. Showing all 12 steps of the trace ssl/t1_lib.c:1077:21: Call 1075. /* Sub-packet for SRP extension */ 1076. || !WPACKET_start_sub_packet_u16(pkt) 1077. || !WPACKET_start_sub_packet_u8(pkt) ^ 1078. /* login must not be zero...internal error if so */ 1079. || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH) ssl/packet.c:224:1: Parameter `pkt->buf->length` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/t1_lib.c:1080:21: Call 1078. /* login must not be zero...internal error if so */ 1079. || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH) 1080. || !WPACKET_memcpy(pkt, s->srp_ctx.login, ^ 1081. strlen(s->srp_ctx.login)) 1082. || !WPACKET_close(pkt) ssl/packet.c:302:1: Parameter `pkt->written` 300. } 301. 302. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 303. { 304. unsigned char *dest; ssl/packet.c:309:10: Call 307. return 1; 308. 309. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 310. return 0; 311. ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [0, s->s3->previous_client_finished_len + pkt->written + s->tlsext_hostname->strlen + 28]):unsigned64 by call to `WPACKET_memcpy` 44. return 0; 45. 46. if (pkt->buf->length - pkt->written < len) { ^ 47. size_t newlen; 48. size_t reflen;
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
d2a_code_trace_data_42051
static ossl_inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } test/packettest.c:74: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 247):unsigned64 by call to `PACKET_forward`. Showing all 14 steps of the trace test/packettest.c:71:10: Call 69. PACKET pkt; 70. 71. if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN)) ^ 72. || !TEST_true(PACKET_get_4(&pkt, &i)) 73. || !TEST_ulong_eq(i, 0x08060402UL) ssl/packet_locl.h:72:8: Parameter `pkt->remaining` 70. * is being used. 71. */ 72. __owur static ossl_inline int PACKET_buf_init(PACKET *pkt, ^ 73. const unsigned char *buf, 74. size_t len) test/packettest.c:72:17: Call 70. 71. if (!TEST_true(PACKET_buf_init(&pkt, smbuf, BUF_LEN)) 72. || !TEST_true(PACKET_get_4(&pkt, &i)) ^ 73. || !TEST_ulong_eq(i, 0x08060402UL) 74. || !TEST_true(PACKET_forward(&pkt, BUF_LEN - 8)) ssl/packet_locl.h:316:8: Parameter `pkt->remaining` 314. * |*data| 315. */ 316. __owur static ossl_inline int PACKET_get_4(PACKET *pkt, unsigned long *data) ^ 317. { 318. if (!PACKET_peek_4(pkt, data)) ssl/packet_locl.h:318:10: Call 316. __owur static ossl_inline int PACKET_get_4(PACKET *pkt, unsigned long *data) 317. { 318. if (!PACKET_peek_4(pkt, data)) ^ 319. return 0; 320. ssl/packet_locl.h:297:8: Parameter `pkt->remaining` 295. * in |*data| 296. */ 297. __owur static ossl_inline int PACKET_peek_4(const PACKET *pkt, ^ 298. unsigned long *data) 299. { test/packettest.c:74:17: Call 72. || !TEST_true(PACKET_get_4(&pkt, &i)) 73. || !TEST_ulong_eq(i, 0x08060402UL) 74. || !TEST_true(PACKET_forward(&pkt, BUF_LEN - 8)) ^ 75. || !TEST_true(PACKET_get_4(&pkt, &i)) 76. || !TEST_ulong_eq(i, 0xfefcfaf8UL) ssl/packet_locl.h:467:8: Parameter `len` 465. 466. /* Move the current reading position forward |len| bytes */ 467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len) ^ 468. { 469. if (PACKET_remaining(pkt) < len) ssl/packet_locl.h:472:5: Call 470. return 0; 471. 472. packet_forward(pkt, len); ^ 473. 474. return 1; ssl/packet_locl.h:33:1: <LHS trace> 31. 32. /* Internal unchecked shorthand; don't use outside this file. */ 33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len) 34. { 35. pkt->curr += len; ssl/packet_locl.h:33:1: Parameter `pkt->remaining` 31. 32. /* Internal unchecked shorthand; don't use outside this file. */ 33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len) 34. { 35. pkt->curr += len; ssl/packet_locl.h:33:1: <RHS trace> 31. 32. /* Internal unchecked shorthand; don't use outside this file. */ 33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len) 34. { 35. pkt->curr += len; ssl/packet_locl.h:33:1: Parameter `len` 31. 32. /* Internal unchecked shorthand; don't use outside this file. */ 33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len) 34. { 35. pkt->curr += len; ssl/packet_locl.h:36:5: Binary operation: ([0, +oo] - 247):unsigned64 by call to `PACKET_forward` 34. { 35. pkt->curr += len; 36. pkt->remaining -= len; ^ 37. } 38.
https://github.com/openssl/openssl/blob/424aa352458486d67e1e9cd3d3990dc06a60ba4a/ssl/packet_locl.h/#L36
d2a_code_trace_data_42052
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size) { void **p = ptr; if (min_size < *size) return; min_size= FFMAX(17*min_size/16 + 32, min_size); av_free(*p); *p = av_malloc(min_size); if (!*p) min_size = 0; *size= min_size; } libavcodec/utils.c:91: error: Integer Overflow L2 (17 × [`min_size` + 8, 8+min(18446744073709551607, `min_size`)]):unsigned64 by call to `av_fast_malloc`. libavcodec/utils.c:83:1: Parameter `min_size` 81. } 82. 83. void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size) ^ 84. { 85. void **p = ptr; libavcodec/utils.c:91:5: Call 89. return; 90. } 91. av_fast_malloc(p, size, min_size + FF_INPUT_BUFFER_PADDING_SIZE); ^ 92. if (*size) 93. memset((uint8_t *)*p + min_size, 0, FF_INPUT_BUFFER_PADDING_SIZE); libavcodec/utils.c:71:1: <RHS trace> 69. } 70. 71. void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size) ^ 72. { 73. void **p = ptr; libavcodec/utils.c:71:1: Parameter `min_size` 69. } 70. 71. void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size) ^ 72. { 73. void **p = ptr; libavcodec/utils.c:76:15: Binary operation: (17 × [min_size + 8, 8+min(18446744073709551607, min_size)]):unsigned64 by call to `av_fast_malloc` 74. if (min_size < *size) 75. return; 76. min_size= FFMAX(17*min_size/16 + 32, min_size); ^ 77. av_free(*p); 78. *p = av_malloc(min_size);
https://github.com/libav/libav/blob/0880503fbbd68bf6b1352488944020e3ec35c2e4/libavcodec/utils.c/#L76
d2a_code_trace_data_42053
DH *ssl_get_auto_dh(SSL *s) { int dh_secbits = 80; if (s->cert->dh_tmp_auto == 2) return DH_get_1024_160(); if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { if (s->s3->tmp.new_cipher->strength_bits == 256) dh_secbits = 128; else dh_secbits = 80; } else { CERT_PKEY *cpk = ssl_get_server_send_pkey(s); dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); } if (dh_secbits >= 128) { DH *dhp = DH_new(); if (!dhp) return NULL; dhp->g = BN_new(); if (dhp->g) BN_set_word(dhp->g, 2); if (dh_secbits >= 192) dhp->p = get_rfc3526_prime_8192(NULL); else dhp->p = get_rfc3526_prime_3072(NULL); if (!dhp->p || !dhp->g) { DH_free(dhp); return NULL; } return dhp; } if (dh_secbits >= 112) return DH_get_2048_224(); return DH_get_1024_160(); } ssl/t1_lib.c:4213: error: NULL_DEREFERENCE pointer `cpk` last assigned on line 4212 could be null and is dereferenced at line 4213, column 45. Showing all 15 steps of the trace ssl/t1_lib.c:4201:1: start of procedure ssl_get_auto_dh() 4199. 4200. #ifndef OPENSSL_NO_DH 4201. > DH *ssl_get_auto_dh(SSL *s) 4202. { 4203. int dh_secbits = 80; ssl/t1_lib.c:4203:5: 4201. DH *ssl_get_auto_dh(SSL *s) 4202. { 4203. > int dh_secbits = 80; 4204. if (s->cert->dh_tmp_auto == 2) 4205. return DH_get_1024_160(); ssl/t1_lib.c:4204:9: Taking false branch 4202. { 4203. int dh_secbits = 80; 4204. if (s->cert->dh_tmp_auto == 2) ^ 4205. return DH_get_1024_160(); 4206. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ssl/t1_lib.c:4206:9: Taking false branch 4204. if (s->cert->dh_tmp_auto == 2) 4205. return DH_get_1024_160(); 4206. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ^ 4207. if (s->s3->tmp.new_cipher->strength_bits == 256) 4208. dh_secbits = 128; ssl/t1_lib.c:4212:9: 4210. dh_secbits = 80; 4211. } else { 4212. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 4213. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 4214. } ssl/ssl_lib.c:2208:1: start of procedure ssl_get_server_send_pkey() 2206. } 2207. 2208. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s) 2209. { 2210. CERT *c; ssl/ssl_lib.c:2213:5: 2211. int i; 2212. 2213. > c = s->cert; 2214. if (!s->s3 || !s->s3->tmp.new_cipher) 2215. return NULL; ssl/ssl_lib.c:2214:10: Taking false branch 2212. 2213. c = s->cert; 2214. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2215. return NULL; 2216. ssl_set_masks(s, s->s3->tmp.new_cipher); ssl/ssl_lib.c:2214:20: Taking false branch 2212. 2213. c = s->cert; 2214. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2215. return NULL; 2216. ssl_set_masks(s, s->s3->tmp.new_cipher); ssl/ssl_lib.c:2216:5: Skipping ssl_set_masks(): empty list of specs 2214. if (!s->s3 || !s->s3->tmp.new_cipher) 2215. return NULL; 2216. ssl_set_masks(s, s->s3->tmp.new_cipher); ^ 2217. 2218. #ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL ssl/ssl_lib.c:2227:5: Skipping ssl_get_server_cert_index(): empty list of specs 2225. #endif 2226. 2227. i = ssl_get_server_cert_index(s); ^ 2228. 2229. /* This may or may not be an error. */ ssl/ssl_lib.c:2230:9: Taking true branch 2228. 2229. /* This may or may not be an error. */ 2230. if (i < 0) ^ 2231. return NULL; 2232. ssl/ssl_lib.c:2231:9: 2229. /* This may or may not be an error. */ 2230. if (i < 0) 2231. > return NULL; 2232. 2233. /* May be NULL. */ ssl/ssl_lib.c:2235:1: return from a call to ssl_get_server_send_pkey 2233. /* May be NULL. */ 2234. return &c->pkeys[i]; 2235. > } 2236. 2237. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, ssl/t1_lib.c:4213:9: 4211. } else { 4212. CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 4213. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 4214. } 4215.
https://github.com/openssl/openssl/blob/eb647452eb73be491521980f45582c63f7194521/ssl/t1_lib.c/#L4213