id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_41354
void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len) { CRYPTO_gcm128_finish(ctx, NULL, 0); memcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c)); } crypto/evp/e_aes.c:341: error: BUFFER_OVERRUN_L3 Offset added: 16 Size: [0, +oo] by call to `CRYPTO_gcm128_tag`. Showing all 6 steps of the trace crypto/evp/e_aes.c:341:3: Call 339. return 0; 340. } 341. CRYPTO_gcm128_tag(gctx->gcm, gctx->tag, 16); ^ 342. gctx->taglen = 16; 343. /* Don't reuse the IV */ crypto/modes/gcm128.c:1379:25: <Offset trace> 1377. { 1378. CRYPTO_gcm128_finish(ctx, NULL, 0); 1379. memcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c)); ^ 1380. } 1381. crypto/modes/gcm128.c:1379:25: Assignment 1377. { 1378. CRYPTO_gcm128_finish(ctx, NULL, 0); 1379. memcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c)); ^ 1380. } 1381. crypto/modes/gcm128.c:1376:1: <Length trace> 1374. } 1375. 1376. > void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len) 1377. { 1378. CRYPTO_gcm128_finish(ctx, NULL, 0); crypto/modes/gcm128.c:1376:1: Parameter `ctx->Xi.c[*]` 1374. } 1375. 1376. > void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len) 1377. { 1378. CRYPTO_gcm128_finish(ctx, NULL, 0); crypto/modes/gcm128.c:1379:2: Array access: Offset added: 16 Size: [0, +oo] by call to `CRYPTO_gcm128_tag` 1377. { 1378. CRYPTO_gcm128_finish(ctx, NULL, 0); 1379. memcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c)); ^ 1380. } 1381.
https://github.com/openssl/openssl/blob/f4001a0d192a2462bcedbaadf95e778ddc352ebb/crypto/modes/gcm128.c/#L1379
d2a_code_trace_data_41355
static int right_encode(unsigned char *out, int *out_len, size_t bits) { unsigned int len = get_encode_size(bits); int i; if (len > 0xFF) return 0; for (i = len - 1; i >= 0; --i) { out[i] = (unsigned char)(bits & 0xFF); bits >>= 8; } out[len] = (unsigned char)len; *out_len = len + 1; return 1; } crypto/kmac/kmac.c:214: error: BUFFER_OVERRUN_L2 Offset: [1, 8] Size: 3 by call to `right_encode`. Showing all 10 steps of the trace crypto/kmac/kmac.c:205:1: Array declaration 203. } 204. 205. > static int kmac_final(EVP_MAC_IMPL *kctx, unsigned char *out) 206. { 207. EVP_MD_CTX *ctx = kctx->ctx; crypto/kmac/kmac.c:214:12: Call 212. lbits = (kctx->xof_mode ? 0 : (kctx->out_len * 8)); 213. 214. return right_encode(encoded_outlen, &len, lbits) ^ 215. && EVP_DigestUpdate(ctx, encoded_outlen, len) 216. && EVP_DigestFinalXOF(ctx, out, kctx->out_len); crypto/kmac/kmac.c:339:24: <Offset trace> 337. static int right_encode(unsigned char *out, int *out_len, size_t bits) 338. { 339. unsigned int len = get_encode_size(bits); ^ 340. int i; 341. crypto/kmac/kmac.c:339:24: Call 337. static int right_encode(unsigned char *out, int *out_len, size_t bits) 338. { 339. unsigned int len = get_encode_size(bits); ^ 340. int i; 341. crypto/kmac/kmac.c:317:5: Assignment 315. static unsigned int get_encode_size(size_t bits) 316. { 317. unsigned int cnt = 0, sz = sizeof(size_t); ^ 318. 319. while (bits && (cnt < sz)) { crypto/kmac/kmac.c:326:5: Assignment 324. if (cnt == 0) 325. cnt = 1; 326. return cnt; ^ 327. } 328. crypto/kmac/kmac.c:339:5: Assignment 337. static int right_encode(unsigned char *out, int *out_len, size_t bits) 338. { 339. unsigned int len = get_encode_size(bits); ^ 340. int i; 341. crypto/kmac/kmac.c:337:1: <Length trace> 335. * 336. */ 337. > static int right_encode(unsigned char *out, int *out_len, size_t bits) 338. { 339. unsigned int len = get_encode_size(bits); crypto/kmac/kmac.c:337:1: Parameter `*out` 335. * 336. */ 337. > static int right_encode(unsigned char *out, int *out_len, size_t bits) 338. { 339. unsigned int len = get_encode_size(bits); crypto/kmac/kmac.c:352:5: Array access: Offset: [1, 8] Size: 3 by call to `right_encode` 350. } 351. /* Tack the length onto the end */ 352. out[len] = (unsigned char)len; ^ 353. 354. /* The Returned length includes the tacked on byte */
https://github.com/openssl/openssl/blob/c7af8b0a267981c25cc42643493289a01ffe1bbd/crypto/kmac/kmac.c/#L352
d2a_code_trace_data_41356
static ossl_inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } ssl/statem/statem_srvr.c:1607: error: INTEGER_OVERFLOW_L2 ([1, `s->clienthello->ciphersuites.remaining`] - [2, 3]):unsigned64 by call to `bytes_to_cipher_list`. Showing all 13 steps of the trace ssl/statem/statem_srvr.c:1447:1: Parameter `s->clienthello->ciphersuites.remaining` 1445. } 1446. 1447. > static int tls_early_post_process_client_hello(SSL *s, int *pal) 1448. { 1449. unsigned int j; ssl/statem/statem_srvr.c:1605:10: Call 1603. } 1604. 1605. if (!ssl_cache_cipherlist(s, &clienthello->ciphersuites, ^ 1606. clienthello->isv2, &al) || 1607. !bytes_to_cipher_list(s, &clienthello->ciphersuites, &ciphers, &scsvs, ssl/ssl_lib.c:4637:1: Parameter `cipher_suites->remaining` 4635. #define SSLV2_CIPHER_LEN 3 4636. 4637. > int ssl_cache_cipherlist(SSL *s, PACKET *cipher_suites, int sslv2format, 4638. int *al) 4639. { ssl/statem/statem_srvr.c:1607:10: Call 1605. if (!ssl_cache_cipherlist(s, &clienthello->ciphersuites, 1606. clienthello->isv2, &al) || 1607. !bytes_to_cipher_list(s, &clienthello->ciphersuites, &ciphers, &scsvs, ^ 1608. clienthello->isv2, &al)) { 1609. goto err; ssl/ssl_lib.c:4720:1: Parameter `cipher_suites->remaining` 4718. } 4719. 4720. > int bytes_to_cipher_list(SSL *s, PACKET *cipher_suites, 4721. STACK_OF(SSL_CIPHER) **skp, 4722. STACK_OF(SSL_CIPHER) **scsvs_out, ssl/ssl_lib.c:4755:12: Call 4753. } 4754. 4755. while (PACKET_copy_bytes(cipher_suites, cipher, n)) { ^ 4756. /* 4757. * SSLv3 ciphers wrapped in an SSLv2-compatible ClientHello have the 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: ([1, s->clienthello->ciphersuites.remaining] - [2, 3]):unsigned64 by call to `bytes_to_cipher_list` 34. { 35. pkt->curr += len; 36. pkt->remaining -= len; ^ 37. } 38.
https://github.com/openssl/openssl/blob/b6e3250671654e0344127be9dd49b3fb4a82f94b/ssl/packet_locl.h/#L36
d2a_code_trace_data_41357
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/takdec.c:463: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `bits_esc4`. libavcodec/takdec.c:456:20: Call 454. return AVERROR_INVALIDDATA; 455. 456. if ((ret = decode_residues(s, decoded, filter_order)) < 0) ^ 457. return ret; 458. libavcodec/takdec.c:286:1: Parameter `s->bc.bits_left` 284. } 285. 286. static int decode_residues(TAKDecContext *s, int32_t *decoded, int length) ^ 287. { 288. BitstreamContext *bc = &s->bc; libavcodec/takdec.c:463:14: Call 461. } 462. 463. dshift = bits_esc4(bc); ^ 464. size = bitstream_read_bit(bc) + 6; 465. libavcodec/takdec.c:367:1: Parameter `bc->bits_left` 365. } 366. 367. static int bits_esc4(BitstreamContext *bc) ^ 368. { 369. if (bitstream_read_bit(bc)) libavcodec/takdec.c:369:9: Call 367. static int bits_esc4(BitstreamContext *bc) 368. { 369. if (bitstream_read_bit(bc)) ^ 370. return bitstream_read(bc, 4) + 1; 371. else libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bits_esc4` 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_41358
static int decode_header_trees(SmackVContext *smk) { GetBitContext gb; int mmap_size, mclr_size, full_size, type_size; mmap_size = AV_RL32(smk->avctx->extradata); mclr_size = AV_RL32(smk->avctx->extradata + 4); full_size = AV_RL32(smk->avctx->extradata + 8); type_size = AV_RL32(smk->avctx->extradata + 12); init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); smk->mmap_tbl = av_malloc(sizeof(int) * 2); smk->mmap_tbl[0] = 0; smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n"); smk->mclr_tbl = av_malloc(sizeof(int) * 2); smk->mclr_tbl[0] = 0; smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n"); smk->full_tbl = av_malloc(sizeof(int) * 2); smk->full_tbl[0] = 0; smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n"); smk->type_tbl = av_malloc(sizeof(int) * 2); smk->type_tbl[0] = 0; smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size)) return -1; } return 0; } libavcodec/smacker.c:292: error: Null Dereference pointer `smk->mmap_tbl` last assigned on line 291 could be null and is dereferenced at line 292, column 9. libavcodec/smacker.c:278:1: start of procedure decode_header_trees() 276. } 277. 278. static int decode_header_trees(SmackVContext *smk) { ^ 279. GetBitContext gb; 280. int mmap_size, mclr_size, full_size, type_size; libavcodec/smacker.c:282:5: 280. int mmap_size, mclr_size, full_size, type_size; 281. 282. mmap_size = AV_RL32(smk->avctx->extradata); ^ 283. mclr_size = AV_RL32(smk->avctx->extradata + 4); 284. full_size = AV_RL32(smk->avctx->extradata + 8); libavcodec/smacker.c:283:5: 281. 282. mmap_size = AV_RL32(smk->avctx->extradata); 283. mclr_size = AV_RL32(smk->avctx->extradata + 4); ^ 284. full_size = AV_RL32(smk->avctx->extradata + 8); 285. type_size = AV_RL32(smk->avctx->extradata + 12); libavcodec/smacker.c:284:5: 282. mmap_size = AV_RL32(smk->avctx->extradata); 283. mclr_size = AV_RL32(smk->avctx->extradata + 4); 284. full_size = AV_RL32(smk->avctx->extradata + 8); ^ 285. type_size = AV_RL32(smk->avctx->extradata + 12); 286. libavcodec/smacker.c:285:5: 283. mclr_size = AV_RL32(smk->avctx->extradata + 4); 284. full_size = AV_RL32(smk->avctx->extradata + 8); 285. type_size = AV_RL32(smk->avctx->extradata + 12); ^ 286. 287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); libavcodec/smacker.c:287:5: 285. type_size = AV_RL32(smk->avctx->extradata + 12); 286. 287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); ^ 288. 289. if(!get_bits1(&gb)) { libavcodec/get_bits.h:383:1: start of procedure init_get_bits() 381. * responsible for checking for the buffer end yourself (take advantage of the padding)! 382. */ 383. static inline void init_get_bits(GetBitContext *s, ^ 384. const uint8_t *buffer, int bit_size) 385. { libavcodec/get_bits.h:386:5: 384. const uint8_t *buffer, int bit_size) 385. { 386. int buffer_size = (bit_size+7)>>3; ^ 387. if (buffer_size < 0 || bit_size < 0) { 388. buffer_size = bit_size = 0; libavcodec/get_bits.h:387:9: Taking false branch 385. { 386. int buffer_size = (bit_size+7)>>3; 387. if (buffer_size < 0 || bit_size < 0) { ^ 388. buffer_size = bit_size = 0; 389. buffer = NULL; libavcodec/get_bits.h:387:28: Taking false branch 385. { 386. int buffer_size = (bit_size+7)>>3; 387. if (buffer_size < 0 || bit_size < 0) { ^ 388. buffer_size = bit_size = 0; 389. buffer = NULL; libavcodec/get_bits.h:392:5: 390. } 391. 392. s->buffer = buffer; ^ 393. s->size_in_bits = bit_size; 394. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:393:5: 391. 392. s->buffer = buffer; 393. s->size_in_bits = bit_size; ^ 394. s->buffer_end = buffer + buffer_size; 395. #ifdef ALT_BITSTREAM_READER libavcodec/get_bits.h:394:5: 392. s->buffer = buffer; 393. s->size_in_bits = bit_size; 394. s->buffer_end = buffer + buffer_size; ^ 395. #ifdef ALT_BITSTREAM_READER 396. s->index = 0; libavcodec/get_bits.h:396:5: 394. s->buffer_end = buffer + buffer_size; 395. #ifdef ALT_BITSTREAM_READER 396. s->index = 0; ^ 397. #elif defined A32_BITSTREAM_READER 398. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3); libavcodec/get_bits.h:402:1: return from a call to init_get_bits 400. skip_bits_long(s, 0); 401. #endif 402. } ^ 403. 404. static inline void align_get_bits(GetBitContext *s) libavcodec/smacker.c:289:9: 287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); 288. 289. if(!get_bits1(&gb)) { ^ 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); libavcodec/get_bits.h:303:1: start of procedure get_bits1() 301. } 302. 303. static inline unsigned int get_bits1(GetBitContext *s){ ^ 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; libavcodec/get_bits.h:305:5: 303. static inline unsigned int get_bits1(GetBitContext *s){ 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; ^ 306. uint8_t result = s->buffer[index>>3]; 307. #ifdef ALT_BITSTREAM_READER_LE libavcodec/get_bits.h:306:5: 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; 306. uint8_t result = s->buffer[index>>3]; ^ 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; libavcodec/get_bits.h:308:5: 306. uint8_t result = s->buffer[index>>3]; 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; ^ 309. result &= 1; 310. #else libavcodec/get_bits.h:309:5: 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7; 309. result &= 1; ^ 310. #else 311. result <<= index & 7; libavcodec/get_bits.h:314:5: 312. result >>= 8 - 1; 313. #endif 314. index++; ^ 315. s->index = index; 316. libavcodec/get_bits.h:315:5: 313. #endif 314. index++; 315. s->index = index; ^ 316. 317. return result; libavcodec/get_bits.h:317:5: 315. s->index = index; 316. 317. return result; ^ 318. #else 319. return get_bits(s, 1); libavcodec/get_bits.h:321:1: return from a call to get_bits1 319. return get_bits(s, 1); 320. #endif 321. } ^ 322. 323. static inline unsigned int show_bits1(GetBitContext *s){ libavcodec/smacker.c:289:9: Taking true branch 287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); 288. 289. if(!get_bits1(&gb)) { ^ 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); libavcodec/smacker.c:290:9: Skipping av_log(): empty list of specs 288. 289. if(!get_bits1(&gb)) { 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); ^ 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); 292. smk->mmap_tbl[0] = 0; libavcodec/smacker.c:291:9: 289. if(!get_bits1(&gb)) { 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); ^ 292. smk->mmap_tbl[0] = 0; 293. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1; libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(size_t size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(size_t size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking true branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:84:9: 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) 84. ptr = NULL; ^ 85. #elif HAVE_MEMALIGN 86. ptr = memalign(32,size); libavutil/mem.c:114:5: 112. ptr = malloc(size); 113. #endif 114. return ptr; ^ 115. } 116. libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavcodec/smacker.c:292:9: 290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 291. smk->mmap_tbl = av_malloc(sizeof(int) * 2); 292. smk->mmap_tbl[0] = 0; ^ 293. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1; 294. } else {
https://github.com/libav/libav/blob/d7d2f0e63c8187d531168256a0ce2aac21d5fce6/libavcodec/smacker.c/#L292
d2a_code_trace_data_41359
static size_t kat_entropy(RAND_DRBG *drbg, unsigned char **pout, int entropy, size_t min_len, size_t max_len, int prediction_resistance) { TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index); t->entropycnt++; *pout = (unsigned char *)t->entropy; return t->entropylen; } test/drbgtest.c:140: error: NULL_DEREFERENCE pointer `t` last assigned on line 138 could be null and is dereferenced at line 140, column 5. Showing all 10 steps of the trace test/drbgtest.c:134:1: start of procedure kat_entropy() 132. } TEST_CTX; 133. 134. > static size_t kat_entropy(RAND_DRBG *drbg, unsigned char **pout, 135. int entropy, size_t min_len, size_t max_len, 136. int prediction_resistance) test/drbgtest.c:138:5: 136. int prediction_resistance) 137. { 138. > TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index); 139. 140. t->entropycnt++; crypto/rand/drbg_lib.c:911:1: start of procedure RAND_DRBG_get_ex_data() 909. } 910. 911. > void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx) 912. { 913. return CRYPTO_get_ex_data(&drbg->ex_data, idx); crypto/rand/drbg_lib.c:913:5: 911. void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx) 912. { 913. > return CRYPTO_get_ex_data(&drbg->ex_data, idx); 914. } 915. crypto/ex_data.c:394:1: start of procedure CRYPTO_get_ex_data() 392. * particular index in the class used by this variable 393. */ 394. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 395. { 396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:396:9: Taking true branch 394. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 395. { 396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 397. return NULL; 398. return sk_void_value(ad->sk, idx); crypto/ex_data.c:397:9: 395. { 396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 397. > return NULL; 398. return sk_void_value(ad->sk, idx); 399. } crypto/ex_data.c:399:1: return from a call to CRYPTO_get_ex_data 397. return NULL; 398. return sk_void_value(ad->sk, idx); 399. > } crypto/rand/drbg_lib.c:914:1: return from a call to RAND_DRBG_get_ex_data 912. { 913. return CRYPTO_get_ex_data(&drbg->ex_data, idx); 914. > } 915. 916. test/drbgtest.c:140:5: 138. TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index); 139. 140. > t->entropycnt++; 141. *pout = (unsigned char *)t->entropy; 142. return t->entropylen;
https://github.com/openssl/openssl/blob/b44882a0bd0717e0aab84f5dc3ef81ab673155e9/test/drbgtest.c/#L140
d2a_code_trace_data_41360
static int check_chain_extensions(X509_STORE_CTX *ctx) { #ifdef OPENSSL_NO_CHAIN_VERIFY return 1; #else int i, ok=0, must_be_ca, plen = 0; X509 *x; int (*cb)(int xok,X509_STORE_CTX *xctx); int proxy_path_length = 0; int purpose; int allow_proxy_certs; cb=ctx->verify_cb; must_be_ca = -1; if (ctx->parent) { allow_proxy_certs = 0; purpose = X509_PURPOSE_CRL_SIGN; } else { allow_proxy_certs = !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) allow_proxy_certs = 1; purpose = ctx->param->purpose; } for (i = 0; i < ctx->last_untrusted; i++) { int ret; x = sk_X509_value(ctx->chain, i); if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) && (x->ex_flags & EXFLAG_CRITICAL)) { ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; ctx->error_depth = i; ctx->current_cert = x; ok=cb(0,ctx); if (!ok) goto end; } if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) { ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; ctx->error_depth = i; ctx->current_cert = x; ok=cb(0,ctx); if (!ok) goto end; } ret = X509_check_ca(x); switch(must_be_ca) { case -1: if ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1) && (ret != 0)) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; case 0: if (ret != 0) { ret = 0; ctx->error = X509_V_ERR_INVALID_NON_CA; } else ret = 1; break; default: if ((ret == 0) || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1))) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; } if (ret == 0) { ctx->error_depth = i; ctx->current_cert = x; ok=cb(0,ctx); if (!ok) goto end; } if (ctx->param->purpose > 0) { ret = X509_check_purpose(x, purpose, must_be_ca > 0); if ((ret == 0) || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1))) { ctx->error = X509_V_ERR_INVALID_PURPOSE; ctx->error_depth = i; ctx->current_cert = x; ok=cb(0,ctx); if (!ok) goto end; } } if ((i > 1) && !(x->ex_flags & EXFLAG_SI) && (x->ex_pathlen != -1) && (plen > (x->ex_pathlen + proxy_path_length + 1))) { ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED; ctx->error_depth = i; ctx->current_cert = x; ok=cb(0,ctx); if (!ok) goto end; } if (!(x->ex_flags & EXFLAG_SI)) plen++; if (x->ex_flags & EXFLAG_PROXY) { if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) { ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED; ctx->error_depth = i; ctx->current_cert = x; ok=cb(0,ctx); if (!ok) goto end; } proxy_path_length++; must_be_ca = 0; } else must_be_ca = 1; } ok = 1; end: return ok; #endif } crypto/x509/x509_vfy.c:599: error: NULL_DEREFERENCE pointer `x` last assigned on line 589 could be null and is dereferenced at line 599, column 30. Showing all 24 steps of the trace crypto/x509/x509_vfy.c:545:1: start of procedure check_chain_extensions() 543. */ 544. 545. > static int check_chain_extensions(X509_STORE_CTX *ctx) 546. { 547. #ifdef OPENSSL_NO_CHAIN_VERIFY crypto/x509/x509_vfy.c:550:2: 548. return 1; 549. #else 550. > int i, ok=0, must_be_ca, plen = 0; 551. X509 *x; 552. int (*cb)(int xok,X509_STORE_CTX *xctx); crypto/x509/x509_vfy.c:553:2: 551. X509 *x; 552. int (*cb)(int xok,X509_STORE_CTX *xctx); 553. > int proxy_path_length = 0; 554. int purpose; 555. int allow_proxy_certs; crypto/x509/x509_vfy.c:556:2: 554. int purpose; 555. int allow_proxy_certs; 556. > cb=ctx->verify_cb; 557. 558. /* must_be_ca can have 1 of 3 values: crypto/x509/x509_vfy.c:566:2: 564. all certificates in the chain except the leaf certificate. 565. */ 566. > must_be_ca = -1; 567. 568. /* CRL path validation */ crypto/x509/x509_vfy.c:569:6: Taking false branch 567. 568. /* CRL path validation */ 569. if (ctx->parent) ^ 570. { 571. allow_proxy_certs = 0; crypto/x509/x509_vfy.c:577:7: Condition is true 575. { 576. allow_proxy_certs = 577. !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); ^ 578. /* A hack to keep people who don't want to modify their 579. software happy */ crypto/x509/x509_vfy.c:577:4: 575. { 576. allow_proxy_certs = 577. > !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 578. /* A hack to keep people who don't want to modify their 579. software happy */ crypto/x509/x509_vfy.c:576:3: 574. else 575. { 576. > allow_proxy_certs = 577. !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 578. /* A hack to keep people who don't want to modify their crypto/x509/x509_vfy.c:580:7: Taking false branch 578. /* A hack to keep people who don't want to modify their 579. software happy */ 580. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) ^ 581. allow_proxy_certs = 1; 582. purpose = ctx->param->purpose; crypto/x509/x509_vfy.c:582:3: 580. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) 581. allow_proxy_certs = 1; 582. > purpose = ctx->param->purpose; 583. } 584. crypto/x509/x509_vfy.c:586:7: 584. 585. /* Check all untrusted certificates */ 586. > for (i = 0; i < ctx->last_untrusted; i++) 587. { 588. int ret; crypto/x509/x509_vfy.c:586:14: Loop condition is true. Entering loop body 584. 585. /* Check all untrusted certificates */ 586. for (i = 0; i < ctx->last_untrusted; i++) ^ 587. { 588. int ret; crypto/x509/x509_vfy.c:589:7: Condition is true 587. { 588. int ret; 589. x = sk_X509_value(ctx->chain, i); ^ 590. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 591. && (x->ex_flags & EXFLAG_CRITICAL)) crypto/x509/x509_vfy.c:589:3: 587. { 588. int ret; 589. > x = sk_X509_value(ctx->chain, i); 590. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 591. && (x->ex_flags & EXFLAG_CRITICAL)) crypto/stack/stack.c:337:1: start of procedure sk_value() 335. } 336. 337. > void *sk_value(const _STACK *st, int i) 338. { 339. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:339:6: Taking false branch 337. void *sk_value(const _STACK *st, int i) 338. { 339. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 340. return st->data[i]; 341. } crypto/stack/stack.c:339:13: Taking false branch 337. void *sk_value(const _STACK *st, int i) 338. { 339. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 340. return st->data[i]; 341. } crypto/stack/stack.c:339:24: Taking true branch 337. void *sk_value(const _STACK *st, int i) 338. { 339. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 340. return st->data[i]; 341. } crypto/stack/stack.c:339:39: 337. void *sk_value(const _STACK *st, int i) 338. { 339. > if(!st || (i < 0) || (i >= st->num)) return NULL; 340. return st->data[i]; 341. } crypto/stack/stack.c:341:1: return from a call to sk_value 339. if(!st || (i < 0) || (i >= st->num)) return NULL; 340. return st->data[i]; 341. > } 342. 343. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:590:9: Taking false branch 588. int ret; 589. x = sk_X509_value(ctx->chain, i); 590. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) ^ 591. && (x->ex_flags & EXFLAG_CRITICAL)) 592. { crypto/x509/x509_vfy.c:599:8: Taking true branch 597. if (!ok) goto end; 598. } 599. if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) ^ 600. { 601. ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; crypto/x509/x509_vfy.c:599:30: 597. if (!ok) goto end; 598. } 599. > if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) 600. { 601. ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED;
https://github.com/openssl/openssl/blob/750487899ad2b794078ed998b513a4a14f60f2cc/crypto/x509/x509_vfy.c/#L599
d2a_code_trace_data_41361
static int get_ocsp_resp_from_responder(SSL *s, tlsextstatusctx *srctx, OCSP_RESPONSE **resp) { char *host = NULL, *port = NULL, *path = NULL; int use_ssl; STACK_OF(OPENSSL_STRING) *aia = NULL; X509 *x = NULL; X509_STORE_CTX *inctx = NULL; X509_OBJECT *obj; OCSP_REQUEST *req = NULL; OCSP_CERTID *id = NULL; STACK_OF(X509_EXTENSION) *exts; int ret = SSL_TLSEXT_ERR_NOACK; int i; x = SSL_get_certificate(s); aia = X509_get1_ocsp(x); if (aia) { if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0), &host, &port, &path, &use_ssl)) { BIO_puts(bio_err, "cert_status: can't parse AIA URL\n"); goto err; } if (srctx->verbose) BIO_printf(bio_err, "cert_status: AIA URL: %s\n", sk_OPENSSL_STRING_value(aia, 0)); } else { if (!srctx->host) { BIO_puts(bio_err, "cert_status: no AIA and no default responder URL\n"); goto done; } host = srctx->host; path = srctx->path; port = srctx->port; use_ssl = srctx->use_ssl; } inctx = X509_STORE_CTX_new(); if (inctx == NULL) goto err; if (!X509_STORE_CTX_init(inctx, SSL_CTX_get_cert_store(SSL_get_SSL_CTX(s)), NULL, NULL)) goto err; obj = X509_STORE_CTX_get_obj_by_subject(inctx, X509_LU_X509, X509_get_issuer_name(x)); if (obj == NULL) { BIO_puts(bio_err, "cert_status: Can't retrieve issuer certificate.\n"); goto done; } id = OCSP_cert_to_id(NULL, x, X509_OBJECT_get0_X509(obj)); X509_OBJECT_free(obj); if (!id) goto err; req = OCSP_REQUEST_new(); if (req == NULL) goto err; if (!OCSP_request_add0_id(req, id)) goto err; id = NULL; SSL_get_tlsext_status_exts(s, &exts); for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i); if (!OCSP_REQUEST_add_ext(req, ext, -1)) goto err; } *resp = process_responder(req, host, path, port, use_ssl, NULL, srctx->timeout); if (*resp == NULL) { BIO_puts(bio_err, "cert_status: error querying responder\n"); goto done; } ret = SSL_TLSEXT_ERR_OK; goto done; err: ret = SSL_TLSEXT_ERR_ALERT_FATAL; done: if (aia != NULL) { OPENSSL_free(host); OPENSSL_free(path); OPENSSL_free(port); X509_email_free(aia); } OCSP_CERTID_free(id); OCSP_REQUEST_free(req); X509_STORE_CTX_free(inctx); return ret; } apps/s_server.c:491: error: NULL_DEREFERENCE pointer `x` last assigned on line 490 could be null and is dereferenced by call to `X509_get1_ocsp()` at line 491, column 11. Showing all 14 steps of the trace apps/s_server.c:474:1: start of procedure get_ocsp_resp_from_responder() 472. * them until they were considered "expired". 473. */ 474. > static int get_ocsp_resp_from_responder(SSL *s, tlsextstatusctx *srctx, 475. OCSP_RESPONSE **resp) 476. { apps/s_server.c:477:5: 475. OCSP_RESPONSE **resp) 476. { 477. > char *host = NULL, *port = NULL, *path = NULL; 478. int use_ssl; 479. STACK_OF(OPENSSL_STRING) *aia = NULL; apps/s_server.c:479:5: 477. char *host = NULL, *port = NULL, *path = NULL; 478. int use_ssl; 479. > STACK_OF(OPENSSL_STRING) *aia = NULL; 480. X509 *x = NULL; 481. X509_STORE_CTX *inctx = NULL; apps/s_server.c:480:5: 478. int use_ssl; 479. STACK_OF(OPENSSL_STRING) *aia = NULL; 480. > X509 *x = NULL; 481. X509_STORE_CTX *inctx = NULL; 482. X509_OBJECT *obj; apps/s_server.c:481:5: 479. STACK_OF(OPENSSL_STRING) *aia = NULL; 480. X509 *x = NULL; 481. > X509_STORE_CTX *inctx = NULL; 482. X509_OBJECT *obj; 483. OCSP_REQUEST *req = NULL; apps/s_server.c:483:5: 481. X509_STORE_CTX *inctx = NULL; 482. X509_OBJECT *obj; 483. > OCSP_REQUEST *req = NULL; 484. OCSP_CERTID *id = NULL; 485. STACK_OF(X509_EXTENSION) *exts; apps/s_server.c:484:5: 482. X509_OBJECT *obj; 483. OCSP_REQUEST *req = NULL; 484. > OCSP_CERTID *id = NULL; 485. STACK_OF(X509_EXTENSION) *exts; 486. int ret = SSL_TLSEXT_ERR_NOACK; apps/s_server.c:486:5: 484. OCSP_CERTID *id = NULL; 485. STACK_OF(X509_EXTENSION) *exts; 486. > int ret = SSL_TLSEXT_ERR_NOACK; 487. int i; 488. apps/s_server.c:490:5: 488. 489. /* Build up OCSP query from server certificate */ 490. > x = SSL_get_certificate(s); 491. aia = X509_get1_ocsp(x); 492. if (aia) { ssl/ssl_lib.c:3338:1: start of procedure SSL_get_certificate() 3336. } 3337. 3338. > X509 *SSL_get_certificate(const SSL *s) 3339. { 3340. if (s->cert != NULL) ssl/ssl_lib.c:3340:9: Taking false branch 3338. X509 *SSL_get_certificate(const SSL *s) 3339. { 3340. if (s->cert != NULL) ^ 3341. return (s->cert->key->x509); 3342. else ssl/ssl_lib.c:3343:9: 3341. return (s->cert->key->x509); 3342. else 3343. > return (NULL); 3344. } 3345. ssl/ssl_lib.c:3344:1: return from a call to SSL_get_certificate 3342. else 3343. return (NULL); 3344. > } 3345. 3346. EVP_PKEY *SSL_get_privatekey(const SSL *s) apps/s_server.c:491:5: 489. /* Build up OCSP query from server certificate */ 490. x = SSL_get_certificate(s); 491. > aia = X509_get1_ocsp(x); 492. if (aia) { 493. if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0),
https://github.com/openssl/openssl/blob/5d8ce306349aabcf40da0324242025aac3cc56e4/apps/s_server.c/#L491
d2a_code_trace_data_41362
int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, size_t *written) { int i; SSL3_BUFFER *wb = s->rlayer.wbuf; size_t currbuf = 0; size_t tmpwrit = 0; if ((s->rlayer.wpend_tot > len) || ((s->rlayer.wpend_buf != buf) && !(s->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER)) || (s->rlayer.wpend_type != type)) { SSLerr(SSL_F_SSL3_WRITE_PENDING, SSL_R_BAD_WRITE_RETRY); return -1; } for (;;) { if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0 && currbuf < s->rlayer.numwpipes - 1) { currbuf++; continue; } clear_sys_error(); if (s->wbio != NULL) { s->rwstate = SSL_WRITING; i = BIO_write(s->wbio, (char *) &(SSL3_BUFFER_get_buf(&wb[currbuf]) [SSL3_BUFFER_get_offset(&wb[currbuf])]), (unsigned int)SSL3_BUFFER_get_left(&wb[currbuf])); if (i >= 0) tmpwrit = i; } else { SSLerr(SSL_F_SSL3_WRITE_PENDING, SSL_R_BIO_NOT_SET); i = -1; } if (i > 0 && tmpwrit == SSL3_BUFFER_get_left(&wb[currbuf])) { SSL3_BUFFER_set_left(&wb[currbuf], 0); SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); if (currbuf + 1 < s->rlayer.numwpipes) continue; s->rwstate = SSL_NOTHING; *written = s->rlayer.wpend_ret; return 1; } else if (i <= 0) { if (SSL_IS_DTLS(s)) { SSL3_BUFFER_set_left(&wb[currbuf], 0); } return -1; } SSL3_BUFFER_add_offset(&wb[currbuf], tmpwrit); SSL3_BUFFER_sub_left(&wb[currbuf], tmpwrit); } } ssl/record/rec_layer_s3.c:605: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `do_ssl3_write`. Showing all 9 steps of the trace ssl/record/rec_layer_s3.c:349:1: Parameter `s->rlayer.numwpipes` 347. * not all data has been sent or non-blocking IO. 348. */ 349. > int ssl3_write_bytes(SSL *s, int type, const void *buf_, size_t len, 350. size_t *written) 351. { ssl/record/rec_layer_s3.c:605:13: Call 603. } 604. 605. i = do_ssl3_write(s, type, &(buf[tot]), pipelens, numpipes, 0, ^ 606. &tmpwrit); 607. if (i <= 0) { ssl/record/rec_layer_s3.c:635:1: Parameter `s->rlayer.numwpipes` 633. } 634. 635. > int do_ssl3_write(SSL *s, int type, const unsigned char *buf, 636. size_t *pipelens, size_t numpipes, 637. int create_empty_fragment, size_t *written) ssl/record/rec_layer_s3.c:656:9: Call 654. * will happen with non blocking IO 655. */ 656. if (RECORD_LAYER_write_pending(&s->rlayer)) ^ 657. return ssl3_write_pending(s, type, buf, totlen, written); 658. ssl/record/rec_layer_s3.c:92:1: Parameter `rl->numwpipes` 90. } 91. 92. > int RECORD_LAYER_write_pending(const RECORD_LAYER *rl) 93. { 94. return (rl->numwpipes > 0) ssl/record/rec_layer_s3.c:657:16: Call 655. */ 656. if (RECORD_LAYER_write_pending(&s->rlayer)) 657. return ssl3_write_pending(s, type, buf, totlen, written); ^ 658. 659. /* If we have an alert to send, lets send it */ ssl/record/rec_layer_s3.c:905:1: <LHS trace> 903. * <0 Failure (may be retryable) 904. */ 905. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 906. size_t *written) 907. { ssl/record/rec_layer_s3.c:905:1: Parameter `s->rlayer.numwpipes` 903. * <0 Failure (may be retryable) 904. */ 905. > int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, size_t len, 906. size_t *written) 907. { ssl/record/rec_layer_s3.c:924:16: Binary operation: ([0, +oo] - 1):unsigned64 by call to `do_ssl3_write` 922. /* Loop until we find a buffer we haven't written out yet */ 923. if (SSL3_BUFFER_get_left(&wb[currbuf]) == 0 924. && currbuf < s->rlayer.numwpipes - 1) { ^ 925. currbuf++; 926. continue;
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/record/rec_layer_s3.c/#L924
d2a_code_trace_data_41363
int dtls_get_message(SSL *s, int *mt, size_t *len) { struct hm_header_st *msg_hdr; unsigned char *p; size_t msg_len; size_t tmplen; int errtype; msg_hdr = &s->d1->r_msg_hdr; memset(msg_hdr, 0, sizeof(*msg_hdr)); again: if (!dtls_get_reassembled_message(s, &errtype, &tmplen)) { if (errtype == DTLS1_HM_BAD_FRAGMENT || errtype == DTLS1_HM_FRAGMENT_RETRY) { goto again; } return 0; } *mt = s->s3->tmp.message_type; p = (unsigned char *)s->init_buf->data; *len = s->init_num; if (*mt == SSL3_MT_CHANGE_CIPHER_SPEC) { if (s->msg_callback) { s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC, p, 1, s, s->msg_callback_arg); } return 1; } msg_len = msg_hdr->msg_len; *(p++) = msg_hdr->type; l2n3(msg_len, p); s2n(msg_hdr->seq, p); l2n3(0, p); l2n3(msg_len, p); if (s->version != DTLS1_BAD_VER) { p -= DTLS1_HM_HEADER_LENGTH; msg_len += DTLS1_HM_HEADER_LENGTH; } if (!ssl3_finish_mac(s, p, msg_len)) return 0; if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, p, msg_len, s, s->msg_callback_arg); memset(msg_hdr, 0, sizeof(*msg_hdr)); s->d1->handshake_read_seq++; s->init_msg = s->init_buf->data + DTLS1_HM_HEADER_LENGTH; return 1; } ssl/statem/statem_dtls.c:373: error: BUFFER_OVERRUN_L3 Offset: 11 (⇐ 9 + 2) Size: [1, 2147483644]. Showing all 11 steps of the trace ssl/statem/statem_dtls.c:341:10: <Length trace> 339. 340. again: 341. if (!dtls_get_reassembled_message(s, &errtype, &tmplen)) { ^ 342. if (errtype == DTLS1_HM_BAD_FRAGMENT 343. || errtype == DTLS1_HM_FRAGMENT_RETRY) { ssl/statem/statem_dtls.c:341:10: Call 339. 340. again: 341. if (!dtls_get_reassembled_message(s, &errtype, &tmplen)) { ^ 342. if (errtype == DTLS1_HM_BAD_FRAGMENT 343. || errtype == DTLS1_HM_FRAGMENT_RETRY) { ssl/statem/statem_dtls.c:726:1: Parameter `*s->init_buf->data` 724. } 725. 726. > static int dtls_get_reassembled_message(SSL *s, int *errtype, size_t *len) 727. { 728. unsigned char wire[DTLS1_HM_HEADER_LENGTH]; ssl/statem/statem_dtls.c:738:11: Call 736. redo: 737. /* see if we have the required fragment already */ 738. ret = dtls1_retrieve_buffered_fragment(s, &frag_len); ^ 739. if (ret < 0) { 740. /* SSLfatal() already called */ ssl/statem/statem_dtls.c:456:1: Parameter `*s->init_buf->data` 454. * fatal error. 455. */ 456. > static int dtls1_retrieve_buffered_fragment(SSL *s, size_t *len) 457. { 458. /*- ssl/statem/statem_dtls.c:352:5: Assignment 350. *mt = s->s3->tmp.message_type; 351. 352. p = (unsigned char *)s->init_buf->data; ^ 353. *len = s->init_num; 354. ssl/statem/statem_dtls.c:369:7: Assignment 367. 368. /* reconstruct message header */ 369. *(p++) = msg_hdr->type; ^ 370. l2n3(msg_len, p); 371. s2n(msg_hdr->seq, p); ssl/statem/statem_dtls.c:370:5: Assignment 368. /* reconstruct message header */ 369. *(p++) = msg_hdr->type; 370. l2n3(msg_len, p); ^ 371. s2n(msg_hdr->seq, p); 372. l2n3(0, p); ssl/statem/statem_dtls.c:371:5: Assignment 369. *(p++) = msg_hdr->type; 370. l2n3(msg_len, p); 371. s2n(msg_hdr->seq, p); ^ 372. l2n3(0, p); 373. l2n3(msg_len, p); ssl/statem/statem_dtls.c:372:5: Assignment 370. l2n3(msg_len, p); 371. s2n(msg_hdr->seq, p); 372. l2n3(0, p); ^ 373. l2n3(msg_len, p); 374. if (s->version != DTLS1_BAD_VER) { ssl/statem/statem_dtls.c:373:5: Array access: Offset: 11 (⇐ 9 + 2) Size: [1, 2147483644] 371. s2n(msg_hdr->seq, p); 372. l2n3(0, p); 373. l2n3(msg_len, p); ^ 374. if (s->version != DTLS1_BAD_VER) { 375. p -= DTLS1_HM_HEADER_LENGTH;
https://github.com/openssl/openssl/blob/e7d961e994620dd5dee6d80794a07fb9de1bab66/ssl/statem/statem_dtls.c/#L373
d2a_code_trace_data_41364
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ int i; InternalBuffer *buf, *last; assert(pic->type==FF_BUFFER_TYPE_INTERNAL); assert(s->internal_buffer_count); if(s->internal_buffer){ buf = NULL; for(i=0; i<s->internal_buffer_count; i++){ buf= &((InternalBuffer*)s->internal_buffer)[i]; if(buf->data[0] == pic->data[0]) break; } assert(i < s->internal_buffer_count); s->internal_buffer_count--; last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; FFSWAP(InternalBuffer, *buf, *last); } for(i=0; i<4; i++){ pic->data[i]=NULL; } if(s->debug&FF_DEBUG_BUFFERS) av_log(s, AV_LOG_DEBUG, "default_release_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count); } libavcodec/utils.c:393: error: Null Dereference pointer `buf` last assigned on line 383 could be null and is dereferenced at line 393, column 5. libavcodec/utils.c:375:1: start of procedure avcodec_default_release_buffer() 373. } 374. 375. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ ^ 376. int i; 377. InternalBuffer *buf, *last; libavcodec/utils.c:379:5: 377. InternalBuffer *buf, *last; 378. 379. assert(pic->type==FF_BUFFER_TYPE_INTERNAL); ^ 380. assert(s->internal_buffer_count); 381. libavcodec/utils.c:380:5: 378. 379. assert(pic->type==FF_BUFFER_TYPE_INTERNAL); 380. assert(s->internal_buffer_count); ^ 381. 382. if(s->internal_buffer){ libavcodec/utils.c:382:8: Taking true branch 380. assert(s->internal_buffer_count); 381. 382. if(s->internal_buffer){ ^ 383. buf = NULL; /* avoids warning */ 384. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize libavcodec/utils.c:383:5: 381. 382. if(s->internal_buffer){ 383. buf = NULL; /* avoids warning */ ^ 384. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize 385. buf= &((InternalBuffer*)s->internal_buffer)[i]; libavcodec/utils.c:384:9: 382. if(s->internal_buffer){ 383. buf = NULL; /* avoids warning */ 384. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize ^ 385. buf= &((InternalBuffer*)s->internal_buffer)[i]; 386. if(buf->data[0] == pic->data[0]) libavcodec/utils.c:384:14: Loop condition is false. Leaving loop 382. if(s->internal_buffer){ 383. buf = NULL; /* avoids warning */ 384. for(i=0; i<s->internal_buffer_count; i++){ //just 3-5 checks so is not worth to optimize ^ 385. buf= &((InternalBuffer*)s->internal_buffer)[i]; 386. if(buf->data[0] == pic->data[0]) libavcodec/utils.c:389:5: 387. break; 388. } 389. assert(i < s->internal_buffer_count); ^ 390. s->internal_buffer_count--; 391. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; libavcodec/utils.c:390:5: 388. } 389. assert(i < s->internal_buffer_count); 390. s->internal_buffer_count--; ^ 391. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; 392. libavcodec/utils.c:391:5: 389. assert(i < s->internal_buffer_count); 390. s->internal_buffer_count--; 391. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; ^ 392. 393. FFSWAP(InternalBuffer, *buf, *last); libavcodec/utils.c:393:5: 391. last = &((InternalBuffer*)s->internal_buffer)[s->internal_buffer_count]; 392. 393. FFSWAP(InternalBuffer, *buf, *last); ^ 394. } 395.
https://github.com/libav/libav/blob/609a2fa1faa82da2451191170ce1807c9a1ba8a8/libavcodec/utils.c/#L393
d2a_code_trace_data_41365
void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur, Picture *last, int y, int h, int picture_structure, int first_field, int draw_edges, int low_delay, int v_edge_pos, int h_edge_pos) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); int hshift = desc->log2_chroma_w; int vshift = desc->log2_chroma_h; const int field_pic = picture_structure != PICT_FRAME; if(field_pic){ h <<= 1; y <<= 1; } if (!avctx->hwaccel && draw_edges && cur->reference && !(avctx->flags & CODEC_FLAG_EMU_EDGE)) { int *linesize = cur->f.linesize; int sides = 0, edge_h; if (y==0) sides |= EDGE_TOP; if (y + h >= v_edge_pos) sides |= EDGE_BOTTOM; edge_h= FFMIN(h, v_edge_pos - y); dsp->draw_edges(cur->f.data[0] + y * linesize[0], linesize[0], h_edge_pos, edge_h, EDGE_WIDTH, EDGE_WIDTH, sides); dsp->draw_edges(cur->f.data[1] + (y >> vshift) * linesize[1], linesize[1], h_edge_pos >> hshift, edge_h >> vshift, EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides); dsp->draw_edges(cur->f.data[2] + (y >> vshift) * linesize[2], linesize[2], h_edge_pos >> hshift, edge_h >> vshift, EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides); } h = FFMIN(h, avctx->height - y); if(field_pic && first_field && !(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return; if (avctx->draw_horiz_band) { AVFrame *src; int offset[AV_NUM_DATA_POINTERS]; int i; if(cur->f.pict_type == AV_PICTURE_TYPE_B || low_delay || (avctx->slice_flags & SLICE_FLAG_CODED_ORDER)) src = &cur->f; else if (last) src = &last->f; else return; if (cur->f.pict_type == AV_PICTURE_TYPE_B && picture_structure == PICT_FRAME && avctx->codec_id != AV_CODEC_ID_SVQ3) { for (i = 0; i < AV_NUM_DATA_POINTERS; i++) offset[i] = 0; }else{ offset[0]= y * src->linesize[0]; offset[1]= offset[2]= (y >> vshift) * src->linesize[1]; for (i = 3; i < AV_NUM_DATA_POINTERS; i++) offset[i] = 0; } emms_c(); avctx->draw_horiz_band(avctx, src, offset, y, picture_structure, h); } } libavcodec/mpegvideo.c:2325: error: Null Dereference pointer `desc` last assigned on line 2324 could be null and is dereferenced at line 2325, column 18. libavcodec/mpegvideo.c:2319:1: start of procedure ff_draw_horiz_band() 2317. * @param h is the normal height, this will be reduced automatically if needed for the last row 2318. */ 2319. void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur, ^ 2320. Picture *last, int y, int h, int picture_structure, 2321. int first_field, int draw_edges, int low_delay, libavcodec/mpegvideo.c:2324:5: 2322. int v_edge_pos, int h_edge_pos) 2323. { 2324. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); ^ 2325. int hshift = desc->log2_chroma_w; 2326. int vshift = desc->log2_chroma_h; libavutil/pixdesc.c:1507:1: start of procedure av_pix_fmt_desc_get() 1505. } 1506. 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1509:9: Taking false branch 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1509:24: Taking true branch 1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1510:9: 1508. { 1509. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1510. return NULL; ^ 1511. return &av_pix_fmt_descriptors[pix_fmt]; 1512. } libavutil/pixdesc.c:1512:1: return from a call to av_pix_fmt_desc_get 1510. return NULL; 1511. return &av_pix_fmt_descriptors[pix_fmt]; 1512. } ^ 1513. 1514. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) libavcodec/mpegvideo.c:2325:5: 2323. { 2324. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); 2325. int hshift = desc->log2_chroma_w; ^ 2326. int vshift = desc->log2_chroma_h; 2327. const int field_pic = picture_structure != PICT_FRAME;
https://github.com/libav/libav/blob/fffca3d278c2a2422c2f61f21c5a9d5f690d328e/libavcodec/mpegvideo.c/#L2325
d2a_code_trace_data_41366
static int seq_parse_frame_data(SeqDemuxContext *seq, ByteIOContext *pb) { unsigned int offset_table[4], buffer_num[4]; TiertexSeqFrameBuffer *seq_buffer; int i, e, err; seq->current_frame_offs += SEQ_FRAME_SIZE; url_fseek(pb, seq->current_frame_offs, SEEK_SET); seq->current_audio_data_offs = get_le16(pb); if (seq->current_audio_data_offs != 0) { seq->current_audio_data_size = SEQ_AUDIO_BUFFER_SIZE * 2; } else { seq->current_audio_data_size = 0; } seq->current_pal_data_offs = get_le16(pb); if (seq->current_pal_data_offs != 0) { seq->current_pal_data_size = 768; } else { seq->current_pal_data_size = 0; } for (i = 0; i < 4; i++) buffer_num[i] = get_byte(pb); for (i = 0; i < 4; i++) offset_table[i] = get_le16(pb); for (i = 0; i < 3; i++) { if (offset_table[i] != 0) { for (e = i + 1; e < 4 && offset_table[e] == 0; e++); err = seq_fill_buffer(seq, pb, buffer_num[1 + i], offset_table[i], offset_table[e] - offset_table[i]); if (err != 0) return err; } } if (buffer_num[0] != 255) { if (buffer_num[0] >= SEQ_NUM_FRAME_BUFFERS) return AVERROR_INVALIDDATA; seq_buffer = &seq->frame_buffers[buffer_num[0]]; seq->current_video_data_size = seq_buffer->fill_size; seq->current_video_data_ptr = seq_buffer->data; seq_buffer->fill_size = 0; } else { seq->current_video_data_size = 0; seq->current_video_data_ptr = 0; } return 0; } libavformat/tiertexseq.c:158: error: Uninitialized Value The value read from offset_table[_] was never initialized. libavformat/tiertexseq.c:158:38: 156. for (i = 0; i < 3; i++) { 157. if (offset_table[i] != 0) { 158. for (e = i + 1; e < 4 && offset_table[e] == 0; e++); ^ 159. err = seq_fill_buffer(seq, pb, buffer_num[1 + i], 160. offset_table[i],
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/tiertexseq.c/#L158
d2a_code_trace_data_41367
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:1061: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1061:9: 1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) ) 1060. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) ) 1061. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, ^ 1062. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1063. CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1061
d2a_code_trace_data_41368
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } apps/s_time.c:262: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace apps/s_time.c:229:21: Call 227. break; 228. 229. if ((scon = doConnection(NULL, host, ctx)) == NULL) ^ 230. goto end; 231. apps/s_time.c:384:21: Call 382. 383. if (scon == NULL) 384. serverCon = SSL_new(ctx); ^ 385. else { 386. serverCon = scon; ssl/ssl_lib.c:522:1: Parameter `ctx->sessions->num_items` 520. } 521. 522. > SSL *SSL_new(SSL_CTX *ctx) 523. { 524. SSL *s; apps/s_time.c:262:9: Call 260. fflush(stdout); 261. 262. SSL_free(scon); ^ 263. scon = NULL; 264. } 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_41369
int BN_set_bit(BIGNUM *a, int n) { int i, j, k; if (n < 0) return 0; i = n / BN_BITS2; j = n % BN_BITS2; if (a->top <= i) { if (bn_wexpand(a, i + 1) == NULL) return (0); for (k = a->top; k < i + 1; k++) a->d[k] = 0; a->top = i + 1; } a->d[i] |= (((BN_ULONG)1) << j); bn_check_top(a); return (1); } test/bntest.c:1605: error: BUFFER_OVERRUN_L3 Offset: [0, 193] Size: [0, 8388607] by call to `BN_GF2m_arr2poly`. Showing all 9 steps of the trace test/bntest.c:1595:16: Assignment 1593. int i, j, s = 0, t, ret = 0; 1594. int p0[] = { 163, 7, 6, 3, 0, -1 }; 1595. int p1[] = { 193, 15, 0, -1 }; ^ 1596. 1597. a = BN_new(); test/bntest.c:1605:5: Call 1603. 1604. BN_GF2m_arr2poly(p0, b[0]); 1605. BN_GF2m_arr2poly(p1, b[1]); ^ 1606. 1607. for (i = 0; i < num0; i++) { crypto/bn/bn_gf2m.c:1209:1: Parameter `*p` 1207. * bit-string. The array must be terminated by -1. 1208. */ 1209. > int BN_GF2m_arr2poly(const int p[], BIGNUM *a) 1210. { 1211. int i; crypto/bn/bn_gf2m.c:1216:13: Call 1214. BN_zero(a); 1215. for (i = 0; p[i] != -1; i++) { 1216. if (BN_set_bit(a, p[i]) == 0) ^ 1217. return 0; 1218. } crypto/bn/bn_lib.c:692:1: <Offset trace> 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: Parameter `a->top` 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: <Length trace> 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:692:1: Parameter `*a->d` 690. } 691. 692. > int BN_set_bit(BIGNUM *a, int n) 693. { 694. int i, j, k; crypto/bn/bn_lib.c:709:5: Array access: Offset: [0, 193] Size: [0, 8388607] by call to `BN_GF2m_arr2poly` 707. } 708. 709. a->d[i] |= (((BN_ULONG)1) << j); ^ 710. bn_check_top(a); 711. return (1);
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_lib.c/#L709
d2a_code_trace_data_41370
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/bntest.c:207: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `BN_lshift`. Showing all 11 steps of the trace test/bntest.c:55:1: Assignment 53. } MPITEST; 54. 55. > static const int NUM0 = 100; /* number of tests */ 56. static const int NUM1 = 50; /* additional tests for some functions */ 57. static BN_CTX *ctx; test/bntest.c:207:13: Call 205. BN_bntest_rand(a, 400, 0, 0); 206. BN_copy(b, a); 207. BN_lshift(a, a, i); ^ 208. BN_add_word(a, i); 209. } else 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 `BN_lshift` 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/ae269dd8b72dbed1f2c5f92dbe0fbf5b7b905e7b/crypto/bn/bn_shift.c/#L112
d2a_code_trace_data_41371
int BN_num_bits_word(BN_ULONG l) { static const unsigned char bits[256] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; #if defined(SIXTY_FOUR_BIT_LONG) if (l & 0xffffffff00000000L) { if (l & 0xffff000000000000L) { if (l & 0xff00000000000000L) { return (bits[(int)(l >> 56)] + 56); } else return (bits[(int)(l >> 48)] + 48); } else { if (l & 0x0000ff0000000000L) { return (bits[(int)(l >> 40)] + 40); } else return (bits[(int)(l >> 32)] + 32); } } else #else # ifdef SIXTY_FOUR_BIT if (l & 0xffffffff00000000LL) { if (l & 0xffff000000000000LL) { if (l & 0xff00000000000000LL) { return (bits[(int)(l >> 56)] + 56); } else return (bits[(int)(l >> 48)] + 48); } else { if (l & 0x0000ff0000000000LL) { return (bits[(int)(l >> 40)] + 40); } else return (bits[(int)(l >> 32)] + 32); } } else # endif #endif { #if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG) if (l & 0xffff0000L) { if (l & 0xff000000L) return (bits[(int)(l >> 24L)] + 24); else return (bits[(int)(l >> 16L)] + 16); } else #endif { #if defined(THIRTY_TWO_BIT) || defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG) if (l & 0xff00L) return (bits[(int)(l >> 8)] + 8); else #endif return (bits[(int)(l)]); } } } test/bntest.c:527: error: BUFFER_OVERRUN_L2 Offset: [0, 18446744073709551615] Size: 256 by call to `BN_mod_word`. Showing all 14 steps of the trace test/bntest.c:526:9: Call 524. 525. s = b->d[0]; 526. BN_copy(b, a); ^ 527. rmod = BN_mod_word(b, s); 528. r = BN_div_word(b, s); crypto/bn/bn_lib.c:362:1: Parameter `*a->d` 360. } 361. 362. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 363. { 364. int i; test/bntest.c:525:9: Assignment 523. } while (BN_is_zero(b)); 524. 525. s = b->d[0]; ^ 526. BN_copy(b, a); 527. rmod = BN_mod_word(b, s); test/bntest.c:527:16: Call 525. s = b->d[0]; 526. BN_copy(b, a); 527. rmod = BN_mod_word(b, s); ^ 528. r = BN_div_word(b, s); 529. crypto/bn/bn_word.c:13:1: Parameter `w` 11. #include "bn_lcl.h" 12. 13. > BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) 14. { 15. #ifndef BN_LLONG crypto/bn/bn_word.c:35:15: Call 33. return (BN_ULONG)-1; 34. 35. ret = BN_div_word(tmp, w); ^ 36. BN_free(tmp); 37. crypto/bn/bn_word.c:61:1: Parameter `w` 59. } 60. 61. > BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) 62. { 63. BN_ULONG ret = 0; crypto/bn/bn_word.c:67:5: Assignment 65. 66. bn_check_top(a); 67. w &= BN_MASK2; ^ 68. 69. if (!w) crypto/bn/bn_word.c:76:20: Call 74. 75. /* normalize input (so bn_div_words doesn't complain) */ 76. j = BN_BITS2 - BN_num_bits_word(w); ^ 77. w <<= j; 78. if (!BN_lshift(a, a, j)) crypto/bn/bn_lib.c:89:1: <Offset trace> 87. } 88. 89. > int BN_num_bits_word(BN_ULONG l) 90. { 91. static const unsigned char bits[256] = { crypto/bn/bn_lib.c:89:1: Parameter `l` 87. } 88. 89. > int BN_num_bits_word(BN_ULONG l) 90. { 91. static const unsigned char bits[256] = { crypto/bn/bn_lib.c:91:5: <Length trace> 89. int BN_num_bits_word(BN_ULONG l) 90. { 91. static const unsigned char bits[256] = { ^ 92. 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 93. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, crypto/bn/bn_lib.c:91:5: Array declaration 89. int BN_num_bits_word(BN_ULONG l) 90. { 91. static const unsigned char bits[256] = { ^ 92. 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 93. 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, crypto/bn/bn_lib.c:114:25: Array access: Offset: [0, 18446744073709551615] Size: 256 by call to `BN_mod_word` 112. if (l & 0xffff000000000000L) { 113. if (l & 0xff00000000000000L) { 114. return (bits[(int)(l >> 56)] + 56); ^ 115. } else 116. return (bits[(int)(l >> 48)] + 48);
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_lib.c/#L114
d2a_code_trace_data_41372
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; return 1; } ssl/t1_lib.c:1444: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `s->s3->previous_server_finished_len` + `pkt->written` + 21]):unsigned64 by call to `WPACKET_start_sub_packet_len__`. Showing all 12 steps of the trace ssl/t1_lib.c:1443:14: Call 1441. tls1_get_formatlist(s, &plist, &plistlen); 1442. 1443. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats) ^ 1444. || !WPACKET_start_sub_packet_u16(pkt) 1445. || !WPACKET_sub_memcpy_u8(pkt, plist, plistlen) ssl/packet.c:261:1: Parameter `pkt->buf->length` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; ssl/t1_lib.c:1444:21: Call 1442. 1443. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_ec_point_formats) 1444. || !WPACKET_start_sub_packet_u16(pkt) ^ 1445. || !WPACKET_sub_memcpy_u8(pkt, plist, plistlen) 1446. || !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, s->s3->previous_client_finished_len + s->s3->previous_server_finished_len + pkt->written + 21]):unsigned64 by call to `WPACKET_start_sub_packet_len__` 44. return 0; 45. 46. if (pkt->buf->length - pkt->written < len) { ^ 47. size_t newlen; 48. size_t reflen;
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
d2a_code_trace_data_41373
static void pred8x8l_down_left_c(uint8_t *src, int has_topleft, int has_topright, int stride) { PREDICT_8x8_LOAD_TOP; PREDICT_8x8_LOAD_TOPRIGHT; SRC(0,0)= (t0 + 2*t1 + t2 + 2) >> 2; SRC(0,1)=SRC(1,0)= (t1 + 2*t2 + t3 + 2) >> 2; SRC(0,2)=SRC(1,1)=SRC(2,0)= (t2 + 2*t3 + t4 + 2) >> 2; SRC(0,3)=SRC(1,2)=SRC(2,1)=SRC(3,0)= (t3 + 2*t4 + t5 + 2) >> 2; SRC(0,4)=SRC(1,3)=SRC(2,2)=SRC(3,1)=SRC(4,0)= (t4 + 2*t5 + t6 + 2) >> 2; SRC(0,5)=SRC(1,4)=SRC(2,3)=SRC(3,2)=SRC(4,1)=SRC(5,0)= (t5 + 2*t6 + t7 + 2) >> 2; SRC(0,6)=SRC(1,5)=SRC(2,4)=SRC(3,3)=SRC(4,2)=SRC(5,1)=SRC(6,0)= (t6 + 2*t7 + t8 + 2) >> 2; SRC(0,7)=SRC(1,6)=SRC(2,5)=SRC(3,4)=SRC(4,3)=SRC(5,2)=SRC(6,1)=SRC(7,0)= (t7 + 2*t8 + t9 + 2) >> 2; SRC(1,7)=SRC(2,6)=SRC(3,5)=SRC(4,4)=SRC(5,3)=SRC(6,2)=SRC(7,1)= (t8 + 2*t9 + t10 + 2) >> 2; SRC(2,7)=SRC(3,6)=SRC(4,5)=SRC(5,4)=SRC(6,3)=SRC(7,2)= (t9 + 2*t10 + t11 + 2) >> 2; SRC(3,7)=SRC(4,6)=SRC(5,5)=SRC(6,4)=SRC(7,3)= (t10 + 2*t11 + t12 + 2) >> 2; SRC(4,7)=SRC(5,6)=SRC(6,5)=SRC(7,4)= (t11 + 2*t12 + t13 + 2) >> 2; SRC(5,7)=SRC(6,6)=SRC(7,5)= (t12 + 2*t13 + t14 + 2) >> 2; SRC(6,7)=SRC(7,6)= (t13 + 2*t14 + t15 + 2) >> 2; SRC(7,7)= (t14 + 3*t15 + 2) >> 2; } libavcodec/h264pred.c:842: error: Uninitialized Value The value read from t7 was never initialized. libavcodec/h264pred.c:842:59: 840. SRC(0,4)=SRC(1,3)=SRC(2,2)=SRC(3,1)=SRC(4,0)= (t4 + 2*t5 + t6 + 2) >> 2; 841. SRC(0,5)=SRC(1,4)=SRC(2,3)=SRC(3,2)=SRC(4,1)=SRC(5,0)= (t5 + 2*t6 + t7 + 2) >> 2; 842. SRC(0,6)=SRC(1,5)=SRC(2,4)=SRC(3,3)=SRC(4,2)=SRC(5,1)=SRC(6,0)= (t6 + 2*t7 + t8 + 2) >> 2; ^ 843. SRC(0,7)=SRC(1,6)=SRC(2,5)=SRC(3,4)=SRC(4,3)=SRC(5,2)=SRC(6,1)=SRC(7,0)= (t7 + 2*t8 + t9 + 2) >> 2; 844. SRC(1,7)=SRC(2,6)=SRC(3,5)=SRC(4,4)=SRC(5,3)=SRC(6,2)=SRC(7,1)= (t8 + 2*t9 + t10 + 2) >> 2;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264pred.c/#L842
d2a_code_trace_data_41374
int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow){ const int *qmat; const uint8_t *scantable= s->intra_scantable.scantable; const uint8_t *perm_scantable= s->intra_scantable.permutated; int max=0; unsigned int threshold1, threshold2; int bias=0; int run_tab[65]; int level_tab[65]; int score_tab[65]; int survivor[65]; int survivor_count; int last_run=0; int last_level=0; int last_score= 0; int last_i; int coeff[2][64]; int coeff_count[64]; int qmul, qadd, start_i, last_non_zero, i, dc; const int esc_length= s->ac_esc_length; uint8_t * length; uint8_t * last_length; const int lambda= s->lambda2 >> (FF_LAMBDA_SHIFT - 6); s->dsp.fdct (block); if(s->dct_error_sum) s->denoise_dct(s, block); qmul= qscale*16; qadd= ((qscale-1)|1)*8; if (s->mb_intra) { int q; if (!s->h263_aic) { if (n < 4) q = s->y_dc_scale; else q = s->c_dc_scale; q = q << 3; } else{ q = 1 << 3; qadd=0; } block[0] = (block[0] + (q >> 1)) / q; start_i = 1; last_non_zero = 0; qmat = s->q_intra_matrix[qscale]; if(s->mpeg_quant || s->out_format == FMT_MPEG1) bias= 1<<(QMAT_SHIFT-1); length = s->intra_ac_vlc_length; last_length= s->intra_ac_vlc_last_length; } else { start_i = 0; last_non_zero = -1; qmat = s->q_inter_matrix[qscale]; length = s->inter_ac_vlc_length; last_length= s->inter_ac_vlc_last_length; } last_i= start_i; threshold1= (1<<QMAT_SHIFT) - bias - 1; threshold2= (threshold1<<1); for(i=63; i>=start_i; i--) { const int j = scantable[i]; int level = block[j] * qmat[j]; if(((unsigned)(level+threshold1))>threshold2){ last_non_zero = i; break; } } for(i=start_i; i<=last_non_zero; i++) { const int j = scantable[i]; int level = block[j] * qmat[j]; if(((unsigned)(level+threshold1))>threshold2){ if(level>0){ level= (bias + level)>>QMAT_SHIFT; coeff[0][i]= level; coeff[1][i]= level-1; }else{ level= (bias - level)>>QMAT_SHIFT; coeff[0][i]= -level; coeff[1][i]= -level+1; } coeff_count[i]= FFMIN(level, 2); assert(coeff_count[i]); max |=level; }else{ coeff[0][i]= (level>>31)|1; coeff_count[i]= 1; } } *overflow= s->max_qcoeff < max; if(last_non_zero < start_i){ memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM)); return last_non_zero; } score_tab[start_i]= 0; survivor[0]= start_i; survivor_count= 1; for(i=start_i; i<=last_non_zero; i++){ int level_index, j, zero_distoration; int dct_coeff= FFABS(block[ scantable[i] ]); int best_score=256*256*256*120; if ( s->dsp.fdct == fdct_ifast #ifndef FAAN_POSTSCALE || s->dsp.fdct == ff_faandct #endif ) dct_coeff= (dct_coeff*inv_aanscales[ scantable[i] ]) >> 12; zero_distoration= dct_coeff*dct_coeff; for(level_index=0; level_index < coeff_count[i]; level_index++){ int distoration; int level= coeff[level_index][i]; const int alevel= FFABS(level); int unquant_coeff; assert(level); if(s->out_format == FMT_H263){ unquant_coeff= alevel*qmul + qadd; }else{ j= s->dsp.idct_permutation[ scantable[i] ]; if(s->mb_intra){ unquant_coeff = (int)( alevel * qscale * s->intra_matrix[j]) >> 3; unquant_coeff = (unquant_coeff - 1) | 1; }else{ unquant_coeff = ((( alevel << 1) + 1) * qscale * ((int) s->inter_matrix[j])) >> 4; unquant_coeff = (unquant_coeff - 1) | 1; } unquant_coeff<<= 3; } distoration= (unquant_coeff - dct_coeff) * (unquant_coeff - dct_coeff) - zero_distoration; level+=64; if((level&(~127)) == 0){ for(j=survivor_count-1; j>=0; j--){ int run= i - survivor[j]; int score= distoration + length[UNI_AC_ENC_INDEX(run, level)]*lambda; score += score_tab[i-run]; if(score < best_score){ best_score= score; run_tab[i+1]= run; level_tab[i+1]= level-64; } } if(s->out_format == FMT_H263){ for(j=survivor_count-1; j>=0; j--){ int run= i - survivor[j]; int score= distoration + last_length[UNI_AC_ENC_INDEX(run, level)]*lambda; score += score_tab[i-run]; if(score < last_score){ last_score= score; last_run= run; last_level= level-64; last_i= i+1; } } } }else{ distoration += esc_length*lambda; for(j=survivor_count-1; j>=0; j--){ int run= i - survivor[j]; int score= distoration + score_tab[i-run]; if(score < best_score){ best_score= score; run_tab[i+1]= run; level_tab[i+1]= level-64; } } if(s->out_format == FMT_H263){ for(j=survivor_count-1; j>=0; j--){ int run= i - survivor[j]; int score= distoration + score_tab[i-run]; if(score < last_score){ last_score= score; last_run= run; last_level= level-64; last_i= i+1; } } } } } score_tab[i+1]= best_score; if(last_non_zero <= 27){ for(; survivor_count; survivor_count--){ if(score_tab[ survivor[survivor_count-1] ] <= best_score) break; } }else{ for(; survivor_count; survivor_count--){ if(score_tab[ survivor[survivor_count-1] ] <= best_score + lambda) break; } } survivor[ survivor_count++ ]= i+1; } if(s->out_format != FMT_H263){ last_score= 256*256*256*120; for(i= survivor[0]; i<=last_non_zero + 1; i++){ int score= score_tab[i]; if(i) score += lambda*2; if(score < last_score){ last_score= score; last_i= i; last_level= level_tab[i]; last_run= run_tab[i]; } } } s->coded_score[n] = last_score; dc= FFABS(block[0]); last_non_zero= last_i - 1; memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM)); if(last_non_zero < start_i) return last_non_zero; if(last_non_zero == 0 && start_i == 0){ int best_level= 0; int best_score= dc * dc; for(i=0; i<coeff_count[0]; i++){ int level= coeff[i][0]; int alevel= FFABS(level); int unquant_coeff, score, distortion; if(s->out_format == FMT_H263){ unquant_coeff= (alevel*qmul + qadd)>>3; }else{ unquant_coeff = ((( alevel << 1) + 1) * qscale * ((int) s->inter_matrix[0])) >> 4; unquant_coeff = (unquant_coeff - 1) | 1; } unquant_coeff = (unquant_coeff + 4) >> 3; unquant_coeff<<= 3 + 3; distortion= (unquant_coeff - dc) * (unquant_coeff - dc); level+=64; if((level&(~127)) == 0) score= distortion + last_length[UNI_AC_ENC_INDEX(0, level)]*lambda; else score= distortion + esc_length*lambda; if(score < best_score){ best_score= score; best_level= level - 64; } } block[0]= best_level; s->coded_score[n] = best_score - dc*dc; if(best_level == 0) return -1; else return last_non_zero; } i= last_i; assert(last_level); block[ perm_scantable[last_non_zero] ]= last_level; i -= last_run + 1; for(; i>start_i; i -= run_tab[i] + 1){ block[ perm_scantable[i-1] ]= level_tab[i]; } return last_non_zero; } libavcodec/mpegvideo_enc.c:3254: error: Uninitialized Value The value read from level_tab[_] was never initialized. libavcodec/mpegvideo_enc.c:3254:9: 3252. 3253. for(; i>start_i; i -= run_tab[i] + 1){ 3254. block[ perm_scantable[i-1] ]= level_tab[i]; ^ 3255. } 3256.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L3254
d2a_code_trace_data_41375
static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr) { register const MPA_INT *w, *w2, *p; int j; OUT_INT *samples2; #if CONFIG_FLOAT float sum, sum2; #elif FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif memcpy(synth_buf + 512, synth_buf, 32 * sizeof(*synth_buf)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(MACS, sum, w, p); p = synth_buf + 48; SUM8(MLSS, sum, w + 32, p); *samples = round_sample(&sum); samples += incr; w++; for(j=1;j<16;j++) { sum2 = 0; p = synth_buf + 16 + j; SUM8P2(sum, MACS, sum2, MLSS, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, MLSS, sum2, MLSS, w + 32, w2 + 32, p); *samples = round_sample(&sum); samples += incr; sum += sum2; *samples2 = round_sample(&sum); samples2 -= incr; w++; w2--; } p = synth_buf + 32; SUM8(MLSS, sum, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; } libavcodec/mpc.c:54: error: Buffer Overrun L2 Offset: [80+min(0, `c->synth_buf_offset[*]`), 81+max(511, `c->synth_buf_offset[*]`)] (⇐ [16+min(0, `c->synth_buf_offset[*]`), 17+max(511, `c->synth_buf_offset[*]`)] + 64) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:45:1: Parameter `c->synth_buf[*]` 43. * Process decoded Musepack data and produce PCM 44. */ 45. static void mpc_synth(MPCContext *c, int16_t *out) ^ 46. { 47. int dither_state = 0; libavcodec/mpc.c:54:13: Call 52. samples_ptr = samples + ch; 53. for(i = 0; i < SAMPLES_PER_BAND; i++) { 54. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 55. ff_mpa_synth_window, &dither_state, 56. samples_ptr, 2, libavcodec/mpegaudiodec.c:705:1: Parameter `*synth_buf_ptr` 703. /* XXX: optimize by avoiding ring buffer usage */ 704. #if !CONFIG_FLOAT 705. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 706. MPA_INT *window, int *dither_state, 707. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:718:5: Assignment 716. 717. offset = *synth_buf_offset; 718. synth_buf = synth_buf_ptr + offset; ^ 719. 720. #if FRAC_BITS <= 15 libavcodec/mpegaudiodec.c:731:5: Call 729. #endif 730. 731. apply_window_mp3_c(synth_buf, window, dither_state, samples, incr); ^ 732. 733. offset = (offset - 32) & 511; libavcodec/mpegaudiodec.c:646:1: <Length trace> 644. } 645. 646. static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, ^ 647. int *dither_state, OUT_INT *samples, int incr) 648. { libavcodec/mpegaudiodec.c:646:1: Parameter `*synth_buf` 644. } 645. 646. static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window, ^ 647. int *dither_state, OUT_INT *samples, int incr) 648. { libavcodec/mpegaudiodec.c:668:5: Assignment 666. 667. sum = *dither_state; 668. p = synth_buf + 16; ^ 669. SUM8(MACS, sum, w, p); 670. p = synth_buf + 48; libavcodec/mpegaudiodec.c:669:5: Array access: Offset: [80+min(0, c->synth_buf_offset[*]), 81+max(511, c->synth_buf_offset[*])] (⇐ [16+min(0, c->synth_buf_offset[*]), 17+max(511, c->synth_buf_offset[*])] + 64) Size: 2 by call to `ff_mpa_synth_filter` 667. sum = *dither_state; 668. p = synth_buf + 16; 669. SUM8(MACS, sum, w, p); ^ 670. p = synth_buf + 48; 671. SUM8(MLSS, sum, w + 32, p);
https://github.com/libav/libav/blob/63e8d9760f23a4edf81e9ae58c4f6d3baa6ff4dd/libavcodec/mpegaudiodec.c/#L669
d2a_code_trace_data_41376
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } crypto/x509v3/v3_ocsp.c:198: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print`. Showing all 7 steps of the trace crypto/x509v3/v3_ocsp.c:198:10: Call 196. if (BIO_printf(bp, "%*s", ind, "") <= 0) 197. return 0; 198. if (!ASN1_GENERALIZEDTIME_print(bp, cutoff)) ^ 199. return 0; 200. return 1; crypto/asn1/t_x509.c:407:1: <Offset trace> 405. }; 406. 407. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 408. { 409. char *v; crypto/asn1/t_x509.c:407:1: Parameter `*tm->data` 405. }; 406. 407. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 408. { 409. char *v; crypto/asn1/t_x509.c:428:5: Assignment 426. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 427. + (v[2] - '0') * 10 + (v[3] - '0'); 428. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 429. if ((M > 12) || (M < 1)) 430. goto err; crypto/asn1/t_x509.c:402:1: <Length trace> 400. } 401. 402. > static const char *mon[12] = { 403. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 404. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/t_x509.c:402:1: Array declaration 400. } 401. 402. > static const char *mon[12] = { 403. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 404. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/t_x509.c:449:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print` 447. 448. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 449. mon[M - 1], d, h, m, s, f_len, f, y, ^ 450. (gmt) ? " GMT" : "") <= 0) 451. return (0);
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/crypto/asn1/t_x509.c/#L449
d2a_code_trace_data_41377
static void new_audio_stream(AVFormatContext *oc) { AVStream *st; AVCodecContext *audio_enc; int codec_id; st = av_new_stream(oc, oc->nb_streams); if (!st) { fprintf(stderr, "Could not alloc stream\n"); av_exit(1); } avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO); bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters; audio_bitstream_filters= NULL; if(thread_count>1) avcodec_thread_init(st->codec, thread_count); audio_enc = st->codec; audio_enc->codec_type = CODEC_TYPE_AUDIO; if(audio_codec_tag) audio_enc->codec_tag= audio_codec_tag; if (oc->oformat->flags & AVFMT_GLOBALHEADER) { audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; avcodec_opts[CODEC_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER; } if (audio_stream_copy) { st->stream_copy = 1; audio_enc->channels = audio_channels; } else { AVCodec *codec; set_context_opts(audio_enc, avcodec_opts[CODEC_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM); if (audio_codec_name) { codec_id = find_codec_or_die(audio_codec_name, CODEC_TYPE_AUDIO, 1); codec = avcodec_find_encoder_by_name(audio_codec_name); output_codecs[nb_ocodecs] = codec; } else { codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_AUDIO); codec = avcodec_find_encoder(codec_id); } audio_enc->codec_id = codec_id; if (audio_qscale > QSCALE_NONE) { audio_enc->flags |= CODEC_FLAG_QSCALE; audio_enc->global_quality = st->quality = FF_QP2LAMBDA * audio_qscale; } audio_enc->thread_count = thread_count; audio_enc->channels = audio_channels; audio_enc->sample_fmt = audio_sample_fmt; audio_enc->channel_layout = channel_layout; if(codec && codec->sample_fmts){ const enum SampleFormat *p= codec->sample_fmts; for(; *p!=-1; p++){ if(*p == audio_enc->sample_fmt) break; } if(*p == -1) audio_enc->sample_fmt = codec->sample_fmts[0]; } } nb_ocodecs++; audio_enc->sample_rate = audio_sample_rate; audio_enc->time_base= (AVRational){1, audio_sample_rate}; if (audio_language) { av_metadata_set(&st->metadata, "language", audio_language); av_free(audio_language); audio_language = NULL; } audio_disable = 0; av_freep(&audio_codec_name); audio_stream_copy = 0; } ffmpeg.c:3124: error: Null Dereference pointer `st` last assigned on line 3119 could be null and is dereferenced at line 3124, column 35. ffmpeg.c:3113:1: start of procedure new_audio_stream() 3111. } 3112. 3113. static void new_audio_stream(AVFormatContext *oc) ^ 3114. { 3115. AVStream *st; ffmpeg.c:3119:5: 3117. int codec_id; 3118. 3119. st = av_new_stream(oc, oc->nb_streams); ^ 3120. if (!st) { 3121. fprintf(stderr, "Could not alloc stream\n"); libavformat/utils.c:2344:1: start of procedure av_new_stream() 2342. } 2343. 2344. AVStream *av_new_stream(AVFormatContext *s, int id) ^ 2345. { 2346. AVStream *st; libavformat/utils.c:2349:9: Taking true branch 2347. int i; 2348. 2349. if (s->nb_streams >= MAX_STREAMS) ^ 2350. return NULL; 2351. libavformat/utils.c:2350:9: 2348. 2349. if (s->nb_streams >= MAX_STREAMS) 2350. return NULL; ^ 2351. 2352. st = av_mallocz(sizeof(AVStream)); libavformat/utils.c:2383:1: return from a call to av_new_stream 2381. s->streams[s->nb_streams++] = st; 2382. return st; 2383. } ^ 2384. 2385. AVProgram *av_new_program(AVFormatContext *ac, int id) ffmpeg.c:3120:10: Taking true branch 3118. 3119. st = av_new_stream(oc, oc->nb_streams); 3120. if (!st) { ^ 3121. fprintf(stderr, "Could not alloc stream\n"); 3122. av_exit(1); ffmpeg.c:3121:9: 3119. st = av_new_stream(oc, oc->nb_streams); 3120. if (!st) { 3121. fprintf(stderr, "Could not alloc stream\n"); ^ 3122. av_exit(1); 3123. } ffmpeg.c:3122:9: Skipping av_exit(): empty list of specs 3120. if (!st) { 3121. fprintf(stderr, "Could not alloc stream\n"); 3122. av_exit(1); ^ 3123. } 3124. avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO); ffmpeg.c:3124:5: 3122. av_exit(1); 3123. } 3124. avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO); ^ 3125. 3126. bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
https://github.com/libav/libav/blob/184bc53db4fded8857af09cee2adc7197940deb7/ffmpeg.c/#L3124
d2a_code_trace_data_41378
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/bn/bn_prime.c:527: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rand`. Showing all 21 steps of the trace crypto/bn/bn_prime.c:518:10: Call 516. bits--; 517. BN_CTX_start(ctx); 518. t1 = BN_CTX_get(ctx); ^ 519. q = BN_CTX_get(ctx); 520. qadd = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:240:5: Call 238. } 239. /* OK, make sure the returned bignum is "zero" */ 240. BN_zero(ret); ^ 241. /* clear BN_FLG_CONSTTIME if leaked from previous frames */ 242. ret->flags &= (~BN_FLG_CONSTTIME); crypto/bn/bn_lib.c:361:1: Parameter `*a->d` 359. } 360. 361. > int BN_set_word(BIGNUM *a, BN_ULONG w) 362. { 363. bn_check_top(a); crypto/bn/bn_lib.c:364:9: Call 362. { 363. bn_check_top(a); 364. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 365. return 0; 366. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `*a->d` 658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 659. 660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 661. { 662. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_prime.c:527:10: Call 525. goto err; 526. 527. if (!BN_rand(q, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) ^ 528. goto err; 529. crypto/bn/bn_rand.c:106:1: Parameter `*rnd->d` 104. return bnrand(NORMAL, rnd, bits, top, bottom, ctx); 105. } 106. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL); crypto/bn/bn_rand.c:108:12: Call 106. int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL); ^ 109. } 110. crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d` 21. } BNRAND_FLAG; 22. 23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom, 24. BN_CTX *ctx) 25. { crypto/bn/bn_rand.c:89:10: Call 87. if (bottom) /* set bottom bit if requested */ 88. buf[bytes - 1] |= 1; 89. if (!BN_bin2bn(buf, bytes, rnd)) ^ 90. goto err; 91. ret = 1; crypto/bn/bn_lib.c:374:1: Parameter `*ret->d` 372. } 373. 374. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) 375. { 376. unsigned int i, m; crypto/bn/bn_lib.c:396:9: Call 394. i = ((n - 1) / BN_BYTES) + 1; 395. m = ((n - 1) % (BN_BYTES)); 396. if (bn_wexpand(ret, (int)i) == NULL) { ^ 397. BN_free(bn); 398. return NULL; crypto/bn/bn_lib.c:962:1: Parameter `*a->d` 960. } 961. 962. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:964:37: Call 962. BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 965. } 966. crypto/bn/bn_lib.c:245:1: Parameter `*b->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_rand` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_41379
static int init_context_frame(MpegEncContext *s) { int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y; s->mb_width = (s->width + 15) / 16; s->mb_stride = s->mb_width + 1; s->b8_stride = s->mb_width * 2 + 1; s->b4_stride = s->mb_width * 4 + 1; mb_array_size = s->mb_height * s->mb_stride; mv_table_size = (s->mb_height + 2) * s->mb_stride + 1; s->h_edge_pos = s->mb_width * 16; s->v_edge_pos = s->mb_height * 16; s->mb_num = s->mb_width * s->mb_height; s->block_wrap[0] = s->block_wrap[1] = s->block_wrap[2] = s->block_wrap[3] = s->b8_stride; s->block_wrap[4] = s->block_wrap[5] = s->mb_stride; y_size = s->b8_stride * (2 * s->mb_height + 1); c_size = s->mb_stride * (s->mb_height + 1); yc_size = y_size + 2 * c_size; FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), fail); for (y = 0; y < s->mb_height; y++) for (x = 0; x < s->mb_width; x++) s->mb_index2xy[x + y * s->mb_width] = x + y * s->mb_stride; s->mb_index2xy[s->mb_height * s->mb_width] = (s->mb_height - 1) * s->mb_stride + s->mb_width; if (s->encoding) { FF_ALLOCZ_OR_GOTO(s->avctx, s->p_mv_table_base, mv_table_size * 2 * sizeof(int16_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->b_forw_mv_table_base, mv_table_size * 2 * sizeof(int16_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->b_back_mv_table_base, mv_table_size * 2 * sizeof(int16_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->b_bidir_forw_mv_table_base, mv_table_size * 2 * sizeof(int16_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->b_bidir_back_mv_table_base, mv_table_size * 2 * sizeof(int16_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->b_direct_mv_table_base, mv_table_size * 2 * sizeof(int16_t), fail); s->p_mv_table = s->p_mv_table_base + s->mb_stride + 1; s->b_forw_mv_table = s->b_forw_mv_table_base + s->mb_stride + 1; s->b_back_mv_table = s->b_back_mv_table_base + s->mb_stride + 1; s->b_bidir_forw_mv_table = s->b_bidir_forw_mv_table_base + s->mb_stride + 1; s->b_bidir_back_mv_table = s->b_bidir_back_mv_table_base + s->mb_stride + 1; s->b_direct_mv_table = s->b_direct_mv_table_base + s->mb_stride + 1; FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_type, mb_array_size * sizeof(uint16_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->lambda_table, mb_array_size * sizeof(int), fail); FF_ALLOC_OR_GOTO(s->avctx, s->cplx_tab, mb_array_size * sizeof(float), fail); FF_ALLOC_OR_GOTO(s->avctx, s->bits_tab, mb_array_size * sizeof(float), fail); } FF_ALLOC_OR_GOTO(s->avctx, s->er_temp_buffer, mb_array_size * sizeof(uint8_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->error_status_table, mb_array_size * sizeof(uint8_t), fail); if (s->codec_id == AV_CODEC_ID_MPEG4 || (s->flags & CODEC_FLAG_INTERLACED_ME)) { for (i = 0; i < 2; i++) { int j, k; for (j = 0; j < 2; j++) { for (k = 0; k < 2; k++) { FF_ALLOCZ_OR_GOTO(s->avctx, s->b_field_mv_table_base[i][j][k], mv_table_size * 2 * sizeof(int16_t), fail); s->b_field_mv_table[i][j][k] = s->b_field_mv_table_base[i][j][k] + s->mb_stride + 1; } FF_ALLOCZ_OR_GOTO(s->avctx, s->b_field_select_table [i][j], mb_array_size * 2 * sizeof(uint8_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->p_field_mv_table_base[i][j], mv_table_size * 2 * sizeof(int16_t), fail); s->p_field_mv_table[i][j] = s->p_field_mv_table_base[i][j] + s->mb_stride + 1; } FF_ALLOCZ_OR_GOTO(s->avctx, s->p_field_select_table[i], mb_array_size * 2 * sizeof(uint8_t), fail); } } if (s->out_format == FMT_H263) { FF_ALLOCZ_OR_GOTO(s->avctx, s->coded_block_base, y_size, fail); s->coded_block = s->coded_block_base + s->b8_stride + 1; FF_ALLOCZ_OR_GOTO(s->avctx, s->cbp_table, mb_array_size * sizeof(uint8_t), fail); FF_ALLOCZ_OR_GOTO(s->avctx, s->pred_dir_table, mb_array_size * sizeof(uint8_t), fail); } if (s->h263_pred || s->h263_plus || !s->encoding) { FF_ALLOCZ_OR_GOTO(s->avctx, s->dc_val_base, yc_size * sizeof(int16_t), fail); s->dc_val[0] = s->dc_val_base + s->b8_stride + 1; s->dc_val[1] = s->dc_val_base + y_size + s->mb_stride + 1; s->dc_val[2] = s->dc_val[1] + c_size; for (i = 0; i < yc_size; i++) s->dc_val_base[i] = 1024; } FF_ALLOCZ_OR_GOTO(s->avctx, s->mbintra_table, mb_array_size, fail); memset(s->mbintra_table, 1, mb_array_size); FF_ALLOCZ_OR_GOTO(s->avctx, s->mbskip_table, mb_array_size + 2, fail); if ((s->avctx->debug & (FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE)) || s->avctx->debug_mv) { s->visualization_buffer[0] = av_malloc((s->mb_width * 16 + 2 * EDGE_WIDTH) * s->mb_height * 16 + 2 * EDGE_WIDTH); s->visualization_buffer[1] = av_malloc((s->mb_width * 16 + 2 * EDGE_WIDTH) * s->mb_height * 16 + 2 * EDGE_WIDTH); s->visualization_buffer[2] = av_malloc((s->mb_width * 16 + 2 * EDGE_WIDTH) * s->mb_height * 16 + 2 * EDGE_WIDTH); } return 0; fail: return AVERROR(ENOMEM); } libavcodec/mpegvideo.c:754: error: Null Dereference pointer `s->mb_index2xy` last assigned on line 748 could be null and is dereferenced at line 754, column 5. libavcodec/mpegvideo.c:719:1: start of procedure init_context_frame() 717. * Initialize and allocates MpegEncContext fields dependent on the resolution. 718. */ 719. static int init_context_frame(MpegEncContext *s) ^ 720. { 721. int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y; libavcodec/mpegvideo.c:723:5: 721. int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y; 722. 723. s->mb_width = (s->width + 15) / 16; ^ 724. s->mb_stride = s->mb_width + 1; 725. s->b8_stride = s->mb_width * 2 + 1; libavcodec/mpegvideo.c:724:5: 722. 723. s->mb_width = (s->width + 15) / 16; 724. s->mb_stride = s->mb_width + 1; ^ 725. s->b8_stride = s->mb_width * 2 + 1; 726. s->b4_stride = s->mb_width * 4 + 1; libavcodec/mpegvideo.c:725:5: 723. s->mb_width = (s->width + 15) / 16; 724. s->mb_stride = s->mb_width + 1; 725. s->b8_stride = s->mb_width * 2 + 1; ^ 726. s->b4_stride = s->mb_width * 4 + 1; 727. mb_array_size = s->mb_height * s->mb_stride; libavcodec/mpegvideo.c:726:5: 724. s->mb_stride = s->mb_width + 1; 725. s->b8_stride = s->mb_width * 2 + 1; 726. s->b4_stride = s->mb_width * 4 + 1; ^ 727. mb_array_size = s->mb_height * s->mb_stride; 728. mv_table_size = (s->mb_height + 2) * s->mb_stride + 1; libavcodec/mpegvideo.c:727:5: 725. s->b8_stride = s->mb_width * 2 + 1; 726. s->b4_stride = s->mb_width * 4 + 1; 727. mb_array_size = s->mb_height * s->mb_stride; ^ 728. mv_table_size = (s->mb_height + 2) * s->mb_stride + 1; 729. libavcodec/mpegvideo.c:728:5: 726. s->b4_stride = s->mb_width * 4 + 1; 727. mb_array_size = s->mb_height * s->mb_stride; 728. mv_table_size = (s->mb_height + 2) * s->mb_stride + 1; ^ 729. 730. /* set default edge pos, will be overriden libavcodec/mpegvideo.c:732:5: 730. /* set default edge pos, will be overriden 731. * in decode_header if needed */ 732. s->h_edge_pos = s->mb_width * 16; ^ 733. s->v_edge_pos = s->mb_height * 16; 734. libavcodec/mpegvideo.c:733:5: 731. * in decode_header if needed */ 732. s->h_edge_pos = s->mb_width * 16; 733. s->v_edge_pos = s->mb_height * 16; ^ 734. 735. s->mb_num = s->mb_width * s->mb_height; libavcodec/mpegvideo.c:735:5: 733. s->v_edge_pos = s->mb_height * 16; 734. 735. s->mb_num = s->mb_width * s->mb_height; ^ 736. 737. s->block_wrap[0] = libavcodec/mpegvideo.c:737:5: 735. s->mb_num = s->mb_width * s->mb_height; 736. 737. s->block_wrap[0] = ^ 738. s->block_wrap[1] = 739. s->block_wrap[2] = libavcodec/mpegvideo.c:741:5: 739. s->block_wrap[2] = 740. s->block_wrap[3] = s->b8_stride; 741. s->block_wrap[4] = ^ 742. s->block_wrap[5] = s->mb_stride; 743. libavcodec/mpegvideo.c:744:5: 742. s->block_wrap[5] = s->mb_stride; 743. 744. y_size = s->b8_stride * (2 * s->mb_height + 1); ^ 745. c_size = s->mb_stride * (s->mb_height + 1); 746. yc_size = y_size + 2 * c_size; libavcodec/mpegvideo.c:745:5: 743. 744. y_size = s->b8_stride * (2 * s->mb_height + 1); 745. c_size = s->mb_stride * (s->mb_height + 1); ^ 746. yc_size = y_size + 2 * c_size; 747. libavcodec/mpegvideo.c:746:5: 744. y_size = s->b8_stride * (2 * s->mb_height + 1); 745. c_size = s->mb_stride * (s->mb_height + 1); 746. yc_size = y_size + 2 * c_size; ^ 747. 748. FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), libavcodec/mpegvideo.c:748:5: 746. yc_size = y_size + 2 * c_size; 747. 748. FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), ^ 749. fail); // error ressilience code looks cleaner with this 750. for (y = 0; y < s->mb_height; y++) libavutil/mem.c:158:1: start of procedure av_mallocz() 156. } 157. 158. void *av_mallocz(size_t size) ^ 159. { 160. void *ptr = av_malloc(size); libavutil/mem.c:160:5: 158. void *av_mallocz(size_t size) 159. { 160. void *ptr = av_malloc(size); ^ 161. if (ptr) 162. memset(ptr, 0, size); libavutil/mem.c:61:1: start of procedure av_malloc() 59. * linker will do it automatically. */ 60. 61. void *av_malloc(size_t size) ^ 62. { 63. void *ptr = NULL; libavutil/mem.c:63:5: 61. void *av_malloc(size_t size) 62. { 63. void *ptr = NULL; ^ 64. #if CONFIG_MEMALIGN_HACK 65. long diff; libavutil/mem.c:69:9: Taking true branch 67. 68. /* let's disallow possible ambiguous cases */ 69. if (size > (INT_MAX - 32) || !size) ^ 70. return NULL; 71. libavutil/mem.c:70:9: 68. /* let's disallow possible ambiguous cases */ 69. if (size > (INT_MAX - 32) || !size) 70. return NULL; ^ 71. 72. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:114:1: return from a call to av_malloc 112. #endif 113. return ptr; 114. } ^ 115. 116. void *av_realloc(void *ptr, size_t size) libavutil/mem.c:161:9: Taking false branch 159. { 160. void *ptr = av_malloc(size); 161. if (ptr) ^ 162. memset(ptr, 0, size); 163. return ptr; libavutil/mem.c:163:5: 161. if (ptr) 162. memset(ptr, 0, size); 163. return ptr; ^ 164. } 165. libavutil/mem.c:164:1: return from a call to av_mallocz 162. memset(ptr, 0, size); 163. return ptr; 164. } ^ 165. 166. char *av_strdup(const char *s) libavcodec/mpegvideo.c:748:5: Taking true branch 746. yc_size = y_size + 2 * c_size; 747. 748. FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), ^ 749. fail); // error ressilience code looks cleaner with this 750. for (y = 0; y < s->mb_height; y++) libavcodec/mpegvideo.c:748:5: Taking false branch 746. yc_size = y_size + 2 * c_size; 747. 748. FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), ^ 749. fail); // error ressilience code looks cleaner with this 750. for (y = 0; y < s->mb_height; y++) libavcodec/mpegvideo.c:750:10: 748. FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), 749. fail); // error ressilience code looks cleaner with this 750. for (y = 0; y < s->mb_height; y++) ^ 751. for (x = 0; x < s->mb_width; x++) 752. s->mb_index2xy[x + y * s->mb_width] = x + y * s->mb_stride; libavcodec/mpegvideo.c:750:17: Loop condition is false. Leaving loop 748. FF_ALLOCZ_OR_GOTO(s->avctx, s->mb_index2xy, (s->mb_num + 1) * sizeof(int), 749. fail); // error ressilience code looks cleaner with this 750. for (y = 0; y < s->mb_height; y++) ^ 751. for (x = 0; x < s->mb_width; x++) 752. s->mb_index2xy[x + y * s->mb_width] = x + y * s->mb_stride; libavcodec/mpegvideo.c:754:5: 752. s->mb_index2xy[x + y * s->mb_width] = x + y * s->mb_stride; 753. 754. s->mb_index2xy[s->mb_height * s->mb_width] = ^ 755. (s->mb_height - 1) * s->mb_stride + s->mb_width; // FIXME really needed? 756.
https://github.com/libav/libav/blob/45635885e44cb7adce35ac19279d48c1ef6c4779/libavcodec/mpegvideo.c/#L754
d2a_code_trace_data_41380
void CRYPTO_free(void *str) { #ifndef OPENSSL_NO_CRYPTO_MDEBUG if (call_malloc_debug) { CRYPTO_mem_debug_free(str, 0); free(str); CRYPTO_mem_debug_free(str, 1); } else { free(str); } #else free(str); #endif } crypto/hmac/hmac.c:257: error: USE_AFTER_FREE call to `HMAC_Init_ex()` eventually accesses memory that was invalidated by call to `free()` on line 255 indirectly during the call to `HMAC_CTX_new()`. Showing all 25 steps of the trace crypto/hmac/hmac.c:255:14: invalidation part of the trace starts here 253. if (md == NULL) 254. md = m; 255. if ((c = HMAC_CTX_new()) == NULL) ^ 256. goto err; 257. if (!HMAC_Init_ex(c, key, key_len, evp_md, NULL)) crypto/hmac/hmac.c:255:14: when calling `HMAC_CTX_new` here 253. if (md == NULL) 254. md = m; 255. if ((c = HMAC_CTX_new()) == NULL) ^ 256. goto err; 257. if (!HMAC_Init_ex(c, key, key_len, evp_md, NULL)) crypto/hmac/hmac.c:175:33: passed as argument to `CRYPTO_zalloc` 173. HMAC_CTX *HMAC_CTX_new(void) 174. { 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); ^ 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { crypto/hmac/hmac.c:175:33: return from call to `CRYPTO_zalloc` 173. HMAC_CTX *HMAC_CTX_new(void) 174. { 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); ^ 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { crypto/hmac/hmac.c:175:5: assigned 173. HMAC_CTX *HMAC_CTX_new(void) 174. { 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); ^ 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { crypto/hmac/hmac.c:177:14: when calling `HMAC_CTX_reset` here 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { ^ 178. HMAC_CTX_free(ctx); 179. ctx = NULL; crypto/hmac/hmac.c:205:1: parameter `ctx` of HMAC_CTX_reset 203. } 204. 205. > int HMAC_CTX_reset(HMAC_CTX *ctx) 206. { 207. hmac_ctx_cleanup(ctx); crypto/hmac/hmac.c:207:5: when calling `hmac_ctx_cleanup` here 205. int HMAC_CTX_reset(HMAC_CTX *ctx) 206. { 207. hmac_ctx_cleanup(ctx); ^ 208. if (ctx->i_ctx == NULL) 209. ctx->i_ctx = EVP_MD_CTX_new(); crypto/hmac/hmac.c:184:1: parameter `ctx` of hmac_ctx_cleanup 182. } 183. 184. > static void hmac_ctx_cleanup(HMAC_CTX *ctx) 185. { 186. EVP_MD_CTX_reset(ctx->i_ctx); crypto/hmac/hmac.c:188:5: when calling `EVP_MD_CTX_reset` here 186. EVP_MD_CTX_reset(ctx->i_ctx); 187. EVP_MD_CTX_reset(ctx->o_ctx); 188. EVP_MD_CTX_reset(ctx->md_ctx); ^ 189. ctx->md = NULL; 190. ctx->key_length = 0; crypto/evp/digest.c:123:1: parameter `ctx` of EVP_MD_CTX_reset 121. 122. /* This call frees resources associated with the context */ 123. > int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) 124. { 125. if (ctx == NULL) crypto/evp/digest.c:137:9: when calling `CRYPTO_clear_free` here 135. if (ctx->digest && ctx->digest->ctx_size && ctx->md_data 136. && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)) { 137. OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size); ^ 138. } 139. EVP_PKEY_CTX_free(ctx->pctx); crypto/mem.c:249:1: parameter `str` of CRYPTO_clear_free 247. } 248. 249. > void CRYPTO_clear_free(void *str, size_t num) 250. { 251. if (str == NULL) crypto/mem.c:255:5: when calling `CRYPTO_free` here 253. if (num) 254. OPENSSL_cleanse(str, num); 255. CRYPTO_free(str); ^ 256. } 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/hmac/hmac.c:255:14: use-after-lifetime part of the trace starts here 253. if (md == NULL) 254. md = m; 255. if ((c = HMAC_CTX_new()) == NULL) ^ 256. goto err; 257. if (!HMAC_Init_ex(c, key, key_len, evp_md, NULL)) crypto/hmac/hmac.c:255:14: passed as argument to `HMAC_CTX_new` 253. if (md == NULL) 254. md = m; 255. if ((c = HMAC_CTX_new()) == NULL) ^ 256. goto err; 257. if (!HMAC_Init_ex(c, key, key_len, evp_md, NULL)) crypto/hmac/hmac.c:175:33: passed as argument to `CRYPTO_zalloc` 173. HMAC_CTX *HMAC_CTX_new(void) 174. { 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); ^ 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { crypto/hmac/hmac.c:175:33: return from call to `CRYPTO_zalloc` 173. HMAC_CTX *HMAC_CTX_new(void) 174. { 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); ^ 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { crypto/hmac/hmac.c:175:5: assigned 173. HMAC_CTX *HMAC_CTX_new(void) 174. { 175. HMAC_CTX *ctx = (HMAC_CTX *)OPENSSL_zalloc(sizeof(HMAC_CTX)); ^ 176. if (ctx) 177. if (!HMAC_CTX_reset(ctx)) { crypto/hmac/hmac.c:255:14: return from call to `HMAC_CTX_new` 253. if (md == NULL) 254. md = m; 255. if ((c = HMAC_CTX_new()) == NULL) ^ 256. goto err; 257. if (!HMAC_Init_ex(c, key, key_len, evp_md, NULL)) crypto/hmac/hmac.c:257:10: when calling `HMAC_Init_ex` here 255. if ((c = HMAC_CTX_new()) == NULL) 256. goto err; 257. if (!HMAC_Init_ex(c, key, key_len, evp_md, NULL)) ^ 258. goto err; 259. if (!HMAC_Update(c, d, n)) crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: invalid access occurs here 243. } 244. #else 245. free(str); ^ 246. #endif 247. }
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/mem.c/#L245
d2a_code_trace_data_41381
static void await_references(H264Context *h){ MpegEncContext * const s = &h->s; const int mb_xy= h->mb_xy; const int mb_type= s->current_picture.mb_type[mb_xy]; int refs[2][48]; int nrefs[2] = {0}; int ref, list; memset(refs, -1, sizeof(refs)); if(IS_16X16(mb_type)){ get_lowest_part_y(h, refs, 0, 16, 0, IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs); }else if(IS_16X8(mb_type)){ get_lowest_part_y(h, refs, 0, 8, 0, IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs); get_lowest_part_y(h, refs, 8, 8, 8, IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs); }else if(IS_8X16(mb_type)){ get_lowest_part_y(h, refs, 0, 16, 0, IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs); get_lowest_part_y(h, refs, 4, 16, 0, IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs); }else{ int i; assert(IS_8X8(mb_type)); for(i=0; i<4; i++){ const int sub_mb_type= h->sub_mb_type[i]; const int n= 4*i; int y_offset= (i&2)<<2; if(IS_SUB_8X8(sub_mb_type)){ get_lowest_part_y(h, refs, n , 8, y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); }else if(IS_SUB_8X4(sub_mb_type)){ get_lowest_part_y(h, refs, n , 4, y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); get_lowest_part_y(h, refs, n+2, 4, y_offset+4, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); }else if(IS_SUB_4X8(sub_mb_type)){ get_lowest_part_y(h, refs, n , 8, y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); get_lowest_part_y(h, refs, n+1, 8, y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); }else{ int j; assert(IS_SUB_4X4(sub_mb_type)); for(j=0; j<4; j++){ int sub_y_offset= y_offset + 2*(j&2); get_lowest_part_y(h, refs, n+j, 4, sub_y_offset, IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs); } } } } for(list=h->list_count-1; list>=0; list--){ for(ref=0; ref<48 && nrefs[list]; ref++){ int row = refs[list][ref]; if(row >= 0){ Picture *ref_pic = &h->ref_list[list][ref]; int ref_field = ref_pic->reference - 1; int ref_field_picture = ref_pic->field_picture; int pic_height = 16*s->mb_height >> ref_field_picture; row <<= MB_MBAFF; nrefs[list]--; if(!FIELD_PICTURE && ref_field_picture){ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN((row >> 1) - !(row&1), pic_height-1), 1); ff_thread_await_progress((AVFrame*)ref_pic, FFMIN((row >> 1) , pic_height-1), 0); }else if(FIELD_PICTURE && !ref_field_picture){ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row*2 + ref_field , pic_height-1), 0); }else if(FIELD_PICTURE){ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row, pic_height-1), ref_field); }else{ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row, pic_height-1), 0); } } } } } libavcodec/h264.c:3145: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `ff_h264_hl_decode_mb`. libavcodec/h264.c:3141:23: Call 3139. for(;;){ 3140. //START_TIMER 3141. int ret = ff_h264_decode_mb_cabac(h); ^ 3142. int eos; 3143. //STOP_TIMER("decode_mb_cabac") libavcodec/h264_cabac.c:1202:1: Parameter `(*h->s.current_picture.qscale_table).*.strlen` 1200. * @return 0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed 1201. */ 1202. int ff_h264_decode_mb_cabac(H264Context *h) { ^ 1203. MpegEncContext * const s = &h->s; 1204. int mb_xy; libavcodec/h264.c:3145:24: Call 3143. //STOP_TIMER("decode_mb_cabac") 3144. 3145. if(ret>=0) ff_h264_hl_decode_mb(h); ^ 3146. 3147. if( ret >= 0 && FRAME_MBAFF ) { //FIXME optimal? or let mb_decode decode 16x32 ? libavcodec/h264.c:1847:1: Parameter `h->list_count` 1845. } 1846. 1847. void ff_h264_hl_decode_mb(H264Context *h){ ^ 1848. MpegEncContext * const s = &h->s; 1849. const int mb_xy= h->mb_xy; libavcodec/h264.c:1854:9: Call 1852. 1853. if (is_complex) { 1854. hl_decode_mb_complex(h); ^ 1855. } else if (h->pixel_shift) { 1856. hl_decode_mb_simple_16(h); libavcodec/h264.c:1843:1: Parameter `h->list_count` 1841. * Process a macroblock; this handles edge cases, such as interlacing. 1842. */ 1843. static void av_noinline hl_decode_mb_complex(H264Context *h){ ^ 1844. hl_decode_mb_internal(h, 0, h->pixel_shift); 1845. } libavcodec/h264.c:1844:5: Call 1842. */ 1843. static void av_noinline hl_decode_mb_complex(H264Context *h){ 1844. hl_decode_mb_internal(h, 0, h->pixel_shift); ^ 1845. } 1846. libavcodec/h264.c:1541:1: Parameter `h->list_count` 1539. } 1540. 1541. static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, int pixel_shift){ ^ 1542. MpegEncContext * const s = &h->s; 1543. const int mb_x= s->mb_x; libavcodec/h264.c:1735:17: Call 1733. }else if(is_h264){ 1734. if (pixel_shift) { 1735. hl_motion_16(h, dest_y, dest_cb, dest_cr, ^ 1736. s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab, 1737. s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab, libavcodec/h264.c:762:1: Parameter `h->list_count` 760. } 761. hl_motion_fn(0, 8); 762. hl_motion_fn(1, 16); ^ 763. 764. static void free_tables(H264Context *h, int free_rbsp){ libavcodec/h264.c:762:1: Call 760. } 761. hl_motion_fn(0, 8); 762. hl_motion_fn(1, 16); ^ 763. 764. static void free_tables(H264Context *h, int free_rbsp){ libavcodec/h264.c:646:1: Parameter `h->list_count` 644. } 645. 646. static av_always_inline void hl_motion(H264Context *h, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, ^ 647. qpel_mc_func (*qpix_put)[16], h264_chroma_mc_func (*chroma_put), 648. qpel_mc_func (*qpix_avg)[16], h264_chroma_mc_func (*chroma_avg), libavcodec/h264.c:658:9: Call 656. 657. if(HAVE_PTHREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) 658. await_references(h); ^ 659. prefetch_motion(h, 0, pixel_shift); 660. libavcodec/h264.c:299:1: <LHS trace> 297. * @param h the H264 context 298. */ 299. static void await_references(H264Context *h){ ^ 300. MpegEncContext * const s = &h->s; 301. const int mb_xy= h->mb_xy; libavcodec/h264.c:299:1: Parameter `h->list_count` 297. * @param h the H264 context 298. */ 299. static void await_references(H264Context *h){ ^ 300. MpegEncContext * const s = &h->s; 301. const int mb_xy= h->mb_xy; libavcodec/h264.c:357:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ff_h264_hl_decode_mb` 355. } 356. 357. for(list=h->list_count-1; list>=0; list--){ ^ 358. for(ref=0; ref<48 && nrefs[list]; ref++){ 359. int row = refs[list][ref];
https://github.com/libav/libav/blob/6a9c85944427e3c4355bce67d7f677ec69527bff/libavcodec/h264.c/#L357
d2a_code_trace_data_41382
static int nss_keylog_int(const char *prefix, SSL *ssl, const uint8_t *parameter_1, size_t parameter_1_len, const uint8_t *parameter_2, size_t parameter_2_len) { char *out = NULL; char *cursor = NULL; size_t out_len = 0; size_t i; size_t prefix_len; if (ssl->ctx->keylog_callback == NULL) return 1; prefix_len = strlen(prefix); out_len = prefix_len + (2*parameter_1_len) + (2*parameter_2_len) + 3; if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) { SSLfatal(ssl, SSL_AD_INTERNAL_ERROR, SSL_F_NSS_KEYLOG_INT, ERR_R_MALLOC_FAILURE); return 0; } strcpy(cursor, prefix); cursor += prefix_len; *cursor++ = ' '; for (i = 0; i < parameter_1_len; i++) { sprintf(cursor, "%02x", parameter_1[i]); cursor += 2; } *cursor++ = ' '; for (i = 0; i < parameter_2_len; i++) { sprintf(cursor, "%02x", parameter_2[i]); cursor += 2; } *cursor = '\0'; ssl->ctx->keylog_callback(ssl, (const char *)out); OPENSSL_free(out); return 1; } ssl/statem/statem_clnt.c:2867: error: BUFFER_OVERRUN_L3 Offset: [4, +oo] Size: [1, 118] by call to `ssl_log_rsa_client_key_exchange`. Showing all 10 steps of the trace ssl/statem/statem_clnt.c:2820:5: Assignment 2818. } 2819. 2820. pmslen = SSL_MAX_MASTER_KEY_LENGTH; ^ 2821. pms = OPENSSL_malloc(pmslen); 2822. if (pms == NULL) { ssl/statem/statem_clnt.c:2867:10: Call 2865. 2866. /* Log the premaster secret, if logging is enabled. */ 2867. if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen)) { ^ 2868. /* SSLfatal() already called */ 2869. goto err; ssl/ssl_lib.c:4940:1: Parameter `premaster_len` 4938. } 4939. 4940. > int ssl_log_rsa_client_key_exchange(SSL *ssl, 4941. const uint8_t *encrypted_premaster, 4942. size_t encrypted_premaster_len, ssl/ssl_lib.c:4953:12: Call 4951. 4952. /* We only want the first 8 bytes of the encrypted premaster as a tag. */ 4953. return nss_keylog_int("RSA", ^ 4954. ssl, 4955. encrypted_premaster, ssl/ssl_lib.c:4887:1: <Length trace> 4885. } 4886. 4887. > static int nss_keylog_int(const char *prefix, 4888. SSL *ssl, 4889. const uint8_t *parameter_1, ssl/ssl_lib.c:4887:1: Parameter `prefix->strlen` 4885. } 4886. 4887. > static int nss_keylog_int(const char *prefix, 4888. SSL *ssl, 4889. const uint8_t *parameter_1, ssl/ssl_lib.c:4910:5: Assignment 4908. * hexadecimal, so we need a buffer that is twice their lengths. 4909. */ 4910. prefix_len = strlen(prefix); ^ 4911. out_len = prefix_len + (2*parameter_1_len) + (2*parameter_2_len) + 3; 4912. if ((out = cursor = OPENSSL_malloc(out_len)) == NULL) { ssl/ssl_lib.c:4919:5: Assignment 4917. 4918. strcpy(cursor, prefix); 4919. cursor += prefix_len; ^ 4920. *cursor++ = ' '; 4921. ssl/ssl_lib.c:4920:6: Assignment 4918. strcpy(cursor, prefix); 4919. cursor += prefix_len; 4920. *cursor++ = ' '; ^ 4921. 4922. for (i = 0; i < parameter_1_len; i++) { ssl/ssl_lib.c:4926:5: Array access: Offset: [4, +oo] Size: [1, 118] by call to `ssl_log_rsa_client_key_exchange` 4924. cursor += 2; 4925. } 4926. *cursor++ = ' '; ^ 4927. 4928. for (i = 0; i < parameter_2_len; i++) {
https://github.com/openssl/openssl/blob/e7d961e994620dd5dee6d80794a07fb9de1bab66/ssl/ssl_lib.c/#L4926
d2a_code_trace_data_41383
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))); assert(!overlapped); return overlapped; } crypto/cms/cms_pwri.c:195: error: INTEGER_OVERFLOW_L2 (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate`. Showing all 7 steps of the trace crypto/cms/cms_pwri.c:195:10: Call 193. return 0; 194. /* setup IV by decrypting last two blocks */ 195. if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl, ^ 196. in + inlen - 2 * blocklen, blocklen * 2) 197. /* 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_DecryptUpdate` 286. */ 287. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | 288. (diff > (0 - (PTRDIFF_T)len))); ^ 289. assert(!overlapped); 290. return overlapped;
https://github.com/openssl/openssl/blob/7141ba31969d0b378d08104a51f8f99b9187b9d5/crypto/evp/evp_enc.c/#L288
d2a_code_trace_data_41384
static int var_diamond_search(MpegEncContext * s, int *best, int dmin, int src_index, int ref_index, int const penalty_factor, int size, int h, int flags) { MotionEstContext * const c= &s->me; me_cmp_func cmpf, chroma_cmpf; int dia_size; LOAD_COMMON LOAD_COMMON2 int map_generation= c->map_generation; cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; for(dia_size=1; dia_size<=c->dia_size; dia_size++){ int dir, start, end; const int x= best[0]; const int y= best[1]; start= FFMAX(0, y + dia_size - ymax); end = FFMIN(dia_size, xmax - x + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x + dir , y + dia_size - dir); } start= FFMAX(0, x + dia_size - xmax); end = FFMIN(dia_size, y - ymin + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x + dia_size - dir, y - dir ); } start= FFMAX(0, -y + dia_size + ymin ); end = FFMIN(dia_size, x - xmin + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x - dir , y - dia_size + dir); } start= FFMAX(0, -x + dia_size + xmin ); end = FFMIN(dia_size, ymax - y + 1); for(dir= start; dir<end; dir++){ int d; CHECK_MV(x - dia_size + dir, y + dir ); } if(x!=best[0] || y!=best[1]) dia_size=0; #if 0 { int dx, dy, i; static int stats[8*8]; dx= FFABS(x-best[0]); dy= FFABS(y-best[1]); stats[dy*8 + dx] ++; if(256*256*256*64 % (stats[0]+1)==0){ for(i=0; i<64; i++){ if((i&7)==0) printf("\n"); printf("%6d ", stats[i]); } printf("\n"); } } #endif } return dmin; } libavcodec/motion_est_template.c:934: error: Uninitialized Value The value read from xmin was never initialized. libavcodec/motion_est_template.c:934:16: 932. 933. start= FFMAX(0, -y + dia_size + ymin ); 934. end = FFMIN(dia_size, x - xmin + 1); ^ 935. for(dir= start; dir<end; dir++){ 936. int d;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L934
d2a_code_trace_data_41385
int ossl_init_thread_start(uint64_t opts) { struct thread_local_inits_st *locals; if (!OPENSSL_init_crypto(0, NULL)) return 0; locals = ossl_init_get_thread_local(1); if (locals == NULL) return 0; if (opts & OPENSSL_INIT_THREAD_ASYNC) { #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " "marking thread for async\n"); #endif locals->async = 1; } if (opts & OPENSSL_INIT_THREAD_ERR_STATE) { #ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " "marking thread for err_state\n"); #endif locals->err_state = 1; } return 1; } crypto/init.c:397: error: MEMORY_LEAK memory dynamically allocated to `locals` by call to `ossl_init_get_thread_local()` at line 384, column 14 is not reachable after line 397, column 9. Showing all 40 steps of the trace crypto/init.c:377:1: start of procedure ossl_init_thread_start() 375. } 376. 377. > int ossl_init_thread_start(uint64_t opts) 378. { 379. struct thread_local_inits_st *locals; crypto/init.c:381:10: Taking false branch 379. struct thread_local_inits_st *locals; 380. 381. if (!OPENSSL_init_crypto(0, NULL)) ^ 382. return 0; 383. crypto/init.c:384:5: 382. return 0; 383. 384. > locals = ossl_init_get_thread_local(1); 385. 386. if (locals == NULL) crypto/init.c:50:1: start of procedure ossl_init_get_thread_local() 48. } 49. 50. > static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) 51. { 52. struct thread_local_inits_st *local = crypto/init.c:52:5: 50. static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc) 51. { 52. > struct thread_local_inits_st *local = 53. CRYPTO_THREAD_get_local(&threadstopkey); 54. crypto/threads_pthread.c:121:1: start of procedure CRYPTO_THREAD_get_local() 119. } 120. 121. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 122. { 123. return pthread_getspecific(*key); crypto/threads_pthread.c:123:5: Skipping pthread_getspecific(): method has no implementation 121. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key) 122. { 123. return pthread_getspecific(*key); ^ 124. } 125. crypto/threads_pthread.c:124:1: return from a call to CRYPTO_THREAD_get_local 122. { 123. return pthread_getspecific(*key); 124. > } 125. 126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) crypto/init.c:55:9: Taking true branch 53. CRYPTO_THREAD_get_local(&threadstopkey); 54. 55. if (local == NULL && alloc) { ^ 56. local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { crypto/init.c:55:26: Taking true branch 53. CRYPTO_THREAD_get_local(&threadstopkey); 54. 55. if (local == NULL && alloc) { ^ 56. local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { crypto/init.c:56:9: 54. 55. if (local == NULL && alloc) { 56. > local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { 58. OPENSSL_free(local); crypto/mem.c:198:1: start of procedure CRYPTO_zalloc() 196. } 197. 198. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 199. { 200. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:200:5: 198. void *CRYPTO_zalloc(size_t num, const char *file, int line) 199. { 200. > void *ret = CRYPTO_malloc(num, file, line); 201. 202. FAILTEST(); crypto/mem.c:170:1: start of procedure CRYPTO_malloc() 168. #endif 169. 170. > void *CRYPTO_malloc(size_t num, const char *file, int line) 171. { 172. void *ret = NULL; crypto/mem.c:172:5: 170. void *CRYPTO_malloc(size_t num, const char *file, int line) 171. { 172. > void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:174:9: Taking false branch 172. void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 175. return malloc_impl(num, file, line); 176. crypto/mem.c:177:9: Taking false branch 175. return malloc_impl(num, file, line); 176. 177. if (num == 0) ^ 178. return NULL; 179. crypto/mem.c:181:5: 179. 180. FAILTEST(); 181. > allow_customize = 0; 182. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 183. if (call_malloc_debug) { crypto/mem.c:191:5: 189. } 190. #else 191. > (void)(file); (void)(line); 192. ret = malloc(num); 193. #endif crypto/mem.c:191:19: 189. } 190. #else 191. > (void)(file); (void)(line); 192. ret = malloc(num); 193. #endif crypto/mem.c:192:5: 190. #else 191. (void)(file); (void)(line); 192. > ret = malloc(num); 193. #endif 194. crypto/mem.c:195:5: 193. #endif 194. 195. > return ret; 196. } 197. crypto/mem.c:196:1: return from a call to CRYPTO_malloc 194. 195. return ret; 196. > } 197. 198. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:203:9: Taking true branch 201. 202. FAILTEST(); 203. if (ret != NULL) ^ 204. memset(ret, 0, num); 205. return ret; crypto/mem.c:204:9: 202. FAILTEST(); 203. if (ret != NULL) 204. > memset(ret, 0, num); 205. return ret; 206. } crypto/mem.c:205:5: 203. if (ret != NULL) 204. memset(ret, 0, num); 205. > return ret; 206. } 207. crypto/mem.c:206:1: return from a call to CRYPTO_zalloc 204. memset(ret, 0, num); 205. return ret; 206. > } 207. 208. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/init.c:57:13: Taking true branch 55. if (local == NULL && alloc) { 56. local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { ^ 58. OPENSSL_free(local); 59. return NULL; crypto/init.c:57:31: 55. if (local == NULL && alloc) { 56. local = OPENSSL_zalloc(sizeof *local); 57. > if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { 58. OPENSSL_free(local); 59. return NULL; crypto/threads_pthread.c:126:1: start of procedure CRYPTO_THREAD_set_local() 124. } 125. 126. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 127. { 128. if (pthread_setspecific(*key, val) != 0) crypto/threads_pthread.c:128:9: Taking false branch 126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val) 127. { 128. if (pthread_setspecific(*key, val) != 0) ^ 129. return 0; 130. crypto/threads_pthread.c:131:5: 129. return 0; 130. 131. > return 1; 132. } 133. crypto/threads_pthread.c:132:1: return from a call to CRYPTO_THREAD_set_local 130. 131. return 1; 132. > } 133. 134. int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key) crypto/init.c:57:31: Taking false branch 55. if (local == NULL && alloc) { 56. local = OPENSSL_zalloc(sizeof *local); 57. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) { ^ 58. OPENSSL_free(local); 59. return NULL; crypto/init.c:62:10: Taking false branch 60. } 61. } 62. if (!alloc) { ^ 63. CRYPTO_THREAD_set_local(&threadstopkey, NULL); 64. } crypto/init.c:66:5: 64. } 65. 66. > return local; 67. } 68. crypto/init.c:67:1: return from a call to ossl_init_get_thread_local 65. 66. return local; 67. > } 68. 69. typedef struct ossl_init_stop_st OPENSSL_INIT_STOP; crypto/init.c:386:9: Taking false branch 384. locals = ossl_init_get_thread_local(1); 385. 386. if (locals == NULL) ^ 387. return 0; 388. crypto/init.c:389:9: Taking false branch 387. return 0; 388. 389. if (opts & OPENSSL_INIT_THREAD_ASYNC) { ^ 390. #ifdef OPENSSL_INIT_DEBUG 391. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: " crypto/init.c:397:9: Taking false branch 395. } 396. 397. if (opts & OPENSSL_INIT_THREAD_ERR_STATE) { ^ 398. #ifdef OPENSSL_INIT_DEBUG 399. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
https://github.com/openssl/openssl/blob/89bc9cf682e833d44fe135c901fe75f600d871ef/crypto/init.c/#L397
d2a_code_trace_data_41386
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) { int line_size; int sample_size = av_get_bytes_per_sample(sample_fmt); int planar = av_sample_fmt_is_planar(sample_fmt); if (!sample_size || nb_samples <= 0 || nb_channels <= 0) return AVERROR(EINVAL); if (!align) { if (nb_samples > INT_MAX - 31) return AVERROR(EINVAL); align = 1; nb_samples = FFALIGN(nb_samples, 32); } if (nb_channels > INT_MAX / align || (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size) return AVERROR(EINVAL); line_size = planar ? FFALIGN(nb_samples * sample_size, align) : FFALIGN(nb_samples * sample_size * nb_channels, align); if (linesize) *linesize = line_size; return planar ? line_size * nb_channels : line_size; } libavcodec/motionpixels.c:318: error: Integer Overflow L2 ([1, 2147483616] + 32):signed32 by call to `av_frame_ref`. libavcodec/motionpixels.c:280:5: Unknown value from: non-const function 278. if (!mp->bswapbuf) 279. return AVERROR(ENOMEM); 280. mp->dsp.bswap_buf((uint32_t *)mp->bswapbuf, (const uint32_t *)buf, buf_size / 4); ^ 281. if (buf_size & 3) 282. memcpy(mp->bswapbuf + (buf_size & ~3), buf + (buf_size & ~3), buf_size & 3); libavcodec/motionpixels.c:318:16: Call 316. 317. end: 318. if ((ret = av_frame_ref(data, mp->frame)) < 0) ^ 319. return ret; 320. *got_frame = 1; libavutil/frame.c:174:1: Parameter `src->nb_samples` 172. } 173. 174. int av_frame_ref(AVFrame *dst, const AVFrame *src) ^ 175. { 176. int i, ret = 0; libavutil/frame.c:182:5: Assignment 180. dst->height = src->height; 181. dst->channel_layout = src->channel_layout; 182. dst->nb_samples = src->nb_samples; ^ 183. 184. ret = av_frame_copy_props(dst, src); libavutil/frame.c:190:15: Call 188. /* duplicate the frame data if it's not refcounted */ 189. if (!src->buf[0]) { 190. ret = av_frame_get_buffer(dst, 32); ^ 191. if (ret < 0) 192. return ret; libavutil/frame.c:161:1: Parameter `frame->nb_samples` 159. } 160. 161. int av_frame_get_buffer(AVFrame *frame, int align) ^ 162. { 163. if (frame->format < 0) libavutil/frame.c:169:16: Call 167. return get_video_buffer(frame, align); 168. else if (frame->nb_samples > 0 && frame->channel_layout) 169. return get_audio_buffer(frame, align); ^ 170. 171. return AVERROR(EINVAL); libavutil/frame.c:112:1: Parameter `frame->nb_samples` 110. } 111. 112. static int get_audio_buffer(AVFrame *frame, int align) ^ 113. { 114. int channels = av_get_channel_layout_nb_channels(frame->channel_layout); libavutil/frame.c:120:15: Call 118. 119. if (!frame->linesize[0]) { 120. ret = av_samples_get_buffer_size(&frame->linesize[0], channels, ^ 121. frame->nb_samples, frame->format, 122. align); libavutil/samplefmt.c:108:1: <LHS trace> 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:108:1: Parameter `nb_samples` 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `av_frame_ref` 122. return AVERROR(EINVAL); 123. align = 1; 124. nb_samples = FFALIGN(nb_samples, 32); ^ 125. } 126.
https://github.com/libav/libav/blob/0e830094ad0dc251613a0aa3234d9c5c397e02e6/libavutil/samplefmt.c/#L124
d2a_code_trace_data_41387
int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len) { if (len > 16 || len < 1) { return -1; } CRYPTO_ocb128_finish(ctx, NULL, 0); memcpy(tag, ctx->tag.c, len); return 1; } crypto/modes/ocb128.c:552: error: BUFFER_OVERRUN_S2 Offset added: [max(1, `len`), min(16, `len`)] Size: [0, +oo]. Showing all 5 steps of the trace crypto/modes/ocb128.c:542:1: <Offset trace> 540. * Retrieve the calculated tag 541. */ 542. > int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len) 543. { 544. if (len > 16 || len < 1) { crypto/modes/ocb128.c:542:1: Parameter `len` 540. * Retrieve the calculated tag 541. */ 542. > int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len) 543. { 544. if (len > 16 || len < 1) { crypto/modes/ocb128.c:542:1: <Length trace> 540. * Retrieve the calculated tag 541. */ 542. > int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len) 543. { 544. if (len > 16 || len < 1) { crypto/modes/ocb128.c:542:1: Parameter `ctx->tag.c[*]` 540. * Retrieve the calculated tag 541. */ 542. > int CRYPTO_ocb128_tag(OCB128_CONTEXT *ctx, unsigned char *tag, size_t len) 543. { 544. if (len > 16 || len < 1) { crypto/modes/ocb128.c:552:5: Array access: Offset added: [max(1, len), min(16, len)] Size: [0, +oo] 550. 551. /* Copy the tag into the supplied buffer */ 552. memcpy(tag, ctx->tag.c, len); ^ 553. 554. return 1;
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/crypto/modes/ocb128.c/#L552
d2a_code_trace_data_41388
int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n) { int i, ret = 0, a, b, c, d; unsigned long l; while ((conv_ascii2bin(*f) == B64_WS) && (n > 0)) { f++; n--; } while ((n > 3) && (B64_NOT_BASE64(conv_ascii2bin(f[n - 1])))) n--; if (n % 4 != 0) return -1; for (i = 0; i < n; i += 4) { a = conv_ascii2bin(*(f++)); b = conv_ascii2bin(*(f++)); c = conv_ascii2bin(*(f++)); d = conv_ascii2bin(*(f++)); if ((a & 0x80) || (b & 0x80) || (c & 0x80) || (d & 0x80)) return -1; l = ((((unsigned long)a) << 18L) | (((unsigned long)b) << 12L) | (((unsigned long)c) << 6L) | (((unsigned long)d))); *(t++) = (unsigned char)(l >> 16L) & 0xff; *(t++) = (unsigned char)(l >> 8L) & 0xff; *(t++) = (unsigned char)(l) & 0xff; ret += 3; } return ret; } crypto/srp/srp_vfy.c:318: error: INTEGER_OVERFLOW_L2 ([0, 2147483646] + 4):signed32 by call to `SRP_user_pwd_set_sv`. Showing all 13 steps of the trace crypto/srp/srp_vfy.c:313:22: Call 311. 312. SRP_user_pwd_set_gN(user_pwd, lgN->g, lgN->N); 313. if (!SRP_user_pwd_set_ids ^ 314. (user_pwd, pp[DB_srpid], pp[DB_srpinfo])) 315. goto err; crypto/srp/srp_vfy.c:80:1: Parameter `id->strlen` 78. } 79. 80. > static int SRP_user_pwd_set_ids(SRP_user_pwd *vinfo, const char *id, 81. const char *info) 82. { crypto/srp/srp_vfy.c:83:44: Call 81. const char *info) 82. { 83. if (id != NULL && NULL == (vinfo->id = OPENSSL_strdup(id))) ^ 84. return 0; 85. return (info == NULL || NULL != (vinfo->info = OPENSSL_strdup(info))); crypto/o_str.c:27:1: Parameter `str->strlen` 25. } 26. 27. > char *CRYPTO_strdup(const char *str, const char* file, int line) 28. { 29. char *ret; crypto/srp/srp_vfy.c:318:22: Call 316. 317. error_code = SRP_ERR_VBASE_BN_LIB; 318. if (!SRP_user_pwd_set_sv ^ 319. (user_pwd, pp[DB_srpsalt], pp[DB_srpverifier])) 320. goto err; crypto/srp/srp_vfy.c:88:1: Parameter `v->strlen` 86. } 87. 88. > static int SRP_user_pwd_set_sv(SRP_user_pwd *vinfo, const char *s, 89. const char *v) 90. { crypto/srp/srp_vfy.c:97:11: Call 95. vinfo->s = NULL; 96. 97. len = t_fromb64(tmp, sizeof(tmp), v); ^ 98. if (len < 0) 99. return 0; crypto/srp/srp_vfy.c:29:1: Parameter `src->strlen` 27. * Convert a base64 string into raw byte array representation. 28. */ 29. > static int t_fromb64(unsigned char *a, size_t alen, const char *src) 30. { 31. size_t size = strlen(src); crypto/srp/srp_vfy.c:31:5: Assignment 29. static int t_fromb64(unsigned char *a, size_t alen, const char *src) 30. { 31. size_t size = strlen(src); ^ 32. 33. /* Four bytes in src become three bytes output. */ crypto/srp/srp_vfy.c:37:12: Call 35. return -1; 36. 37. return EVP_DecodeBlock(a, (unsigned char *)src, (int)size); ^ 38. } 39. crypto/evp/encode.c:351:1: <LHS trace> 349. } 350. 351. > int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n) 352. { 353. int i, ret = 0, a, b, c, d; crypto/evp/encode.c:351:1: Parameter `n` 349. } 350. 351. > int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n) 352. { 353. int i, ret = 0, a, b, c, d; crypto/evp/encode.c:372:24: Binary operation: ([0, 2147483646] + 4):signed32 by call to `SRP_user_pwd_set_sv` 370. return -1; 371. 372. for (i = 0; i < n; i += 4) { ^ 373. a = conv_ascii2bin(*(f++)); 374. b = conv_ascii2bin(*(f++));
https://github.com/openssl/openssl/blob/7747a49f2452dfab8880ff60451073ae8506c90e/crypto/evp/encode.c/#L372
d2a_code_trace_data_41389
static ngx_int_t ngx_http_upstream_get_random_peer(ngx_peer_connection_t *pc, void *data) { ngx_http_upstream_random_peer_data_t *rp = data; time_t now; uintptr_t m; ngx_uint_t i, n; ngx_http_upstream_rr_peer_t *peer; ngx_http_upstream_rr_peers_t *peers; ngx_http_upstream_rr_peer_data_t *rrp; ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, "get random peer, try: %ui", pc->tries); rrp = &rp->rrp; peers = rrp->peers; ngx_http_upstream_rr_peers_rlock(peers); if (rp->tries > 20 || peers->single) { ngx_http_upstream_rr_peers_unlock(peers); return ngx_http_upstream_get_round_robin_peer(pc, rrp); } pc->cached = 0; pc->connection = NULL; now = ngx_time(); for ( ;; ) { i = ngx_http_upstream_peek_random_peer(peers, rp); peer = rp->conf->ranges[i].peer; n = i / (8 * sizeof(uintptr_t)); m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t)); if (rrp->tried[n] & m) { goto next; } ngx_http_upstream_rr_peer_lock(peers, peer); if (peer->down) { ngx_http_upstream_rr_peer_unlock(peers, peer); goto next; } if (peer->max_fails && peer->fails >= peer->max_fails && now - peer->checked <= peer->fail_timeout) { ngx_http_upstream_rr_peer_unlock(peers, peer); goto next; } if (peer->max_conns && peer->conns >= peer->max_conns) { ngx_http_upstream_rr_peer_unlock(peers, peer); goto next; } break; next: if (++rp->tries > 20) { ngx_http_upstream_rr_peers_unlock(peers); return ngx_http_upstream_get_round_robin_peer(pc, rrp); } } rrp->current = peer; if (now - peer->checked > peer->fail_timeout) { peer->checked = now; } pc->sockaddr = peer->sockaddr; pc->socklen = peer->socklen; pc->name = &peer->name; peer->conns++; ngx_http_upstream_rr_peer_unlock(peers, peer); ngx_http_upstream_rr_peers_unlock(peers); rrp->tried[n] |= m; return NGX_OK; } src/http/modules/ngx_http_upstream_random_module.c:276: error: Uninitialized Value The value read from peer was never initialized. src/http/modules/ngx_http_upstream_random_module.c:276:5: 274. } 275. 276. rrp->current = peer; ^ 277. 278. if (now - peer->checked > peer->fail_timeout) {
https://github.com/nginx/nginx/blob/468e37734c48e63296e9f633fd6319519b5f8c74/src/http/modules/ngx_http_upstream_random_module.c/#L276
d2a_code_trace_data_41390
static int estimate_best_b_count(MpegEncContext *s) { AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id); AVCodecContext *c = avcodec_alloc_context3(NULL); AVFrame input[FF_MAX_B_FRAMES + 2]; const int scale = s->avctx->brd_scale; int i, j, out_size, p_lambda, b_lambda, lambda2; int64_t best_rd = INT64_MAX; int best_b_count = -1; assert(scale >= 0 && scale <= 3); p_lambda = s->last_lambda_for[AV_PICTURE_TYPE_P]; b_lambda = s->last_lambda_for[AV_PICTURE_TYPE_B]; if (!b_lambda) b_lambda = p_lambda; lambda2 = (b_lambda * b_lambda + (1 << FF_LAMBDA_SHIFT) / 2) >> FF_LAMBDA_SHIFT; c->width = s->width >> scale; c->height = s->height >> scale; c->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR | CODEC_FLAG_INPUT_PRESERVED ; c->flags |= s->avctx->flags & CODEC_FLAG_QPEL; c->mb_decision = s->avctx->mb_decision; c->me_cmp = s->avctx->me_cmp; c->mb_cmp = s->avctx->mb_cmp; c->me_sub_cmp = s->avctx->me_sub_cmp; c->pix_fmt = AV_PIX_FMT_YUV420P; c->time_base = s->avctx->time_base; c->max_b_frames = s->max_b_frames; if (avcodec_open2(c, codec, NULL) < 0) return -1; for (i = 0; i < s->max_b_frames + 2; i++) { int ysize = c->width * c->height; int csize = (c->width / 2) * (c->height / 2); Picture pre_input, *pre_input_ptr = i ? s->input_picture[i - 1] : s->next_picture_ptr; avcodec_get_frame_defaults(&input[i]); input[i].data[0] = av_malloc(ysize + 2 * csize); input[i].data[1] = input[i].data[0] + ysize; input[i].data[2] = input[i].data[1] + csize; input[i].linesize[0] = c->width; input[i].linesize[1] = input[i].linesize[2] = c->width / 2; if (pre_input_ptr && (!i || s->input_picture[i - 1])) { pre_input = *pre_input_ptr; if (!pre_input.shared && i) { pre_input.f.data[0] += INPLACE_OFFSET; pre_input.f.data[1] += INPLACE_OFFSET; pre_input.f.data[2] += INPLACE_OFFSET; } s->dsp.shrink[scale](input[i].data[0], input[i].linesize[0], pre_input.f.data[0], pre_input.f.linesize[0], c->width, c->height); s->dsp.shrink[scale](input[i].data[1], input[i].linesize[1], pre_input.f.data[1], pre_input.f.linesize[1], c->width >> 1, c->height >> 1); s->dsp.shrink[scale](input[i].data[2], input[i].linesize[2], pre_input.f.data[2], pre_input.f.linesize[2], c->width >> 1, c->height >> 1); } } for (j = 0; j < s->max_b_frames + 1; j++) { int64_t rd = 0; if (!s->input_picture[j]) break; c->error[0] = c->error[1] = c->error[2] = 0; input[0].pict_type = AV_PICTURE_TYPE_I; input[0].quality = 1 * FF_QP2LAMBDA; out_size = encode_frame(c, &input[0]); for (i = 0; i < s->max_b_frames + 1; i++) { int is_p = i % (j + 1) == j || i == s->max_b_frames; input[i + 1].pict_type = is_p ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_B; input[i + 1].quality = is_p ? p_lambda : b_lambda; out_size = encode_frame(c, &input[i + 1]); rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3); } while (out_size) { out_size = encode_frame(c, NULL); rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3); } rd += c->error[0] + c->error[1] + c->error[2]; if (rd < best_rd) { best_rd = rd; best_b_count = j; } } avcodec_close(c); av_freep(&c); for (i = 0; i < s->max_b_frames + 2; i++) { av_freep(&input[i].data[0]); } return best_b_count; } libavcodec/mpegvideo_enc.c:1050: error: Null Dereference pointer `c` last assigned on line 1031 could be null and is dereferenced at line 1050, column 5. libavcodec/mpegvideo_enc.c:1028:1: start of procedure estimate_best_b_count() 1026. } 1027. 1028. static int estimate_best_b_count(MpegEncContext *s) ^ 1029. { 1030. AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id); libavcodec/mpegvideo_enc.c:1030:5: 1028. static int estimate_best_b_count(MpegEncContext *s) 1029. { 1030. AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id); ^ 1031. AVCodecContext *c = avcodec_alloc_context3(NULL); 1032. AVFrame input[FF_MAX_B_FRAMES + 2]; libavcodec/utils.c:1561:1: start of procedure avcodec_find_encoder() 1559. } 1560. 1561. AVCodec *avcodec_find_encoder(enum AVCodecID id) ^ 1562. { 1563. return find_encdec(id, 1); libavcodec/utils.c:1563:5: Skipping find_encdec(): empty list of specs 1561. AVCodec *avcodec_find_encoder(enum AVCodecID id) 1562. { 1563. return find_encdec(id, 1); ^ 1564. } 1565. libavcodec/utils.c:1564:1: return from a call to avcodec_find_encoder 1562. { 1563. return find_encdec(id, 1); 1564. } ^ 1565. 1566. AVCodec *avcodec_find_encoder_by_name(const char *name) libavcodec/mpegvideo_enc.c:1031:5: 1029. { 1030. AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id); 1031. AVCodecContext *c = avcodec_alloc_context3(NULL); ^ 1032. AVFrame input[FF_MAX_B_FRAMES + 2]; 1033. const int scale = s->avctx->brd_scale; libavcodec/options.c:124:1: start of procedure avcodec_alloc_context3() 122. } 123. 124. AVCodecContext *avcodec_alloc_context3(const AVCodec *codec) ^ 125. { 126. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); libavcodec/options.c:126:5: 124. AVCodecContext *avcodec_alloc_context3(const AVCodec *codec) 125. { 126. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); ^ 127. 128. if(avctx==NULL) return NULL; libavutil/mem.c:61:1: start of procedure av_malloc() 59. * linker will do it automatically. */ 60. 61. void *av_malloc(size_t size) ^ 62. { 63. void *ptr = NULL; libavutil/mem.c:63:5: 61. void *av_malloc(size_t size) 62. { 63. void *ptr = NULL; ^ 64. #if CONFIG_MEMALIGN_HACK 65. long diff; libavutil/mem.c:69:9: Taking false branch 67. 68. /* let's disallow possible ambiguous cases */ 69. if (size > (INT_MAX - 32) || !size) ^ 70. return NULL; 71. libavutil/mem.c:69:35: Taking false branch 67. 68. /* let's disallow possible ambiguous cases */ 69. if (size > (INT_MAX - 32) || !size) ^ 70. return NULL; 71. libavutil/mem.c:80:9: Taking false branch 78. ((char *)ptr)[-1] = diff; 79. #elif HAVE_POSIX_MEMALIGN 80. if (posix_memalign(&ptr, 32, size)) ^ 81. ptr = NULL; 82. #elif HAVE_ALIGNED_MALLOC libavutil/mem.c:113:5: 111. ptr = malloc(size); 112. #endif 113. return ptr; ^ 114. } 115. libavutil/mem.c:114:1: return from a call to av_malloc 112. #endif 113. return ptr; 114. } ^ 115. 116. void *av_realloc(void *ptr, size_t size) libavcodec/options.c:128:8: Taking true branch 126. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); 127. 128. if(avctx==NULL) return NULL; ^ 129. 130. if(avcodec_get_context_defaults3(avctx, codec) < 0){ libavcodec/options.c:128:21: 126. AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); 127. 128. if(avctx==NULL) return NULL; ^ 129. 130. if(avcodec_get_context_defaults3(avctx, codec) < 0){ libavcodec/options.c:136:1: return from a call to avcodec_alloc_context3 134. 135. return avctx; 136. } ^ 137. 138. int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src) libavcodec/mpegvideo_enc.c:1033:5: 1031. AVCodecContext *c = avcodec_alloc_context3(NULL); 1032. AVFrame input[FF_MAX_B_FRAMES + 2]; 1033. const int scale = s->avctx->brd_scale; ^ 1034. int i, j, out_size, p_lambda, b_lambda, lambda2; 1035. int64_t best_rd = INT64_MAX; libavcodec/mpegvideo_enc.c:1035:5: 1033. const int scale = s->avctx->brd_scale; 1034. int i, j, out_size, p_lambda, b_lambda, lambda2; 1035. int64_t best_rd = INT64_MAX; ^ 1036. int best_b_count = -1; 1037. libavcodec/mpegvideo_enc.c:1036:5: 1034. int i, j, out_size, p_lambda, b_lambda, lambda2; 1035. int64_t best_rd = INT64_MAX; 1036. int best_b_count = -1; ^ 1037. 1038. assert(scale >= 0 && scale <= 3); libavcodec/mpegvideo_enc.c:1038:5: 1036. int best_b_count = -1; 1037. 1038. assert(scale >= 0 && scale <= 3); ^ 1039. 1040. //emms_c(); libavcodec/mpegvideo_enc.c:1042:5: 1040. //emms_c(); 1041. //s->next_picture_ptr->quality; 1042. p_lambda = s->last_lambda_for[AV_PICTURE_TYPE_P]; ^ 1043. //p_lambda * FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset; 1044. b_lambda = s->last_lambda_for[AV_PICTURE_TYPE_B]; libavcodec/mpegvideo_enc.c:1044:5: 1042. p_lambda = s->last_lambda_for[AV_PICTURE_TYPE_P]; 1043. //p_lambda * FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset; 1044. b_lambda = s->last_lambda_for[AV_PICTURE_TYPE_B]; ^ 1045. if (!b_lambda) // FIXME we should do this somewhere else 1046. b_lambda = p_lambda; libavcodec/mpegvideo_enc.c:1045:10: Taking false branch 1043. //p_lambda * FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset; 1044. b_lambda = s->last_lambda_for[AV_PICTURE_TYPE_B]; 1045. if (!b_lambda) // FIXME we should do this somewhere else ^ 1046. b_lambda = p_lambda; 1047. lambda2 = (b_lambda * b_lambda + (1 << FF_LAMBDA_SHIFT) / 2) >> libavcodec/mpegvideo_enc.c:1047:5: 1045. if (!b_lambda) // FIXME we should do this somewhere else 1046. b_lambda = p_lambda; 1047. lambda2 = (b_lambda * b_lambda + (1 << FF_LAMBDA_SHIFT) / 2) >> ^ 1048. FF_LAMBDA_SHIFT; 1049. libavcodec/mpegvideo_enc.c:1050:5: 1048. FF_LAMBDA_SHIFT; 1049. 1050. c->width = s->width >> scale; ^ 1051. c->height = s->height >> scale; 1052. c->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR |
https://github.com/libav/libav/blob/2eaa3663fda750dac66d41fe8541a8744d5563a4/libavcodec/mpegvideo_enc.c/#L1050
d2a_code_trace_data_41391
static void imdct36(int *out, int *buf, int *in, int *win) { int i, j, t0, t1, t2, t3, s0, s1, s2, s3; int tmp[18], *tmp1, *in1; for(i=17;i>=1;i--) in[i] += in[i-1]; for(i=17;i>=3;i-=2) in[i] += in[i-2]; for(j=0;j<2;j++) { tmp1 = tmp + j; in1 = in + j; #if 0 int64_t t0, t1, t2, t3; t2 = in1[2*4] + in1[2*8] - in1[2*2]; t3 = (in1[2*0] + (int64_t)(in1[2*6]>>1))<<32; t1 = in1[2*0] - in1[2*6]; tmp1[ 6] = t1 - (t2>>1); tmp1[16] = t1 + t2; t0 = MUL64(2*(in1[2*2] + in1[2*4]), C2); t1 = MUL64( in1[2*4] - in1[2*8] , -2*C8); t2 = MUL64(2*(in1[2*2] + in1[2*8]), -C4); tmp1[10] = (t3 - t0 - t2) >> 32; tmp1[ 2] = (t3 + t0 + t1) >> 32; tmp1[14] = (t3 + t2 - t1) >> 32; tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3); t2 = MUL64(2*(in1[2*1] + in1[2*5]), C1); t3 = MUL64( in1[2*5] - in1[2*7] , -2*C7); t0 = MUL64(2*in1[2*3], C3); t1 = MUL64(2*(in1[2*1] + in1[2*7]), -C5); tmp1[ 0] = (t2 + t3 + t0) >> 32; tmp1[12] = (t2 + t1 - t0) >> 32; tmp1[ 8] = (t3 - t1 - t0) >> 32; #else t2 = in1[2*4] + in1[2*8] - in1[2*2]; t3 = in1[2*0] + (in1[2*6]>>1); t1 = in1[2*0] - in1[2*6]; tmp1[ 6] = t1 - (t2>>1); tmp1[16] = t1 + t2; t0 = MULH(2*(in1[2*2] + in1[2*4]), C2); t1 = MULH( in1[2*4] - in1[2*8] , -2*C8); t2 = MULH(2*(in1[2*2] + in1[2*8]), -C4); tmp1[10] = t3 - t0 - t2; tmp1[ 2] = t3 + t0 + t1; tmp1[14] = t3 + t2 - t1; tmp1[ 4] = MULH(2*(in1[2*5] + in1[2*7] - in1[2*1]), -C3); t2 = MULH(2*(in1[2*1] + in1[2*5]), C1); t3 = MULH( in1[2*5] - in1[2*7] , -2*C7); t0 = MULH(2*in1[2*3], C3); t1 = MULH(2*(in1[2*1] + in1[2*7]), -C5); tmp1[ 0] = t2 + t3 + t0; tmp1[12] = t2 + t1 - t0; tmp1[ 8] = t3 - t1 - t0; #endif } i = 0; for(j=0;j<4;j++) { t0 = tmp[i]; t1 = tmp[i + 2]; s0 = t1 + t0; s2 = t1 - t0; t2 = tmp[i + 1]; t3 = tmp[i + 3]; s1 = MULH(2*(t3 + t2), icos36h[j]); s3 = MULL(t3 - t2, icos36[8 - j]); t0 = s0 + s1; t1 = s0 - s1; out[(9 + j)*SBLIMIT] = MULH(t1, win[9 + j]) + buf[9 + j]; out[(8 - j)*SBLIMIT] = MULH(t1, win[8 - j]) + buf[8 - j]; buf[9 + j] = MULH(t0, win[18 + 9 + j]); buf[8 - j] = MULH(t0, win[18 + 8 - j]); t0 = s2 + s3; t1 = s2 - s3; out[(9 + 8 - j)*SBLIMIT] = MULH(t1, win[9 + 8 - j]) + buf[9 + 8 - j]; out[( j)*SBLIMIT] = MULH(t1, win[ j]) + buf[ j]; buf[9 + 8 - j] = MULH(t0, win[18 + 9 + 8 - j]); buf[ + j] = MULH(t0, win[18 + j]); i += 4; } s0 = tmp[16]; s1 = MULH(2*tmp[17], icos36h[4]); t0 = s0 + s1; t1 = s0 - s1; out[(9 + 4)*SBLIMIT] = MULH(t1, win[9 + 4]) + buf[9 + 4]; out[(8 - 4)*SBLIMIT] = MULH(t1, win[8 - 4]) + buf[8 - 4]; buf[9 + 4] = MULH(t0, win[18 + 9 + 4]); buf[8 - 4] = MULH(t0, win[18 + 8 - 4]); } libavcodec/mpegaudiodec.c:1086: error: Uninitialized Value The value read from tmp[_] was never initialized. libavcodec/mpegaudiodec.c:1086:9: 1084. i = 0; 1085. for(j=0;j<4;j++) { 1086. t0 = tmp[i]; ^ 1087. t1 = tmp[i + 2]; 1088. s0 = t1 + t0;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L1086
d2a_code_trace_data_41392
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/t1_lib.c:1212: error: INTEGER_OVERFLOW_L2 (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate`. Showing all 7 steps of the trace ssl/t1_lib.c:1212:25: Call 1210. eticklen -= 16 + EVP_CIPHER_CTX_iv_length(ctx); 1211. sdec = OPENSSL_malloc(eticklen); 1212. if (sdec == NULL || EVP_DecryptUpdate(ctx, sdec, &slen, p, ^ 1213. (int)eticklen) <= 0) { 1214. EVP_CIPHER_CTX_free(ctx); 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_DecryptUpdate` 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_41393
static inline uint64_t get_val(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1); bc->bits >>= n; #else uint64_t ret = bc->bits >> (64 - n); bc->bits <<= n; #endif bc->bits_left -= n; return ret; } libavcodec/mpc7.c:258: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`. libavcodec/mpc7.c:251:36: Call 249. t = bitstream_read_vlc(&bc, hdr_vlc.table, MPC7_HDR_BITS, 1) - 5; 250. if (t == 4) 251. bands[i].res[ch] = bitstream_read(&bc, 4); ^ 252. else bands[i].res[ch] = av_clip(bands[i-1].res[ch] + t, 0, 17); 253. } libavcodec/bitstream.h:183:1: Parameter `bc->bits_left` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/mpc7.c:258:32: Call 256. mb = i; 257. if (c->MSS) 258. bands[i].msf = bitstream_read_bit(&bc); ^ 259. } 260. } libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
d2a_code_trace_data_41394
AP_DECLARE(void) ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_len) { apr_memnode_t *new_node = NULL; apr_allocator_t *allocator; struct ap_varbuf_info *new_info; char *new; if (new_len <= vb->avail) return; if (new_len < 2 * vb->avail && vb->avail < VARBUF_MAX_SIZE/2) { new_len = 2 * vb->avail; } else if (new_len > VARBUF_MAX_SIZE) { apr_abortfunc_t abort_fn = apr_pool_abort_get(vb->pool); ap_assert(abort_fn != NULL); abort_fn(APR_ENOMEM); return; } new_len++; if (new_len <= VARBUF_SMALL_SIZE) { new_len = APR_ALIGN_DEFAULT(new_len); new = apr_palloc(vb->pool, new_len); if (vb->avail && vb->strlen != 0) { AP_DEBUG_ASSERT(vb->buf != NULL); AP_DEBUG_ASSERT(vb->buf != varbuf_empty); if (new == vb->buf + vb->avail + 1) { vb->avail += new_len; return; } else { memcpy(new, vb->buf, vb->strlen == AP_VARBUF_UNKNOWN ? vb->avail + 1 : vb->strlen + 1); } } else { *new = '\0'; } vb->avail = new_len - 1; vb->buf = new; return; } allocator = apr_pool_allocator_get(vb->pool); if (new_len <= VARBUF_MAX_SIZE) new_node = apr_allocator_alloc(allocator, new_len + APR_ALIGN_DEFAULT(sizeof(*new_info))); if (!new_node) { apr_abortfunc_t abort_fn = apr_pool_abort_get(vb->pool); ap_assert(abort_fn != NULL); abort_fn(APR_ENOMEM); return; } new_info = (struct ap_varbuf_info *)new_node->first_avail; new_node->first_avail += APR_ALIGN_DEFAULT(sizeof(*new_info)); new_info->node = new_node; new_info->allocator = allocator; new = new_node->first_avail; AP_DEBUG_ASSERT(new_node->endp - new_node->first_avail >= new_len); new_len = new_node->endp - new_node->first_avail; if (vb->avail && vb->strlen != 0) memcpy(new, vb->buf, vb->strlen == AP_VARBUF_UNKNOWN ? vb->avail + 1 : vb->strlen + 1); else *new = '\0'; if (vb->info) apr_pool_cleanup_run(vb->pool, vb->info, varbuf_cleanup); apr_pool_cleanup_register(vb->pool, new_info, varbuf_cleanup, apr_pool_cleanup_null); vb->info = new_info; vb->buf = new; vb->avail = new_len - 1; } server/util.c:2625: error: INTEGER_OVERFLOW_L2 ([0, 2055] - 1):unsigned64. server/util.c:2581:1: <LHS trace> 2579. } 2580. 2581. AP_DECLARE(void) ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_len) ^ 2582. { 2583. apr_memnode_t *new_node = NULL; server/util.c:2581:1: Parameter `new_len` 2579. } 2580. 2581. AP_DECLARE(void) ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_len) ^ 2582. { 2583. apr_memnode_t *new_node = NULL; server/util.c:2602:5: Assignment 2600. } 2601. 2602. new_len++; /* add space for trailing \0 */ ^ 2603. if (new_len <= VARBUF_SMALL_SIZE) { 2604. new_len = APR_ALIGN_DEFAULT(new_len); server/util.c:2604:9: Assignment 2602. new_len++; /* add space for trailing \0 */ 2603. if (new_len <= VARBUF_SMALL_SIZE) { 2604. new_len = APR_ALIGN_DEFAULT(new_len); ^ 2605. new = apr_palloc(vb->pool, new_len); 2606. if (vb->avail && vb->strlen != 0) { server/util.c:2625:9: Binary operation: ([0, 2055] - 1):unsigned64 2623. *new = '\0'; 2624. } 2625. vb->avail = new_len - 1; ^ 2626. vb->buf = new; 2627. return;
https://github.com/apache/httpd/blob/8b2ec33ac5d314be345814db08e194ffeda6beb0/server/util.c/#L2625
d2a_code_trace_data_41395
PUT_HEVC_QPEL_HV(3, 1) libavcodec/hevcdsp_template.c:983: error: Buffer Overrun L3 Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h3v1_10`. libavcodec/hevcdsp_template.c:983:1: Call 981. QPEL(12) 982. QPEL(8) 983. QPEL(4) ^ 984. 985. static inline void FUNC(put_hevc_epel_pixels)(int16_t *dst, ptrdiff_t dststride, libavcodec/hevcdsp_template.c:907:1: <Offset trace> 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: Assignment 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: <Length trace> 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: Array declaration 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: Assignment 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3) libavcodec/hevcdsp_template.c:907:1: Array access: Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h3v1_10` 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) 907. PUT_HEVC_QPEL_HV(3, 1) ^ 908. PUT_HEVC_QPEL_HV(3, 2) 909. PUT_HEVC_QPEL_HV(3, 3)
https://github.com/libav/libav/blob/688417399c69aadd4c287bdb0dec82ef8799011c/libavcodec/hevcdsp_template.c/#L907
d2a_code_trace_data_41396
void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) { #ifdef POLY1305_ASM poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks; #endif size_t rem, num; if ((num = ctx->num)) { rem = POLY1305_BLOCK_SIZE - num; if (len >= rem) { memcpy(ctx->data + num, inp, rem); poly1305_blocks(ctx->opaque, ctx->data, POLY1305_BLOCK_SIZE, 1); inp += rem; len -= rem; } else { memcpy(ctx->data + num, inp, len); ctx->num = num + len; return; } } rem = len % POLY1305_BLOCK_SIZE; len -= rem; if (len >= POLY1305_BLOCK_SIZE) { poly1305_blocks(ctx->opaque, inp, len, 1); inp += len; } if (rem) memcpy(ctx->data, inp, rem); ctx->num = rem; } test/poly1305_internal_test.c:1571: error: INTEGER_OVERFLOW_L2 ([-15, +oo] - [-15, 15]):unsigned64 by call to `Poly1305_Update`. Showing all 8 steps of the trace test/poly1305_internal_test.c:1561:5: Assignment 1559. const TESTDATA test = tests[idx]; 1560. const unsigned char *in = test.input.data; 1561. size_t inlen = test.input.size; ^ 1562. const unsigned char *key = test.key.data; 1563. const unsigned char *expected = test.expected.data; test/poly1305_internal_test.c:1571:5: Call 1569. 1570. Poly1305_Init(&poly1305, key); 1571. Poly1305_Update(&poly1305, in, inlen); ^ 1572. Poly1305_Final(&poly1305, out); 1573. crypto/poly1305/poly1305.c:471:1: <LHS trace> 469. #endif 470. 471. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 472. { 473. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:471:1: Parameter `len` 469. #endif 470. 471. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 472. { 473. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:471:1: <RHS trace> 469. #endif 470. 471. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 472. { 473. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:471:1: Parameter `len` 469. #endif 470. 471. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 472. { 473. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:499:5: Assignment 497. } 498. 499. rem = len % POLY1305_BLOCK_SIZE; ^ 500. len -= rem; 501. crypto/poly1305/poly1305.c:500:5: Binary operation: ([-15, +oo] - [-15, 15]):unsigned64 by call to `Poly1305_Update` 498. 499. rem = len % POLY1305_BLOCK_SIZE; 500. len -= rem; ^ 501. 502. if (len >= POLY1305_BLOCK_SIZE) {
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/crypto/poly1305/poly1305.c/#L500
d2a_code_trace_data_41397
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_crpt.c:154: error: INTEGER_OVERFLOW_L2 ([0, 4+max(0, `ctx->stack.depth`)] - 1):unsigned32 by call to `BN_mod_inverse`. Showing all 25 steps of the trace crypto/rsa/rsa_crpt.c:132:1: Parameter `ctx->stack.depth` 130. } 131. 132. > static BIGNUM *rsa_get_public_exp(const BIGNUM *d, const BIGNUM *p, 133. const BIGNUM *q, BN_CTX *ctx) 134. { crypto/rsa/rsa_crpt.c:140:5: Call 138. return NULL; 139. 140. BN_CTX_start(ctx); ^ 141. r0 = BN_CTX_get(ctx); 142. r1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/rsa/rsa_crpt.c:151:10: Call 149. if (!BN_sub(r2, q, BN_value_one())) 150. goto err; 151. if (!BN_mul(r0, r1, r2, ctx)) ^ 152. goto err; 153. crypto/bn/bn_mul.c:883:1: Parameter `ctx->stack.depth` 881. #endif /* BN_RECURSION */ 882. 883. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 884. { 885. int ret = 0; crypto/rsa/rsa_crpt.c:154:11: Call 152. goto err; 153. 154. ret = BN_mod_inverse(NULL, d, r0, ctx); ^ 155. err: 156. BN_CTX_end(ctx); crypto/bn/bn_gcd.c:226:1: Parameter `ctx->stack.depth` 224. BN_CTX *ctx); 225. 226. > BIGNUM *BN_mod_inverse(BIGNUM *in, 227. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 228. { crypto/bn/bn_gcd.c:231:10: Call 229. BIGNUM *rv; 230. int noinv; 231. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 232. if (noinv) 233. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:237:1: Parameter `ctx->stack.depth` 235. } 236. 237. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 238. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 239. int *pnoinv) crypto/bn/bn_gcd.c:250:16: Call 248. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 249. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 250. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 251. } 252. crypto/bn/bn_gcd.c:557:1: Parameter `ctx->stack.depth` 555. * not contain branches that may leak sensitive information. 556. */ 557. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 558. const BIGNUM *a, const BIGNUM *n, 559. BN_CTX *ctx) crypto/bn/bn_gcd.c:568:5: Call 566. bn_check_top(n); 567. 568. BN_CTX_start(ctx); ^ 569. A = BN_CTX_get(ctx); 570. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:603:18: Call 601. BN_init(&local_B); 602. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 603. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 604. goto err; 605. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:119:1: Parameter `ctx->stack.depth` 117. #include "bn_lcl.h" 118. 119. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 120. { 121. /* crypto/bn/bn_mod.c:126:11: Call 124. */ 125. 126. if (!(BN_mod(r, m, d, ctx))) ^ 127. return 0; 128. if (!r->neg) crypto/bn/bn_div.c:189:1: Parameter `ctx->stack.depth` 187. * If 'dv' or 'rm' is NULL, the respective value is not returned. 188. */ 189. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 190. BN_CTX *ctx) 191. { crypto/bn/bn_div.c:242:5: Call 240. } 241. 242. BN_CTX_start(ctx); ^ 243. tmp = BN_CTX_get(ctx); 244. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > void BN_CTX_start(BN_CTX *ctx) 237. { 238. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:469:5: Call 467. if (no_branch) 468. bn_correct_top(res); 469. BN_CTX_end(ctx); ^ 470. return (1); 471. err: crypto/bn/bn_ctx.c:250:1: Parameter `ctx->stack.depth` 248. } 249. 250. > void BN_CTX_end(BN_CTX *ctx) 251. { 252. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:256:27: Call 254. ctx->err_stack--; 255. else { 256. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 257. /* Does this stack frame have anything to release? */ 258. if (fp < ctx->used) crypto/bn/bn_ctx.c:326:1: <LHS trace> 324. } 325. 326. > static unsigned int BN_STACK_pop(BN_STACK *st) 327. { 328. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:326:1: Parameter `st->depth` 324. } 325. 326. > static unsigned int BN_STACK_pop(BN_STACK *st) 327. { 328. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:328:12: Binary operation: ([0, 4+max(0, ctx->stack.depth)] - 1):unsigned32 by call to `BN_mod_inverse` 326. static unsigned int BN_STACK_pop(BN_STACK *st) 327. { 328. return st->indexes[--(st->depth)]; ^ 329. } 330.
https://github.com/openssl/openssl/blob/e113c9c59dcb419dd00525cec431edb854a6c897/crypto/bn/bn_ctx.c/#L328
d2a_code_trace_data_41398
int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) { int i, level = 1; ossl_uintmax_t n = posn; void **p; if (sa == NULL) return 0; for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++) if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0) break; for (;sa->levels < level; sa->levels++) { p = alloc_node(); if (p == NULL) return 0; p[0] = sa->nodes; sa->nodes = p; } if (sa->top < posn) sa->top = posn; p = sa->nodes; for (level = sa->levels - 1; level > 0; level--) { i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK; if (p[i] == NULL && (p[i] = alloc_node()) == NULL) return 0; p = p[i]; } p += posn & SA_BLOCK_MASK; if (val == NULL && *p != NULL) sa->nelem--; else if (val != NULL && *p == NULL) sa->nelem++; *p = val; return 1; } test/sparse_array_test.c:51: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `ossl_sa_char_set`. Showing all 10 steps of the trace test/sparse_array_test.c:51:14: Call 49. 50. for (i = 0; i < OSSL_NELEM(cases); i++) { 51. if (!TEST_true(ossl_sa_char_set(sa, cases[i].n, cases[i].v))) { ^ 52. TEST_note("iteration %zu", i + 1); 53. goto err; test/sparse_array_test.c:28:1: Parameter `sa->nelem` 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) test/sparse_array_test.c:28:1: Call 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) crypto/sparse_array.c:183:1: Parameter `sa->nelem` 181. } 182. 183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) 184. { 185. int i, level = 1; test/sparse_array_test.c:51:14: Call 49. 50. for (i = 0; i < OSSL_NELEM(cases); i++) { 51. if (!TEST_true(ossl_sa_char_set(sa, cases[i].n, cases[i].v))) { ^ 52. TEST_note("iteration %zu", i + 1); 53. goto err; test/sparse_array_test.c:28:1: Parameter `sa->nelem` 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) test/sparse_array_test.c:28:1: Call 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) crypto/sparse_array.c:183:1: <LHS trace> 181. } 182. 183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) 184. { 185. int i, level = 1; crypto/sparse_array.c:183:1: Parameter `sa->nelem` 181. } 182. 183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) 184. { 185. int i, level = 1; crypto/sparse_array.c:215:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ossl_sa_char_set` 213. p += posn & SA_BLOCK_MASK; 214. if (val == NULL && *p != NULL) 215. sa->nelem--; ^ 216. else if (val != NULL && *p == NULL) 217. sa->nelem++;
https://github.com/openssl/openssl/blob/8ab53b193a8e95bb2998744bc184146eb1ddcc23/crypto/sparse_array.c/#L215
d2a_code_trace_data_41399
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; } test/sm2_internal_test.c:111: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `EC_GROUP_set_generator`. Showing all 23 steps of the trace test/sm2_internal_test.c:110:17: Call 108. 109. if (!TEST_true(BN_hex2bn(&order, order_hex)) 110. || !TEST_true(BN_hex2bn(&cof, cof_hex)) ^ 111. || !TEST_true(EC_GROUP_set_generator(group, generator, order, cof))) 112. goto done; crypto/bn/bn_print.c:126:1: Parameter `(*bn)->top` 124. } 125. 126. > int BN_hex2bn(BIGNUM **bn, const char *a) 127. { 128. BIGNUM *ret = NULL; test/sm2_internal_test.c:111:17: Call 109. if (!TEST_true(BN_hex2bn(&order, order_hex)) 110. || !TEST_true(BN_hex2bn(&cof, cof_hex)) 111. || !TEST_true(EC_GROUP_set_generator(group, generator, order, cof))) ^ 112. goto done; 113. crypto/ec/ec_lib.c:268:1: Parameter `group->order->top` 266. static int ec_precompute_mont_data(EC_GROUP *); 267. 268. > int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, 269. const BIGNUM *order, const BIGNUM *cofactor) 270. { crypto/ec/ec_lib.c:285:14: Call 283. 284. if (order != NULL) { 285. if (!BN_copy(group->order, order)) ^ 286. return 0; 287. } else crypto/bn/bn_lib.c:285:1: Parameter `a->top` 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->top` 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:943:37: Call 941. BIGNUM *bn_wexpand(BIGNUM *a, int words) 942. { 943. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 944. } 945. 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 `EC_GROUP_set_generator` 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/630fe1da888490b7dfef3fe0928b813ddff5d51a/crypto/bn/bn_lib.c/#L233
d2a_code_trace_data_41400
static int add_custom_ext_intern(SSL_CTX *ctx, ENDPOINT role, unsigned int ext_type, unsigned int context, SSL_custom_ext_add_cb_ex add_cb, SSL_custom_ext_free_cb_ex free_cb, void *add_arg, SSL_custom_ext_parse_cb_ex parse_cb, void *parse_arg) { custom_ext_methods *exts = &ctx->cert->custext; custom_ext_method *meth, *tmp; if (add_cb == NULL && free_cb != NULL) return 0; #ifndef OPENSSL_NO_CT if (ext_type == TLSEXT_TYPE_signed_certificate_timestamp && (context & SSL_EXT_CLIENT_HELLO) != 0 && SSL_CTX_ct_is_enabled(ctx)) return 0; #endif if (SSL_extension_supported(ext_type) && ext_type != TLSEXT_TYPE_signed_certificate_timestamp) return 0; if (ext_type > 0xffff) return 0; if (custom_ext_find(exts, role, ext_type, NULL)) return 0; tmp = OPENSSL_realloc(exts->meths, (exts->meths_count + 1) * sizeof(custom_ext_method)); if (tmp == NULL) return 0; exts->meths = tmp; meth = exts->meths + exts->meths_count; memset(meth, 0, sizeof(*meth)); meth->role = role; meth->context = context; meth->parse_cb = parse_cb; meth->add_cb = add_cb; meth->free_cb = free_cb; meth->ext_type = ext_type; meth->add_arg = add_arg; meth->parse_arg = parse_arg; exts->meths_count++; return 1; } ssl/statem/extensions_cust.c:357: error: BUFFER_OVERRUN_S2 Offset added: [`ctx->cert->custext.meths_count` + 56, `ctx->cert->custext.meths_count` + 56] (⇐ `ctx->cert->custext.meths_count` + 56) Size: [1, 56⋅`ctx->cert->custext.meths_count` + 56]. Showing all 6 steps of the trace ssl/statem/extensions_cust.c:305:1: <Length trace> 303. } 304. 305. > static int add_custom_ext_intern(SSL_CTX *ctx, ENDPOINT role, 306. unsigned int ext_type, 307. unsigned int context, ssl/statem/extensions_cust.c:305:1: Parameter `ctx->cert->custext.meths_count` 303. } 304. 305. > static int add_custom_ext_intern(SSL_CTX *ctx, ENDPOINT role, 306. unsigned int ext_type, 307. unsigned int context, ssl/statem/extensions_cust.c:348:9: Call 346. return 0; 347. /* Search for duplicate */ 348. if (custom_ext_find(exts, role, ext_type, NULL)) ^ 349. return 0; 350. tmp = OPENSSL_realloc(exts->meths, ssl/statem/extensions_cust.c:78:1: Parameter `exts->meths_count` 76. * client, or ENDPOINT_BOTH for either 77. */ 78. > custom_ext_method *custom_ext_find(const custom_ext_methods *exts, 79. ENDPOINT role, unsigned int ext_type, 80. size_t *idx) ssl/statem/extensions_cust.c:356:5: Assignment 354. 355. exts->meths = tmp; 356. meth = exts->meths + exts->meths_count; ^ 357. memset(meth, 0, sizeof(*meth)); 358. meth->role = role; ssl/statem/extensions_cust.c:357:5: Array access: Offset added: [ctx->cert->custext.meths_count + 56, ctx->cert->custext.meths_count + 56] (⇐ ctx->cert->custext.meths_count + 56) Size: [1, 56⋅ctx->cert->custext.meths_count + 56] 355. exts->meths = tmp; 356. meth = exts->meths + exts->meths_count; 357. memset(meth, 0, sizeof(*meth)); ^ 358. meth->role = role; 359. meth->context = context;
https://github.com/openssl/openssl/blob/e128f891de71bbdba8391355af8d6d47d20b1969/ssl/statem/extensions_cust.c/#L357
d2a_code_trace_data_41401
static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track) { MOVStts *ctts_entries; uint32_t entries = 0; uint32_t atom_size; int i; ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); ctts_entries[0].count = 1; ctts_entries[0].duration = track->cluster[0].cts; for (i = 1; i < track->entry; i++) { if (track->cluster[i].cts == ctts_entries[entries].duration) { ctts_entries[entries].count++; } else { entries++; ctts_entries[entries].duration = track->cluster[i].cts; ctts_entries[entries].count = 1; } } entries++; atom_size = 16 + (entries * 8); avio_wb32(pb, atom_size); ffio_wfourcc(pb, "ctts"); avio_wb32(pb, 0); avio_wb32(pb, entries); for (i = 0; i < entries; i++) { avio_wb32(pb, ctts_entries[i].count); avio_wb32(pb, ctts_entries[i].duration); } av_free(ctts_entries); return atom_size; } libavformat/movenc.c:1164: error: Null Dereference pointer `ctts_entries` last assigned on line 1163 could be null and is dereferenced at line 1164, column 5. libavformat/movenc.c:1156:1: start of procedure mov_write_ctts_tag() 1154. } 1155. 1156. static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track) ^ 1157. { 1158. MOVStts *ctts_entries; libavformat/movenc.c:1159:5: 1157. { 1158. MOVStts *ctts_entries; 1159. uint32_t entries = 0; ^ 1160. uint32_t atom_size; 1161. int i; libavformat/movenc.c:1163:5: 1161. int i; 1162. 1163. ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */ ^ 1164. ctts_entries[0].count = 1; 1165. ctts_entries[0].duration = track->cluster[0].cts; libavutil/mem.c:62:1: start of procedure av_malloc() 60. * linker will do it automatically. */ 61. 62. void *av_malloc(size_t size) ^ 63. { 64. void *ptr = NULL; libavutil/mem.c:64:5: 62. void *av_malloc(size_t size) 63. { 64. void *ptr = NULL; ^ 65. #if CONFIG_MEMALIGN_HACK 66. long diff; libavutil/mem.c:70:9: Taking true branch 68. 69. /* let's disallow possibly ambiguous cases */ 70. if (size > (INT_MAX - 32) || !size) ^ 71. return NULL; 72. libavutil/mem.c:71:9: 69. /* let's disallow possibly ambiguous cases */ 70. if (size > (INT_MAX - 32) || !size) 71. return NULL; ^ 72. 73. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavformat/movenc.c:1164:5: 1162. 1163. ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */ 1164. ctts_entries[0].count = 1; ^ 1165. ctts_entries[0].duration = track->cluster[0].cts; 1166. for (i = 1; i < track->entry; i++) {
https://github.com/libav/libav/blob/77ab341c0c6cdf2bd437bb48d429e797d1e60da2/libavformat/movenc.c/#L1164
d2a_code_trace_data_41402
static int check_chain_extensions(X509_STORE_CTX *ctx) { int i, ok = 0, must_be_ca, plen = 0; X509 *x; int (*cb) (int xok, X509_STORE_CTX *xctx); int proxy_path_length = 0; int purpose; int allow_proxy_certs; cb = ctx->verify_cb; must_be_ca = -1; if (ctx->parent) { allow_proxy_certs = 0; purpose = X509_PURPOSE_CRL_SIGN; } else { allow_proxy_certs = ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) allow_proxy_certs = 1; purpose = ctx->param->purpose; } for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { int ret; x = sk_X509_value(ctx->chain, i); if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) && (x->ex_flags & EXFLAG_CRITICAL)) { ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (!allow_proxy_certs && (x->ex_flags & EXFLAG_PROXY)) { ctx->error = X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } ret = X509_check_ca(x); switch (must_be_ca) { case -1: if ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1) && (ret != 0)) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; case 0: if (ret != 0) { ret = 0; ctx->error = X509_V_ERR_INVALID_NON_CA; } else ret = 1; break; default: if ((ret == 0) || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1))) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; } if (ret == 0) { ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (ctx->param->purpose > 0) { ret = X509_check_purpose(x, purpose, must_be_ca > 0); if ((ret == 0) || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) && (ret != 1))) { ctx->error = X509_V_ERR_INVALID_PURPOSE; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } } if ((i > 1) && !(x->ex_flags & EXFLAG_SI) && (x->ex_pathlen != -1) && (plen > (x->ex_pathlen + proxy_path_length + 1))) { ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } if (!(x->ex_flags & EXFLAG_SI)) plen++; if (x->ex_flags & EXFLAG_PROXY) { if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) { ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED; ctx->error_depth = i; ctx->current_cert = x; ok = cb(0, ctx); if (!ok) goto end; } proxy_path_length++; must_be_ca = 0; } else must_be_ca = 1; } ok = 1; end: return ok; } crypto/x509/x509_vfy.c:414: error: NULL_DEREFERENCE pointer `x` last assigned on line 412 could be null and is dereferenced at line 414, column 17. Showing all 22 steps of the trace crypto/x509/x509_vfy.c:372:1: start of procedure check_chain_extensions() 370. */ 371. 372. > static int check_chain_extensions(X509_STORE_CTX *ctx) 373. { 374. int i, ok = 0, must_be_ca, plen = 0; crypto/x509/x509_vfy.c:374:5: 372. static int check_chain_extensions(X509_STORE_CTX *ctx) 373. { 374. > int i, ok = 0, must_be_ca, plen = 0; 375. X509 *x; 376. int (*cb) (int xok, X509_STORE_CTX *xctx); crypto/x509/x509_vfy.c:377:5: 375. X509 *x; 376. int (*cb) (int xok, X509_STORE_CTX *xctx); 377. > int proxy_path_length = 0; 378. int purpose; 379. int allow_proxy_certs; crypto/x509/x509_vfy.c:380:5: 378. int purpose; 379. int allow_proxy_certs; 380. > cb = ctx->verify_cb; 381. 382. /*- crypto/x509/x509_vfy.c:391:5: 389. * all certificates in the chain except the leaf certificate. 390. */ 391. > must_be_ca = -1; 392. 393. /* CRL path validation */ crypto/x509/x509_vfy.c:394:9: Taking false branch 392. 393. /* CRL path validation */ 394. if (ctx->parent) { ^ 395. allow_proxy_certs = 0; 396. purpose = X509_PURPOSE_CRL_SIGN; crypto/x509/x509_vfy.c:399:17: Condition is true 397. } else { 398. allow_proxy_certs = 399. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); ^ 400. /* 401. * A hack to keep people who don't want to modify their software crypto/x509/x509_vfy.c:399:13: 397. } else { 398. allow_proxy_certs = 399. > ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 400. /* 401. * A hack to keep people who don't want to modify their software crypto/x509/x509_vfy.c:398:9: 396. purpose = X509_PURPOSE_CRL_SIGN; 397. } else { 398. > allow_proxy_certs = 399. ! !(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); 400. /* crypto/x509/x509_vfy.c:404:13: Taking false branch 402. * happy 403. */ 404. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) ^ 405. allow_proxy_certs = 1; 406. purpose = ctx->param->purpose; crypto/x509/x509_vfy.c:406:9: 404. if (getenv("OPENSSL_ALLOW_PROXY_CERTS")) 405. allow_proxy_certs = 1; 406. > purpose = ctx->param->purpose; 407. } 408. crypto/x509/x509_vfy.c:410:10: 408. 409. /* Check all untrusted certificates */ 410. > for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { 411. int ret; 412. x = sk_X509_value(ctx->chain, i); crypto/x509/x509_vfy.c:410:17: Loop condition is true. Entering loop body 408. 409. /* Check all untrusted certificates */ 410. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { ^ 411. int ret; 412. x = sk_X509_value(ctx->chain, i); crypto/x509/x509_vfy.c:412:9: 410. for (i = 0; i == 0 || i < ctx->num_untrusted; i++) { 411. int ret; 412. > x = sk_X509_value(ctx->chain, i); 413. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 414. && (x->ex_flags & EXFLAG_CRITICAL)) { include/openssl/x509.h:170:1: start of procedure sk_X509_value() 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking true branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:327:9: 325. { 326. if (!st || (i < 0) || (i >= st->num)) 327. > return NULL; 328. return st->data[i]; 329. } crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) include/openssl/x509.h:170:1: return from a call to sk_X509_value 168. typedef struct x509_cinf_st X509_CINF; 169. 170. > DEFINE_STACK_OF(X509) 171. 172. /* This is used for a table of trust checking functions */ crypto/x509/x509_vfy.c:413:15: Taking true branch 411. int ret; 412. x = sk_X509_value(ctx->chain, i); 413. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) ^ 414. && (x->ex_flags & EXFLAG_CRITICAL)) { 415. ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; crypto/x509/x509_vfy.c:414:17: 412. x = sk_X509_value(ctx->chain, i); 413. if (!(ctx->param->flags & X509_V_FLAG_IGNORE_CRITICAL) 414. > && (x->ex_flags & EXFLAG_CRITICAL)) { 415. ctx->error = X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION; 416. ctx->error_depth = i;
https://github.com/openssl/openssl/blob/25be7a0feacdbd3326774f0da8aaeb966c1f57f8/crypto/x509/x509_vfy.c/#L414
d2a_code_trace_data_41403
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecdsa_ossl.c:449: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 17 steps of the trace crypto/ec/ecdsa_ossl.c:404:5: Call 402. return -1; 403. } 404. BN_CTX_start(ctx); ^ 405. u1 = BN_CTX_get(ctx); 406. u2 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/ec/ecdsa_ossl.c:449:10: Call 447. } 448. /* u1 = m * tmp mod order */ 449. if (!BN_mod_mul(u1, m, u2, order, ctx)) { ^ 450. ECerr(EC_F_OSSL_ECDSA_VERIFY_SIG, ERR_R_BN_LIB); 451. 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:32:5: Call 30. } 31. 32. BN_CTX_start(ctx); ^ 33. rr = (a != r) ? r : BN_CTX_get(ctx); 34. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_sqr.c: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.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:274:1: <Offset trace> 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:274:1: Parameter `st->depth` 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:274:1: <Length trace> 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:274:1: Parameter `*st->indexes` 272. } 273. 274. > static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:276:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 274. static unsigned int BN_STACK_pop(BN_STACK *st) 275. { 276. return st->indexes[--(st->depth)]; ^ 277. } 278.
https://github.com/openssl/openssl/blob/b8c32081e02b7008a90d878eccce46da256dfe86/crypto/bn/bn_ctx.c/#L276
d2a_code_trace_data_41404
static char * ngx_http_geo_add_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx, in_addr_t start, in_addr_t end) { in_addr_t n; ngx_uint_t h, i, s, e; ngx_array_t *a; ngx_http_geo_range_t *range; for (n = start; n <= end; n += 0x10000) { h = n >> 16; if (n == start) { s = n & 0xffff; } else { s = 0; } if ((n | 0xffff) > end) { e = end & 0xffff; } else { e = 0xffff; } a = (ngx_array_t *) ctx->high->low[h].ranges; if (a == NULL) { a = ngx_array_create(ctx->temp_pool, 64, sizeof(ngx_http_geo_range_t)); if (a == NULL) { return NGX_CONF_ERROR; } ctx->high->low[h].ranges = (ngx_http_geo_range_t *) a; } i = a->nelts; range = a->elts; while (i) { i--; if (e < (ngx_uint_t) range[i].start) { continue; } if (s > (ngx_uint_t) range[i].end) { range = ngx_array_push(a); if (range == NULL) { return NGX_CONF_ERROR; } range = a->elts; ngx_memcpy(&range[i + 2], &range[i + 1], (a->nelts - 2 - i) * sizeof(ngx_http_geo_range_t)); range[i + 1].start = (u_short) s; range[i + 1].end = (u_short) e; range[i + 1].value = ctx->value; goto next; } if (s == (ngx_uint_t) range[i].start && e == (ngx_uint_t) range[i].end) { ngx_conf_log_error(NGX_LOG_WARN, cf, 0, "duplicate range \"%V\", value: \"%v\", old value: \"%v\"", ctx->net, ctx->value, range[i].value); range[i].value = ctx->value; goto next; } if (s > (ngx_uint_t) range[i].start && e < (ngx_uint_t) range[i].end) { range = ngx_array_push(a); if (range == NULL) { return NGX_CONF_ERROR; } range = ngx_array_push(a); if (range == NULL) { return NGX_CONF_ERROR; } range = a->elts; ngx_memcpy(&range[i + 3], &range[i + 1], (a->nelts - 3 - i) * sizeof(ngx_http_geo_range_t)); range[i + 2].start = (u_short) (e + 1); range[i + 2].end = range[i].end; range[i + 2].value = range[i].value; range[i + 1].start = (u_short) s; range[i + 1].end = (u_short) e; range[i + 1].value = ctx->value; range[i].end = (u_short) (s - 1); goto next; } if (s == (ngx_uint_t) range[i].start && e < (ngx_uint_t) range[i].end) { range = ngx_array_push(a); if (range == NULL) { return NGX_CONF_ERROR; } range = a->elts; ngx_memcpy(&range[i + 1], &range[i], (a->nelts - 1 - i) * sizeof(ngx_http_geo_range_t)); range[i + 1].start = (u_short) (e + 1); range[i].start = (u_short) s; range[i].end = (u_short) e; range[i].value = ctx->value; goto next; } if (s > (ngx_uint_t) range[i].start && e == (ngx_uint_t) range[i].end) { range = ngx_array_push(a); if (range == NULL) { return NGX_CONF_ERROR; } range = a->elts; ngx_memcpy(&range[i + 2], &range[i + 1], (a->nelts - 2 - i) * sizeof(ngx_http_geo_range_t)); range[i + 1].start = (u_short) s; range[i + 1].end = (u_short) e; range[i + 1].value = ctx->value; range[i].end = (u_short) (s - 1); goto next; } s = (ngx_uint_t) range[i].start; e = (ngx_uint_t) range[i].end; ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "range \"%V\" overlaps \"%d.%d.%d.%d-%d.%d.%d.%d\"", ctx->net, h >> 8, h & 0xff, s >> 8, s & 0xff, h >> 8, h & 0xff, e >> 8, e & 0xff); return NGX_CONF_ERROR; } range = ngx_array_push(a); if (range == NULL) { return NGX_CONF_ERROR; } range->start = (u_short) s; range->end = (u_short) e; range->value = ctx->value; next: continue; } return NGX_CONF_OK; } src/http/modules/ngx_http_geo_module.c:615: error: Integer Overflow L2 ([0, +oo] - 3):unsigned64. src/http/modules/ngx_http_geo_module.c:545:17: <LHS trace> 543. 544. if (a == NULL) { 545. a = ngx_array_create(ctx->temp_pool, 64, ^ 546. sizeof(ngx_http_geo_range_t)); 547. if (a == NULL) { src/http/modules/ngx_http_geo_module.c:545:17: Call 543. 544. if (a == NULL) { 545. a = ngx_array_create(ctx->temp_pool, 64, ^ 546. sizeof(ngx_http_geo_range_t)); 547. if (a == NULL) { src/core/ngx_array.c:26:5: Assignment 24. } 25. 26. a->nelts = 0; ^ 27. a->size = size; 28. a->nalloc = n; src/http/modules/ngx_http_geo_module.c:615:17: Binary operation: ([0, +oo] - 3):unsigned64 613. range = a->elts; 614. 615. ngx_memcpy(&range[i + 3], &range[i + 1], ^ 616. (a->nelts - 3 - i) * sizeof(ngx_http_geo_range_t)); 617.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/http/modules/ngx_http_geo_module.c/#L615
d2a_code_trace_data_41405
static int flv_write_header(AVFormatContext *s) { ByteIOContext *pb = s->pb; FLVContext *flv = s->priv_data; int i, width, height, samplerate, samplesize, channels, audiocodecid, videocodecid; double framerate = 0.0; int metadata_size_pos, data_size; flv->hasAudio = 0; flv->hasVideo = 0; for(i=0; i<s->nb_streams; i++){ AVCodecContext *enc = s->streams[i]->codec; if (enc->codec_type == CODEC_TYPE_VIDEO) { width = enc->width; height = enc->height; if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) { framerate = av_q2d(s->streams[i]->r_frame_rate); } else { framerate = 1/av_q2d(s->streams[i]->codec->time_base); } flv->hasVideo=1; videocodecid = enc->codec_tag; if(videocodecid == 0) { av_log(enc, AV_LOG_ERROR, "video codec not compatible with flv\n"); return -1; } } else { flv->hasAudio=1; samplerate = enc->sample_rate; channels = enc->channels; audiocodecid = enc->codec_tag; samplesize = (enc->codec_id == CODEC_ID_PCM_S8) ? 8 : 16; if(get_audio_flags(enc)<0) return -1; } av_set_pts_info(s->streams[i], 24, 1, 1000); } put_tag(pb,"FLV"); put_byte(pb,1); put_byte(pb, FLV_HEADER_FLAG_HASAUDIO * flv->hasAudio + FLV_HEADER_FLAG_HASVIDEO * flv->hasVideo); put_be32(pb,9); put_be32(pb,0); for(i=0; i<s->nb_streams; i++){ if(s->streams[i]->codec->codec_tag == 5){ put_byte(pb,8); put_be24(pb,0); put_be24(pb,0); put_be32(pb,0); put_be32(pb,11); flv->reserved=5; } } put_byte(pb, 18); metadata_size_pos= url_ftell(pb); put_be24(pb, 0); put_be24(pb, 0); put_be32(pb, 0); put_byte(pb, AMF_DATA_TYPE_STRING); put_amf_string(pb, "onMetaData"); put_byte(pb, AMF_DATA_TYPE_MIXEDARRAY); put_be32(pb, 5*flv->hasVideo + 4*flv->hasAudio + 2); put_amf_string(pb, "duration"); flv->duration_offset= url_ftell(pb); put_amf_double(pb, 0); if(flv->hasVideo){ put_amf_string(pb, "width"); put_amf_double(pb, width); put_amf_string(pb, "height"); put_amf_double(pb, height); put_amf_string(pb, "videodatarate"); put_amf_double(pb, s->bit_rate / 1024.0); put_amf_string(pb, "framerate"); put_amf_double(pb, framerate); put_amf_string(pb, "videocodecid"); put_amf_double(pb, videocodecid); } if(flv->hasAudio){ put_amf_string(pb, "audiosamplerate"); put_amf_double(pb, samplerate); put_amf_string(pb, "audiosamplesize"); put_amf_double(pb, samplesize); put_amf_string(pb, "stereo"); put_amf_bool(pb, (channels == 2)); put_amf_string(pb, "audiocodecid"); put_amf_double(pb, audiocodecid); } put_amf_string(pb, "filesize"); flv->filesize_offset= url_ftell(pb); put_amf_double(pb, 0); put_amf_string(pb, ""); put_byte(pb, AMF_END_OF_OBJECT); data_size= url_ftell(pb) - metadata_size_pos - 10; url_fseek(pb, metadata_size_pos, SEEK_SET); put_be24(pb, data_size); url_fseek(pb, data_size + 10 - 3, SEEK_CUR); put_be32(pb, data_size + 11); return 0; } libavformat/flvenc.c:226: error: Uninitialized Value The value read from samplerate was never initialized. libavformat/flvenc.c:226:9: 224. if(flv->hasAudio){ 225. put_amf_string(pb, "audiosamplerate"); 226. put_amf_double(pb, samplerate); ^ 227. 228. put_amf_string(pb, "audiosamplesize");
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/flvenc.c/#L226
d2a_code_trace_data_41406
IMPLEMENT_new_ctx(cbc, CBC, 192) providers/common/ciphers/aes.c:293: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 293 could be null and is dereferenced at line 293, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:293:1: start of procedure aes_192_cbc_newctx() 291. IMPLEMENT_new_params(cbc, CBC) 292. IMPLEMENT_new_ctx(cbc, CBC, 256) 293. > IMPLEMENT_new_ctx(cbc, CBC, 192) 294. IMPLEMENT_new_ctx(cbc, CBC, 128) 295. 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:293:1: 291. IMPLEMENT_new_params(cbc, CBC) 292. IMPLEMENT_new_ctx(cbc, CBC, 256) 293. > IMPLEMENT_new_ctx(cbc, CBC, 192) 294. IMPLEMENT_new_ctx(cbc, CBC, 128) 295.
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L293
d2a_code_trace_data_41407
static int compat_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) { AVCodecInternal *avci = avctx->internal; int ret; av_assert0(avci->compat_decode_consumed == 0); *got_frame = 0; avci->compat_decode = 1; if (avci->compat_decode_partial_size > 0 && avci->compat_decode_partial_size != pkt->size) { av_log(avctx, AV_LOG_ERROR, "Got unexpected packet size after a partial decode\n"); ret = AVERROR(EINVAL); goto finish; } if (!avci->compat_decode_partial_size) { ret = avcodec_send_packet(avctx, pkt); if (ret == AVERROR_EOF) ret = 0; else if (ret == AVERROR(EAGAIN)) { ret = AVERROR_BUG; goto finish; } else if (ret < 0) goto finish; } while (ret >= 0) { ret = avcodec_receive_frame(avctx, frame); if (ret < 0) { if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) ret = 0; goto finish; } if (frame != avci->compat_decode_frame) { if (!avctx->refcounted_frames) { ret = unrefcount_frame(avci, frame); if (ret < 0) goto finish; } *got_frame = 1; frame = avci->compat_decode_frame; } else { if (!avci->compat_decode_warned) { av_log(avctx, AV_LOG_WARNING, "The deprecated avcodec_decode_* " "API cannot return all the frames for this decoder. " "Some frames will be dropped. Update your code to the " "new decoding API to fix this.\n"); avci->compat_decode_warned = 1; } } if (avci->draining || (!avctx->codec->bsfs && avci->compat_decode_consumed < pkt->size)) break; } finish: if (ret == 0) { if (avctx->codec->bsfs) ret = pkt->size; else ret = FFMIN(avci->compat_decode_consumed, pkt->size); } avci->compat_decode_consumed = 0; avci->compat_decode_partial_size = (ret >= 0) ? pkt->size - ret : 0; return ret; } libavcodec/decode.c:661: error: Uninitialized Value The value read from ret was never initialized. libavcodec/decode.c:661:40: 659. } 660. avci->compat_decode_consumed = 0; 661. avci->compat_decode_partial_size = (ret >= 0) ? pkt->size - ret : 0; ^ 662. 663. return ret;
https://github.com/libav/libav/blob/839010aca9713b5cd6ebe7a1db7e805c3625b168/libavcodec/decode.c/#L661
d2a_code_trace_data_41408
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))); assert(!overlapped); return overlapped; } crypto/cms/cms_pwri.c:205: error: INTEGER_OVERFLOW_L2 (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate`. Showing all 7 steps of the trace crypto/cms/cms_pwri.c:205:13: Call 203. tmp + inlen - blocklen, blocklen) 204. /* Can now decrypt first n - 1 blocks */ 205. || !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen) ^ 206. 207. /* Reset IV to original value */ 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_DecryptUpdate` 286. */ 287. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | 288. (diff > (0 - (PTRDIFF_T)len))); ^ 289. assert(!overlapped); 290. return overlapped;
https://github.com/openssl/openssl/blob/7141ba31969d0b378d08104a51f8f99b9187b9d5/crypto/evp/evp_enc.c/#L288
d2a_code_trace_data_41409
static int kek_unwrap_key(unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen, EVP_CIPHER_CTX *ctx) { size_t blocklen = EVP_CIPHER_CTX_block_size(ctx); unsigned char *tmp; int outl, rv = 0; if (inlen < 2 * blocklen) { return 0; } if (inlen % blocklen) { return 0; } if ((tmp = OPENSSL_malloc(inlen)) == NULL) { CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE); return 0; } if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl, in + inlen - 2 * blocklen, blocklen * 2) || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp + inlen - blocklen, blocklen) || !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen) || !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL) || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen)) goto err; if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) { goto err; } if (inlen < (size_t)(tmp[0] - 4)) { goto err; } *outlen = (size_t)tmp[0]; memcpy(out, tmp + 4, *outlen); rv = 1; err: OPENSSL_clear_free(tmp, inlen); return rv; } crypto/cms/cms_smime.c:691: error: BUFFER_OVERRUN_L3 Offset: 6 Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt`. Showing all 13 steps of the trace crypto/cms/cms_smime.c:691:17: Call 689. if (!id || (CMS_RecipientInfo_kekri_id_cmp(ri, id, idlen) == 0)) { 690. CMS_RecipientInfo_set0_key(ri, key, keylen); 691. r = CMS_RecipientInfo_decrypt(cms, ri); ^ 692. CMS_RecipientInfo_set0_key(ri, NULL, 0); 693. if (r > 0) crypto/cms/cms_env.c:739:1: Parameter `ri->d.pwri->encryptedKey->length` 737. } 738. 739. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) 740. { 741. switch (ri->type) { crypto/cms/cms_smime.c:691:17: Call 689. if (!id || (CMS_RecipientInfo_kekri_id_cmp(ri, id, idlen) == 0)) { 690. CMS_RecipientInfo_set0_key(ri, key, keylen); 691. r = CMS_RecipientInfo_decrypt(cms, ri); ^ 692. CMS_RecipientInfo_set0_key(ri, NULL, 0); 693. if (r > 0) crypto/cms/cms_env.c:739:1: Parameter `ri->d.pwri->encryptedKey->length` 737. } 738. 739. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) 740. { 741. switch (ri->type) { crypto/cms/cms_env.c:749:16: Call 747. 748. case CMS_RECIPINFO_PASS: 749. return cms_RecipientInfo_pwri_crypt(cms, ri, 0); ^ 750. 751. default: crypto/cms/cms_pwri.c:276:1: Parameter `ri->d.pwri->encryptedKey->length` 274. /* Encrypt/Decrypt content key in PWRI recipient info */ 275. 276. > int cms_RecipientInfo_pwri_crypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri, 277. int en_de) 278. { crypto/cms/cms_pwri.c:369:14: Call 367. goto err; 368. } 369. if (!kek_unwrap_key(key, &keylen, ^ 370. pwri->encryptedKey->data, 371. pwri->encryptedKey->length, kekctx)) { crypto/cms/cms_pwri.c:176:1: <Length trace> 174. */ 175. 176. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 177. const unsigned char *in, size_t inlen, 178. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:176:1: Parameter `inlen` 174. */ 175. 176. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 177. const unsigned char *in, size_t inlen, 178. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:191:16: Call 189. return 0; 190. } 191. if ((tmp = OPENSSL_malloc(inlen)) == NULL) { ^ 192. CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE); 193. return 0; crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/cms/cms_pwri.c:191:10: Assignment 189. return 0; 190. } 191. if ((tmp = OPENSSL_malloc(inlen)) == NULL) { ^ 192. CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE); 193. return 0; crypto/cms/cms_pwri.c:214:60: Array access: Offset: 6 Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt` 212. goto err; 213. /* Check check bytes */ 214. if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) { ^ 215. /* Check byte failure */ 216. goto err;
https://github.com/openssl/openssl/blob/bcf082d130a413a728a382bd6e6bfdbf2cedba45/crypto/cms/cms_pwri.c/#L214
d2a_code_trace_data_41410
static int kek_unwrap_key(unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen, EVP_CIPHER_CTX *ctx) { size_t blocklen = EVP_CIPHER_CTX_block_size(ctx); unsigned char *tmp; int outl, rv = 0; if (inlen < 2 * blocklen) { return 0; } if (inlen % blocklen) { return 0; } tmp = OPENSSL_malloc(inlen); if (tmp == NULL) return 0; if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl, in + inlen - 2 * blocklen, blocklen * 2) || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp + inlen - blocklen, blocklen) || !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen) || !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL) || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen)) goto err; if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) { goto err; } if (inlen < (size_t)(tmp[0] - 4)) { goto err; } *outlen = (size_t)tmp[0]; memcpy(out, tmp + 4, *outlen); rv = 1; err: OPENSSL_clear_free(tmp, inlen); return rv; } crypto/cms/cms_smime.c:734: error: BUFFER_OVERRUN_L3 Offset added: [4, +oo] (⇐ 4 + [0, +oo]) Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt`. Showing all 16 steps of the trace crypto/cms/cms_smime.c:734:17: Call 732. if (!id || (CMS_RecipientInfo_kekri_id_cmp(ri, id, idlen) == 0)) { 733. CMS_RecipientInfo_set0_key(ri, key, keylen); 734. r = CMS_RecipientInfo_decrypt(cms, ri); ^ 735. CMS_RecipientInfo_set0_key(ri, NULL, 0); 736. if (r > 0) crypto/cms/cms_env.c:782:1: Parameter `ri->d.pwri->encryptedKey->length` 780. } 781. 782. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) 783. { 784. switch (ri->type) { crypto/cms/cms_smime.c:734:17: Call 732. if (!id || (CMS_RecipientInfo_kekri_id_cmp(ri, id, idlen) == 0)) { 733. CMS_RecipientInfo_set0_key(ri, key, keylen); 734. r = CMS_RecipientInfo_decrypt(cms, ri); ^ 735. CMS_RecipientInfo_set0_key(ri, NULL, 0); 736. if (r > 0) crypto/cms/cms_env.c:782:1: Parameter `ri->d.pwri->encryptedKey->length` 780. } 781. 782. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) 783. { 784. switch (ri->type) { crypto/cms/cms_env.c:792:16: Call 790. 791. case CMS_RECIPINFO_PASS: 792. return cms_RecipientInfo_pwri_crypt(cms, ri, 0); ^ 793. 794. default: crypto/cms/cms_pwri.c:320:1: Parameter `ri->d.pwri->encryptedKey->length` 318. /* Encrypt/Decrypt content key in PWRI recipient info */ 319. 320. > int cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, 321. int en_de) 322. { crypto/cms/cms_pwri.c:409:14: Call 407. goto err; 408. } 409. if (!kek_unwrap_key(key, &keylen, ^ 410. pwri->encryptedKey->data, 411. pwri->encryptedKey->length, kekctx)) { crypto/cms/cms_pwri.c:221:1: <Offset trace> 219. */ 220. 221. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 222. const unsigned char *in, size_t inlen, 223. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:221:1: Parameter `inlen` 219. */ 220. 221. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 222. const unsigned char *in, size_t inlen, 223. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:266:5: Assignment 264. goto err; 265. } 266. *outlen = (size_t)tmp[0]; ^ 267. memcpy(out, tmp + 4, *outlen); 268. rv = 1; crypto/cms/cms_pwri.c:221:1: <Length trace> 219. */ 220. 221. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 222. const unsigned char *in, size_t inlen, 223. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:221:1: Parameter `inlen` 219. */ 220. 221. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 222. const unsigned char *in, size_t inlen, 223. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:236:11: Call 234. return 0; 235. } 236. tmp = OPENSSL_malloc(inlen); ^ 237. if (tmp == NULL) 238. return 0; crypto/mem.c:125:9: Assignment 123. 124. if (num <= 0) 125. return NULL; ^ 126. 127. allow_customize = 0; crypto/cms/cms_pwri.c:236:5: Assignment 234. return 0; 235. } 236. tmp = OPENSSL_malloc(inlen); ^ 237. if (tmp == NULL) 238. return 0; crypto/cms/cms_pwri.c:267:5: Array access: Offset added: [4, +oo] (⇐ 4 + [0, +oo]) Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt` 265. } 266. *outlen = (size_t)tmp[0]; 267. memcpy(out, tmp + 4, *outlen); ^ 268. rv = 1; 269. err:
https://github.com/openssl/openssl/blob/846ec07d904f9cc81d486db0db14fb84f61ff6e5/crypto/cms/cms_pwri.c/#L267
d2a_code_trace_data_41411
void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD *rec, size_t md_size) { #if defined(CBC_MAC_ROTATE_IN_PLACE) unsigned char rotated_mac_buf[64 + EVP_MAX_MD_SIZE]; unsigned char *rotated_mac; #else unsigned char rotated_mac[EVP_MAX_MD_SIZE]; #endif size_t mac_end = rec->length; size_t mac_start = mac_end - md_size; size_t scan_start = 0; size_t i, j; size_t div_spoiler; size_t rotate_offset; OPENSSL_assert(rec->orig_len >= md_size); OPENSSL_assert(md_size <= EVP_MAX_MD_SIZE); #if defined(CBC_MAC_ROTATE_IN_PLACE) rotated_mac = rotated_mac_buf + ((0 - (size_t)rotated_mac_buf) & 63); #endif if (rec->orig_len > md_size + 255 + 1) scan_start = rec->orig_len - (md_size + 255 + 1); div_spoiler = md_size >> 1; div_spoiler <<= (sizeof(div_spoiler) - 1) * 8; rotate_offset = (div_spoiler + mac_start - scan_start) % md_size; memset(rotated_mac, 0, md_size); for (i = scan_start, j = 0; i < rec->orig_len; i++) { unsigned char mac_started = constant_time_ge_8_s(i, mac_start); unsigned char mac_ended = constant_time_ge_8_s(i, mac_end); unsigned char b = rec->data[i]; rotated_mac[j++] |= b & mac_started & ~mac_ended; j &= constant_time_lt_s(j, md_size); } #if defined(CBC_MAC_ROTATE_IN_PLACE) j = 0; for (i = 0; i < md_size; i++) { ((volatile unsigned char *)rotated_mac)[rotate_offset ^ 32]; out[j++] = rotated_mac[rotate_offset++]; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #else memset(out, 0, md_size); rotate_offset = md_size - rotate_offset; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); for (i = 0; i < md_size; i++) { for (j = 0; j < md_size; j++) out[j] |= rotated_mac[i] & constant_time_eq_8_s(j, rotate_offset); rotate_offset++; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #endif } ssl/record/ssl3_record.c:476: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, 64]):unsigned64 by call to `ssl3_cbc_copy_mac`. Showing all 9 steps of the trace ssl/record/ssl3_record.c:226:29: Call 224. if (!PACKET_get_1(&pkt, &type) 225. || !PACKET_get_net_2(&pkt, &version) 226. || !PACKET_get_net_2_len(&pkt, &thisrr->length)) { ^ 227. al = SSL_AD_INTERNAL_ERROR; 228. SSLerr(SSL_F_SSL3_GET_RECORD, ERR_R_INTERNAL_ERROR); ssl/packet_locl.h:164:8: Parameter `*data` 162. 163. /* Same as PACKET_get_net_2() but for a size_t */ 164. __owur static ossl_inline int PACKET_get_net_2_len(PACKET *pkt, size_t *data) ^ 165. { 166. unsigned int i; ssl/record/ssl3_record.c:476:17: Call 474. */ 475. mac = mac_tmp; 476. ssl3_cbc_copy_mac(mac_tmp, thisrr, mac_size); ^ 477. thisrr->length -= mac_size; 478. } else { ssl/record/ssl3_record.c:1297:1: <LHS trace> 1295. #define CBC_MAC_ROTATE_IN_PLACE 1296. 1297. > void ssl3_cbc_copy_mac(unsigned char *out, 1298. const SSL3_RECORD *rec, size_t md_size) 1299. { ssl/record/ssl3_record.c:1297:1: Parameter `rec->length` 1295. #define CBC_MAC_ROTATE_IN_PLACE 1296. 1297. > void ssl3_cbc_copy_mac(unsigned char *out, 1298. const SSL3_RECORD *rec, size_t md_size) 1299. { ssl/record/ssl3_record.c:1310:5: Assignment 1308. * mac_end is the index of |rec->data| just after the end of the MAC. 1309. */ 1310. size_t mac_end = rec->length; ^ 1311. size_t mac_start = mac_end - md_size; 1312. /* ssl/record/ssl3_record.c:1297:1: <RHS trace> 1295. #define CBC_MAC_ROTATE_IN_PLACE 1296. 1297. > void ssl3_cbc_copy_mac(unsigned char *out, 1298. const SSL3_RECORD *rec, size_t md_size) 1299. { ssl/record/ssl3_record.c:1297:1: Parameter `md_size` 1295. #define CBC_MAC_ROTATE_IN_PLACE 1296. 1297. > void ssl3_cbc_copy_mac(unsigned char *out, 1298. const SSL3_RECORD *rec, size_t md_size) 1299. { ssl/record/ssl3_record.c:1311:5: Binary operation: ([0, +oo] - [0, 64]):unsigned64 by call to `ssl3_cbc_copy_mac` 1309. */ 1310. size_t mac_end = rec->length; 1311. size_t mac_start = mac_end - md_size; ^ 1312. /* 1313. * scan_start contains the number of bytes that we can ignore because the
https://github.com/openssl/openssl/blob/829754a62245df76584078011f045185218c60c4/ssl/record/ssl3_record.c/#L1311
d2a_code_trace_data_41412
static int cert_status_cb(SSL *s, void *arg) { tlsextstatusctx *srctx = arg; char *host = NULL, *port = NULL, *path = NULL; int use_ssl; unsigned char *rspder = NULL; int rspderlen; STACK_OF(OPENSSL_STRING) *aia = NULL; X509 *x = NULL; X509_STORE_CTX inctx; X509_OBJECT obj; OCSP_REQUEST *req = NULL; OCSP_RESPONSE *resp = NULL; OCSP_CERTID *id = NULL; STACK_OF(X509_EXTENSION) *exts; int ret = SSL_TLSEXT_ERR_NOACK; int i; if (srctx->verbose) BIO_puts(bio_err, "cert_status: callback called\n"); x = SSL_get_certificate(s); aia = X509_get1_ocsp(x); if (aia) { if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0), &host, &port, &path, &use_ssl)) { BIO_puts(bio_err, "cert_status: can't parse AIA URL\n"); goto err; } if (srctx->verbose) BIO_printf(bio_err, "cert_status: AIA URL: %s\n", sk_OPENSSL_STRING_value(aia, 0)); } else { if (!srctx->host) { BIO_puts(bio_err, "cert_status: no AIA and no default responder URL\n"); goto done; } host = srctx->host; path = srctx->path; port = srctx->port; use_ssl = srctx->use_ssl; } if (!X509_STORE_CTX_init(&inctx, SSL_CTX_get_cert_store(SSL_get_SSL_CTX(s)), NULL, NULL)) goto err; if (X509_STORE_get_by_subject(&inctx, X509_LU_X509, X509_get_issuer_name(x), &obj) <= 0) { BIO_puts(bio_err, "cert_status: Can't retrieve issuer certificate.\n"); X509_STORE_CTX_cleanup(&inctx); goto done; } req = OCSP_REQUEST_new(); if (req == NULL) goto err; id = OCSP_cert_to_id(NULL, x, obj.data.x509); X509_free(obj.data.x509); X509_STORE_CTX_cleanup(&inctx); if (!id) goto err; if (!OCSP_request_add0_id(req, id)) goto err; id = NULL; SSL_get_tlsext_status_exts(s, &exts); for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) { X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i); if (!OCSP_REQUEST_add_ext(req, ext, -1)) goto err; } resp = process_responder(req, host, path, port, use_ssl, NULL, srctx->timeout); if (!resp) { BIO_puts(bio_err, "cert_status: error querying responder\n"); goto done; } rspderlen = i2d_OCSP_RESPONSE(resp, &rspder); if (rspderlen <= 0) goto err; SSL_set_tlsext_status_ocsp_resp(s, rspder, rspderlen); if (srctx->verbose) { BIO_puts(bio_err, "cert_status: ocsp response sent:\n"); OCSP_RESPONSE_print(bio_err, resp, 2); } ret = SSL_TLSEXT_ERR_OK; done: if (ret != SSL_TLSEXT_ERR_OK) ERR_print_errors(bio_err); if (aia) { OPENSSL_free(host); OPENSSL_free(path); OPENSSL_free(port); X509_email_free(aia); } OCSP_CERTID_free(id); OCSP_REQUEST_free(req); OCSP_RESPONSE_free(resp); return ret; err: ret = SSL_TLSEXT_ERR_ALERT_FATAL; goto done; } apps/s_server.c:640: error: NULL_DEREFERENCE pointer `x` last assigned on line 639 could be null and is dereferenced by call to `X509_get1_ocsp()` at line 640, column 11. Showing all 31 steps of the trace apps/s_server.c:618:1: start of procedure cert_status_cb() 616. */ 617. 618. > static int cert_status_cb(SSL *s, void *arg) 619. { 620. tlsextstatusctx *srctx = arg; apps/s_server.c:620:5: 618. static int cert_status_cb(SSL *s, void *arg) 619. { 620. > tlsextstatusctx *srctx = arg; 621. char *host = NULL, *port = NULL, *path = NULL; 622. int use_ssl; apps/s_server.c:621:5: 619. { 620. tlsextstatusctx *srctx = arg; 621. > char *host = NULL, *port = NULL, *path = NULL; 622. int use_ssl; 623. unsigned char *rspder = NULL; apps/s_server.c:623:5: 621. char *host = NULL, *port = NULL, *path = NULL; 622. int use_ssl; 623. > unsigned char *rspder = NULL; 624. int rspderlen; 625. STACK_OF(OPENSSL_STRING) *aia = NULL; apps/s_server.c:625:5: 623. unsigned char *rspder = NULL; 624. int rspderlen; 625. > STACK_OF(OPENSSL_STRING) *aia = NULL; 626. X509 *x = NULL; 627. X509_STORE_CTX inctx; apps/s_server.c:626:5: 624. int rspderlen; 625. STACK_OF(OPENSSL_STRING) *aia = NULL; 626. > X509 *x = NULL; 627. X509_STORE_CTX inctx; 628. X509_OBJECT obj; apps/s_server.c:629:5: 627. X509_STORE_CTX inctx; 628. X509_OBJECT obj; 629. > OCSP_REQUEST *req = NULL; 630. OCSP_RESPONSE *resp = NULL; 631. OCSP_CERTID *id = NULL; apps/s_server.c:630:5: 628. X509_OBJECT obj; 629. OCSP_REQUEST *req = NULL; 630. > OCSP_RESPONSE *resp = NULL; 631. OCSP_CERTID *id = NULL; 632. STACK_OF(X509_EXTENSION) *exts; apps/s_server.c:631:5: 629. OCSP_REQUEST *req = NULL; 630. OCSP_RESPONSE *resp = NULL; 631. > OCSP_CERTID *id = NULL; 632. STACK_OF(X509_EXTENSION) *exts; 633. int ret = SSL_TLSEXT_ERR_NOACK; apps/s_server.c:633:5: 631. OCSP_CERTID *id = NULL; 632. STACK_OF(X509_EXTENSION) *exts; 633. > int ret = SSL_TLSEXT_ERR_NOACK; 634. int i; 635. apps/s_server.c:636:9: Taking true branch 634. int i; 635. 636. if (srctx->verbose) ^ 637. BIO_puts(bio_err, "cert_status: callback called\n"); 638. /* Build up OCSP query from server certificate */ apps/s_server.c:637:9: 635. 636. if (srctx->verbose) 637. > BIO_puts(bio_err, "cert_status: callback called\n"); 638. /* Build up OCSP query from server certificate */ 639. x = SSL_get_certificate(s); crypto/bio/bio_lib.c:252:1: start of procedure BIO_puts() 250. } 251. 252. > int BIO_puts(BIO *b, const char *in) 253. { 254. int i; crypto/bio/bio_lib.c:257:10: Taking false branch 255. long (*cb) (BIO *, int, const char *, int, long, long); 256. 257. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) { ^ 258. BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD); 259. return (-2); crypto/bio/bio_lib.c:257:25: Taking false branch 255. long (*cb) (BIO *, int, const char *, int, long, long); 256. 257. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) { ^ 258. BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD); 259. return (-2); crypto/bio/bio_lib.c:257:48: Taking false branch 255. long (*cb) (BIO *, int, const char *, int, long, long); 256. 257. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) { ^ 258. BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD); 259. return (-2); crypto/bio/bio_lib.c:262:5: 260. } 261. 262. > cb = b->callback; 263. 264. if ((cb != NULL) && ((i = (int)cb(b, BIO_CB_PUTS, in, 0, 0L, 1L)) <= 0)) crypto/bio/bio_lib.c:264:10: Taking false branch 262. cb = b->callback; 263. 264. if ((cb != NULL) && ((i = (int)cb(b, BIO_CB_PUTS, in, 0, 0L, 1L)) <= 0)) ^ 265. return (i); 266. crypto/bio/bio_lib.c:267:10: Taking false branch 265. return (i); 266. 267. if (!b->init) { ^ 268. BIOerr(BIO_F_BIO_PUTS, BIO_R_UNINITIALIZED); 269. return (-2); crypto/bio/bio_lib.c:272:5: Skipping __function_pointer__(): unresolved function pointer 270. } 271. 272. i = b->method->bputs(b, in); ^ 273. 274. if (i > 0) crypto/bio/bio_lib.c:274:9: Taking true branch 272. i = b->method->bputs(b, in); 273. 274. if (i > 0) ^ 275. b->num_write += (uint64_t)i; 276. crypto/bio/bio_lib.c:275:9: 273. 274. if (i > 0) 275. > b->num_write += (uint64_t)i; 276. 277. if (cb != NULL) crypto/bio/bio_lib.c:277:9: Taking false branch 275. b->num_write += (uint64_t)i; 276. 277. if (cb != NULL) ^ 278. i = (int)cb(b, BIO_CB_PUTS | BIO_CB_RETURN, in, 0, 0L, (long)i); 279. return (i); crypto/bio/bio_lib.c:279:5: 277. if (cb != NULL) 278. i = (int)cb(b, BIO_CB_PUTS | BIO_CB_RETURN, in, 0, 0L, (long)i); 279. > return (i); 280. } 281. crypto/bio/bio_lib.c:280:1: return from a call to BIO_puts 278. i = (int)cb(b, BIO_CB_PUTS | BIO_CB_RETURN, in, 0, 0L, (long)i); 279. return (i); 280. > } 281. 282. int BIO_gets(BIO *b, char *in, int inl) apps/s_server.c:639:5: 637. BIO_puts(bio_err, "cert_status: callback called\n"); 638. /* Build up OCSP query from server certificate */ 639. > x = SSL_get_certificate(s); 640. aia = X509_get1_ocsp(x); 641. if (aia) { ssl/ssl_lib.c:2748:1: start of procedure SSL_get_certificate() 2746. } 2747. 2748. > X509 *SSL_get_certificate(const SSL *s) 2749. { 2750. if (s->cert != NULL) ssl/ssl_lib.c:2750:9: Taking false branch 2748. X509 *SSL_get_certificate(const SSL *s) 2749. { 2750. if (s->cert != NULL) ^ 2751. return (s->cert->key->x509); 2752. else ssl/ssl_lib.c:2753:9: 2751. return (s->cert->key->x509); 2752. else 2753. > return (NULL); 2754. } 2755. ssl/ssl_lib.c:2754:1: return from a call to SSL_get_certificate 2752. else 2753. return (NULL); 2754. > } 2755. 2756. EVP_PKEY *SSL_get_privatekey(const SSL *s) apps/s_server.c:640:5: 638. /* Build up OCSP query from server certificate */ 639. x = SSL_get_certificate(s); 640. > aia = X509_get1_ocsp(x); 641. if (aia) { 642. if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0),
https://github.com/openssl/openssl/blob/4cfa6204e8740a3e89b96fac3f1ac49d137e9dc9/apps/s_server.c/#L640
d2a_code_trace_data_41413
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ int i; InternalBuffer *buf, *last; AVCodecInternal *avci = s->internal; assert(s->codec_type == AVMEDIA_TYPE_VIDEO); assert(pic->type==FF_BUFFER_TYPE_INTERNAL); assert(avci->buffer_count); if (avci->buffer) { buf = NULL; for (i = 0; i < avci->buffer_count; i++) { buf = &avci->buffer[i]; if (buf->data[0] == pic->data[0]) break; } assert(i < avci->buffer_count); avci->buffer_count--; last = &avci->buffer[avci->buffer_count]; if (buf != last) FFSWAP(InternalBuffer, *buf, *last); } for (i = 0; i < AV_NUM_DATA_POINTERS; i++) { pic->data[i]=NULL; } if(s->debug&FF_DEBUG_BUFFERS) av_log(s, AV_LOG_DEBUG, "default_release_buffer called on pic %p, %d " "buffers used\n", pic, avci->buffer_count); } libavcodec/utils.c:504: error: Null Dereference pointer `buf` last assigned on line 493 could be null and is dereferenced at line 504, column 13. libavcodec/utils.c:482:1: start of procedure avcodec_default_release_buffer() 480. } 481. 482. void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ ^ 483. int i; 484. InternalBuffer *buf, *last; libavcodec/utils.c:485:5: 483. int i; 484. InternalBuffer *buf, *last; 485. AVCodecInternal *avci = s->internal; ^ 486. 487. assert(s->codec_type == AVMEDIA_TYPE_VIDEO); libavcodec/utils.c:487:5: 485. AVCodecInternal *avci = s->internal; 486. 487. assert(s->codec_type == AVMEDIA_TYPE_VIDEO); ^ 488. 489. assert(pic->type==FF_BUFFER_TYPE_INTERNAL); libavcodec/utils.c:489:5: 487. assert(s->codec_type == AVMEDIA_TYPE_VIDEO); 488. 489. assert(pic->type==FF_BUFFER_TYPE_INTERNAL); ^ 490. assert(avci->buffer_count); 491. libavcodec/utils.c:490:5: 488. 489. assert(pic->type==FF_BUFFER_TYPE_INTERNAL); 490. assert(avci->buffer_count); ^ 491. 492. if (avci->buffer) { libavcodec/utils.c:492:9: Taking true branch 490. assert(avci->buffer_count); 491. 492. if (avci->buffer) { ^ 493. buf = NULL; /* avoids warning */ 494. for (i = 0; i < avci->buffer_count; i++) { //just 3-5 checks so is not worth to optimize libavcodec/utils.c:493:9: 491. 492. if (avci->buffer) { 493. buf = NULL; /* avoids warning */ ^ 494. for (i = 0; i < avci->buffer_count; i++) { //just 3-5 checks so is not worth to optimize 495. buf = &avci->buffer[i]; libavcodec/utils.c:494:14: 492. if (avci->buffer) { 493. buf = NULL; /* avoids warning */ 494. for (i = 0; i < avci->buffer_count; i++) { //just 3-5 checks so is not worth to optimize ^ 495. buf = &avci->buffer[i]; 496. if (buf->data[0] == pic->data[0]) libavcodec/utils.c:494:21: Loop condition is false. Leaving loop 492. if (avci->buffer) { 493. buf = NULL; /* avoids warning */ 494. for (i = 0; i < avci->buffer_count; i++) { //just 3-5 checks so is not worth to optimize ^ 495. buf = &avci->buffer[i]; 496. if (buf->data[0] == pic->data[0]) libavcodec/utils.c:499:9: 497. break; 498. } 499. assert(i < avci->buffer_count); ^ 500. avci->buffer_count--; 501. last = &avci->buffer[avci->buffer_count]; libavcodec/utils.c:500:9: 498. } 499. assert(i < avci->buffer_count); 500. avci->buffer_count--; ^ 501. last = &avci->buffer[avci->buffer_count]; 502. libavcodec/utils.c:501:9: 499. assert(i < avci->buffer_count); 500. avci->buffer_count--; 501. last = &avci->buffer[avci->buffer_count]; ^ 502. 503. if (buf != last) libavcodec/utils.c:503:13: Taking true branch 501. last = &avci->buffer[avci->buffer_count]; 502. 503. if (buf != last) ^ 504. FFSWAP(InternalBuffer, *buf, *last); 505. } libavcodec/utils.c:504:13: 502. 503. if (buf != last) 504. FFSWAP(InternalBuffer, *buf, *last); ^ 505. } 506.
https://github.com/libav/libav/blob/ce94948198f3d22fd1ed53b99ee31e0a3f791f87/libavcodec/utils.c/#L504
d2a_code_trace_data_41414
static int auth_suppdata_generate_cb(SSL *s, unsigned short supp_data_type, const unsigned char **out, unsigned short *outlen, void *arg) { if (c_auth && server_provided_client_authz && server_provided_server_authz) { if (!c_auth_require_reneg || (c_auth_require_reneg && SSL_num_renegotiations(s))) { generated_supp_data = OPENSSL_malloc(10); memcpy(generated_supp_data, "5432154321", 10); *out = generated_supp_data; *outlen = 10; return 1; } } return -1; } apps/s_client.c:2501: error: NULL_DEREFERENCE pointer `generated_supp_data` last assigned on line 2500 could be null and is dereferenced by call to `memcpy()` at line 2501, column 4. Showing all 20 steps of the trace apps/s_client.c:2489:1: start of procedure auth_suppdata_generate_cb() 2487. } 2488. 2489. > static int auth_suppdata_generate_cb(SSL *s, unsigned short supp_data_type, 2490. const unsigned char **out, 2491. unsigned short *outlen, void *arg) apps/s_client.c:2493:6: Taking true branch 2491. unsigned short *outlen, void *arg) 2492. { 2493. if (c_auth && server_provided_client_authz && server_provided_server_authz) ^ 2494. { 2495. /*if auth_require_reneg flag is set, only send supplemental data if apps/s_client.c:2493:16: Taking true branch 2491. unsigned short *outlen, void *arg) 2492. { 2493. if (c_auth && server_provided_client_authz && server_provided_server_authz) ^ 2494. { 2495. /*if auth_require_reneg flag is set, only send supplemental data if apps/s_client.c:2493:48: Taking true branch 2491. unsigned short *outlen, void *arg) 2492. { 2493. if (c_auth && server_provided_client_authz && server_provided_server_authz) ^ 2494. { 2495. /*if auth_require_reneg flag is set, only send supplemental data if apps/s_client.c:2497:8: Taking true branch 2495. /*if auth_require_reneg flag is set, only send supplemental data if 2496. renegotiation has occurred */ 2497. if (!c_auth_require_reneg ^ 2498. || (c_auth_require_reneg && SSL_num_renegotiations(s))) 2499. { apps/s_client.c:2500:4: 2498. || (c_auth_require_reneg && SSL_num_renegotiations(s))) 2499. { 2500. > generated_supp_data = OPENSSL_malloc(10); 2501. memcpy(generated_supp_data, "5432154321", 10); 2502. *out = generated_supp_data; crypto/mem.c:295:1: start of procedure CRYPTO_malloc() 293. } 294. 295. > void *CRYPTO_malloc(int num, const char *file, int line) 296. { 297. void *ret = NULL; crypto/mem.c:297:2: 295. void *CRYPTO_malloc(int num, const char *file, int line) 296. { 297. > void *ret = NULL; 298. 299. if (num <= 0) return NULL; crypto/mem.c:299:6: Taking false branch 297. void *ret = NULL; 298. 299. if (num <= 0) return NULL; ^ 300. 301. allow_customize = 0; crypto/mem.c:301:2: 299. if (num <= 0) return NULL; 300. 301. > allow_customize = 0; 302. if (malloc_debug_func != NULL) 303. { crypto/mem.c:302:6: Taking true branch 300. 301. allow_customize = 0; 302. if (malloc_debug_func != NULL) ^ 303. { 304. allow_customize_debug = 0; crypto/mem.c:304:3: 302. if (malloc_debug_func != NULL) 303. { 304. > allow_customize_debug = 0; 305. malloc_debug_func(NULL, num, file, line, 0); 306. } crypto/mem.c:305:3: Skipping __function_pointer__(): unresolved function pointer 303. { 304. allow_customize_debug = 0; 305. malloc_debug_func(NULL, num, file, line, 0); ^ 306. } 307. ret = malloc_ex_func(num,file,line); crypto/mem.c:307:2: Skipping __function_pointer__(): unresolved function pointer 305. malloc_debug_func(NULL, num, file, line, 0); 306. } 307. ret = malloc_ex_func(num,file,line); ^ 308. #ifdef LEVITTE_DEBUG_MEM 309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); crypto/mem.c:311:6: Taking true branch 309. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num); 310. #endif 311. if (malloc_debug_func != NULL) ^ 312. malloc_debug_func(ret, num, file, line, 1); 313. crypto/mem.c:312:3: Skipping __function_pointer__(): unresolved function pointer 310. #endif 311. if (malloc_debug_func != NULL) 312. malloc_debug_func(ret, num, file, line, 1); ^ 313. 314. #ifndef OPENSSL_CPUID_OBJ crypto/mem.c:318:12: Taking false branch 316. * sanitisation function can't be optimised out. NB: We only do 317. * this for >2Kb so the overhead doesn't bother us. */ 318. if(ret && (num > 2048)) ^ 319. { extern unsigned char cleanse_ctr; 320. ((unsigned char *)ret)[0] = cleanse_ctr; crypto/mem.c:324:2: 322. #endif 323. 324. > return ret; 325. } 326. char *CRYPTO_strdup(const char *str, const char *file, int line) crypto/mem.c:325:2: return from a call to CRYPTO_malloc 323. 324. return ret; 325. } ^ 326. char *CRYPTO_strdup(const char *str, const char *file, int line) 327. { apps/s_client.c:2501:4: 2499. { 2500. generated_supp_data = OPENSSL_malloc(10); 2501. > memcpy(generated_supp_data, "5432154321", 10); 2502. *out = generated_supp_data; 2503. *outlen = 10;
https://github.com/openssl/openssl/blob/99fb221280045f1ed930e4d9355013b461532913/apps/s_client.c/#L2501
d2a_code_trace_data_41415
static void opt_vstats (void) { char filename[40]; time_t today2 = time(NULL); struct tm *today = localtime(&today2); snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, today->tm_sec); opt_vstats_file(filename); } ffmpeg.c:3961: error: Null Dereference pointer `today` last assigned on line 3959 could be null and is dereferenced at line 3961, column 69. ffmpeg.c:3955:1: start of procedure opt_vstats() 3953. } 3954. 3955. static void opt_vstats (void) ^ 3956. { 3957. char filename[40]; ffmpeg.c:3958:5: 3956. { 3957. char filename[40]; 3958. time_t today2 = time(NULL); ^ 3959. struct tm *today = localtime(&today2); 3960. ffmpeg.c:3959:5: 3957. char filename[40]; 3958. time_t today2 = time(NULL); 3959. struct tm *today = localtime(&today2); ^ 3960. 3961. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ffmpeg.c:3961:5: 3959. struct tm *today = localtime(&today2); 3960. 3961. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ^ 3962. today->tm_sec); 3963. opt_vstats_file(filename);
https://github.com/libav/libav/blob/eced8fa02ea237abd9c6a6e9287bb7524addb8f4/ffmpeg.c/#L3961
d2a_code_trace_data_41416
IMPLEMENT_new_ctx(ecb, ECB, 192) providers/common/ciphers/aes.c:287: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 287 could be null and is dereferenced at line 287, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:287:1: start of procedure aes_192_ecb_newctx() 285. IMPLEMENT_new_params(ecb, ECB) 286. IMPLEMENT_new_ctx(ecb, ECB, 256) 287. > IMPLEMENT_new_ctx(ecb, ECB, 192) 288. IMPLEMENT_new_ctx(ecb, ECB, 128) 289. 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:287:1: 285. IMPLEMENT_new_params(ecb, ECB) 286. IMPLEMENT_new_ctx(ecb, ECB, 256) 287. > IMPLEMENT_new_ctx(ecb, ECB, 192) 288. IMPLEMENT_new_ctx(ecb, ECB, 128) 289.
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L287
d2a_code_trace_data_41417
void ngx_http_set_exten(ngx_http_request_t *r) { ngx_int_t i; ngx_str_null(&r->exten); for (i = r->uri.len - 1; i > 1; i--) { if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') { r->exten.len = r->uri.len - i - 1; r->exten.data = &r->uri.data[i + 1]; return; } else if (r->uri.data[i] == '/') { return; } } return; } src/http/ngx_http_request.c:1076: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64 by call to `ngx_http_finalize_request`. src/http/ngx_http_request.c:1052:1: Parameter `*r->args_start` 1050. 1051. 1052. ngx_int_t ^ 1053. ngx_http_process_request_uri(ngx_http_request_t *r) 1054. { src/http/ngx_http_request.c:1058:9: Assignment 1056. 1057. if (r->args_start) { 1058. r->uri.len = r->args_start - 1 - r->uri_start; ^ 1059. } else { 1060. r->uri.len = r->uri_end - r->uri_start; src/http/ngx_http_request.c:1076:13: Call 1074. ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, 1075. "client sent invalid request"); 1076. ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST); ^ 1077. return NGX_ERROR; 1078. } src/http/ngx_http_request.c:2251:1: Parameter `r->uri.len` 2249. 2250. 2251. void ^ 2252. ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) 2253. { src/http/ngx_http_request.c:2323:38: Call 2321. c->write->handler = ngx_http_request_handler; 2322. 2323. ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc)); ^ 2324. return; 2325. } src/http/ngx_http_special_response.c:365:1: Parameter `r->uri.len` 363. 364. 365. ngx_int_t ^ 366. ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) 367. { src/http/ngx_http_special_response.c:416:24: Call 414. for (i = 0; i < clcf->error_pages->nelts; i++) { 415. if (err_page[i].status == error) { 416. return ngx_http_send_error_page(r, &err_page[i]); ^ 417. } 418. } src/http/ngx_http_special_response.c:534:1: Parameter `r->uri.len` 532. 533. 534. static ngx_int_t ^ 535. ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page) 536. { src/http/ngx_http_special_response.c:570:16: Call 568. } 569. 570. return ngx_http_internal_redirect(r, &uri, &args); ^ 571. } 572. src/http/ngx_http_core_module.c:2592:1: Parameter `r->uri.len` 2590. 2591. 2592. ngx_int_t ^ 2593. ngx_http_internal_redirect(ngx_http_request_t *r, 2594. ngx_str_t *uri, ngx_str_t *args) src/http/ngx_http_core_module.c:2622:5: Call 2620. "internal redirect: \"%V?%V\"", uri, &r->args); 2621. 2622. ngx_http_set_exten(r); ^ 2623. 2624. /* clear the modules contexts */ src/http/ngx_http_core_module.c:1794:1: <LHS trace> 1792. 1793. 1794. void ^ 1795. ngx_http_set_exten(ngx_http_request_t *r) 1796. { src/http/ngx_http_core_module.c:1794:1: Parameter `r->uri.len` 1792. 1793. 1794. void ^ 1795. ngx_http_set_exten(ngx_http_request_t *r) 1796. { src/http/ngx_http_core_module.c:1801:10: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_http_finalize_request` 1799. ngx_str_null(&r->exten); 1800. 1801. for (i = r->uri.len - 1; i > 1; i--) { ^ 1802. if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') { 1803.
https://github.com/nginx/nginx/blob/7e52432a0518ab5abe35478aacdac4ddda05c5e5/src/http/ngx_http_core_module.c/#L1801
d2a_code_trace_data_41418
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/sm2/sm2_sign.c:238: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_add`. Showing all 19 steps of the trace crypto/sm2/sm2_sign.c:207:5: Call 205. } 206. 207. BN_CTX_start(ctx); ^ 208. k = BN_CTX_get(ctx); 209. rk = 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/sm2/sm2_sign.c:238:21: Call 236. || !EC_POINT_get_affine_coordinates(group, kG, x1, NULL, 237. ctx) 238. || !BN_mod_add(r, e, x1, order, ctx)) { ^ 239. SM2err(SM2_F_SM2_SIG_GEN, ERR_R_INTERNAL_ERROR); 240. goto done; crypto/bn/bn_mod.c:28:1: Parameter `ctx->stack.depth` 26. } 27. 28. > int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 29. BN_CTX *ctx) 30. { crypto/bn/bn_mod.c:33:12: Call 31. if (!BN_add(r, a, b)) 32. return 0; 33. return BN_nnmod(r, r, m, ctx); ^ 34. } 35. crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_add` 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_41419
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecp_oct.c:62: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 14 steps of the trace crypto/ec/ecp_oct.c:16:1: Parameter `ctx->stack.depth` 14. #include "ec_lcl.h" 15. 16. > int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, 17. EC_POINT *point, 18. const BIGNUM *x_, int y_bit, crypto/ec/ecp_oct.c:36:5: Call 34. y_bit = (y_bit != 0); 35. 36. BN_CTX_start(ctx); ^ 37. tmp1 = BN_CTX_get(ctx); 38. tmp2 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/ec/ecp_oct.c:62:14: Call 60. if (!BN_mod_sqr(tmp2, x_, group->field, ctx)) 61. goto err; 62. if (!BN_mod_mul(tmp1, tmp2, x_, group->field, ctx)) ^ 63. goto err; 64. } crypto/bn/bn_mod.c:203:5: Call 201. bn_check_top(m); 202. 203. BN_CTX_start(ctx); ^ 204. if ((t = BN_CTX_get(ctx)) == NULL) 205. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mod.c:218:5: Call 216. ret = 1; 217. err: 218. BN_CTX_end(ctx); ^ 219. return ret; 220. } crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_41420
int test_exp(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *d, *e, *one; int i; a = BN_new(); b = BN_new(); d = BN_new(); e = BN_new(); one = BN_new(); BN_one(one); for (i = 0; i < num2; i++) { BN_bntest_rand(a, 20 + i * 5, 0, 0); BN_bntest_rand(b, 2 + i, 0, 0); if (BN_exp(d, a, b, ctx) <= 0) return (0); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " ^ "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); } BN_one(e); for (; !BN_is_zero(b); BN_sub(b, b, one)) BN_mul(e, e, a, ctx); BN_sub(e, e, d); if (!BN_is_zero(e)) { fprintf(stderr, "Exponentiation test failed!\n"); return 0; } } BN_free(a); BN_free(b); BN_free(d); BN_free(e); BN_free(one); return (1); } test/bntest.c:1214: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 1181, column 9 is not reachable after line 1214, column 5. Showing all 136 steps of the trace test/bntest.c:1176:1: start of procedure test_exp() 1174. } 1175. 1176. > int test_exp(BIO *bp, BN_CTX *ctx) 1177. { 1178. BIGNUM *a, *b, *d, *e, *one; test/bntest.c:1181:5: 1179. int i; 1180. 1181. > a = BN_new(); 1182. b = BN_new(); 1183. d = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1182:5: 1180. 1181. a = BN_new(); 1182. > b = BN_new(); 1183. d = BN_new(); 1184. e = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1183:5: 1181. a = BN_new(); 1182. b = BN_new(); 1183. > d = BN_new(); 1184. e = BN_new(); 1185. one = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1184:5: 1182. b = BN_new(); 1183. d = BN_new(); 1184. > e = BN_new(); 1185. one = BN_new(); 1186. BN_one(one); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1185:5: 1183. d = BN_new(); 1184. e = BN_new(); 1185. > one = BN_new(); 1186. BN_one(one); 1187. crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1186:5: 1184. e = BN_new(); 1185. one = BN_new(); 1186. > BN_one(one); 1187. 1188. for (i = 0; i < num2; i++) { crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is true 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:1188:10: 1186. BN_one(one); 1187. 1188. > for (i = 0; i < num2; i++) { 1189. BN_bntest_rand(a, 20 + i * 5, 0, 0); 1190. BN_bntest_rand(b, 2 + i, 0, 0); test/bntest.c:1188:17: Loop condition is false. Leaving loop 1186. BN_one(one); 1187. 1188. for (i = 0; i < num2; i++) { ^ 1189. BN_bntest_rand(a, 20 + i * 5, 0, 0); 1190. BN_bntest_rand(b, 2 + i, 0, 0); test/bntest.c:1214:5: 1212. } 1213. } 1214. > BN_free(a); 1215. BN_free(b); 1216. BN_free(d); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L1214
d2a_code_trace_data_41421
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/pem/pvkfmt.c:284: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`. Showing all 25 steps of the trace crypto/pem/pvkfmt.c:284:14: Call 282. goto memerr; 283. 284. if (!BN_mod_exp(pub_key, gbn, priv_key, pbn, ctx)) ^ 285. goto memerr; 286. crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth` 87. } 88. 89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 90. BN_CTX *ctx) 91. { crypto/bn/bn_exp.c:149:15: Call 147. #ifdef RECP_MUL_MOD 148. { 149. ret = BN_mod_exp_recp(r, a, p, m, ctx); ^ 150. } 151. #else crypto/bn/bn_exp.c:161:1: Parameter `ctx->stack.depth` 159. } 160. 161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 162. const BIGNUM *m, BN_CTX *ctx) 163. { crypto/bn/bn_exp.c:191:5: Call 189. } 190. 191. BN_CTX_start(ctx); ^ 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_exp.c:192:10: Call 190. 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); ^ 193. val[0] = BN_CTX_get(ctx); 194. if (val[0] == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:193:14: Call 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); ^ 194. if (val[0] == NULL) 195. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:210:10: Call 208. } 209. 210. if (!BN_nnmod(val[0], a, m, ctx)) ^ 211. goto err; /* 1 */ 212. if (BN_is_zero(val[0])) { crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_41422
static int expand(OPENSSL_LHASH *lh) { OPENSSL_LH_NODE **n, **n1, **n2, *np; unsigned int p, i, j; unsigned long hash, nni; lh->num_nodes++; lh->num_expands++; p = (int)lh->p++; n1 = &(lh->b[p]); n2 = &(lh->b[p + (int)lh->pmax]); *n2 = NULL; nni = lh->num_alloc_nodes; for (np = *n1; np != NULL;) { hash = np->hash; if ((hash % nni) != p) { *n1 = (*n1)->next; np->next = *n2; *n2 = np; } else n1 = &((*n1)->next); np = *n1; } if ((lh->p) >= lh->pmax) { j = (int)lh->num_alloc_nodes * 2; n = OPENSSL_realloc(lh->b, (int)(sizeof(OPENSSL_LH_NODE *) * j)); if (n == NULL) { lh->error++; lh->p = 0; return 0; } for (i = (int)lh->num_alloc_nodes; i < j; i++) n[i] = NULL; lh->pmax = lh->num_alloc_nodes; lh->num_alloc_nodes = j; lh->num_expand_reallocs++; lh->p = 0; lh->b = n; } return 1; } apps/srp.c:453: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] Size: [1, +oo] by call to `update_index`. Showing all 29 steps of the trace apps/srp.c:431:22: Call 429. if (! 430. (gNid = 431. srp_create_user(user, &(row[DB_srpverifier]), ^ 432. &(row[DB_srpsalt]), 433. gNrow ? gNrow[DB_srpsalt] : gN, apps/srp.c:166:14: Call 164. if (! 165. (gNid = 166. SRP_create_verifier(user, password, &salt, srp_verifier, N, ^ 167. g))) { 168. BIO_printf(bio_err, "Internal error creating SRP verifier\n"); crypto/srp/srp_vfy.c:571:10: Call 569. } 570. 571. if (!SRP_create_verifier_BN(user, pass, &s, &v, N_bn, g_bn)) ^ 572. goto err; 573. crypto/srp/srp_vfy.c:637:9: Call 635. } 636. 637. x = SRP_Calc_x(salttmp, user, pass); ^ 638. 639. *verifier = BN_new(); crypto/srp/srp_lib.c:181:10: Call 179. goto err; 180. 181. if (!EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL) ^ 182. || !EVP_DigestUpdate(ctxt, user, strlen(user)) 183. || !EVP_DigestUpdate(ctxt, ":", 1) crypto/evp/digest.c:88:20: Call 86. } else { 87. /* Ask if an ENGINE is reserved for this job */ 88. impl = ENGINE_get_digest_engine(type->type); ^ 89. } 90. if (impl != NULL) { crypto/engine/tb_digest.c:65:12: Call 63. ENGINE *ENGINE_get_digest_engine(int nid) 64. { 65. return engine_table_select(&digest_table, nid); ^ 66. } 67. crypto/engine/eng_table.c:211:10: Call 209. * operations. But don't worry about a fprintf(stderr). 210. */ 211. if (!int_table_check(table, 0)) ^ 212. goto end; 213. tmplate.nid = nid; crypto/engine/eng_table.c:72:15: Call 70. if (!create) 71. return 0; 72. if ((lh = lh_ENGINE_PILE_new(engine_pile_hash, engine_pile_cmp)) == NULL) ^ 73. return 0; 74. *t = (ENGINE_TABLE *)lh; crypto/engine/eng_int.h:176:1: Call 174. typedef struct st_engine_pile ENGINE_PILE; 175. 176. > DEFINE_LHASH_OF(ENGINE_PILE); 177. 178. #ifdef __cplusplus crypto/lhash/lhash.c:38:5: Assignment 36. ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h); 37. ret->num_nodes = MIN_NODES / 2; 38. ret->num_alloc_nodes = MIN_NODES; ^ 39. ret->pmax = MIN_NODES / 2; 40. ret->up_load = UP_LOAD; apps/srp.c:453:25: Call 451. || (userinfo 452. && ((row[DB_srpinfo] = OPENSSL_strdup(userinfo)) == NULL)) 453. || !update_index(db, row)) { ^ 454. OPENSSL_free(row[DB_srpid]); 455. OPENSSL_free(row[DB_srpgN]); apps/srp.c:89:1: Parameter `(*db->db->index)->num_alloc_nodes` 87. } 88. 89. > static int update_index(CA_DB *db, char **row) 90. { 91. char **irow; apps/srp.c:101:10: Call 99. irow[DB_NUMBER] = NULL; 100. 101. if (!TXT_DB_insert(db->db, irow)) { ^ 102. BIO_printf(bio_err, "failed to update srpvfile\n"); 103. BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error); crypto/txt_db/txt_db.c:229:1: Parameter `(*db->index)->num_alloc_nodes` 227. } 228. 229. > int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *row) 230. { 231. int i; crypto/txt_db/txt_db.c:257:19: Call 255. if ((db->qual[i] != NULL) && (db->qual[i] (row) == 0)) 256. continue; 257. (void)lh_OPENSSL_STRING_insert(db->index[i], row); ^ 258. } 259. } include/openssl/lhash.h:197:1: Parameter `lh->num_alloc_nodes` 195. LHASH_OF(type) 196. 197. > DEFINE_LHASH_OF(OPENSSL_STRING); 198. DEFINE_LHASH_OF(OPENSSL_CSTRING); 199. include/openssl/lhash.h:197:1: Call 195. LHASH_OF(type) 196. 197. > DEFINE_LHASH_OF(OPENSSL_STRING); 198. DEFINE_LHASH_OF(OPENSSL_CSTRING); 199. crypto/lhash/lhash.c:70:1: Parameter `lh->num_alloc_nodes` 68. } 69. 70. > void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data) 71. { 72. unsigned long hash; crypto/lhash/lhash.c:77:77: Call 75. 76. lh->error = 0; 77. if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh)) ^ 78. return NULL; /* 'lh->error++' already done in 'expand' */ 79. crypto/lhash/lhash.c:187:1: <Offset trace> 185. } 186. 187. > static int expand(OPENSSL_LHASH *lh) 188. { 189. OPENSSL_LH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:187:1: Parameter `lh->num_alloc_nodes` 185. } 186. 187. > static int expand(OPENSSL_LHASH *lh) 188. { 189. OPENSSL_LH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:213:9: Assignment 211. 212. if ((lh->p) >= lh->pmax) { 213. j = (int)lh->num_alloc_nodes * 2; ^ 214. n = OPENSSL_realloc(lh->b, (int)(sizeof(OPENSSL_LH_NODE *) * j)); 215. if (n == NULL) { crypto/lhash/lhash.c:187:1: <Length trace> 185. } 186. 187. > static int expand(OPENSSL_LHASH *lh) 188. { 189. OPENSSL_LH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:187:1: Parameter `*lh->b` 185. } 186. 187. > static int expand(OPENSSL_LHASH *lh) 188. { 189. OPENSSL_LH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:214:13: Call 212. if ((lh->p) >= lh->pmax) { 213. j = (int)lh->num_alloc_nodes * 2; 214. n = OPENSSL_realloc(lh->b, (int)(sizeof(OPENSSL_LH_NODE *) * j)); ^ 215. if (n == NULL) { 216. /* fputs("realloc error in lhash",stderr); */ crypto/mem.c:117:9: Assignment 115. if (num == 0) { 116. CRYPTO_free(str, file, line); 117. return NULL; ^ 118. } 119. crypto/lhash/lhash.c:214:9: Assignment 212. if ((lh->p) >= lh->pmax) { 213. j = (int)lh->num_alloc_nodes * 2; 214. n = OPENSSL_realloc(lh->b, (int)(sizeof(OPENSSL_LH_NODE *) * j)); ^ 215. if (n == NULL) { 216. /* fputs("realloc error in lhash",stderr); */ crypto/lhash/lhash.c:222:13: Array access: Offset: [16, +oo] Size: [1, +oo] by call to `update_index` 220. } 221. for (i = (int)lh->num_alloc_nodes; i < j; i++) /* 26/02/92 eay */ 222. n[i] = NULL; /* 02/03/92 eay */ ^ 223. lh->pmax = lh->num_alloc_nodes; 224. lh->num_alloc_nodes = j;
https://github.com/openssl/openssl/blob/33e49fda9635f3daabf912a8781abde0de681fe6/crypto/lhash/lhash.c/#L222
d2a_code_trace_data_41423
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/statem_lib.c:219: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 14 steps of the trace ssl/statem/statem_lib.c:129:1: Parameter `pkt->written` 127. } 128. 129. > int tls_construct_cert_verify(SSL *s, WPACKET *pkt) 130. { 131. EVP_PKEY *pkey; ssl/statem/statem_lib.c:219:10: Call 217. #endif 218. 219. if (!WPACKET_sub_memcpy_u16(pkt, sig, siglen)) { ^ 220. SSLerr(SSL_F_TLS_CONSTRUCT_CERT_VERIFY, ERR_R_INTERNAL_ERROR); 221. goto err; ssl/packet.c:348:10: Call 346. size_t lenbytes) 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 349. || !WPACKET_memcpy(pkt, src, len) 350. || !WPACKET_close(pkt)) ssl/packet.c:252:1: Parameter `pkt->buf->length` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/packet.c:349:17: Call 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) 349. || !WPACKET_memcpy(pkt, src, len) ^ 350. || !WPACKET_close(pkt)) 351. return 0; ssl/packet.c:330:1: Parameter `pkt->written` 328. } 329. 330. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 331. { 332. unsigned char *dest; ssl/packet.c:337:10: Call 335. return 1; 336. 337. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 338. return 0; 339. ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 6]):unsigned64 by call to `WPACKET_sub_memcpy__` 47. return 0; 48. 49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 50. size_t newlen; 51. size_t reflen;
https://github.com/openssl/openssl/blob/adb403dea90cd3e2fb028bb16d44364a7b5d75d1/ssl/packet.c/#L49
d2a_code_trace_data_41424
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; } } } apps/s_time.c:447: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `SSL_free`. Showing all 15 steps of the trace apps/s_time.c:411:15: Call 409. #endif 410. 411. if( (scon = doConnection( NULL )) == NULL ) ^ 412. goto end; 413. apps/s_time.c:580:13: Call 578. 579. if (scon == NULL) 580. serverCon=SSL_new(tm_ctx); ^ 581. else 582. { ssl/ssl_lib.c:275:1: Parameter `ctx->sessions->num_nodes` 273. } 274. 275. > SSL *SSL_new(SSL_CTX *ctx) 276. { 277. SSL *s; apps/s_time.c:447:3: Call 445. fflush(stdout); 446. 447. SSL_free( scon ); ^ 448. scon=NULL; 449. } 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, +oo] - 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_41425
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecdsa_ossl.c:423: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse`. Showing all 22 steps of the trace crypto/ec/ecdsa_ossl.c:399:5: Call 397. return -1; 398. } 399. BN_CTX_start(ctx); ^ 400. u1 = BN_CTX_get(ctx); 401. u2 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:235:1: Parameter `ctx->stack.depth` 233. } 234. 235. > void BN_CTX_start(BN_CTX *ctx) 236. { 237. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/ec/ecdsa_ossl.c:423:10: Call 421. } 422. /* calculate tmp1 = inv(S) mod order */ 423. if (!BN_mod_inverse(u2, sig->s, order, ctx)) { ^ 424. ECerr(EC_F_OSSL_ECDSA_VERIFY_SIG, ERR_R_BN_LIB); 425. goto err; crypto/bn/bn_gcd.c:225:1: Parameter `ctx->stack.depth` 223. BN_CTX *ctx); 224. 225. > BIGNUM *BN_mod_inverse(BIGNUM *in, 226. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 227. { crypto/bn/bn_gcd.c:230:10: Call 228. BIGNUM *rv; 229. int noinv; 230. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 231. if (noinv) 232. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:236:1: Parameter `ctx->stack.depth` 234. } 235. 236. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 237. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 238. int *pnoinv) crypto/bn/bn_gcd.c:249:16: Call 247. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 248. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 249. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 250. } 251. crypto/bn/bn_gcd.c:556:1: Parameter `ctx->stack.depth` 554. * not contain branches that may leak sensitive information. 555. */ 556. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 557. const BIGNUM *a, const BIGNUM *n, 558. BN_CTX *ctx) crypto/bn/bn_gcd.c:567:5: Call 565. bn_check_top(n); 566. 567. BN_CTX_start(ctx); ^ 568. A = BN_CTX_get(ctx); 569. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:235:1: Parameter `ctx->stack.depth` 233. } 234. 235. > void BN_CTX_start(BN_CTX *ctx) 236. { 237. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:602:18: Call 600. bn_init(&local_B); 601. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 602. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 603. goto err; 604. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:118:1: Parameter `ctx->stack.depth` 116. #include "bn_lcl.h" 117. 118. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 119. { 120. /* crypto/bn/bn_mod.c:125:11: Call 123. */ 124. 125. if (!(BN_mod(r, m, d, ctx))) ^ 126. return 0; 127. if (!r->neg) crypto/bn/bn_div.c:188:1: Parameter `ctx->stack.depth` 186. * If 'dv' or 'rm' is NULL, the respective value is not returned. 187. */ 188. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 189. BN_CTX *ctx) 190. { crypto/bn/bn_div.c:241:5: Call 239. } 240. 241. BN_CTX_start(ctx); ^ 242. tmp = BN_CTX_get(ctx); 243. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:235:1: Parameter `ctx->stack.depth` 233. } 234. 235. > void BN_CTX_start(BN_CTX *ctx) 236. { 237. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:460:5: Call 458. if (no_branch) 459. bn_correct_top(res); 460. BN_CTX_end(ctx); ^ 461. return (1); 462. err: crypto/bn/bn_ctx.c:249:1: Parameter `ctx->stack.depth` 247. } 248. 249. > void BN_CTX_end(BN_CTX *ctx) 250. { 251. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:255:27: Call 253. ctx->err_stack--; 254. else { 255. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 256. /* Does this stack frame have anything to release? */ 257. if (fp < ctx->used) crypto/bn/bn_ctx.c:325:1: <LHS trace> 323. } 324. 325. > static unsigned int BN_STACK_pop(BN_STACK *st) 326. { 327. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:325:1: Parameter `st->depth` 323. } 324. 325. > static unsigned int BN_STACK_pop(BN_STACK *st) 326. { 327. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:327:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_inverse` 325. static unsigned int BN_STACK_pop(BN_STACK *st) 326. { 327. return st->indexes[--(st->depth)]; ^ 328. } 329.
https://github.com/openssl/openssl/blob/be2e334fce734e726a4085701bc3cbbaabf9d893/crypto/bn/bn_ctx.c/#L327
d2a_code_trace_data_41426
int MAIN(int argc, char **argv) { unsigned char *buf=NULL,*buf2=NULL; int ret=1; #define ALGOR_NUM 14 #define SIZE_NUM 5 #define RSA_NUM 4 #define DSA_NUM 3 long count,rsa_count; int i,j,k,rsa_num,rsa_num2; #ifndef NO_MD2 unsigned char md2[MD2_DIGEST_LENGTH]; #endif #ifndef NO_MDC2 unsigned char mdc2[MDC2_DIGEST_LENGTH]; #endif #ifndef NO_MD5 unsigned char md5[MD5_DIGEST_LENGTH]; unsigned char hmac[MD5_DIGEST_LENGTH]; #endif #ifndef NO_SHA unsigned char sha[SHA_DIGEST_LENGTH]; #endif #ifndef NO_RIPEMD unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; #endif #ifndef NO_RC4 RC4_KEY rc4_ks; #endif #ifndef NO_RC5 RC5_32_KEY rc5_ks; #endif #ifndef NO_RC2 RC2_KEY rc2_ks; #endif #ifndef NO_IDEA IDEA_KEY_SCHEDULE idea_ks; #endif #ifndef NO_BF BF_KEY bf_ks; #endif #ifndef NO_CAST CAST_KEY cast_ks; #endif static unsigned char key16[16]= {0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0, 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; unsigned char iv[8]; #ifndef NO_DES des_cblock *buf_as_des_cblock = NULL; static des_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; static des_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; static des_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; des_key_schedule sch,sch2,sch3; #endif #define D_MD2 0 #define D_MDC2 1 #define D_MD5 2 #define D_HMAC 3 #define D_SHA1 4 #define D_RMD160 5 #define D_RC4 6 #define D_CBC_DES 7 #define D_EDE3_DES 8 #define D_CBC_IDEA 9 #define D_CBC_RC2 10 #define D_CBC_RC5 11 #define D_CBC_BF 12 #define D_CBC_CAST 13 double d,results[ALGOR_NUM][SIZE_NUM]; static int lengths[SIZE_NUM]={8,64,256,1024,8*1024}; long c[ALGOR_NUM][SIZE_NUM]; static char *names[ALGOR_NUM]={ "md2","mdc2","md5","hmac(md5)","sha1","rmd160","rc4", "des cbc","des ede3","idea cbc", "rc2 cbc","rc5-32/12 cbc","blowfish cbc","cast cbc"}; #define R_DSA_512 0 #define R_DSA_1024 1 #define R_DSA_2048 2 #define R_RSA_512 0 #define R_RSA_1024 1 #define R_RSA_2048 2 #define R_RSA_4096 3 #ifndef NO_RSA RSA *rsa_key[RSA_NUM]; long rsa_c[RSA_NUM][2]; double rsa_results[RSA_NUM][2]; static unsigned int rsa_bits[RSA_NUM]={512,1024,2048,4096}; static unsigned char *rsa_data[RSA_NUM]= {test512,test1024,test2048,test4096}; static int rsa_data_length[RSA_NUM]={ sizeof(test512),sizeof(test1024), sizeof(test2048),sizeof(test4096)}; #endif #ifndef NO_DSA DSA *dsa_key[DSA_NUM]; long dsa_c[DSA_NUM][2]; double dsa_results[DSA_NUM][2]; static unsigned int dsa_bits[DSA_NUM]={512,1024,2048}; #endif int rsa_doit[RSA_NUM]; int dsa_doit[DSA_NUM]; int doit[ALGOR_NUM]; int pr_header=0; apps_startup(); memset(results, 0, sizeof(results)); #ifndef NO_DSA memset(dsa_key,0,sizeof(dsa_key)); #endif if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); #ifndef NO_RSA memset(rsa_key,0,sizeof(rsa_key)); for (i=0; i<RSA_NUM; i++) rsa_key[i]=NULL; #endif if ((buf=(unsigned char *)Malloc((int)BUFSIZE)) == NULL) { BIO_printf(bio_err,"out of memory\n"); goto end; } #ifndef NO_DES buf_as_des_cblock = (des_cblock *)buf; #endif if ((buf2=(unsigned char *)Malloc((int)BUFSIZE)) == NULL) { BIO_printf(bio_err,"out of memory\n"); goto end; } memset(c,0,sizeof(c)); memset(iv,0,sizeof(iv)); for (i=0; i<ALGOR_NUM; i++) doit[i]=0; for (i=0; i<RSA_NUM; i++) rsa_doit[i]=0; for (i=0; i<DSA_NUM; i++) dsa_doit[i]=0; j=0; argc--; argv++; while (argc) { #ifndef NO_MD2 if (strcmp(*argv,"md2") == 0) doit[D_MD2]=1; else #endif #ifndef NO_MDC2 if (strcmp(*argv,"mdc2") == 0) doit[D_MDC2]=1; else #endif #ifndef NO_MD5 if (strcmp(*argv,"md5") == 0) doit[D_MD5]=1; else #endif #ifndef NO_MD5 if (strcmp(*argv,"hmac") == 0) doit[D_HMAC]=1; else #endif #ifndef NO_SHA if (strcmp(*argv,"sha1") == 0) doit[D_SHA1]=1; else if (strcmp(*argv,"sha") == 0) doit[D_SHA1]=1; else #endif #ifndef NO_RIPEMD if (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1; else if (strcmp(*argv,"rmd160") == 0) doit[D_RMD160]=1; else if (strcmp(*argv,"ripemd160") == 0) doit[D_RMD160]=1; else #endif #ifndef NO_RC4 if (strcmp(*argv,"rc4") == 0) doit[D_RC4]=1; else #endif #ifndef NO_DES if (strcmp(*argv,"des-cbc") == 0) doit[D_CBC_DES]=1; else if (strcmp(*argv,"des-ede3") == 0) doit[D_EDE3_DES]=1; else #endif #ifndef NO_RSA #ifdef RSAref if (strcmp(*argv,"rsaref") == 0) { RSA_set_default_method(RSA_PKCS1_RSAref()); j--; } else #endif #ifndef RSA_NULL if (strcmp(*argv,"openssl") == 0) { RSA_set_default_method(RSA_PKCS1_SSLeay()); j--; } else #endif #endif if (strcmp(*argv,"dsa512") == 0) dsa_doit[R_DSA_512]=2; else if (strcmp(*argv,"dsa1024") == 0) dsa_doit[R_DSA_1024]=2; else if (strcmp(*argv,"dsa2048") == 0) dsa_doit[R_DSA_2048]=2; else if (strcmp(*argv,"rsa512") == 0) rsa_doit[R_RSA_512]=2; else if (strcmp(*argv,"rsa1024") == 0) rsa_doit[R_RSA_1024]=2; else if (strcmp(*argv,"rsa2048") == 0) rsa_doit[R_RSA_2048]=2; else if (strcmp(*argv,"rsa4096") == 0) rsa_doit[R_RSA_4096]=2; else #ifndef NO_RC2 if (strcmp(*argv,"rc2-cbc") == 0) doit[D_CBC_RC2]=1; else if (strcmp(*argv,"rc2") == 0) doit[D_CBC_RC2]=1; else #endif #ifndef NO_RC5 if (strcmp(*argv,"rc5-cbc") == 0) doit[D_CBC_RC5]=1; else if (strcmp(*argv,"rc5") == 0) doit[D_CBC_RC5]=1; else #endif #ifndef NO_IDEA if (strcmp(*argv,"idea-cbc") == 0) doit[D_CBC_IDEA]=1; else if (strcmp(*argv,"idea") == 0) doit[D_CBC_IDEA]=1; else #endif #ifndef NO_BF if (strcmp(*argv,"bf-cbc") == 0) doit[D_CBC_BF]=1; else if (strcmp(*argv,"blowfish") == 0) doit[D_CBC_BF]=1; else if (strcmp(*argv,"bf") == 0) doit[D_CBC_BF]=1; else #endif #ifndef NO_CAST if (strcmp(*argv,"cast-cbc") == 0) doit[D_CBC_CAST]=1; else if (strcmp(*argv,"cast") == 0) doit[D_CBC_CAST]=1; else if (strcmp(*argv,"cast5") == 0) doit[D_CBC_CAST]=1; else #endif #ifndef NO_DES if (strcmp(*argv,"des") == 0) { doit[D_CBC_DES]=1; doit[D_EDE3_DES]=1; } else #endif #ifndef NO_RSA if (strcmp(*argv,"rsa") == 0) { rsa_doit[R_RSA_512]=1; rsa_doit[R_RSA_1024]=1; rsa_doit[R_RSA_2048]=1; rsa_doit[R_RSA_4096]=1; } else #endif #ifndef NO_DSA if (strcmp(*argv,"dsa") == 0) { dsa_doit[R_DSA_512]=1; dsa_doit[R_DSA_1024]=1; } else #endif { BIO_printf(bio_err,"bad value, pick one of\n"); BIO_printf(bio_err,"md2 mdc2 md5 hmac sha1 rmd160\n"); #ifndef NO_IDEA BIO_printf(bio_err,"idea-cbc "); #endif #ifndef NO_RC2 BIO_printf(bio_err,"rc2-cbc "); #endif #ifndef NO_RC5 BIO_printf(bio_err,"rc5-cbc "); #endif #ifndef NO_BF BIO_printf(bio_err,"bf-cbc"); #endif #if !defined(NO_IDEA) && !defined(NO_RC2) && !defined(NO_BF) && !defined(NO_RC5) BIO_printf(bio_err,"\n"); #endif BIO_printf(bio_err,"des-cbc des-ede3 "); #ifndef NO_RC4 BIO_printf(bio_err,"rc4"); #endif #ifndef NO_RSA BIO_printf(bio_err,"\nrsa512 rsa1024 rsa2048 rsa4096\n"); #endif #ifndef NO_DSA BIO_printf(bio_err,"\ndsa512 dsa1024 dsa2048\n"); #endif BIO_printf(bio_err,"idea rc2 des rsa blowfish\n"); goto end; } argc--; argv++; j++; } if (j == 0) { for (i=0; i<ALGOR_NUM; i++) doit[i]=1; for (i=0; i<RSA_NUM; i++) rsa_doit[i]=1; for (i=0; i<DSA_NUM; i++) dsa_doit[i]=1; } for (i=0; i<ALGOR_NUM; i++) if (doit[i]) pr_header++; #ifndef TIMES BIO_printf(bio_err,"To get the most accurate results, try to run this\n"); BIO_printf(bio_err,"program when this computer is idle.\n"); #endif #ifndef NO_RSA for (i=0; i<RSA_NUM; i++) { unsigned char *p; p=rsa_data[i]; rsa_key[i]=d2i_RSAPrivateKey(NULL,&p,rsa_data_length[i]); if (rsa_key[i] == NULL) { BIO_printf(bio_err,"internal error loading RSA key number %d\n",i); goto end; } #if 0 else { BIO_printf(bio_err,"Loaded RSA key, %d bit modulus and e= 0x",BN_num_bits(rsa_key[i]->n)); BN_print(bio_err,rsa_key[i]->e); BIO_printf(bio_err,"\n"); } #endif } #endif #ifndef NO_DSA dsa_key[0]=get_dsa512(); dsa_key[1]=get_dsa1024(); dsa_key[2]=get_dsa2048(); #endif #ifndef NO_DES des_set_key(&key,sch); des_set_key(&key2,sch2); des_set_key(&key3,sch3); #endif #ifndef NO_IDEA idea_set_encrypt_key(key16,&idea_ks); #endif #ifndef NO_RC4 RC4_set_key(&rc4_ks,16,key16); #endif #ifndef NO_RC2 RC2_set_key(&rc2_ks,16,key16,128); #endif #ifndef NO_RC5 RC5_32_set_key(&rc5_ks,16,key16,12); #endif #ifndef NO_BF BF_set_key(&bf_ks,16,key16); #endif #ifndef NO_CAST CAST_set_key(&cast_ks,16,key16); #endif #ifndef NO_RSA memset(rsa_c,0,sizeof(rsa_c)); #endif #ifndef SIGALRM BIO_printf(bio_err,"First we calculate the approximate speed ...\n"); count=10; do { long i; count*=2; Time_F(START); for (i=count; i; i--) des_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock, &(sch[0]),DES_ENCRYPT); d=Time_F(STOP); } while (d <3); c[D_MD2][0]=count/10; c[D_MDC2][0]=count/10; c[D_MD5][0]=count; c[D_HMAC][0]=count; c[D_SHA1][0]=count; c[D_RMD160][0]=count; c[D_RC4][0]=count*5; c[D_CBC_DES][0]=count; c[D_EDE3_DES][0]=count/3; c[D_CBC_IDEA][0]=count; c[D_CBC_RC2][0]=count; c[D_CBC_RC5][0]=count; c[D_CBC_BF][0]=count; c[D_CBC_CAST][0]=count; for (i=1; i<SIZE_NUM; i++) { c[D_MD2][i]=c[D_MD2][0]*4*lengths[0]/lengths[i]; c[D_MDC2][i]=c[D_MDC2][0]*4*lengths[0]/lengths[i]; c[D_MD5][i]=c[D_MD5][0]*4*lengths[0]/lengths[i]; c[D_HMAC][i]=c[D_HMAC][0]*4*lengths[0]/lengths[i]; c[D_SHA1][i]=c[D_SHA1][0]*4*lengths[0]/lengths[i]; c[D_RMD160][i]=c[D_RMD160][0]*4*lengths[0]/lengths[i]; } for (i=1; i<SIZE_NUM; i++) { long l0,l1; l0=(long)lengths[i-1]; l1=(long)lengths[i]; c[D_RC4][i]=c[D_RC4][i-1]*l0/l1; c[D_CBC_DES][i]=c[D_CBC_DES][i-1]*l0/l1; c[D_EDE3_DES][i]=c[D_EDE3_DES][i-1]*l0/l1; c[D_CBC_IDEA][i]=c[D_CBC_IDEA][i-1]*l0/l1; c[D_CBC_RC2][i]=c[D_CBC_RC2][i-1]*l0/l1; c[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1; c[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1; c[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1; } #ifndef NO_RSA rsa_c[R_RSA_512][0]=count/2000; rsa_c[R_RSA_512][1]=count/400; for (i=1; i<RSA_NUM; i++) { rsa_c[i][0]=rsa_c[i-1][0]/8; rsa_c[i][1]=rsa_c[i-1][1]/4; if ((rsa_doit[i] <= 1) && (rsa_c[i][0] == 0)) rsa_doit[i]=0; else { if (rsa_c[i][0] == 0) { rsa_c[i][0]=1; rsa_c[i][1]=20; } } } #endif dsa_c[R_DSA_512][0]=count/1000; dsa_c[R_DSA_512][1]=count/1000/2; for (i=1; i<DSA_NUM; i++) { dsa_c[i][0]=dsa_c[i-1][0]/4; dsa_c[i][1]=dsa_c[i-1][1]/4; if ((dsa_doit[i] <= 1) && (dsa_c[i][0] == 0)) dsa_doit[i]=0; else { if (dsa_c[i] == 0) { dsa_c[i][0]=1; dsa_c[i][1]=1; } } } #define COND(d) (count < (d)) #define COUNT(d) (d) #else #define COND(c) (run) #define COUNT(d) (count) signal(SIGALRM,sig_done); #endif #ifndef NO_MD2 if (doit[D_MD2]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_MD2],c[D_MD2][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_MD2][j]); count++) MD2(buf,(unsigned long)lengths[j],&(md2[0])); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_MD2],d); results[D_MD2][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_MDC2 if (doit[D_MDC2]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_MDC2],c[D_MDC2][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_MDC2][j]); count++) MDC2(buf,(unsigned long)lengths[j],&(mdc2[0])); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_MDC2],d); results[D_MDC2][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_MD5 if (doit[D_MD5]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_MD5],c[D_MD5][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_MD5][j]); count++) MD5(&(buf[0]),(unsigned long)lengths[j],&(md5[0])); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_MD5],d); results[D_MD5][j]=((double)count)/d*lengths[j]; } } #endif #if !defined(NO_MD5) && !defined(NO_HMAC) if (doit[D_HMAC]) { HMAC_CTX hctx; HMAC_Init(&hctx,(unsigned char *)"This is a key...", 16,EVP_md5()); for (j=0; j<SIZE_NUM; j++) { print_message(names[D_HMAC],c[D_HMAC][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_HMAC][j]); count++) { HMAC_Init(&hctx,NULL,0,NULL); HMAC_Update(&hctx,buf,lengths[j]); HMAC_Final(&hctx,&(hmac[0]),NULL); } d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_HMAC],d); results[D_HMAC][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_SHA if (doit[D_SHA1]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_SHA1],c[D_SHA1][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_SHA1][j]); count++) SHA1(buf,(unsigned long)lengths[j],&(sha[0])); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_SHA1],d); results[D_SHA1][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_RIPEMD if (doit[D_RMD160]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_RMD160],c[D_RMD160][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_RMD160][j]); count++) RIPEMD160(buf,(unsigned long)lengths[j],&(rmd160[0])); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_RMD160],d); results[D_RMD160][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_RC4 if (doit[D_RC4]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_RC4],c[D_RC4][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_RC4][j]); count++) RC4(&rc4_ks,(unsigned int)lengths[j], buf,buf); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_RC4],d); results[D_RC4][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_DES if (doit[D_CBC_DES]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_DES],c[D_CBC_DES][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_DES][j]); count++) des_ncbc_encrypt(buf,buf,lengths[j],sch, &iv,DES_ENCRYPT); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_CBC_DES],d); results[D_CBC_DES][j]=((double)count)/d*lengths[j]; } } if (doit[D_EDE3_DES]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_EDE3_DES],c[D_EDE3_DES][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_EDE3_DES][j]); count++) des_ede3_cbc_encrypt(buf,buf,lengths[j], sch,sch2,sch3, &iv,DES_ENCRYPT); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_EDE3_DES],d); results[D_EDE3_DES][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_IDEA if (doit[D_CBC_IDEA]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_IDEA],c[D_CBC_IDEA][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_IDEA][j]); count++) idea_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&idea_ks, iv,IDEA_ENCRYPT); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_CBC_IDEA],d); results[D_CBC_IDEA][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_RC2 if (doit[D_CBC_RC2]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_RC2],c[D_CBC_RC2][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_RC2][j]); count++) RC2_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&rc2_ks, iv,RC2_ENCRYPT); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_CBC_RC2],d); results[D_CBC_RC2][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_RC5 if (doit[D_CBC_RC5]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_RC5],c[D_CBC_RC5][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_RC5][j]); count++) RC5_32_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&rc5_ks, iv,RC5_ENCRYPT); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_CBC_RC5],d); results[D_CBC_RC5][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_BF if (doit[D_CBC_BF]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_BF],c[D_CBC_BF][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_BF][j]); count++) BF_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&bf_ks, iv,BF_ENCRYPT); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_CBC_BF],d); results[D_CBC_BF][j]=((double)count)/d*lengths[j]; } } #endif #ifndef NO_CAST if (doit[D_CBC_CAST]) { for (j=0; j<SIZE_NUM; j++) { print_message(names[D_CBC_CAST],c[D_CBC_CAST][j],lengths[j]); Time_F(START); for (count=0,run=1; COND(c[D_CBC_CAST][j]); count++) CAST_cbc_encrypt(buf,buf, (unsigned long)lengths[j],&cast_ks, iv,CAST_ENCRYPT); d=Time_F(STOP); BIO_printf(bio_err,"%ld %s's in %.2fs\n", count,names[D_CBC_CAST],d); results[D_CBC_CAST][j]=((double)count)/d*lengths[j]; } } #endif RAND_bytes(buf,36); #ifndef NO_RSA for (j=0; j<RSA_NUM; j++) { int ret; if (!rsa_doit[j]) continue; ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]); pkey_print_message("private","rsa",rsa_c[j][0],rsa_bits[j], RSA_SECONDS); Time_F(START); for (count=0,run=1; COND(rsa_c[j][0]); count++) { ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]); if (ret <= 0) { BIO_printf(bio_err,"RSA private encrypt failure\n"); ERR_print_errors(bio_err); count=1; break; } } d=Time_F(STOP); BIO_printf(bio_err,"%ld %d bit private RSA's in %.2fs\n", count,rsa_bits[j],d); rsa_results[j][0]=d/(double)count; rsa_count=count; #if 1 ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]); pkey_print_message("public","rsa",rsa_c[j][1],rsa_bits[j], RSA_SECONDS); Time_F(START); for (count=0,run=1; COND(rsa_c[j][1]); count++) { ret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]); if (ret <= 0) { BIO_printf(bio_err,"RSA verify failure\n"); ERR_print_errors(bio_err); count=1; break; } } d=Time_F(STOP); BIO_printf(bio_err,"%ld %d bit public RSA's in %.2fs\n", count,rsa_bits[j],d); rsa_results[j][1]=d/(double)count; #endif if (rsa_count <= 1) { for (j++; j<RSA_NUM; j++) rsa_doit[j]=0; } } #endif RAND_bytes(buf,20); #ifndef NO_DSA for (j=0; j<DSA_NUM; j++) { unsigned int kk; if (!dsa_doit[j]) continue; DSA_generate_key(dsa_key[j]); rsa_num=DSA_sign(EVP_PKEY_DSA,buf,20,buf2, &kk,dsa_key[j]); pkey_print_message("sign","dsa",dsa_c[j][0],dsa_bits[j], DSA_SECONDS); Time_F(START); for (count=0,run=1; COND(dsa_c[j][0]); count++) { rsa_num=DSA_sign(EVP_PKEY_DSA,buf,20,buf2, &kk,dsa_key[j]); if (rsa_num <= 0) { BIO_printf(bio_err,"DSA sign failure\n"); ERR_print_errors(bio_err); count=1; break; } } d=Time_F(STOP); BIO_printf(bio_err,"%ld %d bit DSA signs in %.2fs\n", count,dsa_bits[j],d); dsa_results[j][0]=d/(double)count; rsa_count=count; rsa_num2=DSA_verify(EVP_PKEY_DSA,buf,20,buf2, kk,dsa_key[j]); pkey_print_message("verify","dsa",dsa_c[j][1],dsa_bits[j], DSA_SECONDS); Time_F(START); for (count=0,run=1; COND(dsa_c[j][1]); count++) { rsa_num2=DSA_verify(EVP_PKEY_DSA,buf,20,buf2, kk,dsa_key[j]); if (rsa_num2 <= 0) { BIO_printf(bio_err,"DSA verify failure\n"); ERR_print_errors(bio_err); count=1; break; } } d=Time_F(STOP); BIO_printf(bio_err,"%ld %d bit DSA verify in %.2fs\n", count,dsa_bits[j],d); dsa_results[j][1]=d/(double)count; if (rsa_count <= 1) { for (j++; j<DSA_NUM; j++) dsa_doit[j]=0; } } #endif fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_VERSION)); fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_BUILT_ON)); printf("options:"); printf("%s ",BN_options()); #ifndef NO_MD2 printf("%s ",MD2_options()); #endif #ifndef NO_RC4 printf("%s ",RC4_options()); #endif #ifndef NO_DES printf("%s ",des_options()); #endif #ifndef NO_IDEA printf("%s ",idea_options()); #endif #ifndef NO_BF printf("%s ",BF_options()); #endif fprintf(stdout,"\n%s\n",SSLeay_version(SSLEAY_CFLAGS)); if (pr_header) { fprintf(stdout,"The 'numbers' are in 1000s of bytes per second processed.\n"); fprintf(stdout,"type "); for (j=0; j<SIZE_NUM; j++) fprintf(stdout,"%7d bytes",lengths[j]); fprintf(stdout,"\n"); } for (k=0; k<ALGOR_NUM; k++) { if (!doit[k]) continue; fprintf(stdout,"%-13s",names[k]); for (j=0; j<SIZE_NUM; j++) { if (results[k][j] > 10000) fprintf(stdout," %11.2fk",results[k][j]/1e3); else fprintf(stdout," %11.2f ",results[k][j]); } fprintf(stdout,"\n"); } #ifndef NO_RSA j=1; for (k=0; k<RSA_NUM; k++) { if (!rsa_doit[k]) continue; if (j) { printf("%18ssign verify sign/s verify/s\n"," "); j=0; } fprintf(stdout,"rsa %4u bits %8.4fs %8.4fs %8.1f %8.1f", rsa_bits[k],rsa_results[k][0],rsa_results[k][1], 1.0/rsa_results[k][0],1.0/rsa_results[k][1]); fprintf(stdout,"\n"); } #endif #ifndef NO_DSA j=1; for (k=0; k<DSA_NUM; k++) { if (!dsa_doit[k]) continue; if (j) { printf("%18ssign verify sign/s verify/s\n"," "); j=0; } fprintf(stdout,"dsa %4u bits %8.4fs %8.4fs %8.1f %8.1f", dsa_bits[k],dsa_results[k][0],dsa_results[k][1], 1.0/dsa_results[k][0],1.0/dsa_results[k][1]); fprintf(stdout,"\n"); } #endif ret=0; end: if (buf != NULL) Free(buf); if (buf2 != NULL) Free(buf2); #ifndef NO_RSA for (i=0; i<RSA_NUM; i++) if (rsa_key[i] != NULL) RSA_free(rsa_key[i]); #endif #ifndef NO_DSA for (i=0; i<DSA_NUM; i++) if (dsa_key[i] != NULL) DSA_free(dsa_key[i]); #endif EXIT(ret); } apps/speed.c:967: error: UNINITIALIZED_VALUE The value read from rsa_doit[_] was never initialized. Showing all 1 steps of the trace apps/speed.c:967:8: 965. { 966. int ret; 967. > if (!rsa_doit[j]) continue; 968. ret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]); 969. pkey_print_message("private","rsa",rsa_c[j][0],rsa_bits[j],
https://github.com/openssl/openssl/blob/c91e1259347388b57264bec5b4a9fd91237adc26/apps/speed.c/#L967
d2a_code_trace_data_41427
IMPLEMENT_new_ctx(cfb1, CFB, 256) providers/common/ciphers/aes.c:309: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 309 could be null and is dereferenced at line 309, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:309:1: start of procedure aes_256_cfb1_newctx() 307. IMPLEMENT_new_ctx(cfb, CFB, 192) 308. IMPLEMENT_new_ctx(cfb, CFB, 128) 309. > IMPLEMENT_new_ctx(cfb1, CFB, 256) 310. IMPLEMENT_new_ctx(cfb1, CFB, 192) 311. IMPLEMENT_new_ctx(cfb1, CFB, 128) crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE) crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking false branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) providers/common/ciphers/aes.c:309:1: 307. IMPLEMENT_new_ctx(cfb, CFB, 192) 308. IMPLEMENT_new_ctx(cfb, CFB, 128) 309. > IMPLEMENT_new_ctx(cfb1, CFB, 256) 310. IMPLEMENT_new_ctx(cfb1, CFB, 192) 311. IMPLEMENT_new_ctx(cfb1, CFB, 128)
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L309
d2a_code_trace_data_41428
static int ui_read(UI *ui, UI_STRING *uis) { switch (UI_get_string_type(uis)) { case UIT_PROMPT: { char result[PEM_BUFSIZE]; const struct pem_password_cb_data *data = UI_method_get_ex_data(UI_get_method(ui), ui_method_data_index()); int maxsize = UI_get_result_maxsize(uis); int len = data->cb(result, maxsize > PEM_BUFSIZE ? PEM_BUFSIZE : maxsize, data->rwflag, UI_get0_user_data(ui)); if (len <= 0) return len; if (UI_set_result(ui, uis, result) >= 0) return 1; return 0; } case UIT_VERIFY: case UIT_NONE: case UIT_BOOLEAN: case UIT_INFO: case UIT_ERROR: break; } return 1; } crypto/ui/ui_util.c:114: error: NULL_DEREFERENCE pointer `data` last assigned on line 110 could be null and is dereferenced at line 114, column 23. Showing all 31 steps of the trace crypto/ui/ui_util.c:104:1: start of procedure ui_read() 102. return 1; 103. } 104. > static int ui_read(UI *ui, UI_STRING *uis) 105. { 106. switch (UI_get_string_type(uis)) { crypto/ui/ui_util.c:106:5: 104. static int ui_read(UI *ui, UI_STRING *uis) 105. { 106. > switch (UI_get_string_type(uis)) { 107. case UIT_PROMPT: 108. { crypto/ui/ui_lib.c:709:1: start of procedure UI_get_string_type() 707. } 708. 709. > enum UI_string_types UI_get_string_type(UI_STRING *uis) 710. { 711. return uis->type; crypto/ui/ui_lib.c:711:5: 709. enum UI_string_types UI_get_string_type(UI_STRING *uis) 710. { 711. > return uis->type; 712. } 713. crypto/ui/ui_lib.c:712:1: return from a call to UI_get_string_type 710. { 711. return uis->type; 712. > } 713. 714. int UI_get_input_flags(UI_STRING *uis) crypto/ui/ui_util.c:107:5: Switch condition is true. Entering switch case 105. { 106. switch (UI_get_string_type(uis)) { 107. case UIT_PROMPT: ^ 108. { 109. char result[PEM_BUFSIZE]; crypto/ui/ui_util.c:110:13: 108. { 109. char result[PEM_BUFSIZE]; 110. > const struct pem_password_cb_data *data = 111. UI_method_get_ex_data(UI_get_method(ui), 112. ui_method_data_index()); crypto/ui/ui_lib.c:551:1: start of procedure UI_get_method() 549. } 550. 551. > const UI_METHOD *UI_get_method(UI *ui) 552. { 553. return ui->meth; crypto/ui/ui_lib.c:553:5: 551. const UI_METHOD *UI_get_method(UI *ui) 552. { 553. > return ui->meth; 554. } 555. crypto/ui/ui_lib.c:554:1: return from a call to UI_get_method 552. { 553. return ui->meth; 554. > } 555. 556. const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth) crypto/ui/ui_util.c:86:1: start of procedure ui_method_data_index() 84. } 85. 86. > static int ui_method_data_index() 87. { 88. static int idx = -1; crypto/ui/ui_util.c:88:5: 86. static int ui_method_data_index() 87. { 88. > static int idx = -1; 89. 90. if (idx == -1) crypto/ui/ui_util.c:90:9: Taking true branch 88. static int idx = -1; 89. 90. if (idx == -1) ^ 91. idx = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI_METHOD, 92. 0, NULL, crypto/ui/ui_util.c:91:9: Skipping CRYPTO_get_ex_new_index(): empty list of specs 89. 90. if (idx == -1) 91. idx = CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI_METHOD, ^ 92. 0, NULL, 93. ui_new_method_data, crypto/ui/ui_util.c:97:5: 95. ui_free_method_data); 96. 97. > return idx; 98. } 99. crypto/ui/ui_util.c:98:1: return from a call to ui_method_data_index 96. 97. return idx; 98. > } 99. 100. static int ui_open(UI *ui) crypto/ui/ui_lib.c:704:1: start of procedure UI_method_get_ex_data() 702. } 703. 704. > const void *UI_method_get_ex_data(const UI_METHOD *method, int idx) 705. { 706. return CRYPTO_get_ex_data(&method->ex_data, idx); crypto/ui/ui_lib.c:706:5: 704. const void *UI_method_get_ex_data(const UI_METHOD *method, int idx) 705. { 706. > return CRYPTO_get_ex_data(&method->ex_data, idx); 707. } 708. crypto/ex_data.c:375:1: start of procedure CRYPTO_get_ex_data() 373. * particular index in the class used by this variable 374. */ 375. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 376. { 377. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:377:9: Taking true branch 375. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 376. { 377. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 378. return NULL; 379. return sk_void_value(ad->sk, idx); crypto/ex_data.c:378:9: 376. { 377. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 378. > return NULL; 379. return sk_void_value(ad->sk, idx); 380. } crypto/ex_data.c:380:1: return from a call to CRYPTO_get_ex_data 378. return NULL; 379. return sk_void_value(ad->sk, idx); 380. > } crypto/ui/ui_lib.c:707:1: return from a call to UI_method_get_ex_data 705. { 706. return CRYPTO_get_ex_data(&method->ex_data, idx); 707. > } 708. 709. enum UI_string_types UI_get_string_type(UI_STRING *uis) crypto/ui/ui_util.c:113:13: 111. UI_method_get_ex_data(UI_get_method(ui), 112. ui_method_data_index()); 113. > int maxsize = UI_get_result_maxsize(uis); 114. int len = data->cb(result, 115. maxsize > PEM_BUFSIZE ? PEM_BUFSIZE : maxsize, crypto/ui/ui_lib.c:784:1: start of procedure UI_get_result_maxsize() 782. } 783. 784. > int UI_get_result_maxsize(UI_STRING *uis) 785. { 786. switch (uis->type) { crypto/ui/ui_lib.c:786:5: 784. int UI_get_result_maxsize(UI_STRING *uis) 785. { 786. > switch (uis->type) { 787. case UIT_PROMPT: 788. case UIT_VERIFY: crypto/ui/ui_lib.c:787:5: Switch condition is true. Entering switch case 785. { 786. switch (uis->type) { 787. case UIT_PROMPT: ^ 788. case UIT_VERIFY: 789. return uis->_.string_data.result_maxsize; crypto/ui/ui_lib.c:789:9: 787. case UIT_PROMPT: 788. case UIT_VERIFY: 789. > return uis->_.string_data.result_maxsize; 790. case UIT_NONE: 791. case UIT_INFO: crypto/ui/ui_lib.c:797:1: return from a call to UI_get_result_maxsize 795. } 796. return -1; 797. > } 798. 799. int UI_set_result(UI *ui, UI_STRING *uis, const char *result) crypto/ui/ui_util.c:115:32: Condition is false 113. int maxsize = UI_get_result_maxsize(uis); 114. int len = data->cb(result, 115. maxsize > PEM_BUFSIZE ? PEM_BUFSIZE : maxsize, ^ 116. data->rwflag, UI_get0_user_data(ui)); 117. crypto/ui/ui_util.c:114:13: 112. ui_method_data_index()); 113. int maxsize = UI_get_result_maxsize(uis); 114. > int len = data->cb(result, 115. maxsize > PEM_BUFSIZE ? PEM_BUFSIZE : maxsize, 116. data->rwflag, UI_get0_user_data(ui));
https://github.com/openssl/openssl/blob/e3bc1305ec97d4ad4ab05fa59a288e92df2b2025/crypto/ui/ui_util.c/#L114
d2a_code_trace_data_41429
static dav_error * dav_validate_resource_state(apr_pool_t *p, const dav_resource *resource, dav_lockdb *lockdb, const dav_if_header *if_header, int flags, dav_buffer *pbuf, request_rec *r) { dav_error *err; const char *uri; const char *etag; const dav_hooks_locks *locks_hooks = (lockdb ? lockdb->hooks : NULL); const dav_if_header *ifhdr_scan; dav_if_state_list *state_list; dav_lock *lock_list; dav_lock *lock; int num_matched; int num_that_apply; int seen_locktoken; apr_size_t uri_len; const char *reason = NULL; if (lockdb == NULL) { lock_list = NULL; } else { if ((err = dav_lock_query(lockdb, resource, &lock_list)) != NULL) { return dav_push_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, "The locks could not be queried for " "verification against a possible \"If:\" " "header.", err); } } if (flags & DAV_LOCKSCOPE_EXCLUSIVE) { if (lock_list != NULL) { return dav_new_error(p, HTTP_LOCKED, 0, 0, "Existing lock(s) on the requested resource " "prevent an exclusive lock."); } seen_locktoken = 1; } else if (flags & DAV_LOCKSCOPE_SHARED) { for (lock = lock_list; lock != NULL; lock = lock->next) { if (lock->scope == DAV_LOCKSCOPE_EXCLUSIVE) { return dav_new_error(p, HTTP_LOCKED, 0, 0, "The requested resource is already " "locked exclusively."); } } seen_locktoken = 1; } else { seen_locktoken = (lock_list == NULL); } if (if_header == NULL) { if (seen_locktoken) return NULL; return dav_new_error(p, HTTP_LOCKED, 0, 0, "This resource is locked and an \"If:\" header " "was not supplied to allow access to the " "resource."); } if (lock_list == NULL && if_header->dummy_header) { if (flags & DAV_VALIDATE_IS_PARENT) return NULL; return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0, "The locktoken specified in the \"Lock-Token:\" " "header is invalid because this resource has no " "outstanding locks."); } uri = resource->uri; uri_len = strlen(uri); if (uri[uri_len - 1] == '/') { dav_set_bufsize(p, pbuf, uri_len); memcpy(pbuf->buf, uri, uri_len); pbuf->buf[--uri_len] = '\0'; uri = pbuf->buf; } etag = (*resource->hooks->getetag)(resource); num_that_apply = 0; for (ifhdr_scan = if_header; ifhdr_scan != NULL; ifhdr_scan = ifhdr_scan->next) { if (ifhdr_scan->uri != NULL && (uri_len != ifhdr_scan->uri_len || memcmp(uri, ifhdr_scan->uri, uri_len) != 0)) { continue; } ++num_that_apply; for (state_list = ifhdr_scan->state; state_list != NULL; state_list = state_list->next) { switch(state_list->type) { case dav_if_etag: { const char *given_etag, *current_etag; int mismatch; if (state_list->etag[0] == 'W' && state_list->etag[1] == '/') { given_etag = state_list->etag + 2; } else { given_etag = state_list->etag; } if (etag[0] == 'W' && etag[1] == '/') { current_etag = etag + 2; } else { current_etag = etag; } mismatch = strcmp(given_etag, current_etag); if (state_list->condition == DAV_IF_COND_NORMAL && mismatch) { reason = "an entity-tag was specified, but the resource's " "actual ETag does not match."; goto state_list_failed; } else if (state_list->condition == DAV_IF_COND_NOT && !mismatch) { reason = "an entity-tag was specified using the \"Not\" form, " "but the resource's actual ETag matches the provided " "entity-tag."; goto state_list_failed; } break; } case dav_if_opaquelock: if (lockdb == NULL) { if (state_list->condition == DAV_IF_COND_NOT) { continue; } reason = "a State-token was supplied, but a lock database " "is not available for to provide the required lock."; goto state_list_failed; } num_matched = 0; for (lock = lock_list; lock != NULL; lock = lock->next) { if ((*locks_hooks->compare_locktoken)(state_list->locktoken, lock->locktoken)) { continue; } seen_locktoken = 1; if (state_list->condition == DAV_IF_COND_NOT) { reason = "a State-token was supplied, which used a " "\"Not\" condition. The State-token was found " "in the locks on this resource"; goto state_list_failed; } if (lock->auth_user && (!r->user || strcmp(lock->auth_user, r->user))) { const char *errmsg; errmsg = apr_pstrcat(p, "User \"", r->user, "\" submitted a locktoken created " "by user \"", lock->auth_user, "\".", NULL); return dav_new_error(p, HTTP_FORBIDDEN, 0, 0, errmsg); } num_matched = 1; break; } if (num_matched == 0 && state_list->condition == DAV_IF_COND_NORMAL) { reason = "a State-token was supplied, but it was not found " "in the locks on this resource."; goto state_list_failed; } break; case dav_if_unknown: if (state_list->condition == DAV_IF_COND_NORMAL) { reason = "an unknown state token was supplied"; goto state_list_failed; } break; } } if (seen_locktoken) { return NULL; } break; state_list_failed: ; } if (ifhdr_scan == NULL) { if (num_that_apply == 0) { if (seen_locktoken) return NULL; if (dav_find_submitted_locktoken(if_header, lock_list, locks_hooks)) { return NULL; } return dav_new_error(p, HTTP_LOCKED, 0 , 0, "This resource is locked and the \"If:\" " "header did not specify one of the " "locktokens for this resource's lock(s)."); } if (if_header->dummy_header) { return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0, "The locktoken specified in the " "\"Lock-Token:\" header did not specify one " "of this resource's locktoken(s)."); } if (reason == NULL) { return dav_new_error(p, HTTP_PRECONDITION_FAILED, 0, 0, "The preconditions specified by the \"If:\" " "header did not match this resource."); } return dav_new_error(p, HTTP_PRECONDITION_FAILED, 0, 0, apr_psprintf(p, "The precondition(s) specified by " "the \"If:\" header did not match " "this resource. At least one " "failure is because: %s", reason)); } if (dav_find_submitted_locktoken(if_header, lock_list, locks_hooks)) { return NULL; } if (if_header->dummy_header) { return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0, "The locktoken specified in the " "\"Lock-Token:\" header did not specify one " "of this resource's locktoken(s)."); } return dav_new_error(p, HTTP_LOCKED, 1 , 0, "This resource is locked and the \"If:\" header " "did not specify one of the " "locktokens for this resource's lock(s)."); } modules/dav/main/mod_dav.c:2527: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `dav_validate_request`. modules/dav/main/mod_dav.c:2496:19: Call 2494. /* handle the request body */ 2495. /* ### this may move lower once we start processing bodies */ 2496. if ((result = process_mkcol_body(r)) != OK) { ^ 2497. return result; 2498. } modules/dav/main/mod_dav.c:2434:24: Unknown value from: apr_table_get 2432. 2433. const char *tenc = apr_table_get(r->headers_in, "Transfer-Encoding"); 2434. const char *lenp = apr_table_get(r->headers_in, "Content-Length"); ^ 2435. 2436. /* make sure to set the Apache request fields properly. */ modules/dav/main/mod_dav.c:2514:22: Call 2512. } 2513. 2514. resource_state = dav_get_resource_state(r, resource); ^ 2515. 2516. /* modules/dav/main/util_lock.c:676:1: Parameter `resource->exists` 674. ** Returns DAV_RESOURCE_ERROR if an error occurs. 675. */ 676. DAV_DECLARE(int) dav_get_resource_state(request_rec *r, ^ 677. const dav_resource *resource) 678. { modules/dav/main/mod_dav.c:2527:16: Call 2525. * a locknull resource, then we check only the resource. 2526. */ 2527. if ((err = dav_validate_request(r, resource, 0, NULL, &multi_status, ^ 2528. resource_state == DAV_RESOURCE_NULL ? 2529. DAV_VALIDATE_PARENT : modules/dav/main/util.c:1455:1: Parameter `resource->uri->strlen` 1453. ** error is necessary, response will point to it, else NULL. 1454. */ 1455. DAV_DECLARE(dav_error *) dav_validate_request(request_rec *r, ^ 1456. dav_resource *resource, 1457. int depth, modules/dav/main/util.c:1586:15: Call 1584. } 1585. else { 1586. err = dav_validate_resource_state(r->pool, resource, lockdb, ^ 1587. if_header, flags, &work_buf, r); 1588. } modules/dav/main/util.c:802:1: <LHS trace> 800. * Returns NULL if path/uri meets if-header and lock requirements 801. */ 802. static dav_error * dav_validate_resource_state(apr_pool_t *p, ^ 803. const dav_resource *resource, 804. dav_lockdb *lockdb, modules/dav/main/util.c:802:1: Parameter `resource->uri->strlen` 800. * Returns NULL if path/uri meets if-header and lock requirements 801. */ 802. static dav_error * dav_validate_resource_state(apr_pool_t *p, ^ 803. const dav_resource *resource, 804. dav_lockdb *lockdb, modules/dav/main/util.c:988:5: Assignment 986. */ 987. uri = resource->uri; 988. uri_len = strlen(uri); ^ 989. if (uri[uri_len - 1] == '/') { 990. dav_set_bufsize(p, pbuf, uri_len); modules/dav/main/util.c:989:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `dav_validate_request` 987. uri = resource->uri; 988. uri_len = strlen(uri); 989. if (uri[uri_len - 1] == '/') { ^ 990. dav_set_bufsize(p, pbuf, uri_len); 991. memcpy(pbuf->buf, uri, uri_len);
https://github.com/apache/httpd/blob/8b2ec33ac5d314be345814db08e194ffeda6beb0/modules/dav/main/util.c/#L989
d2a_code_trace_data_41430
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/bn/bn_prime.c:433: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rshift1`. Showing all 14 steps of the trace crypto/bn/bn_prime.c:425:10: Call 423. 424. /* we need ((rnd-rem) % add) == 0 */ 425. if (!BN_mod(t1, q, qadd, ctx)) ^ 426. goto err; 427. if (!BN_sub(q, q, t1)) crypto/bn/bn_div.c:209:1: Parameter `rm->top` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_prime.c:433:14: Call 431. goto err; 432. } else { 433. if (!BN_rshift1(t1, rem)) ^ 434. goto err; 435. if (!BN_add(q, q, t1)) crypto/bn/bn_shift.c:47:1: Parameter `*r->d` 45. } 46. 47. > int BN_rshift1(BIGNUM *r, const BIGNUM *a) 48. { 49. BN_ULONG *ap, *rp, t, c; crypto/bn/bn_shift.c:63:13: Call 61. j = i - (ap[i - 1] == 1); 62. if (a != r) { 63. if (bn_wexpand(r, j) == NULL) ^ 64. return 0; 65. r->neg = a->neg; crypto/bn/bn_lib.c:960:1: Parameter `*a->d` 958. } 959. 960. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 961. { 962. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:962:37: Call 960. BIGNUM *bn_wexpand(BIGNUM *a, int words) 961. { 962. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 963. } 964. crypto/bn/bn_lib.c:245:1: Parameter `*b->d` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `*b->d` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_rshift1` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_41431
static inline int mpc8_dec_base(GetBitContext *gb, int k, int n) { int code = get_bits(gb, mpc8_cnk_len[k-1][n-1] - 1); if (code >= mpc8_cnk_lost[k-1][n-1]) code = ((code << 1) | get_bits1(gb)) - mpc8_cnk_lost[k-1][n-1]; return code; } libavcodec/mpc8.c:230: error: Buffer Overrun L3 Offset: [-1, +oo] Size: 33 by call to `mpc8_get_mask`. libavcodec/mpc8.c:225:13: Assignment 223. int mask; 224. 225. cnt = 0; ^ 226. for(i = 0; i < maxband; i++) 227. if(bands[i].res[0] || bands[i].res[1]) libavcodec/mpc8.c:230:20: Call 228. cnt++; 229. t = mpc8_get_mod_golomb(gb, cnt); 230. mask = mpc8_get_mask(gb, cnt, t); ^ 231. for(i = maxband - 1; i >= 0; i--) 232. if(bands[i].res[0] || bands[i].res[1]){ libavcodec/mpc8.c:84:1: Parameter `t` 82. } 83. 84. static int mpc8_get_mask(GetBitContext *gb, int size, int t) ^ 85. { 86. int mask = 0; libavcodec/mpc8.c:89:17: Call 87. 88. if(t && t != size) 89. mask = mpc8_dec_enum(gb, FFMIN(t, size - t), size); ^ 90. if((t << 1) > size) mask = ~mask; 91. libavcodec/mpc8.c:59:1: Parameter `n` 57. } 58. 59. static inline int mpc8_dec_enum(GetBitContext *gb, int k, int n) ^ 60. { 61. int bits = 0; libavcodec/mpc8.c:63:16: Call 61. int bits = 0; 62. const uint32_t * C = mpc8_cnk[k-1]; 63. int code = mpc8_dec_base(gb, k, n); ^ 64. 65. do { libavcodec/mpc8.c:49:1: <Offset trace> 47. static const int quant_offsets[6] = { MPC8_Q5_OFFSET, MPC8_Q6_OFFSET, MPC8_Q7_OFFSET, MPC8_Q8_OFFSET }; 48. 49. static inline int mpc8_dec_base(GetBitContext *gb, int k, int n) ^ 50. { 51. int code = get_bits(gb, mpc8_cnk_len[k-1][n-1] - 1); libavcodec/mpc8.c:49:1: Parameter `n` 47. static const int quant_offsets[6] = { MPC8_Q5_OFFSET, MPC8_Q6_OFFSET, MPC8_Q7_OFFSET, MPC8_Q8_OFFSET }; 48. 49. static inline int mpc8_dec_base(GetBitContext *gb, int k, int n) ^ 50. { 51. int code = get_bits(gb, mpc8_cnk_len[k-1][n-1] - 1); libavcodec/mpc8data.h:80:1: <Length trace> 78. }; 79. 80. const static uint8_t mpc8_cnk_len[16][33] = ^ 81. { 82. {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6}, libavcodec/mpc8data.h:80:1: Array declaration 78. }; 79. 80. const static uint8_t mpc8_cnk_len[16][33] = ^ 81. { 82. {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6}, libavcodec/mpc8.c:51:29: Array access: Offset: [-1, +oo] Size: 33 by call to `mpc8_get_mask` 49. static inline int mpc8_dec_base(GetBitContext *gb, int k, int n) 50. { 51. int code = get_bits(gb, mpc8_cnk_len[k-1][n-1] - 1); ^ 52. 53. if (code >= mpc8_cnk_lost[k-1][n-1])
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpc8.c/#L51
d2a_code_trace_data_41432
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; } crypto/bn/bn_mont.c:175: error: BUFFER_OVERRUN_S2 Offset: [max(1, `mont->N.top`), +oo] (⇐ [0, +oo] + [max(1, `mont->N.top`), `mont->N.top`]) Size: [0, 8388607] by call to `BN_from_montgomery_word`. Showing all 10 steps of the trace crypto/bn/bn_mont.c:166:1: Parameter `mont->N.top` 164. #endif /* MONT_WORD */ 165. 166. > int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont, 167. BN_CTX *ctx) 168. { crypto/bn/bn_mont.c:175:16: Call 173. BN_CTX_start(ctx); 174. if ((t = BN_CTX_get(ctx)) && BN_copy(t, a)) 175. retn = BN_from_montgomery_word(ret, t, mont); ^ 176. BN_CTX_end(ctx); 177. #else /* !MONT_WORD */ 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:940:1: Parameter `*a->d` 938. } 939. 940. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 941. { 942. 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: [max(1, mont->N.top), +oo] (⇐ [0, +oo] + [max(1, mont->N.top), mont->N.top]) Size: [0, 8388607] by call to `BN_from_montgomery_word` 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/9b02dc97e4963969da69675a871dbe80e6d31cda/crypto/bn/bn_mont.c/#L106
d2a_code_trace_data_41433
void avformat_free_context(AVFormatContext *s) { int i; if (!s) return; av_opt_free(s); if (s->iformat && s->iformat->priv_class && s->priv_data) av_opt_free(s->priv_data); for (i = 0; i < s->nb_streams; i++) free_stream(&s->streams[i]); for (i = s->nb_programs - 1; i >= 0; i--) { av_dict_free(&s->programs[i]->metadata); av_freep(&s->programs[i]->stream_index); av_freep(&s->programs[i]); } av_freep(&s->programs); av_freep(&s->priv_data); while (s->nb_chapters--) { av_dict_free(&s->chapters[s->nb_chapters]->metadata); av_free(s->chapters[s->nb_chapters]); } av_freep(&s->chapters); av_dict_free(&s->metadata); av_freep(&s->streams); av_freep(&s->internal); av_free(s); } libavformat/segment.c:371: error: Integer Overflow L1 ([-oo, 0] - 1):unsigned32 by call to `avformat_free_context`. libavformat/segment.c:351:20: Call 349. 350. if (!seg->write_header_trailer) { 351. if ((ret = segment_end(oc, 0)) < 0) ^ 352. goto fail; 353. if ((ret = open_null_ctx(&oc->pb)) < 0) libavformat/segment.c:167:9: Call 165. av_write_frame(oc, NULL); /* Flush any buffered data (fragmented mp4) */ 166. if (write_trailer) 167. av_write_trailer(oc); ^ 168. ff_format_io_close(oc, &oc->pb); 169. libavformat/mux.c:698:9: Call 696. fail: 697. for (i = 0; i < s->nb_streams; i++) { 698. av_freep(&s->streams[i]->priv_data); ^ 699. av_freep(&s->streams[i]->index_entries); 700. } libavutil/mem.c:207:26: Assignment 205. 206. memcpy(&val, arg, sizeof(val)); 207. memcpy(arg, &(void *){ NULL }, sizeof(val)); ^ 208. av_free(val); 209. } libavformat/segment.c:371:5: Call 369. fail: 370. ff_format_io_close(s, &seg->pb); 371. avformat_free_context(oc); ^ 372. return ret; 373. } libavformat/utils.c:2477:1: <LHS trace> 2475. } 2476. 2477. void avformat_free_context(AVFormatContext *s) ^ 2478. { 2479. int i; libavformat/utils.c:2477:1: Parameter `s->nb_chapters` 2475. } 2476. 2477. void avformat_free_context(AVFormatContext *s) ^ 2478. { 2479. int i; libavformat/utils.c:2498:12: Binary operation: ([-oo, 0] - 1):unsigned32 by call to `avformat_free_context` 2496. av_freep(&s->programs); 2497. av_freep(&s->priv_data); 2498. while (s->nb_chapters--) { ^ 2499. av_dict_free(&s->chapters[s->nb_chapters]->metadata); 2500. av_free(s->chapters[s->nb_chapters]);
https://github.com/libav/libav/blob/611ba89b896a5286b6d8ad9bfdbb8b4f5c11df9c/libavformat/utils.c/#L2498
d2a_code_trace_data_41434
int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX *ctx) { int ret = 0; BIGNUM *b; BN_CTX *new_ctx = NULL; if (ctx == NULL) { ctx = new_ctx = BN_CTX_new(); if (ctx == NULL) { ECerr(EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT, ERR_R_MALLOC_FAILURE); goto err; } } BN_CTX_start(ctx); b = BN_CTX_get(ctx); if (b == NULL) goto err; if (!BN_GF2m_mod_arr(b, group->b, group->poly)) goto err; if (BN_is_zero(b)) goto err; ret = 1; err: if (ctx != NULL) BN_CTX_end(ctx); BN_CTX_free(new_ctx); return ret; } crypto/ec/ec2_smpl.c:269: error: NULL_DEREFERENCE pointer `new_ctx` last assigned on line 239 could be null and is dereferenced by call to `BN_CTX_free()` at line 269, column 5. Showing all 40 steps of the trace crypto/ec/ec2_smpl.c:234:1: start of procedure ec_GF2m_simple_group_check_discriminant() 232. * elliptic curve <=> b != 0 (mod p) 233. */ 234. > int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group, 235. BN_CTX *ctx) 236. { crypto/ec/ec2_smpl.c:237:5: 235. BN_CTX *ctx) 236. { 237. > int ret = 0; 238. BIGNUM *b; 239. BN_CTX *new_ctx = NULL; crypto/ec/ec2_smpl.c:239:5: 237. int ret = 0; 238. BIGNUM *b; 239. > BN_CTX *new_ctx = NULL; 240. 241. if (ctx == NULL) { crypto/ec/ec2_smpl.c:241:9: Taking false branch 239. BN_CTX *new_ctx = NULL; 240. 241. if (ctx == NULL) { ^ 242. ctx = new_ctx = BN_CTX_new(); 243. if (ctx == NULL) { crypto/ec/ec2_smpl.c:249:5: 247. } 248. } 249. > BN_CTX_start(ctx); 250. b = BN_CTX_get(ctx); 251. if (b == NULL) crypto/bn/bn_ctx.c:179:1: start of procedure BN_CTX_start() 177. } 178. 179. > void BN_CTX_start(BN_CTX *ctx) 180. { 181. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_ctx.c:183:9: Taking true branch 181. CTXDBG_ENTRY("BN_CTX_start", ctx); 182. /* If we're already overflowing ... */ 183. if (ctx->err_stack || ctx->too_many) ^ 184. ctx->err_stack++; 185. /* (Try to) get a new frame pointer */ crypto/bn/bn_ctx.c:184:9: 182. /* If we're already overflowing ... */ 183. if (ctx->err_stack || ctx->too_many) 184. > ctx->err_stack++; 185. /* (Try to) get a new frame pointer */ 186. else if (!BN_STACK_push(&ctx->stack, ctx->used)) { crypto/bn/bn_ctx.c:183:5: 181. CTXDBG_ENTRY("BN_CTX_start", ctx); 182. /* If we're already overflowing ... */ 183. > if (ctx->err_stack || ctx->too_many) 184. ctx->err_stack++; 185. /* (Try to) get a new frame pointer */ crypto/bn/bn_ctx.c:191:1: return from a call to BN_CTX_start 189. } 190. CTXDBG_EXIT(ctx); 191. > } 192. 193. void BN_CTX_end(BN_CTX *ctx) crypto/ec/ec2_smpl.c:250:5: 248. } 249. BN_CTX_start(ctx); 250. > b = BN_CTX_get(ctx); 251. if (b == NULL) 252. goto err; crypto/bn/bn_ctx.c:210:1: start of procedure BN_CTX_get() 208. } 209. 210. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 211. { 212. BIGNUM *ret; crypto/bn/bn_ctx.c:215:9: Taking true branch 213. 214. CTXDBG_ENTRY("BN_CTX_get", ctx); 215. if (ctx->err_stack || ctx->too_many) ^ 216. return NULL; 217. if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) { crypto/bn/bn_ctx.c:216:9: 214. CTXDBG_ENTRY("BN_CTX_get", ctx); 215. if (ctx->err_stack || ctx->too_many) 216. > return NULL; 217. if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) { 218. /* crypto/bn/bn_ctx.c:231:1: return from a call to BN_CTX_get 229. CTXDBG_RET(ctx, ret); 230. return ret; 231. > } 232. 233. /************/ crypto/ec/ec2_smpl.c:251:9: Taking true branch 249. BN_CTX_start(ctx); 250. b = BN_CTX_get(ctx); 251. if (b == NULL) ^ 252. goto err; 253. crypto/ec/ec2_smpl.c:266:2: 264. ret = 1; 265. 266. > err: 267. if (ctx != NULL) 268. BN_CTX_end(ctx); crypto/ec/ec2_smpl.c:267:9: Taking true branch 265. 266. err: 267. if (ctx != NULL) ^ 268. BN_CTX_end(ctx); 269. BN_CTX_free(new_ctx); crypto/ec/ec2_smpl.c:268:9: 266. err: 267. if (ctx != NULL) 268. > BN_CTX_end(ctx); 269. BN_CTX_free(new_ctx); 270. return ret; crypto/bn/bn_ctx.c:193:1: start of procedure BN_CTX_end() 191. } 192. 193. > void BN_CTX_end(BN_CTX *ctx) 194. { 195. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:196:9: Taking true branch 194. { 195. CTXDBG_ENTRY("BN_CTX_end", ctx); 196. if (ctx->err_stack) ^ 197. ctx->err_stack--; 198. else { crypto/bn/bn_ctx.c:197:9: 195. CTXDBG_ENTRY("BN_CTX_end", ctx); 196. if (ctx->err_stack) 197. > ctx->err_stack--; 198. else { 199. unsigned int fp = BN_STACK_pop(&ctx->stack); crypto/bn/bn_ctx.c:196:5: 194. { 195. CTXDBG_ENTRY("BN_CTX_end", ctx); 196. > if (ctx->err_stack) 197. ctx->err_stack--; 198. else { crypto/bn/bn_ctx.c:208:1: return from a call to BN_CTX_end 206. } 207. CTXDBG_EXIT(ctx); 208. > } 209. 210. BIGNUM *BN_CTX_get(BN_CTX *ctx) crypto/ec/ec2_smpl.c:269:5: 267. if (ctx != NULL) 268. BN_CTX_end(ctx); 269. > BN_CTX_free(new_ctx); 270. return ret; 271. } crypto/bn/bn_ctx.c:157:1: start of procedure BN_CTX_free() 155. } 156. 157. > void BN_CTX_free(BN_CTX *ctx) 158. { 159. #ifdef BN_CTX_DEBUG crypto/bn/bn_ctx.c:174:5: 172. } 173. #endif 174. > BN_STACK_finish(&ctx->stack); 175. BN_POOL_finish(&ctx->pool); 176. OPENSSL_free(ctx); crypto/bn/bn_ctx.c:243:1: start of procedure BN_STACK_finish() 241. } 242. 243. > static void BN_STACK_finish(BN_STACK *st) 244. { 245. OPENSSL_free(st->indexes); crypto/bn/bn_ctx.c:245:5: 243. static void BN_STACK_finish(BN_STACK *st) 244. { 245. > OPENSSL_free(st->indexes); 246. st->indexes = NULL; 247. } crypto/mem.c:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:298:30: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); ^ 300. return; 301. } crypto/mem.c:300:9: 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); 300. > return; 301. } 302. crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/bn/bn_ctx.c:246:5: 244. { 245. OPENSSL_free(st->indexes); 246. > st->indexes = NULL; 247. } 248. crypto/bn/bn_ctx.c:247:1: return from a call to BN_STACK_finish 245. OPENSSL_free(st->indexes); 246. st->indexes = NULL; 247. > } 248. 249. crypto/bn/bn_ctx.c:175:5: 173. #endif 174. BN_STACK_finish(&ctx->stack); 175. > BN_POOL_finish(&ctx->pool); 176. OPENSSL_free(ctx); 177. } crypto/bn/bn_ctx.c:284:1: start of procedure BN_POOL_finish() 282. } 283. 284. > static void BN_POOL_finish(BN_POOL *p) 285. { 286. unsigned int loop; crypto/bn/bn_ctx.c:289:12: Loop condition is false. Leaving loop 287. BIGNUM *bn; 288. 289. while (p->head) { ^ 290. for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++) 291. if (bn->d)
https://github.com/openssl/openssl/blob/98c03302fb7b855647aa14022f61f5fb272e514a/crypto/ec/ec2_smpl.c/#L269
d2a_code_trace_data_41435
unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) { unsigned int ret=0, i, j; do { ++ret; for(i=0,j=ret;i<n-1;i++) j*=ret; } while (j<=x); return (ret-1); } libavcodec/vorbis_enc.c:279: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `cb_lookup_vals`. libavcodec/vorbis_enc.c:279:20: Call 277. 278. if (cb->lookup) { 279. vals = cb_lookup_vals(cb->lookup, cb->ndimentions, cb->nentries); ^ 280. cb->quantlist = av_malloc(sizeof(int) * vals); 281. for (i = 0; i < vals; i++) libavcodec/vorbis_enc.c:176:1: Parameter `dimentions` 174. } 175. 176. static int cb_lookup_vals(int lookup, int dimentions, int entries) { ^ 177. if (lookup == 1) return ff_vorbis_nth_root(entries, dimentions); 178. else if (lookup == 2) return dimentions * entries; libavcodec/vorbis_enc.c:177:34: Call 175. 176. static int cb_lookup_vals(int lookup, int dimentions, int entries) { 177. if (lookup == 1) return ff_vorbis_nth_root(entries, dimentions); ^ 178. else if (lookup == 2) return dimentions * entries; 179. return 0; libavcodec/vorbis.c:35:1: <LHS trace> 33. /* Helper functions */ 34. 35. unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) { // x^(1/n) ^ 36. unsigned int ret=0, i, j; 37. libavcodec/vorbis.c:35:1: Parameter `n` 33. /* Helper functions */ 34. 35. unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) { // x^(1/n) ^ 36. unsigned int ret=0, i, j; 37. libavcodec/vorbis.c:40:23: Binary operation: ([0, +oo] - 1):unsigned32 by call to `cb_lookup_vals` 38. do { 39. ++ret; 40. for(i=0,j=ret;i<n-1;i++) j*=ret; ^ 41. } while (j<=x); 42.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vorbis.c/#L40
d2a_code_trace_data_41436
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:317: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp_mont_consttime`. Showing all 28 steps of the trace test/bntest.c:317:10: Call 315. BN_bntest_rand(a, 1024, 0, 0); 316. BN_zero(p); 317. if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) ^ 318. return 0; 319. if (!BN_is_one(d)) { crypto/bn/bn_exp.c:601:1: Parameter `ctx->stack.depth` 599. * http://www.daemonology.net/hyperthreading-considered-harmful/) 600. */ 601. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 602. const BIGNUM *m, BN_CTX *ctx, 603. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:641:5: Call 639. } 640. 641. BN_CTX_start(ctx); ^ 642. 643. /* crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_exp.c:652:14: Call 650. if ((mont = BN_MONT_CTX_new()) == NULL) 651. goto err; 652. if (!BN_MONT_CTX_set(mont, m, ctx)) ^ 653. goto err; 654. } crypto/bn/bn_mont.c:247:1: Parameter `ctx->stack.depth` 245. } 246. 247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 248. { 249. int ret = 0; crypto/bn/bn_mont.c:255:5: Call 253. return 0; 254. 255. BN_CTX_start(ctx); ^ 256. if ((Ri = BN_CTX_get(ctx)) == NULL) 257. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mont.c:326:14: Call 324. tmod.top = buf[0] != 0 ? 1 : 0; 325. /* Ri = R^-1 mod N */ 326. if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 327. goto err; 328. if (!BN_lshift(Ri, Ri, BN_BITS2)) crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth` 122. BN_CTX *ctx); 123. 124. > BIGNUM *BN_mod_inverse(BIGNUM *in, 125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 126. { crypto/bn/bn_gcd.c:129:10: Call 127. BIGNUM *rv; 128. int noinv; 129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 130. if (noinv) 131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth` 133. } 134. 135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 137. int *pnoinv) crypto/bn/bn_gcd.c:148:16: Call 146. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 147. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 148. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 149. } 150. crypto/bn/bn_gcd.c:455:1: Parameter `ctx->stack.depth` 453. * not contain branches that may leak sensitive information. 454. */ 455. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 456. const BIGNUM *a, const BIGNUM *n, 457. BN_CTX *ctx) crypto/bn/bn_gcd.c:466:5: Call 464. bn_check_top(n); 465. 466. BN_CTX_start(ctx); ^ 467. A = BN_CTX_get(ctx); 468. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:501:18: Call 499. bn_init(&local_B); 500. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 501. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 502. goto err; 503. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:140:1: Parameter `ctx->stack.depth` 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:193:5: Call 191. } 192. 193. BN_CTX_start(ctx); ^ 194. tmp = BN_CTX_get(ctx); 195. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:416:5: Call 414. if (no_branch) 415. bn_correct_top(res); 416. BN_CTX_end(ctx); ^ 417. return (1); 418. err: crypto/bn/bn_ctx.c:195:1: Parameter `ctx->stack.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_exp_mont_consttime` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_41437
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:1132: error: Integer Overflow L2 ([-3, +oo] - 5):unsigned32 by call to `read_decode_block`. libavcodec/alsdec.c:1131:20: Call 1129. bd[1].raw_other = bd[0].raw_samples; 1130. 1131. if ((ret = read_decode_block(ctx, &bd[0])) < 0 || ^ 1132. (ret = read_decode_block(ctx, &bd[1])) < 0) 1133. goto fail; libavcodec/alsdec.c:1017:16: Call 1015. int ret; 1016. 1017. if ((ret = read_block(ctx, bd)) < 0) ^ 1018. return ret; 1019. libavcodec/alsdec.c:976:15: Call 974. // read block type flag and read the samples accordingly 975. if (bitstream_read_bit(bc)) { 976. ret = read_var_block_data(ctx, bd); ^ 977. } else { 978. read_const_block_data(ctx, bd); libavcodec/alsdec.c:625:31: Call 623. } else { 624. if (sconf->bgmc && sconf->sb_part) 625. log2_sub_blocks = bitstream_read(bc, 2); ^ 626. else 627. log2_sub_blocks = 2 * bitstream_read_bit(bc); libavcodec/bitstream.h:183:1: Parameter `bc->bits_left` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/alsdec.c:1132:20: Call 1130. 1131. if ((ret = read_decode_block(ctx, &bd[0])) < 0 || 1132. (ret = read_decode_block(ctx, &bd[1])) < 0) ^ 1133. goto fail; 1134. libavcodec/alsdec.c:1013:1: Parameter `ctx->bc.bits_left` 1011. /** Read and decode block data successively. 1012. */ 1013. static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd) ^ 1014. { 1015. int ret; libavcodec/alsdec.c:1017:16: Call 1015. int ret; 1016. 1017. if ((ret = read_block(ctx, bd)) < 0) ^ 1018. return ret; 1019. libavcodec/alsdec.c:968:1: Parameter `ctx->bc.bits_left` 966. /** Read the block data. 967. */ 968. static int read_block(ALSDecContext *ctx, ALSBlockData *bd) ^ 969. { 970. int ret = 0; libavcodec/alsdec.c:975:9: Call 973. *bd->shift_lsbs = 0; 974. // read block type flag and read the samples accordingly 975. if (bitstream_read_bit(bc)) { ^ 976. ret = read_var_block_data(ctx, bd); 977. } else { libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/alsdec.c:978:9: Call 976. ret = read_var_block_data(ctx, bd); 977. } else { 978. read_const_block_data(ctx, bd); ^ 979. } 980. libavcodec/alsdec.c:557:1: Parameter `ctx->bc.bits_left` 555. /** Read the block data for a constant block 556. */ 557. static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) ^ 558. { 559. ALSSpecificConfig *sconf = &ctx->sconf; libavcodec/alsdec.c:564:24: Call 562. 563. *bd->raw_samples = 0; 564. *bd->const_block = bitstream_read_bit(bc); // 1 = constant value, 0 = zero block (silence) ^ 565. bd->js_blocks = bitstream_read_bit(bc); 566. libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/alsdec.c:565:24: Call 563. *bd->raw_samples = 0; 564. *bd->const_block = bitstream_read_bit(bc); // 1 = constant value, 0 = zero block (silence) 565. bd->js_blocks = bitstream_read_bit(bc); ^ 566. 567. // skip 5 reserved bits libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/alsdec.c:568:5: Call 566. 567. // skip 5 reserved bits 568. bitstream_skip(bc, 5); ^ 569. 570. if (*bd->const_block) { 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: ([-3, +oo] - 5):unsigned32 by call to `read_decode_block` 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_41438
static void do_video_stats(AVFormatContext *os, AVOutputStream *ost, int frame_size) { AVCodecContext *enc; int frame_number; double ti1, bitrate, avg_bitrate; if (!vstats_file) { vstats_file = fopen(vstats_filename, "w"); if (!vstats_file) { perror("fopen"); ffmpeg_exit(1); } } enc = ost->st->codec; if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { frame_number = ost->frame_number; fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); if (enc->flags&CODEC_FLAG_PSNR) fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0))); fprintf(vstats_file,"f_size= %6d ", frame_size); ti1 = ost->sync_opts * av_q2d(enc->time_base); if (ti1 < 0.01) ti1 = 0.01; bitrate = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0; avg_bitrate = (double)(video_size * 8) / ti1 / 1000.0; fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ", (double)video_size / 1024, ti1, bitrate, avg_bitrate); fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(enc->coded_frame->pict_type)); } } ffmpeg.c:1312: error: Null Dereference pointer `vstats_file` last assigned on line 1302 could be null and is dereferenced by call to `fprintf()` at line 1312, column 9. ffmpeg.c:1293:1: start of procedure do_video_stats() 1291. } 1292. 1293. static void do_video_stats(AVFormatContext *os, AVOutputStream *ost, ^ 1294. int frame_size) 1295. { ffmpeg.c:1301:10: Taking true branch 1299. 1300. /* this is executed just the first time do_video_stats is called */ 1301. if (!vstats_file) { ^ 1302. vstats_file = fopen(vstats_filename, "w"); 1303. if (!vstats_file) { ffmpeg.c:1302:9: 1300. /* this is executed just the first time do_video_stats is called */ 1301. if (!vstats_file) { 1302. vstats_file = fopen(vstats_filename, "w"); ^ 1303. if (!vstats_file) { 1304. perror("fopen"); ffmpeg.c:1303:14: Taking true branch 1301. if (!vstats_file) { 1302. vstats_file = fopen(vstats_filename, "w"); 1303. if (!vstats_file) { ^ 1304. perror("fopen"); 1305. ffmpeg_exit(1); ffmpeg.c:1304:13: 1302. vstats_file = fopen(vstats_filename, "w"); 1303. if (!vstats_file) { 1304. perror("fopen"); ^ 1305. ffmpeg_exit(1); 1306. } ffmpeg.c:1305:13: Skipping ffmpeg_exit(): empty list of specs 1303. if (!vstats_file) { 1304. perror("fopen"); 1305. ffmpeg_exit(1); ^ 1306. } 1307. } ffmpeg.c:1309:5: 1307. } 1308. 1309. enc = ost->st->codec; ^ 1310. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { 1311. frame_number = ost->frame_number; ffmpeg.c:1310:9: Taking true branch 1308. 1309. enc = ost->st->codec; 1310. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { ^ 1311. frame_number = ost->frame_number; 1312. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); ffmpeg.c:1311:9: 1309. enc = ost->st->codec; 1310. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { 1311. frame_number = ost->frame_number; ^ 1312. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); 1313. if (enc->flags&CODEC_FLAG_PSNR) ffmpeg.c:1312:9: 1310. if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { 1311. frame_number = ost->frame_number; 1312. fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); ^ 1313. if (enc->flags&CODEC_FLAG_PSNR) 1314. fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0]/(enc->width*enc->height*255.0*255.0)));
https://github.com/libav/libav/blob/a6286bda0956bfe15b4e1a9f96e1689666e1d866/ffmpeg.c/#L1312
d2a_code_trace_data_41439
char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; int i; int n, lold, l, l1, l2, num, j, type; const char *s; char *p; unsigned char *q; BUF_MEM *b = NULL; static const char hex[17] = "0123456789ABCDEF"; int gs_doit[4]; char tmp_buf[80]; #ifdef CHARSET_EBCDIC unsigned char ebcdic_buf[1024]; #endif if (buf == NULL) { if ((b = BUF_MEM_new()) == NULL) goto err; if (!BUF_MEM_grow(b, 200)) goto err; b->data[0] = '\0'; len = 200; } else if (len == 0) { return NULL; } if (a == NULL) { if (b) { buf = b->data; OPENSSL_free(b); } strncpy(buf, "NO X509_NAME", len); buf[len - 1] = '\0'; return buf; } len--; l = 0; for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { ne = sk_X509_NAME_ENTRY_value(a->entries, i); n = OBJ_obj2nid(ne->object); if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) { i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object); s = tmp_buf; } l1 = strlen(s); type = ne->value->type; num = ne->value->length; if (num > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { ascii2ebcdic(ebcdic_buf, q, (num > (int)sizeof(ebcdic_buf)) ? (int)sizeof(ebcdic_buf) : num); q = ebcdic_buf; } #endif if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) { gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0; for (j = 0; j < num; j++) if (q[j] != 0) gs_doit[j & 3] = 1; if (gs_doit[0] | gs_doit[1] | gs_doit[2]) gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; else { gs_doit[0] = gs_doit[1] = gs_doit[2] = 0; gs_doit[3] = 1; } } else gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; for (l2 = j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; l2++; #ifndef CHARSET_EBCDIC if ((q[j] < ' ') || (q[j] > '~')) l2 += 3; #else if ((os_toascii[q[j]] < os_toascii[' ']) || (os_toascii[q[j]] > os_toascii['~'])) l2 += 3; #endif } lold = l; l += 1 + l1 + 1 + l2; if (l > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; p = &(b->data[lold]); } else if (l > len) { break; } else p = &(buf[lold]); *(p++) = '/'; memcpy(p, s, (unsigned int)l1); p += l1; *(p++) = '='; #ifndef CHARSET_EBCDIC q = ne->value->data; #endif for (j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; #ifndef CHARSET_EBCDIC n = q[j]; if ((n < ' ') || (n > '~')) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = n; #else n = os_toascii[q[j]]; if ((n < os_toascii[' ']) || (n > os_toascii['~'])) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = q[j]; #endif } *p = '\0'; } if (b != NULL) { p = b->data; OPENSSL_free(b); } else p = buf; if (i == 0) *p = '\0'; return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); end: BUF_MEM_free(b); return (NULL); } crypto/x509/t_crl.c:99: error: BUFFER_OVERRUN_L3 Offset added: [0, 200] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace crypto/x509/t_crl.c:99:9: Call 97. X509_CRL_get0_signature(&sig, &sig_alg, x); 98. X509_signature_print(out, sig_alg, NULL); 99. p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0); ^ 100. BIO_printf(out, "%8sIssuer: %s\n", "", p); 101. OPENSSL_free(p); crypto/x509/x509_obj.c:73:1: <Offset trace> 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: Parameter `len` 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: <Length trace> 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: Parameter `*buf` 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:104:9: Array access: Offset added: [0, 200] Size: [1, 2147483644] by call to `X509_NAME_oneline` 102. OPENSSL_free(b); 103. } 104. strncpy(buf, "NO X509_NAME", len); ^ 105. buf[len - 1] = '\0'; 106. return buf;
https://github.com/openssl/openssl/blob/24c2cd3967ed23acc0bd31a3781c4525e2e42a2c/crypto/x509/x509_obj.c/#L104
d2a_code_trace_data_41440
static int vp3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; static int counter = 0; int i; init_get_bits(&gb, buf, buf_size * 8); if (s->theora && get_bits1(&gb)) { av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n"); return -1; } s->keyframe = !get_bits1(&gb); if (!s->theora) skip_bits(&gb, 1); for (i = 0; i < 3; i++) s->last_qps[i] = s->qps[i]; s->nqps=0; do{ s->qps[s->nqps++]= get_bits(&gb, 6); } while(s->theora >= 0x030200 && s->nqps<3 && get_bits1(&gb)); for (i = s->nqps; i < 3; i++) s->qps[i] = -1; if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n", s->keyframe?"key":"", counter, s->qps[0]); counter++; if (s->qps[0] != s->last_qps[0]) init_loop_filter(s); for (i = 0; i < s->nqps; i++) if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0]) init_dequantizer(s, i); if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe) return buf_size; s->current_frame.reference = 3; s->current_frame.pict_type = s->keyframe ? FF_I_TYPE : FF_P_TYPE; if (avctx->get_buffer(avctx, &s->current_frame) < 0) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); goto error; } if (s->keyframe) { if (!s->theora) { skip_bits(&gb, 4); skip_bits(&gb, 4); if (s->version) { s->version = get_bits(&gb, 5); if (counter == 1) av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version); } } if (s->version || s->theora) { if (get_bits1(&gb)) av_log(s->avctx, AV_LOG_ERROR, "Warning, unsupported keyframe coding type?!\n"); skip_bits(&gb, 2); } } else { if (!s->golden_frame.data[0]) { av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n"); s->golden_frame.reference = 3; s->golden_frame.pict_type = FF_I_TYPE; if (avctx->get_buffer(avctx, &s->golden_frame) < 0) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); goto error; } s->last_frame = s->golden_frame; s->last_frame.type = FF_BUFFER_TYPE_COPY; } } s->current_frame.qscale_table= s->qscale_table; s->current_frame.qstride= 0; memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment)); if (unpack_superblocks(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n"); goto error; } if (unpack_modes(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n"); goto error; } if (unpack_vectors(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n"); goto error; } if (unpack_block_qpis(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_block_qpis\n"); goto error; } if (unpack_dct_coeffs(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n"); goto error; } for (i = 0; i < 3; i++) { int height = s->height >> (i && s->chroma_y_shift); if (s->flipped_image) s->data_offset[i] = 0; else s->data_offset[i] = (height-1) * s->current_frame.linesize[i]; } s->last_slice_end = 0; for (i = 0; i < s->c_superblock_height; i++) render_slice(s, i); for (i = 0; i < 3; i++) { int row = (s->height >> (3+(i && s->chroma_y_shift))) - 1; apply_loop_filter(s, i, row, row+1); } vp3_draw_horiz_band(s, s->height); *data_size=sizeof(AVFrame); *(AVFrame*)data= s->current_frame; if (s->last_frame.data[0] && s->last_frame.type != FF_BUFFER_TYPE_COPY) avctx->release_buffer(avctx, &s->last_frame); s->last_frame= s->current_frame; if (s->keyframe) { if (s->golden_frame.data[0]) avctx->release_buffer(avctx, &s->golden_frame); s->golden_frame = s->current_frame; s->last_frame.type = FF_BUFFER_TYPE_COPY; } s->current_frame.data[0]= NULL; return buf_size; error: if (s->current_frame.data[0]) avctx->release_buffer(avctx, &s->current_frame); return -1; } libavcodec/vp3.c:1728: error: Null Dereference pointer `&gb->buffer` last assigned on line 1720 could be null and is dereferenced by call to `get_bits1()` at line 1728, column 20. libavcodec/vp3.c:1709:1: start of procedure vp3_decode_frame() 1707. * This is the ffmpeg/libavcodec API frame decode function. 1708. */ 1709. static int vp3_decode_frame(AVCodecContext *avctx, ^ 1710. void *data, int *data_size, 1711. AVPacket *avpkt) libavcodec/vp3.c:1713:5: 1711. AVPacket *avpkt) 1712. { 1713. const uint8_t *buf = avpkt->data; ^ 1714. int buf_size = avpkt->size; 1715. Vp3DecodeContext *s = avctx->priv_data; libavcodec/vp3.c:1714:5: 1712. { 1713. const uint8_t *buf = avpkt->data; 1714. int buf_size = avpkt->size; ^ 1715. Vp3DecodeContext *s = avctx->priv_data; 1716. GetBitContext gb; libavcodec/vp3.c:1715:5: 1713. const uint8_t *buf = avpkt->data; 1714. int buf_size = avpkt->size; 1715. Vp3DecodeContext *s = avctx->priv_data; ^ 1716. GetBitContext gb; 1717. static int counter = 0; libavcodec/vp3.c:1717:5: 1715. Vp3DecodeContext *s = avctx->priv_data; 1716. GetBitContext gb; 1717. static int counter = 0; ^ 1718. int i; 1719. libavcodec/vp3.c:1720:5: 1718. int i; 1719. 1720. init_get_bits(&gb, buf, buf_size * 8); ^ 1721. 1722. if (s->theora && get_bits1(&gb)) libavcodec/get_bits.h:473:1: start of procedure init_get_bits() 471. * responsible for checking for the buffer end yourself (take advantage of the padding)! 472. */ 473. static inline void init_get_bits(GetBitContext *s, ^ 474. const uint8_t *buffer, int bit_size) 475. { libavcodec/get_bits.h:476:5: 474. const uint8_t *buffer, int bit_size) 475. { 476. int buffer_size= (bit_size+7)>>3; ^ 477. if(buffer_size < 0 || bit_size < 0) { 478. buffer_size = bit_size = 0; libavcodec/get_bits.h:477:8: Taking true branch 475. { 476. int buffer_size= (bit_size+7)>>3; 477. if(buffer_size < 0 || bit_size < 0) { ^ 478. buffer_size = bit_size = 0; 479. buffer = NULL; libavcodec/get_bits.h:478:9: 476. int buffer_size= (bit_size+7)>>3; 477. if(buffer_size < 0 || bit_size < 0) { 478. buffer_size = bit_size = 0; ^ 479. buffer = NULL; 480. } libavcodec/get_bits.h:479:9: 477. if(buffer_size < 0 || bit_size < 0) { 478. buffer_size = bit_size = 0; 479. buffer = NULL; ^ 480. } 481. libavcodec/get_bits.h:482:5: 480. } 481. 482. s->buffer= buffer; ^ 483. s->size_in_bits= bit_size; 484. s->buffer_end= buffer + buffer_size; libavcodec/get_bits.h:483:5: 481. 482. s->buffer= buffer; 483. s->size_in_bits= bit_size; ^ 484. s->buffer_end= buffer + buffer_size; 485. #ifdef ALT_BITSTREAM_READER libavcodec/get_bits.h:484:5: 482. s->buffer= buffer; 483. s->size_in_bits= bit_size; 484. s->buffer_end= buffer + buffer_size; ^ 485. #ifdef ALT_BITSTREAM_READER 486. s->index=0; libavcodec/get_bits.h:486:5: 484. s->buffer_end= buffer + buffer_size; 485. #ifdef ALT_BITSTREAM_READER 486. s->index=0; ^ 487. #elif defined LIBMPEG2_BITSTREAM_READER 488. s->buffer_ptr = (uint8_t*)((intptr_t)buffer&(~1)); libavcodec/get_bits.h:496:1: return from a call to init_get_bits 494. skip_bits_long(s, 0); 495. #endif 496. } ^ 497. 498. static inline void align_get_bits(GetBitContext *s) libavcodec/vp3.c:1722:9: Taking false branch 1720. init_get_bits(&gb, buf, buf_size * 8); 1721. 1722. if (s->theora && get_bits1(&gb)) ^ 1723. { 1724. av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n"); libavcodec/vp3.c:1728:20: 1726. } 1727. 1728. s->keyframe = !get_bits1(&gb); ^ 1729. if (!s->theora) 1730. skip_bits(&gb, 1); libavcodec/get_bits.h:393:1: start of procedure get_bits1() 391. } 392. 393. static inline unsigned int get_bits1(GetBitContext *s){ ^ 394. #ifdef ALT_BITSTREAM_READER 395. unsigned int index= s->index; libavcodec/get_bits.h:395:5: 393. static inline unsigned int get_bits1(GetBitContext *s){ 394. #ifdef ALT_BITSTREAM_READER 395. unsigned int index= s->index; ^ 396. uint8_t result= s->buffer[ index>>3 ]; 397. #ifdef ALT_BITSTREAM_READER_LE libavcodec/get_bits.h:396:5: 394. #ifdef ALT_BITSTREAM_READER 395. unsigned int index= s->index; 396. uint8_t result= s->buffer[ index>>3 ]; ^ 397. #ifdef ALT_BITSTREAM_READER_LE 398. result>>= (index&0x07);
https://github.com/libav/libav/blob/eb6a6cd788a172f146534c5fab9b98d6cbf59520/libavcodec/vp3.c/#L1728
d2a_code_trace_data_41441
static void contract(LHASH *lh) { LHASH_NODE **n,*n1,*np; np=lh->b[lh->p+lh->pmax-1]; lh->b[lh->p+lh->pmax-1]=NULL; if (lh->p == 0) { n=(LHASH_NODE **)OPENSSL_realloc(lh->b, (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax)); if (n == NULL) { lh->error++; return; } lh->num_contract_reallocs++; lh->num_alloc_nodes/=2; lh->pmax/=2; lh->p=lh->pmax-1; lh->b=n; } else lh->p--; lh->num_nodes--; lh->num_contracts++; n1=lh->b[(int)lh->p]; if (n1 == NULL) lh->b[(int)lh->p]=np; else { while (n1->next != NULL) n1=n1->next; n1->next=np; } } ssl/s3_pkt.c:792: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `ssl3_get_record`. Showing all 15 steps of the trace ssl/s3_pkt.c:728:1: Parameter `s->ctx->sessions->p` 726. * none of our business 727. */ 728. > int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) 729. { 730. int al,i,j,ret; ssl/s3_pkt.c:792:7: Call 790. if ((rr->length == 0) || (s->rstate == SSL_ST_READ_BODY)) 791. { 792. ret=ssl3_get_record(s); ^ 793. if (ret <= 0) return(ret); 794. } ssl/s3_pkt.c:231:1: Parameter `s->ctx->sessions->p` 229. */ 230. /* used only by ssl3_read_bytes */ 231. > static int ssl3_get_record(SSL *s) 232. { 233. int ssl_major,ssl_minor,al; ssl/s3_pkt.c:452:2: Call 450. SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC); 451. f_err: 452. ssl3_send_alert(s,SSL3_AL_FATAL,al); ^ 453. err: 454. return(ret); ssl/s3_pkt.c:1176:1: Parameter `s->ctx->sessions->p` 1174. } 1175. 1176. > void ssl3_send_alert(SSL *s, int level, int desc) 1177. { 1178. /* Map tls/ssl alert value to correct one */ ssl/s3_pkt.c:1183:3: Call 1181. /* If a fatal one, remove from cache */ 1182. if ((level == 2) && (s->session != NULL)) 1183. SSL_CTX_remove_session(s->ctx,s->session); ^ 1184. 1185. s->s3->alert_dispatch=1; ssl/ssl_sess.c:464:1: Parameter `ctx->sessions->p` 462. } 463. 464. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 465. { 466. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:466:9: Call 464. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 465. { 466. return remove_session_lock(ctx, c, 1); ^ 467. } 468. ssl/ssl_sess.c:469:1: Parameter `ctx->sessions->p` 467. } 468. 469. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 470. { 471. SSL_SESSION *r; ssl/ssl_sess.c:477:20: Call 475. { 476. if(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); 477. r=(SSL_SESSION *)lh_delete(ctx->sessions,c); ^ 478. if (r != NULL) 479. { crypto/lhash/lhash.c:217:1: Parameter `lh->pmax` 215. } 216. 217. > void *lh_delete(LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:243:3: Call 241. if ((lh->num_nodes > MIN_NODES) && 242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes))) 243. contract(lh); ^ 244. 245. return((void *)ret); crypto/lhash/lhash.c:361:1: <LHS trace> 359. } 360. 361. > static void contract(LHASH *lh) 362. { 363. LHASH_NODE **n,*n1,*np; crypto/lhash/lhash.c:361:1: Parameter `lh->p` 359. } 360. 361. > static void contract(LHASH *lh) 362. { 363. LHASH_NODE **n,*n1,*np; crypto/lhash/lhash.c:365:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ssl3_get_record` 363. LHASH_NODE **n,*n1,*np; 364. 365. np=lh->b[lh->p+lh->pmax-1]; ^ 366. lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */ 367. if (lh->p == 0)
https://github.com/openssl/openssl/blob/ee60d9fb282030be3f25e951b86d74d8f2dd1bdd/crypto/lhash/lhash.c/#L365
d2a_code_trace_data_41442
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: [-1, 14] 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:35: Array access: Offset: [-1, 14] 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_41443
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1347: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_mul`. Showing all 14 steps of the trace test/bntest.c:1322:1: Parameter `ctx->stack.depth` 1320. } 1321. 1322. > int test_gf2m_mod_mul(BIO *bp, BN_CTX *ctx) 1323. { 1324. BIGNUM *a, *b[2], *c, *d, *e, *f, *g, *h; test/bntest.c:1347:13: Call 1345. BN_bntest_rand(d, 1024, 0, 0); 1346. for (j = 0; j < 2; j++) { 1347. BN_GF2m_mod_mul(e, a, c, b[j], ctx); ^ 1348. BN_GF2m_add(f, a, d); 1349. BN_GF2m_mod_mul(g, f, c, b[j], ctx); crypto/bn/bn_gf2m.c:473:1: Parameter `ctx->stack.depth` 471. * BN_GF2m_mod_mul_arr function. 472. */ 473. > int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 474. const BIGNUM *p, BN_CTX *ctx) 475. { crypto/bn/bn_gf2m.c:489:11: Call 487. goto err; 488. } 489. ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx); ^ 490. bn_check_top(r); 491. err: crypto/bn/bn_gf2m.c:432:5: Call 430. } 431. 432. BN_CTX_start(ctx); ^ 433. if ((s = BN_CTX_get(ctx)) == NULL) 434. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gf2m.c:462:5: Call 460. 461. err: 462. BN_CTX_end(ctx); ^ 463. return ret; 464. } crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <Offset trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: <Length trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_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/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_41444
static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size, AVSubtitle *sub) { DVBSubContext *ctx = avctx->priv_data; DVBSubDisplayDefinition *display_def = ctx->display_definition; DVBSubRegion *region; DVBSubRegionDisplay *display; AVSubtitleRect *rect; DVBSubCLUT *clut; uint32_t *clut_table; int i; int offset_x=0, offset_y=0; sub->rects = NULL; sub->start_display_time = 0; sub->end_display_time = ctx->time_out * 1000; sub->format = 0; if (display_def) { offset_x = display_def->x; offset_y = display_def->y; } sub->num_rects = ctx->display_list_size; if (sub->num_rects > 0) { sub->rects = av_mallocz(sizeof(*sub->rects) * sub->num_rects); if (!sub->rects) return AVERROR(ENOMEM); for (i = 0; i < sub->num_rects; i++) { sub->rects[i] = av_mallocz(sizeof(*sub->rects[i])); if (!sub->rects[i]) { int j; for (j = 0; j < i; j ++) av_free(sub->rects[j]); av_free(sub->rects); return AVERROR(ENOMEM); } } } i = 0; for (display = ctx->display_list; display; display = display->next) { region = get_region(ctx, display->region_id); rect = sub->rects[i]; if (!region) continue; rect->x = display->x_pos + offset_x; rect->y = display->y_pos + offset_y; rect->w = region->width; rect->h = region->height; rect->nb_colors = 16; rect->type = SUBTITLE_BITMAP; rect->linesize[0] = region->width; clut = get_clut(ctx, region->clut); if (!clut) clut = &default_clut; switch (region->depth) { case 2: clut_table = clut->clut4; break; case 8: clut_table = clut->clut256; break; case 4: default: clut_table = clut->clut16; break; } rect->data[1] = av_mallocz(AVPALETTE_SIZE); if (!rect->data[1]) { for (i = 0; i < sub->num_rects; i++) av_free(sub->rects[i]); av_free(sub->rects); return AVERROR(ENOMEM); } memcpy(rect->data[1], clut_table, (1 << region->depth) * sizeof(uint32_t)); rect->data[0] = av_malloc(region->buf_size); if (!rect->data[0]) { av_free(rect->data[1]); for (i = 0; i < sub->num_rects; i++) av_free(sub->rects[i]); av_free(sub->rects); return AVERROR(ENOMEM); } memcpy(rect->data[0], region->pbuf, region->buf_size); #if FF_API_AVPICTURE FF_DISABLE_DEPRECATION_WARNINGS { int j; for (j = 0; j < 4; j++) { rect->pict.data[j] = rect->data[j]; rect->pict.linesize[j] = rect->linesize[j]; } } FF_ENABLE_DEPRECATION_WARNINGS #endif i++; } sub->num_rects = i; #ifdef DEBUG save_display_set(ctx); #endif return 1; } libavcodec/dvbsubdec.c:1309: error: Null Dereference pointer `sub->rects` last assigned on line 1277 could be null and is dereferenced at line 1309, column 16. libavcodec/dvbsubdec.c:1263:1: start of procedure dvbsub_display_end_segment() 1261. } 1262. 1263. static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, ^ 1264. int buf_size, AVSubtitle *sub) 1265. { libavcodec/dvbsubdec.c:1266:5: 1264. int buf_size, AVSubtitle *sub) 1265. { 1266. DVBSubContext *ctx = avctx->priv_data; ^ 1267. DVBSubDisplayDefinition *display_def = ctx->display_definition; 1268. libavcodec/dvbsubdec.c:1267:5: 1265. { 1266. DVBSubContext *ctx = avctx->priv_data; 1267. DVBSubDisplayDefinition *display_def = ctx->display_definition; ^ 1268. 1269. DVBSubRegion *region; libavcodec/dvbsubdec.c:1275:5: 1273. uint32_t *clut_table; 1274. int i; 1275. int offset_x=0, offset_y=0; ^ 1276. 1277. sub->rects = NULL; libavcodec/dvbsubdec.c:1277:5: 1275. int offset_x=0, offset_y=0; 1276. 1277. sub->rects = NULL; ^ 1278. sub->start_display_time = 0; 1279. sub->end_display_time = ctx->time_out * 1000; libavcodec/dvbsubdec.c:1278:5: 1276. 1277. sub->rects = NULL; 1278. sub->start_display_time = 0; ^ 1279. sub->end_display_time = ctx->time_out * 1000; 1280. sub->format = 0; libavcodec/dvbsubdec.c:1279:5: 1277. sub->rects = NULL; 1278. sub->start_display_time = 0; 1279. sub->end_display_time = ctx->time_out * 1000; ^ 1280. sub->format = 0; 1281. libavcodec/dvbsubdec.c:1280:5: 1278. sub->start_display_time = 0; 1279. sub->end_display_time = ctx->time_out * 1000; 1280. sub->format = 0; ^ 1281. 1282. if (display_def) { libavcodec/dvbsubdec.c:1282:9: Taking true branch 1280. sub->format = 0; 1281. 1282. if (display_def) { ^ 1283. offset_x = display_def->x; 1284. offset_y = display_def->y; libavcodec/dvbsubdec.c:1283:9: 1281. 1282. if (display_def) { 1283. offset_x = display_def->x; ^ 1284. offset_y = display_def->y; 1285. } libavcodec/dvbsubdec.c:1284:9: 1282. if (display_def) { 1283. offset_x = display_def->x; 1284. offset_y = display_def->y; ^ 1285. } 1286. libavcodec/dvbsubdec.c:1287:5: 1285. } 1286. 1287. sub->num_rects = ctx->display_list_size; ^ 1288. 1289. if (sub->num_rects > 0) { libavcodec/dvbsubdec.c:1289:9: Taking false branch 1287. sub->num_rects = ctx->display_list_size; 1288. 1289. if (sub->num_rects > 0) { ^ 1290. sub->rects = av_mallocz(sizeof(*sub->rects) * sub->num_rects); 1291. if (!sub->rects) libavcodec/dvbsubdec.c:1305:5: 1303. } 1304. 1305. i = 0; ^ 1306. 1307. for (display = ctx->display_list; display; display = display->next) { libavcodec/dvbsubdec.c:1307:10: 1305. i = 0; 1306. 1307. for (display = ctx->display_list; display; display = display->next) { ^ 1308. region = get_region(ctx, display->region_id); 1309. rect = sub->rects[i]; libavcodec/dvbsubdec.c:1307:39: Loop condition is true. Entering loop body 1305. i = 0; 1306. 1307. for (display = ctx->display_list; display; display = display->next) { ^ 1308. region = get_region(ctx, display->region_id); 1309. rect = sub->rects[i]; libavcodec/dvbsubdec.c:1308:9: 1306. 1307. for (display = ctx->display_list; display; display = display->next) { 1308. region = get_region(ctx, display->region_id); ^ 1309. rect = sub->rects[i]; 1310. libavcodec/dvbsubdec.c:148:1: start of procedure get_region() 146. } 147. 148. static DVBSubRegion* get_region(DVBSubContext *ctx, int region_id) ^ 149. { 150. DVBSubRegion *ptr = ctx->region_list; libavcodec/dvbsubdec.c:150:5: 148. static DVBSubRegion* get_region(DVBSubContext *ctx, int region_id) 149. { 150. DVBSubRegion *ptr = ctx->region_list; ^ 151. 152. while (ptr && ptr->id != region_id) { libavcodec/dvbsubdec.c:152:12: Loop condition is true. Entering loop body 150. DVBSubRegion *ptr = ctx->region_list; 151. 152. while (ptr && ptr->id != region_id) { ^ 153. ptr = ptr->next; 154. } libavcodec/dvbsubdec.c:152:19: Loop condition is true. Entering loop body 150. DVBSubRegion *ptr = ctx->region_list; 151. 152. while (ptr && ptr->id != region_id) { ^ 153. ptr = ptr->next; 154. } libavcodec/dvbsubdec.c:153:9: 151. 152. while (ptr && ptr->id != region_id) { 153. ptr = ptr->next; ^ 154. } 155. libavcodec/dvbsubdec.c:152:12: Loop condition is true. Entering loop body 150. DVBSubRegion *ptr = ctx->region_list; 151. 152. while (ptr && ptr->id != region_id) { ^ 153. ptr = ptr->next; 154. } libavcodec/dvbsubdec.c:152:19: Loop condition is true. Entering loop body 150. DVBSubRegion *ptr = ctx->region_list; 151. 152. while (ptr && ptr->id != region_id) { ^ 153. ptr = ptr->next; 154. } libavcodec/dvbsubdec.c:153:9: 151. 152. while (ptr && ptr->id != region_id) { 153. ptr = ptr->next; ^ 154. } 155. libavcodec/dvbsubdec.c:152:12: Loop condition is true. Entering loop body 150. DVBSubRegion *ptr = ctx->region_list; 151. 152. while (ptr && ptr->id != region_id) { ^ 153. ptr = ptr->next; 154. } libavcodec/dvbsubdec.c:152:19: Loop condition is false. Leaving loop 150. DVBSubRegion *ptr = ctx->region_list; 151. 152. while (ptr && ptr->id != region_id) { ^ 153. ptr = ptr->next; 154. } libavcodec/dvbsubdec.c:156:5: 154. } 155. 156. return ptr; ^ 157. } 158. libavcodec/dvbsubdec.c:157:1: return from a call to get_region 155. 156. return ptr; 157. } ^ 158. 159. static void delete_region_display_list(DVBSubContext *ctx, DVBSubRegion *region) libavcodec/dvbsubdec.c:1309:9: 1307. for (display = ctx->display_list; display; display = display->next) { 1308. region = get_region(ctx, display->region_id); 1309. rect = sub->rects[i]; ^ 1310. 1311. if (!region)
https://github.com/libav/libav/blob/969f215957b25ec014aeed6e440ecb450e6927c1/libavcodec/dvbsubdec.c/#L1309
d2a_code_trace_data_41445
static void copy_parameter_set(void **to, void **from, int count, int size) { int i; for (i = 0; i < count; i++) { if (to[i] && !from[i]) av_freep(&to[i]); else if (from[i] && !to[i]) to[i] = av_malloc(size); if (from[i]) memcpy(to[i], from[i], size); } } libavcodec/h264.c:1619: error: Null Dereference pointer `*to[i]` last assigned on line 1616 could be null and is dereferenced by call to `memcpy()` at line 1619, column 13. libavcodec/h264.c:1608:1: start of procedure copy_parameter_set() 1606. } 1607. 1608. static void copy_parameter_set(void **to, void **from, int count, int size) ^ 1609. { 1610. int i; libavcodec/h264.c:1612:10: 1610. int i; 1611. 1612. for (i = 0; i < count; i++) { ^ 1613. if (to[i] && !from[i]) 1614. av_freep(&to[i]); libavcodec/h264.c:1612:17: Loop condition is true. Entering loop body 1610. int i; 1611. 1612. for (i = 0; i < count; i++) { ^ 1613. if (to[i] && !from[i]) 1614. av_freep(&to[i]); libavcodec/h264.c:1613:13: Taking false branch 1611. 1612. for (i = 0; i < count; i++) { 1613. if (to[i] && !from[i]) ^ 1614. av_freep(&to[i]); 1615. else if (from[i] && !to[i]) libavcodec/h264.c:1615:18: Taking true branch 1613. if (to[i] && !from[i]) 1614. av_freep(&to[i]); 1615. else if (from[i] && !to[i]) ^ 1616. to[i] = av_malloc(size); 1617. libavcodec/h264.c:1615:30: Taking true branch 1613. if (to[i] && !from[i]) 1614. av_freep(&to[i]); 1615. else if (from[i] && !to[i]) ^ 1616. to[i] = av_malloc(size); 1617. libavcodec/h264.c:1616:13: 1614. av_freep(&to[i]); 1615. else if (from[i] && !to[i]) 1616. to[i] = av_malloc(size); ^ 1617. 1618. if (from[i]) libavutil/mem.c:61:1: start of procedure av_malloc() 59. * linker will do it automatically. */ 60. 61. void *av_malloc(size_t size) ^ 62. { 63. void *ptr = NULL; libavutil/mem.c:63:5: 61. void *av_malloc(size_t size) 62. { 63. void *ptr = NULL; ^ 64. #if CONFIG_MEMALIGN_HACK 65. long diff; libavutil/mem.c:69:9: Taking true branch 67. 68. /* let's disallow possibly ambiguous cases */ 69. if (size > (INT_MAX - 32) || !size) ^ 70. return NULL; 71. libavutil/mem.c:70:9: 68. /* let's disallow possibly ambiguous cases */ 69. if (size > (INT_MAX - 32) || !size) 70. return NULL; ^ 71. 72. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:114:1: return from a call to av_malloc 112. #endif 113. return ptr; 114. } ^ 115. 116. void *av_realloc(void *ptr, size_t size) libavcodec/h264.c:1618:13: Taking true branch 1616. to[i] = av_malloc(size); 1617. 1618. if (from[i]) ^ 1619. memcpy(to[i], from[i], size); 1620. } libavcodec/h264.c:1619:13: 1617. 1618. if (from[i]) 1619. memcpy(to[i], from[i], size); ^ 1620. } 1621. }
https://github.com/libav/libav/blob/5f4b1b1cbd0604b74cacc0870b501659240b5b45/libavcodec/h264.c/#L1619
d2a_code_trace_data_41446
static void BN_POOL_release(BN_POOL *p, unsigned int num) { unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; p->used -= num; while (num--) { bn_check_top(p->current->vals + offset); if (offset == 0) { offset = BN_CTX_POOL_SIZE - 1; p->current = p->current->prev; } else offset--; } } crypto/rsa/rsa_sp800_56b_check.c:227: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_gcd`. Showing all 15 steps of the trace 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: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->pool.used` 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/rsa/rsa_sp800_56b_check.c:227:15: Call 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)) */ 229. } crypto/bn/bn_gcd.c:15:1: Parameter `ctx->pool.used` 13. static BIGNUM *euclid(BIGNUM *a, BIGNUM *b); 14. 15. > int BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) 16. { 17. BIGNUM *a, *b, *t; crypto/bn/bn_gcd.c:24:9: Call 22. 23. BN_CTX_start(ctx); 24. a = BN_CTX_get(ctx); ^ 25. b = BN_CTX_get(ctx); 26. if (b == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->pool.used` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:25:9: Call 23. BN_CTX_start(ctx); 24. a = BN_CTX_get(ctx); 25. b = BN_CTX_get(ctx); ^ 26. if (b == NULL) 27. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->pool.used` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:49:5: Call 47. ret = 1; 48. err: 49. BN_CTX_end(ctx); ^ 50. bn_check_top(r); 51. return ret; crypto/bn/bn_ctx.c:185:1: Parameter `ctx->pool.used` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:194:13: Call 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) 194. BN_POOL_release(&ctx->pool, ctx->used - fp); ^ 195. ctx->used = fp; 196. /* Unjam "too_many" in case "get" had failed */ crypto/bn/bn_ctx.c:338:1: <LHS trace> 336. } 337. 338. > static void BN_POOL_release(BN_POOL *p, unsigned int num) 339. { 340. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; crypto/bn/bn_ctx.c:338:1: Parameter `p->used` 336. } 337. 338. > static void BN_POOL_release(BN_POOL *p, unsigned int num) 339. { 340. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; crypto/bn/bn_ctx.c:340:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_gcd` 338. static void BN_POOL_release(BN_POOL *p, unsigned int num) 339. { 340. unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; ^ 341. 342. p->used -= num;
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L340
d2a_code_trace_data_41447
int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop, OSSL_PROPERTY_LIST *pl) { PROPERTY_DEFN_ELEM elem, *old, *p = NULL; size_t len; LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns; property_defns = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_DEFN_INDEX, &property_defns_method); if (property_defns == NULL) return 0; if (prop == NULL) return 1; if (pl == NULL) { elem.prop = prop; lh_PROPERTY_DEFN_ELEM_delete(property_defns, &elem); return 1; } len = strlen(prop); p = OPENSSL_malloc(sizeof(*p) + len); if (p != NULL) { p->prop = p->body; p->defn = pl; memcpy(p->body, prop, len + 1); old = lh_PROPERTY_DEFN_ELEM_insert(property_defns, p); if (old != NULL) { property_defn_free(old); return 1; } if (!lh_PROPERTY_DEFN_ELEM_error(property_defns)) return 1; } OPENSSL_free(p); return 0; } test/property_test.c:243: error: BUFFER_OVERRUN_L3 Offset added: [1, 11] Size: [0, +oo] by call to `ossl_method_store_add`. Showing all 10 steps of the trace test/property_test.c:229:9: Array declaration 227. char *impl; 228. } impls[] = { 229. { 6, "position=1", "a" }, ^ 230. { 6, "position=2", "b" }, 231. { 6, "position=3", "c" }, test/property_test.c:243:14: Call 241. 242. for (i = 0; i < OSSL_NELEM(impls); i++) 243. if (!TEST_true(ossl_method_store_add(store, NULL, impls[i].nid, ^ 244. impls[i].prop, impls[i].impl, 245. NULL, NULL))) { crypto/property/property.c:177:1: Parameter `*properties` 175. } 176. 177. > int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov, 178. int nid, const char *properties, void *method, 179. int (*method_up_ref)(void *), crypto/property/property.c:216:9: Call 214. if (impl->properties == NULL) 215. goto err; 216. ossl_prop_defn_set(store->ctx, properties, impl->properties); ^ 217. } 218. crypto/property/defn_cache.c:84:1: <Offset trace> 82. } 83. 84. > int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop, 85. OSSL_PROPERTY_LIST *pl) 86. { crypto/property/defn_cache.c:84:1: Parameter `prop->strlen` 82. } 83. 84. > int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop, 85. OSSL_PROPERTY_LIST *pl) 86. { crypto/property/defn_cache.c:104:5: Assignment 102. return 1; 103. } 104. len = strlen(prop); ^ 105. p = OPENSSL_malloc(sizeof(*p) + len); 106. if (p != NULL) { crypto/property/defn_cache.c:84:1: <Length trace> 82. } 83. 84. > int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop, 85. OSSL_PROPERTY_LIST *pl) 86. { crypto/property/defn_cache.c:84:1: Parameter `*prop` 82. } 83. 84. > int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop, 85. OSSL_PROPERTY_LIST *pl) 86. { crypto/property/defn_cache.c:109:9: Array access: Offset added: [1, 11] Size: [0, +oo] by call to `ossl_method_store_add` 107. p->prop = p->body; 108. p->defn = pl; 109. memcpy(p->body, prop, len + 1); ^ 110. old = lh_PROPERTY_DEFN_ELEM_insert(property_defns, p); 111. if (old != NULL) {
https://github.com/openssl/openssl/blob/c1d56231ef6385b557ec72eec508e55ea26ca8b0/crypto/property/defn_cache.c/#L109
d2a_code_trace_data_41448
static int kek_unwrap_key(unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen, EVP_CIPHER_CTX *ctx) { size_t blocklen = EVP_CIPHER_CTX_block_size(ctx); unsigned char *tmp; int outl, rv = 0; if (inlen < 2 * blocklen) { return 0; } if (inlen % blocklen) { return 0; } if ((tmp = OPENSSL_malloc(inlen)) == NULL) { CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE); return 0; } if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl, in + inlen - 2 * blocklen, blocklen * 2) || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp + inlen - blocklen, blocklen) || !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen) || !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL) || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen)) goto err; if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) { goto err; } if (inlen < (size_t)(tmp[0] - 4)) { goto err; } *outlen = (size_t)tmp[0]; memcpy(out, tmp + 4, *outlen); rv = 1; err: OPENSSL_clear_free(tmp, inlen); return rv; } crypto/cms/cms_smime.c:691: error: BUFFER_OVERRUN_L3 Offset added: [4, +oo] (⇐ 4 + [0, +oo]) Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt`. Showing all 17 steps of the trace crypto/cms/cms_smime.c:691:17: Call 689. if (!id || (CMS_RecipientInfo_kekri_id_cmp(ri, id, idlen) == 0)) { 690. CMS_RecipientInfo_set0_key(ri, key, keylen); 691. r = CMS_RecipientInfo_decrypt(cms, ri); ^ 692. CMS_RecipientInfo_set0_key(ri, NULL, 0); 693. if (r > 0) crypto/cms/cms_env.c:739:1: Parameter `ri->d.pwri->encryptedKey->length` 737. } 738. 739. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) 740. { 741. switch (ri->type) { crypto/cms/cms_smime.c:691:17: Call 689. if (!id || (CMS_RecipientInfo_kekri_id_cmp(ri, id, idlen) == 0)) { 690. CMS_RecipientInfo_set0_key(ri, key, keylen); 691. r = CMS_RecipientInfo_decrypt(cms, ri); ^ 692. CMS_RecipientInfo_set0_key(ri, NULL, 0); 693. if (r > 0) crypto/cms/cms_env.c:739:1: Parameter `ri->d.pwri->encryptedKey->length` 737. } 738. 739. > int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) 740. { 741. switch (ri->type) { crypto/cms/cms_env.c:749:16: Call 747. 748. case CMS_RECIPINFO_PASS: 749. return cms_RecipientInfo_pwri_crypt(cms, ri, 0); ^ 750. 751. default: crypto/cms/cms_pwri.c:276:1: Parameter `ri->d.pwri->encryptedKey->length` 274. /* Encrypt/Decrypt content key in PWRI recipient info */ 275. 276. > int cms_RecipientInfo_pwri_crypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri, 277. int en_de) 278. { crypto/cms/cms_pwri.c:369:14: Call 367. goto err; 368. } 369. if (!kek_unwrap_key(key, &keylen, ^ 370. pwri->encryptedKey->data, 371. pwri->encryptedKey->length, kekctx)) { crypto/cms/cms_pwri.c:211:13: <Offset trace> 209. || !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL) 210. /* Decrypt again */ 211. || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen)) ^ 212. goto err; 213. /* Check check bytes */ crypto/cms/cms_pwri.c:211:13: Call 209. || !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL) 210. /* Decrypt again */ 211. || !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen)) ^ 212. goto err; 213. /* Check check bytes */ crypto/evp/evp_enc.c:443:1: Parameter `ctx->buf[*]` 441. } 442. 443. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 444. const unsigned char *in, int inl) 445. { crypto/cms/cms_pwri.c:222:5: Assignment 220. goto err; 221. } 222. *outlen = (size_t)tmp[0]; ^ 223. memcpy(out, tmp + 4, *outlen); 224. rv = 1; crypto/cms/cms_pwri.c:176:1: <Length trace> 174. */ 175. 176. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 177. const unsigned char *in, size_t inlen, 178. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:176:1: Parameter `inlen` 174. */ 175. 176. > static int kek_unwrap_key(unsigned char *out, size_t *outlen, 177. const unsigned char *in, size_t inlen, 178. EVP_CIPHER_CTX *ctx) crypto/cms/cms_pwri.c:191:16: Call 189. return 0; 190. } 191. if ((tmp = OPENSSL_malloc(inlen)) == NULL) { ^ 192. CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE); 193. return 0; crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/cms/cms_pwri.c:191:10: Assignment 189. return 0; 190. } 191. if ((tmp = OPENSSL_malloc(inlen)) == NULL) { ^ 192. CMSerr(CMS_F_KEK_UNWRAP_KEY, ERR_R_MALLOC_FAILURE); 193. return 0; crypto/cms/cms_pwri.c:223:5: Array access: Offset added: [4, +oo] (⇐ 4 + [0, +oo]) Size: [1, +oo] by call to `CMS_RecipientInfo_decrypt` 221. } 222. *outlen = (size_t)tmp[0]; 223. memcpy(out, tmp + 4, *outlen); ^ 224. rv = 1; 225. err:
https://github.com/openssl/openssl/blob/bcf082d130a413a728a382bd6e6bfdbf2cedba45/crypto/cms/cms_pwri.c/#L223
d2a_code_trace_data_41449
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } r->neg = a->neg; nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } apps/gendsa.c:126: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `DSA_generate_key`. Showing all 25 steps of the trace apps/gendsa.c:125:58: Call 123. 124. DSA_get0_pqg(dsa, &p, NULL, NULL); 125. BIO_printf(bio_err, "Generating DSA key, %d bits\n", BN_num_bits(p)); ^ 126. if (!DSA_generate_key(dsa)) 127. goto end; crypto/bn/bn_lib.c:166:9: Call 164. bn_check_top(a); 165. 166. if (BN_is_zero(a)) ^ 167. return 0; 168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); crypto/bn/bn_lib.c:918:1: Parameter `a->top` 916. } 917. 918. > int BN_is_zero(const BIGNUM *a) 919. { 920. return a->top == 0; apps/gendsa.c:126:10: Call 124. DSA_get0_pqg(dsa, &p, NULL, NULL); 125. BIO_printf(bio_err, "Generating DSA key, %d bits\n", BN_num_bits(p)); 126. if (!DSA_generate_key(dsa)) ^ 127. goto end; 128. crypto/dsa/dsa_key.c:19:1: Parameter `dsa->g->top` 17. static int dsa_builtin_keygen(DSA *dsa); 18. 19. > int DSA_generate_key(DSA *dsa) 20. { 21. if (dsa->meth->dsa_keygen) crypto/dsa/dsa_key.c:23:12: Call 21. if (dsa->meth->dsa_keygen) 22. return dsa->meth->dsa_keygen(dsa); 23. return dsa_builtin_keygen(dsa); ^ 24. } 25. crypto/dsa/dsa_key.c:26:1: Parameter `dsa->g->top` 24. } 25. 26. > static int dsa_builtin_keygen(DSA *dsa) 27. { 28. int ok = 0; crypto/dsa/dsa_key.c:59:14: Call 57. BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); 58. 59. if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) { ^ 60. BN_free(prk); 61. goto err; crypto/bn/bn_exp.c:90:1: Parameter `a->top` 88. } 89. 90. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 91. BN_CTX *ctx) 92. { crypto/bn/bn_exp.c:150:19: Call 148. } else 149. # endif 150. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 151. } else 152. #endif crypto/bn/bn_exp.c:300:1: Parameter `a->top` 298. } 299. 300. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 301. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 302. { crypto/bn/bn_exp.c:312:16: Call 310. 311. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 312. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 313. } 314. crypto/bn/bn_exp.c:600:1: Parameter `a->top` 598. * http://www.daemonology.net/hyperthreading-considered-harmful/) 599. */ 600. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 601. const BIGNUM *m, BN_CTX *ctx, 602. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:753:14: Call 751. /* prepare a^1 in Montgomery domain */ 752. if (a->neg || BN_ucmp(a, m) >= 0) { 753. if (!BN_mod(&am, a, m, ctx)) ^ 754. goto err; 755. if (!BN_to_montgomery(&am, &am, mont, ctx)) crypto/bn/bn_div.c:140:1: Parameter `num->top` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/bn/bn_div.c:210:11: Call 208. sdiv->neg = 0; 209. norm_shift += BN_BITS2; 210. if (!(BN_lshift(snum, num, norm_shift))) ^ 211. goto err; 212. snum->neg = 0; crypto/bn/bn_shift.c:81:1: <Offset trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `n` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:96:5: Assignment 94. 95. r->neg = a->neg; 96. nw = n / BN_BITS2; ^ 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) 98. return (0); crypto/bn/bn_shift.c:81:1: <Length trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `*r->d` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:9: Call 95. r->neg = a->neg; 96. nw = n / BN_BITS2; 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 98. return (0); 99. lb = n % BN_BITS2; crypto/bn/bn_lib.c:1014:1: Parameter `*a->d` 1012. } 1013. 1014. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 1015. { 1016. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_shift.c:102:5: Assignment 100. rb = BN_BITS2 - lb; 101. f = a->d; 102. t = r->d; ^ 103. t[a->top + nw] = 0; 104. if (lb == 0) crypto/bn/bn_shift.c:110:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `DSA_generate_key` 108. for (i = a->top - 1; i >= 0; i--) { 109. l = f[i]; 110. t[nw + i + 1] |= (l >> rb) & BN_MASK2; ^ 111. t[nw + i] = (l << lb) & BN_MASK2; 112. }
https://github.com/openssl/openssl/blob/ec772a817afc0f788c38006f623204a7d76221ec/crypto/bn/bn_shift.c/#L110
d2a_code_trace_data_41450
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/statem/statem.c:608: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`. Showing all 13 steps of the trace ssl/statem/statem.c:474:1: Parameter `s->initial_ctx->sessions->num_items` 472. * will resume in the same state where we left off. 473. */ 474. > static SUB_STATE_RETURN read_state_machine(SSL *s) { 475. OSSL_STATEM *st = &s->statem; 476. int ret, mt; ssl/statem/statem.c:608:13: Call 606. default: 607. /* Shouldn't happen */ 608. ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); ^ 609. SSLerr(SSL_F_READ_STATE_MACHINE, ERR_R_INTERNAL_ERROR); 610. ossl_statem_set_error(s); ssl/s3_msg.c:64:1: Parameter `s->initial_ctx->sessions->num_items` 62. } 63. 64. > int ssl3_send_alert(SSL *s, int level, int desc) 65. { 66. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:75:9: Call 73. /* If a fatal one, remove from cache */ 74. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 75. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 76. 77. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items` 689. } 690. 691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:693:12: Call 691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ^ 694. } 695. ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items` 694. } 695. 696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 697. { 698. SSL_SESSION *r; ssl/ssl_sess.c:706:17: Call 704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 705. ret = 1; 706. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 707. SSL_SESSION_list_remove(ctx, c); 708. } ssl/ssl_locl.h:581:1: Parameter `lh->num_items` 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:581:1: Call 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_send_alert` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_41451
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 xmin 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_41452
static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) { RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; int size, i, err; char *content; char url[1024]; if (!ff_network_init()) return AVERROR(EIO); content = av_malloc(SDP_MAX_SIZE); size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1); if (size <= 0) { av_free(content); return AVERROR_INVALIDDATA; } content[size] ='\0'; sdp_parse(s, content); av_free(content); for (i = 0; i < rt->nb_rtsp_streams; i++) { char namebuf[50]; rtsp_st = rt->rtsp_streams[i]; getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip, sizeof(rtsp_st->sdp_ip), namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); ff_url_join(url, sizeof(url), "rtp", NULL, namebuf, rtsp_st->sdp_port, "?localport=%d&ttl=%d", rtsp_st->sdp_port, rtsp_st->sdp_ttl); if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) { err = AVERROR_INVALIDDATA; goto fail; } if ((err = rtsp_open_transport_ctx(s, rtsp_st))) goto fail; } return 0; fail: ff_rtsp_close_streams(s); ff_network_close(); return err; } libavformat/rtsp.c:2077: error: Null Dereference pointer `content` last assigned on line 2071 could be null and is dereferenced at line 2077, column 5. libavformat/rtsp.c:2058:1: start of procedure sdp_read_header() 2056. } 2057. 2058. static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) ^ 2059. { 2060. RTSPState *rt = s->priv_data; libavformat/rtsp.c:2060:5: 2058. static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) 2059. { 2060. RTSPState *rt = s->priv_data; ^ 2061. RTSPStream *rtsp_st; 2062. int size, i, err; libavformat/rtsp.c:2066:10: 2064. char url[1024]; 2065. 2066. if (!ff_network_init()) ^ 2067. return AVERROR(EIO); 2068. libavformat/network.h:49:1: start of procedure ff_network_init() 47. int ff_socket_nonblock(int socket, int enable); 48. 49. static inline int ff_network_init(void) ^ 50. { 51. #if HAVE_WINSOCK2_H libavformat/network.h:56:5: 54. return 0; 55. #endif 56. return 1; ^ 57. } 58. libavformat/network.h:57:1: return from a call to ff_network_init 55. #endif 56. return 1; 57. } ^ 58. 59. static inline void ff_network_close(void) libavformat/rtsp.c:2066:10: Taking false branch 2064. char url[1024]; 2065. 2066. if (!ff_network_init()) ^ 2067. return AVERROR(EIO); 2068. libavformat/rtsp.c:2071:5: 2069. /* read the whole sdp file */ 2070. /* XXX: better loading */ 2071. content = av_malloc(SDP_MAX_SIZE); ^ 2072. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1); 2073. if (size <= 0) { libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(unsigned int size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(unsigned int size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking true branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,16,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:84:9: 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,16,size)) 84. ptr = NULL; ^ 85. #elif HAVE_MEMALIGN 86. ptr = memalign(16,size); libavutil/mem.c:116:5: 114. ptr = malloc(size); 115. #endif 116. return ptr; ^ 117. } 118. libavutil/mem.c:117:1: return from a call to av_malloc 115. #endif 116. return ptr; 117. } ^ 118. 119. void *av_realloc(void *ptr, unsigned int size) libavformat/rtsp.c:2072:5: Skipping get_buffer(): empty list of specs 2070. /* XXX: better loading */ 2071. content = av_malloc(SDP_MAX_SIZE); 2072. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1); ^ 2073. if (size <= 0) { 2074. av_free(content); libavformat/rtsp.c:2073:9: Taking false branch 2071. content = av_malloc(SDP_MAX_SIZE); 2072. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1); 2073. if (size <= 0) { ^ 2074. av_free(content); 2075. return AVERROR_INVALIDDATA; libavformat/rtsp.c:2077:5: 2075. return AVERROR_INVALIDDATA; 2076. } 2077. content[size] ='\0'; ^ 2078. 2079. sdp_parse(s, content);
https://github.com/libav/libav/blob/f41237c9dbe9751ef025812edebdec762797e57d/libavformat/rtsp.c/#L2077
d2a_code_trace_data_41453
uintptr_t ngx_escape_uri(u_char *dst, u_char *src, size_t size, ngx_uint_t type) { ngx_uint_t n; uint32_t *escape; static u_char hex[] = "0123456789ABCDEF"; static uint32_t uri[] = { 0xffffffff, 0x80000029, 0x00000000, 0x80000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; static uint32_t args[] = { 0xffffffff, 0x88000869, 0x00000000, 0x80000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; static uint32_t uri_component[] = { 0xffffffff, 0xfc009fff, 0x78000001, 0xb8000001, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; static uint32_t html[] = { 0xffffffff, 0x000000ad, 0x00000000, 0x80000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; static uint32_t refresh[] = { 0xffffffff, 0x00000085, 0x00000000, 0x80000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; static uint32_t memcached[] = { 0xffffffff, 0x00000021, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; static uint32_t *map[] = { uri, args, uri_component, html, refresh, memcached, memcached }; escape = map[type]; if (dst == NULL) { n = 0; while (size) { if (escape[*src >> 5] & (1U << (*src & 0x1f))) { n++; } src++; size--; } return (uintptr_t) n; } while (size) { if (escape[*src >> 5] & (1U << (*src & 0x1f))) { *dst++ = '%'; *dst++ = hex[*src >> 4]; *dst++ = hex[*src & 0xf]; src++; } else { *dst++ = *src++; } size--; } return (uintptr_t) dst; } src/http/modules/ngx_http_proxy_module.c:1313: error: Buffer Overrun L3 Offset: [1, +oo] Size: [0, +oo] by call to `ngx_escape_uri`. src/http/modules/ngx_http_proxy_module.c:1296:5: Assignment 1294. /* the request line */ 1295. 1296. b->last = ngx_copy(b->last, method.data, method.len); ^ 1297. *b->last++ = ' '; 1298. src/http/modules/ngx_http_proxy_module.c:1313:13: Call 1311. 1312. if (escape) { 1313. ngx_escape_uri(b->last, r->uri.data + loc_len, ^ 1314. r->uri.len - loc_len, NGX_ESCAPE_URI); 1315. b->last += r->uri.len - loc_len + escape; src/core/ngx_string.c:1424:1: <Length trace> 1422. 1423. 1424. uintptr_t ^ 1425. ngx_escape_uri(u_char *dst, u_char *src, size_t size, ngx_uint_t type) 1426. { src/core/ngx_string.c:1424:1: Parameter `*dst` 1422. 1423. 1424. uintptr_t ^ 1425. ngx_escape_uri(u_char *dst, u_char *src, size_t size, ngx_uint_t type) 1426. { src/core/ngx_string.c:1578:14: Assignment 1576. while (size) { 1577. if (escape[*src >> 5] & (1U << (*src & 0x1f))) { 1578. *dst++ = '%'; ^ 1579. *dst++ = hex[*src >> 4]; 1580. *dst++ = hex[*src & 0xf]; src/core/ngx_string.c:1579:13: Array access: Offset: [1, +oo] Size: [0, +oo] by call to `ngx_escape_uri` 1577. if (escape[*src >> 5] & (1U << (*src & 0x1f))) { 1578. *dst++ = '%'; 1579. *dst++ = hex[*src >> 4]; ^ 1580. *dst++ = hex[*src & 0xf]; 1581. src++;
https://github.com/nginx/nginx/blob/6299f5e9149483251bbbcc8ad26cf29b6109e75c/src/core/ngx_string.c/#L1579