id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_43954
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/dsa/dsa_key.c:41: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_priv_rand_range`. Showing all 24 steps of the trace crypto/dsa/dsa_key.c:25:1: Parameter `dsa->priv_key->top` 23. } 24. 25. > static int dsa_builtin_keygen(DSA *dsa) 26. { 27. int ok = 0; crypto/dsa/dsa_key.c:41:14: Call 39. 40. do 41. if (!BN_priv_rand_range(priv_key, dsa->q)) ^ 42. goto err; 43. while (BN_is_zero(priv_key)) ; crypto/bn/bn_rand.c:182:1: Parameter `r->top` 180. } 181. 182. > int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) 183. { 184. return bnrand_range(PRIVATE, r, range); crypto/bn/bn_rand.c:184:12: Call 182. int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) 183. { 184. return bnrand_range(PRIVATE, r, range); ^ 185. } 186. crypto/bn/bn_rand.c:113:1: Parameter `r->top` 111. 112. /* random number r: 0 <= r < range */ 113. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range) 114. { 115. int n; crypto/bn/bn_rand.c:128:9: Call 126. 127. if (n == 1) 128. BN_zero(r); ^ 129. else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) { 130. /* crypto/bn/bn_lib.c:357:1: Parameter `a->top` 355. } 356. 357. > int BN_set_word(BIGNUM *a, BN_ULONG w) 358. { 359. bn_check_top(a); crypto/bn/bn_lib.c:360:9: Call 358. { 359. bn_check_top(a); 360. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 361. return 0; 362. a->neg = 0; crypto/bn/bn_lcl.h:651:1: Parameter `a->top` 649. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 650. 651. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 652. { 653. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_lcl.h:659:12: Call 657. return a; 658. 659. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 660. } 661. crypto/bn/bn_lib.c:246:1: Parameter `b->top` 244. */ 245. 246. > BIGNUM *bn_expand2(BIGNUM *b, int words) 247. { 248. bn_check_top(b); crypto/bn/bn_lib.c:251:23: Call 249. 250. if (words > b->dmax) { 251. BN_ULONG *a = bn_expand_internal(b, words); ^ 252. if (!a) 253. return NULL; crypto/bn/bn_lib.c:208:1: <Offset trace> 206. /* This is used by bn_expand2() */ 207. /* The caller MUST check that words > b->dmax before calling this */ 208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 209. { 210. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:208:1: Parameter `b->top` 206. /* This is used by bn_expand2() */ 207. /* The caller MUST check that words > b->dmax before calling this */ 208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 209. { 210. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:208:1: <Length trace> 206. /* This is used by bn_expand2() */ 207. /* The caller MUST check that words > b->dmax before calling this */ 208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 209. { 210. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:208:1: Parameter `words` 206. /* This is used by bn_expand2() */ 207. /* The caller MUST check that words > b->dmax before calling this */ 208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 209. { 210. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:225:13: Call 223. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 224. else 225. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 226. if (a == NULL) { 227. 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:225:9: Assignment 223. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 224. else 225. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 226. if (a == NULL) { 227. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/bn/bn_lib.c:233:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_priv_rand_range` 231. assert(b->top <= words); 232. if (b->top > 0) 233. memcpy(a, b->d, sizeof(*a) * b->top); ^ 234. 235. return a;
https://github.com/openssl/openssl/blob/49cd47eaababc8c57871b929080fc1357e2ad7b8/crypto/bn/bn_lib.c/#L233
d2a_code_trace_data_43955
BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g) { BN_CTX *bn_ctx; BIGNUM *A = NULL; if (a == NULL || N == NULL || g == NULL || (bn_ctx = BN_CTX_new()) == NULL) return NULL; if ((A = BN_new()) != NULL && !BN_mod_exp(A, g, a, N, bn_ctx)) { BN_free(A); A = NULL; } BN_CTX_free(bn_ctx); return A; } crypto/srp/srp_lib.c:250: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 249, column 14 is not reachable after line 250, column 9. Showing all 74 steps of the trace crypto/srp/srp_lib.c:241:1: start of procedure SRP_Calc_A() 239. } 240. 241. > BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g) 242. { 243. BN_CTX *bn_ctx; crypto/srp/srp_lib.c:244:5: 242. { 243. BN_CTX *bn_ctx; 244. > BIGNUM *A = NULL; 245. 246. if (a == NULL || N == NULL || g == NULL || (bn_ctx = BN_CTX_new()) == NULL) crypto/srp/srp_lib.c:246:9: Taking false branch 244. BIGNUM *A = NULL; 245. 246. if (a == NULL || N == NULL || g == NULL || (bn_ctx = BN_CTX_new()) == NULL) ^ 247. return NULL; 248. crypto/srp/srp_lib.c:246:22: Taking false branch 244. BIGNUM *A = NULL; 245. 246. if (a == NULL || N == NULL || g == NULL || (bn_ctx = BN_CTX_new()) == NULL) ^ 247. return NULL; 248. crypto/srp/srp_lib.c:246:35: Taking false branch 244. BIGNUM *A = NULL; 245. 246. if (a == NULL || N == NULL || g == NULL || (bn_ctx = BN_CTX_new()) == NULL) ^ 247. return NULL; 248. crypto/srp/srp_lib.c:246:48: 244. BIGNUM *A = NULL; 245. 246. > if (a == NULL || N == NULL || g == NULL || (bn_ctx = BN_CTX_new()) == NULL) 247. return NULL; 248. crypto/bn/bn_ctx.c:189:1: start of procedure BN_CTX_new() 187. 188. 189. > BN_CTX *BN_CTX_new(void) 190. { 191. BN_CTX *ret; crypto/bn/bn_ctx.c:193:9: 191. BN_CTX *ret; 192. 193. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_ctx.c:193:9: Taking false branch 191. BN_CTX *ret; 192. 193. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/bn/bn_ctx.c:198:5: 196. } 197. /* Initialise the structure */ 198. > BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. return ret; crypto/bn/bn_ctx.c:335:1: start of procedure BN_POOL_init() 333. /***********/ 334. 335. > static void BN_POOL_init(BN_POOL *p) 336. { 337. p->head = p->current = p->tail = NULL; crypto/bn/bn_ctx.c:337:5: 335. static void BN_POOL_init(BN_POOL *p) 336. { 337. > p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. } crypto/bn/bn_ctx.c:338:5: 336. { 337. p->head = p->current = p->tail = NULL; 338. > p->used = p->size = 0; 339. } 340. crypto/bn/bn_ctx.c:339:1: return from a call to BN_POOL_init 337. p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. > } 340. 341. static void BN_POOL_finish(BN_POOL *p) crypto/bn/bn_ctx.c:199:5: 197. /* Initialise the structure */ 198. BN_POOL_init(&ret->pool); 199. > BN_STACK_init(&ret->stack); 200. return ret; 201. } crypto/bn/bn_ctx.c:294:1: start of procedure BN_STACK_init() 292. /************/ 293. 294. > static void BN_STACK_init(BN_STACK *st) 295. { 296. st->indexes = NULL; crypto/bn/bn_ctx.c:296:5: 294. static void BN_STACK_init(BN_STACK *st) 295. { 296. > st->indexes = NULL; 297. st->depth = st->size = 0; 298. } crypto/bn/bn_ctx.c:297:5: 295. { 296. st->indexes = NULL; 297. > st->depth = st->size = 0; 298. } 299. crypto/bn/bn_ctx.c:298:1: return from a call to BN_STACK_init 296. st->indexes = NULL; 297. st->depth = st->size = 0; 298. > } 299. 300. static void BN_STACK_finish(BN_STACK *st) crypto/bn/bn_ctx.c:200:5: 198. BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. > return ret; 201. } 202. crypto/bn/bn_ctx.c:201:1: return from a call to BN_CTX_new 199. BN_STACK_init(&ret->stack); 200. return ret; 201. > } 202. 203. BN_CTX *BN_CTX_secure_new(void) crypto/srp/srp_lib.c:246:48: Taking false branch 244. BIGNUM *A = NULL; 245. 246. if (a == NULL || N == NULL || g == NULL || (bn_ctx = BN_CTX_new()) == NULL) ^ 247. return NULL; 248. crypto/srp/srp_lib.c:249:9: 247. return NULL; 248. 249. > if ((A = BN_new()) != NULL && !BN_mod_exp(A, g, a, N, bn_ctx)) { 250. BN_free(A); 251. A = NULL; crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) crypto/srp/srp_lib.c:249:9: Taking true branch 247. return NULL; 248. 249. if ((A = BN_new()) != NULL && !BN_mod_exp(A, g, a, N, bn_ctx)) { ^ 250. BN_free(A); 251. A = NULL; crypto/srp/srp_lib.c:249:36: Taking true branch 247. return NULL; 248. 249. if ((A = BN_new()) != NULL && !BN_mod_exp(A, g, a, N, bn_ctx)) { ^ 250. BN_free(A); 251. A = NULL; crypto/srp/srp_lib.c:250:9: 248. 249. if ((A = BN_new()) != NULL && !BN_mod_exp(A, g, a, N, bn_ctx)) { 250. > BN_free(A); 251. A = NULL; 252. } crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/srp/srp_lib.c/#L250
d2a_code_trace_data_43956
static ossl_inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } test/servername_test.c:45: error: INTEGER_OVERFLOW_L2 ([0, 9223372036854775807] - 34):unsigned64 by call to `PACKET_forward`. Showing all 15 steps of the trace test/servername_test.c:34:19: Assignment 32. long len; 33. unsigned char *data; 34. PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0}, pkt4 = {0}, pkt5 = {0}; ^ 35. unsigned int servname_type = 0, type = 0; 36. int ret = 0; test/servername_test.c:39:10: Call 37. 38. len = BIO_get_mem_data(bio, (char **)&data); 39. if (!TEST_true(PACKET_buf_init(&pkt, data, len)) ^ 40. /* Skip the record header */ 41. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH) 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/servername_test.c:41:17: Call 39. if (!TEST_true(PACKET_buf_init(&pkt, data, len)) 40. /* Skip the record header */ 41. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH) ^ 42. /* Skip the handshake message header */ 43. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH)) 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) test/servername_test.c:43:17: Call 41. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH) 42. /* Skip the handshake message header */ 43. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH)) ^ 44. /* Skip client version and random */ 45. || !TEST_true(PACKET_forward(&pkt, CLIENT_VERSION_LEN 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) test/servername_test.c:45:17: Call 43. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH)) 44. /* Skip client version and random */ 45. || !TEST_true(PACKET_forward(&pkt, CLIENT_VERSION_LEN ^ 46. + SSL3_RANDOM_SIZE)) 47. /* Skip session id */ 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, 9223372036854775807] - 34):unsigned64 by call to `PACKET_forward` 34. { 35. pkt->curr += len; 36. pkt->remaining -= len; ^ 37. } 38.
https://github.com/openssl/openssl/blob/190b9a03b72a8029c27e4bd0ab000129e240a413/ssl/packet_locl.h/#L36
d2a_code_trace_data_43957
int ossl_init_thread_start(uint64_t opts) { struct thread_local_inits_st *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:329: error: MEMORY_LEAK memory dynamically allocated by call to `ossl_init_get_thread_local()` at line 311, column 44 is not reachable after line 329, column 9. Showing all 38 steps of the trace crypto/init.c:309:1: start of procedure ossl_init_thread_start() 307. } 308. 309. > int ossl_init_thread_start(uint64_t opts) 310. { 311. struct thread_local_inits_st *locals = ossl_init_get_thread_local(1); crypto/init.c:311:5: 309. int ossl_init_thread_start(uint64_t opts) 310. { 311. > struct thread_local_inits_st *locals = ossl_init_get_thread_local(1); 312. 313. if (locals == NULL) crypto/init.c:37:1: start of procedure ossl_init_get_thread_local() 35. } 36. 37. > static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) 38. { 39. struct thread_local_inits_st *local = crypto/init.c:39:5: 37. static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) 38. { 39. > struct thread_local_inits_st *local = 40. CRYPTO_THREAD_get_local(&threadstopkey); 41. crypto/threads_pthread.c:79:1: start of procedure CRYPTO_THREAD_get_local() 77. } 78. 79. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 80. { 81. return pthread_getspecific(*key); crypto/threads_pthread.c:81:5: Skipping pthread_getspecific(): method has no implementation 79. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 80. { 81. return pthread_getspecific(*key); ^ 82. } 83. crypto/threads_pthread.c:82:1: return from a call to CRYPTO_THREAD_get_local 80. { 81. return pthread_getspecific(*key); 82. > } 83. 84. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) crypto/init.c:42:9: Taking true branch 40. CRYPTO_THREAD_get_local(&threadstopkey); 41. 42. if (local == NULL && alloc) { ^ 43. local = OPENSSL_zalloc(sizeof *local); 44. CRYPTO_THREAD_set_local(&threadstopkey, local); crypto/init.c:42:26: Taking true branch 40. CRYPTO_THREAD_get_local(&threadstopkey); 41. 42. if (local == NULL && alloc) { ^ 43. local = OPENSSL_zalloc(sizeof *local); 44. CRYPTO_THREAD_set_local(&threadstopkey, local); crypto/init.c:43:9: 41. 42. if (local == NULL && alloc) { 43. > local = OPENSSL_zalloc(sizeof *local); 44. CRYPTO_THREAD_set_local(&threadstopkey, local); 45. } crypto/mem.c:98:1: start of procedure CRYPTO_zalloc() 96. } 97. 98. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:100:5: 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. > void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:102:9: Taking true branch 100. void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) ^ 103. memset(ret, 0, num); 104. return ret; crypto/mem.c:103:9: 101. 102. if (ret != NULL) 103. > memset(ret, 0, num); 104. return ret; 105. } crypto/mem.c:104:5: 102. if (ret != NULL) 103. memset(ret, 0, num); 104. > return ret; 105. } 106. crypto/mem.c:105:1: return from a call to CRYPTO_zalloc 103. memset(ret, 0, num); 104. return ret; 105. > } 106. 107. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/init.c:44:9: 42. if (local == NULL && alloc) { 43. local = OPENSSL_zalloc(sizeof *local); 44. > CRYPTO_THREAD_set_local(&threadstopkey, local); 45. } 46. if (!alloc) { crypto/threads_pthread.c:84:1: start of procedure CRYPTO_THREAD_set_local() 82. } 83. 84. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 85. { 86. if (pthread_setspecific(*key, val) != 0) crypto/threads_pthread.c:86:9: Taking true branch 84. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 85. { 86. if (pthread_setspecific(*key, val) != 0) ^ 87. return 0; 88. crypto/threads_pthread.c:87:9: 85. { 86. if (pthread_setspecific(*key, val) != 0) 87. > return 0; 88. 89. return 1; crypto/threads_pthread.c:90:1: return from a call to CRYPTO_THREAD_set_local 88. 89. return 1; 90. > } 91. 92. int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key) crypto/init.c:46:10: Taking false branch 44. CRYPTO_THREAD_set_local(&threadstopkey, local); 45. } 46. if (!alloc) { ^ 47. CRYPTO_THREAD_set_local(&threadstopkey, NULL); 48. } crypto/init.c:50:5: 48. } 49. 50. > return local; 51. } 52. crypto/init.c:51:1: return from a call to ossl_init_get_thread_local 49. 50. return local; 51. > } 52. 53. typedef struct ossl_init_stop_st OPENSSL_INIT_STOP; crypto/init.c:313:9: Taking false branch 311. struct thread_local_inits_st *locals = ossl_init_get_thread_local(1); 312. 313. if (locals == NULL) ^ 314. return 0; 315. crypto/init.c:316:9: Taking false branch 314. return 0; 315. 316. if (opts & OPENSSL_INIT_THREAD_ASYNC) { ^ 317. #ifdef OPENSSL_INIT_DEBUG 318. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " crypto/init.c:324:9: Taking true branch 322. } 323. 324. if (opts & OPENSSL_INIT_THREAD_ERR_STATE) { ^ 325. #ifdef OPENSSL_INIT_DEBUG 326. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " crypto/init.c:329:9: 327. "marking thread for err_state\n"); 328. #endif 329. > locals->err_state = 1; 330. } 331.
https://github.com/openssl/openssl/blob/b2de11c58b57e7f0d58c6f8a1d4177705650647e/crypto/init.c/#L329
d2a_code_trace_data_43958
int ssl3_new(SSL *s) { SSL3_STATE *s3; if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL) goto err; s->s3 = s3; #ifndef OPENSSL_NO_SRP if (!SSL_SRP_CTX_init(s)) goto err; #endif s->method->ssl_clear(s); return (1); err: return (0); } ssl/s3_lib.c:2822: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_zalloc()` at line 2817, column 15 is not reachable after line 2822, column 10. Showing all 21 steps of the trace ssl/s3_lib.c:2813:1: start of procedure ssl3_new() 2811. } 2812. 2813. > int ssl3_new(SSL *s) 2814. { 2815. SSL3_STATE *s3; ssl/s3_lib.c:2817:9: 2815. SSL3_STATE *s3; 2816. 2817. > if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL) 2818. goto err; 2819. s->s3 = s3; crypto/mem.c:98:1: start of procedure CRYPTO_zalloc() 96. } 97. 98. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:100:5: 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. > void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:102:9: Taking true branch 100. void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) ^ 103. memset(ret, 0, num); 104. return ret; crypto/mem.c:103:9: 101. 102. if (ret != NULL) 103. > memset(ret, 0, num); 104. return ret; 105. } crypto/mem.c:104:5: 102. if (ret != NULL) 103. memset(ret, 0, num); 104. > return ret; 105. } 106. crypto/mem.c:105:1: return from a call to CRYPTO_zalloc 103. memset(ret, 0, num); 104. return ret; 105. > } 106. 107. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) ssl/s3_lib.c:2817:9: Taking false branch 2815. SSL3_STATE *s3; 2816. 2817. if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL) ^ 2818. goto err; 2819. s->s3 = s3; ssl/s3_lib.c:2819:5: 2817. if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL) 2818. goto err; 2819. > s->s3 = s3; 2820. 2821. #ifndef OPENSSL_NO_SRP ssl/s3_lib.c:2822:10: Skipping SSL_SRP_CTX_init(): empty list of specs 2820. 2821. #ifndef OPENSSL_NO_SRP 2822. if (!SSL_SRP_CTX_init(s)) ^ 2823. goto err; 2824. #endif
https://github.com/openssl/openssl/blob/de451856f08364ad6c6659b6eacbe820edc2aab9/ssl/s3_lib.c/#L2822
d2a_code_trace_data_43959
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) { int line_size; int sample_size = av_get_bytes_per_sample(sample_fmt); int planar = av_sample_fmt_is_planar(sample_fmt); if (!sample_size || nb_samples <= 0 || nb_channels <= 0) return AVERROR(EINVAL); if (!align) { if (nb_samples > INT_MAX - 31) return AVERROR(EINVAL); align = 1; nb_samples = FFALIGN(nb_samples, 32); } if (nb_channels > INT_MAX / align || (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size) return AVERROR(EINVAL); line_size = planar ? FFALIGN(nb_samples * sample_size, align) : FFALIGN(nb_samples * sample_size * nb_channels, align); if (linesize) *linesize = line_size; return planar ? line_size * nb_channels : line_size; } libavresample/resample.c:462: error: Integer Overflow L2 ([1, 2147483616] + 32):signed32 by call to `ff_audio_data_realloc`. libavresample/resample.c:460:23: Call 458. /* TODO: try to calculate this without the dummy resample() run */ 459. if (!dst->read_only && dst->allow_realloc) { 460. out_samples = resample(c, NULL, NULL, NULL, c->buffer->nb_samples, ^ 461. INT_MAX, 0, nearest_neighbour); 462. ret = ff_audio_data_realloc(dst, out_samples); libavresample/resample.c:357:9: Assignment 355. 356. if (!dst != !src) 357. return AVERROR(EINVAL); ^ 358. 359. if (nearest_neighbour) { libavresample/resample.c:460:9: Assignment 458. /* TODO: try to calculate this without the dummy resample() run */ 459. if (!dst->read_only && dst->allow_realloc) { 460. out_samples = resample(c, NULL, NULL, NULL, c->buffer->nb_samples, ^ 461. INT_MAX, 0, nearest_neighbour); 462. ret = ff_audio_data_realloc(dst, out_samples); libavresample/resample.c:462:15: Call 460. out_samples = resample(c, NULL, NULL, NULL, c->buffer->nb_samples, 461. INT_MAX, 0, nearest_neighbour); 462. ret = ff_audio_data_realloc(dst, out_samples); ^ 463. if (ret < 0) { 464. av_log(c->avr, AV_LOG_ERROR, "error reallocating output\n"); libavresample/audio_data.c:153:1: Parameter `nb_samples` 151. } 152. 153. int ff_audio_data_realloc(AudioData *a, int nb_samples) ^ 154. { 155. int ret, new_buf_size, plane_size, p; libavresample/audio_data.c:177:15: Call 175. uint8_t *new_data[AVRESAMPLE_MAX_CHANNELS] = { NULL }; 176. 177. ret = av_samples_alloc(new_data, &plane_size, a->allocated_channels, ^ 178. nb_samples, a->sample_fmt, 0); 179. if (ret < 0) libavutil/samplefmt.c:162:1: Parameter `nb_samples` 160. } 161. 162. int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, ^ 163. int nb_samples, enum AVSampleFormat sample_fmt, int align) 164. { libavutil/samplefmt.c:166:16: Call 164. { 165. uint8_t *buf; 166. int size = av_samples_get_buffer_size(NULL, nb_channels, nb_samples, ^ 167. sample_fmt, align); 168. if (size < 0) libavutil/samplefmt.c:108:1: <LHS trace> 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:108:1: Parameter `nb_samples` 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `ff_audio_data_realloc` 122. return AVERROR(EINVAL); 123. align = 1; 124. nb_samples = FFALIGN(nb_samples, 32); ^ 125. } 126.
https://github.com/libav/libav/blob/254c95cdd1b669a722204a4a65974fc2523c8f83/libavutil/samplefmt.c/#L124
d2a_code_trace_data_43960
static int xan_huffman_decode(unsigned char *dest, int dest_len, const unsigned char *src, int src_len) { unsigned char byte = *src++; unsigned char ival = byte + 0x16; const unsigned char * ptr = src + byte*2; int ptr_len = src_len - 1 - byte*2; unsigned char val = ival; unsigned char *dest_end = dest + dest_len; unsigned char *dest_start = dest; GetBitContext gb; if (ptr_len < 0) return AVERROR_INVALIDDATA; init_get_bits(&gb, ptr, ptr_len * 8); while (val != 0x16) { unsigned idx = val - 0x17 + get_bits1(&gb) * byte; if (idx >= 2 * byte) return AVERROR_INVALIDDATA; val = src[idx]; if (val < 0x16) { if (dest >= dest_end) return dest_len; *dest++ = val; val = ival; } } return dest - dest_start; } libavcodec/xan.c:134: error: Null Dereference pointer `&gb->buffer` last assigned on line 131 could be null and is dereferenced by call to `get_bits1()` at line 134, column 37. libavcodec/xan.c:116:1: start of procedure xan_huffman_decode() 114. } 115. 116. static int xan_huffman_decode(unsigned char *dest, int dest_len, ^ 117. const unsigned char *src, int src_len) 118. { libavcodec/xan.c:119:5: 117. const unsigned char *src, int src_len) 118. { 119. unsigned char byte = *src++; ^ 120. unsigned char ival = byte + 0x16; 121. const unsigned char * ptr = src + byte*2; libavcodec/xan.c:120:5: 118. { 119. unsigned char byte = *src++; 120. unsigned char ival = byte + 0x16; ^ 121. const unsigned char * ptr = src + byte*2; 122. int ptr_len = src_len - 1 - byte*2; libavcodec/xan.c:121:5: 119. unsigned char byte = *src++; 120. unsigned char ival = byte + 0x16; 121. const unsigned char * ptr = src + byte*2; ^ 122. int ptr_len = src_len - 1 - byte*2; 123. unsigned char val = ival; libavcodec/xan.c:122:5: 120. unsigned char ival = byte + 0x16; 121. const unsigned char * ptr = src + byte*2; 122. int ptr_len = src_len - 1 - byte*2; ^ 123. unsigned char val = ival; 124. unsigned char *dest_end = dest + dest_len; libavcodec/xan.c:123:5: 121. const unsigned char * ptr = src + byte*2; 122. int ptr_len = src_len - 1 - byte*2; 123. unsigned char val = ival; ^ 124. unsigned char *dest_end = dest + dest_len; 125. unsigned char *dest_start = dest; libavcodec/xan.c:124:5: 122. int ptr_len = src_len - 1 - byte*2; 123. unsigned char val = ival; 124. unsigned char *dest_end = dest + dest_len; ^ 125. unsigned char *dest_start = dest; 126. GetBitContext gb; libavcodec/xan.c:125:5: 123. unsigned char val = ival; 124. unsigned char *dest_end = dest + dest_len; 125. unsigned char *dest_start = dest; ^ 126. GetBitContext gb; 127. libavcodec/xan.c:128:9: Taking false branch 126. GetBitContext gb; 127. 128. if (ptr_len < 0) ^ 129. return AVERROR_INVALIDDATA; 130. libavcodec/xan.c:131:5: 129. return AVERROR_INVALIDDATA; 130. 131. init_get_bits(&gb, ptr, ptr_len * 8); ^ 132. 133. while (val != 0x16) { libavcodec/get_bits.h:376:1: start of procedure init_get_bits() 374. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. 375. */ 376. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, ^ 377. int bit_size) 378. { libavcodec/get_bits.h:380:5: 378. { 379. int buffer_size; 380. int ret = 0; ^ 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { libavcodec/get_bits.h:382:9: Taking true branch 380. int ret = 0; 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { ^ 383. bit_size = 0; 384. buffer = NULL; libavcodec/get_bits.h:383:9: 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 383. bit_size = 0; ^ 384. buffer = NULL; 385. ret = AVERROR_INVALIDDATA; libavcodec/get_bits.h:384:9: 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 383. bit_size = 0; 384. buffer = NULL; ^ 385. ret = AVERROR_INVALIDDATA; 386. } libavcodec/get_bits.h:385:9: 383. bit_size = 0; 384. buffer = NULL; 385. ret = AVERROR_INVALIDDATA; ^ 386. } 387. libavcodec/get_bits.h:388:5: 386. } 387. 388. buffer_size = (bit_size + 7) >> 3; ^ 389. 390. s->buffer = buffer; libavcodec/get_bits.h:390:5: 388. buffer_size = (bit_size + 7) >> 3; 389. 390. s->buffer = buffer; ^ 391. s->size_in_bits = bit_size; 392. #if !UNCHECKED_BITSTREAM_READER libavcodec/get_bits.h:391:5: 389. 390. s->buffer = buffer; 391. s->size_in_bits = bit_size; ^ 392. #if !UNCHECKED_BITSTREAM_READER 393. s->size_in_bits_plus8 = bit_size + 8; libavcodec/get_bits.h:393:5: 391. s->size_in_bits = bit_size; 392. #if !UNCHECKED_BITSTREAM_READER 393. s->size_in_bits_plus8 = bit_size + 8; ^ 394. #endif 395. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:395:5: 393. s->size_in_bits_plus8 = bit_size + 8; 394. #endif 395. s->buffer_end = buffer + buffer_size; ^ 396. s->index = 0; 397. libavcodec/get_bits.h:396:5: 394. #endif 395. s->buffer_end = buffer + buffer_size; 396. s->index = 0; ^ 397. 398. return ret; libavcodec/get_bits.h:398:5: 396. s->index = 0; 397. 398. return ret; ^ 399. } 400. libavcodec/get_bits.h:399:1: return from a call to init_get_bits 397. 398. return ret; 399. } ^ 400. 401. /** libavcodec/xan.c:133:12: Loop condition is true. Entering loop body 131. init_get_bits(&gb, ptr, ptr_len * 8); 132. 133. while (val != 0x16) { ^ 134. unsigned idx = val - 0x17 + get_bits1(&gb) * byte; 135. if (idx >= 2 * byte) libavcodec/xan.c:134:9: 132. 133. while (val != 0x16) { 134. unsigned idx = val - 0x17 + get_bits1(&gb) * byte; ^ 135. if (idx >= 2 * byte) 136. return AVERROR_INVALIDDATA; libavcodec/get_bits.h:272:1: start of procedure get_bits1() 270. } 271. 272. static inline unsigned int get_bits1(GetBitContext *s) ^ 273. { 274. unsigned int index = s->index; libavcodec/get_bits.h:274:5: 272. static inline unsigned int get_bits1(GetBitContext *s) 273. { 274. unsigned int index = s->index; ^ 275. uint8_t result = s->buffer[index >> 3]; 276. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:275:5: 273. { 274. unsigned int index = s->index; 275. uint8_t result = s->buffer[index >> 3]; ^ 276. #ifdef BITSTREAM_READER_LE 277. result >>= index & 7;
https://github.com/libav/libav/blob/77ab341c0c6cdf2bd437bb48d429e797d1e60da2/libavcodec/xan.c/#L134
d2a_code_trace_data_43961
static av_always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi, const uint8_t* zigzag_scan, const int *weight, int bias) { int i, area; #if 0 static const int classes[] = {12, 24, 36, 0xffff}; #else static const int classes[] = {-1, -1, 255, 0xffff}; #endif int max=classes[0]; int prev=0; bi->mb[0] = blk[0]; for (area = 0; area < 4; area++) { bi->prev[area] = prev; bi->bit_size[area] = 1; for (i=mb_area_start[area]; i<mb_area_start[area+1]; i++) { int level = blk[zigzag_scan[i]]; if (level+15 > 30U) { bi->sign[i] = (level>>31)&1; level = (FFABS(level) * weight[i] + (1<<(dv_weight_bits+3))) >> (dv_weight_bits+4); bi->mb[i] = level; if(level>max) max= level; bi->bit_size[area] += dv_rl2vlc_size(i - prev - 1, level); bi->next[prev]= i; prev= i; } } } bi->next[prev]= i; for(bi->cno = 0; max > classes[bi->cno]; bi->cno++); bi->cno += bias; if (bi->cno >= 3) { bi->cno = 3; prev=0; i= bi->next[prev]; for (area = 0; area < 4; area++) { bi->prev[area] = prev; bi->bit_size[area] = 1; for (; i<mb_area_start[area+1]; i= bi->next[i]) { bi->mb[i] >>=1; if (bi->mb[i]) { bi->bit_size[area] += dv_rl2vlc_size(i - prev - 1, bi->mb[i]); bi->next[prev]= i; prev= i; } } } bi->next[prev]= i; } } libavcodec/dv.c:710: error: Uninitialized Value The value read from i was never initialized. libavcodec/dv.c:710:5: 708. } 709. } 710. bi->next[prev]= i; ^ 711. for(bi->cno = 0; max > classes[bi->cno]; bi->cno++); 712.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/dv.c/#L710
d2a_code_trace_data_43962
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/ec/ecp_smpl.c:1018: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_add_quick`. Showing all 18 steps of the trace crypto/ec/ecp_smpl.c:976:10: Call 974. 975. BN_CTX_start(ctx); 976. rh = BN_CTX_get(ctx); ^ 977. tmp = BN_CTX_get(ctx); 978. Z4 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:366:15: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/bn/bn_lib.c:366:5: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/ec/ecp_smpl.c:1018:18: Call 1016. if (!field_mul(group, tmp, Z4, group->a, ctx)) 1017. goto err; 1018. if (!BN_mod_add_quick(rh, rh, tmp, p)) ^ 1019. goto err; 1020. if (!field_mul(group, rh, rh, point->X, ctx)) crypto/bn/bn_mod.c:93:1: Parameter `*r->d` 91. } 92. 93. > int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 94. const BIGNUM *m) 95. { crypto/bn/bn_mod.c:96:15: Call 94. const BIGNUM *m) 95. { 96. int ret = bn_mod_add_fixed_top(r, a, b, m); ^ 97. 98. if (ret) crypto/bn/bn_mod.c:48:1: Parameter `*r->d` 46. * move depending on whether or not subtraction borrowed. 47. */ 48. > int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 49. const BIGNUM *m) 50. { crypto/bn/bn_mod.c:56:9: Call 54. const BN_ULONG *ap, *bp; 55. 56. if (bn_wexpand(r, mtop) == NULL) ^ 57. return 0; 58. crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:245:1: Parameter `*b->d` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `*b->d` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_add_quick` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_43963
void bn_correct_top(BIGNUM *a) { BN_ULONG *ftl; int tmp_top = a->top; if (tmp_top > 0) { for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) { ftl--; if (*ftl != 0) break; } a->top = tmp_top; } if (a->top == 0) a->neg = 0; bn_pollute(a); } test/bntest.c:1795: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mul`. Showing all 13 steps of the trace test/bntest.c:1791:10: Call 1789. 1790. /* Test that BN_mul never gives negative zero. */ 1791. if (!TEST_true(BN_set_word(a, 1))) ^ 1792. goto err; 1793. BN_set_negative(a, 1); crypto/bn/bn_lib.c:395:1: Parameter `*a->d` 393. } 394. 395. > int BN_set_word(BIGNUM *a, BN_ULONG w) 396. { 397. bn_check_top(a); crypto/bn/bn_lib.c:398:9: Call 396. { 397. bn_check_top(a); 398. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 399. return (0); 400. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `*a->d` 658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 659. 660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 661. { 662. if (bits > (INT_MAX - BN_BITS2 + 1)) test/bntest.c:1795:10: Call 1793. BN_set_negative(a, 1); 1794. BN_zero(b); 1795. if (!TEST_true(BN_mul(c, a, b, ctx))) ^ 1796. goto err; 1797. if (!TEST_BN_eq_zero(c) crypto/bn/bn_mul.c:545:13: Assignment 543. if (bn_wexpand(rr, 16) == NULL) 544. goto err; 545. rr->top = 16; ^ 546. bn_mul_comba8(rr->d, a->d, b->d); 547. goto end; crypto/bn/bn_mul.c:639:5: Call 637. #endif 638. rr->neg = a->neg ^ b->neg; 639. bn_correct_top(rr); ^ 640. if (r != rr && BN_copy(r, rr) == NULL) 641. goto err; crypto/bn/bn_lib.c:953:1: <Offset trace> 951. } 952. 953. > void bn_correct_top(BIGNUM *a) 954. { 955. BN_ULONG *ftl; crypto/bn/bn_lib.c:953:1: Parameter `a->top` 951. } 952. 953. > void bn_correct_top(BIGNUM *a) 954. { 955. BN_ULONG *ftl; crypto/bn/bn_lib.c:956:5: Assignment 954. { 955. BN_ULONG *ftl; 956. int tmp_top = a->top; ^ 957. 958. if (tmp_top > 0) { crypto/bn/bn_lib.c:953:1: <Length trace> 951. } 952. 953. > void bn_correct_top(BIGNUM *a) 954. { 955. BN_ULONG *ftl; crypto/bn/bn_lib.c:953:1: Parameter `*a->d` 951. } 952. 953. > void bn_correct_top(BIGNUM *a) 954. { 955. BN_ULONG *ftl; crypto/bn/bn_lib.c:959:14: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mul` 957. 958. if (tmp_top > 0) { 959. for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) { ^ 960. ftl--; 961. if (*ftl != 0)
https://github.com/openssl/openssl/blob/3f97052392cb10fca5309212bf720685262ad4a6/crypto/bn/bn_lib.c/#L959
d2a_code_trace_data_43964
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_8`. 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_8` 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_43965
int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int send) { unsigned char *mac_sec, *seq; const EVP_MD_CTX *hash; unsigned char *p, rec_char; size_t md_size; int npad; int t; if (send) { mac_sec = &(ssl->s3->write_mac_secret[0]); seq = RECORD_LAYER_get_write_sequence(&ssl->rlayer); hash = ssl->write_hash; } else { mac_sec = &(ssl->s3->read_mac_secret[0]); seq = RECORD_LAYER_get_read_sequence(&ssl->rlayer); hash = ssl->read_hash; } t = EVP_MD_CTX_size(hash); if (t < 0) return -1; md_size = t; npad = (48 / md_size) * md_size; if (!send && EVP_CIPHER_CTX_mode(ssl->enc_read_ctx) == EVP_CIPH_CBC_MODE && ssl3_cbc_record_digest_supported(hash)) { unsigned char header[75]; unsigned j = 0; memcpy(header + j, mac_sec, md_size); j += md_size; memcpy(header + j, ssl3_pad_1, npad); j += npad; memcpy(header + j, seq, 8); j += 8; header[j++] = rec->type; header[j++] = rec->length >> 8; header[j++] = rec->length & 0xff; if (ssl3_cbc_digest_record(hash, md, &md_size, header, rec->input, rec->length + md_size, rec->orig_len, mac_sec, md_size, 1) <= 0) return -1; } else { unsigned int md_size_u; EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); if (md_ctx == NULL) return -1; rec_char = rec->type; p = md; s2n(rec->length, p); if (EVP_MD_CTX_copy_ex(md_ctx, hash) <= 0 || EVP_DigestUpdate(md_ctx, mac_sec, md_size) <= 0 || EVP_DigestUpdate(md_ctx, ssl3_pad_1, npad) <= 0 || EVP_DigestUpdate(md_ctx, seq, 8) <= 0 || EVP_DigestUpdate(md_ctx, &rec_char, 1) <= 0 || EVP_DigestUpdate(md_ctx, md, 2) <= 0 || EVP_DigestUpdate(md_ctx, rec->input, rec->length) <= 0 || EVP_DigestFinal_ex(md_ctx, md, NULL) <= 0 || EVP_MD_CTX_copy_ex(md_ctx, hash) <= 0 || EVP_DigestUpdate(md_ctx, mac_sec, md_size) <= 0 || EVP_DigestUpdate(md_ctx, ssl3_pad_2, npad) <= 0 || EVP_DigestUpdate(md_ctx, md, md_size) <= 0 || EVP_DigestFinal_ex(md_ctx, md, &md_size_u) <= 0) { EVP_MD_CTX_reset(md_ctx); return -1; } md_size = md_size_u; EVP_MD_CTX_free(md_ctx); } ssl3_record_sequence_update(seq); return (md_size); } ssl/record/ssl3_record.c:934: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 913, column 30 is not reachable after line 934, column 13. Showing all 66 steps of the trace ssl/record/ssl3_record.c:849:1: start of procedure n_ssl3_mac() 847. } 848. 849. > int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int send) 850. { 851. unsigned char *mac_sec, *seq; ssl/record/ssl3_record.c:858:9: Taking true branch 856. int t; 857. 858. if (send) { ^ 859. mac_sec = &(ssl->s3->write_mac_secret[0]); 860. seq = RECORD_LAYER_get_write_sequence(&ssl->rlayer); ssl/record/ssl3_record.c:859:9: 857. 858. if (send) { 859. > mac_sec = &(ssl->s3->write_mac_secret[0]); 860. seq = RECORD_LAYER_get_write_sequence(&ssl->rlayer); 861. hash = ssl->write_hash; ssl/record/ssl3_record.c:860:9: 858. if (send) { 859. mac_sec = &(ssl->s3->write_mac_secret[0]); 860. > seq = RECORD_LAYER_get_write_sequence(&ssl->rlayer); 861. hash = ssl->write_hash; 862. } else { ssl/record/ssl3_record.c:861:9: 859. mac_sec = &(ssl->s3->write_mac_secret[0]); 860. seq = RECORD_LAYER_get_write_sequence(&ssl->rlayer); 861. > hash = ssl->write_hash; 862. } else { 863. mac_sec = &(ssl->s3->read_mac_secret[0]); ssl/record/ssl3_record.c:868:5: 866. } 867. 868. > t = EVP_MD_CTX_size(hash); 869. if (t < 0) 870. return -1; crypto/evp/evp_lib.c:439:1: start of procedure EVP_MD_CTX_md() 437. } 438. 439. > const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx) 440. { 441. if (!ctx) crypto/evp/evp_lib.c:441:10: Taking false branch 439. const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx) 440. { 441. if (!ctx) ^ 442. return NULL; 443. return ctx->digest; crypto/evp/evp_lib.c:443:5: 441. if (!ctx) 442. return NULL; 443. > return ctx->digest; 444. } 445. crypto/evp/evp_lib.c:444:1: return from a call to EVP_MD_CTX_md 442. return NULL; 443. return ctx->digest; 444. > } 445. 446. EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx) crypto/evp/evp_lib.c:301:1: start of procedure EVP_MD_size() 299. } 300. 301. > int EVP_MD_size(const EVP_MD *md) 302. { 303. if (!md) { crypto/evp/evp_lib.c:303:10: Taking false branch 301. int EVP_MD_size(const EVP_MD *md) 302. { 303. if (!md) { ^ 304. EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL); 305. return -1; crypto/evp/evp_lib.c:307:5: 305. return -1; 306. } 307. > return md->md_size; 308. } 309. crypto/evp/evp_lib.c:308:1: return from a call to EVP_MD_size 306. } 307. return md->md_size; 308. > } 309. 310. unsigned long EVP_MD_flags(const EVP_MD *md) ssl/record/ssl3_record.c:869:9: Taking false branch 867. 868. t = EVP_MD_CTX_size(hash); 869. if (t < 0) ^ 870. return -1; 871. md_size = t; ssl/record/ssl3_record.c:871:5: 869. if (t < 0) 870. return -1; 871. > md_size = t; 872. npad = (48 / md_size) * md_size; 873. ssl/record/ssl3_record.c:872:5: 870. return -1; 871. md_size = t; 872. > npad = (48 / md_size) * md_size; 873. 874. if (!send && ssl/record/ssl3_record.c:874:10: Taking false branch 872. npad = (48 / md_size) * md_size; 873. 874. if (!send && ^ 875. EVP_CIPHER_CTX_mode(ssl->enc_read_ctx) == EVP_CIPH_CBC_MODE && 876. ssl3_cbc_record_digest_supported(hash)) { ssl/record/ssl3_record.c:913:9: 911. unsigned int md_size_u; 912. /* Chop the digest off the end :-) */ 913. > EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); 914. 915. if (md_ctx == NULL) crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new() 42. } 43. 44. > EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:46:5: 44. EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. } 48. crypto/mem.c:98:1: start of procedure CRYPTO_zalloc() 96. } 97. 98. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:100:5: 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. > void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:102:9: Taking true branch 100. void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) ^ 103. memset(ret, 0, num); 104. return ret; crypto/mem.c:103:9: 101. 102. if (ret != NULL) 103. > memset(ret, 0, num); 104. return ret; 105. } crypto/mem.c:104:5: 102. if (ret != NULL) 103. memset(ret, 0, num); 104. > return ret; 105. } 106. crypto/mem.c:105:1: return from a call to CRYPTO_zalloc 103. memset(ret, 0, num); 104. return ret; 105. > } 106. 107. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. > } 48. 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) ssl/record/ssl3_record.c:915:13: Taking false branch 913. EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); 914. 915. if (md_ctx == NULL) ^ 916. return -1; 917. ssl/record/ssl3_record.c:918:9: 916. return -1; 917. 918. > rec_char = rec->type; 919. p = md; 920. s2n(rec->length, p); ssl/record/ssl3_record.c:919:9: 917. 918. rec_char = rec->type; 919. > p = md; 920. s2n(rec->length, p); 921. if (EVP_MD_CTX_copy_ex(md_ctx, hash) <= 0 ssl/record/ssl3_record.c:920:9: 918. rec_char = rec->type; 919. p = md; 920. > s2n(rec->length, p); 921. if (EVP_MD_CTX_copy_ex(md_ctx, hash) <= 0 922. || EVP_DigestUpdate(md_ctx, mac_sec, md_size) <= 0 ssl/record/ssl3_record.c:921:13: 919. p = md; 920. s2n(rec->length, p); 921. > if (EVP_MD_CTX_copy_ex(md_ctx, hash) <= 0 922. || EVP_DigestUpdate(md_ctx, mac_sec, md_size) <= 0 923. || EVP_DigestUpdate(md_ctx, ssl3_pad_1, npad) <= 0 crypto/evp/digest.c:183:1: start of procedure EVP_MD_CTX_copy_ex() 181. } 182. 183. > int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) 184. { 185. unsigned char *tmp_buf; crypto/evp/digest.c:186:10: Taking false branch 184. { 185. unsigned char *tmp_buf; 186. if ((in == NULL) || (in->digest == NULL)) { ^ 187. EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED); 188. return 0; crypto/evp/digest.c:186:26: Taking false branch 184. { 185. unsigned char *tmp_buf; 186. if ((in == NULL) || (in->digest == NULL)) { ^ 187. EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, EVP_R_INPUT_NOT_INITIALIZED); 188. return 0; crypto/evp/digest.c:192:9: Taking true branch 190. #ifndef OPENSSL_NO_ENGINE 191. /* Make sure it's safe to copy a digest context using an ENGINE */ 192. if (in->engine && !ENGINE_init(in->engine)) { ^ 193. EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB); 194. return 0; crypto/evp/digest.c:192:24: 190. #ifndef OPENSSL_NO_ENGINE 191. /* Make sure it's safe to copy a digest context using an ENGINE */ 192. > if (in->engine && !ENGINE_init(in->engine)) { 193. EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB); 194. return 0; crypto/engine/eng_init.c:76:1: start of procedure ENGINE_init() 74. 75. /* The API (locked) version of "init" */ 76. > int ENGINE_init(ENGINE *e) 77. { 78. int ret; crypto/engine/eng_init.c:79:9: Taking false branch 77. { 78. int ret; 79. if (e == NULL) { ^ 80. ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_PASSED_NULL_PARAMETER); 81. return 0; crypto/engine/eng_init.c:83:10: 81. return 0; 82. } 83. > if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) { 84. ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE); 85. return 0; crypto/threads_pthread.c:63:1: start of procedure CRYPTO_THREAD_run_once() 61. } 62. 63. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 64. { 65. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:65:9: Taking true branch 63. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 64. { 65. if (pthread_once(once, init) != 0) ^ 66. return 0; 67. crypto/threads_pthread.c:66:9: 64. { 65. if (pthread_once(once, init) != 0) 66. > return 0; 67. 68. return 1; crypto/threads_pthread.c:69:1: return from a call to CRYPTO_THREAD_run_once 67. 68. return 1; 69. > } 70. 71. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/engine/eng_init.c:83:10: Condition is false 81. return 0; 82. } 83. if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) { ^ 84. ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE); 85. return 0; crypto/engine/eng_init.c:83:10: Taking true branch 81. return 0; 82. } 83. if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) { ^ 84. ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE); 85. return 0; crypto/engine/eng_init.c:84:9: Skipping ERR_put_error(): empty list of specs 82. } 83. if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) { 84. ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE); ^ 85. return 0; 86. } crypto/engine/eng_init.c:85:9: 83. if (!RUN_ONCE(&engine_lock_init, do_engine_lock_init)) { 84. ENGINEerr(ENGINE_F_ENGINE_INIT, ERR_R_MALLOC_FAILURE); 85. > return 0; 86. } 87. CRYPTO_THREAD_write_lock(global_engine_lock); crypto/engine/eng_init.c:91:1: return from a call to ENGINE_init 89. CRYPTO_THREAD_unlock(global_engine_lock); 90. return ret; 91. > } 92. 93. /* The API (locked) version of "finish" */ crypto/evp/digest.c:192:24: Taking true branch 190. #ifndef OPENSSL_NO_ENGINE 191. /* Make sure it's safe to copy a digest context using an ENGINE */ 192. if (in->engine && !ENGINE_init(in->engine)) { ^ 193. EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB); 194. return 0; crypto/evp/digest.c:193:9: Skipping ERR_put_error(): empty list of specs 191. /* Make sure it's safe to copy a digest context using an ENGINE */ 192. if (in->engine && !ENGINE_init(in->engine)) { 193. EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB); ^ 194. return 0; 195. } crypto/evp/digest.c:194:9: 192. if (in->engine && !ENGINE_init(in->engine)) { 193. EVPerr(EVP_F_EVP_MD_CTX_COPY_EX, ERR_R_ENGINE_LIB); 194. > return 0; 195. } 196. #endif crypto/evp/digest.c:240:1: return from a call to EVP_MD_CTX_copy_ex 238. 239. return 1; 240. > } 241. 242. int EVP_Digest(const void *data, size_t count, ssl/record/ssl3_record.c:921:13: Taking true branch 919. p = md; 920. s2n(rec->length, p); 921. if (EVP_MD_CTX_copy_ex(md_ctx, hash) <= 0 ^ 922. || EVP_DigestUpdate(md_ctx, mac_sec, md_size) <= 0 923. || EVP_DigestUpdate(md_ctx, ssl3_pad_1, npad) <= 0 ssl/record/ssl3_record.c:934:13: Skipping EVP_MD_CTX_reset(): empty list of specs 932. || EVP_DigestUpdate(md_ctx, md, md_size) <= 0 933. || EVP_DigestFinal_ex(md_ctx, md, &md_size_u) <= 0) { 934. EVP_MD_CTX_reset(md_ctx); ^ 935. return -1; 936. }
https://github.com/openssl/openssl/blob/9a7169870e803bdd9767d75ca8f64802ca0e7f1c/ssl/record/ssl3_record.c/#L934
d2a_code_trace_data_43966
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; return 1; } ssl/statem/statem_clnt.c:806: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `pkt->written` + 69]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 14 steps of the trace ssl/statem/statem_clnt.c:795:17: Call 793. sess_id_len = s->session->session_id_length; 794. if (sess_id_len > sizeof(s->session->session_id) 795. || !WPACKET_start_sub_packet_u8(pkt) ^ 796. || (sess_id_len != 0 && !WPACKET_memcpy(pkt, s->session->session_id, 797. sess_id_len)) ssl/packet.c:224:1: Parameter `pkt->buf->length` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/statem/statem_clnt.c:806:21: Call 804. if (SSL_IS_DTLS(s)) { 805. if (s->d1->cookie_len > sizeof(s->d1->cookie) 806. || !WPACKET_sub_memcpy_u8(pkt, s->d1->cookie, ^ 807. s->d1->cookie_len)) { 808. SSLerr(SSL_F_TLS_CONSTRUCT_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); ssl/packet.c:317:1: Parameter `pkt->written` 315. } 316. 317. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len, 318. size_t lenbytes) 319. { ssl/packet.c:320:10: Call 318. size_t lenbytes) 319. { 320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 321. || !WPACKET_memcpy(pkt, src, len) 322. || !WPACKET_close(pkt)) ssl/packet.c:224:1: Parameter `pkt->written` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/packet.c:248:10: Call 246. } 247. 248. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 249. return 0; 250. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */ ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [0, pkt->written + 69]):unsigned64 by call to `WPACKET_sub_memcpy__` 44. return 0; 45. 46. if (pkt->buf->length - pkt->written < len) { ^ 47. size_t newlen; 48. size_t reflen;
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/packet.c/#L46
d2a_code_trace_data_43967
EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md) { ssl_clear_hash_ctx(hash); *hash = EVP_MD_CTX_new(); if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { EVP_MD_CTX_free(*hash); *hash = NULL; return NULL; } return *hash; } ssl/ssl_lib.c:4410: error: MEMORY_LEAK memory dynamically allocated to `*hash` by call to `EVP_MD_CTX_new()` at line 4407, column 13 is not reachable after line 4410, column 9. Showing all 50 steps of the trace ssl/ssl_lib.c:4404:1: start of procedure ssl_replace_hash() 4402. */ 4403. 4404. > EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md) 4405. { 4406. ssl_clear_hash_ctx(hash); ssl/ssl_lib.c:4406:5: 4404. EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md) 4405. { 4406. > ssl_clear_hash_ctx(hash); 4407. *hash = EVP_MD_CTX_new(); 4408. if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { ssl/ssl_lib.c:4416:1: start of procedure ssl_clear_hash_ctx() 4414. } 4415. 4416. > void ssl_clear_hash_ctx(EVP_MD_CTX **hash) 4417. { 4418. ssl/ssl_lib.c:4419:5: 4417. { 4418. 4419. > EVP_MD_CTX_free(*hash); 4420. *hash = NULL; 4421. } crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free() 47. } 48. 49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); ^ 52. OPENSSL_free(ctx); 53. } crypto/evp/digest.c:52:5: 50. { 51. EVP_MD_CTX_reset(ctx); 52. > OPENSSL_free(ctx); 53. } 54. crypto/mem.c:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking false branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:312:5: 310. } 311. #else 312. > free(str); 313. #endif 314. } crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free 51. EVP_MD_CTX_reset(ctx); 52. OPENSSL_free(ctx); 53. > } 54. 55. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) ssl/ssl_lib.c:4420:5: 4418. 4419. EVP_MD_CTX_free(*hash); 4420. > *hash = NULL; 4421. } 4422. ssl/ssl_lib.c:4421:1: return from a call to ssl_clear_hash_ctx 4419. EVP_MD_CTX_free(*hash); 4420. *hash = NULL; 4421. > } 4422. 4423. /* Retrieve handshake hashes */ ssl/ssl_lib.c:4407:5: 4405. { 4406. ssl_clear_hash_ctx(hash); 4407. > *hash = EVP_MD_CTX_new(); 4408. if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { 4409. EVP_MD_CTX_free(*hash); crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new() 42. } 43. 44. > EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:46:5: 44. EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. } 48. crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking true branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:234:9: 232. FAILTEST(); 233. if (ret != NULL) 234. > memset(ret, 0, num); 235. return ret; 236. } crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. > } 48. 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) ssl/ssl_lib.c:4408:9: Taking false branch 4406. ssl_clear_hash_ctx(hash); 4407. *hash = EVP_MD_CTX_new(); 4408. if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { ^ 4409. EVP_MD_CTX_free(*hash); 4410. *hash = NULL; ssl/ssl_lib.c:4408:27: Taking true branch 4406. ssl_clear_hash_ctx(hash); 4407. *hash = EVP_MD_CTX_new(); 4408. if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { ^ 4409. EVP_MD_CTX_free(*hash); 4410. *hash = NULL; ssl/ssl_lib.c:4408:33: Taking true branch 4406. ssl_clear_hash_ctx(hash); 4407. *hash = EVP_MD_CTX_new(); 4408. if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { ^ 4409. EVP_MD_CTX_free(*hash); 4410. *hash = NULL; ssl/ssl_lib.c:4409:9: 4407. *hash = EVP_MD_CTX_new(); 4408. if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { 4409. > EVP_MD_CTX_free(*hash); 4410. *hash = NULL; 4411. return NULL; crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free() 47. } 48. 49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); ^ 52. OPENSSL_free(ctx); 53. } crypto/evp/digest.c:52:5: 50. { 51. EVP_MD_CTX_reset(ctx); 52. > OPENSSL_free(ctx); 53. } 54. crypto/mem.c:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:298:30: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); ^ 300. return; 301. } crypto/mem.c:300:9: 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); 300. > return; 301. } 302. crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free 51. EVP_MD_CTX_reset(ctx); 52. OPENSSL_free(ctx); 53. > } 54. 55. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) ssl/ssl_lib.c:4410:9: 4408. if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { 4409. EVP_MD_CTX_free(*hash); 4410. > *hash = NULL; 4411. return NULL; 4412. }
https://github.com/openssl/openssl/blob/16ff13427f00753a76672317143753b83cea7982/ssl/ssl_lib.c/#L4410
d2a_code_trace_data_43968
static inline void idct4row(DCTELEM *row) { int c0, c1, c2, c3, a0, a1, a2, a3; a0 = row[0]; a1 = row[1]; a2 = row[2]; a3 = row[3]; c0 = (a0 + a2)*R3 + (1 << (R_SHIFT - 1)); c2 = (a0 - a2)*R3 + (1 << (R_SHIFT - 1)); c1 = a1 * R1 + a3 * R2; c3 = a1 * R2 - a3 * R1; row[0]= (c0 + c1) >> R_SHIFT; row[1]= (c2 + c3) >> R_SHIFT; row[2]= (c2 - c3) >> R_SHIFT; row[3]= (c0 - c1) >> R_SHIFT; } libavcodec/wmv2.c:70: error: Buffer Overrun L1 Offset: [8, 64] (⇐ [5, 61] + 3) Size: 6 by call to `wmv2_add_block`. libavcodec/wmv2.c:70:5: Call 68. 69. wmv2_add_block(w, block1[4], dest_cb , s->uvlinesize, 4); 70. wmv2_add_block(w, block1[5], dest_cr , s->uvlinesize, 5); ^ 71. } 72. libavcodec/wmv2.c:35:1: Parameter `n` 33. } 34. 35. static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){ ^ 36. MpegEncContext * const s= &w->s; 37. libavcodec/wmv2.c:50:9: Call 48. case 2: 49. ff_simple_idct48_add(dst , stride, block1); 50. ff_simple_idct48_add(dst + 4 , stride, w->abt_block2[n]); ^ 51. memset(w->abt_block2[n], 0, 64*sizeof(DCTELEM)); 52. break; libavcodec/simple_idct.c:573:1: Parameter `*block` 571. } 572. 573. void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block) ^ 574. { 575. int i; libavcodec/simple_idct.c:579:9: Call 577. /* IDCT4 on each line */ 578. for(i=0; i<8; i++) { 579. idct4row(block + i*8); ^ 580. } 581. libavcodec/simple_idct.c:539:1: <Length trace> 537. #define R3 R_FIX(0.5) 538. #define R_SHIFT 11 539. static inline void idct4row(DCTELEM *row) ^ 540. { 541. int c0, c1, c2, c3, a0, a1, a2, a3; libavcodec/simple_idct.c:539:1: Parameter `*row` 537. #define R3 R_FIX(0.5) 538. #define R_SHIFT 11 539. static inline void idct4row(DCTELEM *row) ^ 540. { 541. int c0, c1, c2, c3, a0, a1, a2, a3; libavcodec/simple_idct.c:547:10: Array access: Offset: [8, 64] (⇐ [5, 61] + 3) Size: 6 by call to `wmv2_add_block` 545. a1 = row[1]; 546. a2 = row[2]; 547. a3 = row[3]; ^ 548. c0 = (a0 + a2)*R3 + (1 << (R_SHIFT - 1)); 549. c2 = (a0 - a2)*R3 + (1 << (R_SHIFT - 1));
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/simple_idct.c/#L547
d2a_code_trace_data_43969
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; pkt->written += len; pkt->curr += len; return 1; } ssl/t1_lib.c:1063: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + 19]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 12 steps of the trace ssl/t1_lib.c:1062:21: Call 1060. /* Sub-packet for servername list (always 1 hostname)*/ 1061. || !WPACKET_start_sub_packet_u16(pkt) 1062. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) ^ 1063. || !WPACKET_sub_memcpy_u16(pkt, s->tlsext_hostname, 1064. strlen(s->tlsext_hostname)) ssl/packet.c:242:1: Parameter `pkt->buf->length` 240. } 241. 242. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 243. { 244. unsigned char *data; ssl/t1_lib.c:1063:21: Call 1061. || !WPACKET_start_sub_packet_u16(pkt) 1062. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name) 1063. || !WPACKET_sub_memcpy_u16(pkt, s->tlsext_hostname, ^ 1064. strlen(s->tlsext_hostname)) 1065. || !WPACKET_close(pkt) ssl/packet.c:298:1: Parameter `pkt->written` 296. } 297. 298. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len, 299. size_t lenbytes) 300. { ssl/packet.c:301:10: Call 299. size_t lenbytes) 300. { 301. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 302. || !WPACKET_memcpy(pkt, src, len) 303. || !WPACKET_close(pkt)) ssl/packet.c:205:1: Parameter `pkt->written` 203. } 204. 205. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 206. { 207. WPACKET_SUB *sub; ssl/packet.c:229:10: Call 227. } 228. 229. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 230. return 0; 231. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */ ssl/packet.c:15:1: <LHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `pkt->buf->length` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: <RHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `len` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:25:9: Binary operation: ([0, +oo] - [0, s->s3->previous_client_finished_len + pkt->written + 19]):unsigned64 by call to `WPACKET_sub_memcpy__` 23. return 0; 24. 25. if (pkt->buf->length - pkt->written < len) { ^ 26. size_t newlen; 27. size_t reflen;
https://github.com/openssl/openssl/blob/a6972f346248fbc37e42056bb943fae0896a2967/ssl/packet.c/#L25
d2a_code_trace_data_43970
int ssl3_get_cert_verify(SSL *s) { EVP_PKEY *pkey=NULL; unsigned char *p; int al,ok,ret=0; long n; int type=0,i,j; X509 *peer; const EVP_MD *md = NULL; EVP_MD_CTX mctx; EVP_MD_CTX_init(&mctx); n=s->method->ssl_get_message(s, SSL3_ST_SR_CERT_VRFY_A, SSL3_ST_SR_CERT_VRFY_B, -1, 516, &ok); if (!ok) return((int)n); if (s->session->peer != NULL) { peer=s->session->peer; pkey=X509_get_pubkey(peer); type=X509_certificate_type(peer,pkey); } else { peer=NULL; pkey=NULL; } if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) { s->s3->tmp.reuse_message=1; if ((peer != NULL) && (type & EVP_PKT_SIGN)) { al=SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_MISSING_VERIFY_MESSAGE); goto f_err; } ret=1; goto end; } if (peer == NULL) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_NO_CLIENT_CERT_RECEIVED); al=SSL_AD_UNEXPECTED_MESSAGE; goto f_err; } if (!(type & EVP_PKT_SIGN)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE); al=SSL_AD_ILLEGAL_PARAMETER; goto f_err; } if (s->s3->change_cipher_spec) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_CCS_RECEIVED_EARLY); al=SSL_AD_UNEXPECTED_MESSAGE; goto f_err; } p=(unsigned char *)s->init_msg; if (n==64 && (pkey->type==NID_id_GostR3410_94 || pkey->type == NID_id_GostR3410_2001) ) { i=64; } else { if (SSL_USE_SIGALGS(s)) { int rv = tls12_check_peer_sigalg(&md, s, p, pkey); if (rv == -1) { al = SSL_AD_INTERNAL_ERROR; goto f_err; } else if (rv == 0) { al = SSL_AD_DECODE_ERROR; goto f_err; } #ifdef SSL_DEBUG fprintf(stderr, "USING TLSv1.2 HASH %s\n", EVP_MD_name(md)); #endif p += 2; n -= 2; } n2s(p,i); n-=2; if (i > n) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_LENGTH_MISMATCH); al=SSL_AD_DECODE_ERROR; goto f_err; } } j=EVP_PKEY_size(pkey); if ((i > j) || (n > j) || (n <= 0)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_WRONG_SIGNATURE_SIZE); al=SSL_AD_DECODE_ERROR; goto f_err; } if (SSL_USE_SIGALGS(s)) { long hdatalen = 0; void *hdata; hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); if (hdatalen <= 0) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); al=SSL_AD_INTERNAL_ERROR; goto f_err; } #ifdef SSL_DEBUG fprintf(stderr, "Using TLS 1.2 with client verify alg %s\n", EVP_MD_name(md)); #endif if (!EVP_VerifyInit_ex(&mctx, md, NULL) || !EVP_VerifyUpdate(&mctx, hdata, hdatalen)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_EVP_LIB); al=SSL_AD_INTERNAL_ERROR; goto f_err; } if (EVP_VerifyFinal(&mctx, p , i, pkey) <= 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_SIGNATURE); goto f_err; } } else #ifndef OPENSSL_NO_RSA if (pkey->type == EVP_PKEY_RSA) { i=RSA_verify(NID_md5_sha1, s->s3->tmp.cert_verify_md, MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH, p, i, pkey->pkey.rsa); if (i < 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_RSA_DECRYPT); goto f_err; } if (i == 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_RSA_SIGNATURE); goto f_err; } } else #endif #ifndef OPENSSL_NO_DSA if (pkey->type == EVP_PKEY_DSA) { j=DSA_verify(pkey->save_type, &(s->s3->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH,p,i,pkey->pkey.dsa); if (j <= 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_DSA_SIGNATURE); goto f_err; } } else #endif #ifndef OPENSSL_NO_ECDSA if (pkey->type == EVP_PKEY_EC) { j=ECDSA_verify(pkey->save_type, &(s->s3->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), SHA_DIGEST_LENGTH,p,i,pkey->pkey.ec); if (j <= 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_ECDSA_SIGNATURE); goto f_err; } } else #endif if (pkey->type == NID_id_GostR3410_94 || pkey->type == NID_id_GostR3410_2001) { unsigned char signature[64]; int idx; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey,NULL); EVP_PKEY_verify_init(pctx); if (i!=64) { fprintf(stderr,"GOST signature length is %d",i); } for (idx=0;idx<64;idx++) { signature[63-idx]=p[idx]; } j=EVP_PKEY_verify(pctx,signature,64,s->s3->tmp.cert_verify_md,32); EVP_PKEY_CTX_free(pctx); if (j<=0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_ECDSA_SIGNATURE); goto f_err; } } else { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,ERR_R_INTERNAL_ERROR); al=SSL_AD_UNSUPPORTED_CERTIFICATE; goto f_err; } ret=1; if (0) { f_err: ssl3_send_alert(s,SSL3_AL_FATAL,al); } end: if (s->s3->handshake_buffer) { BIO_free(s->s3->handshake_buffer); s->s3->handshake_buffer = NULL; s->s3->flags &= ~TLS1_FLAGS_KEEP_HANDSHAKE; } EVP_MD_CTX_cleanup(&mctx); EVP_PKEY_free(pkey); return(ret); } ssl/s3_srvr.c:3138: error: NULL_DEREFERENCE pointer `pkey` last assigned on line 3090 could be null and is dereferenced at line 3138, column 16. Showing all 27 steps of the trace ssl/s3_srvr.c:3066:1: start of procedure ssl3_get_cert_verify() 3064. } 3065. 3066. > int ssl3_get_cert_verify(SSL *s) 3067. { 3068. EVP_PKEY *pkey=NULL; ssl/s3_srvr.c:3068:2: 3066. int ssl3_get_cert_verify(SSL *s) 3067. { 3068. > EVP_PKEY *pkey=NULL; 3069. unsigned char *p; 3070. int al,ok,ret=0; ssl/s3_srvr.c:3070:2: 3068. EVP_PKEY *pkey=NULL; 3069. unsigned char *p; 3070. > int al,ok,ret=0; 3071. long n; 3072. int type=0,i,j; ssl/s3_srvr.c:3072:2: 3070. int al,ok,ret=0; 3071. long n; 3072. > int type=0,i,j; 3073. X509 *peer; 3074. const EVP_MD *md = NULL; ssl/s3_srvr.c:3074:2: 3072. int type=0,i,j; 3073. X509 *peer; 3074. > const EVP_MD *md = NULL; 3075. EVP_MD_CTX mctx; 3076. EVP_MD_CTX_init(&mctx); ssl/s3_srvr.c:3076:2: 3074. const EVP_MD *md = NULL; 3075. EVP_MD_CTX mctx; 3076. > EVP_MD_CTX_init(&mctx); 3077. 3078. n=s->method->ssl_get_message(s, crypto/evp/digest.c:120:1: start of procedure EVP_MD_CTX_init() 118. #endif 119. 120. > void EVP_MD_CTX_init(EVP_MD_CTX *ctx) 121. { 122. memset(ctx,'\0',sizeof *ctx); crypto/evp/digest.c:122:2: 120. void EVP_MD_CTX_init(EVP_MD_CTX *ctx) 121. { 122. > memset(ctx,'\0',sizeof *ctx); 123. } 124. crypto/evp/digest.c:123:2: return from a call to EVP_MD_CTX_init 121. { 122. memset(ctx,'\0',sizeof *ctx); 123. } ^ 124. 125. EVP_MD_CTX *EVP_MD_CTX_create(void) ssl/s3_srvr.c:3078:2: Skipping __function_pointer__(): unresolved function pointer 3076. EVP_MD_CTX_init(&mctx); 3077. 3078. n=s->method->ssl_get_message(s, ^ 3079. SSL3_ST_SR_CERT_VRFY_A, 3080. SSL3_ST_SR_CERT_VRFY_B, ssl/s3_srvr.c:3085:7: Taking false branch 3083. &ok); 3084. 3085. if (!ok) return((int)n); ^ 3086. 3087. if (s->session->peer != NULL) ssl/s3_srvr.c:3087:6: Taking true branch 3085. if (!ok) return((int)n); 3086. 3087. if (s->session->peer != NULL) ^ 3088. { 3089. peer=s->session->peer; ssl/s3_srvr.c:3089:3: 3087. if (s->session->peer != NULL) 3088. { 3089. > peer=s->session->peer; 3090. pkey=X509_get_pubkey(peer); 3091. type=X509_certificate_type(peer,pkey); ssl/s3_srvr.c:3090:3: 3088. { 3089. peer=s->session->peer; 3090. > pkey=X509_get_pubkey(peer); 3091. type=X509_certificate_type(peer,pkey); 3092. } crypto/x509/x509_cmp.c:313:1: start of procedure X509_get_pubkey() 311. } 312. 313. > EVP_PKEY *X509_get_pubkey(X509 *x) 314. { 315. if ((x == NULL) || (x->cert_info == NULL)) crypto/x509/x509_cmp.c:315:7: Taking false branch 313. EVP_PKEY *X509_get_pubkey(X509 *x) 314. { 315. if ((x == NULL) || (x->cert_info == NULL)) ^ 316. return(NULL); 317. return(X509_PUBKEY_get(x->cert_info->key)); crypto/x509/x509_cmp.c:315:22: Taking true branch 313. EVP_PKEY *X509_get_pubkey(X509 *x) 314. { 315. if ((x == NULL) || (x->cert_info == NULL)) ^ 316. return(NULL); 317. return(X509_PUBKEY_get(x->cert_info->key)); crypto/x509/x509_cmp.c:316:3: 314. { 315. if ((x == NULL) || (x->cert_info == NULL)) 316. > return(NULL); 317. return(X509_PUBKEY_get(x->cert_info->key)); 318. } crypto/x509/x509_cmp.c:318:2: return from a call to X509_get_pubkey 316. return(NULL); 317. return(X509_PUBKEY_get(x->cert_info->key)); 318. } ^ 319. 320. ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) ssl/s3_srvr.c:3091:3: Skipping X509_certificate_type(): empty list of specs 3089. peer=s->session->peer; 3090. pkey=X509_get_pubkey(peer); 3091. type=X509_certificate_type(peer,pkey); ^ 3092. } 3093. else ssl/s3_srvr.c:3099:6: Taking false branch 3097. } 3098. 3099. if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) ^ 3100. { 3101. s->s3->tmp.reuse_message=1; ssl/s3_srvr.c:3112:6: Taking false branch 3110. } 3111. 3112. if (peer == NULL) ^ 3113. { 3114. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_NO_CLIENT_CERT_RECEIVED); ssl/s3_srvr.c:3119:8: Taking false branch 3117. } 3118. 3119. if (!(type & EVP_PKT_SIGN)) ^ 3120. { 3121. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE); ssl/s3_srvr.c:3126:6: Taking false branch 3124. } 3125. 3126. if (s->s3->change_cipher_spec) ^ 3127. { 3128. SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_CCS_RECEIVED_EARLY); ssl/s3_srvr.c:3134:2: 3132. 3133. /* we now have a signature that we need to verify */ 3134. > p=(unsigned char *)s->init_msg; 3135. /* Check for broken implementations of GOST ciphersuites */ 3136. /* If key is GOST and n is exactly 64, it is bare ssl/s3_srvr.c:3138:6: Taking true branch 3136. /* If key is GOST and n is exactly 64, it is bare 3137. * signature without length field */ 3138. if (n==64 && (pkey->type==NID_id_GostR3410_94 || ^ 3139. pkey->type == NID_id_GostR3410_2001) ) 3140. { ssl/s3_srvr.c:3138:16: 3136. /* If key is GOST and n is exactly 64, it is bare 3137. * signature without length field */ 3138. > if (n==64 && (pkey->type==NID_id_GostR3410_94 || 3139. pkey->type == NID_id_GostR3410_2001) ) 3140. {
https://github.com/openssl/openssl/blob/7e965dcc3812ac6ec4d1413c5ea3224be6486c8f/ssl/s3_srvr.c/#L3138
d2a_code_trace_data_43971
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_gen.c:199: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse`. Showing all 44 steps of the trace crypto/rsa/rsa_gen.c:97:5: Call 95. if (ctx == NULL) 96. goto err; 97. BN_CTX_start(ctx); ^ 98. r0 = BN_CTX_get(ctx); 99. r1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/rsa/rsa_gen.c:199:17: Call 197. ERR_set_mark(); 198. BN_set_flags(r2, BN_FLG_CONSTTIME); 199. if (BN_mod_inverse(r1, r2, rsa->e, ctx) != NULL) { ^ 200. /* GCD == 1 since inverse exists */ 201. break; crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth` 122. BN_CTX *ctx); 123. 124. > BIGNUM *BN_mod_inverse(BIGNUM *in, 125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 126. { crypto/bn/bn_gcd.c:129:10: Call 127. BIGNUM *rv; 128. int noinv; 129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 130. if (noinv) 131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth` 133. } 134. 135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 137. int *pnoinv) crypto/bn/bn_gcd.c:155:16: Call 153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 155. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 156. } 157. crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth` 456. * not contain branches that may leak sensitive information. 457. */ 458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 459. const BIGNUM *a, const BIGNUM *n, 460. BN_CTX *ctx) crypto/bn/bn_gcd.c:469:5: Call 467. bn_check_top(n); 468. 469. BN_CTX_start(ctx); ^ 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_gcd.c:470:9: Call 468. 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); ^ 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:471:9: Call 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); ^ 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:472:9: Call 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); ^ 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:473:9: Call 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); ^ 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:474:9: Call 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); ^ 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:475:9: Call 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); ^ 476. T = BN_CTX_get(ctx); 477. if (T == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:476:9: Call 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); ^ 477. if (T == NULL) 478. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:504:18: Call 502. bn_init(&local_B); 503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 504. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 505. goto err; 506. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:264:1: Parameter `ctx->stack.depth` 262. * divisor's length is considered public; 263. */ 264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 265. const BIGNUM *divisor, BN_CTX *ctx) 266. { 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.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:282:11: Call 280. BN_CTX_start(ctx); 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); ^ 283. snum = BN_CTX_get(ctx); 284. sdiv = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_div.c:283:12: Call 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); 283. snum = BN_CTX_get(ctx); ^ 284. sdiv = BN_CTX_get(ctx); 285. if (sdiv == 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_div.c:284:12: Call 282. tmp = BN_CTX_get(ctx); 283. snum = BN_CTX_get(ctx); 284. sdiv = BN_CTX_get(ctx); ^ 285. if (sdiv == NULL) 286. 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_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.depth` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <LHS trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43972
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) { offset = BN_CTX_POOL_SIZE - 1; p->current = p->current->prev; } else offset--; } } crypto/rsa/rsa_crpt.c:184: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse`. Showing all 36 steps of the trace crypto/rsa/rsa_crpt.c:182:7: Call 180. if (!BN_sub(r1, p, BN_value_one())) goto err; 181. if (!BN_sub(r2, q, BN_value_one())) goto err; 182. if (!BN_mul(r0, r1, r2, ctx)) goto err; ^ 183. 184. ret = BN_mod_inverse(NULL, d, r0, ctx); crypto/bn/bn_mul.c:943:1: Parameter `ctx->pool.used` 941. #endif /* BN_RECURSION */ 942. 943. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 944. { 945. int ret=0; crypto/rsa/rsa_crpt.c:184:8: Call 182. if (!BN_mul(r0, r1, r2, ctx)) goto err; 183. 184. ret = BN_mod_inverse(NULL, d, r0, ctx); ^ 185. err: 186. BN_CTX_end(ctx); crypto/bn/bn_gcd.c:209:1: Parameter `ctx->pool.used` 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->pool.used` 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:520:6: Call 518. 519. BN_CTX_start(ctx); 520. A = BN_CTX_get(ctx); ^ 521. B = BN_CTX_get(ctx); 522. X = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; crypto/bn/bn_gcd.c:521:6: Call 519. BN_CTX_start(ctx); 520. A = BN_CTX_get(ctx); 521. B = BN_CTX_get(ctx); ^ 522. X = BN_CTX_get(ctx); 523. D = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; crypto/bn/bn_gcd.c:522:6: Call 520. A = BN_CTX_get(ctx); 521. B = BN_CTX_get(ctx); 522. X = BN_CTX_get(ctx); ^ 523. D = BN_CTX_get(ctx); 524. M = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; crypto/bn/bn_gcd.c:523:6: Call 521. B = BN_CTX_get(ctx); 522. X = BN_CTX_get(ctx); 523. D = BN_CTX_get(ctx); ^ 524. M = BN_CTX_get(ctx); 525. Y = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; crypto/bn/bn_gcd.c:524:6: Call 522. X = BN_CTX_get(ctx); 523. D = BN_CTX_get(ctx); 524. M = BN_CTX_get(ctx); ^ 525. Y = BN_CTX_get(ctx); 526. T = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; crypto/bn/bn_gcd.c:525:6: Call 523. D = BN_CTX_get(ctx); 524. M = BN_CTX_get(ctx); 525. Y = BN_CTX_get(ctx); ^ 526. T = BN_CTX_get(ctx); 527. if (T == NULL) goto err; crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; crypto/bn/bn_gcd.c:526:6: Call 524. M = BN_CTX_get(ctx); 525. Y = BN_CTX_get(ctx); 526. T = BN_CTX_get(ctx); ^ 527. if (T == NULL) goto err; 528. crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; 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->pool.used` 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->pool.used` 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:227:6: Call 225. 226. BN_CTX_start(ctx); 227. tmp=BN_CTX_get(ctx); ^ 228. snum=BN_CTX_get(ctx); 229. sdiv=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; crypto/bn/bn_div.c:228:7: Call 226. BN_CTX_start(ctx); 227. tmp=BN_CTX_get(ctx); 228. snum=BN_CTX_get(ctx); ^ 229. sdiv=BN_CTX_get(ctx); 230. if (dv == NULL) crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; crypto/bn/bn_div.c:229:7: Call 227. tmp=BN_CTX_get(ctx); 228. snum=BN_CTX_get(ctx); 229. sdiv=BN_CTX_get(ctx); ^ 230. if (dv == NULL) 231. res=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used` 286. } 287. 288. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 289. { 290. BIGNUM *ret; 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->pool.used` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:280:4: Call 278. /* Does this stack frame have anything to release? */ 279. if(fp < ctx->used) 280. BN_POOL_release(&ctx->pool, ctx->used - fp); ^ 281. ctx->used = fp; 282. /* Unjam "too_many" in case "get" had failed */ crypto/bn/bn_ctx.c:438:1: <LHS trace> 436. } 437. 438. > static void BN_POOL_release(BN_POOL *p, unsigned int num) 439. { 440. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; crypto/bn/bn_ctx.c:438:1: Parameter `p->used` 436. } 437. 438. > static void BN_POOL_release(BN_POOL *p, unsigned int num) 439. { 440. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; crypto/bn/bn_ctx.c:440:2: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse` 438. static void BN_POOL_release(BN_POOL *p, unsigned int num) 439. { 440. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; ^ 441. p->used -= num; 442. while(num--)
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/bn/bn_ctx.c/#L440
d2a_code_trace_data_43973
static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap, int width, int height) { uint8_t *src_m1, *src_0, *src_p1, *src_p2; int y; uint8_t *buf; buf = (uint8_t*)av_malloc(width); src_m1 = src1; memcpy(buf,src_m1,width); src_0=&src_m1[src_wrap]; src_p1=&src_0[src_wrap]; src_p2=&src_p1[src_wrap]; for(y=0;y<(height-2);y+=2) { deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width); src_m1 = src_p1; src_0 = src_p2; src_p1 += 2*src_wrap; src_p2 += 2*src_wrap; } deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width); av_free(buf); } libavcodec/imgconvert.c:1456: error: Null Dereference pointer `buf` last assigned on line 1453 could be null and is dereferenced by call to `memcpy()` at line 1456, column 5. libavcodec/imgconvert.c:1447:1: start of procedure deinterlace_bottom_field_inplace() 1445. } 1446. 1447. static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap, ^ 1448. int width, int height) 1449. { libavcodec/imgconvert.c:1453:5: 1451. int y; 1452. uint8_t *buf; 1453. buf = (uint8_t*)av_malloc(width); ^ 1454. 1455. src_m1 = src1; libavutil/mem.c:47:1: start of procedure av_malloc() 45. linker will do it automatically. */ 46. 47. void *av_malloc(unsigned int size) ^ 48. { 49. void *ptr = NULL; libavutil/mem.c:49:5: 47. void *av_malloc(unsigned int size) 48. { 49. void *ptr = NULL; ^ 50. #if CONFIG_MEMALIGN_HACK 51. long diff; libavutil/mem.c:55:8: Taking true branch 53. 54. /* let's disallow possible ambiguous cases */ 55. if(size > (INT_MAX-16) ) ^ 56. return NULL; 57. libavutil/mem.c:56:9: 54. /* let's disallow possible ambiguous cases */ 55. if(size > (INT_MAX-16) ) 56. return NULL; ^ 57. 58. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:100:1: return from a call to av_malloc 98. #endif 99. return ptr; 100. } ^ 101. 102. void *av_realloc(void *ptr, unsigned int size) libavcodec/imgconvert.c:1455:5: 1453. buf = (uint8_t*)av_malloc(width); 1454. 1455. src_m1 = src1; ^ 1456. memcpy(buf,src_m1,width); 1457. src_0=&src_m1[src_wrap]; libavcodec/imgconvert.c:1456:5: 1454. 1455. src_m1 = src1; 1456. memcpy(buf,src_m1,width); ^ 1457. src_0=&src_m1[src_wrap]; 1458. src_p1=&src_0[src_wrap];
https://github.com/libav/libav/blob/184bc53db4fded8857af09cee2adc7197940deb7/libavcodec/imgconvert.c/#L1456
d2a_code_trace_data_43974
int test_gf2m_mod_sqr(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b[2], *c, *d; int i, j, ret = 0; int p0[] = { 163, 7, 6, 3, 0, -1 }; int p1[] = { 193, 15, 0, -1 }; a = BN_new(); b[0] = BN_new(); b[1] = BN_new(); c = BN_new(); d = BN_new(); BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); for (i = 0; i < num0; i++) { BN_bntest_rand(a, 1024, 0, 0); for (j = 0; j < 2; j++) { BN_GF2m_mod_sqr(c, a, b[j], ctx); BN_copy(d, a); BN_GF2m_mod_mul(d, a, d, b[j], ctx); BN_GF2m_add(d, c, d); if (!BN_is_zero(d)) { fprintf(stderr, "GF(2^m) modular squaring test failed!\n"); goto err; } } } ret = 1; err: BN_free(a); BN_free(b[0]); BN_free(b[1]); BN_free(c); BN_free(d); return ret; } test/bntest.c:1385: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 1360, column 9 is not reachable after line 1385, column 5. Showing all 133 steps of the trace test/bntest.c:1353:1: start of procedure test_gf2m_mod_sqr() 1351. } 1352. 1353. > int test_gf2m_mod_sqr(BIO *bp, BN_CTX *ctx) 1354. { 1355. BIGNUM *a, *b[2], *c, *d; test/bntest.c:1356:5: 1354. { 1355. BIGNUM *a, *b[2], *c, *d; 1356. > int i, j, ret = 0; 1357. int p0[] = { 163, 7, 6, 3, 0, -1 }; 1358. int p1[] = { 193, 15, 0, -1 }; test/bntest.c:1357:5: 1355. BIGNUM *a, *b[2], *c, *d; 1356. int i, j, ret = 0; 1357. > int p0[] = { 163, 7, 6, 3, 0, -1 }; 1358. int p1[] = { 193, 15, 0, -1 }; 1359. test/bntest.c:1358:5: 1356. int i, j, ret = 0; 1357. int p0[] = { 163, 7, 6, 3, 0, -1 }; 1358. > int p1[] = { 193, 15, 0, -1 }; 1359. 1360. a = BN_new(); test/bntest.c:1360:5: 1358. int p1[] = { 193, 15, 0, -1 }; 1359. 1360. > a = BN_new(); 1361. b[0] = BN_new(); 1362. b[1] = 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:1361:5: 1359. 1360. a = BN_new(); 1361. > b[0] = BN_new(); 1362. b[1] = BN_new(); 1363. 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:1362:5: 1360. a = BN_new(); 1361. b[0] = BN_new(); 1362. > b[1] = BN_new(); 1363. c = BN_new(); 1364. 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:1363:5: 1361. b[0] = BN_new(); 1362. b[1] = BN_new(); 1363. > c = BN_new(); 1364. d = BN_new(); 1365. 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:1364:5: 1362. b[1] = BN_new(); 1363. c = BN_new(); 1364. > d = BN_new(); 1365. 1366. BN_GF2m_arr2poly(p0, b[0]); 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:1366:5: Skipping BN_GF2m_arr2poly(): empty list of specs 1364. d = BN_new(); 1365. 1366. BN_GF2m_arr2poly(p0, b[0]); ^ 1367. BN_GF2m_arr2poly(p1, b[1]); 1368. test/bntest.c:1367:5: Skipping BN_GF2m_arr2poly(): empty list of specs 1365. 1366. BN_GF2m_arr2poly(p0, b[0]); 1367. BN_GF2m_arr2poly(p1, b[1]); ^ 1368. 1369. for (i = 0; i < num0; i++) { test/bntest.c:1369:10: 1367. BN_GF2m_arr2poly(p1, b[1]); 1368. 1369. > for (i = 0; i < num0; i++) { 1370. BN_bntest_rand(a, 1024, 0, 0); 1371. for (j = 0; j < 2; j++) { test/bntest.c:1369:17: Loop condition is false. Leaving loop 1367. BN_GF2m_arr2poly(p1, b[1]); 1368. 1369. for (i = 0; i < num0; i++) { ^ 1370. BN_bntest_rand(a, 1024, 0, 0); 1371. for (j = 0; j < 2; j++) { test/bntest.c:1383:5: 1381. } 1382. } 1383. > ret = 1; 1384. err: 1385. BN_free(a); test/bntest.c:1384:2: 1382. } 1383. ret = 1; 1384. > err: 1385. BN_free(a); 1386. BN_free(b[0]); test/bntest.c:1385:5: 1383. ret = 1; 1384. err: 1385. > BN_free(a); 1386. BN_free(b[0]); 1387. BN_free(b[1]); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L1385
d2a_code_trace_data_43975
static int epzs_motion_search4(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d, dmin; int map_generation; const int penalty_factor= c->penalty_factor; const int size=1; const int h=8; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON int flags= c->flags; LOAD_COMMON2 cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; map_generation= update_map_generation(c); dmin = 1000000; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) }else{ CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) } if(dmin>64*4){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1166: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1166:9: 1164. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) 1165. //FIXME try some early stop 1166. CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) ^ 1167. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) 1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1166
d2a_code_trace_data_43976
static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){ MpegEncContext * const s = &h->s; static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3}; int level[16]; int zeros_left, coeff_num, coeff_token, total_coeff, i, j, trailing_ones, run_before; if(n == CHROMA_DC_BLOCK_INDEX){ coeff_token= get_vlc2(gb, chroma_dc_coeff_token_vlc.table, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 1); total_coeff= coeff_token>>2; }else{ if(n == LUMA_DC_BLOCK_INDEX){ total_coeff= pred_non_zero_count(h, 0); coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2); total_coeff= coeff_token>>2; }else{ total_coeff= pred_non_zero_count(h, n); coeff_token= get_vlc2(gb, coeff_token_vlc[ coeff_token_table_index[total_coeff] ].table, COEFF_TOKEN_VLC_BITS, 2); total_coeff= coeff_token>>2; h->non_zero_count_cache[ scan8[n] ]= total_coeff; } } if(total_coeff==0) return 0; if(total_coeff > (unsigned)max_coeff) { av_log(h->s.avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff=%d)\n", s->mb_x, s->mb_y, total_coeff); return -1; } trailing_ones= coeff_token&3; tprintf(h->s.avctx, "trailing:%d, total:%d\n", trailing_ones, total_coeff); assert(total_coeff<=16); for(i=0; i<trailing_ones; i++){ level[i]= 1 - 2*get_bits1(gb); } if(i<total_coeff) { int level_code, mask; int suffix_length = total_coeff > 10 && trailing_ones < 3; int prefix= get_level_prefix(gb); if(prefix<14){ if(suffix_length) level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); else level_code= (prefix<<suffix_length); }else if(prefix==14){ if(suffix_length) level_code= (prefix<<suffix_length) + get_bits(gb, suffix_length); else level_code= prefix + get_bits(gb, 4); }else if(prefix==15){ level_code= (prefix<<suffix_length) + get_bits(gb, 12); if(suffix_length==0) level_code+=15; }else{ av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y); return -1; } if(trailing_ones < 3) level_code += 2; suffix_length = 1; if(level_code > 5) suffix_length++; mask= -(level_code&1); level[i]= (((2+level_code)>>1) ^ mask) - mask; i++; for(;i<total_coeff;i++) { static const int suffix_limit[7] = {0,5,11,23,47,95,INT_MAX }; prefix = get_level_prefix(gb); if(prefix<15){ level_code = (prefix<<suffix_length) + get_bits(gb, suffix_length); }else if(prefix==15){ level_code = (prefix<<suffix_length) + get_bits(gb, 12); }else{ av_log(h->s.avctx, AV_LOG_ERROR, "prefix too large at %d %d\n", s->mb_x, s->mb_y); return -1; } mask= -(level_code&1); level[i]= (((2+level_code)>>1) ^ mask) - mask; if(level_code > suffix_limit[suffix_length]) suffix_length++; } } if(total_coeff == max_coeff) zeros_left=0; else{ if(n == CHROMA_DC_BLOCK_INDEX) zeros_left= get_vlc2(gb, chroma_dc_total_zeros_vlc[ total_coeff-1 ].table, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1); else zeros_left= get_vlc2(gb, total_zeros_vlc[ total_coeff-1 ].table, TOTAL_ZEROS_VLC_BITS, 1); } coeff_num = zeros_left + total_coeff - 1; j = scantable[coeff_num]; if(n > 24){ block[j] = level[0]; for(i=1;i<total_coeff;i++) { if(zeros_left <= 0) run_before = 0; else if(zeros_left < 7){ run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1); }else{ run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); } zeros_left -= run_before; coeff_num -= 1 + run_before; j= scantable[ coeff_num ]; block[j]= level[i]; } }else{ block[j] = (level[0] * qmul[j] + 32)>>6; for(i=1;i<total_coeff;i++) { if(zeros_left <= 0) run_before = 0; else if(zeros_left < 7){ run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1); }else{ run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); } zeros_left -= run_before; coeff_num -= 1 + run_before; j= scantable[ coeff_num ]; block[j]= (level[i] * qmul[j] + 32)>>6; } } if(zeros_left<0){ av_log(h->s.avctx, AV_LOG_ERROR, "negative number of zero coeffs at %d %d\n", s->mb_x, s->mb_y); return -1; } return 0; } libavcodec/h264.c:4429: error: Uninitialized Value The value read from level[_] was never initialized. libavcodec/h264.c:4429:13: 4427. j= scantable[ coeff_num ]; 4428. 4429. block[j]= (level[i] * qmul[j] + 32)>>6; ^ 4430. } 4431. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L4429
d2a_code_trace_data_43977
static int www_body(char *hostname, int s, int stype, unsigned char *context) { char *buf = NULL; int ret = 1; int i, j, k, dot; SSL *con; const SSL_CIPHER *c; BIO *io, *ssl_bio, *sbio; #ifdef RENEG int total_bytes = 0; #endif int width; fd_set readfds; width = s + 1; buf = app_malloc(bufsize, "server www buffer"); io = BIO_new(BIO_f_buffer()); ssl_bio = BIO_new(BIO_f_ssl()); if ((io == NULL) || (ssl_bio == NULL)) goto err; #ifdef FIONBIO if (s_nbio) { unsigned long sl = 1; if (!s_quiet) BIO_printf(bio_err, "turning on non blocking io\n"); if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) ERR_print_errors(bio_err); } #endif if (!BIO_set_write_buffer_size(io, bufsize)) goto err; if ((con = SSL_new(ctx)) == NULL) goto err; if (s_tlsextdebug) { SSL_set_tlsext_debug_callback(con, tlsext_cb); SSL_set_tlsext_debug_arg(con, bio_s_out); } if (context && !SSL_set_session_id_context(con, context, strlen((char *)context))) goto err; sbio = BIO_new_socket(s, BIO_NOCLOSE); if (s_nbio_test) { BIO *test; test = BIO_new(BIO_f_nbio_test()); sbio = BIO_push(test, sbio); } SSL_set_bio(con, sbio, sbio); SSL_set_accept_state(con); BIO_set_ssl(ssl_bio, con, BIO_CLOSE); BIO_push(io, ssl_bio); #ifdef CHARSET_EBCDIC io = BIO_push(BIO_new(BIO_f_ebcdic_filter()), io); #endif if (s_debug) { BIO_set_callback(SSL_get_rbio(con), bio_dump_callback); BIO_set_callback_arg(SSL_get_rbio(con), (char *)bio_s_out); } if (s_msg) { #ifndef OPENSSL_NO_SSL_TRACE if (s_msg == 2) SSL_set_msg_callback(con, SSL_trace); else #endif SSL_set_msg_callback(con, msg_cb); SSL_set_msg_callback_arg(con, bio_s_msg ? bio_s_msg : bio_s_out); } for (;;) { i = BIO_gets(io, buf, bufsize - 1); if (i < 0) { if (!BIO_should_retry(io) && !SSL_waiting_for_async(con)) { if (!s_quiet) ERR_print_errors(bio_err); goto err; } else { BIO_printf(bio_s_out, "read R BLOCK\n"); #ifndef OPENSSL_NO_SRP if (BIO_should_io_special(io) && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP renego during read\n"); srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); else BIO_printf(bio_s_out, "LOOKUP not successful\n"); continue; } #endif #if defined(OPENSSL_SYS_NETWARE) delay(1000); #elif !defined(OPENSSL_SYS_MSDOS) sleep(1); #endif continue; } } else if (i == 0) { ret = 1; goto end; } if (((www == 1) && (strncmp("GET ", buf, 4) == 0)) || ((www == 2) && (strncmp("GET /stats ", buf, 11) == 0))) { char *p; X509 *peer; STACK_OF(SSL_CIPHER) *sk; static const char *space = " "; if (www == 1 && strncmp("GET /reneg", buf, 10) == 0) { if (strncmp("GET /renegcert", buf, 14) == 0) SSL_set_verify(con, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, NULL); i = SSL_renegotiate(con); BIO_printf(bio_s_out, "SSL_renegotiate -> %d\n", i); i = SSL_do_handshake(con); if (i <= 0) { BIO_printf(bio_s_out, "SSL_do_handshake() Retval %d\n", SSL_get_error(con, i)); ERR_print_errors(bio_err); goto err; } FD_ZERO(&readfds); openssl_fdset(s, &readfds); i = select(width, (void *)&readfds, NULL, NULL, NULL); if (i <= 0 || !FD_ISSET(s, &readfds)) { BIO_printf(bio_s_out, "Error waiting for client response\n"); ERR_print_errors(bio_err); goto err; } BIO_gets(io, buf, bufsize - 1); } BIO_puts(io, "HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n"); BIO_puts(io, "<HTML><BODY BGCOLOR=\"#ffffff\">\n"); BIO_puts(io, "<pre>\n"); BIO_puts(io, "\n"); for (i = 0; i < local_argc; i++) { const char *myp; for (myp = local_argv[i]; *myp; myp++) switch (*myp) { case '<': BIO_puts(io, "&lt;"); break; case '>': BIO_puts(io, "&gt;"); break; case '&': BIO_puts(io, "&amp;"); break; default: BIO_write(io, myp, 1); break; } BIO_write(io, " ", 1); } BIO_puts(io, "\n"); BIO_printf(io, "Secure Renegotiation IS%s supported\n", SSL_get_secure_renegotiation_support(con) ? "" : " NOT"); BIO_printf(io, "Ciphers supported in s_server binary\n"); sk = SSL_get_ciphers(con); j = sk_SSL_CIPHER_num(sk); for (i = 0; i < j; i++) { c = sk_SSL_CIPHER_value(sk, i); BIO_printf(io, "%-11s:%-25s ", SSL_CIPHER_get_version(c), SSL_CIPHER_get_name(c)); if ((((i + 1) % 2) == 0) && (i + 1 != j)) BIO_puts(io, "\n"); } BIO_puts(io, "\n"); p = SSL_get_shared_ciphers(con, buf, bufsize); if (p != NULL) { BIO_printf(io, "---\nCiphers common between both SSL end points:\n"); j = i = 0; while (*p) { if (*p == ':') { BIO_write(io, space, 26 - j); i++; j = 0; BIO_write(io, ((i % 3) ? " " : "\n"), 1); } else { BIO_write(io, p, 1); j++; } p++; } BIO_puts(io, "\n"); } ssl_print_sigalgs(io, con); #ifndef OPENSSL_NO_EC ssl_print_curves(io, con, 0); #endif BIO_printf(io, (SSL_cache_hit(con) ? "---\nReused, " : "---\nNew, ")); c = SSL_get_current_cipher(con); BIO_printf(io, "%s, Cipher is %s\n", SSL_CIPHER_get_version(c), SSL_CIPHER_get_name(c)); SSL_SESSION_print(io, SSL_get_session(con)); BIO_printf(io, "---\n"); print_stats(io, SSL_get_SSL_CTX(con)); BIO_printf(io, "---\n"); peer = SSL_get_peer_certificate(con); if (peer != NULL) { BIO_printf(io, "Client certificate\n"); X509_print(io, peer); PEM_write_bio_X509(io, peer); } else BIO_puts(io, "no client certificate available\n"); BIO_puts(io, "</BODY></HTML>\r\n\r\n"); break; } else if ((www == 2 || www == 3) && (strncmp("GET /", buf, 5) == 0)) { BIO *file; char *p, *e; static const char *text = "HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n"; p = &(buf[5]); dot = 1; for (e = p; *e != '\0'; e++) { if (e[0] == ' ') break; switch (dot) { case 1: dot = (e[0] == '.') ? 2 : 0; break; case 2: dot = (e[0] == '.') ? 3 : 0; break; case 3: dot = (e[0] == '/') ? -1 : 0; break; } if (dot == 0) dot = (e[0] == '/') ? 1 : 0; } dot = (dot == 3) || (dot == -1); if (*e == '\0') { BIO_puts(io, text); BIO_printf(io, "'%s' is an invalid file name\r\n", p); break; } *e = '\0'; if (dot) { BIO_puts(io, text); BIO_printf(io, "'%s' contains '..' reference\r\n", p); break; } if (*p == '/') { BIO_puts(io, text); BIO_printf(io, "'%s' is an invalid path\r\n", p); break; } if (app_isdir(p) > 0) { BIO_puts(io, text); BIO_printf(io, "'%s' is a directory\r\n", p); break; } if ((file = BIO_new_file(p, "r")) == NULL) { BIO_puts(io, text); BIO_printf(io, "Error opening '%s'\r\n", p); ERR_print_errors(io); break; } if (!s_quiet) BIO_printf(bio_err, "FILE:%s\n", p); if (www == 2) { i = strlen(p); if (((i > 5) && (strcmp(&(p[i - 5]), ".html") == 0)) || ((i > 4) && (strcmp(&(p[i - 4]), ".php") == 0)) || ((i > 4) && (strcmp(&(p[i - 4]), ".htm") == 0))) BIO_puts(io, "HTTP/1.0 200 ok\r\nContent-type: text/html\r\n\r\n"); else BIO_puts(io, "HTTP/1.0 200 ok\r\nContent-type: text/plain\r\n\r\n"); } for (;;) { i = BIO_read(file, buf, bufsize); if (i <= 0) break; #ifdef RENEG total_bytes += i; BIO_printf(bio_err, "%d\n", i); if (total_bytes > 3 * 1024) { total_bytes = 0; BIO_printf(bio_err, "RENEGOTIATE\n"); SSL_renegotiate(con); } #endif for (j = 0; j < i;) { #ifdef RENEG { static count = 0; if (++count == 13) { SSL_renegotiate(con); } } #endif k = BIO_write(io, &(buf[j]), i - j); if (k <= 0) { if (!BIO_should_retry(io) && !SSL_waiting_for_async(con)) goto write_error; else { BIO_printf(bio_s_out, "rwrite W BLOCK\n"); } } else { j += k; } } } write_error: BIO_free(file); break; } } for (;;) { i = (int)BIO_flush(io); if (i <= 0) { if (!BIO_should_retry(io)) break; } else break; } end: SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); err: if (ret >= 0) BIO_printf(bio_s_out, "ACCEPT\n"); OPENSSL_free(buf); BIO_free_all(io); return (ret); } apps/s_server.c:2618: error: MEMORY_LEAK memory dynamically allocated to `ssl_bio` by call to `BIO_new()` at line 2617, column 15 is not reachable after line 2618, column 10. Showing all 63 steps of the trace apps/s_server.c:2598:1: start of procedure www_body() 2596. #endif 2597. 2598. > static int www_body(char *hostname, int s, int stype, unsigned char *context) 2599. { 2600. char *buf = NULL; apps/s_server.c:2600:5: 2598. static int www_body(char *hostname, int s, int stype, unsigned char *context) 2599. { 2600. > char *buf = NULL; 2601. int ret = 1; 2602. int i, j, k, dot; apps/s_server.c:2601:5: 2599. { 2600. char *buf = NULL; 2601. > int ret = 1; 2602. int i, j, k, dot; 2603. SSL *con; apps/s_server.c:2613:5: 2611. 2612. /* Set width for a select call if needed */ 2613. > width = s + 1; 2614. 2615. buf = app_malloc(bufsize, "server www buffer"); apps/s_server.c:2615:5: 2613. width = s + 1; 2614. 2615. > buf = app_malloc(bufsize, "server www buffer"); 2616. io = BIO_new(BIO_f_buffer()); 2617. ssl_bio = BIO_new(BIO_f_ssl()); apps/apps.c:976:1: start of procedure app_malloc() 974. } 975. 976. > void* app_malloc(int sz, const char *what) 977. { 978. void *vp = OPENSSL_malloc(sz); apps/apps.c:978:5: 976. void* app_malloc(int sz, const char *what) 977. { 978. > void *vp = OPENSSL_malloc(sz); 979. 980. if (vp == 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) apps/apps.c:980:9: Taking false branch 978. void *vp = OPENSSL_malloc(sz); 979. 980. if (vp == NULL) { ^ 981. BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n", 982. opt_getprog(), sz, what); apps/apps.c:986:5: 984. exit(1); 985. } 986. > return vp; 987. } 988. apps/apps.c:987:1: return from a call to app_malloc 985. } 986. return vp; 987. > } 988. 989. /* apps/s_server.c:2616:5: 2614. 2615. buf = app_malloc(bufsize, "server www buffer"); 2616. > io = BIO_new(BIO_f_buffer()); 2617. ssl_bio = BIO_new(BIO_f_ssl()); 2618. if ((io == NULL) || (ssl_bio == NULL)) crypto/bio/bf_buff.c:87:1: start of procedure BIO_f_buffer() 85. }; 86. 87. > BIO_METHOD *BIO_f_buffer(void) 88. { 89. return (&methods_buffer); crypto/bio/bf_buff.c:89:5: 87. BIO_METHOD *BIO_f_buffer(void) 88. { 89. > return (&methods_buffer); 90. } 91. crypto/bio/bf_buff.c:90:1: return from a call to BIO_f_buffer 88. { 89. return (&methods_buffer); 90. > } 91. 92. static int buffer_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); crypto/bio/bio_lib.c:68:5: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. 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/bio/bio_lib.c:70:9: Taking false branch 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { ^ 71. BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); 72. return (NULL); crypto/bio/bio_lib.c:74:10: Taking true branch 72. return (NULL); 73. } 74. if (!BIO_set(ret, method)) { ^ 75. OPENSSL_free(ret); 76. ret = NULL; crypto/bio/bio_lib.c:75:9: 73. } 74. if (!BIO_set(ret, method)) { 75. > OPENSSL_free(ret); 76. ret = NULL; 77. } crypto/mem.c:234:1: start of procedure CRYPTO_free() 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: 243. } 244. #else 245. > free(str); 246. #endif 247. } crypto/mem.c:247:1: return from a call to CRYPTO_free 245. free(str); 246. #endif 247. > } 248. 249. void CRYPTO_clear_free(void *str, size_t num) crypto/bio/bio_lib.c:76:9: 74. if (!BIO_set(ret, method)) { 75. OPENSSL_free(ret); 76. > ret = NULL; 77. } 78. return (ret); crypto/bio/bio_lib.c:78:5: 76. ret = NULL; 77. } 78. > return (ret); 79. } 80. crypto/bio/bio_lib.c:79:1: return from a call to BIO_new 77. } 78. return (ret); 79. > } 80. 81. int BIO_set(BIO *bio, BIO_METHOD *method) apps/s_server.c:2617:5: 2615. buf = app_malloc(bufsize, "server www buffer"); 2616. io = BIO_new(BIO_f_buffer()); 2617. > ssl_bio = BIO_new(BIO_f_ssl()); 2618. if ((io == NULL) || (ssl_bio == NULL)) 2619. goto err; ssl/bio_ssl.c:97:1: start of procedure BIO_f_ssl() 95. }; 96. 97. > BIO_METHOD *BIO_f_ssl(void) 98. { 99. return (&methods_sslp); ssl/bio_ssl.c:99:5: 97. BIO_METHOD *BIO_f_ssl(void) 98. { 99. > return (&methods_sslp); 100. } 101. ssl/bio_ssl.c:100:1: return from a call to BIO_f_ssl 98. { 99. return (&methods_sslp); 100. > } 101. 102. static int ssl_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); crypto/bio/bio_lib.c:68:5: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. 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/bio/bio_lib.c:70:9: Taking false branch 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { ^ 71. BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); 72. return (NULL); crypto/bio/bio_lib.c:74:10: Taking false branch 72. return (NULL); 73. } 74. if (!BIO_set(ret, method)) { ^ 75. OPENSSL_free(ret); 76. ret = NULL; crypto/bio/bio_lib.c:78:5: 76. ret = NULL; 77. } 78. > return (ret); 79. } 80. crypto/bio/bio_lib.c:79:1: return from a call to BIO_new 77. } 78. return (ret); 79. > } 80. 81. int BIO_set(BIO *bio, BIO_METHOD *method) apps/s_server.c:2618:10: Taking true branch 2616. io = BIO_new(BIO_f_buffer()); 2617. ssl_bio = BIO_new(BIO_f_ssl()); 2618. if ((io == NULL) || (ssl_bio == NULL)) ^ 2619. goto err; 2620.
https://github.com/openssl/openssl/blob/fe05264e32327e33f0b0c091479affeecbf55e89/apps/s_server.c/#L2618
d2a_code_trace_data_43978
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } test/servername_test.c:215: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 16 steps of the trace test/servername_test.c:190:11: Call 188. goto end; 189. 190. con = SSL_new(ctx); ^ 191. if (!TEST_ptr(con)) 192. goto end; ssl/ssl_lib.c:603:1: Parameter `ctx->sessions->num_items` 601. } 602. 603. > SSL *SSL_new(SSL_CTX *ctx) 604. { 605. SSL *s; test/servername_test.c:215:5: Call 213. ret = 1; 214. end: 215. SSL_free(con); ^ 216. SSL_CTX_free(ctx); 217. return ret; ssl/ssl_lib.c:1051:1: Parameter `s->session_ctx->sessions->num_items` 1049. } 1050. 1051. > void SSL_free(SSL *s) 1052. { 1053. int i; ssl/ssl_lib.c:1082:9: Call 1080. /* Make the next call work :-) */ 1081. if (s->session != NULL) { 1082. ssl_clear_bad_session(s); ^ 1083. SSL_SESSION_free(s->session); 1084. } ssl/ssl_sess.c:1062:1: Parameter `s->session_ctx->sessions->num_items` 1060. } 1061. 1062. > int ssl_clear_bad_session(SSL *s) 1063. { 1064. if ((s->session != NULL) && ssl/ssl_sess.c:1067:9: Call 1065. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1066. !(SSL_in_init(s) || SSL_in_before(s))) { 1067. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1068. return (1); 1069. } 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:702:1: Parameter `lh->num_items` 700. } TLSEXT_INDEX; 701. 702. > DEFINE_LHASH_OF(SSL_SESSION); 703. /* Needed in ssl_cert.c */ 704. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:702:1: Call 700. } TLSEXT_INDEX; 701. 702. > DEFINE_LHASH_OF(SSL_SESSION); 703. /* Needed in ssl_cert.c */ 704. 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/190b9a03b72a8029c27e4bd0ab000129e240a413/crypto/lhash/lhash.c/#L126
d2a_code_trace_data_43979
int test_gf2m_mod_sqrt(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b[2], *c, *d, *e, *f; int i, j, ret = 0; int p0[] = { 163, 7, 6, 3, 0, -1 }; int p1[] = { 193, 15, 0, -1 }; a = BN_new(); b[0] = BN_new(); b[1] = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); f = BN_new(); BN_GF2m_arr2poly(p0, b[0]); BN_GF2m_arr2poly(p1, b[1]); for (i = 0; i < num0; i++) { BN_bntest_rand(a, 512, 0, 0); for (j = 0; j < 2; j++) { BN_GF2m_mod(c, a, b[j]); BN_GF2m_mod_sqrt(d, a, b[j], ctx); BN_GF2m_mod_sqr(e, d, b[j], ctx); BN_GF2m_add(f, c, e); if (!BN_is_zero(f)) { fprintf(stderr, "GF(2^m) modular square root test failed!\n"); goto err; } } } ret = 1; err: BN_free(a); BN_free(b[0]); BN_free(b[1]); BN_free(c); BN_free(d); BN_free(e); BN_free(f); return ret; } test/bntest.c:1558: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 1531, column 9 is not reachable after line 1558, column 5. Showing all 177 steps of the trace test/bntest.c:1524:1: start of procedure test_gf2m_mod_sqrt() 1522. } 1523. 1524. > int test_gf2m_mod_sqrt(BIO *bp, BN_CTX *ctx) 1525. { 1526. BIGNUM *a, *b[2], *c, *d, *e, *f; test/bntest.c:1527:5: 1525. { 1526. BIGNUM *a, *b[2], *c, *d, *e, *f; 1527. > int i, j, ret = 0; 1528. int p0[] = { 163, 7, 6, 3, 0, -1 }; 1529. int p1[] = { 193, 15, 0, -1 }; test/bntest.c:1528:5: 1526. BIGNUM *a, *b[2], *c, *d, *e, *f; 1527. int i, j, ret = 0; 1528. > int p0[] = { 163, 7, 6, 3, 0, -1 }; 1529. int p1[] = { 193, 15, 0, -1 }; 1530. test/bntest.c:1529:5: 1527. int i, j, ret = 0; 1528. int p0[] = { 163, 7, 6, 3, 0, -1 }; 1529. > int p1[] = { 193, 15, 0, -1 }; 1530. 1531. a = BN_new(); test/bntest.c:1531:5: 1529. int p1[] = { 193, 15, 0, -1 }; 1530. 1531. > a = BN_new(); 1532. b[0] = BN_new(); 1533. b[1] = 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:1532:5: 1530. 1531. a = BN_new(); 1532. > b[0] = BN_new(); 1533. b[1] = BN_new(); 1534. 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:1533:5: 1531. a = BN_new(); 1532. b[0] = BN_new(); 1533. > b[1] = BN_new(); 1534. c = BN_new(); 1535. 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:1534:5: 1532. b[0] = BN_new(); 1533. b[1] = BN_new(); 1534. > c = BN_new(); 1535. d = BN_new(); 1536. e = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1535:5: 1533. b[1] = BN_new(); 1534. c = BN_new(); 1535. > d = BN_new(); 1536. e = BN_new(); 1537. f = 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:1536:5: 1534. c = BN_new(); 1535. d = BN_new(); 1536. > e = BN_new(); 1537. f = BN_new(); 1538. 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:1537:5: 1535. d = BN_new(); 1536. e = BN_new(); 1537. > f = BN_new(); 1538. 1539. BN_GF2m_arr2poly(p0, b[0]); 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:1539:5: Skipping BN_GF2m_arr2poly(): empty list of specs 1537. f = BN_new(); 1538. 1539. BN_GF2m_arr2poly(p0, b[0]); ^ 1540. BN_GF2m_arr2poly(p1, b[1]); 1541. test/bntest.c:1540:5: Skipping BN_GF2m_arr2poly(): empty list of specs 1538. 1539. BN_GF2m_arr2poly(p0, b[0]); 1540. BN_GF2m_arr2poly(p1, b[1]); ^ 1541. 1542. for (i = 0; i < num0; i++) { test/bntest.c:1542:10: 1540. BN_GF2m_arr2poly(p1, b[1]); 1541. 1542. > for (i = 0; i < num0; i++) { 1543. BN_bntest_rand(a, 512, 0, 0); 1544. for (j = 0; j < 2; j++) { test/bntest.c:1542:17: Loop condition is false. Leaving loop 1540. BN_GF2m_arr2poly(p1, b[1]); 1541. 1542. for (i = 0; i < num0; i++) { ^ 1543. BN_bntest_rand(a, 512, 0, 0); 1544. for (j = 0; j < 2; j++) { test/bntest.c:1556:5: 1554. } 1555. } 1556. > ret = 1; 1557. err: 1558. BN_free(a); test/bntest.c:1557:2: 1555. } 1556. ret = 1; 1557. > err: 1558. BN_free(a); 1559. BN_free(b[0]); test/bntest.c:1558:5: 1556. ret = 1; 1557. err: 1558. > BN_free(a); 1559. BN_free(b[0]); 1560. BN_free(b[1]); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L1558
d2a_code_trace_data_43980
static int rand_bytes(unsigned char *buf, int num, int pseudo) { static volatile int stirred_pool = 0; int i, j, k; size_t num_ceil, st_idx, st_num; int ok; long md_c[2]; unsigned char local_md[MD_DIGEST_LENGTH]; EVP_MD_CTX *m; #ifndef GETPID_IS_MEANINGLESS pid_t curr_pid = getpid(); #endif time_t curr_time = time(NULL); int do_stir_pool = 0; #ifdef OPENSSL_SYS_WIN32 FILETIME tv; # ifdef _WIN32_WCE SYSTEMTIME t; GetSystemTime(&t); SystemTimeToFileTime(&t, &tv); # else GetSystemTimeAsFileTime(&tv); # endif #elif defined(OPENSSL_SYS_VXWORKS) struct timespec tv; clock_gettime(CLOCK_REALTIME, &ts); #elif defined(OPENSSL_SYS_DSPBIOS) unsigned long long tv, OPENSSL_rdtsc(); tv = OPENSSL_rdtsc(); #else struct timeval tv; gettimeofday(&tv, NULL); #endif #ifdef PREDICT if (rand_predictable) { unsigned char val = 1; for (i = 0; i < num; i++) buf[i] = val++; return (1); } #endif if (num <= 0) return 1; m = EVP_MD_CTX_new(); if (m == NULL) goto err_mem; num_ceil = (1 + (num - 1) / (MD_DIGEST_LENGTH / 2)) * (MD_DIGEST_LENGTH / 2); if (!RUN_ONCE(&rand_lock_init, do_rand_lock_init)) goto err_mem; CRYPTO_THREAD_write_lock(rand_lock); ASYNC_block_pause(); CRYPTO_THREAD_write_lock(rand_tmp_lock); locking_threadid = CRYPTO_THREAD_get_current_id(); CRYPTO_THREAD_unlock(rand_tmp_lock); crypto_lock_rand = 1; if (!initialized) { RAND_poll(); initialized = 1; } if (!stirred_pool) do_stir_pool = 1; ok = (entropy >= ENTROPY_NEEDED); if (!ok) { entropy -= num; if (entropy < 0) entropy = 0; } if (do_stir_pool) { int n = STATE_SIZE; while (n > 0) { #if MD_DIGEST_LENGTH > 20 # error "Please adjust DUMMY_SEED." #endif #define DUMMY_SEED "...................." rand_add(DUMMY_SEED, MD_DIGEST_LENGTH, 0.0); n -= MD_DIGEST_LENGTH; } if (ok) stirred_pool = 1; } st_idx = state_index; st_num = state_num; md_c[0] = md_count[0]; md_c[1] = md_count[1]; memcpy(local_md, md, sizeof md); state_index += num_ceil; if (state_index > state_num) state_index %= state_num; md_count[0] += 1; crypto_lock_rand = 0; ASYNC_unblock_pause(); CRYPTO_THREAD_unlock(rand_lock); while (num > 0) { j = (num >= MD_DIGEST_LENGTH / 2) ? MD_DIGEST_LENGTH / 2 : num; num -= j; if (!MD_Init(m)) goto err; #ifndef GETPID_IS_MEANINGLESS if (curr_pid) { if (!MD_Update(m, (unsigned char *)&curr_pid, sizeof curr_pid)) goto err; curr_pid = 0; } #endif if (curr_time) { if (!MD_Update(m, (unsigned char *)&curr_time, sizeof curr_time)) goto err; if (!MD_Update(m, (unsigned char *)&tv, sizeof tv)) goto err; curr_time = 0; if (!rand_hw_seed(m)) goto err; } if (!MD_Update(m, local_md, MD_DIGEST_LENGTH)) goto err; if (!MD_Update(m, (unsigned char *)&(md_c[0]), sizeof(md_c))) goto err; k = (st_idx + MD_DIGEST_LENGTH / 2) - st_num; if (k > 0) { if (!MD_Update(m, &(state[st_idx]), MD_DIGEST_LENGTH / 2 - k)) goto err; if (!MD_Update(m, &(state[0]), k)) goto err; } else if (!MD_Update(m, &(state[st_idx]), MD_DIGEST_LENGTH / 2)) goto err; if (!MD_Final(m, local_md)) goto err; for (i = 0; i < MD_DIGEST_LENGTH / 2; i++) { state[st_idx++] ^= local_md[i]; if (st_idx >= st_num) st_idx = 0; if (i < j) *(buf++) = local_md[i + MD_DIGEST_LENGTH / 2]; } } if (!MD_Init(m) || !MD_Update(m, (unsigned char *)&(md_c[0]), sizeof(md_c)) || !MD_Update(m, local_md, MD_DIGEST_LENGTH)) goto err; CRYPTO_THREAD_write_lock(rand_lock); ASYNC_block_pause(); if (!MD_Update(m, md, MD_DIGEST_LENGTH) || !MD_Final(m, md)) { CRYPTO_THREAD_unlock(rand_lock); goto err; } ASYNC_unblock_pause(); CRYPTO_THREAD_unlock(rand_lock); EVP_MD_CTX_free(m); if (ok) return (1); else if (pseudo) return 0; else { RANDerr(RAND_F_RAND_BYTES, RAND_R_PRNG_NOT_SEEDED); ERR_add_error_data(1, "You need to read the OpenSSL FAQ, " "https://www.openssl.org/docs/faq.html"); return (0); } err: RANDerr(RAND_F_RAND_BYTES, ERR_R_EVP_LIB); EVP_MD_CTX_free(m); return 0; err_mem: RANDerr(RAND_F_RAND_BYTES, ERR_R_MALLOC_FAILURE); EVP_MD_CTX_free(m); return 0; } crypto/rand/md_rand.c:523: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 326, column 9 is not reachable after line 523, column 5. Showing all 49 steps of the trace crypto/rand/md_rand.c:278:1: start of procedure rand_bytes() 276. } 277. 278. > static int rand_bytes(unsigned char *buf, int num, int pseudo) 279. { 280. static volatile int stirred_pool = 0; crypto/rand/md_rand.c:280:5: 278. static int rand_bytes(unsigned char *buf, int num, int pseudo) 279. { 280. > static volatile int stirred_pool = 0; 281. int i, j, k; 282. size_t num_ceil, st_idx, st_num; crypto/rand/md_rand.c:288:5: 286. EVP_MD_CTX *m; 287. #ifndef GETPID_IS_MEANINGLESS 288. > pid_t curr_pid = getpid(); 289. #endif 290. time_t curr_time = time(NULL); crypto/rand/md_rand.c:290:5: 288. pid_t curr_pid = getpid(); 289. #endif 290. > time_t curr_time = time(NULL); 291. int do_stir_pool = 0; 292. /* time value for various platforms */ crypto/rand/md_rand.c:291:5: 289. #endif 290. time_t curr_time = time(NULL); 291. > int do_stir_pool = 0; 292. /* time value for various platforms */ 293. #ifdef OPENSSL_SYS_WIN32 crypto/rand/md_rand.c:310:5: 308. #else 309. struct timeval tv; 310. > gettimeofday(&tv, NULL); 311. #endif 312. crypto/rand/md_rand.c:323:9: Taking false branch 321. #endif 322. 323. if (num <= 0) ^ 324. return 1; 325. crypto/rand/md_rand.c:326:5: 324. return 1; 325. 326. > m = EVP_MD_CTX_new(); 327. if (m == NULL) 328. goto err_mem; crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new() 42. } 43. 44. > EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:46:5: 44. EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. } 48. crypto/mem.c:98:1: start of procedure CRYPTO_zalloc() 96. } 97. 98. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:100:5: 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) 99. { 100. > void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) crypto/mem.c:71:1: start of procedure CRYPTO_malloc() 69. } 70. 71. > void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. void *ret = NULL; crypto/mem.c:73:5: 71. void *CRYPTO_malloc(size_t num, const char *file, int line) 72. { 73. > void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:75:9: Taking false branch 73. void *ret = NULL; 74. 75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 76. return malloc_impl(num, file, line); 77. crypto/mem.c:78:9: Taking false branch 76. return malloc_impl(num, file, line); 77. 78. if (num <= 0) ^ 79. return NULL; 80. crypto/mem.c:81:5: 79. return NULL; 80. 81. > allow_customize = 0; 82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 83. if (call_malloc_debug) { crypto/mem.c:91:5: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:91:24: 89. } 90. #else 91. > osslargused(file); osslargused(line); 92. ret = malloc(num); 93. #endif crypto/mem.c:92:5: 90. #else 91. osslargused(file); osslargused(line); 92. > ret = malloc(num); 93. #endif 94. crypto/mem.c:95:5: 93. #endif 94. 95. > return ret; 96. } 97. crypto/mem.c:96:1: return from a call to CRYPTO_malloc 94. 95. return ret; 96. > } 97. 98. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:102:9: Taking true branch 100. void *ret = CRYPTO_malloc(num, file, line); 101. 102. if (ret != NULL) ^ 103. memset(ret, 0, num); 104. return ret; crypto/mem.c:103:9: 101. 102. if (ret != NULL) 103. > memset(ret, 0, num); 104. return ret; 105. } crypto/mem.c:104:5: 102. if (ret != NULL) 103. memset(ret, 0, num); 104. > return ret; 105. } 106. crypto/mem.c:105:1: return from a call to CRYPTO_zalloc 103. memset(ret, 0, num); 104. return ret; 105. > } 106. 107. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. > } 48. 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) crypto/rand/md_rand.c:327:9: Taking false branch 325. 326. m = EVP_MD_CTX_new(); 327. if (m == NULL) ^ 328. goto err_mem; 329. crypto/rand/md_rand.c:331:5: 329. 330. /* round upwards to multiple of MD_DIGEST_LENGTH/2 */ 331. > num_ceil = 332. (1 + (num - 1) / (MD_DIGEST_LENGTH / 2)) * (MD_DIGEST_LENGTH / 2); 333. crypto/rand/md_rand.c:352:10: 350. */ 351. 352. > if (!RUN_ONCE(&rand_lock_init, do_rand_lock_init)) 353. goto err_mem; 354. crypto/threads_pthread.c:63:1: start of procedure CRYPTO_THREAD_run_once() 61. } 62. 63. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 64. { 65. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:65:9: Taking false branch 63. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 64. { 65. if (pthread_once(once, init) != 0) ^ 66. return 0; 67. crypto/threads_pthread.c:68:5: 66. return 0; 67. 68. > return 1; 69. } 70. crypto/threads_pthread.c:69:1: return from a call to CRYPTO_THREAD_run_once 67. 68. return 1; 69. > } 70. 71. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/rand/md_rand.c:352:10: Condition is true 350. */ 351. 352. if (!RUN_ONCE(&rand_lock_init, do_rand_lock_init)) ^ 353. goto err_mem; 354. crypto/rand/md_rand.c:352:10: Taking true branch 350. */ 351. 352. if (!RUN_ONCE(&rand_lock_init, do_rand_lock_init)) ^ 353. goto err_mem; 354. crypto/rand/md_rand.c:521:2: 519. EVP_MD_CTX_free(m); 520. return 0; 521. > err_mem: 522. RANDerr(RAND_F_RAND_BYTES, ERR_R_MALLOC_FAILURE); 523. EVP_MD_CTX_free(m); crypto/rand/md_rand.c:522:5: Skipping ERR_put_error(): empty list of specs 520. return 0; 521. err_mem: 522. RANDerr(RAND_F_RAND_BYTES, ERR_R_MALLOC_FAILURE); ^ 523. EVP_MD_CTX_free(m); 524. return 0; crypto/rand/md_rand.c:523:5: 521. err_mem: 522. RANDerr(RAND_F_RAND_BYTES, ERR_R_MALLOC_FAILURE); 523. > EVP_MD_CTX_free(m); 524. return 0; 525. crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free() 47. } 48. 49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); ^ 52. OPENSSL_free(ctx); 53. } crypto/evp/digest.c:52:5: 50. { 51. EVP_MD_CTX_reset(ctx); 52. > OPENSSL_free(ctx); 53. } 54. crypto/mem.c:163:1: start of procedure CRYPTO_free() 161. } 162. 163. > void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:165:9: Taking true branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:165:30: Taking true branch 163. void CRYPTO_free(void *str, const char *file, int line) 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 166. free_impl(str, file, line); 167. return; crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer 164. { 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { 166. free_impl(str, file, line); ^ 167. return; 168. } crypto/mem.c:167:9: 165. if (free_impl != NULL && free_impl != &CRYPTO_free) { 166. free_impl(str, file, line); 167. > return; 168. } 169. crypto/mem.c:181:1: return from a call to CRYPTO_free 179. free(str); 180. #endif 181. > } 182. 183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free 51. EVP_MD_CTX_reset(ctx); 52. OPENSSL_free(ctx); 53. > } 54. 55. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
https://github.com/openssl/openssl/blob/d53b1dd4483243a271eea7288915a1fb5293505c/crypto/rand/md_rand.c/#L523
d2a_code_trace_data_43981
static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) { const char *s = *t; int64_t v = 0; if (*s == '9' || *s == '8' || !ossl_isdigit(*s)) return 0; do { v = (v << 3) + (*s - '0'); } while (ossl_isdigit(*++s) && *s != '9' && *s != '8'); if (!ossl_isspace(*s) && *s != '\0' && *s != ',') { PROPerr(PROP_F_PARSE_OCT, PROP_R_NOT_AN_OCTAL_DIGIT); return 0; } *t = skip_space(s); res->type = PROPERTY_TYPE_NUMBER; res->v.int_val = v; return 1; } test/property_test.c:299: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] (⇐ [1, +oo] + 1) Size: [1, 37] by call to `ossl_method_store_add`. Showing all 23 steps of the trace test/property_test.c:265:9: Array declaration 263. char *impl; 264. } impls[] = { 265. { 1, "fast=no, colour=green", "a" }, ^ 266. { 1, "fast, colour=blue", "b" }, 267. { 1, "", "-" }, test/property_test.c:299:14: Call 297. 298. for (i = 0; i < OSSL_NELEM(impls); i++) 299. if (!TEST_true(ossl_method_store_add(store, impls[i].nid, impls[i].prop, ^ 300. impls[i].impl, NULL))) { 301. TEST_note("iteration %zd", i + 1); crypto/property/property.c:186:1: Parameter `*properties` 184. } 185. 186. > int ossl_method_store_add(OSSL_METHOD_STORE *store, 187. int nid, const char *properties, 188. void *method, void (*method_destruct)(void *)) crypto/property/property.c:215:33: Call 213. ossl_method_cache_flush(store, nid); 214. if ((impl->properties = ossl_prop_defn_get(properties)) == NULL) { 215. if ((impl->properties = ossl_parse_property(properties)) == NULL) ^ 216. goto err; 217. ossl_prop_defn_set(properties, impl->properties); crypto/property/property_parse.c:315:1: Parameter `*defn` 313. } 314. 315. > OSSL_PROPERTY_LIST *ossl_parse_property(const char *defn) 316. { 317. PROPERTY_DEFINITION *prop = NULL; crypto/property/property_parse.c:320:5: Assignment 318. OSSL_PROPERTY_LIST *res = NULL; 319. STACK_OF(PROPERTY_DEFINITION) *sk; 320. const char *s = defn; ^ 321. int done; 322. crypto/property/property_parse.c:326:9: Call 324. return NULL; 325. 326. s = skip_space(s); ^ 327. done = *s == '\0'; 328. while (!done) { crypto/property/property_parse.c:50:1: Parameter `*s` 48. DEFINE_STACK_OF(PROPERTY_DEFINITION) 49. 50. > static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) crypto/property/property_parse.c:54:5: Assignment 52. while (ossl_isspace(*s)) 53. s++; 54. return s; ^ 55. } 56. crypto/property/property_parse.c:326:5: Assignment 324. return NULL; 325. 326. s = skip_space(s); ^ 327. done = *s == '\0'; 328. while (!done) { crypto/property/property_parse.c:333:14: Call 331. goto err; 332. memset(&prop->v, 0, sizeof(prop->v)); 333. if (!parse_name(&s, 1, &prop->name_idx)) ^ 334. goto err; 335. prop->oper = PROPERTY_OPER_EQ; crypto/property/property_parse.c:81:1: Parameter `**t` 79. } 80. 81. > static int parse_name(const char *t[], int create, OSSL_PROPERTY_IDX *idx) 82. { 83. char name[100]; crypto/property/property_parse.c:340:13: Call 338. goto err; 339. } 340. if (match_ch(&s, '=')) { ^ 341. if (!parse_value(&s, prop, 1)) { 342. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); crypto/property/property_parse.c:57:1: Parameter `**t` 55. } 56. 57. > static int match_ch(const char *t[], char m) 58. { 59. const char *s = *t; crypto/property/property_parse.c:341:18: Call 339. } 340. if (match_ch(&s, '=')) { 341. if (!parse_value(&s, prop, 1)) { ^ 342. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); 343. goto err; crypto/property/property_parse.c:244:1: Parameter `**t` 242. } 243. 244. > static int parse_value(const char *t[], PROPERTY_DEFINITION *res, int create) 245. { 246. const char *s = *t; crypto/property/property_parse.c:246:5: Assignment 244. static int parse_value(const char *t[], PROPERTY_DEFINITION *res, int create) 245. { 246. const char *s = *t; ^ 247. int r = 0; 248. crypto/property/property_parse.c:263:9: Assignment 261. r = parse_hex(&s, res); 262. } else if (*s == '0' && ossl_isdigit(s[1])) { 263. s++; ^ 264. r = parse_oct(&s, res); 265. } else if (ossl_isdigit(*s)) { crypto/property/property_parse.c:264:13: Call 262. } else if (*s == '0' && ossl_isdigit(s[1])) { 263. s++; 264. r = parse_oct(&s, res); ^ 265. } else if (ossl_isdigit(*s)) { 266. return parse_number(t, res); crypto/property/property_parse.c:163:1: <Length trace> 161. } 162. 163. > static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 164. { 165. const char *s = *t; crypto/property/property_parse.c:163:1: Parameter `**t` 161. } 162. 163. > static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 164. { 165. const char *s = *t; crypto/property/property_parse.c:165:5: Assignment 163. static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 164. { 165. const char *s = *t; ^ 166. int64_t v = 0; 167. crypto/property/property_parse.c:172:14: Array access: Offset: [2, +oo] (⇐ [1, +oo] + 1) Size: [1, 37] by call to `ossl_method_store_add` 170. do { 171. v = (v << 3) + (*s - '0'); 172. } while (ossl_isdigit(*++s) && *s != '9' && *s != '8'); ^ 173. if (!ossl_isspace(*s) && *s != '\0' && *s != ',') { 174. PROPerr(PROP_F_PARSE_OCT, PROP_R_NOT_AN_OCTAL_DIGIT);
https://github.com/openssl/openssl/blob/4460ad90af0338abe31286f29b36baf2e41abf19/crypto/property/property_parse.c/#L172
d2a_code_trace_data_43982
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_sp800_56b_gen.c:319: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `rsa_sp800_56b_derive_params_from_pq`. Showing all 30 steps of the trace crypto/rsa/rsa_sp800_56b_gen.c:314:14: Call 312. for (;;) { 313. /* (Step 2) Generate prime factors */ 314. if (!rsa_fips186_4_gen_prob_primes(rsa, NULL, NULL, NULL, NULL, NULL, ^ 315. NULL, NULL, NULL, NULL, NULL, NULL, 316. NULL, nbits, e, ctx, cb)) crypto/rsa/rsa_sp800_56b_gen.c:51:1: Parameter `ctx->stack.depth` 49. * (Required for CAVS testing). 50. */ 51. > int rsa_fips186_4_gen_prob_primes(RSA *rsa, BIGNUM *p1, BIGNUM *p2, 52. BIGNUM *Xpout, const BIGNUM *Xp, 53. const BIGNUM *Xp1, const BIGNUM *Xp2, crypto/rsa/rsa_sp800_56b_gen.c:319:14: Call 317. goto err; 318. /* (Steps 3-5) Compute params d, n, dP, dQ, qInv */ 319. ok = rsa_sp800_56b_derive_params_from_pq(rsa, nbits, e, ctx); ^ 320. if (ok < 0) 321. goto err; crypto/rsa/rsa_sp800_56b_gen.c:180:1: Parameter `ctx->stack.depth` 178. * 1 = success. 179. */ 180. > int rsa_sp800_56b_derive_params_from_pq(RSA *rsa, int nbits, 181. const BIGNUM *e, BN_CTX *ctx) 182. { crypto/rsa/rsa_sp800_56b_gen.c:186:5: Call 184. BIGNUM *p1, *q1, *lcm, *p1q1, *gcd; 185. 186. BN_CTX_start(ctx); ^ 187. p1 = BN_CTX_get(ctx); 188. q1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/rsa/rsa_sp800_56b_gen.c:187:10: Call 185. 186. BN_CTX_start(ctx); 187. p1 = BN_CTX_get(ctx); ^ 188. q1 = BN_CTX_get(ctx); 189. lcm = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_gen.c:188:10: Call 186. BN_CTX_start(ctx); 187. p1 = BN_CTX_get(ctx); 188. q1 = BN_CTX_get(ctx); ^ 189. lcm = BN_CTX_get(ctx); 190. p1q1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_gen.c:189:11: Call 187. p1 = BN_CTX_get(ctx); 188. q1 = BN_CTX_get(ctx); 189. lcm = BN_CTX_get(ctx); ^ 190. p1q1 = BN_CTX_get(ctx); 191. gcd = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_gen.c:190:12: Call 188. q1 = BN_CTX_get(ctx); 189. lcm = BN_CTX_get(ctx); 190. p1q1 = BN_CTX_get(ctx); ^ 191. gcd = BN_CTX_get(ctx); 192. if (gcd == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_gen.c:191:11: Call 189. lcm = BN_CTX_get(ctx); 190. p1q1 = BN_CTX_get(ctx); 191. gcd = BN_CTX_get(ctx); ^ 192. if (gcd == NULL) 193. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_sp800_56b_gen.c:196:9: Call 194. 195. /* LCM((p-1, q-1)) */ 196. if (rsa_get_lcm(ctx, rsa->p, rsa->q, lcm, gcd, p1, q1, p1q1) != 1) ^ 197. goto err; 198. crypto/rsa/rsa_sp800_56b_check.c:220:1: Parameter `ctx->stack.depth` 218. 219. /* return LCM(p-1, q-1) */ 220. > int rsa_get_lcm(BN_CTX *ctx, const BIGNUM *p, const BIGNUM *q, 221. BIGNUM *lcm, BIGNUM *gcd, BIGNUM *p1, BIGNUM *q1, 222. BIGNUM *p1q1) crypto/rsa/rsa_sp800_56b_check.c:226:15: Call 224. return BN_sub(p1, p, BN_value_one()) /* p-1 */ 225. && BN_sub(q1, q, BN_value_one()) /* q-1 */ 226. && BN_mul(p1q1, p1, q1, ctx) /* (p-1)(q-1) */ ^ 227. && BN_gcd(gcd, p1, q1, ctx) 228. && BN_div(lcm, NULL, p1q1, gcd, ctx); /* LCM((p-1, q-1)) */ crypto/bn/bn_mul.c:497:1: Parameter `ctx->stack.depth` 495. #endif /* BN_RECURSION */ 496. 497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = bn_mul_fixed_top(r, a, b, ctx); crypto/bn/bn_mul.c:499:15: Call 497. int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = bn_mul_fixed_top(r, a, b, ctx); ^ 500. 501. bn_correct_top(r); crypto/bn/bn_mul.c:507:1: Parameter `ctx->stack.depth` 505. } 506. 507. > int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 508. { 509. int ret = 0; crypto/bn/bn_mul.c:533:5: Call 531. top = al + bl; 532. 533. BN_CTX_start(ctx); ^ 534. if ((r == a) || (r == b)) { 535. if ((rr = BN_CTX_get(ctx)) == NULL) crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mul.c:618:5: Call 616. err: 617. bn_check_top(r); 618. BN_CTX_end(ctx); ^ 619. return ret; 620. } crypto/bn/bn_ctx.c:185:1: Parameter `ctx->stack.depth` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <LHS trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `rsa_sp800_56b_derive_params_from_pq` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43983
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *A, *a = NULL; const BN_ULONG *B; int i; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b,BN_FLG_SECURE)) a = A = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = A = OPENSSL_zalloc(words * sizeof(*a)); if (A == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } #if 1 B = b->d; if (B != NULL) { for (i = b->top >> 2; i > 0; i--, A += 4, B += 4) { BN_ULONG a0, a1, a2, a3; a0 = B[0]; a1 = B[1]; a2 = B[2]; a3 = B[3]; A[0] = a0; A[1] = a1; A[2] = a2; A[3] = a3; } switch (b->top & 3) { case 3: A[2] = B[2]; case 2: A[1] = B[1]; case 1: A[0] = B[0]; case 0: ; } } #else memset(A, 0, sizeof(*A) * words); memcpy(A, b->d, sizeof(b->d[0]) * b->top); #endif return (a); } crypto/dh/dh_check.c:154: error: BUFFER_OVERRUN_L3 Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_set_word`. Showing all 12 steps of the trace crypto/dh/dh_check.c:153:11: Call 151. goto err; 152. BN_CTX_start(ctx); 153. tmp = BN_CTX_get(ctx); ^ 154. if (tmp == NULL || !BN_set_word(tmp, 1)) 155. goto err; crypto/bn/bn_ctx.c:283:5: Call 281. } 282. /* OK, make sure the returned bignum is "zero" */ 283. BN_zero(ret); ^ 284. ctx->used++; 285. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:520:1: Parameter `*a->d` 518. } 519. 520. > int BN_set_word(BIGNUM *a, BN_ULONG w) 521. { 522. bn_check_top(a); crypto/dh/dh_check.c:154:25: Call 152. BN_CTX_start(ctx); 153. tmp = BN_CTX_get(ctx); 154. if (tmp == NULL || !BN_set_word(tmp, 1)) ^ 155. goto err; 156. if (BN_cmp(pub_key, tmp) <= 0) crypto/bn/bn_lib.c:520:1: Parameter `*a->d` 518. } 519. 520. > int BN_set_word(BIGNUM *a, BN_ULONG w) 521. { 522. bn_check_top(a); crypto/bn/bn_lib.c:523:9: Call 521. { 522. bn_check_top(a); 523. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 524. return (0); 525. a->neg = 0; crypto/bn/bn_lib.c:380:1: Parameter `*b->d` 378. */ 379. 380. > BIGNUM *bn_expand2(BIGNUM *b, int words) 381. { 382. bn_check_top(b); crypto/bn/bn_lib.c:385:23: Call 383. 384. if (words > b->dmax) { 385. BN_ULONG *a = bn_expand_internal(b, words); ^ 386. if (!a) 387. return NULL; crypto/bn/bn_lib.c:299:1: <Length trace> 297. /* This is used by bn_expand2() */ 298. /* The caller MUST check that words > b->dmax before calling this */ 299. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 300. { 301. BN_ULONG *A, *a = NULL; crypto/bn/bn_lib.c:299:1: Parameter `*b->d` 297. /* This is used by bn_expand2() */ 298. /* The caller MUST check that words > b->dmax before calling this */ 299. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 300. { 301. BN_ULONG *A, *a = NULL; crypto/bn/bn_lib.c:325:5: Assignment 323. 324. #if 1 325. B = b->d; ^ 326. /* Check if the previous number needs to be copied */ 327. if (B != NULL) { crypto/bn/bn_lib.c:342:18: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_set_word` 340. a1 = B[1]; 341. a2 = B[2]; 342. a3 = B[3]; ^ 343. A[0] = a0; 344. A[1] = a1;
https://github.com/openssl/openssl/blob/c10d1bc81cb047cbd53f8cc430632b6a4a70252d/crypto/bn/bn_lib.c/#L342
d2a_code_trace_data_43984
static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, OPENSSL_LH_DOALL_FUNC func, OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) { int i; OPENSSL_LH_NODE *a, *n; if (lh == NULL) return; for (i = lh->num_nodes - 1; i >= 0; i--) { a = lh->b[i]; while (a != NULL) { n = a->next; if (use_arg) func_arg(a->data, arg); else func(a->data); a = n; } } } test/sslapitest.c:4447: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `SSL_free`. Showing all 17 steps of the trace test/sslapitest.c:4431:10: Call 4429. } 4430. 4431. if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, ^ 4432. NULL, NULL)) 4433. || !TEST_true(create_ssl_connection(serverssl, clientssl, test/ssltestlib.c:576:15: Call 574. if (*sssl != NULL) 575. serverssl = *sssl; 576. else if (!TEST_ptr(serverssl = SSL_new(serverctx))) ^ 577. goto error; 578. if (*cssl != NULL) ssl/ssl_lib.c:668:1: Parameter `ctx->sessions->num_nodes` 666. } 667. 668. > SSL *SSL_new(SSL_CTX *ctx) 669. { 670. SSL *s; test/sslapitest.c:4447:5: Call 4445. 4446. end: 4447. SSL_free(serverssl); ^ 4448. SSL_free(clientssl); 4449. SSL_CTX_free(sctx); ssl/ssl_lib.c:1124:1: Parameter `s->ctx->sessions->num_nodes` 1122. } 1123. 1124. > void SSL_free(SSL *s) 1125. { 1126. int i; ssl/ssl_lib.c:1196:5: Call 1194. RECORD_LAYER_release(&s->rlayer); 1195. 1196. SSL_CTX_free(s->ctx); ^ 1197. 1198. ASYNC_WAIT_CTX_free(s->waitctx); ssl/ssl_lib.c:3046:1: Parameter `a->sessions->num_nodes` 3044. } 3045. 3046. > void SSL_CTX_free(SSL_CTX *a) 3047. { 3048. int i; ssl/ssl_lib.c:3072:9: Call 3070. */ 3071. if (a->sessions != NULL) 3072. SSL_CTX_flush_sessions(a, 0); ^ 3073. 3074. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); ssl/ssl_sess.c:1116:1: Parameter `s->sessions->num_nodes` 1114. IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1115. 1116. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 1117. { 1118. unsigned long i; ssl/ssl_sess.c:1129:5: Call 1127. i = lh_SSL_SESSION_get_down_load(s->sessions); 1128. lh_SSL_SESSION_set_down_load(s->sessions, 0); 1129. lh_SSL_SESSION_doall_TIMEOUT_PARAM(tp.cache, timeout_cb, &tp); ^ 1130. lh_SSL_SESSION_set_down_load(s->sessions, i); 1131. CRYPTO_THREAD_unlock(s->lock); ssl/ssl_sess.c:1114:1: Parameter `lh->num_nodes` 1112. } 1113. 1114. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1115. 1116. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) ssl/ssl_sess.c:1114:1: Call 1112. } 1113. 1114. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 1115. 1116. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) crypto/lhash/lhash.c:198:1: Parameter `lh->num_nodes` 196. } 197. 198. > void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 199. { 200. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); crypto/lhash/lhash.c:200:5: Call 198. void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 199. { 200. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); ^ 201. } 202. crypto/lhash/lhash.c:166:1: <LHS trace> 164. } 165. 166. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 167. OPENSSL_LH_DOALL_FUNC func, 168. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:166:1: Parameter `lh->num_nodes` 164. } 165. 166. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 167. OPENSSL_LH_DOALL_FUNC func, 168. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:180:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `SSL_free` 178. * memory leaks otherwise 179. */ 180. for (i = lh->num_nodes - 1; i >= 0; i--) { ^ 181. a = lh->b[i]; 182. while (a != NULL) {
https://github.com/openssl/openssl/blob/148796291e47ad402ddfd1bbe6f34a2652657ec2/crypto/lhash/lhash.c/#L180
d2a_code_trace_data_43985
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/bn/bn_prime.c:92: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `probable_prime_dh_safe`. Showing all 22 steps of the trace crypto/bn/bn_prime.c:54:1: Parameter `ret->top` 52. } 53. 54. > int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, 55. const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb) 56. { crypto/bn/bn_prime.c:92:18: Call 90. } else { 91. if (safe) { 92. if (!probable_prime_dh_safe(ret, bits, add, rem, ctx)) ^ 93. goto err; 94. } else { crypto/bn/bn_prime.c:407:1: Parameter `p->top` 405. } 406. 407. > static int probable_prime_dh_safe(BIGNUM *p, int bits, const BIGNUM *padd, 408. const BIGNUM *rem, BN_CTX *ctx) 409. { crypto/bn/bn_prime.c:443:10: Call 441. 442. /* we now have a random number 'rand' to test. */ 443. if (!BN_lshift1(p, q)) ^ 444. goto err; 445. if (!BN_add_word(p, 1)) crypto/bn/bn_shift.c:13:1: Parameter `r->top` 11. #include "bn_lcl.h" 12. 13. > int BN_lshift1(BIGNUM *r, const BIGNUM *a) 14. { 15. register BN_ULONG *ap, *rp, t, c; crypto/bn/bn_shift.c:27:13: Call 25. r->top = a->top; 26. } else { 27. if (bn_wexpand(r, a->top + 1) == NULL) ^ 28. return (0); 29. } 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:284:1: Parameter `b->top` 282. */ 283. 284. > BIGNUM *bn_expand2(BIGNUM *b, int words) 285. { 286. bn_check_top(b); crypto/bn/bn_lib.c:289:23: Call 287. 288. if (words > b->dmax) { 289. BN_ULONG *a = bn_expand_internal(b, words); ^ 290. if (!a) 291. return NULL; crypto/bn/bn_lib.c:246:1: <Offset trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `b->top` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: <Length trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `words` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:263:13: Call 261. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 262. else 263. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 264. if (a == NULL) { 265. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/mem.c:186:1: Parameter `num` 184. } 185. 186. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 187. { 188. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:188:17: Call 186. void *CRYPTO_zalloc(size_t num, const char *file, int line) 187. { 188. void *ret = CRYPTO_malloc(num, file, line); ^ 189. 190. FAILTEST(); crypto/mem.c:166:9: Assignment 164. 165. if (num == 0) 166. return NULL; ^ 167. 168. FAILTEST(); crypto/mem.c:188:5: Assignment 186. void *CRYPTO_zalloc(size_t num, const char *file, int line) 187. { 188. void *ret = CRYPTO_malloc(num, file, line); ^ 189. 190. FAILTEST(); crypto/mem.c:193:5: Assignment 191. if (ret != NULL) 192. memset(ret, 0, num); 193. return ret; ^ 194. } 195. crypto/bn/bn_lib.c:263:9: Assignment 261. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 262. else 263. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 264. if (a == NULL) { 265. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/bn/bn_lib.c:271:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `probable_prime_dh_safe` 269. assert(b->top <= words); 270. if (b->top > 0) 271. memcpy(a, b->d, sizeof(*a) * b->top); ^ 272. 273. return a;
https://github.com/openssl/openssl/blob/757264207ad8650a89ea903d48ad89f61d56ea9c/crypto/bn/bn_lib.c/#L271
d2a_code_trace_data_43986
static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type) { OutputStream *ost; AVStream *st = avformat_new_stream(oc, NULL); int idx = oc->nb_streams - 1, ret = 0; char *bsf = NULL, *next, *codec_tag = NULL; AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL; double qscale = -1; char *buf = NULL, *arg = NULL, *preset = NULL; AVIOContext *s = NULL; if (!st) { av_log(NULL, AV_LOG_FATAL, "Could not alloc stream.\n"); exit_program(1); } if (oc->nb_streams - 1 < o->nb_streamid_map) st->id = o->streamid_map[oc->nb_streams - 1]; output_streams = grow_array(output_streams, sizeof(*output_streams), &nb_output_streams, nb_output_streams + 1); ost = &output_streams[nb_output_streams - 1]; ost->file_index = nb_output_files; ost->index = idx; ost->st = st; st->codec->codec_type = type; choose_encoder(o, oc, ost); if (ost->enc) { ost->opts = filter_codec_opts(codec_opts, ost->enc->id, oc, st); } avcodec_get_context_defaults3(st->codec, ost->enc); st->codec->codec_type = type; MATCH_PER_STREAM_OPT(presets, str, preset, oc, st); if (preset && (!(ret = get_preset_file_2(preset, ost->enc->name, &s)))) { do { buf = get_line(s); if (!buf[0] || buf[0] == '#') { av_free(buf); continue; } if (!(arg = strchr(buf, '='))) { av_log(NULL, AV_LOG_FATAL, "Invalid line found in the preset file.\n"); exit_program(1); } *arg++ = 0; av_dict_set(&ost->opts, buf, arg, AV_DICT_DONT_OVERWRITE); av_free(buf); } while (!s->eof_reached); avio_close(s); } if (ret) { av_log(NULL, AV_LOG_FATAL, "Preset %s specified for stream %d:%d, but could not be opened.\n", preset, ost->file_index, ost->index); exit_program(1); } ost->max_frames = INT64_MAX; MATCH_PER_STREAM_OPT(max_frames, i64, ost->max_frames, oc, st); MATCH_PER_STREAM_OPT(bitstream_filters, str, bsf, oc, st); while (bsf) { if (next = strchr(bsf, ',')) *next++ = 0; if (!(bsfc = av_bitstream_filter_init(bsf))) { av_log(NULL, AV_LOG_FATAL, "Unknown bitstream filter %s\n", bsf); exit_program(1); } if (bsfc_prev) bsfc_prev->next = bsfc; else ost->bitstream_filters = bsfc; bsfc_prev = bsfc; bsf = next; } MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, oc, st); if (codec_tag) { uint32_t tag = strtol(codec_tag, &next, 0); if (*next) tag = AV_RL32(codec_tag); st->codec->codec_tag = tag; } MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st); if (qscale >= 0 || same_quant) { st->codec->flags |= CODEC_FLAG_QSCALE; st->codec->global_quality = FF_QP2LAMBDA * qscale; } if (oc->oformat->flags & AVFMT_GLOBALHEADER) st->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; av_opt_get_int(sws_opts, "sws_flags", 0, &ost->sws_flags); return ost; } avconv.c:3122: error: Null Dereference pointer `st` last assigned on line 3108 could be null and is dereferenced at line 3122, column 9. avconv.c:3105:1: start of procedure new_output_stream() 3103. } 3104. 3105. static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type) ^ 3106. { 3107. OutputStream *ost; avconv.c:3108:5: 3106. { 3107. OutputStream *ost; 3108. AVStream *st = avformat_new_stream(oc, NULL); ^ 3109. int idx = oc->nb_streams - 1, ret = 0; 3110. char *bsf = NULL, *next, *codec_tag = NULL; libavformat/utils.c:2704:1: start of procedure avformat_new_stream() 2702. #endif 2703. 2704. AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) ^ 2705. { 2706. AVStream *st; libavformat/utils.c:2710:9: Taking true branch 2708. AVStream **streams; 2709. 2710. if (s->nb_streams >= INT_MAX/sizeof(*streams)) ^ 2711. return NULL; 2712. streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams)); libavformat/utils.c:2711:9: 2709. 2710. if (s->nb_streams >= INT_MAX/sizeof(*streams)) 2711. return NULL; ^ 2712. streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams)); 2713. if (!streams) libavformat/utils.c:2752:1: return from a call to avformat_new_stream 2750. s->streams[s->nb_streams++] = st; 2751. return st; 2752. } ^ 2753. 2754. AVProgram *av_new_program(AVFormatContext *ac, int id) avconv.c:3109:5: 3107. OutputStream *ost; 3108. AVStream *st = avformat_new_stream(oc, NULL); 3109. int idx = oc->nb_streams - 1, ret = 0; ^ 3110. char *bsf = NULL, *next, *codec_tag = NULL; 3111. AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL; avconv.c:3110:5: 3108. AVStream *st = avformat_new_stream(oc, NULL); 3109. int idx = oc->nb_streams - 1, ret = 0; 3110. char *bsf = NULL, *next, *codec_tag = NULL; ^ 3111. AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL; 3112. double qscale = -1; avconv.c:3111:5: 3109. int idx = oc->nb_streams - 1, ret = 0; 3110. char *bsf = NULL, *next, *codec_tag = NULL; 3111. AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL; ^ 3112. double qscale = -1; 3113. char *buf = NULL, *arg = NULL, *preset = NULL; avconv.c:3112:5: 3110. char *bsf = NULL, *next, *codec_tag = NULL; 3111. AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL; 3112. double qscale = -1; ^ 3113. char *buf = NULL, *arg = NULL, *preset = NULL; 3114. AVIOContext *s = NULL; avconv.c:3113:5: 3111. AVBitStreamFilterContext *bsfc, *bsfc_prev = NULL; 3112. double qscale = -1; 3113. char *buf = NULL, *arg = NULL, *preset = NULL; ^ 3114. AVIOContext *s = NULL; 3115. avconv.c:3114:5: 3112. double qscale = -1; 3113. char *buf = NULL, *arg = NULL, *preset = NULL; 3114. AVIOContext *s = NULL; ^ 3115. 3116. if (!st) { avconv.c:3116:10: Taking true branch 3114. AVIOContext *s = NULL; 3115. 3116. if (!st) { ^ 3117. av_log(NULL, AV_LOG_FATAL, "Could not alloc stream.\n"); 3118. exit_program(1); avconv.c:3117:9: Skipping av_log(): empty list of specs 3115. 3116. if (!st) { 3117. av_log(NULL, AV_LOG_FATAL, "Could not alloc stream.\n"); ^ 3118. exit_program(1); 3119. } avconv.c:3118:9: Skipping exit_program(): empty list of specs 3116. if (!st) { 3117. av_log(NULL, AV_LOG_FATAL, "Could not alloc stream.\n"); 3118. exit_program(1); ^ 3119. } 3120. avconv.c:3121:9: Taking true branch 3119. } 3120. 3121. if (oc->nb_streams - 1 < o->nb_streamid_map) ^ 3122. st->id = o->streamid_map[oc->nb_streams - 1]; 3123. avconv.c:3122:9: 3120. 3121. if (oc->nb_streams - 1 < o->nb_streamid_map) 3122. st->id = o->streamid_map[oc->nb_streams - 1]; ^ 3123. 3124. output_streams = grow_array(output_streams, sizeof(*output_streams), &nb_output_streams,
https://github.com/libav/libav/blob/e551a6f49a13f2e992c42bc00a8b45ad636e52ad/avconv.c/#L3122
d2a_code_trace_data_43987
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 ymin 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_43988
static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size) { H264Context *h = s->priv_data; const uint8_t *buf_end = buf + buf_size; unsigned int pps_id; unsigned int slice_type; int state = -1, got_reset = 0; const uint8_t *ptr; int field_poc[2]; s->pict_type = AV_PICTURE_TYPE_I; s->key_frame = 0; s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; h->avctx = avctx; ff_h264_reset_sei(h); if (!buf_size) return 0; for (;;) { int src_length, dst_length, consumed; buf = avpriv_find_start_code(buf, buf_end, &state); if (buf >= buf_end) break; --buf; src_length = buf_end - buf; switch (state & 0x1f) { case NAL_SLICE: case NAL_IDR_SLICE: if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) { if (src_length > 60) src_length = 60; } else { if (src_length > 1000) src_length = 1000; } break; } ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); if (ptr == NULL || dst_length < 0) break; init_get_bits(&h->gb, ptr, 8 * dst_length); switch (h->nal_unit_type) { case NAL_SPS: ff_h264_decode_seq_parameter_set(h); break; case NAL_PPS: ff_h264_decode_picture_parameter_set(h, h->gb.size_in_bits); break; case NAL_SEI: ff_h264_decode_sei(h); break; case NAL_IDR_SLICE: s->key_frame = 1; h->prev_frame_num = 0; h->prev_frame_num_offset = 0; h->prev_poc_msb = h->prev_poc_lsb = 0; case NAL_SLICE: get_ue_golomb(&h->gb); slice_type = get_ue_golomb_31(&h->gb); s->pict_type = golomb_to_pict_type[slice_type % 5]; if (h->sei_recovery_frame_cnt >= 0) { s->key_frame = 1; } pps_id = get_ue_golomb(&h->gb); if (pps_id >= MAX_PPS_COUNT) { av_log(h->avctx, AV_LOG_ERROR, "pps_id out of range\n"); return -1; } if (!h->pps_buffers[pps_id]) { av_log(h->avctx, AV_LOG_ERROR, "non-existing PPS referenced\n"); return -1; } h->pps = *h->pps_buffers[pps_id]; if (!h->sps_buffers[h->pps.sps_id]) { av_log(h->avctx, AV_LOG_ERROR, "non-existing SPS referenced\n"); return -1; } h->sps = *h->sps_buffers[h->pps.sps_id]; h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num); avctx->profile = ff_h264_get_profile(&h->sps); avctx->level = h->sps.level_idc; if (h->sps.frame_mbs_only_flag) { h->picture_structure = PICT_FRAME; } else { if (get_bits1(&h->gb)) { h->picture_structure = PICT_TOP_FIELD + get_bits1(&h->gb); } else { h->picture_structure = PICT_FRAME; } } if (h->nal_unit_type == NAL_IDR_SLICE) get_ue_golomb(&h->gb); if (h->sps.poc_type == 0) { h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb); if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME) h->delta_poc_bottom = get_se_golomb(&h->gb); } if (h->sps.poc_type == 1 && !h->sps.delta_pic_order_always_zero_flag) { h->delta_poc[0] = get_se_golomb(&h->gb); if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME) h->delta_poc[1] = get_se_golomb(&h->gb); } field_poc[0] = field_poc[1] = INT_MAX; ff_init_poc(h, field_poc, &s->output_picture_number); if (h->nal_ref_idc && h->nal_unit_type != NAL_IDR_SLICE) { got_reset = scan_mmco_reset(s); if (got_reset < 0) return got_reset; } h->prev_frame_num = got_reset ? 0 : h->frame_num; h->prev_frame_num_offset = got_reset ? 0 : h->frame_num_offset; if (h->nal_ref_idc != 0) { if (!got_reset) { h->prev_poc_msb = h->poc_msb; h->prev_poc_lsb = h->poc_lsb; } else { h->prev_poc_msb = 0; h->prev_poc_lsb = h->picture_structure == PICT_BOTTOM_FIELD ? 0 : field_poc[0]; } } if (h->sps.pic_struct_present_flag) { switch (h->sei_pic_struct) { case SEI_PIC_STRUCT_TOP_FIELD: case SEI_PIC_STRUCT_BOTTOM_FIELD: s->repeat_pict = 0; break; case SEI_PIC_STRUCT_FRAME: case SEI_PIC_STRUCT_TOP_BOTTOM: case SEI_PIC_STRUCT_BOTTOM_TOP: s->repeat_pict = 1; break; case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: s->repeat_pict = 2; break; case SEI_PIC_STRUCT_FRAME_DOUBLING: s->repeat_pict = 3; break; case SEI_PIC_STRUCT_FRAME_TRIPLING: s->repeat_pict = 5; break; default: s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0; break; } } else { s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0; } if (h->picture_structure == PICT_FRAME) { s->picture_structure = AV_PICTURE_STRUCTURE_FRAME; if (h->sps.pic_struct_present_flag) { switch (h->sei_pic_struct) { case SEI_PIC_STRUCT_TOP_BOTTOM: case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: s->field_order = AV_FIELD_TT; break; case SEI_PIC_STRUCT_BOTTOM_TOP: case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: s->field_order = AV_FIELD_BB; break; default: s->field_order = AV_FIELD_PROGRESSIVE; break; } } else { if (field_poc[0] < field_poc[1]) s->field_order = AV_FIELD_TT; else if (field_poc[0] > field_poc[1]) s->field_order = AV_FIELD_BB; else s->field_order = AV_FIELD_PROGRESSIVE; } } else { if (h->picture_structure == PICT_TOP_FIELD) s->picture_structure = AV_PICTURE_STRUCTURE_TOP_FIELD; else s->picture_structure = AV_PICTURE_STRUCTURE_BOTTOM_FIELD; s->field_order = AV_FIELD_UNKNOWN; } return 0; } buf += consumed; } av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n"); return -1; } libavcodec/h264_parser.c:220: error: Null Dereference pointer `h->gb.buffer` last assigned on line 217 could be null and is dereferenced by call to `ff_h264_decode_seq_parameter_set()` at line 220, column 13. libavcodec/h264_parser.c:167:1: start of procedure parse_nal_units() 165. * @param buf_size size of the buffer. 166. */ 167. static inline int parse_nal_units(AVCodecParserContext *s, ^ 168. AVCodecContext *avctx, 169. const uint8_t *buf, int buf_size) libavcodec/h264_parser.c:171:5: 169. const uint8_t *buf, int buf_size) 170. { 171. H264Context *h = s->priv_data; ^ 172. const uint8_t *buf_end = buf + buf_size; 173. unsigned int pps_id; libavcodec/h264_parser.c:172:5: 170. { 171. H264Context *h = s->priv_data; 172. const uint8_t *buf_end = buf + buf_size; ^ 173. unsigned int pps_id; 174. unsigned int slice_type; libavcodec/h264_parser.c:175:5: 173. unsigned int pps_id; 174. unsigned int slice_type; 175. int state = -1, got_reset = 0; ^ 176. const uint8_t *ptr; 177. int field_poc[2]; libavcodec/h264_parser.c:180:5: 178. 179. /* set some sane default values */ 180. s->pict_type = AV_PICTURE_TYPE_I; ^ 181. s->key_frame = 0; 182. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; libavcodec/h264_parser.c:181:5: 179. /* set some sane default values */ 180. s->pict_type = AV_PICTURE_TYPE_I; 181. s->key_frame = 0; ^ 182. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; 183. libavcodec/h264_parser.c:182:5: 180. s->pict_type = AV_PICTURE_TYPE_I; 181. s->key_frame = 0; 182. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; ^ 183. 184. h->avctx = avctx; libavcodec/h264_parser.c:184:5: 182. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; 183. 184. h->avctx = avctx; ^ 185. ff_h264_reset_sei(h); 186. libavcodec/h264_parser.c:185:5: 183. 184. h->avctx = avctx; 185. ff_h264_reset_sei(h); ^ 186. 187. if (!buf_size) libavcodec/h264_sei.c:39:1: start of procedure ff_h264_reset_sei() 37. }; 38. 39. void ff_h264_reset_sei(H264Context *h) ^ 40. { 41. h->sei_recovery_frame_cnt = -1; libavcodec/h264_sei.c:41:5: 39. void ff_h264_reset_sei(H264Context *h) 40. { 41. h->sei_recovery_frame_cnt = -1; ^ 42. h->sei_dpb_output_delay = 0; 43. h->sei_cpb_removal_delay = -1; libavcodec/h264_sei.c:42:5: 40. { 41. h->sei_recovery_frame_cnt = -1; 42. h->sei_dpb_output_delay = 0; ^ 43. h->sei_cpb_removal_delay = -1; 44. h->sei_buffering_period_present = 0; libavcodec/h264_sei.c:43:5: 41. h->sei_recovery_frame_cnt = -1; 42. h->sei_dpb_output_delay = 0; 43. h->sei_cpb_removal_delay = -1; ^ 44. h->sei_buffering_period_present = 0; 45. } libavcodec/h264_sei.c:44:5: 42. h->sei_dpb_output_delay = 0; 43. h->sei_cpb_removal_delay = -1; 44. h->sei_buffering_period_present = 0; ^ 45. } 46. libavcodec/h264_sei.c:45:1: return from a call to ff_h264_reset_sei 43. h->sei_cpb_removal_delay = -1; 44. h->sei_buffering_period_present = 0; 45. } ^ 46. 47. static int decode_picture_timing(H264Context *h) libavcodec/h264_parser.c:187:10: Taking false branch 185. ff_h264_reset_sei(h); 186. 187. if (!buf_size) ^ 188. return 0; 189. libavcodec/h264_parser.c:389:5: Loop condition is true. Entering loop body 387. } 388. buf += consumed; 389. } ^ 390. /* didn't find a picture! */ 391. av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n"); libavcodec/h264_parser.c:192:9: Skipping avpriv_find_start_code(): empty list of specs 190. for (;;) { 191. int src_length, dst_length, consumed; 192. buf = avpriv_find_start_code(buf, buf_end, &state); ^ 193. if (buf >= buf_end) 194. break; libavcodec/h264_parser.c:193:13: Taking false branch 191. int src_length, dst_length, consumed; 192. buf = avpriv_find_start_code(buf, buf_end, &state); 193. if (buf >= buf_end) ^ 194. break; 195. --buf; libavcodec/h264_parser.c:195:9: 193. if (buf >= buf_end) 194. break; 195. --buf; ^ 196. src_length = buf_end - buf; 197. switch (state & 0x1f) { libavcodec/h264_parser.c:196:9: 194. break; 195. --buf; 196. src_length = buf_end - buf; ^ 197. switch (state & 0x1f) { 198. case NAL_SLICE: libavcodec/h264_parser.c:197:9: 195. --buf; 196. src_length = buf_end - buf; 197. switch (state & 0x1f) { ^ 198. case NAL_SLICE: 199. case NAL_IDR_SLICE: libavcodec/h264_parser.c:198:9: Switch condition is true. Entering switch case 196. src_length = buf_end - buf; 197. switch (state & 0x1f) { 198. case NAL_SLICE: ^ 199. case NAL_IDR_SLICE: 200. // Do not walk the whole buffer just to decode slice header libavcodec/h264_parser.c:201:17: Taking false branch 199. case NAL_IDR_SLICE: 200. // Do not walk the whole buffer just to decode slice header 201. if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) { ^ 202. /* IDR or disposable slice 203. * No need to decode many bytes because MMCOs shall not be present. */ libavcodec/h264_parser.c:201:52: Taking false branch 199. case NAL_IDR_SLICE: 200. // Do not walk the whole buffer just to decode slice header 201. if ((state & 0x1f) == NAL_IDR_SLICE || ((state >> 5) & 0x3) == 0) { ^ 202. /* IDR or disposable slice 203. * No need to decode many bytes because MMCOs shall not be present. */ libavcodec/h264_parser.c:208:21: Taking false branch 206. } else { 207. /* To decode up to MMCOs */ 208. if (src_length > 1000) ^ 209. src_length = 1000; 210. } libavcodec/h264_parser.c:213:9: Skipping ff_h264_decode_nal(): empty list of specs 211. break; 212. } 213. ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); ^ 214. if (ptr == NULL || dst_length < 0) 215. break; libavcodec/h264_parser.c:214:13: Taking false branch 212. } 213. ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); 214. if (ptr == NULL || dst_length < 0) ^ 215. break; 216. libavcodec/h264_parser.c:214:28: Taking false branch 212. } 213. ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); 214. if (ptr == NULL || dst_length < 0) ^ 215. break; 216. libavcodec/h264_parser.c:217:9: 215. break; 216. 217. init_get_bits(&h->gb, ptr, 8 * dst_length); ^ 218. switch (h->nal_unit_type) { 219. case NAL_SPS: libavcodec/get_bits.h:375:1: start of procedure init_get_bits() 373. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. 374. */ 375. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, ^ 376. int bit_size) 377. { libavcodec/get_bits.h:379:5: 377. { 378. int buffer_size; 379. int ret = 0; ^ 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { libavcodec/get_bits.h:381:9: Taking true branch 379. int ret = 0; 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { ^ 382. buffer_size = bit_size = 0; 383. buffer = NULL; libavcodec/get_bits.h:382:9: 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 382. buffer_size = bit_size = 0; ^ 383. buffer = NULL; 384. ret = AVERROR_INVALIDDATA; libavcodec/get_bits.h:383:9: 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 382. buffer_size = bit_size = 0; 383. buffer = NULL; ^ 384. ret = AVERROR_INVALIDDATA; 385. } libavcodec/get_bits.h:384:9: 382. buffer_size = bit_size = 0; 383. buffer = NULL; 384. ret = AVERROR_INVALIDDATA; ^ 385. } 386. libavcodec/get_bits.h:387:5: 385. } 386. 387. buffer_size = (bit_size + 7) >> 3; ^ 388. 389. s->buffer = buffer; libavcodec/get_bits.h:389:5: 387. buffer_size = (bit_size + 7) >> 3; 388. 389. s->buffer = buffer; ^ 390. s->size_in_bits = bit_size; 391. #if !UNCHECKED_BITSTREAM_READER libavcodec/get_bits.h:390:5: 388. 389. s->buffer = buffer; 390. s->size_in_bits = bit_size; ^ 391. #if !UNCHECKED_BITSTREAM_READER 392. s->size_in_bits_plus8 = bit_size + 8; libavcodec/get_bits.h:392:5: 390. s->size_in_bits = bit_size; 391. #if !UNCHECKED_BITSTREAM_READER 392. s->size_in_bits_plus8 = bit_size + 8; ^ 393. #endif 394. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:394:5: 392. s->size_in_bits_plus8 = bit_size + 8; 393. #endif 394. s->buffer_end = buffer + buffer_size; ^ 395. s->index = 0; 396. libavcodec/get_bits.h:395:5: 393. #endif 394. s->buffer_end = buffer + buffer_size; 395. s->index = 0; ^ 396. 397. return ret; libavcodec/get_bits.h:397:5: 395. s->index = 0; 396. 397. return ret; ^ 398. } 399. libavcodec/get_bits.h:398:1: return from a call to init_get_bits 396. 397. return ret; 398. } ^ 399. 400. /** libavcodec/h264_parser.c:218:9: 216. 217. init_get_bits(&h->gb, ptr, 8 * dst_length); 218. switch (h->nal_unit_type) { ^ 219. case NAL_SPS: 220. ff_h264_decode_seq_parameter_set(h); libavcodec/h264_parser.c:219:9: Switch condition is true. Entering switch case 217. init_get_bits(&h->gb, ptr, 8 * dst_length); 218. switch (h->nal_unit_type) { 219. case NAL_SPS: ^ 220. ff_h264_decode_seq_parameter_set(h); 221. break; libavcodec/h264_parser.c:220:13: 218. switch (h->nal_unit_type) { 219. case NAL_SPS: 220. ff_h264_decode_seq_parameter_set(h); ^ 221. break; 222. case NAL_PPS: libavcodec/h264_ps.c:295:1: start of procedure ff_h264_decode_seq_parameter_set() 293. } 294. 295. int ff_h264_decode_seq_parameter_set(H264Context *h) ^ 296. { 297. int profile_idc, level_idc, constraint_set_flags = 0; libavcodec/h264_ps.c:297:5: 295. int ff_h264_decode_seq_parameter_set(H264Context *h) 296. { 297. int profile_idc, level_idc, constraint_set_flags = 0; ^ 298. unsigned int sps_id; 299. int i, log2_max_frame_num_minus4; libavcodec/h264_ps.c:302:5: Skipping get_bits(): empty list of specs 300. SPS *sps; 301. 302. profile_idc = get_bits(&h->gb, 8); ^ 303. constraint_set_flags |= get_bits1(&h->gb) << 0; // constraint_set0_flag 304. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag libavcodec/h264_ps.c:303:5: 301. 302. profile_idc = get_bits(&h->gb, 8); 303. constraint_set_flags |= get_bits1(&h->gb) << 0; // constraint_set0_flag ^ 304. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag 305. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:304:5: 302. profile_idc = get_bits(&h->gb, 8); 303. constraint_set_flags |= get_bits1(&h->gb) << 0; // constraint_set0_flag 304. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag ^ 305. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag 306. constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:305:5: 303. constraint_set_flags |= get_bits1(&h->gb) << 0; // constraint_set0_flag 304. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag 305. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag ^ 306. constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag 307. get_bits(&h->gb, 4); // reserved libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:306:5: 304. constraint_set_flags |= get_bits1(&h->gb) << 1; // constraint_set1_flag 305. constraint_set_flags |= get_bits1(&h->gb) << 2; // constraint_set2_flag 306. constraint_set_flags |= get_bits1(&h->gb) << 3; // constraint_set3_flag ^ 307. get_bits(&h->gb, 4); // reserved 308. level_idc = get_bits(&h->gb, 8); libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7;
https://github.com/libav/libav/blob/72072bf9de3241848ea86f68d2297b7a5d6ad49b/libavcodec/h264_parser.c/#L220
d2a_code_trace_data_43989
ERR_STATE *ERR_get_state(void) { ERR_STATE *state; int saveerrno = get_last_sys_error(); if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL)) return NULL; if (!RUN_ONCE(&err_init, err_do_init)) return NULL; state = CRYPTO_THREAD_get_local(&err_thread_local); if (state == (ERR_STATE*)-1) return NULL; if (state == NULL) { if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) return NULL; if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) { CRYPTO_THREAD_set_local(&err_thread_local, NULL); return NULL; } if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state) || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { ERR_STATE_free(state); CRYPTO_THREAD_set_local(&err_thread_local, NULL); return NULL; } OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL); } set_sys_error(saveerrno); return state; } crypto/err/err.c:703: error: NULL_DEREFERENCE pointer `null` is dereferenced by call to `ossl_init_thread_start()` at line 703, column 14. Showing all 28 steps of the trace crypto/err/err.c:679:1: start of procedure ERR_get_state() 677. } 678. 679. > ERR_STATE *ERR_get_state(void) 680. { 681. ERR_STATE *state; crypto/err/err.c:682:5: 680. { 681. ERR_STATE *state; 682. > int saveerrno = get_last_sys_error(); 683. 684. if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL)) crypto/err/err.c:684:10: Taking false branch 682. int saveerrno = get_last_sys_error(); 683. 684. if (!OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL)) ^ 685. return NULL; 686. crypto/err/err.c:687:10: 685. return NULL; 686. 687. > if (!RUN_ONCE(&err_init, err_do_init)) 688. return NULL; 689. crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once() 109. } 110. 111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:113:9: Taking false branch 111. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) ^ 114. return 0; 115. crypto/threads_pthread.c:116:5: 114. return 0; 115. 116. > return 1; 117. } 118. crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once 115. 116. return 1; 117. > } 118. 119. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/err/err.c:687:10: Condition is true 685. return NULL; 686. 687. if (!RUN_ONCE(&err_init, err_do_init)) ^ 688. return NULL; 689. crypto/err/err.c:687:10: Taking false branch 685. return NULL; 686. 687. if (!RUN_ONCE(&err_init, err_do_init)) ^ 688. return NULL; 689. crypto/err/err.c:690:5: 688. return NULL; 689. 690. > state = CRYPTO_THREAD_get_local(&err_thread_local); 691. if (state == (ERR_STATE*)-1) 692. return NULL; crypto/threads_pthread.c:127:1: start of procedure CRYPTO_THREAD_get_local() 125. } 126. 127. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 128. { 129. return pthread_getspecific(*key); crypto/threads_pthread.c:129:5: Skipping pthread_getspecific(): method has no implementation 127. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 128. { 129. return pthread_getspecific(*key); ^ 130. } 131. crypto/threads_pthread.c:130:1: return from a call to CRYPTO_THREAD_get_local 128. { 129. return pthread_getspecific(*key); 130. > } 131. 132. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) crypto/err/err.c:691:9: Taking false branch 689. 690. state = CRYPTO_THREAD_get_local(&err_thread_local); 691. if (state == (ERR_STATE*)-1) ^ 692. return NULL; 693. crypto/err/err.c:694:9: Taking true branch 692. return NULL; 693. 694. if (state == NULL) { ^ 695. if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) 696. return NULL; crypto/err/err.c:695:14: 693. 694. if (state == NULL) { 695. > if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) 696. return NULL; 697. crypto/threads_pthread.c:132:1: start of procedure CRYPTO_THREAD_set_local() 130. } 131. 132. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 133. { 134. if (pthread_setspecific(*key, val) != 0) crypto/threads_pthread.c:134:9: Taking false branch 132. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 133. { 134. if (pthread_setspecific(*key, val) != 0) ^ 135. return 0; 136. crypto/threads_pthread.c:137:5: 135. return 0; 136. 137. > return 1; 138. } 139. crypto/threads_pthread.c:138:1: return from a call to CRYPTO_THREAD_set_local 136. 137. return 1; 138. > } 139. 140. int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key) crypto/err/err.c:695:14: Taking false branch 693. 694. if (state == NULL) { 695. if (!CRYPTO_THREAD_set_local(&err_thread_local, (ERR_STATE*)-1)) ^ 696. return NULL; 697. crypto/err/err.c:698:13: 696. return NULL; 697. 698. > if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) { 699. CRYPTO_THREAD_set_local(&err_thread_local, NULL); 700. return NULL; providers/fips/fipsprov.c:476:1: start of procedure CRYPTO_zalloc() 474. } 475. 476. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 477. { 478. return c_CRYPTO_zalloc(num, file, line); providers/fips/fipsprov.c:478:5: Skipping __function_pointer__(): unresolved function pointer 476. void *CRYPTO_zalloc(size_t num, const char *file, int line) 477. { 478. return c_CRYPTO_zalloc(num, file, line); ^ 479. } 480. providers/fips/fipsprov.c:479:1: return from a call to CRYPTO_zalloc 477. { 478. return c_CRYPTO_zalloc(num, file, line); 479. > } 480. 481. void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line) crypto/err/err.c:698:13: Taking false branch 696. return NULL; 697. 698. if ((state = OPENSSL_zalloc(sizeof(*state))) == NULL) { ^ 699. CRYPTO_THREAD_set_local(&err_thread_local, NULL); 700. return NULL; crypto/err/err.c:703:14: 701. } 702. 703. > if (!ossl_init_thread_start(NULL, NULL, err_delete_thread_state) 704. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { 705. ERR_STATE_free(state);
https://github.com/openssl/openssl/blob/2cafb1dff3ef13c470c4d2d7b1d8a1f7142d8813/crypto/err/err.c/#L703
d2a_code_trace_data_43990
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, int32_t sb_samples[SBLIMIT]) { int32_t tmp[32]; register MPA_INT *synth_buf; register const MPA_INT *w, *w2, *p; int j, offset, v; OUT_INT *samples2; #if FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif dct32(tmp, sb_samples); offset = *synth_buf_offset; synth_buf = synth_buf_ptr + offset; for(j=0;j<32;j++) { v = tmp[j]; #if FRAC_BITS <= 15 v = av_clip_int16(v); #endif synth_buf[j] = v; } memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(sum, +=, w, p); p = synth_buf + 48; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); samples += incr; w++; for(j=1;j<16;j++) { sum2 = 0; p = synth_buf + 16 + j; SUM8P2(sum, +=, sum2, -=, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p); *samples = round_sample(&sum); samples += incr; sum += sum2; *samples2 = round_sample(&sum); samples2 -= incr; w++; w2--; } p = synth_buf + 32; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; offset = (offset - 32) & 511; *synth_buf_offset = offset; } libavcodec/mpc.c:60: error: Buffer Overrun L2 Offset: [144+min(0, `c->synth_buf_offset[*]`), 145+max(511, `c->synth_buf_offset[*]`)] (⇐ [16+min(0, `c->synth_buf_offset[*]`), 17+max(511, `c->synth_buf_offset[*]`)] + 128) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]` 49. * Process decoded Musepack data and produce PCM 50. */ 51. static void mpc_synth(MPCContext *c, int16_t *out) ^ 52. { 53. int dither_state = 0; libavcodec/mpc.c:60:13: Call 58. samples_ptr = samples + ch; 59. for(i = 0; i < SAMPLES_PER_BAND; i++) { 60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 61. mpa_window, &dither_state, 62. samples_ptr, 2, libavcodec/mpegaudiodec.c:858:1: <Length trace> 856. 32 samples. */ 857. /* XXX: optimize by avoiding ring buffer usage */ 858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 859. MPA_INT *window, int *dither_state, 860. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr` 856. 32 samples. */ 857. /* XXX: optimize by avoiding ring buffer usage */ 858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 859. MPA_INT *window, int *dither_state, 860. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:877:5: Assignment 875. 876. offset = *synth_buf_offset; 877. synth_buf = synth_buf_ptr + offset; ^ 878. 879. for(j=0;j<32;j++) { libavcodec/mpegaudiodec.c:896:5: Assignment 894. 895. sum = *dither_state; 896. p = synth_buf + 16; ^ 897. SUM8(sum, +=, w, p); 898. p = synth_buf + 48; libavcodec/mpegaudiodec.c:897:5: Array access: Offset: [144+min(0, c->synth_buf_offset[*]), 145+max(511, c->synth_buf_offset[*])] (⇐ [16+min(0, c->synth_buf_offset[*]), 17+max(511, c->synth_buf_offset[*])] + 128) Size: 2 by call to `ff_mpa_synth_filter` 895. sum = *dither_state; 896. p = synth_buf + 16; 897. SUM8(sum, +=, w, p); ^ 898. p = synth_buf + 48; 899. SUM8(sum, -=, w + 32, p);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L897
d2a_code_trace_data_43991
void TIFFSwabLong8(uint64* lp) { register unsigned char* cp = (unsigned char*) lp; unsigned char t; assert(sizeof(uint64)==8); t = cp[7]; cp[7] = cp[0]; cp[0] = t; t = cp[6]; cp[6] = cp[1]; cp[1] = t; t = cp[5]; cp[5] = cp[2]; cp[2] = t; t = cp[4]; cp[4] = cp[3]; cp[3] = t; } libtiff/tif_dirread.c:1482: error: Buffer Overrun L3 Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFSwabLong8`. libtiff/tif_dirread.c:1372:6: Call 1370. return(TIFFReadDirEntryErrType); 1371. } 1372. err=TIFFReadDirEntryArray(tif,direntry,&count,2,&origdata); ^ 1373. if ((err!=TIFFReadDirEntryErrOk)||(origdata==0)) 1374. { libtiff/tif_dirread.c:756:1: Parameter `**value` 754. } 755. 756. static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32* count, uint32 desttypesize, void** value) ^ 757. { 758. int typesize; libtiff/tif_dirread.c:1477:5: Assignment 1475. int16* mb; 1476. uint32 n; 1477. ma=(uint64*)origdata; ^ 1478. mb=data; 1479. for (n=0; n<count; n++) libtiff/tif_dirread.c:1482:7: Call 1480. { 1481. if (tif->tif_flags&TIFF_SWAB) 1482. TIFFSwabLong8(ma); ^ 1483. err=TIFFReadDirEntryCheckRangeSshortLong8(*ma); 1484. if (err!=TIFFReadDirEntryErrOk) libtiff/tif_swab.c:58:1: <Length trace> 56. 57. #ifndef TIFFSwabLong8 58. void ^ 59. TIFFSwabLong8(uint64* lp) 60. { libtiff/tif_swab.c:58:1: Parameter `*lp` 56. 57. #ifndef TIFFSwabLong8 58. void ^ 59. TIFFSwabLong8(uint64* lp) 60. { libtiff/tif_swab.c:61:2: Assignment 59. TIFFSwabLong8(uint64* lp) 60. { 61. register unsigned char* cp = (unsigned char*) lp; ^ 62. unsigned char t; 63. assert(sizeof(uint64)==8); libtiff/tif_swab.c:64:6: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFSwabLong8` 62. unsigned char t; 63. assert(sizeof(uint64)==8); 64. t = cp[7]; cp[7] = cp[0]; cp[0] = t; ^ 65. t = cp[6]; cp[6] = cp[1]; cp[1] = t; 66. t = cp[5]; cp[5] = cp[2]; cp[2] = t;
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L64
d2a_code_trace_data_43992
int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor) { if (generator == NULL) { ECerr(EC_F_EC_GROUP_SET_GENERATOR, ERR_R_PASSED_NULL_PARAMETER); return 0; } if (group->generator == NULL) { group->generator = EC_POINT_new(group); if (group->generator == NULL) return 0; } if (!EC_POINT_copy(group->generator, generator)) return 0; if (order != NULL) { if (!BN_copy(group->order, order)) return 0; } else BN_zero(group->order); if (cofactor != NULL) { if (!BN_copy(group->cofactor, cofactor)) return 0; } else BN_zero(group->cofactor); ec_precompute_mont_data(group); return 1; } crypto/ec/ec_lib.c:336: error: MEMORY_LEAK memory dynamically allocated by call to `EC_POINT_new()` at line 312, column 28 is not reachable after line 336, column 5. Showing all 54 steps of the trace crypto/ec/ec_lib.c:303:1: start of procedure EC_GROUP_set_generator() 301. } 302. 303. > int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, 304. const BIGNUM *order, const BIGNUM *cofactor) 305. { crypto/ec/ec_lib.c:306:9: Taking false branch 304. const BIGNUM *order, const BIGNUM *cofactor) 305. { 306. if (generator == NULL) { ^ 307. ECerr(EC_F_EC_GROUP_SET_GENERATOR, ERR_R_PASSED_NULL_PARAMETER); 308. return 0; crypto/ec/ec_lib.c:311:9: Taking true branch 309. } 310. 311. if (group->generator == NULL) { ^ 312. group->generator = EC_POINT_new(group); 313. if (group->generator == NULL) crypto/ec/ec_lib.c:312:9: 310. 311. if (group->generator == NULL) { 312. > group->generator = EC_POINT_new(group); 313. if (group->generator == NULL) 314. return 0; crypto/ec/ec_lib.c:561:1: start of procedure EC_POINT_new() 559. /* functions for EC_POINT objects */ 560. 561. > EC_POINT *EC_POINT_new(const EC_GROUP *group) 562. { 563. EC_POINT *ret; crypto/ec/ec_lib.c:565:9: Taking false branch 563. EC_POINT *ret; 564. 565. if (group == NULL) { ^ 566. ECerr(EC_F_EC_POINT_NEW, ERR_R_PASSED_NULL_PARAMETER); 567. return NULL; crypto/ec/ec_lib.c:569:9: Taking false branch 567. return NULL; 568. } 569. if (group->meth->point_init == 0) { ^ 570. ECerr(EC_F_EC_POINT_NEW, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 571. return NULL; crypto/ec/ec_lib.c:574:5: 572. } 573. 574. > ret = OPENSSL_malloc(sizeof(*ret)); 575. if (ret == NULL) { 576. ECerr(EC_F_EC_POINT_NEW, ERR_R_MALLOC_FAILURE); 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/ec/ec_lib.c:575:9: Taking false branch 573. 574. ret = OPENSSL_malloc(sizeof(*ret)); 575. if (ret == NULL) { ^ 576. ECerr(EC_F_EC_POINT_NEW, ERR_R_MALLOC_FAILURE); 577. return NULL; crypto/ec/ec_lib.c:580:5: 578. } 579. 580. > ret->meth = group->meth; 581. 582. if (!ret->meth->point_init(ret)) { crypto/ec/ec_lib.c:582:10: Taking false branch 580. ret->meth = group->meth; 581. 582. if (!ret->meth->point_init(ret)) { ^ 583. OPENSSL_free(ret); 584. return NULL; crypto/ec/ec_lib.c:587:5: 585. } 586. 587. > return ret; 588. } 589. crypto/ec/ec_lib.c:588:1: return from a call to EC_POINT_new 586. 587. return ret; 588. > } 589. 590. void EC_POINT_free(EC_POINT *point) crypto/ec/ec_lib.c:313:13: Taking false branch 311. if (group->generator == NULL) { 312. group->generator = EC_POINT_new(group); 313. if (group->generator == NULL) ^ 314. return 0; 315. } crypto/ec/ec_lib.c:316:10: 314. return 0; 315. } 316. > if (!EC_POINT_copy(group->generator, generator)) 317. return 0; 318. crypto/ec/ec_lib.c:612:1: start of procedure EC_POINT_copy() 610. } 611. 612. > int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src) 613. { 614. if (dest->meth->point_copy == 0) { crypto/ec/ec_lib.c:614:9: Taking false branch 612. int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src) 613. { 614. if (dest->meth->point_copy == 0) { ^ 615. ECerr(EC_F_EC_POINT_COPY, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); 616. return 0; crypto/ec/ec_lib.c:618:9: Taking false branch 616. return 0; 617. } 618. if (dest->meth != src->meth) { ^ 619. ECerr(EC_F_EC_POINT_COPY, EC_R_INCOMPATIBLE_OBJECTS); 620. return 0; crypto/ec/ec_lib.c:622:9: Taking false branch 620. return 0; 621. } 622. if (dest == src) ^ 623. return 1; 624. return dest->meth->point_copy(dest, src); crypto/ec/ec_lib.c:624:5: Skipping __function_pointer__(): unresolved function pointer 622. if (dest == src) 623. return 1; 624. return dest->meth->point_copy(dest, src); ^ 625. } 626. crypto/ec/ec_lib.c:625:1: return from a call to EC_POINT_copy 623. return 1; 624. return dest->meth->point_copy(dest, src); 625. > } 626. 627. EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group) crypto/ec/ec_lib.c:316:10: Taking false branch 314. return 0; 315. } 316. if (!EC_POINT_copy(group->generator, generator)) ^ 317. return 0; 318. crypto/ec/ec_lib.c:319:9: Taking false branch 317. return 0; 318. 319. if (order != NULL) { ^ 320. if (!BN_copy(group->order, order)) 321. return 0; crypto/ec/ec_lib.c:323:9: 321. return 0; 322. } else 323. > BN_zero(group->order); 324. 325. if (cofactor != NULL) { crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is false 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) crypto/ec/ec_lib.c:325:9: Taking false branch 323. BN_zero(group->order); 324. 325. if (cofactor != NULL) { ^ 326. if (!BN_copy(group->cofactor, cofactor)) 327. return 0; crypto/ec/ec_lib.c:329:9: 327. return 0; 328. } else 329. > BN_zero(group->cofactor); 330. 331. /* crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is false 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) crypto/ec/ec_lib.c:336:5: Skipping ec_precompute_mont_data(): empty list of specs 334. * |group->mont_data| will be NULL in this case. 335. */ 336. ec_precompute_mont_data(group); ^ 337. 338. return 1;
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/crypto/ec/ec_lib.c/#L336
d2a_code_trace_data_43993
int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k) { register u32 s0,s1,s2,s3; k[0] = s0 = GETU32(rawKey); k[1] = s1 = GETU32(rawKey+4); k[2] = s2 = GETU32(rawKey+8); k[3] = s3 = GETU32(rawKey+12); if (keyBitLength != 128) { k[8] = s0 = GETU32(rawKey+16); k[9] = s1 = GETU32(rawKey+20); if (keyBitLength == 192) { k[10] = s2 = ~s0; k[11] = s3 = ~s1; } else { k[10] = s2 = GETU32(rawKey+24); k[11] = s3 = GETU32(rawKey+28); } s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3]; } Camellia_Feistel(s0,s1,s2,s3,SIGMA+0); Camellia_Feistel(s2,s3,s0,s1,SIGMA+2); s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3]; Camellia_Feistel(s0,s1,s2,s3,SIGMA+4); Camellia_Feistel(s2,s3,s0,s1,SIGMA+6); if (keyBitLength == 128) { k[ 4] = s0, k[ 5] = s1, k[ 6] = s2, k[ 7] = s3; RotLeft128(s0,s1,s2,s3,15); k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3; RotLeft128(s0,s1,s2,s3,15); k[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3; RotLeft128(s0,s1,s2,s3,15); k[24] = s0, k[25] = s1; RotLeft128(s0,s1,s2,s3,15); k[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3; RotLeft128(s1,s2,s3,s0,2); k[40] = s1, k[41] = s2, k[42] = s3, k[43] = s0; RotLeft128(s1,s2,s3,s0,17); k[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0; s0 = k[ 0], s1 = k[ 1], s2 = k[ 2], s3 = k[ 3]; RotLeft128(s0,s1,s2,s3,15); k[ 8] = s0, k[ 9] = s1, k[10] = s2, k[11] = s3; RotLeft128(s0,s1,s2,s3,30); k[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3; RotLeft128(s0,s1,s2,s3,15); k[26] = s2, k[27] = s3; RotLeft128(s0,s1,s2,s3,17); k[32] = s0, k[33] = s1, k[34] = s2, k[35] = s3; RotLeft128(s0,s1,s2,s3,17); k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3; RotLeft128(s0,s1,s2,s3,17); k[44] = s0, k[45] = s1, k[46] = s2, k[47] = s3; return 3; } else { k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3; s0 ^= k[8], s1 ^= k[9], s2 ^=k[10], s3 ^=k[11]; Camellia_Feistel(s0,s1,s2,s3,(SIGMA+8)); Camellia_Feistel(s2,s3,s0,s1,(SIGMA+10)); k[ 4] = s0, k[ 5] = s1, k[ 6] = s2, k[ 7] = s3; RotLeft128(s0,s1,s2,s3,30); k[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3; RotLeft128(s0,s1,s2,s3,30); k[40] = s0, k[41] = s1, k[42] = s2, k[43] = s3; RotLeft128(s1,s2,s3,s0,19); k[64] = s1, k[65] = s2, k[66] = s3, k[67] = s0; s0 = k[ 8], s1 = k[ 9], s2 = k[10], s3 = k[11]; RotLeft128(s0,s1,s2,s3,15); k[ 8] = s0, k[ 9] = s1, k[10] = s2, k[11] = s3; RotLeft128(s0,s1,s2,s3,15); k[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3; RotLeft128(s0,s1,s2,s3,30); k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3; RotLeft128(s1,s2,s3,s0,2); k[52] = s1, k[53] = s2, k[54] = s3, k[55] = s0; s0 = k[12], s1 = k[13], s2 = k[14], s3 = k[15]; RotLeft128(s0,s1,s2,s3,15); k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3; RotLeft128(s0,s1,s2,s3,30); k[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3; k[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0; RotLeft128(s1,s2,s3,s0,17); k[56] = s1, k[57] = s2, k[58] = s3, k[59] = s0; s0 = k[ 0], s1 = k[ 1], s2 = k[ 2], s3 = k[ 3]; RotLeft128(s1,s2,s3,s0,13); k[24] = s1, k[25] = s2, k[26] = s3, k[27] = s0; RotLeft128(s1,s2,s3,s0,15); k[32] = s1, k[33] = s2, k[34] = s3, k[35] = s0; RotLeft128(s1,s2,s3,s0,17); k[44] = s1, k[45] = s2, k[46] = s3, k[47] = s0; RotLeft128(s2,s3,s0,s1,2); k[60] = s2, k[61] = s3, k[62] = s0, k[63] = s1; return 4; } } apps/speed.c:1229: error: BUFFER_OVERRUN_L1 Offset: 31 (⇐ 28 + 3) Size: 16 by call to `Camellia_set_key`. Showing all 9 steps of the trace apps/speed.c:425:2: Array declaration 423. CAST_KEY cast_ks; 424. #endif 425. static const unsigned char key16[16]= ^ 426. {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0, 427. 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; apps/speed.c:1229:2: Call 1227. #endif 1228. #ifndef OPENSSL_NO_CAMELLIA 1229. Camellia_set_key(key16,128,&camellia_ks1); ^ 1230. Camellia_set_key(ckey24,192,&camellia_ks2); 1231. Camellia_set_key(ckey32,256,&camellia_ks3); crypto/camellia/cmll_utl.c:57:1: Parameter `*userKey` 55. #include "cmll_locl.h" 56. 57. > int Camellia_set_key(const unsigned char *userKey, const int bits, 58. CAMELLIA_KEY *key) 59. { crypto/camellia/cmll_utl.c:63:9: Call 61. fips_cipher_abort(Camellia); 62. #endif 63. return private_Camellia_set_key(userKey, bits, key); ^ 64. } crypto/camellia/cmll_misc.c:59:1: Parameter `*userKey` 57. const char CAMELLIA_version[]="CAMELLIA" OPENSSL_VERSION_PTEXT; 58. 59. > int private_Camellia_set_key(const unsigned char *userKey, const int bits, 60. CAMELLIA_KEY *key) 61. { crypto/camellia/cmll_misc.c:66:22: Call 64. if(bits != 128 && bits != 192 && bits != 256) 65. return -2; 66. key->grand_rounds = Camellia_Ekeygen(bits , userKey, key->u.rd_key); ^ 67. return 0; 68. } crypto/camellia/camellia.c:362:1: <Length trace> 360. } while (0) 361. 362. > int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k) 363. { 364. register u32 s0,s1,s2,s3; crypto/camellia/camellia.c:362:1: Parameter `*rawKey` 360. } while (0) 361. 362. > int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k) 363. { 364. register u32 s0,s1,s2,s3; crypto/camellia/camellia.c:383:17: Array access: Offset: 31 (⇐ 28 + 3) Size: 16 by call to `Camellia_set_key` 381. { 382. k[10] = s2 = GETU32(rawKey+24); 383. k[11] = s3 = GETU32(rawKey+28); ^ 384. } 385. s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/camellia/camellia.c/#L383
d2a_code_trace_data_43994
static int early_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_early_get0_ext(s, TLSEXT_TYPE_server_name, &p, &remaining) || remaining <= 2) return 0; len = (*(p++) << 1); 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++) << 1); 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:198: error: NULL_DEREFERENCE pointer `ex_data` last assigned on line 147 could be null and is dereferenced at line 198, column 9. Showing all 28 steps of the trace test/handshake_helper.c:142:1: start of procedure early_select_server_ctx() 140. } 141. 142. > static int early_select_server_ctx(SSL *s, void *arg, int ignore) 143. { 144. const char *servername; test/handshake_helper.c:147:5: 145. const unsigned char *p; 146. size_t len, remaining; 147. > HANDSHAKE_EX_DATA *ex_data = 148. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 149. ssl/ssl_lib.c:3729:1: start of procedure SSL_get_ex_data() 3727. } 3728. 3729. > void *SSL_get_ex_data(const SSL *s, int idx) 3730. { 3731. return (CRYPTO_get_ex_data(&s->ex_data, idx)); ssl/ssl_lib.c:3731:5: 3729. void *SSL_get_ex_data(const SSL *s, int idx) 3730. { 3731. > return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3732. } 3733. crypto/ex_data.c:387:1: start of procedure CRYPTO_get_ex_data() 385. * particular index in the class used by this variable 386. */ 387. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:389:9: Taking true branch 387. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 390. return NULL; 391. return sk_void_value(ad->sk, idx); crypto/ex_data.c:390:9: 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 390. > return NULL; 391. return sk_void_value(ad->sk, idx); 392. } crypto/ex_data.c:392:1: return from a call to CRYPTO_get_ex_data 390. return NULL; 391. return sk_void_value(ad->sk, idx); 392. > } ssl/ssl_lib.c:3732:1: return from a call to SSL_get_ex_data 3730. { 3731. return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3732. > } 3733. 3734. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) test/handshake_helper.c:154:10: Taking false branch 152. * was written, so parsing the normal case is a bit complex. 153. */ 154. if (!SSL_early_get0_ext(s, TLSEXT_TYPE_server_name, &p, &remaining) || ^ 155. remaining <= 2) 156. return 0; test/handshake_helper.c:155:9: Taking false branch 153. */ 154. if (!SSL_early_get0_ext(s, TLSEXT_TYPE_server_name, &p, &remaining) || 155. remaining <= 2) ^ 156. return 0; 157. /* Extract the length of the supplied list of names. */ test/handshake_helper.c:158:5: 156. return 0; 157. /* Extract the length of the supplied list of names. */ 158. > len = (*(p++) << 1); 159. len += *(p++); 160. if (len + 2 != remaining) test/handshake_helper.c:159:5: 157. /* Extract the length of the supplied list of names. */ 158. len = (*(p++) << 1); 159. > len += *(p++); 160. if (len + 2 != remaining) 161. return 0; test/handshake_helper.c:160:9: Taking false branch 158. len = (*(p++) << 1); 159. len += *(p++); 160. if (len + 2 != remaining) ^ 161. return 0; 162. remaining = len; test/handshake_helper.c:162:5: 160. if (len + 2 != remaining) 161. return 0; 162. > remaining = len; 163. /* 164. * The list in practice only has a single element, so we only consider test/handshake_helper.c:167:9: Taking false branch 165. * the first one. 166. */ 167. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) ^ 168. return 0; 169. remaining--; test/handshake_helper.c:167:27: Taking false branch 165. * the first one. 166. */ 167. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) ^ 168. return 0; 169. remaining--; test/handshake_helper.c:169:5: 167. if (remaining == 0 || *p++ != TLSEXT_NAMETYPE_host_name) 168. return 0; 169. > remaining--; 170. /* Now we can finally pull out the byte array with the actual hostname. */ 171. if (remaining <= 2) test/handshake_helper.c:171:9: Taking false branch 169. remaining--; 170. /* Now we can finally pull out the byte array with the actual hostname. */ 171. if (remaining <= 2) ^ 172. return 0; 173. len = (*(p++) << 1); test/handshake_helper.c:173:5: 171. if (remaining <= 2) 172. return 0; 173. > len = (*(p++) << 1); 174. len += *(p++); 175. if (len + 2 > remaining) test/handshake_helper.c:174:5: 172. return 0; 173. len = (*(p++) << 1); 174. > len += *(p++); 175. if (len + 2 > remaining) 176. return 0; test/handshake_helper.c:175:9: Taking false branch 173. len = (*(p++) << 1); 174. len += *(p++); 175. if (len + 2 > remaining) ^ 176. return 0; 177. remaining = len; test/handshake_helper.c:177:5: 175. if (len + 2 > remaining) 176. return 0; 177. > remaining = len; 178. servername = (const char *)p; 179. test/handshake_helper.c:178:5: 176. return 0; 177. remaining = len; 178. > servername = (const char *)p; 179. 180. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { test/handshake_helper.c:180:9: Taking false branch 178. servername = (const char *)p; 179. 180. if (len == strlen("server2") && strncmp(servername, "server2", len) == 0) { ^ 181. SSL_CTX *new_ctx = arg; 182. SSL_set_SSL_CTX(s, new_ctx); test/handshake_helper.c:193:16: Taking false branch 191. ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; 192. return 1; 193. } else if (len == strlen("server1") && ^ 194. strncmp(servername, "server1", len) == 0) { 195. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; test/handshake_helper.c:197:16: Taking true branch 195. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 196. return 1; 197. } else if (ignore) { ^ 198. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 199. return 1; test/handshake_helper.c:198:9: 196. return 1; 197. } else if (ignore) { 198. > ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 199. return 1; 200. }
https://github.com/openssl/openssl/blob/0f5df0f1037590de12cc11eeab26fe29bf3f16a3/test/handshake_helper.c/#L198
d2a_code_trace_data_43995
int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) { int al, i, j, ret; unsigned int n; SSL3_RECORD *rr; void (*cb) (const SSL *ssl, int type2, int val) = NULL; if (!SSL3_BUFFER_is_initialised(&s->rlayer.rbuf)) { if (!ssl3_setup_buffers(s)) return (-1); } if ((type && (type != SSL3_RT_APPLICATION_DATA) && (type != SSL3_RT_HANDSHAKE)) || (peek && (type != SSL3_RT_APPLICATION_DATA))) { SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR); return -1; } if ((ret = have_handshake_fragment(s, type, buf, len, peek))) return ret; #ifndef OPENSSL_NO_SCTP if ((!s->in_handshake && SSL_in_init(s)) || (BIO_dgram_is_sctp(SSL_get_rbio(s)) && (s->state == DTLS1_SCTP_ST_SR_READ_SOCK || s->state == DTLS1_SCTP_ST_CR_READ_SOCK) && s->s3->in_read_app_data != 2)) #else if (!s->in_handshake && SSL_in_init(s)) #endif { i = s->handshake_func(s); if (i < 0) return (i); if (i == 0) { SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_SSL_HANDSHAKE_FAILURE); return (-1); } } start: s->rwstate = SSL_NOTHING; rr = &s->rlayer.rrec; if (s->state == SSL_ST_OK && SSL3_RECORD_get_length(rr) == 0) { pitem *item; item = pqueue_pop(s->rlayer.d->buffered_app_data.q); if (item) { #ifndef OPENSSL_NO_SCTP if (BIO_dgram_is_sctp(SSL_get_rbio(s))) { DTLS1_RECORD_DATA *rdata = (DTLS1_RECORD_DATA *)item->data; BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SCTP_SET_RCVINFO, sizeof(rdata->recordinfo), &rdata->recordinfo); } #endif dtls1_copy_record(s, item); OPENSSL_free(item->data); pitem_free(item); } } if (dtls1_handle_timeout(s) > 0) goto start; if ((SSL3_RECORD_get_length(rr) == 0) || (s->rlayer.rstate == SSL_ST_READ_BODY)) { ret = dtls1_get_record(s); if (ret <= 0) { ret = dtls1_read_failed(s, ret); if (ret <= 0) return (ret); else goto start; } } if (s->d1->listen && rr->type != SSL3_RT_HANDSHAKE) { SSL3_RECORD_set_length(rr, 0); goto start; } if (s->s3->change_cipher_spec && (SSL3_RECORD_get_type(rr) != SSL3_RT_HANDSHAKE)) { if (dtls1_buffer_record(s, &(s->rlayer.d->buffered_app_data), SSL3_RECORD_get_seq_num(rr)) < 0) { SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR); return -1; } SSL3_RECORD_set_length(rr, 0); goto start; } if (s->shutdown & SSL_RECEIVED_SHUTDOWN) { SSL3_RECORD_set_length(rr, 0); s->rwstate = SSL_NOTHING; return (0); } if (type == SSL3_RECORD_get_type(rr)) { if (SSL_in_init(s) && (type == SSL3_RT_APPLICATION_DATA) && (s->enc_read_ctx == NULL)) { al = SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_APP_DATA_IN_HANDSHAKE); goto f_err; } if (len <= 0) return (len); if ((unsigned int)len > SSL3_RECORD_get_length(rr)) n = SSL3_RECORD_get_length(rr); else n = (unsigned int)len; memcpy(buf, &(SSL3_RECORD_get_data(rr)[SSL3_RECORD_get_off(rr)]), n); if (!peek) { SSL3_RECORD_add_length(rr, -n); SSL3_RECORD_add_off(rr, n); if (SSL3_RECORD_get_length(rr) == 0) { s->rlayer.rstate = SSL_ST_READ_HEADER; SSL3_RECORD_set_off(rr, 0); } } #ifndef OPENSSL_NO_SCTP if (BIO_dgram_is_sctp(SSL_get_rbio(s)) && SSL3_RECORD_get_type(rr) == SSL3_RT_APPLICATION_DATA && (s->state == DTLS1_SCTP_ST_SR_READ_SOCK || s->state == DTLS1_SCTP_ST_CR_READ_SOCK)) { s->rwstate = SSL_READING; BIO_clear_retry_flags(SSL_get_rbio(s)); BIO_set_retry_read(SSL_get_rbio(s)); } if (BIO_dgram_is_sctp(SSL_get_rbio(s)) && s->d1->shutdown_received && !BIO_dgram_sctp_msg_waiting(SSL_get_rbio(s))) { s->shutdown |= SSL_RECEIVED_SHUTDOWN; return (0); } #endif return (n); } { unsigned int k, dest_maxlen = 0; unsigned char *dest = NULL; unsigned int *dest_len = NULL; if (SSL3_RECORD_get_type(rr) == SSL3_RT_HANDSHAKE) { dest_maxlen = sizeof s->rlayer.d->handshake_fragment; dest = s->rlayer.d->handshake_fragment; dest_len = &s->rlayer.d->handshake_fragment_len; } else if (SSL3_RECORD_get_type(rr) == SSL3_RT_ALERT) { dest_maxlen = sizeof(s->rlayer.d->alert_fragment); dest = s->rlayer.d->alert_fragment; dest_len = &s->rlayer.d->alert_fragment_len; } #ifndef OPENSSL_NO_HEARTBEATS else if (SSL3_RECORD_get_type(rr) == TLS1_RT_HEARTBEAT) { if(dtls1_process_heartbeat(s, SSL3_RECORD_get_data(rr), SSL3_RECORD_get_length(rr)) < 0) { return -1; } SSL3_RECORD_set_length(rr, 0); s->rwstate = SSL_READING; BIO_clear_retry_flags(SSL_get_rbio(s)); BIO_set_retry_read(SSL_get_rbio(s)); return (-1); } #endif else if (SSL3_RECORD_get_type(rr) != SSL3_RT_CHANGE_CIPHER_SPEC) { if (SSL3_RECORD_get_type(rr) == SSL3_RT_APPLICATION_DATA) { BIO *bio; s->s3->in_read_app_data = 2; bio = SSL_get_rbio(s); s->rwstate = SSL_READING; BIO_clear_retry_flags(bio); BIO_set_retry_read(bio); return (-1); } al = SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_UNEXPECTED_RECORD); goto f_err; } if (dest_maxlen > 0) { if (SSL3_RECORD_get_length(rr) < dest_maxlen) { #ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE FIX ME #endif s->rlayer.rstate = SSL_ST_READ_HEADER; SSL3_RECORD_set_length(rr, 0); goto start; } for (k = 0; k < dest_maxlen; k++) { dest[k] = SSL3_RECORD_get_data(rr)[SSL3_RECORD_get_off(rr)]; SSL3_RECORD_add_off(rr, 1); SSL3_RECORD_add_length(rr, -1); } *dest_len = dest_maxlen; } } if ((!s->server) && (s->rlayer.d->handshake_fragment_len >= DTLS1_HM_HEADER_LENGTH) && (s->rlayer.d->handshake_fragment[0] == SSL3_MT_HELLO_REQUEST) && (s->session != NULL) && (s->session->cipher != NULL)) { s->rlayer.d->handshake_fragment_len = 0; if ((s->rlayer.d->handshake_fragment[1] != 0) || (s->rlayer.d->handshake_fragment[2] != 0) || (s->rlayer.d->handshake_fragment[3] != 0)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_BAD_HELLO_REQUEST); goto err; } if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->rlayer.d->handshake_fragment, 4, s, s->msg_callback_arg); if (SSL_is_init_finished(s) && !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && !s->s3->renegotiate) { s->d1->handshake_read_seq++; s->new_session = 1; ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) { i = s->handshake_func(s); if (i < 0) return (i); if (i == 0) { SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_SSL_HANDSHAKE_FAILURE); return (-1); } if (!(s->mode & SSL_MODE_AUTO_RETRY)) { if (SSL3_BUFFER_get_left(&s->rlayer.rbuf) == 0) { BIO *bio; s->rwstate = SSL_READING; bio = SSL_get_rbio(s); BIO_clear_retry_flags(bio); BIO_set_retry_read(bio); return (-1); } } } } goto start; } if (s->rlayer.d->alert_fragment_len >= DTLS1_AL_HEADER_LENGTH) { int alert_level = s->rlayer.d->alert_fragment[0]; int alert_descr = s->rlayer.d->alert_fragment[1]; s->rlayer.d->alert_fragment_len = 0; if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_ALERT, s->rlayer.d->alert_fragment, 2, s, s->msg_callback_arg); if (s->info_callback != NULL) cb = s->info_callback; else if (s->ctx->info_callback != NULL) cb = s->ctx->info_callback; if (cb != NULL) { j = (alert_level << 8) | alert_descr; cb(s, SSL_CB_READ_ALERT, j); } if (alert_level == SSL3_AL_WARNING) { s->s3->warn_alert = alert_descr; if (alert_descr == SSL_AD_CLOSE_NOTIFY) { #ifndef OPENSSL_NO_SCTP if (BIO_dgram_is_sctp(SSL_get_rbio(s)) && BIO_dgram_sctp_msg_waiting(SSL_get_rbio(s))) { s->d1->shutdown_received = 1; s->rwstate = SSL_READING; BIO_clear_retry_flags(SSL_get_rbio(s)); BIO_set_retry_read(SSL_get_rbio(s)); return -1; } #endif s->shutdown |= SSL_RECEIVED_SHUTDOWN; return (0); } #if 0 if (alert_descr == DTLS1_AD_MISSING_HANDSHAKE_MESSAGE) { unsigned short seq; unsigned int frag_off; unsigned char *p = &(s->rlayer.d->alert_fragment[2]); n2s(p, seq); n2l3(p, frag_off); dtls1_retransmit_message(s, dtls1_get_queue_priority (frag->msg_header.seq, 0), frag_off, &found); if (!found && SSL_in_init(s)) { ssl3_send_alert(s, SSL3_AL_WARNING, DTLS1_AD_MISSING_HANDSHAKE_MESSAGE); } } #endif } else if (alert_level == SSL3_AL_FATAL) { char tmp[16]; s->rwstate = SSL_NOTHING; s->s3->fatal_alert = alert_descr; SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_AD_REASON_OFFSET + alert_descr); BIO_snprintf(tmp, sizeof tmp, "%d", alert_descr); ERR_add_error_data(2, "SSL alert number ", tmp); s->shutdown |= SSL_RECEIVED_SHUTDOWN; SSL_CTX_remove_session(s->ctx, s->session); return (0); } else { al = SSL_AD_ILLEGAL_PARAMETER; SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_UNKNOWN_ALERT_TYPE); goto f_err; } goto start; } if (s->shutdown & SSL_SENT_SHUTDOWN) { s->rwstate = SSL_NOTHING; SSL3_RECORD_set_length(rr, 0); return (0); } if (SSL3_RECORD_get_type(rr) == SSL3_RT_CHANGE_CIPHER_SPEC) { struct ccs_header_st ccs_hdr; unsigned int ccs_hdr_len = DTLS1_CCS_HEADER_LENGTH; dtls1_get_ccs_header(SSL3_RECORD_get_data(rr), &ccs_hdr); if (s->version == DTLS1_BAD_VER) ccs_hdr_len = 3; if ((SSL3_RECORD_get_length(rr) != ccs_hdr_len) || (SSL3_RECORD_get_off(rr) != 0) || (SSL3_RECORD_get_data(rr)[0] != SSL3_MT_CCS)) { i = SSL_AD_ILLEGAL_PARAMETER; SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_BAD_CHANGE_CIPHER_SPEC); goto err; } SSL3_RECORD_set_length(rr, 0); if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC, SSL3_RECORD_get_data(rr), 1, s, s->msg_callback_arg); if (!s->d1->change_cipher_spec_ok) { goto start; } s->d1->change_cipher_spec_ok = 0; s->s3->change_cipher_spec = 1; if (!ssl3_do_change_cipher_spec(s)) goto err; dtls1_reset_seq_numbers(s, SSL3_CC_READ); if (s->version == DTLS1_BAD_VER) s->d1->handshake_read_seq++; #ifndef OPENSSL_NO_SCTP BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD, 1, NULL); #endif goto start; } if ((s->rlayer.d->handshake_fragment_len >= DTLS1_HM_HEADER_LENGTH) && !s->in_handshake) { struct hm_header_st msg_hdr; dtls1_get_message_header(rr->data, &msg_hdr); if (SSL3_RECORD_get_epoch(rr) != s->rlayer.d->r_epoch) { SSL3_RECORD_set_length(rr, 0); goto start; } if (msg_hdr.type == SSL3_MT_FINISHED) { if (dtls1_check_timeout_num(s) < 0) return -1; dtls1_retransmit_buffered_messages(s); SSL3_RECORD_set_length(rr, 0); goto start; } if (((s->state & SSL_ST_MASK) == SSL_ST_OK) && !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) { s->state = s->server ? SSL_ST_ACCEPT : SSL_ST_CONNECT; s->renegotiate = 1; s->new_session = 1; } i = s->handshake_func(s); if (i < 0) return (i); if (i == 0) { SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_SSL_HANDSHAKE_FAILURE); return (-1); } if (!(s->mode & SSL_MODE_AUTO_RETRY)) { if (SSL3_BUFFER_get_left(&s->rlayer.rbuf) == 0) { BIO *bio; s->rwstate = SSL_READING; bio = SSL_get_rbio(s); BIO_clear_retry_flags(bio); BIO_set_retry_read(bio); return (-1); } } goto start; } switch (SSL3_RECORD_get_type(rr)) { default: if (s->version == TLS1_VERSION) { SSL3_RECORD_set_length(rr, 0); goto start; } al = SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_UNEXPECTED_RECORD); goto f_err; case SSL3_RT_CHANGE_CIPHER_SPEC: case SSL3_RT_ALERT: case SSL3_RT_HANDSHAKE: al = SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR); goto f_err; case SSL3_RT_APPLICATION_DATA: if (s->s3->in_read_app_data && (s->s3->total_renegotiations != 0) && (((s->state & SSL_ST_CONNECT) && (s->state >= SSL3_ST_CW_CLNT_HELLO_A) && (s->state <= SSL3_ST_CR_SRVR_HELLO_A) ) || ((s->state & SSL_ST_ACCEPT) && (s->state <= SSL3_ST_SW_HELLO_REQ_A) && (s->state >= SSL3_ST_SR_CLNT_HELLO_A) ) )) { s->s3->in_read_app_data = 2; return (-1); } else { al = SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_UNEXPECTED_RECORD); goto f_err; } } f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); err: return (-1); } ssl/record/rec_layer_d1.c:698: error: INTEGER_OVERFLOW_L1 ([1, +oo] + 4294967295):unsigned32. Showing all 3 steps of the trace ssl/record/rec_layer_d1.c:413:1: <LHS trace> 411. * none of our business 412. */ 413. > int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) 414. { 415. int al, i, j, ret; ssl/record/rec_layer_d1.c:413:1: Parameter `s->rlayer.rrec.length` 411. * none of our business 412. */ 413. > int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) 414. { 415. int al, i, j, ret; ssl/record/rec_layer_d1.c:698:17: Binary operation: ([1, +oo] + 4294967295):unsigned32 696. dest[k] = SSL3_RECORD_get_data(rr)[SSL3_RECORD_get_off(rr)]; 697. SSL3_RECORD_add_off(rr, 1); 698. SSL3_RECORD_add_length(rr, -1); ^ 699. } 700. *dest_len = dest_maxlen;
https://github.com/openssl/openssl/blob/747e16398d704a667cc99f8a0b1912c36b7de52d/ssl/record/rec_layer_d1.c/#L698
d2a_code_trace_data_43996
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/dsa/dsa_ossl.c:129: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 21 steps of the trace crypto/dsa/dsa_ossl.c:87:9: Call 85. if (ctx == NULL) 86. goto err; 87. m = BN_CTX_get(ctx); ^ 88. blind = BN_CTX_get(ctx); 89. blindm = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/dsa/dsa_ossl.c:129:10: Call 127. 128. /* tmp := blind * priv_key * r mod q */ 129. if (!BN_mod_mul(tmp, blind, dsa->priv_key, dsa->q, ctx)) ^ 130. goto err; 131. if (!BN_mod_mul(tmp, tmp, ret->r, dsa->q, ctx)) crypto/bn/bn_mod.c:193:1: Parameter `ctx->stack.depth` 191. 192. /* slow but works */ 193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 194. BN_CTX *ctx) 195. { crypto/bn/bn_mod.c:203:5: Call 201. bn_check_top(m); 202. 203. BN_CTX_start(ctx); ^ 204. if ((t = BN_CTX_get(ctx)) == NULL) 205. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mod.c:204:14: Call 202. 203. BN_CTX_start(ctx); 204. if ((t = BN_CTX_get(ctx)) == NULL) ^ 205. goto err; 206. if (a == b) { crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mod.c:207:14: Call 205. goto err; 206. if (a == b) { 207. if (!BN_sqr(t, a, ctx)) ^ 208. goto err; 209. } else { crypto/bn/bn_sqr.c:17:1: Parameter `ctx->stack.depth` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int ret = bn_sqr_fixed_top(r, a, ctx); crypto/bn/bn_sqr.c:19:15: Call 17. int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int ret = bn_sqr_fixed_top(r, a, ctx); ^ 20. 21. bn_correct_top(r); crypto/bn/bn_sqr.c:42:5: Call 40. } 41. 42. BN_CTX_start(ctx); ^ 43. rr = (a != r) ? r : BN_CTX_get(ctx); 44. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_sqr.c:104:5: Call 102. bn_check_top(rr); 103. bn_check_top(tmp); 104. BN_CTX_end(ctx); ^ 105. return ret; 106. } crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 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_43997
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } apps/rsa.c:221: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `RSA_check_key_ex`. Showing all 53 steps of the trace apps/rsa.c:216:9: Call 214. RSA_get0_key(rsa, &n, NULL, NULL); 215. BIO_printf(out, "Modulus="); 216. BN_print(out, n); ^ 217. BIO_printf(out, "\n"); 218. } crypto/bn/bn_print.c:304:1: Parameter `a->top` 302. # endif 303. 304. > int BN_print(BIO *bp, const BIGNUM *a) 305. { 306. int i, j, v, z = 0; apps/rsa.c:221:17: Call 219. 220. if (check) { 221. int r = RSA_check_key_ex(rsa, NULL); ^ 222. 223. if (r == 1) { crypto/rsa/rsa_chk.c:19:1: Parameter `key->p->top` 17. } 18. 19. > int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) 20. { 21. BIGNUM *i, *j, *k, *l, *m; crypto/rsa/rsa_chk.c:65:9: Call 63. 64. /* p prime? */ 65. if (BN_is_prime_ex(key->p, BN_prime_checks, NULL, cb) != 1) { ^ 66. ret = 0; 67. RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_P_NOT_PRIME); crypto/bn/bn_prime.c:145:1: Parameter `a->top` 143. } 144. 145. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 146. BN_GENCB *cb) 147. { crypto/bn/bn_prime.c:148:12: Call 146. BN_GENCB *cb) 147. { 148. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); ^ 149. } 150. crypto/bn/bn_prime.c:151:1: Parameter `a->top` 149. } 150. 151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 152. int do_trial_division, BN_GENCB *cb) 153. { crypto/bn/bn_prime.c:161:9: Call 159. 160. /* Take care of the really small primes 2 & 3 */ 161. if (BN_is_word(a, 2) || BN_is_word(a, 3)) ^ 162. return 1; 163. crypto/bn/bn_lib.c:855:1: Parameter `a->top` 853. } 854. 855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); crypto/bn/bn_lib.c:857:12: Call 855. int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); ^ 858. } 859. crypto/bn/bn_lib.c:840:1: Parameter `a->top` 838. } 839. 840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 841. { 842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_prime.c:161:29: Call 159. 160. /* Take care of the really small primes 2 & 3 */ 161. if (BN_is_word(a, 2) || BN_is_word(a, 3)) ^ 162. return 1; 163. crypto/bn/bn_lib.c:855:1: Parameter `a->top` 853. } 854. 855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); crypto/bn/bn_lib.c:857:12: Call 855. int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); ^ 858. } 859. crypto/bn/bn_lib.c:840:1: Parameter `a->top` 838. } 839. 840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 841. { 842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_prime.c:165:10: Call 163. 164. /* Check odd and bigger than 1 */ 165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0) ^ 166. return 0; 167. crypto/bn/bn_lib.c:860:1: Parameter `a->top` 858. } 859. 860. > int BN_is_odd(const BIGNUM *a) 861. { 862. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_prime.c:165:26: Call 163. 164. /* Check odd and bigger than 1 */ 165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0) ^ 166. return 0; 167. crypto/bn/bn_lib.c:542:1: Parameter `a->top` 540. } 541. 542. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 543. { 544. int i; crypto/bn/bn_prime.c:198:10: Call 196. 197. /* compute A1 := a - 1 */ 198. if (!BN_copy(A1, a) || !BN_sub_word(A1, 1)) ^ 199. goto err; 200. /* compute A3 := a - 3 */ crypto/bn/bn_lib.c:285:1: Parameter `b->top` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_prime.c:201:10: Call 199. goto err; 200. /* compute A3 := a - 3 */ 201. if (!BN_copy(A3, a) || !BN_sub_word(A3, 3)) ^ 202. goto err; 203. crypto/bn/bn_lib.c:285:1: Parameter `b->top` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_prime.c:215:10: Call 213. if (mont == NULL) 214. goto err; 215. if (!BN_MONT_CTX_set(mont, a, ctx)) ^ 216. goto err; 217. crypto/bn/bn_mont.c:238:9: Call 236. BIGNUM *Ri, *R; 237. 238. if (BN_is_zero(mod)) ^ 239. return 0; 240. crypto/bn/bn_lib.c:845:1: Parameter `a->top` 843. } 844. 845. > int BN_is_zero(const BIGNUM *a) 846. { 847. return a->top == 0; crypto/bn/bn_prime.c:223:13: Call 221. goto err; 222. 223. j = witness(check, a, A1, A1_odd, k, ctx, mont); ^ 224. if (j == -1) 225. goto err; crypto/bn/bn_prime.c:245:1: Parameter `a->top` 243. } 244. 245. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1, 246. const BIGNUM *a1_odd, int k, BN_CTX *ctx, 247. BN_MONT_CTX *mont) crypto/bn/bn_prime.c:249:10: Call 247. BN_MONT_CTX *mont) 248. { 249. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ ^ 250. return -1; 251. if (BN_is_one(w)) crypto/bn/bn_exp.c:296:1: Parameter `m->top` 294. } 295. 296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 298. { crypto/bn/bn_exp.c:310:16: Call 308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) { 310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 311. } 312. crypto/bn/bn_exp.c:745:14: Assignment 743. /* 2^(top*BN_BITS2) - m */ 744. tmp.d[0] = (0 - m->d[0]) & BN_MASK2; 745. for (i = 1; i < top; i++) ^ 746. tmp.d[i] = (~m->d[i]) & BN_MASK2; 747. tmp.top = top; crypto/bn/bn_exp.c:1062:14: Call 1060. bits -= window0; 1061. wvalue = bn_get_bits(p, bits) & wmask; 1062. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue, ^ 1063. window)) 1064. goto err; crypto/bn/bn_exp.c:520:1: Parameter `top` 518. } 519. 520. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, 521. unsigned char *buf, int idx, 522. int window) crypto/bn/bn_exp.c:577:5: Assignment 575. } 576. 577. b->top = top; ^ 578. bn_correct_top(b); 579. return 1; crypto/bn/bn_exp.c:578:5: Call 576. 577. b->top = top; 578. bn_correct_top(b); ^ 579. return 1; 580. } crypto/bn/bn_lib.c:946:1: Parameter `a->top` 944. } 945. 946. > void bn_correct_top(BIGNUM *a) 947. { 948. BN_ULONG *ftl; crypto/bn/bn_exp.c:1075:22: Call 1073. /* Square the result window-size times */ 1074. for (i = 0; i < window; i++) 1075. if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) ^ 1076. goto err; 1077. crypto/bn/bn_mont.c:26:1: Parameter `a->top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:53:14: Call 51. bn_check_top(tmp); 52. if (a == b) { 53. if (!BN_sqr(tmp, a, ctx)) ^ 54. goto err; 55. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:105:1: <Offset trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `n` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:116:5: Assignment 114. rp[0] = rp[max - 1] = 0; 115. rp++; 116. j = n; ^ 117. 118. if (--j > 0) { crypto/bn/bn_sqr.c:118:9: Assignment 116. j = n; 117. 118. if (--j > 0) { ^ 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:105:1: <Length trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `*r` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:113:5: Assignment 111. max = n * 2; 112. ap = a; 113. rp = r; ^ 114. rp[0] = rp[max - 1] = 0; 115. rp++; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp = r; 114. rp[0] = rp[max - 1] = 0; 115. rp++; ^ 116. j = n; 117. crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `RSA_check_key_ex` 118. if (--j > 0) { 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 121. rp += 2; 122. }
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_sqr.c/#L120
d2a_code_trace_data_43998
static int inter_recon(AVCodecContext *avctx) { static const uint8_t bwlog_tab[2][N_BS_SIZES] = { { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 }, }; VP9Context *s = avctx->priv_data; VP9Block *const b = &s->b; int row = b->row, col = b->col; AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; int w = avctx->width, h = avctx->height; ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; if (!ref1->data[0] || (b->comp && !ref2->data[0])) return AVERROR_INVALIDDATA; if (b->bs > BS_8x8) { if (b->bs == BS_8x4) { mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y, ref1->data[0], ref1->linesize[0], row << 3, col << 3, &b->mv[0][0], 8, 4, w, h); mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0] + 4 * ls_y, ls_y, ref1->data[0], ref1->linesize[0], (row << 3) + 4, col << 3, &b->mv[2][0], 8, 4, w, h); if (b->comp) { mc_luma_dir(s, s->dsp.mc[3][b->filter][1], b->dst[0], ls_y, ref2->data[0], ref2->linesize[0], row << 3, col << 3, &b->mv[0][1], 8, 4, w, h); mc_luma_dir(s, s->dsp.mc[3][b->filter][1], b->dst[0] + 4 * ls_y, ls_y, ref2->data[0], ref2->linesize[0], (row << 3) + 4, col << 3, &b->mv[2][1], 8, 4, w, h); } } else if (b->bs == BS_4x8) { mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y, ref1->data[0], ref1->linesize[0], row << 3, col << 3, &b->mv[0][0], 4, 8, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4, ls_y, ref1->data[0], ref1->linesize[0], row << 3, (col << 3) + 4, &b->mv[1][0], 4, 8, w, h); if (b->comp) { mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y, ref2->data[0], ref2->linesize[0], row << 3, col << 3, &b->mv[0][1], 4, 8, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4, ls_y, ref2->data[0], ref2->linesize[0], row << 3, (col << 3) + 4, &b->mv[1][1], 4, 8, w, h); } } else { av_assert2(b->bs == BS_4x4); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0], ls_y, ref1->data[0], ref1->linesize[0], row << 3, col << 3, &b->mv[0][0], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4, ls_y, ref1->data[0], ref1->linesize[0], row << 3, (col << 3) + 4, &b->mv[1][0], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4 * ls_y, ls_y, ref1->data[0], ref1->linesize[0], (row << 3) + 4, col << 3, &b->mv[2][0], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][0], b->dst[0] + 4 * ls_y + 4, ls_y, ref1->data[0], ref1->linesize[0], (row << 3) + 4, (col << 3) + 4, &b->mv[3][0], 4, 4, w, h); if (b->comp) { mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0], ls_y, ref2->data[0], ref2->linesize[0], row << 3, col << 3, &b->mv[0][1], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4, ls_y, ref2->data[0], ref2->linesize[0], row << 3, (col << 3) + 4, &b->mv[1][1], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4 * ls_y, ls_y, ref2->data[0], ref2->linesize[0], (row << 3) + 4, col << 3, &b->mv[2][1], 4, 4, w, h); mc_luma_dir(s, s->dsp.mc[4][b->filter][1], b->dst[0] + 4 * ls_y + 4, ls_y, ref2->data[0], ref2->linesize[0], (row << 3) + 4, (col << 3) + 4, &b->mv[3][1], 4, 4, w, h); } } } else { int bwl = bwlog_tab[0][b->bs]; int bw = bwh_tab[0][b->bs][0] * 4; int bh = bwh_tab[0][b->bs][1] * 4; mc_luma_dir(s, s->dsp.mc[bwl][b->filter][0], b->dst[0], ls_y, ref1->data[0], ref1->linesize[0], row << 3, col << 3, &b->mv[0][0], bw, bh, w, h); if (b->comp) mc_luma_dir(s, s->dsp.mc[bwl][b->filter][1], b->dst[0], ls_y, ref2->data[0], ref2->linesize[0], row << 3, col << 3, &b->mv[0][1], bw, bh, w, h); } { int bwl = bwlog_tab[1][b->bs]; int bw = bwh_tab[1][b->bs][0] * 4, bh = bwh_tab[1][b->bs][1] * 4; VP56mv mvuv; w = (w + 1) >> 1; h = (h + 1) >> 1; if (b->bs > BS_8x8) { mvuv.x = ROUNDED_DIV(b->mv[0][0].x + b->mv[1][0].x + b->mv[2][0].x + b->mv[3][0].x, 4); mvuv.y = ROUNDED_DIV(b->mv[0][0].y + b->mv[1][0].y + b->mv[2][0].y + b->mv[3][0].y, 4); } else { mvuv = b->mv[0][0]; } mc_chroma_dir(s, s->dsp.mc[bwl][b->filter][0], b->dst[1], b->dst[2], ls_uv, ref1->data[1], ref1->linesize[1], ref1->data[2], ref1->linesize[2], row << 2, col << 2, &mvuv, bw, bh, w, h); if (b->comp) { if (b->bs > BS_8x8) { mvuv.x = ROUNDED_DIV(b->mv[0][1].x + b->mv[1][1].x + b->mv[2][1].x + b->mv[3][1].x, 4); mvuv.y = ROUNDED_DIV(b->mv[0][1].y + b->mv[1][1].y + b->mv[2][1].y + b->mv[3][1].y, 4); } else { mvuv = b->mv[0][1]; } mc_chroma_dir(s, s->dsp.mc[bwl][b->filter][1], b->dst[1], b->dst[2], ls_uv, ref2->data[1], ref2->linesize[1], ref2->data[2], ref2->linesize[2], row << 2, col << 2, &mvuv, bw, bh, w, h); } } if (!b->skip) { int w4 = bwh_tab[1][b->bs][0] << 1, step1d = 1 << b->tx, n; int h4 = bwh_tab[1][b->bs][1] << 1, x, y, step = 1 << (b->tx * 2); int end_x = FFMIN(2 * (s->cols - col), w4); int end_y = FFMIN(2 * (s->rows - row), h4); int tx = 4 * s->lossless + b->tx, uvtx = b->uvtx + 4 * s->lossless; int uvstep1d = 1 << b->uvtx, p; uint8_t *dst = b->dst[0]; for (n = 0, y = 0; y < end_y; y += step1d) { uint8_t *ptr = dst; for (x = 0; x < end_x; x += step1d, ptr += 4 * step1d, n += step) { int eob = b->tx > TX_8X8 ? AV_RN16A(&s->eob[n]) : s->eob[n]; if (eob) s->dsp.itxfm_add[tx][DCT_DCT](ptr, b->y_stride, s->block + 16 * n, eob); } dst += 4 * b->y_stride * step1d; } h4 >>= 1; w4 >>= 1; end_x >>= 1; end_y >>= 1; step = 1 << (b->uvtx * 2); for (p = 0; p < 2; p++) { dst = b->dst[p + 1]; for (n = 0, y = 0; y < end_y; y += uvstep1d) { uint8_t *ptr = dst; for (x = 0; x < end_x; x += uvstep1d, ptr += 4 * uvstep1d, n += step) { int eob = b->uvtx > TX_8X8 ? AV_RN16A(&s->uveob[p][n]) : s->uveob[p][n]; if (eob) s->dsp.itxfm_add[uvtx][DCT_DCT](ptr, b->uv_stride, s->uvblock[p] + 16 * n, eob); } dst += 4 * uvstep1d * b->uv_stride; } } } return 0; } libavcodec/vp9block.c:1248: error: Null Dereference pointer `ref2` last assigned on line 1228 could be null and is dereferenced at line 1248, column 29. libavcodec/vp9block.c:1218:1: start of procedure inter_recon() 1216. } 1217. 1218. static int inter_recon(AVCodecContext *avctx) ^ 1219. { 1220. static const uint8_t bwlog_tab[2][N_BS_SIZES] = { libavcodec/vp9block.c:1220:5: 1218. static int inter_recon(AVCodecContext *avctx) 1219. { 1220. static const uint8_t bwlog_tab[2][N_BS_SIZES] = { ^ 1221. { 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 }, 1222. { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 }, libavcodec/vp9block.c:1224:5: 1222. { 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4 }, 1223. }; 1224. VP9Context *s = avctx->priv_data; ^ 1225. VP9Block *const b = &s->b; 1226. int row = b->row, col = b->col; libavcodec/vp9block.c:1225:5: 1223. }; 1224. VP9Context *s = avctx->priv_data; 1225. VP9Block *const b = &s->b; ^ 1226. int row = b->row, col = b->col; 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; libavcodec/vp9block.c:1226:5: 1224. VP9Context *s = avctx->priv_data; 1225. VP9Block *const b = &s->b; 1226. int row = b->row, col = b->col; ^ 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; libavcodec/vp9block.c:1227:5: 1225. VP9Block *const b = &s->b; 1226. int row = b->row, col = b->col; 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; ^ 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; 1229. int w = avctx->width, h = avctx->height; libavcodec/vp9block.c:1228:21: Condition is false 1226. int row = b->row, col = b->col; 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; ^ 1229. int w = avctx->width, h = avctx->height; 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; libavcodec/vp9block.c:1228:5: 1226. int row = b->row, col = b->col; 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; ^ 1229. int w = avctx->width, h = avctx->height; 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; libavcodec/vp9block.c:1229:5: 1227. AVFrame *ref1 = s->refs[s->refidx[b->ref[0]]]; 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; 1229. int w = avctx->width, h = avctx->height; ^ 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; 1231. libavcodec/vp9block.c:1230:5: 1228. AVFrame *ref2 = b->comp ? s->refs[s->refidx[b->ref[1]]] : NULL; 1229. int w = avctx->width, h = avctx->height; 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; ^ 1231. 1232. if (!ref1->data[0] || (b->comp && !ref2->data[0])) libavcodec/vp9block.c:1232:10: Taking false branch 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; 1231. 1232. if (!ref1->data[0] || (b->comp && !ref2->data[0])) ^ 1233. return AVERROR_INVALIDDATA; 1234. libavcodec/vp9block.c:1232:28: Taking false branch 1230. ptrdiff_t ls_y = b->y_stride, ls_uv = b->uv_stride; 1231. 1232. if (!ref1->data[0] || (b->comp && !ref2->data[0])) ^ 1233. return AVERROR_INVALIDDATA; 1234. libavcodec/vp9block.c:1236:9: Taking true branch 1234. 1235. // y inter pred 1236. if (b->bs > BS_8x8) { ^ 1237. if (b->bs == BS_8x4) { 1238. mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y, libavcodec/vp9block.c:1237:13: Taking true branch 1235. // y inter pred 1236. if (b->bs > BS_8x8) { 1237. if (b->bs == BS_8x4) { ^ 1238. mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y, 1239. ref1->data[0], ref1->linesize[0], libavcodec/vp9block.c:1238:13: Skipping mc_luma_dir(): empty list of specs 1236. if (b->bs > BS_8x8) { 1237. if (b->bs == BS_8x4) { 1238. mc_luma_dir(s, s->dsp.mc[3][b->filter][0], b->dst[0], ls_y, ^ 1239. ref1->data[0], ref1->linesize[0], 1240. row << 3, col << 3, &b->mv[0][0], 8, 4, w, h); libavcodec/vp9block.c:1241:13: Skipping mc_luma_dir(): empty list of specs 1239. ref1->data[0], ref1->linesize[0], 1240. row << 3, col << 3, &b->mv[0][0], 8, 4, w, h); 1241. mc_luma_dir(s, s->dsp.mc[3][b->filter][0], ^ 1242. b->dst[0] + 4 * ls_y, ls_y, 1243. ref1->data[0], ref1->linesize[0], libavcodec/vp9block.c:1246:17: Taking true branch 1244. (row << 3) + 4, col << 3, &b->mv[2][0], 8, 4, w, h); 1245. 1246. if (b->comp) { ^ 1247. mc_luma_dir(s, s->dsp.mc[3][b->filter][1], b->dst[0], ls_y, 1248. ref2->data[0], ref2->linesize[0], libavcodec/vp9block.c:1247:17: 1245. 1246. if (b->comp) { 1247. mc_luma_dir(s, s->dsp.mc[3][b->filter][1], b->dst[0], ls_y, ^ 1248. ref2->data[0], ref2->linesize[0], 1249. row << 3, col << 3, &b->mv[0][1], 8, 4, w, h);
https://github.com/libav/libav/blob/d7b3ee9a3a03ab88d61a5895fbdbc6689f4dd671/libavcodec/vp9block.c/#L1248
d2a_code_trace_data_43999
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } test/bntest.c:1818: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_sqrt`. Showing all 44 steps of the trace test/bntest.c:1781:18: Call 1779. unsigned primes[8] = { 2, 3, 5, 7, 11, 13, 17, 19 }; 1780. 1781. if (!BN_set_word(p, primes[i])) ^ 1782. goto err; 1783. } else { crypto/bn/bn_lib.c:463:1: Parameter `a->top` 461. } 462. 463. > int BN_set_word(BIGNUM *a, BN_ULONG w) 464. { 465. bn_check_top(a); test/bntest.c:1818:18: Call 1816. goto err; 1817. 1818. if (!BN_mod_sqrt(r, a, p, ctx)) ^ 1819. goto err; 1820. if (!BN_mod_sqr(r, r, p, ctx)) crypto/bn/bn_sqrt.c:13:1: Parameter `p->top` 11. #include "bn_lcl.h" 12. 13. > BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) 14. /* 15. * Returns 'ret' such that ret^2 == a (mod p), using the Tonelli/Shanks crypto/bn/bn_sqrt.c:26:10: Call 24. int e, i, j; 25. 26. if (!BN_is_odd(p) || BN_abs_is_word(p, 1)) { ^ 27. if (BN_abs_is_word(p, 2)) { 28. if (ret == NULL) crypto/bn/bn_lib.c:935:1: Parameter `a->top` 933. } 934. 935. > int BN_is_odd(const BIGNUM *a) 936. { 937. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_sqrt.c:26:26: Call 24. int e, i, j; 25. 26. if (!BN_is_odd(p) || BN_abs_is_word(p, 1)) { ^ 27. if (BN_abs_is_word(p, 2)) { 28. if (ret == NULL) crypto/bn/bn_lib.c:915:1: Parameter `a->top` 913. } 914. 915. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 916. { 917. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_sqrt.c:75:10: Call 73. 74. /* A = a mod p */ 75. if (!BN_nnmod(A, a, p, ctx)) ^ 76. goto end; 77. crypto/bn/bn_mod.c:13:1: Parameter `d->top` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:140:1: Parameter `divisor->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_sqrt.c:80:13: Call 78. /* now write |p| - 1 as 2^e*q where q is odd */ 79. e = 1; 80. while (!BN_is_bit_set(p, e)) ^ 81. e++; 82. /* we'll set q later (if needed) */ crypto/bn/bn_lib.c:732:1: Parameter `a->top` 730. } 731. 732. > int BN_is_bit_set(const BIGNUM *a, int n) 733. { 734. int i, j; crypto/bn/bn_sqrt.c:93:14: Call 91. * so we can use exponent (|p|+1)/4, i.e. (|p|-3)/4 + 1. 92. */ 93. if (!BN_rshift(q, p, 2)) ^ 94. goto end; 95. q->neg = 0; crypto/bn/bn_shift.c:120:1: Parameter `a->top` 118. } 119. 120. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 121. { 122. int i, j, nw, lb, rb; crypto/bn/bn_sqrt.c:98:14: Call 96. if (!BN_add_word(q, 1)) 97. goto end; 98. if (!BN_mod_exp(ret, A, q, p, ctx)) ^ 99. goto end; 100. err = 0; 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:143:9: Call 141. /* if ((m->d[m->top-1]&BN_TBIT) && BN_is_odd(m)) */ 142. 143. if (BN_is_odd(m)) { ^ 144. # ifdef MONT_EXP_WORD 145. if (a->top == 1 && !a->neg crypto/bn/bn_lib.c:935:1: Parameter `a->top` 933. } 934. 935. > int BN_is_odd(const BIGNUM *a) 936. { 937. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_exp.c:151:19: Call 149. } else 150. # endif 151. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 152. } else 153. #endif crypto/bn/bn_exp.c:301:1: Parameter `m->top` 299. } 300. 301. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 302. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 303. { crypto/bn/bn_exp.c:313:16: Call 311. 312. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 313. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 314. } 315. crypto/bn/bn_exp.c:744:14: Assignment 742. /* 2^(top*BN_BITS2) - m */ 743. tmp.d[0] = (0 - m->d[0]) & BN_MASK2; 744. for (i = 1; i < top; i++) ^ 745. tmp.d[i] = (~m->d[i]) & BN_MASK2; 746. tmp.top = top; crypto/bn/bn_exp.c:1043:14: Call 1041. for (wvalue = 0, i = bits % window; i >= 0; i--, bits--) 1042. wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); 1043. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue, ^ 1044. window)) 1045. goto err; crypto/bn/bn_exp.c:525:1: Parameter `top` 523. } 524. 525. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, 526. unsigned char *buf, int idx, 527. int window) crypto/bn/bn_exp.c:582:5: Assignment 580. } 581. 582. b->top = top; ^ 583. bn_correct_top(b); 584. return 1; crypto/bn/bn_exp.c:583:5: Call 581. 582. b->top = top; 583. bn_correct_top(b); ^ 584. return 1; 585. } crypto/bn/bn_lib.c:1021:1: Parameter `a->top` 1019. } 1020. 1021. > void bn_correct_top(BIGNUM *a) 1022. { 1023. BN_ULONG *ftl; crypto/bn/bn_exp.c:1056:22: Call 1054. /* Scan the window, squaring the result as we go */ 1055. for (i = 0; i < window; i++, bits--) { 1056. if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) ^ 1057. goto err; 1058. wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); crypto/bn/bn_mont.c:26:1: Parameter `a->top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:53:14: Call 51. bn_check_top(tmp); 52. if (a == b) { 53. if (!BN_sqr(tmp, a, ctx)) ^ 54. goto err; 55. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:105:1: <Offset trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `n` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:116:5: Assignment 114. rp[0] = rp[max - 1] = 0; 115. rp++; 116. j = n; ^ 117. 118. if (--j > 0) { crypto/bn/bn_sqr.c:118:9: Assignment 116. j = n; 117. 118. if (--j > 0) { ^ 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:105:1: <Length trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `*r` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:113:5: Assignment 111. max = n * 2; 112. ap = a; 113. rp = r; ^ 114. rp[0] = rp[max - 1] = 0; 115. rp++; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp = r; 114. rp[0] = rp[max - 1] = 0; 115. rp++; ^ 116. j = n; 117. crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_sqrt` 118. if (--j > 0) { 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 121. rp += 2; 122. }
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_sqr.c/#L120
d2a_code_trace_data_44000
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/record/rec_layer_d1.c:933: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`. Showing all 13 steps of the trace ssl/record/rec_layer_d1.c:338:1: Parameter `s->initial_ctx->sessions->num_items` 336. * none of our business 337. */ 338. > int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, 339. size_t len, int peek, size_t *readbytes) 340. { ssl/record/rec_layer_d1.c:933:5: Call 931. 932. f_err: 933. ssl3_send_alert(s, SSL3_AL_FATAL, al); ^ 934. return -1; 935. } ssl/s3_msg.c:63:1: Parameter `s->initial_ctx->sessions->num_items` 61. } 62. 63. > int ssl3_send_alert(SSL *s, int level, int desc) 64. { 65. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:74:9: Call 72. /* If a fatal one, remove from cache */ 73. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 74. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 75. 76. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:698:1: Parameter `ctx->sessions->num_items` 696. } 697. 698. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 699. { 700. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:700:12: Call 698. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 699. { 700. return remove_session_lock(ctx, c, 1); ^ 701. } 702. ssl/ssl_sess.c:703:1: Parameter `ctx->sessions->num_items` 701. } 702. 703. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 704. { 705. SSL_SESSION *r; ssl/ssl_sess.c:713:17: Call 711. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 712. ret = 1; 713. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 714. SSL_SESSION_list_remove(ctx, c); 715. } ssl/ssl_locl.h:598:1: Parameter `lh->num_items` 596. }; 597. 598. > DEFINE_LHASH_OF(SSL_SESSION); 599. /* Needed in ssl_cert.c */ 600. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:598:1: Call 596. }; 597. 598. > DEFINE_LHASH_OF(SSL_SESSION); 599. /* Needed in ssl_cert.c */ 600. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `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/6438632420cee9821409221ef6717edc5ee408c1/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_44001
static int rev_body(char *hostname, int s, int stype, unsigned char *context) { char *buf = NULL; int i; int ret = 1; SSL *con; BIO *io, *ssl_bio, *sbio; buf = app_malloc(bufsize, "server rev buffer"); io = BIO_new(BIO_f_buffer()); ssl_bio = BIO_new(BIO_f_ssl()); if ((io == NULL) || (ssl_bio == NULL)) goto err; if (!BIO_set_write_buffer_size(io, bufsize)) goto err; if ((con = SSL_new(ctx)) == NULL) goto err; if (s_tlsextdebug) { SSL_set_tlsext_debug_callback(con, tlsext_cb); SSL_set_tlsext_debug_arg(con, bio_s_out); } if (context && !SSL_set_session_id_context(con, context, strlen((char *)context))) { ERR_print_errors(bio_err); goto err; } sbio = BIO_new_socket(s, BIO_NOCLOSE); SSL_set_bio(con, sbio, sbio); SSL_set_accept_state(con); BIO_set_ssl(ssl_bio, con, BIO_CLOSE); BIO_push(io, ssl_bio); #ifdef CHARSET_EBCDIC io = BIO_push(BIO_new(BIO_f_ebcdic_filter()), io); #endif if (s_debug) { BIO_set_callback(SSL_get_rbio(con), bio_dump_callback); BIO_set_callback_arg(SSL_get_rbio(con), (char *)bio_s_out); } if (s_msg) { #ifndef OPENSSL_NO_SSL_TRACE if (s_msg == 2) SSL_set_msg_callback(con, SSL_trace); else #endif SSL_set_msg_callback(con, msg_cb); SSL_set_msg_callback_arg(con, bio_s_msg ? bio_s_msg : bio_s_out); } for (;;) { i = BIO_do_handshake(io); if (i > 0) break; if (!BIO_should_retry(io)) { BIO_puts(bio_err, "CONNECTION FAILURE\n"); ERR_print_errors(bio_err); goto end; } #ifndef OPENSSL_NO_SRP if (BIO_should_io_special(io) && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP renego during accept\n"); srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); else BIO_printf(bio_s_out, "LOOKUP not successful\n"); continue; } #endif } BIO_printf(bio_err, "CONNECTION ESTABLISHED\n"); print_ssl_summary(con); for (;;) { i = BIO_gets(io, buf, bufsize - 1); if (i < 0) { if (!BIO_should_retry(io)) { if (!s_quiet) ERR_print_errors(bio_err); goto err; } else { BIO_printf(bio_s_out, "read R BLOCK\n"); #ifndef OPENSSL_NO_SRP if (BIO_should_io_special(io) && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP renego during read\n"); srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); else BIO_printf(bio_s_out, "LOOKUP not successful\n"); continue; } #endif #if defined(OPENSSL_SYS_NETWARE) delay(1000); #elif !defined(OPENSSL_SYS_MSDOS) sleep(1); #endif continue; } } else if (i == 0) { ret = 1; BIO_printf(bio_err, "CONNECTION CLOSED\n"); goto end; } else { char *p = buf + i - 1; while (i && (*p == '\n' || *p == '\r')) { p--; i--; } if (!s_ign_eof && (i == 5) && (strncmp(buf, "CLOSE", 5) == 0)) { ret = 1; BIO_printf(bio_err, "CONNECTION CLOSED\n"); goto end; } BUF_reverse((unsigned char *)buf, NULL, i); buf[i] = '\n'; BIO_write(io, buf, i + 1); for (;;) { i = BIO_flush(io); if (i > 0) break; if (!BIO_should_retry(io)) goto end; } } } end: SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); err: OPENSSL_free(buf); BIO_free_all(io); return (ret); } apps/s_server.c:2996: error: MEMORY_LEAK memory dynamically allocated to `ssl_bio` by call to `BIO_new()` at line 2995, column 15 is not reachable after line 2996, column 10. Showing all 62 steps of the trace apps/s_server.c:2985:1: start of procedure rev_body() 2983. } 2984. 2985. > static int rev_body(char *hostname, int s, int stype, unsigned char *context) 2986. { 2987. char *buf = NULL; apps/s_server.c:2987:5: 2985. static int rev_body(char *hostname, int s, int stype, unsigned char *context) 2986. { 2987. > char *buf = NULL; 2988. int i; 2989. int ret = 1; apps/s_server.c:2989:5: 2987. char *buf = NULL; 2988. int i; 2989. > int ret = 1; 2990. SSL *con; 2991. BIO *io, *ssl_bio, *sbio; apps/s_server.c:2993:5: 2991. BIO *io, *ssl_bio, *sbio; 2992. 2993. > buf = app_malloc(bufsize, "server rev buffer"); 2994. io = BIO_new(BIO_f_buffer()); 2995. ssl_bio = BIO_new(BIO_f_ssl()); apps/apps.c:976:1: start of procedure app_malloc() 974. } 975. 976. > void* app_malloc(int sz, const char *what) 977. { 978. void *vp = OPENSSL_malloc(sz); apps/apps.c:978:5: 976. void* app_malloc(int sz, const char *what) 977. { 978. > void *vp = OPENSSL_malloc(sz); 979. 980. if (vp == 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) apps/apps.c:980:9: Taking false branch 978. void *vp = OPENSSL_malloc(sz); 979. 980. if (vp == NULL) { ^ 981. BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n", 982. opt_getprog(), sz, what); apps/apps.c:986:5: 984. exit(1); 985. } 986. > return vp; 987. } 988. apps/apps.c:987:1: return from a call to app_malloc 985. } 986. return vp; 987. > } 988. 989. /* apps/s_server.c:2994:5: 2992. 2993. buf = app_malloc(bufsize, "server rev buffer"); 2994. > io = BIO_new(BIO_f_buffer()); 2995. ssl_bio = BIO_new(BIO_f_ssl()); 2996. if ((io == NULL) || (ssl_bio == NULL)) crypto/bio/bf_buff.c:87:1: start of procedure BIO_f_buffer() 85. }; 86. 87. > BIO_METHOD *BIO_f_buffer(void) 88. { 89. return (&methods_buffer); crypto/bio/bf_buff.c:89:5: 87. BIO_METHOD *BIO_f_buffer(void) 88. { 89. > return (&methods_buffer); 90. } 91. crypto/bio/bf_buff.c:90:1: return from a call to BIO_f_buffer 88. { 89. return (&methods_buffer); 90. > } 91. 92. static int buffer_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); crypto/bio/bio_lib.c:68:5: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. 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/bio/bio_lib.c:70:9: Taking false branch 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { ^ 71. BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); 72. return (NULL); crypto/bio/bio_lib.c:74:10: Taking true branch 72. return (NULL); 73. } 74. if (!BIO_set(ret, method)) { ^ 75. OPENSSL_free(ret); 76. ret = NULL; crypto/bio/bio_lib.c:75:9: 73. } 74. if (!BIO_set(ret, method)) { 75. > OPENSSL_free(ret); 76. ret = NULL; 77. } crypto/mem.c:234:1: start of procedure CRYPTO_free() 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: 243. } 244. #else 245. > free(str); 246. #endif 247. } crypto/mem.c:247:1: return from a call to CRYPTO_free 245. free(str); 246. #endif 247. > } 248. 249. void CRYPTO_clear_free(void *str, size_t num) crypto/bio/bio_lib.c:76:9: 74. if (!BIO_set(ret, method)) { 75. OPENSSL_free(ret); 76. > ret = NULL; 77. } 78. return (ret); crypto/bio/bio_lib.c:78:5: 76. ret = NULL; 77. } 78. > return (ret); 79. } 80. crypto/bio/bio_lib.c:79:1: return from a call to BIO_new 77. } 78. return (ret); 79. > } 80. 81. int BIO_set(BIO *bio, BIO_METHOD *method) apps/s_server.c:2995:5: 2993. buf = app_malloc(bufsize, "server rev buffer"); 2994. io = BIO_new(BIO_f_buffer()); 2995. > ssl_bio = BIO_new(BIO_f_ssl()); 2996. if ((io == NULL) || (ssl_bio == NULL)) 2997. goto err; ssl/bio_ssl.c:97:1: start of procedure BIO_f_ssl() 95. }; 96. 97. > BIO_METHOD *BIO_f_ssl(void) 98. { 99. return (&methods_sslp); ssl/bio_ssl.c:99:5: 97. BIO_METHOD *BIO_f_ssl(void) 98. { 99. > return (&methods_sslp); 100. } 101. ssl/bio_ssl.c:100:1: return from a call to BIO_f_ssl 98. { 99. return (&methods_sslp); 100. > } 101. 102. static int ssl_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); crypto/bio/bio_lib.c:68:5: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. 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/bio/bio_lib.c:70:9: Taking false branch 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { ^ 71. BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); 72. return (NULL); crypto/bio/bio_lib.c:74:10: Taking false branch 72. return (NULL); 73. } 74. if (!BIO_set(ret, method)) { ^ 75. OPENSSL_free(ret); 76. ret = NULL; crypto/bio/bio_lib.c:78:5: 76. ret = NULL; 77. } 78. > return (ret); 79. } 80. crypto/bio/bio_lib.c:79:1: return from a call to BIO_new 77. } 78. return (ret); 79. > } 80. 81. int BIO_set(BIO *bio, BIO_METHOD *method) apps/s_server.c:2996:10: Taking true branch 2994. io = BIO_new(BIO_f_buffer()); 2995. ssl_bio = BIO_new(BIO_f_ssl()); 2996. if ((io == NULL) || (ssl_bio == NULL)) ^ 2997. goto err; 2998.
https://github.com/openssl/openssl/blob/fe05264e32327e33f0b0c091479affeecbf55e89/apps/s_server.c/#L2996
d2a_code_trace_data_44002
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bn_internal_test.c:37: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `bn_miller_rabin_is_prime`. Showing all 66 steps of the trace test/bn_internal_test.c:37:14: Call 35. && TEST_true(BN_set_word(bn, 11)) 36. /* return extra parameters related to composite */ 37. && TEST_true(bn_miller_rabin_is_prime(bn, 10, ctx, NULL, 1, &status)) ^ 38. && TEST_int_eq(status, BN_PRIMETEST_PROBABLY_PRIME); 39. BN_free(bn); crypto/bn/bn_prime.c:249:1: Parameter `ctx->stack.depth` 247. * returns 0 if there was an error, otherwise it returns 1. 248. */ 249. > int bn_miller_rabin_is_prime(const BIGNUM *w, int iterations, BN_CTX *ctx, 250. BN_GENCB *cb, int enhanced, int *status) 251. { crypto/bn/bn_prime.c:260:5: Call 258. return 0; 259. 260. BN_CTX_start(ctx); ^ 261. g = BN_CTX_get(ctx); 262. w1 = 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_prime.c:261:9: Call 259. 260. BN_CTX_start(ctx); 261. g = BN_CTX_get(ctx); ^ 262. w1 = BN_CTX_get(ctx); 263. w3 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_prime.c:262:10: Call 260. BN_CTX_start(ctx); 261. g = BN_CTX_get(ctx); 262. w1 = BN_CTX_get(ctx); ^ 263. w3 = BN_CTX_get(ctx); 264. x = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_prime.c:263:10: Call 261. g = BN_CTX_get(ctx); 262. w1 = BN_CTX_get(ctx); 263. w3 = BN_CTX_get(ctx); ^ 264. x = BN_CTX_get(ctx); 265. m = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_prime.c:264:9: Call 262. w1 = BN_CTX_get(ctx); 263. w3 = BN_CTX_get(ctx); 264. x = BN_CTX_get(ctx); ^ 265. m = BN_CTX_get(ctx); 266. z = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_prime.c:265:9: Call 263. w3 = BN_CTX_get(ctx); 264. x = BN_CTX_get(ctx); 265. m = BN_CTX_get(ctx); ^ 266. z = BN_CTX_get(ctx); 267. b = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_prime.c:266:9: Call 264. x = BN_CTX_get(ctx); 265. m = BN_CTX_get(ctx); 266. z = BN_CTX_get(ctx); ^ 267. b = BN_CTX_get(ctx); 268. 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_prime.c:267:9: Call 265. m = BN_CTX_get(ctx); 266. z = BN_CTX_get(ctx); 267. b = BN_CTX_get(ctx); ^ 268. 269. if (!(b != NULL crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_prime.c:292:26: Call 290. /* Montgomery setup for computations mod a */ 291. mont = BN_MONT_CTX_new(); 292. if (mont == NULL || !BN_MONT_CTX_set(mont, w, ctx)) ^ 293. goto err; 294. crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth` 261. } 262. 263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 264. { 265. int i, ret = 0; crypto/bn/bn_mont.c:271:5: Call 269. return 0; 270. 271. BN_CTX_start(ctx); ^ 272. if ((Ri = BN_CTX_get(ctx)) == NULL) 273. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mont.c:272:15: Call 270. 271. BN_CTX_start(ctx); 272. if ((Ri = BN_CTX_get(ctx)) == NULL) ^ 273. goto err; 274. R = &(mont->RR); /* grab RR as a temp */ crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mont.c:351:19: Call 349. if (BN_is_one(&tmod)) 350. BN_zero(Ri); 351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 352. goto err; 353. if (!BN_lshift(Ri, Ri, BN_BITS2)) crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth` 122. BN_CTX *ctx); 123. 124. > BIGNUM *BN_mod_inverse(BIGNUM *in, 125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 126. { crypto/bn/bn_gcd.c:129:10: Call 127. BIGNUM *rv; 128. int noinv; 129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 130. if (noinv) 131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth` 133. } 134. 135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 137. int *pnoinv) crypto/bn/bn_gcd.c:155:16: Call 153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 155. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 156. } 157. crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth` 456. * not contain branches that may leak sensitive information. 457. */ 458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 459. const BIGNUM *a, const BIGNUM *n, 460. BN_CTX *ctx) crypto/bn/bn_gcd.c:469:5: Call 467. bn_check_top(n); 468. 469. BN_CTX_start(ctx); ^ 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_gcd.c:470:9: Call 468. 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); ^ 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:471:9: Call 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); ^ 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:472:9: Call 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); ^ 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:473:9: Call 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); ^ 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:474:9: Call 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); ^ 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:475:9: Call 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); ^ 476. T = BN_CTX_get(ctx); 477. if (T == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:476:9: Call 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); ^ 477. if (T == NULL) 478. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:504:18: Call 502. bn_init(&local_B); 503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 504. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 505. goto err; 506. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:264:1: Parameter `ctx->stack.depth` 262. * divisor's length is considered public; 263. */ 264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 265. const BIGNUM *divisor, BN_CTX *ctx) 266. { 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.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:282:11: Call 280. BN_CTX_start(ctx); 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); ^ 283. snum = BN_CTX_get(ctx); 284. sdiv = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_div.c:283:12: Call 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); 283. snum = BN_CTX_get(ctx); ^ 284. sdiv = BN_CTX_get(ctx); 285. if (sdiv == 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_div.c:284:12: Call 282. tmp = BN_CTX_get(ctx); 283. snum = BN_CTX_get(ctx); 284. sdiv = BN_CTX_get(ctx); ^ 285. if (sdiv == NULL) 286. 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_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.depth` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <LHS trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bn_miller_rabin_is_prime` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_44003
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:1174: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:1174:9: 1172. } 1173. if(dmin>64*4){ 1174. CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, ^ 1175. (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) 1176. if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1174
d2a_code_trace_data_44004
static void decode_gain_and_index(QCELPContext *q, float *gain) { int i, subframes_count, g1[16]; float slope; if(q->bitrate >= RATE_QUARTER) { switch(q->bitrate) { case RATE_FULL: subframes_count = 16; break; case RATE_HALF: subframes_count = 4; break; default: subframes_count = 5; } for(i=0; i<subframes_count; i++) { g1[i] = 4 * q->frame.cbgain[i]; if(q->bitrate == RATE_FULL && !((i+1) & 3)) { g1[i] += av_clip((g1[i-1] + g1[i-2] + g1[i-3]) / 3 - 6, 0, 32); } gain[i] = qcelp_g12ga[g1[i]]; if(q->frame.cbsign[i]) { gain[i] = -gain[i]; q->frame.cindex[i] = (q->frame.cindex[i]-89) & 127; } } q->prev_g1[0] = g1[i-2]; q->prev_g1[1] = g1[i-1]; q->last_codebook_gain = qcelp_g12ga[g1[i-1]]; if(q->bitrate == RATE_QUARTER) { gain[7] = gain[4]; gain[6] = 0.4*gain[3] + 0.6*gain[4]; gain[5] = gain[3]; gain[4] = 0.8*gain[2] + 0.2*gain[3]; gain[3] = 0.2*gain[1] + 0.8*gain[2]; gain[2] = gain[1]; gain[1] = 0.6*gain[0] + 0.4*gain[1]; } }else { if(q->bitrate == RATE_OCTAVE) { g1[0] = 2 * q->frame.cbgain[0] + av_clip((q->prev_g1[0] + q->prev_g1[1]) / 2 - 5, 0, 54); subframes_count = 8; }else { assert(q->bitrate == I_F_Q); g1[0] = q->prev_g1[1]; switch(q->erasure_count) { case 1 : break; case 2 : g1[0] -= 1; break; case 3 : g1[0] -= 2; break; default: g1[0] -= 6; } if(g1[0] < 0) g1[0] = 0; subframes_count = 4; } slope = 0.5*(qcelp_g12ga[g1[0]] - q->last_codebook_gain) / subframes_count; for(i=1; i<=subframes_count; i++) gain[i-1] = q->last_codebook_gain + slope * i; q->last_codebook_gain = gain[i-2]; q->prev_g1[0] = q->prev_g1[1]; q->prev_g1[1] = g1[0]; } } libavcodec/qcelpdec.c:233: error: Buffer Overrun L3 Offset: [-3, 12] Size: 16. libavcodec/qcelpdec.c:224:29: <Offset trace> 222. switch(q->bitrate) 223. { 224. case RATE_FULL: subframes_count = 16; break; ^ 225. case RATE_HALF: subframes_count = 4; break; 226. default: subframes_count = 5; libavcodec/qcelpdec.c:224:29: Assignment 222. switch(q->bitrate) 223. { 224. case RATE_FULL: subframes_count = 16; break; ^ 225. case RATE_HALF: subframes_count = 4; break; 226. default: subframes_count = 5; libavcodec/qcelpdec.c:215:1: <Length trace> 213. * TIA/EIA/IS-733 2.4.6.2 214. */ 215. static void decode_gain_and_index(QCELPContext *q, ^ 216. float *gain) { 217. int i, subframes_count, g1[16]; libavcodec/qcelpdec.c:215:1: Array declaration 213. * TIA/EIA/IS-733 2.4.6.2 214. */ 215. static void decode_gain_and_index(QCELPContext *q, ^ 216. float *gain) { 217. int i, subframes_count, g1[16]; libavcodec/qcelpdec.c:233:55: Array access: Offset: [-3, 12] Size: 16 231. if(q->bitrate == RATE_FULL && !((i+1) & 3)) 232. { 233. g1[i] += av_clip((g1[i-1] + g1[i-2] + g1[i-3]) / 3 - 6, 0, 32); ^ 234. } 235.
https://github.com/libav/libav/blob/ce60c2d133876b2878b724cb512b81d4a149c72e/libavcodec/qcelpdec.c/#L233
d2a_code_trace_data_44005
char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len) { static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; char *ret, *dst; unsigned i_bits = 0; int i_shift = 0; int bytes_remaining = len; if (len >= UINT_MAX / 4 || buf_len < len * 4 / 3 + 12) return NULL; ret = dst = buf; while (bytes_remaining) { i_bits = (i_bits << 8) + *src++; bytes_remaining--; i_shift += 8; do { *dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f]; i_shift -= 6; } while (i_shift > 6 || (bytes_remaining == 0 && i_shift > 0)); } while ((dst - ret) & 3) *dst++ = '='; *dst = '\0'; return ret; } libavutil/base64.c:83: error: Integer Overflow L2 ([`len`, min(1073741822, `len`)] × 4):signed32. libavutil/base64.c:73:1: <LHS trace> 71. *****************************************************************************/ 72. 73. char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len) ^ 74. { 75. static const char b64[] = libavutil/base64.c:73:1: Parameter `len` 71. *****************************************************************************/ 72. 73. char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len) ^ 74. { 75. static const char b64[] = libavutil/base64.c:83:9: Binary operation: ([len, min(1073741822, len)] × 4):signed32 81. 82. if (len >= UINT_MAX / 4 || 83. buf_len < len * 4 / 3 + 12) ^ 84. return NULL; 85. ret = dst = buf;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavutil/base64.c/#L83
d2a_code_trace_data_44006
static int opt_metadata(const char *opt, const char *arg) { char *mid= strchr(arg, '='); if(!mid){ fprintf(stderr, "Missing =\n"); ffmpeg_exit(1); } *mid++= 0; av_metadata_set2(&metadata, arg, mid, 0); return 0; } ffmpeg.c:2742: error: Null Dereference pointer `mid` last assigned on line 2742 could be null and is dereferenced at line 2742, column 5. ffmpeg.c:2734:1: start of procedure opt_metadata() 2732. } 2733. 2734. static int opt_metadata(const char *opt, const char *arg) ^ 2735. { 2736. char *mid= strchr(arg, '='); ffmpeg.c:2736:5: 2734. static int opt_metadata(const char *opt, const char *arg) 2735. { 2736. char *mid= strchr(arg, '='); ^ 2737. 2738. if(!mid){ ffmpeg.c:2738:9: Taking true branch 2736. char *mid= strchr(arg, '='); 2737. 2738. if(!mid){ ^ 2739. fprintf(stderr, "Missing =\n"); 2740. ffmpeg_exit(1); ffmpeg.c:2739:9: 2737. 2738. if(!mid){ 2739. fprintf(stderr, "Missing =\n"); ^ 2740. ffmpeg_exit(1); 2741. } ffmpeg.c:2740:9: Skipping ffmpeg_exit(): empty list of specs 2738. if(!mid){ 2739. fprintf(stderr, "Missing =\n"); 2740. ffmpeg_exit(1); ^ 2741. } 2742. *mid++= 0; ffmpeg.c:2742:5: 2740. ffmpeg_exit(1); 2741. } 2742. *mid++= 0; ^ 2743. 2744. av_metadata_set2(&metadata, arg, mid, 0);
https://github.com/libav/libav/blob/eced8fa02ea237abd9c6a6e9287bb7524addb8f4/ffmpeg.c/#L2742
d2a_code_trace_data_44007
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) { bn_check_top(b); if (a == b) return a; if (bn_wexpand(a, b->top) == NULL) return NULL; if (b->top > 0) memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); a->top = b->top; a->neg = b->neg; bn_check_top(a); return a; } crypto/ec/ecdsa_ossl.c:463: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINT_mul`. Showing all 18 steps of the trace crypto/ec/ecdsa_ossl.c:428:10: Call 426. } 427. /* calculate tmp1 = inv(S) mod order */ 428. if (!ec_group_do_inverse_ord(group, u2, sig->s, ctx)) { ^ 429. ECerr(EC_F_OSSL_ECDSA_VERIFY_SIG, ERR_R_BN_LIB); 430. goto err; crypto/ec/ec_lib.c:1074:1: Parameter `res->top` 1072. * other functionality. 1073. */ 1074. > int ec_group_do_inverse_ord(const EC_GROUP *group, BIGNUM *res, 1075. const BIGNUM *x, BN_CTX *ctx) 1076. { crypto/ec/ecdsa_ossl.c:463:10: Call 461. goto err; 462. } 463. if (!EC_POINT_mul(group, point, u1, pub_key, u2, ctx)) { ^ 464. ECerr(EC_F_OSSL_ECDSA_VERIFY_SIG, ERR_R_EC_LIB); 465. goto err; crypto/ec/ec_lib.c:929:1: Parameter `p_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 `(*scalars)->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:354:1: Parameter `(*scalars)->top` 352. * in the addition if scalar != NULL 353. */ 354. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 355. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 356. BN_CTX *ctx) crypto/ec/ec_mult.c:415:16: Call 413. * we always call the constant time version. 414. */ 415. return ec_mul_consttime(group, r, scalars[0], points[0], ctx); ^ 416. } 417. 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:180:10: Call 178. goto err; 179. 180. if (!BN_copy(k, scalar)) ^ 181. goto err; 182. 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/b8c32081e02b7008a90d878eccce46da256dfe86/crypto/bn/bn_lib.c/#L295
d2a_code_trace_data_44008
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) { PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | (diff > (0 - (PTRDIFF_T)len))); return overlapped; } ssl/record/ssl3_record_tls13.c:96: error: INTEGER_OVERFLOW_L2 (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`. Showing all 9 steps of the trace ssl/record/ssl3_record_tls13.c:96:16: Call 94. /* TODO(size_t): lenu/lenf should be a size_t but EVP doesn't support it */ 95. if (EVP_CipherInit_ex(ctx, NULL, NULL, NULL, iv, send) <= 0 96. || EVP_CipherUpdate(ctx, rec->data, &lenu, rec->input, ^ 97. (unsigned int)rec->length) <= 0 98. || (!send && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, crypto/evp/evp_enc.c:205:1: Parameter `ctx->cipher->block_size` 203. } 204. 205. > int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 206. const unsigned char *in, int inl) 207. { crypto/evp/evp_enc.c:211:16: Call 209. return EVP_EncryptUpdate(ctx, out, outl, in, inl); 210. else 211. return EVP_DecryptUpdate(ctx, out, outl, in, inl); ^ 212. } 213. crypto/evp/evp_enc.c:416:1: Parameter `ctx->cipher->block_size` 414. } 415. 416. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 417. const unsigned char *in, int inl) 418. { crypto/evp/evp_enc.c:422:5: Assignment 420. unsigned int b; 421. 422. b = ctx->cipher->block_size; ^ 423. 424. if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { crypto/evp/evp_enc.c:452:16: Call 450. /* see comment about PTRDIFF_T comparison above */ 451. if (((PTRDIFF_T)out == (PTRDIFF_T)in) 452. || is_partially_overlapping(out, in, b)) { ^ 453. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING); 454. return 0; crypto/evp/evp_enc.c:279:1: <RHS trace> 277. #endif 278. 279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 280. { 281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:279:1: Parameter `len` 277. #endif 278. 279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 280. { 281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:288:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate` 286. */ 287. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | 288. (diff > (0 - (PTRDIFF_T)len))); ^ 289. 290. return overlapped;
https://github.com/openssl/openssl/blob/b1531d8e6cc95837e38b10d875ae64144c6fdf7a/crypto/evp/evp_enc.c/#L288
d2a_code_trace_data_44009
IMPLEMENT_new_ctx(cbc, CBC, 128) providers/common/ciphers/aes.c:294: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 294 could be null and is dereferenced at line 294, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:294:1: start of procedure aes_128_cbc_newctx() 292. IMPLEMENT_new_ctx(cbc, CBC, 256) 293. IMPLEMENT_new_ctx(cbc, CBC, 192) 294. > IMPLEMENT_new_ctx(cbc, CBC, 128) 295. 296. /* OFB */ crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE) crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking false branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) providers/common/ciphers/aes.c:294:1: 292. IMPLEMENT_new_ctx(cbc, CBC, 256) 293. IMPLEMENT_new_ctx(cbc, CBC, 192) 294. > IMPLEMENT_new_ctx(cbc, CBC, 128) 295. 296. /* OFB */
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L294
d2a_code_trace_data_44010
static int encode_test_init(struct evp_test *t, const char *encoding) { struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata)); if (strcmp(encoding, "canonical") == 0) { edata->encoding = BASE64_CANONICAL_ENCODING; } else if (strcmp(encoding, "valid") == 0) { edata->encoding = BASE64_VALID_ENCODING; } else if (strcmp(encoding, "invalid") == 0) { edata->encoding = BASE64_INVALID_ENCODING; t->expected_err = OPENSSL_strdup("DECODE_ERROR"); if (t->expected_err == NULL) return 0; } else { fprintf(stderr, "Bad encoding: %s. Should be one of " "{canonical, valid, invalid}\n", encoding); return 0; } t->data = edata; return 1; } test/evp_test.c:1557: error: NULL_DEREFERENCE pointer `edata` last assigned on line 1554 could be null and is dereferenced at line 1557, column 9. Showing all 18 steps of the trace test/evp_test.c:1552:1: start of procedure encode_test_init() 1550. }; 1551. 1552. > static int encode_test_init(struct evp_test *t, const char *encoding) 1553. { 1554. struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata)); test/evp_test.c:1554:5: 1552. static int encode_test_init(struct evp_test *t, const char *encoding) 1553. { 1554. > struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata)); 1555. 1556. if (strcmp(encoding, "canonical") == 0) { crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking false branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) test/evp_test.c:1556:9: Taking true branch 1554. struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata)); 1555. 1556. if (strcmp(encoding, "canonical") == 0) { ^ 1557. edata->encoding = BASE64_CANONICAL_ENCODING; 1558. } else if (strcmp(encoding, "valid") == 0) { test/evp_test.c:1557:9: 1555. 1556. if (strcmp(encoding, "canonical") == 0) { 1557. > edata->encoding = BASE64_CANONICAL_ENCODING; 1558. } else if (strcmp(encoding, "valid") == 0) { 1559. edata->encoding = BASE64_VALID_ENCODING;
https://github.com/openssl/openssl/blob/928623825cc59e272e2031cd3f07c5b7bbd605d4/test/evp_test.c/#L1557
d2a_code_trace_data_44011
SwsVector *sws_cloneVec(SwsVector *a){ double *coeff= av_malloc(a->length*sizeof(double)); int i; SwsVector *vec= av_malloc(sizeof(SwsVector)); vec->coeff= coeff; vec->length= a->length; for (i=0; i<a->length; i++) coeff[i]= a->coeff[i]; return vec; } libswscale/swscale.c:3062: error: Null Dereference pointer `vec` last assigned on line 3060 could be null and is dereferenced at line 3062, column 5. libswscale/swscale.c:3057:1: start of procedure sws_cloneVec() 3055. } 3056. 3057. SwsVector *sws_cloneVec(SwsVector *a){ ^ 3058. double *coeff= av_malloc(a->length*sizeof(double)); 3059. int i; libswscale/swscale.c:3058:5: 3056. 3057. SwsVector *sws_cloneVec(SwsVector *a){ 3058. double *coeff= av_malloc(a->length*sizeof(double)); ^ 3059. int i; 3060. SwsVector *vec= av_malloc(sizeof(SwsVector)); libavutil/mem.c:47:1: start of procedure av_malloc() 45. linker will do it automatically. */ 46. 47. void *av_malloc(unsigned int size) ^ 48. { 49. void *ptr = NULL; libavutil/mem.c:49:5: 47. void *av_malloc(unsigned int size) 48. { 49. void *ptr = NULL; ^ 50. #if CONFIG_MEMALIGN_HACK 51. long diff; libavutil/mem.c:55:8: Taking false branch 53. 54. /* let's disallow possible ambiguous cases */ 55. if(size > (INT_MAX-16) ) ^ 56. return NULL; 57. libavutil/mem.c:66:9: Taking false branch 64. ((char*)ptr)[-1]= diff; 65. #elif HAVE_POSIX_MEMALIGN 66. if (posix_memalign(&ptr,16,size)) ^ 67. ptr = NULL; 68. #elif HAVE_MEMALIGN libavutil/mem.c:99:5: 97. ptr = malloc(size); 98. #endif 99. return ptr; ^ 100. } 101. libavutil/mem.c:100:1: return from a call to av_malloc 98. #endif 99. return ptr; 100. } ^ 101. 102. void *av_realloc(void *ptr, unsigned int size) libswscale/swscale.c:3060:5: 3058. double *coeff= av_malloc(a->length*sizeof(double)); 3059. int i; 3060. SwsVector *vec= av_malloc(sizeof(SwsVector)); ^ 3061. 3062. vec->coeff= coeff; libavutil/mem.c:47:1: start of procedure av_malloc() 45. linker will do it automatically. */ 46. 47. void *av_malloc(unsigned int size) ^ 48. { 49. void *ptr = NULL; libavutil/mem.c:49:5: 47. void *av_malloc(unsigned int size) 48. { 49. void *ptr = NULL; ^ 50. #if CONFIG_MEMALIGN_HACK 51. long diff; libavutil/mem.c:55:8: Taking false branch 53. 54. /* let's disallow possible ambiguous cases */ 55. if(size > (INT_MAX-16) ) ^ 56. return NULL; 57. libavutil/mem.c:66:9: Taking true branch 64. ((char*)ptr)[-1]= diff; 65. #elif HAVE_POSIX_MEMALIGN 66. if (posix_memalign(&ptr,16,size)) ^ 67. ptr = NULL; 68. #elif HAVE_MEMALIGN libavutil/mem.c:67:9: 65. #elif HAVE_POSIX_MEMALIGN 66. if (posix_memalign(&ptr,16,size)) 67. ptr = NULL; ^ 68. #elif HAVE_MEMALIGN 69. ptr = memalign(16,size); libavutil/mem.c:99:5: 97. ptr = malloc(size); 98. #endif 99. return ptr; ^ 100. } 101. libavutil/mem.c:100:1: return from a call to av_malloc 98. #endif 99. return ptr; 100. } ^ 101. 102. void *av_realloc(void *ptr, unsigned int size) libswscale/swscale.c:3062:5: 3060. SwsVector *vec= av_malloc(sizeof(SwsVector)); 3061. 3062. vec->coeff= coeff; ^ 3063. vec->length= a->length; 3064.
https://github.com/libav/libav/blob/184bc53db4fded8857af09cee2adc7197940deb7/libswscale/swscale.c/#L3062
d2a_code_trace_data_44012
int test_div(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; int i; a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); BN_one(a); BN_zero(b); if (BN_div(d, c, a, b, ctx)) { fprintf(stderr, "Division by zero succeeded!\n"); return 0; } for (i = 0; i < num0 + num1; i++) { if (i < num1) { BN_bntest_rand(a, 400, 0, 0); BN_copy(b, a); BN_lshift(a, a, i); BN_add_word(a, i); } else BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0); a->neg = rand_neg(); b->neg = rand_neg(); BN_div(d, c, a, b, ctx); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " / "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); if (!results) { BN_print(bp, a); BIO_puts(bp, " % "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, c); BIO_puts(bp, "\n"); } BN_mul(e, d, b, ctx); BN_add(d, e, c); BN_sub(d, d, a); if (!BN_is_zero(d)) { fprintf(stderr, "Division test failed!\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); return (1); } test/bntest.c:507: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 455, column 9 is not reachable after line 507, column 5. Showing all 160 steps of the trace test/bntest.c:449:1: start of procedure test_div() 447. } 448. 449. > int test_div(BIO *bp, BN_CTX *ctx) 450. { 451. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:454:5: 452. int i; 453. 454. > a = BN_new(); 455. b = BN_new(); 456. 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:455:5: 453. 454. a = BN_new(); 455. > b = BN_new(); 456. c = BN_new(); 457. 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:456:5: 454. a = BN_new(); 455. b = BN_new(); 456. > c = BN_new(); 457. d = BN_new(); 458. e = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:457:5: 455. b = BN_new(); 456. c = BN_new(); 457. > d = BN_new(); 458. e = BN_new(); 459. 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:458:5: 456. c = BN_new(); 457. d = BN_new(); 458. > e = BN_new(); 459. 460. BN_one(a); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:460:5: 458. e = BN_new(); 459. 460. > BN_one(a); 461. BN_zero(b); 462. 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:461:5: 459. 460. BN_one(a); 461. > BN_zero(b); 462. 463. if (BN_div(d, c, a, b, ctx)) { crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is 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:463:9: Taking false branch 461. BN_zero(b); 462. 463. if (BN_div(d, c, a, b, ctx)) { ^ 464. fprintf(stderr, "Division by zero succeeded!\n"); 465. return 0; test/bntest.c:468:10: 466. } 467. 468. > for (i = 0; i < num0 + num1; i++) { 469. if (i < num1) { 470. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:468:17: Loop condition is false. Leaving loop 466. } 467. 468. for (i = 0; i < num0 + num1; i++) { ^ 469. if (i < num1) { 470. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:506:5: 504. } 505. } 506. > BN_free(a); 507. BN_free(b); 508. BN_free(c); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:507:5: 505. } 506. BN_free(a); 507. > BN_free(b); 508. BN_free(c); 509. BN_free(d); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L507
d2a_code_trace_data_44013
static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) { const char *s = *t; int64_t v = 0; if (*s == '9' || *s == '8' || !ossl_isdigit(*s)) return 0; do { v = (v << 3) + (*s - '0'); } while (ossl_isdigit(*++s) && *s != '9' && *s != '8'); if (!ossl_isspace(*s) && *s != '\0' && *s != ',') { PROPerr(PROP_F_PARSE_OCT, PROP_R_NOT_AN_OCTAL_DIGIT); return 0; } *t = skip_space(s); res->type = PROPERTY_TYPE_NUMBER; res->v.int_val = v; return 1; } test/property_test.c:310: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] (⇐ [1, +oo] + 1) Size: [1, 37] by call to `ossl_method_store_add`. Showing all 23 steps of the trace test/property_test.c:276:9: Array declaration 274. char *impl; 275. } impls[] = { 276. { 1, "fast=no, colour=green", "a" }, ^ 277. { 1, "fast, colour=blue", "b" }, 278. { 1, "", "-" }, test/property_test.c:310:14: Call 308. 309. for (i = 0; i < OSSL_NELEM(impls); i++) 310. if (!TEST_true(ossl_method_store_add(store, impls[i].nid, impls[i].prop, ^ 311. impls[i].impl, NULL))) { 312. TEST_note("iteration %zd", i + 1); crypto/property/property.c:176:1: Parameter `*properties` 174. } 175. 176. > int ossl_method_store_add(OSSL_METHOD_STORE *store, 177. int nid, const char *properties, 178. void *method, void (*method_destruct)(void *)) crypto/property/property.c:205:28: Call 203. ossl_method_cache_flush(store, nid); 204. if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) { 205. impl->properties = ossl_parse_property(store->ctx, properties); ^ 206. if (impl->properties == NULL) 207. goto err; crypto/property/property_parse.c:322:1: Parameter `*defn` 320. } 321. 322. > OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn) 323. { 324. PROPERTY_DEFINITION *prop = NULL; crypto/property/property_parse.c:327:5: Assignment 325. OSSL_PROPERTY_LIST *res = NULL; 326. STACK_OF(PROPERTY_DEFINITION) *sk; 327. const char *s = defn; ^ 328. int done; 329. crypto/property/property_parse.c:333:9: Call 331. return NULL; 332. 333. s = skip_space(s); ^ 334. done = *s == '\0'; 335. while (!done) { crypto/property/property_parse.c:52:1: Parameter `*s` 50. DEFINE_STACK_OF(PROPERTY_DEFINITION) 51. 52. > static const char *skip_space(const char *s) 53. { 54. while (ossl_isspace(*s)) crypto/property/property_parse.c:56:5: Assignment 54. while (ossl_isspace(*s)) 55. s++; 56. return s; ^ 57. } 58. crypto/property/property_parse.c:333:5: Assignment 331. return NULL; 332. 333. s = skip_space(s); ^ 334. done = *s == '\0'; 335. while (!done) { crypto/property/property_parse.c:341:14: Call 339. memset(&prop->v, 0, sizeof(prop->v)); 340. prop->optional = 0; 341. if (!parse_name(ctx, &s, 1, &prop->name_idx)) ^ 342. goto err; 343. prop->oper = PROPERTY_OPER_EQ; crypto/property/property_parse.c:83:1: Parameter `**t` 81. } 82. 83. > static int parse_name(OPENSSL_CTX *ctx, const char *t[], int create, 84. OSSL_PROPERTY_IDX *idx) 85. { crypto/property/property_parse.c:348:13: Call 346. goto err; 347. } 348. if (match_ch(&s, '=')) { ^ 349. if (!parse_value(ctx, &s, prop, 1)) { 350. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); crypto/property/property_parse.c:59:1: Parameter `**t` 57. } 58. 59. > static int match_ch(const char *t[], char m) 60. { 61. const char *s = *t; crypto/property/property_parse.c:349:18: Call 347. } 348. if (match_ch(&s, '=')) { 349. if (!parse_value(ctx, &s, prop, 1)) { ^ 350. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); 351. goto err; crypto/property/property_parse.c:247:1: Parameter `**t` 245. } 246. 247. > static int parse_value(OPENSSL_CTX *ctx, const char *t[], 248. PROPERTY_DEFINITION *res, int create) 249. { crypto/property/property_parse.c:250:5: Assignment 248. PROPERTY_DEFINITION *res, int create) 249. { 250. const char *s = *t; ^ 251. int r = 0; 252. crypto/property/property_parse.c:267:9: Assignment 265. r = parse_hex(&s, res); 266. } else if (*s == '0' && ossl_isdigit(s[1])) { 267. s++; ^ 268. r = parse_oct(&s, res); 269. } else if (ossl_isdigit(*s)) { crypto/property/property_parse.c:268:13: Call 266. } else if (*s == '0' && ossl_isdigit(s[1])) { 267. s++; 268. r = parse_oct(&s, res); ^ 269. } else if (ossl_isdigit(*s)) { 270. return parse_number(t, res); crypto/property/property_parse.c:166:1: <Length trace> 164. } 165. 166. > static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 167. { 168. const char *s = *t; crypto/property/property_parse.c:166:1: Parameter `**t` 164. } 165. 166. > static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 167. { 168. const char *s = *t; crypto/property/property_parse.c:168:5: Assignment 166. static int parse_oct(const char *t[], PROPERTY_DEFINITION *res) 167. { 168. const char *s = *t; ^ 169. int64_t v = 0; 170. crypto/property/property_parse.c:175:14: Array access: Offset: [2, +oo] (⇐ [1, +oo] + 1) Size: [1, 37] by call to `ossl_method_store_add` 173. do { 174. v = (v << 3) + (*s - '0'); 175. } while (ossl_isdigit(*++s) && *s != '9' && *s != '8'); ^ 176. if (!ossl_isspace(*s) && *s != '\0' && *s != ',') { 177. PROPerr(PROP_F_PARSE_OCT, PROP_R_NOT_AN_OCTAL_DIGIT);
https://github.com/openssl/openssl/blob/bddf965d29cb4a9c4d6eeb94aa96dfa47d0cfa5d/crypto/property/property_parse.c/#L175
d2a_code_trace_data_44014
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:1069: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:1069:13: 1067. if(dmin>h*h*4){ 1068. if(c->pre_pass){ 1069. CHECK_CLIPPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16, ^ 1070. (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16) 1071. if(!s->first_slice_line)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1069
d2a_code_trace_data_44015
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:1129: error: Buffer Overrun L1 Offset: [8, 11] (⇐ [0, 3] + 8) Size: 4 by call to `cmp`. libavcodec/motion_est.c:1125:13: Assignment 1123. chroma_cmpf= s->dsp.sse[1]; 1124. init_mv4_ref(c); 1125. for(i=0; i<4; i++){ ^ 1126. xy= s->block_index[i]; 1127. x= p->motion_val[0][xy][0]; libavcodec/motion_est.c:1129:17: Call 1127. x= p->motion_val[0][xy][0]; 1128. y= p->motion_val[0][xy][1]; 1129. d+= cmp(s, x>>shift, y>>shift, x&mask, y&mask, 1, 8, i, i, cmpf, chroma_cmpf, flags); ^ 1130. } 1131. s->mb_type[mb_xy]=CANDIDATE_MB_TYPE_INTER4V; 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, 11] (⇐ [0, 3] + 8) Size: 4 by call to `cmp` 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_44016
static int epzs_motion_search4(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d, dmin; int map_generation; const int penalty_factor= c->penalty_factor; const int size=1; const int h=8; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON int flags= c->flags; LOAD_COMMON2 cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; map_generation= update_map_generation(c); dmin = 1000000; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) }else{ CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) } if(dmin>64*4){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1177: error: Uninitialized Value The value read from xmin was never initialized. libavcodec/motion_est_template.c:1177:13: 1175. (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) 1176. if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line 1177. CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, ^ 1178. (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) 1179. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1177
d2a_code_trace_data_44017
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } crypto/bn/bn_x931p.c:134: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex`. Showing all 59 steps of the trace crypto/bn/bn_x931p.c:94:10: Call 92. goto err; 93. 94. if (!BN_mul(p, p, p2, ctx)) ^ 95. goto err; 96. crypto/bn/bn_mul.c:497:1: Parameter `r->top` 495. #endif /* BN_RECURSION */ 496. 497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = 0; crypto/bn/bn_x931p.c:103:10: Call 101. goto err; 102. 103. if (!BN_sub(p, p, t)) ^ 104. goto err; 105. crypto/bn/bn_add.c:45:1: Parameter `a->top` 43. 44. /* signed sub of b from a. */ 45. > int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 46. { 47. int ret, r_neg, cmp_res; crypto/bn/bn_x931p.c:111:10: Call 109. /* p now equals Rp */ 110. 111. if (!BN_mod_sub(p, p, Xp, p1p2, ctx)) ^ 112. goto err; 113. crypto/bn/bn_mod.c:50:1: Parameter `a->top` 48. } 49. 50. > int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 51. BN_CTX *ctx) 52. { crypto/bn/bn_mod.c:53:10: Call 51. BN_CTX *ctx) 52. { 53. if (!BN_sub(r, a, b)) ^ 54. return 0; 55. return BN_nnmod(r, r, m, ctx); crypto/bn/bn_add.c:45:1: Parameter `a->top` 43. 44. /* signed sub of b from a. */ 45. > int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 46. { 47. int ret, r_neg, cmp_res; crypto/bn/bn_x931p.c:114:10: Call 112. goto err; 113. 114. if (!BN_add(p, p, Xp)) ^ 115. goto err; 116. crypto/bn/bn_add.c:14:1: Parameter `a->top` 12. 13. /* signed add of b to a. */ 14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 15. { 16. int ret, r_neg, cmp_res; crypto/bn/bn_x931p.c:122:14: Call 120. int i = 1; 121. BN_GENCB_call(cb, 0, i++); 122. if (!BN_copy(pm1, p)) ^ 123. goto err; 124. if (!BN_sub_word(pm1, 1)) 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_x931p.c:134:21: Call 132. * better. 133. */ 134. int r = BN_is_prime_fasttest_ex(p, 50, ctx, 1, cb); ^ 135. if (r < 0) 136. goto err; crypto/bn/bn_prime.c:151:1: Parameter `a->top` 149. } 150. 151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 152. int do_trial_division, BN_GENCB *cb) 153. { crypto/bn/bn_prime.c:161:9: Call 159. 160. /* Take care of the really small primes 2 & 3 */ 161. if (BN_is_word(a, 2) || BN_is_word(a, 3)) ^ 162. return 1; 163. crypto/bn/bn_lib.c:855:1: Parameter `a->top` 853. } 854. 855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); crypto/bn/bn_lib.c:857:12: Call 855. int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); ^ 858. } 859. crypto/bn/bn_lib.c:840:1: Parameter `a->top` 838. } 839. 840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 841. { 842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_prime.c:161:29: Call 159. 160. /* Take care of the really small primes 2 & 3 */ 161. if (BN_is_word(a, 2) || BN_is_word(a, 3)) ^ 162. return 1; 163. crypto/bn/bn_lib.c:855:1: Parameter `a->top` 853. } 854. 855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); crypto/bn/bn_lib.c:857:12: Call 855. int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); ^ 858. } 859. crypto/bn/bn_lib.c:840:1: Parameter `a->top` 838. } 839. 840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 841. { 842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_prime.c:165:10: Call 163. 164. /* Check odd and bigger than 1 */ 165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0) ^ 166. return 0; 167. crypto/bn/bn_lib.c:860:1: Parameter `a->top` 858. } 859. 860. > int BN_is_odd(const BIGNUM *a) 861. { 862. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_prime.c:165:26: Call 163. 164. /* Check odd and bigger than 1 */ 165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0) ^ 166. return 0; 167. crypto/bn/bn_lib.c:542:1: Parameter `a->top` 540. } 541. 542. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 543. { 544. int i; crypto/bn/bn_prime.c:198:10: Call 196. 197. /* compute A1 := a - 1 */ 198. if (!BN_copy(A1, a) || !BN_sub_word(A1, 1)) ^ 199. goto err; 200. /* compute A3 := a - 3 */ crypto/bn/bn_lib.c:285:1: Parameter `b->top` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_prime.c:201:10: Call 199. goto err; 200. /* compute A3 := a - 3 */ 201. if (!BN_copy(A3, a) || !BN_sub_word(A3, 3)) ^ 202. goto err; 203. crypto/bn/bn_lib.c:285:1: Parameter `b->top` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_prime.c:215:10: Call 213. if (mont == NULL) 214. goto err; 215. if (!BN_MONT_CTX_set(mont, a, ctx)) ^ 216. goto err; 217. crypto/bn/bn_mont.c:238:9: Call 236. BIGNUM *Ri, *R; 237. 238. if (BN_is_zero(mod)) ^ 239. return 0; 240. crypto/bn/bn_lib.c:845:1: Parameter `a->top` 843. } 844. 845. > int BN_is_zero(const BIGNUM *a) 846. { 847. return a->top == 0; crypto/bn/bn_prime.c:223:13: Call 221. goto err; 222. 223. j = witness(check, a, A1, A1_odd, k, ctx, mont); ^ 224. if (j == -1) 225. goto err; crypto/bn/bn_prime.c:245:1: Parameter `a->top` 243. } 244. 245. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1, 246. const BIGNUM *a1_odd, int k, BN_CTX *ctx, 247. BN_MONT_CTX *mont) crypto/bn/bn_prime.c:249:10: Call 247. BN_MONT_CTX *mont) 248. { 249. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ ^ 250. return -1; 251. if (BN_is_one(w)) crypto/bn/bn_exp.c:296:1: Parameter `m->top` 294. } 295. 296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 298. { crypto/bn/bn_exp.c:310:16: Call 308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) { 310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 311. } 312. crypto/bn/bn_exp.c:745:14: Assignment 743. /* 2^(top*BN_BITS2) - m */ 744. tmp.d[0] = (0 - m->d[0]) & BN_MASK2; 745. for (i = 1; i < top; i++) ^ 746. tmp.d[i] = (~m->d[i]) & BN_MASK2; 747. tmp.top = top; crypto/bn/bn_exp.c:1062:14: Call 1060. bits -= window0; 1061. wvalue = bn_get_bits(p, bits) & wmask; 1062. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue, ^ 1063. window)) 1064. goto err; crypto/bn/bn_exp.c:520:1: Parameter `top` 518. } 519. 520. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, 521. unsigned char *buf, int idx, 522. int window) crypto/bn/bn_exp.c:577:5: Assignment 575. } 576. 577. b->top = top; ^ 578. bn_correct_top(b); 579. return 1; crypto/bn/bn_exp.c:578:5: Call 576. 577. b->top = top; 578. bn_correct_top(b); ^ 579. return 1; 580. } crypto/bn/bn_lib.c:946:1: Parameter `a->top` 944. } 945. 946. > void bn_correct_top(BIGNUM *a) 947. { 948. BN_ULONG *ftl; crypto/bn/bn_exp.c:1075:22: Call 1073. /* Square the result window-size times */ 1074. for (i = 0; i < window; i++) 1075. if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) ^ 1076. goto err; 1077. crypto/bn/bn_mont.c:26:1: Parameter `a->top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:53:14: Call 51. bn_check_top(tmp); 52. if (a == b) { 53. if (!BN_sqr(tmp, a, ctx)) ^ 54. goto err; 55. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:105:1: <Offset trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `n` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:116:5: Assignment 114. rp[0] = rp[max - 1] = 0; 115. rp++; 116. j = n; ^ 117. 118. if (--j > 0) { crypto/bn/bn_sqr.c:118:9: Assignment 116. j = n; 117. 118. if (--j > 0) { ^ 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:105:1: <Length trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `*r` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:113:5: Assignment 111. max = n * 2; 112. ap = a; 113. rp = r; ^ 114. rp[0] = rp[max - 1] = 0; 115. rp++; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp = r; 114. rp[0] = rp[max - 1] = 0; 115. rp++; ^ 116. j = n; 117. crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex` 118. if (--j > 0) { 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 121. rp += 2; 122. }
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_sqr.c/#L120
d2a_code_trace_data_44018
static int makebwmap(TIFFRGBAImage* img) { TIFFRGBValue* Map = img->Map; int bitspersample = img->bitspersample; int nsamples = 8 / bitspersample; int i; uint32* p; if( nsamples == 0 ) nsamples = 1; img->BWmap = (uint32**) _TIFFmalloc( 256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32))); if (img->BWmap == NULL) { TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No space for B&W mapping table"); return (0); } p = (uint32*)(img->BWmap + 256); for (i = 0; i < 256; i++) { TIFFRGBValue c; img->BWmap[i] = p; switch (bitspersample) { #define GREY(x) c = Map[x]; *p++ = PACK(c,c,c); case 1: GREY(i>>7); GREY((i>>6)&1); GREY((i>>5)&1); GREY((i>>4)&1); GREY((i>>3)&1); GREY((i>>2)&1); GREY((i>>1)&1); GREY(i&1); break; case 2: GREY(i>>6); GREY((i>>4)&3); GREY((i>>2)&3); GREY(i&3); break; case 4: GREY(i>>4); GREY(i&0xf); break; case 8: case 16: GREY(i); break; } #undef GREY } return (1); } libtiff/tif_getimage.c:2205: error: Buffer Overrun L3 Offset: [0, 15] Size: [0, +oo] by call to `makebwmap`. libtiff/tif_getimage.c:2183:9: Assignment 2181. /* treat 16 bit the same as eight bit */ 2182. if( img->bitspersample == 16 ) 2183. range = (int32) 255; ^ 2184. 2185. img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue)); libtiff/tif_getimage.c:2185:32: Call 2183. range = (int32) 255; 2184. 2185. img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue)); ^ 2186. if (img->Map == NULL) { 2187. TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), libtiff/tif_unix.c:253:1: Parameter `s` 251. #endif 252. 253. void* ^ 254. _TIFFmalloc(tmsize_t s) 255. { libtiff/tif_unix.c:256:10: Array declaration 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_unix.c:256:2: Assignment 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_getimage.c:2185:5: Assignment 2183. range = (int32) 255; 2184. 2185. img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue)); ^ 2186. if (img->Map == NULL) { 2187. TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), libtiff/tif_getimage.c:2205:7: Call 2203. * unpacking tables for samples <= 8 bits. 2204. */ 2205. if (!makebwmap(img)) ^ 2206. return (0); 2207. /* no longer need Map, free it */ libtiff/tif_getimage.c:2134:10: <Offset trace> 2132. } 2133. p = (uint32*)(img->BWmap + 256); 2134. for (i = 0; i < 256; i++) { ^ 2135. TIFFRGBValue c; 2136. img->BWmap[i] = p; libtiff/tif_getimage.c:2134:10: Assignment 2132. } 2133. p = (uint32*)(img->BWmap + 256); 2134. for (i = 0; i < 256; i++) { ^ 2135. TIFFRGBValue c; 2136. img->BWmap[i] = p; libtiff/tif_getimage.c:2115:1: <Length trace> 2113. * number. 2114. */ 2115. static int ^ 2116. makebwmap(TIFFRGBAImage* img) 2117. { libtiff/tif_getimage.c:2115:1: Parameter `*img->Map` 2113. * number. 2114. */ 2115. static int ^ 2116. makebwmap(TIFFRGBAImage* img) 2117. { libtiff/tif_getimage.c:2118:5: Assignment 2116. makebwmap(TIFFRGBAImage* img) 2117. { 2118. TIFFRGBValue* Map = img->Map; ^ 2119. int bitspersample = img->bitspersample; 2120. int nsamples = 8 / bitspersample; libtiff/tif_getimage.c:2156:6: Array access: Offset: [0, 15] Size: [0, +oo] by call to `makebwmap` 2154. break; 2155. case 4: 2156. GREY(i>>4); ^ 2157. GREY(i&0xf); 2158. break;
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_getimage.c/#L2156
d2a_code_trace_data_44019
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) { PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | (diff > (0 - (PTRDIFF_T)len))); return overlapped; } crypto/evp/bio_enc.c:183: error: INTEGER_OVERFLOW_L2 (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`. Showing all 9 steps of the trace crypto/evp/bio_enc.c:183:22: Call 181. int j = outl - blocksize, buf_len; 182. 183. if (!EVP_CipherUpdate(ctx->cipher, ^ 184. (unsigned char *)out, &buf_len, 185. ctx->read_start, i > j ? j : i)) { crypto/evp/evp_enc.c:205:1: Parameter `ctx->cipher->block_size` 203. } 204. 205. > int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 206. const unsigned char *in, int inl) 207. { crypto/evp/evp_enc.c:211:16: Call 209. return EVP_EncryptUpdate(ctx, out, outl, in, inl); 210. else 211. return EVP_DecryptUpdate(ctx, out, outl, in, inl); ^ 212. } 213. crypto/evp/evp_enc.c:416:1: Parameter `ctx->cipher->block_size` 414. } 415. 416. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 417. const unsigned char *in, int inl) 418. { crypto/evp/evp_enc.c:422:5: Assignment 420. unsigned int b; 421. 422. b = ctx->cipher->block_size; ^ 423. 424. if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { crypto/evp/evp_enc.c:452:16: Call 450. /* see comment about PTRDIFF_T comparison above */ 451. if (((PTRDIFF_T)out == (PTRDIFF_T)in) 452. || is_partially_overlapping(out, in, b)) { ^ 453. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING); 454. return 0; crypto/evp/evp_enc.c:279:1: <RHS trace> 277. #endif 278. 279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 280. { 281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:279:1: Parameter `len` 277. #endif 278. 279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 280. { 281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:288:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate` 286. */ 287. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | 288. (diff > (0 - (PTRDIFF_T)len))); ^ 289. 290. return overlapped;
https://github.com/openssl/openssl/blob/b1531d8e6cc95837e38b10d875ae64144c6fdf7a/crypto/evp/evp_enc.c/#L288
d2a_code_trace_data_44020
static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) { int i; LHASH_NODE *a,*n; if (lh == NULL) return; for (i=lh->num_nodes-1; i>=0; i--) { a=lh->b[i]; while (a != NULL) { n=a->next; if(use_arg) func_arg(a->data,arg); else func(a->data); a=n; } } } ssl/ssl_lib.c:2758: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->ctx->sessions->num_nodes`)] - 1):unsigned32 by call to `SSL_free`. Showing all 15 steps of the trace ssl/ssl_lib.c:2633:1: Parameter `s->ctx->sessions->num_nodes` 2631. } 2632. 2633. > SSL *SSL_dup(SSL *s) 2634. { 2635. STACK_OF(X509_NAME) *sk; ssl/ssl_lib.c:2640:11: Call 2638. int i; 2639. 2640. if ((ret=SSL_new(SSL_get_SSL_CTX(s))) == NULL) ^ 2641. return(NULL); 2642. ssl/ssl_lib.c:275:1: Parameter `ctx->sessions->num_nodes` 273. } 274. 275. > SSL *SSL_new(SSL_CTX *ctx) 276. { 277. SSL *s; ssl/ssl_lib.c:2758:20: Call 2756. { 2757. err: 2758. if (ret != NULL) SSL_free(ret); ^ 2759. ret=NULL; 2760. } ssl/ssl_lib.c:505:1: Parameter `s->initial_ctx->sessions->num_nodes` 503. } 504. 505. > void SSL_free(SSL *s) 506. { 507. int i; ssl/ssl_lib.c:568:22: Call 566. if (s->tlsext_hostname) 567. OPENSSL_free(s->tlsext_hostname); 568. if (s->initial_ctx) SSL_CTX_free(s->initial_ctx); ^ 569. #ifndef OPENSSL_NO_EC 570. if (s->tlsext_ecpointformatlist) OPENSSL_free(s->tlsext_ecpointformatlist); ssl/ssl_lib.c:1899:1: Parameter `a->sessions->num_nodes` 1897. #endif 1898. 1899. > void SSL_CTX_free(SSL_CTX *a) 1900. { 1901. int i; ssl/ssl_lib.c:1931:3: Call 1929. */ 1930. if (a->sessions != NULL) 1931. SSL_CTX_flush_sessions(a,0); ^ 1932. 1933. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); ssl/ssl_sess.c:985:1: Parameter `s->sessions->num_nodes` 983. static IMPLEMENT_LHASH_DOALL_ARG_FN(timeout, SSL_SESSION, TIMEOUT_PARAM) 984. 985. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 986. { 987. unsigned long i; ssl/ssl_sess.c:997:2: Call 995. i=CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load; 996. CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=0; 997. lh_SSL_SESSION_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), ^ 998. TIMEOUT_PARAM, &tp); 999. CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=i; crypto/lhash/lhash.c:305:1: Parameter `lh->num_nodes` 303. } 304. 305. > void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 306. { 307. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); crypto/lhash/lhash.c:307:2: Call 305. void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 306. { 307. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); ^ 308. } 309. crypto/lhash/lhash.c:270:1: <LHS trace> 268. } 269. 270. > static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:270:1: Parameter `lh->num_nodes` 268. } 269. 270. > static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:281:7: Binary operation: ([0, max(0, s->ctx->sessions->num_nodes)] - 1):unsigned32 by call to `SSL_free` 279. /* reverse the order so we search from 'top to bottom' 280. * We were having memory leaks otherwise */ 281. for (i=lh->num_nodes-1; i>=0; i--) ^ 282. { 283. a=lh->b[i];
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/lhash/lhash.c/#L281
d2a_code_trace_data_44021
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, int32_t sb_samples[SBLIMIT]) { int32_t tmp[32]; register MPA_INT *synth_buf; register const MPA_INT *w, *w2, *p; int j, offset, v; OUT_INT *samples2; #if FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif dct32(tmp, sb_samples); offset = *synth_buf_offset; synth_buf = synth_buf_ptr + offset; for(j=0;j<32;j++) { v = tmp[j]; #if FRAC_BITS <= 15 v = av_clip_int16(v); #endif synth_buf[j] = v; } memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(sum, +=, w, p); p = synth_buf + 48; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); samples += incr; w++; for(j=1;j<16;j++) { sum2 = 0; p = synth_buf + 16 + j; SUM8P2(sum, +=, sum2, -=, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p); *samples = round_sample(&sum); samples += incr; sum += sum2; *samples2 = round_sample(&sum); samples2 -= incr; w++; w2--; } p = synth_buf + 32; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; offset = (offset - 32) & 511; *synth_buf_offset = offset; } libavcodec/mpc.c:60: error: Buffer Overrun L2 Offset: [496+min(0, `c->synth_buf_offset[*]`), 497+max(511, `c->synth_buf_offset[*]`)] (⇐ [48+min(0, `c->synth_buf_offset[*]`), 49+max(511, `c->synth_buf_offset[*]`)] + 448) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]` 49. * Process decoded Musepack data and produce PCM 50. */ 51. static void mpc_synth(MPCContext *c, int16_t *out) ^ 52. { 53. int dither_state = 0; libavcodec/mpc.c:60:13: Call 58. samples_ptr = samples + ch; 59. for(i = 0; i < SAMPLES_PER_BAND; i++) { 60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 61. mpa_window, &dither_state, 62. samples_ptr, 2, libavcodec/mpegaudiodec.c:858:1: <Length trace> 856. 32 samples. */ 857. /* XXX: optimize by avoiding ring buffer usage */ 858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 859. MPA_INT *window, int *dither_state, 860. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr` 856. 32 samples. */ 857. /* XXX: optimize by avoiding ring buffer usage */ 858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 859. MPA_INT *window, int *dither_state, 860. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:877:5: Assignment 875. 876. offset = *synth_buf_offset; 877. synth_buf = synth_buf_ptr + offset; ^ 878. 879. for(j=0;j<32;j++) { libavcodec/mpegaudiodec.c:898:5: Assignment 896. p = synth_buf + 16; 897. SUM8(sum, +=, w, p); 898. p = synth_buf + 48; ^ 899. SUM8(sum, -=, w + 32, p); 900. *samples = round_sample(&sum); libavcodec/mpegaudiodec.c:899:5: Array access: Offset: [496+min(0, c->synth_buf_offset[*]), 497+max(511, c->synth_buf_offset[*])] (⇐ [48+min(0, c->synth_buf_offset[*]), 49+max(511, c->synth_buf_offset[*])] + 448) Size: 2 by call to `ff_mpa_synth_filter` 897. SUM8(sum, +=, w, p); 898. p = synth_buf + 48; 899. SUM8(sum, -=, w + 32, p); ^ 900. *samples = round_sample(&sum); 901. samples += incr;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L899
d2a_code_trace_data_44022
static void opt_output_file(const char *filename) { AVFormatContext *oc; int err, use_video, use_audio, use_subtitle, use_data; int input_has_video, input_has_audio, input_has_subtitle, input_has_data; AVFormatParameters params, *ap = &params; AVOutputFormat *file_oformat; 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; use_data = data_stream_copy || data_codec_name; if (nb_input_files > 0) { check_inputs(&input_has_video, &input_has_audio, &input_has_subtitle, &input_has_data); if (!input_has_video) use_video = 0; if (!input_has_audio) use_audio = 0; if (!input_has_subtitle) use_subtitle = 0; if (!input_has_data) use_data = 0; } if (audio_disable) use_audio = 0; if (video_disable) use_video = 0; if (subtitle_disable) use_subtitle = 0; if (data_disable) use_data = 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); if (use_data) new_data_stream(oc, nb_output_files); oc->timestamp = recording_timestamp; av_metadata_copy(&oc->metadata, metadata, 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(EINVAL)); ffmpeg_exit(1); } } if (!(oc->oformat->flags & AVFMT_NOFILE)) { if (!file_overwrite && (strchr(filename, ':') == NULL || filename[1] == ':' || av_strstart(filename, "file:", NULL))) { if (avio_check(filename, 0) == 0) { 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 = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE)) < 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); av_freep(&forced_key_frames); uninit_opts(); init_opts(); } ffmpeg.c:3755: error: Null Dereference pointer `file_oformat` last assigned on line 3744 could be null and is dereferenced at line 3755, column 17. ffmpeg.c:3719:1: start of procedure opt_output_file() 3717. } 3718. 3719. static void opt_output_file(const char *filename) ^ 3720. { 3721. AVFormatContext *oc; ffmpeg.c:3724:5: 3722. int err, use_video, use_audio, use_subtitle, use_data; 3723. int input_has_video, input_has_audio, input_has_subtitle, input_has_data; 3724. AVFormatParameters params, *ap = &params; ^ 3725. AVOutputFormat *file_oformat; 3726. ffmpeg.c:3727:10: Taking false branch 3725. AVOutputFormat *file_oformat; 3726. 3727. if (!strcmp(filename, "-")) ^ 3728. filename = "pipe:"; 3729. ffmpeg.c:3730:5: 3728. filename = "pipe:"; 3729. 3730. oc = avformat_alloc_context(); ^ 3731. if (!oc) { 3732. print_error(filename, AVERROR(ENOMEM)); libavformat/options.c:78:1: start of procedure avformat_alloc_context() 76. } 77. 78. AVFormatContext *avformat_alloc_context(void) ^ 79. { 80. AVFormatContext *ic; libavformat/options.c:81:5: 79. { 80. AVFormatContext *ic; 81. ic = av_malloc(sizeof(AVFormatContext)); ^ 82. if (!ic) return ic; 83. 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(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) libavformat/options.c:82:10: Taking false branch 80. AVFormatContext *ic; 81. ic = av_malloc(sizeof(AVFormatContext)); 82. if (!ic) return ic; ^ 83. avformat_get_context_defaults(ic); 84. ic->av_class = &av_format_context_class; libavformat/options.c:83:5: Skipping avformat_get_context_defaults(): empty list of specs 81. ic = av_malloc(sizeof(AVFormatContext)); 82. if (!ic) return ic; 83. avformat_get_context_defaults(ic); ^ 84. ic->av_class = &av_format_context_class; 85. return ic; libavformat/options.c:84:5: 82. if (!ic) return ic; 83. avformat_get_context_defaults(ic); 84. ic->av_class = &av_format_context_class; ^ 85. return ic; 86. } libavformat/options.c:85:5: 83. avformat_get_context_defaults(ic); 84. ic->av_class = &av_format_context_class; 85. return ic; ^ 86. } libavformat/options.c:86:1: return from a call to avformat_alloc_context 84. ic->av_class = &av_format_context_class; 85. return ic; 86. } ^ ffmpeg.c:3731:10: Taking false branch 3729. 3730. oc = avformat_alloc_context(); 3731. if (!oc) { ^ 3732. print_error(filename, AVERROR(ENOMEM)); 3733. ffmpeg_exit(1); ffmpeg.c:3736:9: Taking false branch 3734. } 3735. 3736. if (last_asked_format) { ^ 3737. file_oformat = av_guess_format(last_asked_format, NULL, NULL); 3738. if (!file_oformat) { ffmpeg.c:3744:9: Skipping av_guess_format(): empty list of specs 3742. last_asked_format = NULL; 3743. } else { 3744. file_oformat = av_guess_format(NULL, filename, NULL); ^ 3745. if (!file_oformat) { 3746. fprintf(stderr, "Unable to find a suitable output format for '%s'\n", ffmpeg.c:3745:14: Taking true branch 3743. } else { 3744. file_oformat = av_guess_format(NULL, filename, NULL); 3745. if (!file_oformat) { ^ 3746. fprintf(stderr, "Unable to find a suitable output format for '%s'\n", 3747. filename); ffmpeg.c:3746:13: 3744. file_oformat = av_guess_format(NULL, filename, NULL); 3745. if (!file_oformat) { 3746. fprintf(stderr, "Unable to find a suitable output format for '%s'\n", ^ 3747. filename); 3748. ffmpeg_exit(1); ffmpeg.c:3748:13: Skipping ffmpeg_exit(): empty list of specs 3746. fprintf(stderr, "Unable to find a suitable output format for '%s'\n", 3747. filename); 3748. ffmpeg_exit(1); ^ 3749. } 3750. } ffmpeg.c:3752:5: 3750. } 3751. 3752. oc->oformat = file_oformat; ^ 3753. av_strlcpy(oc->filename, filename, sizeof(oc->filename)); 3754. ffmpeg.c:3753:5: 3751. 3752. oc->oformat = file_oformat; 3753. av_strlcpy(oc->filename, filename, sizeof(oc->filename)); ^ 3754. 3755. if (!strcmp(file_oformat->name, "ffm") && libavutil/avstring.c:64:1: start of procedure av_strlcpy() 62. } 63. 64. size_t av_strlcpy(char *dst, const char *src, size_t size) ^ 65. { 66. size_t len = 0; libavutil/avstring.c:66:5: 64. size_t av_strlcpy(char *dst, const char *src, size_t size) 65. { 66. size_t len = 0; ^ 67. while (++len < size && *src) 68. *dst++ = *src++; libavutil/avstring.c:67:12: Loop condition is true. Entering loop body 65. { 66. size_t len = 0; 67. while (++len < size && *src) ^ 68. *dst++ = *src++; 69. if (len <= size) libavutil/avstring.c:67:28: Loop condition is false. Leaving loop 65. { 66. size_t len = 0; 67. while (++len < size && *src) ^ 68. *dst++ = *src++; 69. if (len <= size) libavutil/avstring.c:69:9: Taking true branch 67. while (++len < size && *src) 68. *dst++ = *src++; 69. if (len <= size) ^ 70. *dst = 0; 71. return len + strlen(src) - 1; libavutil/avstring.c:70:9: 68. *dst++ = *src++; 69. if (len <= size) 70. *dst = 0; ^ 71. return len + strlen(src) - 1; 72. } libavutil/avstring.c:71:5: 69. if (len <= size) 70. *dst = 0; 71. return len + strlen(src) - 1; ^ 72. } 73. libavutil/avstring.c:72:1: return from a call to av_strlcpy 70. *dst = 0; 71. return len + strlen(src) - 1; 72. } ^ 73. 74. size_t av_strlcat(char *dst, const char *src, size_t size) ffmpeg.c:3755:10: 3753. av_strlcpy(oc->filename, filename, sizeof(oc->filename)); 3754. 3755. if (!strcmp(file_oformat->name, "ffm") && ^ 3756. av_strstart(filename, "http:", NULL)) { 3757. /* special case for files sent to ffserver: we get the stream
https://github.com/libav/libav/blob/b568d6d94bda607e4ebb35be68181a8c2a9f5c50/ffmpeg.c/#L3755
d2a_code_trace_data_44023
PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx) { STACK_OF(PKCS7_RECIP_INFO) *rsk; PKCS7_RECIP_INFO *ri; int i; i=OBJ_obj2nid(p7->type); if (i != NID_pkcs7_signedAndEnveloped) return(NULL); rsk=p7->d.signed_and_enveloped->recipientinfo; ri=sk_PKCS7_RECIP_INFO_value(rsk,0); if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return(NULL); ri=sk_PKCS7_RECIP_INFO_value(rsk,idx); return(ri->issuer_and_serial); } crypto/pkcs7/pk7_doit.c:1070: error: NULL_DEREFERENCE pointer `ri` last assigned on line 1069 could be null and is dereferenced at line 1070, column 8. Showing all 42 steps of the trace crypto/pkcs7/pk7_doit.c:1058:1: start of procedure PKCS7_get_issuer_and_serial() 1056. } 1057. 1058. > PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx) 1059. { 1060. STACK_OF(PKCS7_RECIP_INFO) *rsk; crypto/pkcs7/pk7_doit.c:1064:2: 1062. int i; 1063. 1064. > i=OBJ_obj2nid(p7->type); 1065. if (i != NID_pkcs7_signedAndEnveloped) return(NULL); 1066. rsk=p7->d.signed_and_enveloped->recipientinfo; crypto/objects/obj_dat.c:387:1: start of procedure OBJ_obj2nid() 385. } 386. 387. > int OBJ_obj2nid(const ASN1_OBJECT *a) 388. { 389. ASN1_OBJECT **op; crypto/objects/obj_dat.c:392:6: Taking false branch 390. ADDED_OBJ ad,*adp; 391. 392. if (a == NULL) ^ 393. return(NID_undef); 394. if (a->nid != 0) crypto/objects/obj_dat.c:394:6: Taking false branch 392. if (a == NULL) 393. return(NID_undef); 394. if (a->nid != 0) ^ 395. return(a->nid); 396. crypto/objects/obj_dat.c:397:6: Taking true branch 395. return(a->nid); 396. 397. if (added != NULL) ^ 398. { 399. ad.type=ADDED_DATA; crypto/objects/obj_dat.c:399:3: 397. if (added != NULL) 398. { 399. > ad.type=ADDED_DATA; 400. ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 401. adp=(ADDED_OBJ *)lh_retrieve(added,&ad); crypto/objects/obj_dat.c:400:3: 398. { 399. ad.type=ADDED_DATA; 400. > ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 401. adp=(ADDED_OBJ *)lh_retrieve(added,&ad); 402. if (adp != NULL) return (adp->obj->nid); crypto/objects/obj_dat.c:401:3: 399. ad.type=ADDED_DATA; 400. ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 401. > adp=(ADDED_OBJ *)lh_retrieve(added,&ad); 402. if (adp != NULL) return (adp->obj->nid); 403. } crypto/lhash/lhash.c:248:1: start of procedure lh_retrieve() 246. } 247. 248. > void *lh_retrieve(LHASH *lh, const void *data) 249. { 250. unsigned long hash; crypto/lhash/lhash.c:254:2: 252. void *ret; 253. 254. > lh->error=0; 255. rn=getrn(lh,data,&hash); 256. crypto/lhash/lhash.c:255:2: Skipping getrn(): empty list of specs 253. 254. lh->error=0; 255. rn=getrn(lh,data,&hash); ^ 256. 257. if (*rn == NULL) crypto/lhash/lhash.c:257:6: Taking false branch 255. rn=getrn(lh,data,&hash); 256. 257. if (*rn == NULL) ^ 258. { 259. lh->num_retrieve_miss++; crypto/lhash/lhash.c:264:3: 262. else 263. { 264. > ret= (*rn)->data; 265. lh->num_retrieve++; 266. } crypto/lhash/lhash.c:265:3: 263. { 264. ret= (*rn)->data; 265. > lh->num_retrieve++; 266. } 267. return(ret); crypto/lhash/lhash.c:267:2: 265. lh->num_retrieve++; 266. } 267. > return(ret); 268. } 269. crypto/lhash/lhash.c:268:2: return from a call to lh_retrieve 266. } 267. return(ret); 268. } ^ 269. 270. static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, crypto/objects/obj_dat.c:402:7: Taking true branch 400. ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 401. adp=(ADDED_OBJ *)lh_retrieve(added,&ad); 402. if (adp != NULL) return (adp->obj->nid); ^ 403. } 404. op=(ASN1_OBJECT **)OBJ_bsearch((const char *)&a,(const char *)obj_objs, crypto/objects/obj_dat.c:402:20: 400. ad.obj=(ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 401. adp=(ADDED_OBJ *)lh_retrieve(added,&ad); 402. > if (adp != NULL) return (adp->obj->nid); 403. } 404. op=(ASN1_OBJECT **)OBJ_bsearch((const char *)&a,(const char *)obj_objs, crypto/objects/obj_dat.c:409:2: return from a call to OBJ_obj2nid 407. return(NID_undef); 408. return((*op)->nid); 409. } ^ 410. 411. /* Convert an object name into an ASN1_OBJECT crypto/pkcs7/pk7_doit.c:1065:6: Taking false branch 1063. 1064. i=OBJ_obj2nid(p7->type); 1065. if (i != NID_pkcs7_signedAndEnveloped) return(NULL); ^ 1066. rsk=p7->d.signed_and_enveloped->recipientinfo; 1067. ri=sk_PKCS7_RECIP_INFO_value(rsk,0); crypto/pkcs7/pk7_doit.c:1066:2: 1064. i=OBJ_obj2nid(p7->type); 1065. if (i != NID_pkcs7_signedAndEnveloped) return(NULL); 1066. > rsk=p7->d.signed_and_enveloped->recipientinfo; 1067. ri=sk_PKCS7_RECIP_INFO_value(rsk,0); 1068. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return(NULL); crypto/pkcs7/pk7_doit.c:1067:2: 1065. if (i != NID_pkcs7_signedAndEnveloped) return(NULL); 1066. rsk=p7->d.signed_and_enveloped->recipientinfo; 1067. > ri=sk_PKCS7_RECIP_INFO_value(rsk,0); 1068. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return(NULL); 1069. ri=sk_PKCS7_RECIP_INFO_value(rsk,idx); crypto/stack/stack.c:307:1: start of procedure sk_value() 305. } 306. 307. > char *sk_value(const STACK *st, int i) 308. { 309. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:309:6: Taking false branch 307. char *sk_value(const STACK *st, int i) 308. { 309. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 310. return st->data[i]; 311. } crypto/stack/stack.c:309:13: Taking false branch 307. char *sk_value(const STACK *st, int i) 308. { 309. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 310. return st->data[i]; 311. } crypto/stack/stack.c:309:24: Taking false branch 307. char *sk_value(const STACK *st, int i) 308. { 309. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 310. return st->data[i]; 311. } crypto/stack/stack.c:310:2: 308. { 309. if(!st || (i < 0) || (i >= st->num)) return NULL; 310. > return st->data[i]; 311. } 312. crypto/stack/stack.c:311:1: return from a call to sk_value 309. if(!st || (i < 0) || (i >= st->num)) return NULL; 310. return st->data[i]; 311. > } 312. 313. char *sk_set(STACK *st, int i, char *value) crypto/pkcs7/pk7_doit.c:1068:6: 1066. rsk=p7->d.signed_and_enveloped->recipientinfo; 1067. ri=sk_PKCS7_RECIP_INFO_value(rsk,0); 1068. > if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return(NULL); 1069. ri=sk_PKCS7_RECIP_INFO_value(rsk,idx); 1070. return(ri->issuer_and_serial); crypto/stack/stack.c:301:1: start of procedure sk_num() 299. } 300. 301. > int sk_num(const STACK *st) 302. { 303. if(st == NULL) return -1; crypto/stack/stack.c:303:5: Taking false branch 301. int sk_num(const STACK *st) 302. { 303. if(st == NULL) return -1; ^ 304. return st->num; 305. } crypto/stack/stack.c:304:2: 302. { 303. if(st == NULL) return -1; 304. > return st->num; 305. } 306. crypto/stack/stack.c:305:1: return from a call to sk_num 303. if(st == NULL) return -1; 304. return st->num; 305. > } 306. 307. char *sk_value(const STACK *st, int i) crypto/pkcs7/pk7_doit.c:1068:6: Taking false branch 1066. rsk=p7->d.signed_and_enveloped->recipientinfo; 1067. ri=sk_PKCS7_RECIP_INFO_value(rsk,0); 1068. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return(NULL); ^ 1069. ri=sk_PKCS7_RECIP_INFO_value(rsk,idx); 1070. return(ri->issuer_and_serial); crypto/pkcs7/pk7_doit.c:1069:2: 1067. ri=sk_PKCS7_RECIP_INFO_value(rsk,0); 1068. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return(NULL); 1069. > ri=sk_PKCS7_RECIP_INFO_value(rsk,idx); 1070. return(ri->issuer_and_serial); 1071. } crypto/stack/stack.c:307:1: start of procedure sk_value() 305. } 306. 307. > char *sk_value(const STACK *st, int i) 308. { 309. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:309:6: Taking false branch 307. char *sk_value(const STACK *st, int i) 308. { 309. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 310. return st->data[i]; 311. } crypto/stack/stack.c:309:13: Taking true branch 307. char *sk_value(const STACK *st, int i) 308. { 309. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 310. return st->data[i]; 311. } crypto/stack/stack.c:309:39: 307. char *sk_value(const STACK *st, int i) 308. { 309. > if(!st || (i < 0) || (i >= st->num)) return NULL; 310. return st->data[i]; 311. } crypto/stack/stack.c:311:1: return from a call to sk_value 309. if(!st || (i < 0) || (i >= st->num)) return NULL; 310. return st->data[i]; 311. > } 312. 313. char *sk_set(STACK *st, int i, char *value) crypto/pkcs7/pk7_doit.c:1070:2: 1068. if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return(NULL); 1069. ri=sk_PKCS7_RECIP_INFO_value(rsk,idx); 1070. > return(ri->issuer_and_serial); 1071. } 1072.
https://github.com/openssl/openssl/blob/f253a058d3519cdfa7d1859e0e83ef7781e4fffb/crypto/pkcs7/pk7_doit.c/#L1070
d2a_code_trace_data_44024
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:1169: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1169:9: 1167. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) 1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) 1169. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) ^ 1170. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, 1171. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1169
d2a_code_trace_data_44025
ASN1_OBJECT *OBJ_nid2obj(int n) { ADDED_OBJ ad, *adp; ASN1_OBJECT ob; if ((n >= 0) && (n < NUM_NID)) { if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) { OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID); return (NULL); } return ((ASN1_OBJECT *)&(nid_objs[n])); } else if (added == NULL) return (NULL); else { ad.type = ADDED_NID; ad.obj = &ob; ob.nid = n; adp = lh_ADDED_OBJ_retrieve(added, &ad); if (adp != NULL) return (adp->obj); else { OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID); return (NULL); } } } crypto/asn1/p5_pbev2.c:107: error: USE_AFTER_FREE call to `OBJ_nid2obj()` eventually accesses memory that was invalidated by call to `free()` on line 101 indirectly during the call to `EVP_CIPHER_type()`. Showing all 17 steps of the trace crypto/asn1/p5_pbev2.c:101:15: invalidation part of the trace starts here 99. ASN1_OBJECT *obj; 100. 101. alg_nid = EVP_CIPHER_type(cipher); ^ 102. if (alg_nid == NID_undef) { 103. ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, crypto/asn1/p5_pbev2.c:101:15: global variable `nid_objs` accessed here 99. ASN1_OBJECT *obj; 100. 101. alg_nid = EVP_CIPHER_type(cipher); ^ 102. if (alg_nid == NID_undef) { 103. ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, crypto/asn1/p5_pbev2.c:101:15: when calling `EVP_CIPHER_type` here 99. ASN1_OBJECT *obj; 100. 101. alg_nid = EVP_CIPHER_type(cipher); ^ 102. if (alg_nid == NID_undef) { 103. ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, crypto/evp/evp_lib.c:206:16: global variable `nid_objs` accessed here 204. default: 205. /* Check it has an OID and it is valid */ 206. otmp = OBJ_nid2obj(nid); ^ 207. if (OBJ_get0_data(otmp) == NULL) 208. nid = NID_undef; crypto/evp/evp_lib.c:206:16: passed as argument to `OBJ_nid2obj` 204. default: 205. /* Check it has an OID and it is valid */ 206. otmp = OBJ_nid2obj(nid); ^ 207. if (OBJ_get0_data(otmp) == NULL) 208. nid = NID_undef; crypto/evp/evp_lib.c:206:16: return from call to `OBJ_nid2obj` 204. default: 205. /* Check it has an OID and it is valid */ 206. otmp = OBJ_nid2obj(nid); ^ 207. if (OBJ_get0_data(otmp) == NULL) 208. nid = NID_undef; crypto/evp/evp_lib.c:206:9: assigned 204. default: 205. /* Check it has an OID and it is valid */ 206. otmp = OBJ_nid2obj(nid); ^ 207. if (OBJ_get0_data(otmp) == NULL) 208. nid = NID_undef; crypto/evp/evp_lib.c:209:9: when calling `ASN1_OBJECT_free` here 207. if (OBJ_get0_data(otmp) == NULL) 208. nid = NID_undef; 209. ASN1_OBJECT_free(otmp); ^ 210. return nid; 211. } crypto/asn1/a_object.c:380:1: parameter `a` of ASN1_OBJECT_free 378. } 379. 380. > void ASN1_OBJECT_free(ASN1_OBJECT *a) 381. { 382. if (a == NULL) crypto/asn1/a_object.c:399:9: when calling `CRYPTO_free` here 397. } 398. if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC) 399. OPENSSL_free(a); ^ 400. } 401. crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: was invalidated by call to `free()` 243. } 244. #else 245. free(str); ^ 246. #endif 247. } crypto/asn1/p5_pbev2.c:101:15: use-after-lifetime part of the trace starts here 99. ASN1_OBJECT *obj; 100. 101. alg_nid = EVP_CIPHER_type(cipher); ^ 102. if (alg_nid == NID_undef) { 103. ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, crypto/asn1/p5_pbev2.c:101:15: global variable `nid_objs` accessed here 99. ASN1_OBJECT *obj; 100. 101. alg_nid = EVP_CIPHER_type(cipher); ^ 102. if (alg_nid == NID_undef) { 103. ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, crypto/asn1/p5_pbev2.c:107:11: when calling `OBJ_nid2obj` here 105. goto err; 106. } 107. obj = OBJ_nid2obj(alg_nid); ^ 108. 109. if ((pbe2 = PBE2PARAM_new()) == NULL) crypto/objects/obj_dat.c:299:34: global variable `nid_objs` accessed here 297. 298. if ((n >= 0) && (n < NUM_NID)) { 299. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) { ^ 300. OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID); 301. return (NULL); crypto/objects/obj_dat.c:299:34: invalid access occurs here 297. 298. if ((n >= 0) && (n < NUM_NID)) { 299. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) { ^ 300. OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID); 301. return (NULL);
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/objects/obj_dat.c/#L299
d2a_code_trace_data_44026
void avfilter_unref_buffer(AVFilterBufferRef *ref) { if(!(--ref->buf->refcount)) ref->buf->free(ref->buf); av_free(ref->video); av_free(ref); } libavfilter/avfilter.c:292: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer`. libavfilter/avfilter.c:292:9: Call 290. * a copied version dues to permission issues */ 291. if(link->src_buf) { 292. avfilter_unref_buffer(link->src_buf); ^ 293. link->src_buf = NULL; 294. } libavfilter/avfilter.c:61:1: <LHS trace> 59. } 60. 61. void avfilter_unref_buffer(AVFilterBufferRef *ref) ^ 62. { 63. if(!(--ref->buf->refcount)) libavfilter/avfilter.c:61:1: Parameter `ref->buf->refcount` 59. } 60. 61. void avfilter_unref_buffer(AVFilterBufferRef *ref) ^ 62. { 63. if(!(--ref->buf->refcount)) libavfilter/avfilter.c:63:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avfilter_unref_buffer` 61. void avfilter_unref_buffer(AVFilterBufferRef *ref) 62. { 63. if(!(--ref->buf->refcount)) ^ 64. ref->buf->free(ref->buf); 65. av_free(ref->video);
https://github.com/libav/libav/blob/ad0d70c964f852a18e9ab8124f0e7aa8876cac6e/libavfilter/avfilter.c/#L63
d2a_code_trace_data_44027
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); r->neg = a->neg; lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } test/dhtest.c:60: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `DH_check`. Showing all 16 steps of the trace test/dhtest.c:56:17: Call 54. BN_GENCB_set(_cb, &cb, NULL); 55. if (!TEST_ptr(a = DH_new()) 56. || !TEST_true(DH_generate_parameters_ex(a, 64, ^ 57. DH_GENERATOR_5, _cb))) 58. goto err; crypto/dh/dh_gen.c:23:1: Parameter `ret->p->top` 21. BN_GENCB *cb); 22. 23. > int DH_generate_parameters_ex(DH *ret, int prime_len, int generator, 24. BN_GENCB *cb) 25. { test/dhtest.c:60:10: Call 58. goto err; 59. 60. if (!DH_check(a, &i)) ^ 61. goto err; 62. if (!TEST_false(i & DH_CHECK_P_NOT_PRIME) crypto/dh/dh_check.c:65:1: Parameter `dh->p->top` 63. */ 64. 65. > int DH_check(const DH *dh, int *ret) 66. { 67. int ok = 0, r; crypto/dh/dh_check.c:102:14: Call 100. *ret |= DH_CHECK_Q_NOT_PRIME; 101. /* Check p == 1 mod q i.e. q divides p - 1 */ 102. if (!BN_div(t1, t2, dh->p, dh->q, ctx)) ^ 103. goto err; 104. if (!BN_is_one(t2)) crypto/bn/bn_div.c:140:1: Parameter `num->top` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/bn/bn_div.c:210:11: Call 208. sdiv->neg = 0; 209. norm_shift += BN_BITS2; 210. if (!(BN_lshift(snum, num, norm_shift))) ^ 211. goto err; 212. snum->neg = 0; crypto/bn/bn_shift.c:83:1: <Offset trace> 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:83:1: Parameter `n` 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:5: Assignment 95. } 96. 97. nw = n / BN_BITS2; ^ 98. if (bn_wexpand(r, a->top + nw + 1) == NULL) 99. return (0); crypto/bn/bn_shift.c:83:1: <Length trace> 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:83:1: Parameter `*r->d` 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:98:9: Call 96. 97. nw = n / BN_BITS2; 98. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 99. return (0); 100. r->neg = a->neg; crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_shift.c:104:5: Assignment 102. rb = BN_BITS2 - lb; 103. f = a->d; 104. t = r->d; ^ 105. t[a->top + nw] = 0; 106. if (lb == 0) crypto/bn/bn_shift.c:112:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `DH_check` 110. for (i = a->top - 1; i >= 0; i--) { 111. l = f[i]; 112. t[nw + i + 1] |= (l >> rb) & BN_MASK2; ^ 113. t[nw + i] = (l << lb) & BN_MASK2; 114. }
https://github.com/openssl/openssl/blob/dc99b885ded3cbc586d5ffec779f0e75a269bda3/crypto/bn/bn_shift.c/#L112
d2a_code_trace_data_44028
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/record/rec_layer_s3.c:1420: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `SSL_CTX_remove_session`. Showing all 11 steps of the trace ssl/record/rec_layer_s3.c:994:1: Parameter `s->initial_ctx->sessions->num_items` 992. * none of our business 993. */ 994. > int ssl3_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, 995. size_t len, int peek, size_t *readbytes) 996. { ssl/record/rec_layer_s3.c:1420:13: Call 1418. s->shutdown |= SSL_RECEIVED_SHUTDOWN; 1419. SSL3_RECORD_set_read(rr); 1420. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1421. return 0; 1422. } 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:598:1: Parameter `lh->num_items` 596. }; 597. 598. > DEFINE_LHASH_OF(SSL_SESSION); 599. /* Needed in ssl_cert.c */ 600. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:598:1: Call 596. }; 597. 598. > DEFINE_LHASH_OF(SSL_SESSION); 599. /* Needed in ssl_cert.c */ 600. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `SSL_CTX_remove_session` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_44029
static void decode(Real288_internal *glob, unsigned int input) { unsigned int x,y; float f; double sum,sumsum; float *p1,*p2; float buffer[5]; const float *table; for (x=36;x--;glob->sb[x+5]=glob->sb[x]); for (x=5;x--;) { p1=glob->sb+x;p2=glob->pr1; for (sum=0,y=36;y--;sum-=(*(++p1))*(*(p2++))); glob->sb[x]=sum; } f=amptable[input&7]; table=codetable+(input>>3)*5; for (sum=32,x=10;x--;sum-=glob->pr2[x]*glob->lhist[x]); if (sum<0) sum=0; else if (sum>60) sum=60; sumsum=exp(sum*0.1151292546497)*f; for (sum=0,x=5;x--;) { buffer[x]=table[x]*sumsum; sum+=buffer[x]*buffer[x]; } if ((sum/=5)<1) sum=1; for (x=10;--x;glob->lhist[x]=glob->lhist[x-1]); *glob->lhist=glob->history[glob->phase]=10*log10(sum)-32; for (x=1;x<5;x++) for (y=x;y--;buffer[x]-=glob->pr1[x-y-1]*buffer[y]); for (x=0;x<5;x++) { f=glob->sb[4-x]+buffer[x]; if (f>4095) f=4095; else if (f<-4095) f=-4095; glob->output[glob->phasep+x]=glob->sb[4-x]=f; } } libavcodec/ra288.c:126: error: Uninitialized Value The value read from buffer[_] was never initialized. libavcodec/ra288.c:126:5: 124. /* output */ 125. for (x=0;x<5;x++) { 126. f=glob->sb[4-x]+buffer[x]; ^ 127. if (f>4095) f=4095; else if (f<-4095) f=-4095; 128. glob->output[glob->phasep+x]=glob->sb[4-x]=f;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra288.c/#L126
d2a_code_trace_data_44030
int RAND_bytes(unsigned char *buf, int num) { const RAND_METHOD *meth = RAND_get_rand_method(); if (meth->bytes != NULL) return meth->bytes(buf, num); RANDerr(RAND_F_RAND_BYTES, RAND_R_FUNC_NOT_IMPLEMENTED); return -1; } crypto/rand/rand_lib.c:830: error: NULL_DEREFERENCE pointer `meth` last assigned on line 828 could be null and is dereferenced at line 830, column 9. Showing all 14 steps of the trace crypto/rand/rand_lib.c:826:1: start of procedure RAND_bytes() 824. } 825. 826. > int RAND_bytes(unsigned char *buf, int num) 827. { 828. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:828:5: 826. int RAND_bytes(unsigned char *buf, int num) 827. { 828. > const RAND_METHOD *meth = RAND_get_rand_method(); 829. 830. if (meth->bytes != NULL) crypto/rand/rand_lib.c:732:1: start of procedure RAND_get_rand_method() 730. } 731. 732. > const RAND_METHOD *RAND_get_rand_method(void) 733. { 734. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:734:5: 732. const RAND_METHOD *RAND_get_rand_method(void) 733. { 734. > const RAND_METHOD *tmp_meth = NULL; 735. 736. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:736:10: 734. const RAND_METHOD *tmp_meth = NULL; 735. 736. > if (!RUN_ONCE(&rand_init, do_rand_init)) 737. return NULL; 738. crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once() 109. } 110. 111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:113:9: Taking true branch 111. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) ^ 114. return 0; 115. crypto/threads_pthread.c:114:9: 112. { 113. if (pthread_once(once, init) != 0) 114. > return 0; 115. 116. return 1; crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once 115. 116. return 1; 117. > } 118. 119. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/rand/rand_lib.c:736:10: Condition is false 734. const RAND_METHOD *tmp_meth = NULL; 735. 736. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 737. return NULL; 738. crypto/rand/rand_lib.c:736:10: Taking true branch 734. const RAND_METHOD *tmp_meth = NULL; 735. 736. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 737. return NULL; 738. crypto/rand/rand_lib.c:737:9: 735. 736. if (!RUN_ONCE(&rand_init, do_rand_init)) 737. > return NULL; 738. 739. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:760:1: return from a call to RAND_get_rand_method 758. CRYPTO_THREAD_unlock(rand_meth_lock); 759. return tmp_meth; 760. > } 761. 762. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:830:9: 828. const RAND_METHOD *meth = RAND_get_rand_method(); 829. 830. > if (meth->bytes != NULL) 831. return meth->bytes(buf, num); 832. RANDerr(RAND_F_RAND_BYTES, RAND_R_FUNC_NOT_IMPLEMENTED);
https://github.com/openssl/openssl/blob/95658c32436017aeeef3d8598957071baf6769a9/crypto/rand/rand_lib.c/#L830
d2a_code_trace_data_44031
static ossl_inline size_t constant_time_is_zero_s(size_t a) { return constant_time_msb_s(~a & (a - 1)); } test/constant_time_test.c:80: error: INTEGER_OVERFLOW_L1 (0 - 1):unsigned64 by call to `constant_time_is_zero_s`. Showing all 5 steps of the trace test/constant_time_test.c:78:1: Parameter `a` 76. } 77. 78. > static int test_is_zero_s(unsigned int a) 79. { 80. if (a == 0 && !TEST_size_t_eq(constant_time_is_zero_s(a), CONSTTIME_TRUE_S)) test/constant_time_test.c:80:20: Call 78. static int test_is_zero_s(unsigned int a) 79. { 80. if (a == 0 && !TEST_size_t_eq(constant_time_is_zero_s(a), CONSTTIME_TRUE_S)) ^ 81. return 0; 82. if (a != 0 && !TEST_uint_eq(constant_time_is_zero_s(a), CONSTTIME_FALSE_S)) include/internal/constant_time_locl.h:155:1: <LHS trace> 153. } 154. 155. > static ossl_inline size_t constant_time_is_zero_s(size_t a) 156. { 157. return constant_time_msb_s(~a & (a - 1)); include/internal/constant_time_locl.h:155:1: Parameter `a` 153. } 154. 155. > static ossl_inline size_t constant_time_is_zero_s(size_t a) 156. { 157. return constant_time_msb_s(~a & (a - 1)); include/internal/constant_time_locl.h:157:12: Binary operation: (0 - 1):unsigned64 by call to `constant_time_is_zero_s` 155. static ossl_inline size_t constant_time_is_zero_s(size_t a) 156. { 157. return constant_time_msb_s(~a & (a - 1)); ^ 158. } 159.
https://github.com/openssl/openssl/blob/f3ab6c16c424054c8d6d2c152744dcbaf41c3232/include/internal/constant_time_locl.h/#L157
d2a_code_trace_data_44032
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:217: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rshift`. Showing all 14 steps of the trace crypto/ec/ecdsa_ossl.c:212:10: Call 210. if (8 * dgst_len > i) 211. dgst_len = (i + 7) / 8; 212. if (!BN_bin2bn(dgst, dgst_len, m)) { ^ 213. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); 214. goto err; crypto/bn/bn_lib.c:372:1: Parameter `*ret->d` 370. } 371. 372. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) 373. { 374. unsigned int i, m; crypto/ec/ecdsa_ossl.c:217:32: Call 215. } 216. /* If still too long, truncate remaining bits with a shift */ 217. if ((8 * dgst_len > i) && !BN_rshift(m, m, 8 - (i & 0x7))) { ^ 218. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); 219. goto err; crypto/bn/bn_shift.c:122:1: Parameter `*r->d` 120. } 121. 122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 123. { 124. int i, j, nw, lb, rb; crypto/bn/bn_shift.c:145:13: Call 143. i = (BN_num_bits(a) - n + (BN_BITS2 - 1)) / BN_BITS2; 144. if (r != a) { 145. if (bn_wexpand(r, i) == NULL) ^ 146. return 0; 147. r->neg = a->neg; crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:245:1: Parameter `*b->d` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `*b->d` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rshift` 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_44033
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/record/rec_layer_s3.c:1049: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_get_record`. Showing all 15 steps of the trace ssl/record/rec_layer_s3.c:969:1: Parameter `s->initial_ctx->sessions->num_items` 967. * none of our business 968. */ 969. > int ssl3_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, 970. int len, int peek) 971. { ssl/record/rec_layer_s3.c:1049:19: Call 1047. /* get new records if necessary */ 1048. if (num_recs == 0) { 1049. ret = ssl3_get_record(s); ^ 1050. if (ret <= 0) 1051. return (ret); ssl/record/ssl3_record.c:126:1: Parameter `s->initial_ctx->sessions->num_items` 124. */ 125. /* used only by ssl3_read_bytes */ 126. > int ssl3_get_record(SSL *s) 127. { 128. int ssl_major, ssl_minor, al; ssl/record/ssl3_record.c:507:5: Call 505. 506. f_err: 507. ssl3_send_alert(s, SSL3_AL_FATAL, al); ^ 508. err: 509. return ret; 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_get_record` 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_44034
void TIFFReverseBits(uint8* cp, tmsize_t n) { for (; n > 8; n -= 8) { cp[0] = TIFFBitRevTable[cp[0]]; cp[1] = TIFFBitRevTable[cp[1]]; cp[2] = TIFFBitRevTable[cp[2]]; cp[3] = TIFFBitRevTable[cp[3]]; cp[4] = TIFFBitRevTable[cp[4]]; cp[5] = TIFFBitRevTable[cp[5]]; cp[6] = TIFFBitRevTable[cp[6]]; cp[7] = TIFFBitRevTable[cp[7]]; cp += 8; } while (n-- > 0) { *cp = TIFFBitRevTable[*cp]; cp++; } } contrib/addtiffo/tif_overview.c:912: error: Buffer Overrun L3 Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFDestroyOvrCache`. contrib/addtiffo/tif_overview.c:714:1: Parameter `hTIFF->tif_rawdata` 712. /************************************************************************/ 713. 714. void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList, ^ 715. int bUseSubIFDs, const char *pszResampleMethod, 716. int (*pfnProgress)( double, void * ), contrib/addtiffo/tif_overview.c:912:9: Call 910. for( i = 0; i < nOverviews; i++ ) 911. { 912. TIFFDestroyOvrCache( papoRawBIs[i] ); ^ 913. } 914. contrib/addtiffo/tif_ovrcache.c:326:1: Parameter `*psCache->hTIFF->tif_rawdata` 324. /************************************************************************/ 325. 326. void TIFFDestroyOvrCache( TIFFOvrCache * psCache ) ^ 327. 328. { contrib/addtiffo/tif_ovrcache.c:330:9: Call 328. { 329. while( psCache->nBlockOffset < psCache->nBlocksPerColumn ) 330. TIFFWriteOvrRow( psCache ); ^ 331. 332. _TIFFfree( psCache->pabyRow1Blocks ); contrib/addtiffo/tif_ovrcache.c:135:1: Parameter `*psCache->hTIFF->tif_rawdata` 133. /************************************************************************/ 134. 135. static void TIFFWriteOvrRow( TIFFOvrCache * psCache ) ^ 136. 137. { contrib/addtiffo/tif_ovrcache.c:255:5: Call 253. /* Restore access to original directory. */ 254. /* -------------------------------------------------------------------- */ 255. TIFFFlush( psCache->hTIFF ); ^ 256. /* TODO: add checks on error status return of TIFFFlush */ 257. TIFFSetSubDirectory( psCache->hTIFF, nBaseDirOffset ); libtiff/tif_flush.c:30:1: Parameter `*tif->tif_rawdata` 28. #include "tiffiop.h" 29. 30. int ^ 31. TIFFFlush(TIFF* tif) 32. { libtiff/tif_flush.c:81:13: Call 79. 80. if ((tif->tif_flags & (TIFF_DIRTYDIRECT|TIFF_DIRTYSTRIP)) 81. && !TIFFRewriteDirectory(tif)) ^ 82. return (0); 83. libtiff/tif_dirwrite.c:214:1: Parameter `*tif->tif_rawdata` 212. * previously used directory space. 213. */ 214. int ^ 215. TIFFRewriteDirectory( TIFF *tif ) 216. { libtiff/tif_dirwrite.c:221:10: Call 219. /* We don't need to do anything special if it hasn't been written. */ 220. if( tif->tif_diroff == 0 ) 221. return TIFFWriteDirectory( tif ); ^ 222. 223. /* libtiff/tif_dirwrite.c:178:1: Parameter `*tif->tif_rawdata` 176. * storage that's been changed. 177. */ 178. int ^ 179. TIFFWriteDirectory(TIFF* tif) 180. { libtiff/tif_dirwrite.c:181:9: Call 179. TIFFWriteDirectory(TIFF* tif) 180. { 181. return TIFFWriteDirectorySec(tif,TRUE,TRUE,NULL); ^ 182. } 183. libtiff/tif_dirwrite.c:360:1: Parameter `*tif->tif_rawdata` 358. } 359. 360. static int ^ 361. TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff) 362. { libtiff/tif_dirwrite.c:402:12: Call 400. && (tif->tif_flags & TIFF_BEENWRITING) != 0 ) 401. { 402. if( !TIFFFlushData1(tif) ) ^ 403. { 404. TIFFErrorExt(tif->tif_clientdata, module, libtiff/tif_write.c:788:1: Parameter `*tif->tif_rawdata` 786. * for infinite recursion. 787. */ 788. int ^ 789. TIFFFlushData1(TIFF* tif) 790. { libtiff/tif_write.c:794:4: Call 792. if (!isFillOrder(tif, tif->tif_dir.td_fillorder) && 793. (tif->tif_flags & TIFF_NOBITREV) == 0) 794. TIFFReverseBits((uint8*)tif->tif_rawdata, ^ 795. tif->tif_rawcc); 796. if (!TIFFAppendToStrip(tif, libtiff/tif_swab.c:283:1: <Length trace> 281. } 282. 283. void ^ 284. TIFFReverseBits(uint8* cp, tmsize_t n) 285. { libtiff/tif_swab.c:283:1: Parameter `*cp` 281. } 282. 283. void ^ 284. TIFFReverseBits(uint8* cp, tmsize_t n) 285. { libtiff/tif_swab.c:294:3: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFDestroyOvrCache` 292. cp[5] = TIFFBitRevTable[cp[5]]; 293. cp[6] = TIFFBitRevTable[cp[6]]; 294. cp[7] = TIFFBitRevTable[cp[7]]; ^ 295. cp += 8; 296. }
https://gitlab.com/libtiff/libtiff/blob/b9b93f661ed56fda222ce686a6e6ef03ee84bc3d/libtiff/tif_swab.c/#L294
d2a_code_trace_data_44035
static inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) { int nza, nzb; int ctx = 0; if( cat == 0 ) { nza = h->left_cbp&0x100; nzb = h-> top_cbp&0x100; } else if( cat == 1 || cat == 2 ) { nza = h->non_zero_count_cache[scan8[idx] - 1]; nzb = h->non_zero_count_cache[scan8[idx] - 8]; } else if( cat == 3 ) { nza = (h->left_cbp>>(6+idx))&0x01; nzb = (h-> top_cbp>>(6+idx))&0x01; } else { assert(cat == 4); nza = h->non_zero_count_cache[scan8[16+idx] - 1]; nzb = h->non_zero_count_cache[scan8[16+idx] - 8]; } if( nza > 0 ) ctx++; if( nzb > 0 ) ctx += 2; return ctx + 4 * cat; } libavcodec/h264.c:5997: error: Buffer Overrun L2 Offset: [16, 31] Size: 24 by call to `decode_cabac_residual`. libavcodec/h264.c:5995:22: Assignment 5993. if( cbp&15 ) { 5994. qmul = h->dequant4_coeff[0][s->qscale]; 5995. for( i = 0; i < 16; i++ ) { ^ 5996. //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 AC:%d\n", i ); 5997. decode_cabac_residual(h, h->mb + 16*i, 1, i, scan + 1, qmul, 15); libavcodec/h264.c:5997:21: Call 5995. for( i = 0; i < 16; i++ ) { 5996. //av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 AC:%d\n", i ); 5997. decode_cabac_residual(h, h->mb + 16*i, 1, i, scan + 1, qmul, 15); ^ 5998. } 5999. } else { libavcodec/h264.c:5371:1: Parameter `n` 5369. }; 5370. 5371. static void decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) { ^ 5372. const int mb_xy = h->s.mb_x + h->s.mb_y*h->s.mb_stride; 5373. static const int significant_coeff_flag_offset[2][6] = { libavcodec/h264.c:5431:49: Call 5429. /* read coded block flag */ 5430. if( cat != 5 ) { 5431. if( get_cabac( CC, &h->cabac_state[85 + get_cabac_cbf_ctx( h, cat, n ) ] ) == 0 ) { ^ 5432. if( cat == 1 || cat == 2 ) 5433. h->non_zero_count_cache[scan8[n]] = 0; libavcodec/h264.c:5336:1: <Offset trace> 5334. } 5335. 5336. static inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) { ^ 5337. int nza, nzb; 5338. int ctx = 0; libavcodec/h264.c:5336:1: Parameter `idx` 5334. } 5335. 5336. static inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) { ^ 5337. int nza, nzb; 5338. int ctx = 0; libavcodec/h264data.h:271:1: <Length trace> 269. */ 270. 271. static const uint8_t scan8[16 + 2*4]={ ^ 272. 4+1*8, 5+1*8, 4+2*8, 5+2*8, 273. 6+1*8, 7+1*8, 6+2*8, 7+2*8, libavcodec/h264data.h:271:1: Array declaration 269. */ 270. 271. static const uint8_t scan8[16 + 2*4]={ ^ 272. 4+1*8, 5+1*8, 4+2*8, 5+2*8, 273. 6+1*8, 7+1*8, 6+2*8, 7+2*8, libavcodec/h264.c:5351:39: Array access: Offset: [16, 31] Size: 24 by call to `decode_cabac_residual` 5349. } else { 5350. assert(cat == 4); 5351. nza = h->non_zero_count_cache[scan8[16+idx] - 1]; ^ 5352. nzb = h->non_zero_count_cache[scan8[16+idx] - 8]; 5353. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L5351
d2a_code_trace_data_44036
static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) { BIGNUM *n; BN_ULONG *ap, *np, *rp, n0, v, carry; int nl, max, i; n = &(mont->N); nl = n->top; if (nl == 0) { ret->top = 0; return (1); } max = (2 * nl); if (bn_wexpand(r, max) == NULL) return (0); r->neg ^= n->neg; np = n->d; rp = r->d; i = max - r->top; if (i) memset(&rp[r->top], 0, sizeof(*rp) * i); r->top = max; n0 = mont->n0[0]; for (carry = 0, i = 0; i < nl; i++, rp++) { v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2); v = (v + carry + rp[nl]) & BN_MASK2; carry |= (v != rp[nl]); carry &= (v <= rp[nl]); rp[nl] = v; } if (bn_wexpand(ret, nl) == NULL) return (0); ret->top = nl; ret->neg = r->neg; rp = ret->d; ap = &(r->d[nl]); # define BRANCH_FREE 1 # if BRANCH_FREE { BN_ULONG *nrp; size_t m; v = bn_sub_words(rp, ap, np, nl) - carry; m = (0 - (size_t)v); nrp = (BN_ULONG *)(((PTR_SIZE_INT) rp & ~m) | ((PTR_SIZE_INT) ap & m)); for (i = 0, nl -= 4; i < nl; i += 4) { BN_ULONG t1, t2, t3, t4; t1 = nrp[i + 0]; t2 = nrp[i + 1]; t3 = nrp[i + 2]; ap[i + 0] = 0; t4 = nrp[i + 3]; ap[i + 1] = 0; rp[i + 0] = t1; ap[i + 2] = 0; rp[i + 1] = t2; ap[i + 3] = 0; rp[i + 2] = t3; rp[i + 3] = t4; } for (nl += 4; i < nl; i++) rp[i] = nrp[i], ap[i] = 0; } # else if (bn_sub_words(rp, ap, np, nl) - carry) memcpy(rp, ap, nl * sizeof(BN_ULONG)); # endif bn_correct_top(r); bn_correct_top(ret); bn_check_top(ret); return (1); } test/bntest.c:384: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] (⇐ [0, +oo] + [1, +oo]) Size: [0, 8388607] by call to `BN_mod_mul_montgomery`. Showing all 13 steps of the trace test/bntest.c:383:5: Call 381. "D81FDC7C54E02B60262B241D53C040E99E45826ECA37A804668E690E1AFC1CA4" 382. "2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF"); 383. BN_MONT_CTX_set(mont, n, ctx); ^ 384. BN_mod_mul_montgomery(c, a, b, mont, ctx); 385. BN_mod_mul_montgomery(d, b, a, mont, ctx); crypto/bn/bn_mont.c:247:1: Parameter `mont->N.top` 245. } 246. 247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 248. { 249. int ret = 0; test/bntest.c:384:5: Call 382. "2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF"); 383. BN_MONT_CTX_set(mont, n, ctx); 384. BN_mod_mul_montgomery(c, a, b, mont, ctx); ^ 385. BN_mod_mul_montgomery(d, b, a, mont, ctx); 386. if (!TEST_BN_eq(c, d)) crypto/bn/bn_mont.c:26:1: Parameter `mont->N.top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:61:10: Call 59. /* reduce from aRR to aR */ 60. #ifdef MONT_WORD 61. if (!BN_from_montgomery_word(r, tmp, mont)) ^ 62. goto err; 63. #else crypto/bn/bn_mont.c:104:21: <Offset trace> 102. n0 = mont->n0[0]; 103. 104. for (carry = 0, i = 0; i < nl; i++, rp++) { ^ 105. v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2); 106. v = (v + carry + rp[nl]) & BN_MASK2; crypto/bn/bn_mont.c:104:21: Assignment 102. n0 = mont->n0[0]; 103. 104. for (carry = 0, i = 0; i < nl; i++, rp++) { ^ 105. v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2); 106. v = (v + carry + rp[nl]) & BN_MASK2; crypto/bn/bn_mont.c:75:1: <Length trace> 73. 74. #ifdef MONT_WORD 75. > static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) 76. { 77. BIGNUM *n; crypto/bn/bn_mont.c:75:1: Parameter `*r->d` 73. 74. #ifdef MONT_WORD 75. > static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) 76. { 77. BIGNUM *n; crypto/bn/bn_mont.c:89:9: Call 87. 88. max = (2 * nl); /* carry is stored separately */ 89. if (bn_wexpand(r, max) == NULL) ^ 90. return (0); 91. 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_mont.c:94:5: Assignment 92. r->neg ^= n->neg; 93. np = n->d; 94. rp = r->d; ^ 95. 96. /* clear the top words of T */ crypto/bn/bn_mont.c:106:26: Array access: Offset: [1, +oo] (⇐ [0, +oo] + [1, +oo]) Size: [0, 8388607] by call to `BN_mod_mul_montgomery` 104. for (carry = 0, i = 0; i < nl; i++, rp++) { 105. v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2); 106. v = (v + carry + rp[nl]) & BN_MASK2; ^ 107. carry |= (v != rp[nl]); 108. carry &= (v <= rp[nl]);
https://github.com/openssl/openssl/blob/3f97052392cb10fca5309212bf720685262ad4a6/crypto/bn/bn_mont.c/#L106
d2a_code_trace_data_44037
int OSSL_trace_enabled(int category) { int ret = 0; #ifndef OPENSSL_NO_TRACE category = ossl_trace_get_category(category); ret = trace_channels[category].bio != NULL; #endif return ret; } crypto/trace.c:434: error: BUFFER_OVERRUN_L3 Offset: [-1, 12] Size: 13. Showing all 7 steps of the trace crypto/trace.c:433:16: <Offset trace> 431. int ret = 0; 432. #ifndef OPENSSL_NO_TRACE 433. category = ossl_trace_get_category(category); ^ 434. ret = trace_channels[category].bio != NULL; 435. #endif crypto/trace.c:433:16: Call 431. int ret = 0; 432. #ifndef OPENSSL_NO_TRACE 433. category = ossl_trace_get_category(category); ^ 434. ret = trace_channels[category].bio != NULL; 435. #endif crypto/trace.c:422:9: Assignment 420. { 421. if (category < 0 || category >= OSSL_TRACE_CATEGORY_NUM) 422. return -1; ^ 423. if (trace_channels[category].bio != NULL) 424. return category; crypto/trace.c:433:5: Assignment 431. int ret = 0; 432. #ifndef OPENSSL_NO_TRACE 433. category = ossl_trace_get_category(category); ^ 434. ret = trace_channels[category].bio != NULL; 435. #endif crypto/trace.c:160:1: <Length trace> 158. 159. /* We use one trace channel for each trace category */ 160. > static struct { 161. enum { t_channel, t_callback } type; 162. BIO *bio; crypto/trace.c:160:1: Array declaration 158. 159. /* We use one trace channel for each trace category */ 160. > static struct { 161. enum { t_channel, t_callback } type; 162. BIO *bio; crypto/trace.c:434:11: Array access: Offset: [-1, 12] Size: 13 432. #ifndef OPENSSL_NO_TRACE 433. category = ossl_trace_get_category(category); 434. ret = trace_channels[category].bio != NULL; ^ 435. #endif 436. return ret;
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/trace.c/#L434
d2a_code_trace_data_44038
static ossl_inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } ssl/statem/statem_clnt.c:2213: error: INTEGER_OVERFLOW_L2 ([0, -3+max(5, `pkt->remaining`)] - [0, -3+max(5, `pkt->remaining`)]):unsigned64 by call to `PACKET_copy_bytes`. Showing all 10 steps of the trace ssl/statem/statem_clnt.c:2201:10: Call 2199. return 0; 2200. } 2201. if (!PACKET_get_net_3_len(pkt, &resplen) ^ 2202. || PACKET_remaining(pkt) != resplen) { 2203. *al = SSL_AD_DECODE_ERROR; ssl/packet_locl.h:205:8: Parameter `*data` 203. 204. /* Same as PACKET_get_net_3() but for a size_t */ 205. __owur static ossl_inline int PACKET_get_net_3_len(PACKET *pkt, size_t *data) ^ 206. { 207. unsigned long i; ssl/statem/statem_clnt.c:2213:10: Call 2211. return 0; 2212. } 2213. if (!PACKET_copy_bytes(pkt, s->ext.ocsp.resp, resplen)) { ^ 2214. *al = SSL_AD_DECODE_ERROR; 2215. SSLerr(SSL_F_TLS_PROCESS_CERT_STATUS_BODY, SSL_R_LENGTH_MISMATCH); ssl/packet_locl.h:379:8: Parameter `len` 377. * The caller is responsible for ensuring that |data| can hold |len| bytes. 378. */ 379. __owur static ossl_inline int PACKET_copy_bytes(PACKET *pkt, ^ 380. unsigned char *data, size_t len) 381. { ssl/packet_locl.h:385:5: Call 383. return 0; 384. 385. packet_forward(pkt, len); ^ 386. 387. 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, -3+max(5, pkt->remaining)] - [0, -3+max(5, pkt->remaining)]):unsigned64 by call to `PACKET_copy_bytes` 34. { 35. pkt->curr += len; 36. pkt->remaining -= len; ^ 37. } 38.
https://github.com/openssl/openssl/blob/f61c5ca6ca183bf0a51651857e3efb02a98889ad/ssl/packet_locl.h/#L36
d2a_code_trace_data_44039
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/wavpack.c:1008: error: Integer Overflow L2 ([1, +oo] - 32):unsigned32 by call to `bitstream_read`. libavcodec/wavpack.c:1008:34: Call 1006. s->extra_sc.size = size * 8; 1007. bitstream_init8(&s->bc_extra_bits, gb.buffer, size); 1008. s->crc_extra_bits = bitstream_read(&s->bc_extra_bits, 32); ^ 1009. bytestream2_skip(&gb, size); 1010. s->got_extra_bits = 1; libavcodec/bitstream.h:183:1: Parameter `n` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/bitstream.h:194:12: Call 192. } 193. 194. return get_val(bc, n); ^ 195. } 196. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([1, +oo] - 32):unsigned32 by call to `bitstream_read` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
d2a_code_trace_data_44040
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1292: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_mul`. Showing all 14 steps of the trace test/bntest.c:1292:10: Call 1290. goto err; 1291. 1292. if (!BN_mod_mul(ret, a, b, m, ctx) ^ 1293. || !equalBN("A * B (mod M)", mod_mul, ret)) 1294. goto err; crypto/bn/bn_mod.c:73:1: Parameter `ctx->stack.depth` 71. 72. /* slow but works */ 73. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 74. BN_CTX *ctx) 75. { crypto/bn/bn_mod.c:83:5: Call 81. bn_check_top(m); 82. 83. BN_CTX_start(ctx); ^ 84. if ((t = BN_CTX_get(ctx)) == NULL) 85. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c: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_sqr.c:32:5: Call 30. } 31. 32. BN_CTX_start(ctx); ^ 33. rr = (a != r) ? r : BN_CTX_get(ctx); 34. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_sqr.c:100:5: Call 98. bn_check_top(rr); 99. bn_check_top(tmp); 100. BN_CTX_end(ctx); ^ 101. return (ret); 102. } 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_mod_mul` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_44041
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; pkt->written += len; pkt->curr += len; return 1; } ssl/t1_reneg.c:57: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `WPACKET_start_sub_packet_len__`. Showing all 10 steps of the trace ssl/t1_reneg.c:56:17: Call 54. { 55. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate) 56. || !WPACKET_start_sub_packet_u16(pkt) ^ 57. || !WPACKET_start_sub_packet_u8(pkt) 58. || !WPACKET_memcpy(pkt, s->s3->previous_client_finished, ssl/packet.c:205:1: Parameter `pkt->buf->length` 203. } 204. 205. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 206. { 207. WPACKET_SUB *sub; 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:205:1: Parameter `pkt->written` 203. } 204. 205. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 206. { 207. WPACKET_SUB *sub; ssl/packet.c:229:10: Call 227. } 228. 229. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 230. return 0; 231. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */ ssl/packet.c:15:1: <LHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `pkt->buf->length` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: <RHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `len` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:25:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 6]):unsigned64 by call to `WPACKET_start_sub_packet_len__` 23. return 0; 24. 25. if (pkt->buf->length - pkt->written < len) { ^ 26. size_t newlen; 27. size_t reflen;
https://github.com/openssl/openssl/blob/7507e73d409b8f3046d6efcc3f4c0b6208b59b64/ssl/packet.c/#L25
d2a_code_trace_data_44042
ngx_int_t ngx_conf_full_name(ngx_cycle_t *cycle, ngx_str_t *name, ngx_uint_t conf_prefix) { size_t len; u_char *p, *prefix; ngx_str_t old; if (name->data[0] == '/') { return NGX_OK; } #if (NGX_WIN32) if (name->len > 2 && name->data[1] == ':' && ((name->data[0] >= 'a' && name->data[0] <= 'z') || (name->data[0] >= 'A' && name->data[0] <= 'Z'))) { return NGX_OK; } #endif old = *name; if (conf_prefix) { len = sizeof(NGX_CONF_PREFIX) - 1; prefix = (u_char *) NGX_CONF_PREFIX; } else { len = cycle->root.len; prefix = cycle->root.data; } name->len = len + old.len; name->data = ngx_pnalloc(cycle->pool, name->len + 1); if (name->data == NULL) { return NGX_ERROR; } p = ngx_cpymem(name->data, prefix, len); ngx_cpystrn(p, old.data, old.len + 1); return NGX_OK; } src/core/ngx_cycle.c:165: error: Buffer Overrun L3 Offset added: [17, 22] Size: [0, +oo] by call to `ngx_log_create_errlog`. src/core/ngx_cycle.c:90:5: Assignment 88. cycle->log = log; 89. cycle->old_cycle = old_cycle; 90. cycle->root.len = sizeof(NGX_PREFIX) - 1; ^ 91. cycle->root.data = (u_char *) NGX_PREFIX; 92. src/core/ngx_cycle.c:165:22: Call 163. 164. 165. cycle->new_log = ngx_log_create_errlog(cycle, NULL); ^ 166. if (cycle->new_log == NULL) { 167. ngx_destroy_pool(pool); src/core/ngx_log.c:225:1: Parameter `cycle->root.len` 223. 224. 225. ngx_log_t * ^ 226. ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_array_t *args) 227. { src/core/ngx_log.c:244:17: Call 242. } 243. 244. log->file = ngx_conf_open_file(cycle, name); ^ 245. if (log->file == NULL) { 246. return NULL; src/core/ngx_conf_file.c:841:1: Parameter `cycle->root.len` 839. 840. 841. ngx_open_file_t * ^ 842. ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) 843. { src/core/ngx_conf_file.c:857:13: Call 855. full = *name; 856. 857. if (ngx_conf_full_name(cycle, &full, 0) != NGX_OK) { ^ 858. return NULL; 859. } src/core/ngx_conf_file.c:820:9: <Offset trace> 818. 819. if (conf_prefix) { 820. len = sizeof(NGX_CONF_PREFIX) - 1; ^ 821. prefix = (u_char *) NGX_CONF_PREFIX; 822. src/core/ngx_conf_file.c:820:9: Assignment 818. 819. if (conf_prefix) { 820. len = sizeof(NGX_CONF_PREFIX) - 1; ^ 821. prefix = (u_char *) NGX_CONF_PREFIX; 822. src/core/ngx_conf_file.c:828:5: <Length trace> 826. } 827. 828. name->len = len + old.len; ^ 829. name->data = ngx_pnalloc(cycle->pool, name->len + 1); 830. if (name->data == NULL) { src/core/ngx_conf_file.c:828:5: Assignment 826. } 827. 828. name->len = len + old.len; ^ 829. name->data = ngx_pnalloc(cycle->pool, name->len + 1); 830. if (name->data == NULL) { src/core/ngx_conf_file.c:829:18: Call 827. 828. name->len = len + old.len; 829. name->data = ngx_pnalloc(cycle->pool, name->len + 1); ^ 830. if (name->data == NULL) { 831. return NGX_ERROR; src/core/ngx_palloc.c:155:13: Assignment 153. 154. do { 155. m = p->d.last; ^ 156. 157. if ((size_t) (p->d.end - m) >= size) { src/core/ngx_palloc.c:160:17: Assignment 158. p->d.last = m + size; 159. 160. return m; ^ 161. } 162. src/core/ngx_conf_file.c:829:5: Assignment 827. 828. name->len = len + old.len; 829. name->data = ngx_pnalloc(cycle->pool, name->len + 1); ^ 830. if (name->data == NULL) { 831. return NGX_ERROR; src/core/ngx_conf_file.c:834:9: Array access: Offset added: [17, 22] Size: [0, +oo] by call to `ngx_log_create_errlog` 832. } 833. 834. p = ngx_cpymem(name->data, prefix, len); ^ 835. ngx_cpystrn(p, old.data, old.len + 1); 836.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_conf_file.c/#L834
d2a_code_trace_data_44043
static void tls1_lookup_sigalg(int *phash_nid, int *psign_nid, int *psignhash_nid, const unsigned char *data) { int sign_nid, hash_nid; if (!phash_nid && !psign_nid && !psignhash_nid) return; if (phash_nid || psignhash_nid) { hash_nid = tls12_find_nid(data[0], tls12_md, sizeof(tls12_md)/sizeof(tls12_lookup)); if (phash_nid) *phash_nid = hash_nid; } if (psign_nid || psignhash_nid) { sign_nid = tls12_find_nid(data[1], tls12_sig, sizeof(tls12_sig)/sizeof(tls12_lookup)); if (psign_nid) *psign_nid = sign_nid; } if (psignhash_nid) { if (sign_nid && hash_nid) OBJ_find_sigid_by_algs(psignhash_nid, hash_nid, sign_nid); else *psignhash_nid = NID_undef; } } ssl/t1_lib.c:2921: error: UNINITIALIZED_VALUE The value read from hash_nid was never initialized. Showing all 1 steps of the trace ssl/t1_lib.c:2921:19: 2919. if (psignhash_nid) 2920. { 2921. > if (sign_nid && hash_nid) 2922. OBJ_find_sigid_by_algs(psignhash_nid, 2923. hash_nid, sign_nid);
https://github.com/openssl/openssl/blob/be681e123c3582f7bef18ed41b5ffa4793e8c4f7/ssl/t1_lib.c/#L2921
d2a_code_trace_data_44044
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:324: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/sslapitest.c:295:10: Call 293. 294. /* Now do a handshake and check that the logs have been written to. */ 295. if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, ^ 296. &clientssl, NULL, NULL)) 297. || !TEST_true(create_ssl_connection(serverssl, clientssl, 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:324:5: Call 322. 323. end: 324. SSL_free(serverssl); ^ 325. SSL_free(clientssl); 326. 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_44045
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:154: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 16 steps of the trace test/cipherlist_test.c:131:11: Call 129. uint32_t expected_cipher_id, cipher_id; 130. 131. ssl = SSL_new(ctx); ^ 132. TEST_check(ssl != NULL); 133. 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/cipherlist_test.c:154:5: Call 152. err: 153. sk_SSL_CIPHER_free(ciphers); 154. SSL_free(ssl); ^ 155. return ret; 156. } 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_44046
int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type) { if(s->me_method>=ME_EPZS){ int score[8]; int i, y, range= s->avctx->me_range ? s->avctx->me_range : (INT_MAX/2); uint8_t * fcode_tab= s->fcode_tab; int best_fcode=-1; int best_score=-10000000; if(s->msmpeg4_version) range= FFMIN(range, 16); else if(s->codec_id == CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) range= FFMIN(range, 256); for(i=0; i<8; i++) score[i]= s->mb_num*(8-i); for(y=0; y<s->mb_height; y++){ int x; int xy= y*s->mb_stride; for(x=0; x<s->mb_width; x++){ if(s->mb_type[xy] & type){ int mx= mv_table[xy][0]; int my= mv_table[xy][1]; int fcode= FFMAX(fcode_tab[mx + MAX_MV], fcode_tab[my + MAX_MV]); int j; if(mx >= range || mx < -range || my >= range || my < -range) continue; for(j=0; j<fcode && j<8; j++){ if(s->pict_type==FF_B_TYPE || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy]) score[j]-= 170; } } xy++; } } for(i=1; i<8; i++){ if(score[i] > best_score){ best_score= score[i]; best_fcode= i; } } return best_fcode; }else{ return 1; } } libavcodec/motion_est.c:2039: error: Uninitialized Value The value read from score[_] was never initialized. libavcodec/motion_est.c:2039:17: 2037. for(i=1; i<8; i++){ 2038. if(score[i] > best_score){ 2039. best_score= score[i]; ^ 2040. best_fcode= i; 2041. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L2039
d2a_code_trace_data_44047
static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, int max) { const unsigned char *p = *pp; unsigned long ret = 0; unsigned int i; if (max-- < 1) return (0); if (*p == 0x80) { *inf = 1; ret = 0; p++; } else { *inf = 0; i = *p & 0x7f; if (*(p++) & 0x80) { if (max < (int)i) return 0; while (i && *p == 0) { p++; i--; } if (i > sizeof(long)) return 0; while (i-- > 0) { ret <<= 8L; ret |= *(p++); } } else ret = i; } if (ret > LONG_MAX) return 0; *pp = p; *rl = (long)ret; return (1); } ssl/t1_lib.c:3134: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, +oo] by call to `d2i_SSL_SESSION`. Showing all 33 steps of the trace ssl/t1_lib.c:3117:22: Call 3115. /* Move p after IV to start of encrypted ticket, update length */ 3116. p = etick + 16 + EVP_CIPHER_CTX_iv_length(ctx); 3117. eticklen -= 16 + EVP_CIPHER_CTX_iv_length(ctx); ^ 3118. sdec = OPENSSL_malloc(eticklen); 3119. if (sdec == NULL crypto/evp/evp_lib.c:277:1: Parameter `ctx->cipher->iv_len` 275. } 276. 277. > int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) 278. { 279. return ctx->cipher->iv_len; crypto/evp/evp_lib.c:279:5: Assignment 277. int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) 278. { 279. return ctx->cipher->iv_len; ^ 280. } 281. ssl/t1_lib.c:3117:5: Assignment 3115. /* Move p after IV to start of encrypted ticket, update length */ 3116. p = etick + 16 + EVP_CIPHER_CTX_iv_length(ctx); 3117. eticklen -= 16 + EVP_CIPHER_CTX_iv_length(ctx); ^ 3118. sdec = OPENSSL_malloc(eticklen); 3119. if (sdec == NULL ssl/t1_lib.c:3118:12: Call 3116. p = etick + 16 + EVP_CIPHER_CTX_iv_length(ctx); 3117. eticklen -= 16 + EVP_CIPHER_CTX_iv_length(ctx); 3118. sdec = OPENSSL_malloc(eticklen); ^ 3119. if (sdec == NULL 3120. || EVP_DecryptUpdate(ctx, sdec, &slen, p, eticklen) <= 0) { crypto/mem.c:125:9: Assignment 123. 124. if (num <= 0) 125. return NULL; ^ 126. 127. allow_customize = 0; ssl/t1_lib.c:3118:5: Assignment 3116. p = etick + 16 + EVP_CIPHER_CTX_iv_length(ctx); 3117. eticklen -= 16 + EVP_CIPHER_CTX_iv_length(ctx); 3118. sdec = OPENSSL_malloc(eticklen); ^ 3119. if (sdec == NULL 3120. || EVP_DecryptUpdate(ctx, sdec, &slen, p, eticklen) <= 0) { ssl/t1_lib.c:3132:5: Assignment 3130. EVP_CIPHER_CTX_free(ctx); 3131. ctx = NULL; 3132. p = sdec; ^ 3133. 3134. sess = d2i_SSL_SESSION(NULL, &p, slen); ssl/t1_lib.c:3134:12: Call 3132. p = sdec; 3133. 3134. sess = d2i_SSL_SESSION(NULL, &p, slen); ^ 3135. OPENSSL_free(sdec); 3136. if (sess) { ssl/ssl_asn1.c:288:1: Parameter `**pp` 286. } 287. 288. > SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, 289. long length) 290. { ssl/ssl_asn1.c:293:5: Assignment 291. long id; 292. unsigned int tmpl; 293. const unsigned char *p = *pp; ^ 294. SSL_SESSION_ASN1 *as = NULL; 295. SSL_SESSION *ret = NULL; ssl/ssl_asn1.c:297:10: Call 295. SSL_SESSION *ret = NULL; 296. 297. as = d2i_SSL_SESSION_ASN1(NULL, &p, length); ^ 298. /* ASN.1 code returns suitable error */ 299. if (as == NULL) ssl/ssl_asn1.c:143:1: Parameter `**in` 141. } static_ASN1_SEQUENCE_END(SSL_SESSION_ASN1) 142. 143. > IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(SSL_SESSION_ASN1) 144. 145. /* Utility functions for i2d_SSL_SESSION */ ssl/ssl_asn1.c:143:1: Call 141. } static_ASN1_SEQUENCE_END(SSL_SESSION_ASN1) 142. 143. > IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(SSL_SESSION_ASN1) 144. 145. /* Utility functions for i2d_SSL_SESSION */ crypto/asn1/tasn_dec.c:144:1: Parameter `**in` 142. */ 143. 144. > ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval, 145. const unsigned char **in, long len, 146. const ASN1_ITEM *it) crypto/asn1/tasn_dec.c:153:9: Call 151. pval = &ptmpval; 152. asn1_tlc_clear_nc(&c); 153. if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0) ^ 154. return *pval; 155. return NULL; crypto/asn1/tasn_dec.c:158:1: Parameter `**in` 156. } 157. 158. > int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, 159. const ASN1_ITEM *it, 160. int tag, int aclass, char opt, ASN1_TLC *ctx) crypto/asn1/tasn_dec.c:163:10: Call 161. { 162. int rv; 163. rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx); ^ 164. if (rv <= 0) 165. ASN1_item_ex_free(pval, it); crypto/asn1/tasn_dec.c:174:1: Parameter `**in` 172. */ 173. 174. > static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in, 175. long len, const ASN1_ITEM *it, 176. int tag, int aclass, char opt, ASN1_TLC *ctx) crypto/asn1/tasn_dec.c:218:9: Assignment 216. 217. case ASN1_ITYPE_MSTRING: 218. p = *in; ^ 219. /* Just read in tag and class */ 220. ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, crypto/asn1/tasn_dec.c:220:15: Call 218. p = *in; 219. /* Just read in tag and class */ 220. ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, ^ 221. &p, len, -1, 0, 1, ctx); 222. if (!ret) { crypto/asn1/tasn_dec.c:1098:1: Parameter `**in` 1096. */ 1097. 1098. > static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, 1099. char *inf, char *cst, 1100. const unsigned char **in, long len, crypto/asn1/tasn_dec.c:1107:5: Assignment 1105. long plen; 1106. const unsigned char *p, *q; 1107. p = *in; ^ 1108. q = p; 1109. crypto/asn1/tasn_dec.c:1117:13: Call 1115. p += ctx->hdrlen; 1116. } else { 1117. i = ASN1_get_object(&p, &plen, &ptag, &pclass, len); ^ 1118. if (ctx) { 1119. ctx->ret = i; crypto/asn1/asn1_lib.c:92:1: Parameter `**pp` 90. } 91. 92. > int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, 93. int *pclass, long omax) 94. { crypto/asn1/asn1_lib.c:97:5: Assignment 95. int i, ret; 96. long l; 97. const unsigned char *p = *pp; ^ 98. int tag, xclass, inf; 99. long max = omax; crypto/asn1/asn1_lib.c:126:9: Assignment 124. } else { 125. tag = i; 126. p++; ^ 127. if (--max == 0) 128. goto err; crypto/asn1/asn1_lib.c:132:10: Call 130. *ptag = tag; 131. *pclass = xclass; 132. if (!asn1_get_length(&p, &inf, plength, (int)max)) ^ 133. goto err; 134. crypto/asn1/asn1_lib.c:153:1: <Length trace> 151. } 152. 153. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, 154. int max) 155. { crypto/asn1/asn1_lib.c:153:1: Parameter `**pp` 151. } 152. 153. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, 154. int max) 155. { crypto/asn1/asn1_lib.c:156:5: Assignment 154. int max) 155. { 156. const unsigned char *p = *pp; ^ 157. unsigned long ret = 0; 158. unsigned int i; crypto/asn1/asn1_lib.c:169:15: Assignment 167. *inf = 0; 168. i = *p & 0x7f; 169. if (*(p++) & 0x80) { ^ 170. if (max < (int)i) 171. return 0; crypto/asn1/asn1_lib.c:173:25: Array access: Offset: [2, +oo] Size: [1, +oo] by call to `d2i_SSL_SESSION` 171. return 0; 172. /* Skip leading zeroes */ 173. while (i && *p == 0) { ^ 174. p++; 175. i--;
https://github.com/openssl/openssl/blob/846ec07d904f9cc81d486db0db14fb84f61ff6e5/crypto/asn1/asn1_lib.c/#L173
d2a_code_trace_data_44048
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } crypto/bn/bn_mont.c:56: error: BUFFER_OVERRUN_S2 Offset: [max(16, `a->top`), `a->top`] (⇐ 1 + [-1+max(16, `a->top`), `a->top` - 1]) Size: [0, 8388607] by call to `BN_sqr`. Showing all 14 steps of the trace crypto/bn/bn_mont.c:26:1: Parameter `b->top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:56:14: Call 54. bn_check_top(tmp); 55. if (a == b) { 56. if (!BN_sqr(tmp, a, ctx)) ^ 57. goto err; 58. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:99:1: <Offset trace> 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:99:1: Parameter `n` 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:110:5: Assignment 108. rp[0] = rp[max - 1] = 0; 109. rp++; 110. j = n; ^ 111. 112. if (--j > 0) { crypto/bn/bn_sqr.c:112:9: Assignment 110. j = n; 111. 112. if (--j > 0) { ^ 113. ap++; 114. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:99:1: <Length trace> 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:99:1: Parameter `*r` 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:107:5: Assignment 105. max = n * 2; 106. ap = a; 107. rp = r; ^ 108. rp[0] = rp[max - 1] = 0; 109. rp++; crypto/bn/bn_sqr.c:109:5: Assignment 107. rp = r; 108. rp[0] = rp[max - 1] = 0; 109. rp++; ^ 110. j = n; 111. crypto/bn/bn_sqr.c:114:9: Array access: Offset: [max(16, a->top), a->top] (⇐ 1 + [-1+max(16, a->top), a->top - 1]) Size: [0, 8388607] by call to `BN_sqr` 112. if (--j > 0) { 113. ap++; 114. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 115. rp += 2; 116. }
https://github.com/openssl/openssl/blob/305b68f1a2b6d4d0aa07a6ab47ac372f067a40bb/crypto/bn/bn_sqr.c/#L114
d2a_code_trace_data_44049
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_eay.c:693: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked`. Showing all 26 steps of the trace crypto/rsa/rsa_eay.c:665:2: Call 663. 664. if((ctx = BN_CTX_new()) == NULL) goto err; 665. BN_CTX_start(ctx); ^ 666. f = BN_CTX_get(ctx); 667. 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:693:8: Call 691. 692. if (rsa->flags & RSA_FLAG_CACHE_PUBLIC) 693. if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_n, CRYPTO_LOCK_RSA, rsa->n, ctx)) ^ 694. goto err; 695. crypto/bn/bn_mont.c:478:1: Parameter `ctx->stack.depth` 476. } 477. 478. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, 479. const BIGNUM *mod, BN_CTX *ctx) 480. { crypto/bn/bn_mont.c:494:16: Call 492. { 493. ret = BN_MONT_CTX_new(); 494. if (ret && !BN_MONT_CTX_set(ret, mod, ctx)) ^ 495. BN_MONT_CTX_free(ret); 496. else 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_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/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/bn/bn_ctx.c/#L353
d2a_code_trace_data_44050
static int val_in_array(const int *arr, int len, int val) { int i; for (i = 0; i < len; i++) if (arr[i] == val) return 1; return 0; } libavcodec/extract_extradata_bsf.c:85: error: Buffer Overrun L3 Offset: [0, 2] Size: [2, 3] by call to `val_in_array`. libavcodec/extract_extradata_bsf.c:72:9: Assignment 70. if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) { 71. extradata_nal_types = extradata_nal_types_hevc; 72. nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_hevc); ^ 73. } else { 74. extradata_nal_types = extradata_nal_types_h264; libavcodec/extract_extradata_bsf.c:85:13: Call 83. for (i = 0; i < h2645_pkt.nb_nals; i++) { 84. H2645NAL *nal = &h2645_pkt.nals[i]; 85. if (val_in_array(extradata_nal_types, nb_extradata_nal_types, nal->type)) { ^ 86. extradata_size += nal->raw_size + 3; 87. if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) { libavcodec/extract_extradata_bsf.c:43:1: <Offset trace> 41. } ExtractExtradataContext; 42. 43. static int val_in_array(const int *arr, int len, int val) ^ 44. { 45. int i; libavcodec/extract_extradata_bsf.c:43:1: Parameter `len` 41. } ExtractExtradataContext; 42. 43. static int val_in_array(const int *arr, int len, int val) ^ 44. { 45. int i; libavcodec/extract_extradata_bsf.c:43:1: <Length trace> 41. } ExtractExtradataContext; 42. 43. static int val_in_array(const int *arr, int len, int val) ^ 44. { 45. int i; libavcodec/extract_extradata_bsf.c:43:1: Parameter `*arr` 41. } ExtractExtradataContext; 42. 43. static int val_in_array(const int *arr, int len, int val) ^ 44. { 45. int i; libavcodec/extract_extradata_bsf.c:47:13: Array access: Offset: [0, 2] Size: [2, 3] by call to `val_in_array` 45. int i; 46. for (i = 0; i < len; i++) 47. if (arr[i] == val) ^ 48. return 1; 49. return 0;
https://github.com/libav/libav/blob/8652a2c24836ce5546b398f12b7fed45000050e1/libavcodec/extract_extradata_bsf.c/#L47
d2a_code_trace_data_44051
static inline void skip_remaining(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE bc->bits >>= n; #else bc->bits <<= n; #endif bc->bits_left -= n; } libavcodec/alsdec.c:1500: error: Integer Overflow L2 ([0, +oo] - 32):unsigned32 by call to `read_frame_data`. libavcodec/alsdec.c:1484:5: Call 1482. unsigned int c, sample, ra_frame, bytes_read, shift; 1483. 1484. bitstream_init8(&ctx->bc, buffer, buffer_size); ^ 1485. 1486. // In the case that the distance between random access frames is set to zero libavcodec/bitstream.h:104:1: Parameter `bc->bits_left` 102. 103. /* Initialize BitstreamContext with buffer size in bytes instead of bits. */ 104. static inline int bitstream_init8(BitstreamContext *bc, const uint8_t *buffer, ^ 105. unsigned byte_size) 106. { libavcodec/alsdec.c:1500:26: Call 1498. 1499. // decode the frame data 1500. if ((invalid_frame = read_frame_data(ctx, ra_frame)) < 0) ^ 1501. av_log(ctx->avctx, AV_LOG_WARNING, 1502. "Reading frame data failed. Skipping RA unit.\n"); libavcodec/alsdec.c:1327:1: Parameter `ctx->bc.bits_left` 1325. /** Read the frame data. 1326. */ 1327. static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) ^ 1328. { 1329. ALSSpecificConfig *sconf = &ctx->sconf; libavcodec/alsdec.c:1340:9: Call 1338. // skip the size of the ra unit if present in the frame 1339. if (sconf->ra_flag == RA_FLAG_FRAMES && ra_frame) 1340. bitstream_skip(bc, 32); ^ 1341. 1342. if (sconf->mc_coding && sconf->joint_stereo) { libavcodec/bitstream.h:241:1: Parameter `n` 239. 240. /* Skip n bits in the buffer. */ 241. static inline void bitstream_skip(BitstreamContext *bc, unsigned n) ^ 242. { 243. if (n <= bc->bits_left) libavcodec/bitstream.h:244:9: Call 242. { 243. if (n <= bc->bits_left) 244. skip_remaining(bc, n); ^ 245. else { 246. n -= bc->bits_left; libavcodec/bitstream.h:230:1: <LHS trace> 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: Parameter `bc->bits_left` 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: <RHS trace> 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: Parameter `n` 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:237:5: Binary operation: ([0, +oo] - 32):unsigned32 by call to `read_frame_data` 235. bc->bits <<= n; 236. #endif 237. bc->bits_left -= n; ^ 238. } 239.
https://github.com/libav/libav/blob/7ff018c1cb43a5fe5ee2049d325cdd785852067a/libavcodec/bitstream.h/#L237
d2a_code_trace_data_44052
static inline void skip_remaining(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE bc->bits >>= n; #else bc->bits <<= n; #endif bc->bits_left -= n; } libavcodec/tak.c:150: error: Integer Overflow L2 ([0, +oo] - 24):unsigned32 by call to `bitstream_skip`. libavcodec/tak.c:133:21: Call 131. 132. ti->flags = bitstream_read(bc, TAK_FRAME_HEADER_FLAGS_BITS); 133. ti->frame_num = bitstream_read(bc, TAK_FRAME_HEADER_NO_BITS); ^ 134. 135. if (ti->flags & TAK_FRAME_FLAG_IS_LAST) { 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/tak.c:150:5: Call 148. } 149. 150. bitstream_skip(bc, 24); ^ 151. 152. return 0; libavcodec/bitstream.h:241:1: Parameter `n` 239. 240. /* Skip n bits in the buffer. */ 241. static inline void bitstream_skip(BitstreamContext *bc, unsigned n) ^ 242. { 243. if (n <= bc->bits_left) libavcodec/bitstream.h:244:9: Call 242. { 243. if (n <= bc->bits_left) 244. skip_remaining(bc, n); ^ 245. else { 246. n -= bc->bits_left; libavcodec/bitstream.h:230:1: <LHS trace> 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: Parameter `bc->bits_left` 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: <RHS trace> 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:230:1: Parameter `n` 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:237:5: Binary operation: ([0, +oo] - 24):unsigned32 by call to `bitstream_skip` 235. bc->bits <<= n; 236. #endif 237. bc->bits_left -= n; ^ 238. } 239.
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L237
d2a_code_trace_data_44053
int 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: if (MD5_Init((MD5_CTX *)md_state.c) <= 0) return 0; 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: if (SHA1_Init((SHA_CTX *)md_state.c) <= 0) return 0; 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: if (SHA224_Init((SHA256_CTX *)md_state.c) <= 0) return 0; 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: if (SHA256_Init((SHA256_CTX *)md_state.c) <= 0) return 0; 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: if (SHA384_Init((SHA512_CTX *)md_state.c) <= 0) return 0; 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: if (SHA512_Init((SHA512_CTX *)md_state.c) <= 0) return 0; 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 0; } 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; if (header_length <= md_block_size) { return 0; } 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); if (EVP_DigestInit_ex(&md_ctx, ctx->digest, NULL ) <= 0) goto err; if (is_sslv3) { memset(hmac_pad, 0x5c, sslv3_pad_length); if (EVP_DigestUpdate(&md_ctx, mac_secret, mac_secret_length) <= 0 || EVP_DigestUpdate(&md_ctx, hmac_pad, sslv3_pad_length) <= 0 || EVP_DigestUpdate(&md_ctx, mac_out, md_size) <= 0) goto err; } else { for (i = 0; i < md_block_size; i++) hmac_pad[i] ^= 0x6a; if (EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size) <= 0 || EVP_DigestUpdate(&md_ctx, mac_out, md_size) <= 0) goto err; } 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); return 1; err: EVP_MD_CTX_cleanup(&md_ctx); return 0; } ssl/record/ssl3_record.c:849: error: BUFFER_OVERRUN_L3 Offset added: [-63, +oo] Size: 128 by call to `ssl3_cbc_digest_record`. Showing all 12 steps of the trace ssl/record/ssl3_record.c:790:1: Parameter `ssl->read_hash->digest->md_size` 788. } 789. 790. > int n_ssl3_mac(SSL *ssl, unsigned char *md, int send) 791. { 792. SSL3_RECORD *rec; ssl/record/ssl3_record.c:813:9: Call 811. } 812. 813. t = EVP_MD_CTX_size(hash); ^ 814. if (t < 0) 815. return -1; crypto/evp/evp_lib.c:302:9: Assignment 300. if (!md) { 301. EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL); 302. return -1; ^ 303. } 304. return md->md_size; ssl/record/ssl3_record.c:813:5: Assignment 811. } 812. 813. t = EVP_MD_CTX_size(hash); ^ 814. if (t < 0) 815. return -1; ssl/record/ssl3_record.c:816:5: Assignment 814. if (t < 0) 815. return -1; 816. md_size = t; ^ 817. npad = (48 / md_size) * md_size; 818. ssl/record/ssl3_record.c:849:13: Call 847. 848. /* Final param == is SSLv3 */ 849. if (ssl3_cbc_digest_record(hash, ^ 850. md, &md_size, 851. header, rec->input, ssl/s3_cbc.c:193:5: <Offset trace> 191. void (*md_final_raw) (void *ctx, unsigned char *md_out); 192. void (*md_transform) (void *ctx, const unsigned char *block); 193. unsigned md_size, md_block_size = 64; ^ 194. unsigned sslv3_pad_length = 40, header_length, variance_blocks, 195. len, max_mac_bytes, num_blocks, ssl/s3_cbc.c:193:5: Assignment 191. void (*md_final_raw) (void *ctx, unsigned char *md_out); 192. void (*md_transform) (void *ctx, const unsigned char *block); 193. unsigned md_size, md_block_size = 64; ^ 194. unsigned sslv3_pad_length = 40, header_length, variance_blocks, 195. len, max_mac_bytes, num_blocks, ssl/s3_cbc.c:422:13: Assignment 420. return 0; 421. } 422. overhang = header_length - md_block_size; ^ 423. md_transform(md_state.c, header); 424. memcpy(first_block, header + md_block_size, overhang); ssl/s3_cbc.c:177:1: <Length trace> 175. * Returns 1 on success or 0 on error 176. */ 177. > int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, 178. unsigned char *md_out, 179. size_t *md_out_size, ssl/s3_cbc.c:177:1: Array declaration 175. * Returns 1 on success or 0 on error 176. */ 177. > int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, 178. unsigned char *md_out, 179. size_t *md_out_size, ssl/s3_cbc.c:424:13: Array access: Offset added: [-63, +oo] Size: 128 by call to `ssl3_cbc_digest_record` 422. overhang = header_length - md_block_size; 423. md_transform(md_state.c, header); 424. memcpy(first_block, header + md_block_size, overhang); ^ 425. memcpy(first_block + overhang, data, md_block_size - overhang); 426. md_transform(md_state.c, first_block);
https://github.com/openssl/openssl/blob/ba4f1331e3e96a83144adf5f100b8b5f8f29a2c9/ssl/s3_cbc.c/#L424