Dataset Viewer
Auto-converted to Parquet Duplicate
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
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
2