id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_43854
ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc) { u_char ch; ngx_str_t name; ngx_uint_t i, bracket; if (ngx_http_script_init_arrays(sc) != NGX_OK) { return NGX_ERROR; } for (i = 0; i < sc->source->len; ) { name.len = 0; if (sc->source->data[i] == '$') { if (++i == sc->source->len) { goto invalid_variable; } #if (NGX_PCRE) { ngx_uint_t n; if (sc->source->data[i] >= '1' && sc->source->data[i] <= '9') { n = sc->source->data[i] - '0'; if (sc->captures_mask & (1 << n)) { sc->dup_capture = 1; } sc->captures_mask |= 1 << n; if (ngx_http_script_add_capture_code(sc, n) != NGX_OK) { return NGX_ERROR; } i++; continue; } } #endif if (sc->source->data[i] == '{') { bracket = 1; if (++i == sc->source->len) { goto invalid_variable; } name.data = &sc->source->data[i]; } else { bracket = 0; name.data = &sc->source->data[i]; } for ( ; i < sc->source->len; i++, name.len++) { ch = sc->source->data[i]; if (ch == '}' && bracket) { i++; bracket = 0; break; } if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '_') { continue; } break; } if (bracket) { ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0, "the closing bracket in \"%V\" " "variable is missing", &name); return NGX_ERROR; } if (name.len == 0) { goto invalid_variable; } sc->variables++; if (ngx_http_script_add_var_code(sc, &name) != NGX_OK) { return NGX_ERROR; } continue; } if (sc->source->data[i] == '?' && sc->compile_args) { sc->args = 1; sc->compile_args = 0; if (ngx_http_script_add_args_code(sc) != NGX_OK) { return NGX_ERROR; } i++; continue; } name.data = &sc->source->data[i]; while (i < sc->source->len) { if (sc->source->data[i] == '$') { break; } if (sc->source->data[i] == '?') { sc->args = 1; if (sc->compile_args) { break; } } i++; name.len++; } sc->size += name.len; if (ngx_http_script_add_copy_code(sc, &name, (i == sc->source->len)) != NGX_OK) { return NGX_ERROR; } } return ngx_http_script_done(sc); invalid_variable: ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0, "invalid variable name"); return NGX_ERROR; } src/http/ngx_http_core_module.c:4524: error: Buffer Overrun L3 Offset: [2, +oo] Size: [1, +oo] by call to `ngx_http_script_compile`. src/http/ngx_http_core_module.c:4429:1: Parameter `conf->root.data` 4427. 4428. 4429. static char * ^ 4430. ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 4431. { src/http/ngx_http_core_module.c:4524:13: Call 4522. sc.complete_values = 1; 4523. 4524. if (ngx_http_script_compile(&sc) != NGX_OK) { ^ 4525. return NGX_CONF_ERROR; 4526. } src/http/ngx_http_script.c:332:1: <Offset trace> 330. 331. 332. ngx_int_t ^ 333. ngx_http_script_compile(ngx_http_script_compile_t *sc) 334. { src/http/ngx_http_script.c:332:1: Parameter `sc->source->len` 330. 331. 332. ngx_int_t ^ 333. ngx_http_script_compile(ngx_http_script_compile_t *sc) 334. { src/http/ngx_http_script.c:332:1: <Length trace> 330. 331. 332. ngx_int_t ^ 333. ngx_http_script_compile(ngx_http_script_compile_t *sc) 334. { src/http/ngx_http_script.c:332:1: Parameter `*sc->source->data` 330. 331. 332. ngx_int_t ^ 333. ngx_http_script_compile(ngx_http_script_compile_t *sc) 334. { src/http/ngx_http_script.c:385:17: Array access: Offset: [2, +oo] Size: [1, +oo] by call to `ngx_http_script_compile` 383. } 384. 385. name.data = &sc->source->data[i]; ^ 386. 387. } else {
https://github.com/nginx/nginx/blob/79a03b3ff6d950e60a06c6d979bd7a909709e82d/src/http/ngx_http_script.c/#L385
d2a_code_trace_data_43855
static void new_subtitle_stream(AVFormatContext *oc, int file_idx) { AVStream *st; AVOutputStream *ost; AVCodec *codec=NULL; AVCodecContext *subtitle_enc; enum CodecID codec_id; st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); if (!st) { fprintf(stderr, "Could not alloc stream\n"); ffmpeg_exit(1); } ost = new_output_stream(oc, file_idx); subtitle_enc = st->codec; output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); if(!subtitle_stream_copy){ if (subtitle_codec_name) { codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1, avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->strict_std_compliance); codec= output_codecs[nb_output_codecs-1] = avcodec_find_encoder_by_name(subtitle_codec_name); } else { codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_SUBTITLE); codec = avcodec_find_encoder(codec_id); } } avcodec_get_context_defaults3(st->codec, codec); ost->bitstream_filters = subtitle_bitstream_filters; subtitle_bitstream_filters= NULL; subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE; if(subtitle_codec_tag) subtitle_enc->codec_tag= subtitle_codec_tag; if (oc->oformat->flags & AVFMT_GLOBALHEADER) { subtitle_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->flags |= CODEC_FLAG_GLOBAL_HEADER; } if (subtitle_stream_copy) { st->stream_copy = 1; } else { subtitle_enc->codec_id = codec_id; set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM, codec); } if (subtitle_language) { av_metadata_set2(&st->metadata, "language", subtitle_language, 0); av_freep(&subtitle_language); } subtitle_disable = 0; av_freep(&subtitle_codec_name); subtitle_stream_copy = 0; } ffmpeg.c:3603: error: Null Dereference pointer `st` last assigned on line 3597 could be null and is dereferenced at line 3603, column 20. ffmpeg.c:3589:1: start of procedure new_subtitle_stream() 3587. } 3588. 3589. static void new_subtitle_stream(AVFormatContext *oc, int file_idx) ^ 3590. { 3591. AVStream *st; ffmpeg.c:3593:5: 3591. AVStream *st; 3592. AVOutputStream *ost; 3593. AVCodec *codec=NULL; ^ 3594. AVCodecContext *subtitle_enc; 3595. enum CodecID codec_id; ffmpeg.c:3597:28: Condition is true 3595. enum CodecID codec_id; 3596. 3597. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); ^ 3598. if (!st) { 3599. fprintf(stderr, "Could not alloc stream\n"); ffmpeg.c:3597:5: 3595. enum CodecID codec_id; 3596. 3597. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); ^ 3598. if (!st) { 3599. fprintf(stderr, "Could not alloc stream\n"); libavformat/utils.c:2601:1: start of procedure av_new_stream() 2599. } 2600. 2601. AVStream *av_new_stream(AVFormatContext *s, int id) ^ 2602. { 2603. AVStream *st; libavformat/utils.c:2607:9: Taking true branch 2605. 2606. #if FF_API_MAX_STREAMS 2607. if (s->nb_streams >= MAX_STREAMS){ ^ 2608. av_log(s, AV_LOG_ERROR, "Too many streams\n"); 2609. return NULL; libavformat/utils.c:2608:9: Skipping av_log(): empty list of specs 2606. #if FF_API_MAX_STREAMS 2607. if (s->nb_streams >= MAX_STREAMS){ 2608. av_log(s, AV_LOG_ERROR, "Too many streams\n"); ^ 2609. return NULL; 2610. } libavformat/utils.c:2609:9: 2607. if (s->nb_streams >= MAX_STREAMS){ 2608. av_log(s, AV_LOG_ERROR, "Too many streams\n"); 2609. return NULL; ^ 2610. } 2611. #else libavformat/utils.c:2658:1: return from a call to av_new_stream 2656. s->streams[s->nb_streams++] = st; 2657. return st; 2658. } ^ 2659. 2660. AVProgram *av_new_program(AVFormatContext *ac, int id) ffmpeg.c:3598:10: Taking true branch 3596. 3597. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); 3598. if (!st) { ^ 3599. fprintf(stderr, "Could not alloc stream\n"); 3600. ffmpeg_exit(1); ffmpeg.c:3599:9: 3597. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); 3598. if (!st) { 3599. fprintf(stderr, "Could not alloc stream\n"); ^ 3600. ffmpeg_exit(1); 3601. } ffmpeg.c:3600:9: Skipping ffmpeg_exit(): empty list of specs 3598. if (!st) { 3599. fprintf(stderr, "Could not alloc stream\n"); 3600. ffmpeg_exit(1); ^ 3601. } 3602. ost = new_output_stream(oc, file_idx); ffmpeg.c:3602:5: Skipping new_output_stream(): empty list of specs 3600. ffmpeg_exit(1); 3601. } 3602. ost = new_output_stream(oc, file_idx); ^ 3603. subtitle_enc = st->codec; 3604. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); ffmpeg.c:3603:5: 3601. } 3602. ost = new_output_stream(oc, file_idx); 3603. subtitle_enc = st->codec; ^ 3604. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); 3605. if(!subtitle_stream_copy){
https://github.com/libav/libav/blob/2d777bb7a20041ac0564ffef85bf40619af8ccd1/ffmpeg.c/#L3603
d2a_code_trace_data_43856
static inline uint64_t get_val(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1); bc->bits >>= n; #else uint64_t ret = bc->bits >> (64 - n); bc->bits <<= n; #endif bc->bits_left -= n; return ret; } libavcodec/mpc7.c:92: error: Integer Overflow L2 ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`. libavcodec/mpc7.c:91:5: Call 89. return -1; 90. } 91. bitstream_skip(&bc, 88); ^ 92. c->gapless = bitstream_read_bit(&bc); 93. c->lastframelen = bitstream_read(&bc, 11); libavcodec/bitstream.h:241:1: Parameter `n` 239. 240. /* Skip n bits in the buffer. */ 241. static inline void bitstream_skip(BitstreamContext *bc, unsigned n) ^ 242. { 243. if (n <= bc->bits_left) libavcodec/bitstream.h:244:9: Call 242. { 243. if (n <= bc->bits_left) 244. skip_remaining(bc, n); ^ 245. else { 246. n -= bc->bits_left; libavcodec/bitstream.h:230:1: Parameter `n` 228. } 229. 230. static inline void skip_remaining(BitstreamContext *bc, unsigned n) ^ 231. { 232. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:237:5: Assignment 235. bc->bits <<= n; 236. #endif 237. bc->bits_left -= n; ^ 238. } 239. libavcodec/mpc7.c:92:23: Call 90. } 91. bitstream_skip(&bc, 88); 92. c->gapless = bitstream_read_bit(&bc); ^ 93. c->lastframelen = bitstream_read(&bc, 11); 94. av_log(avctx, AV_LOG_DEBUG, "IS: %d, MSS: %d, TG: %d, LFL: %d, bands: %d\n", libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
d2a_code_trace_data_43857
static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) { unsigned int crc; unsigned char packet[TS_PACKET_SIZE]; const unsigned char *buf_ptr; unsigned char *q; int first, b, len1, left; crc = bswap_32(av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, buf, len - 4)); buf[len - 4] = (crc >> 24) & 0xff; buf[len - 3] = (crc >> 16) & 0xff; buf[len - 2] = (crc >> 8) & 0xff; buf[len - 1] = (crc) & 0xff; buf_ptr = buf; while (len > 0) { first = (buf == buf_ptr); q = packet; *q++ = 0x47; b = (s->pid >> 8); if (first) b |= 0x40; *q++ = b; *q++ = s->pid; s->cc = (s->cc + 1) & 0xf; *q++ = 0x10 | s->cc; if (first) *q++ = 0; len1 = TS_PACKET_SIZE - (q - packet); if (len1 > len) len1 = len; memcpy(q, buf_ptr, len1); q += len1; left = TS_PACKET_SIZE - (q - packet); if (left > 0) memset(q, 0xff, left); s->write_packet(s, packet); buf_ptr += len1; len -= len1; } } libavformat/mpegtsenc.c:330: error: Buffer Overrun L2 Offset added: [5, 189] (⇐ [4, 5] + [1, 184]) Size: 188 by call to `mpegts_write_section1`. libavformat/mpegtsenc.c:296:1: Array declaration 294. } 295. 296. static void mpegts_write_sdt(AVFormatContext *s) ^ 297. { 298. MpegTSWrite *ts = s->priv_data; libavformat/mpegtsenc.c:330:5: Call 328. desc_list_len_ptr[1] = val; 329. } 330. mpegts_write_section1(&ts->sdt, SDT_TID, ts->tsid, 0, 0, 0, ^ 331. data, q - data); 332. } libavformat/mpegtsenc.c:93:1: Parameter `len` 91. } 92. 93. static int mpegts_write_section1(MpegTSSection *s, int tid, int id, ^ 94. int version, int sec_num, int last_sec_num, 95. uint8_t *buf, int len) libavformat/mpegtsenc.c:100:5: Assignment 98. unsigned int tot_len; 99. 100. tot_len = 3 + 5 + len + 4; ^ 101. /* check if not too big */ 102. if (tot_len > 1024) libavformat/mpegtsenc.c:114:5: Call 112. memcpy(q, buf, len); 113. 114. mpegts_write_section(s, section, tot_len); ^ 115. return 0; 116. } libavformat/mpegtsenc.c:38:1: <Offset trace> 36. 37. /* NOTE: 4 bytes must be left at the end for the crc32 */ 38. static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) ^ 39. { 40. unsigned int crc; libavformat/mpegtsenc.c:38:1: Parameter `len` 36. 37. /* NOTE: 4 bytes must be left at the end for the crc32 */ 38. static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) ^ 39. { 40. unsigned int crc; libavformat/mpegtsenc.c:38:1: <Length trace> 36. 37. /* NOTE: 4 bytes must be left at the end for the crc32 */ 38. static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) ^ 39. { 40. unsigned int crc; libavformat/mpegtsenc.c:38:1: Array declaration 36. 37. /* NOTE: 4 bytes must be left at the end for the crc32 */ 38. static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) ^ 39. { 40. unsigned int crc; libavformat/mpegtsenc.c:56:9: Assignment 54. while (len > 0) { 55. first = (buf == buf_ptr); 56. q = packet; ^ 57. *q++ = 0x47; 58. b = (s->pid >> 8); libavformat/mpegtsenc.c:57:10: Assignment 55. first = (buf == buf_ptr); 56. q = packet; 57. *q++ = 0x47; ^ 58. b = (s->pid >> 8); 59. if (first) libavformat/mpegtsenc.c:61:10: Assignment 59. if (first) 60. b |= 0x40; 61. *q++ = b; ^ 62. *q++ = s->pid; 63. s->cc = (s->cc + 1) & 0xf; libavformat/mpegtsenc.c:62:10: Assignment 60. b |= 0x40; 61. *q++ = b; 62. *q++ = s->pid; ^ 63. s->cc = (s->cc + 1) & 0xf; 64. *q++ = 0x10 | s->cc; libavformat/mpegtsenc.c:64:10: Assignment 62. *q++ = s->pid; 63. s->cc = (s->cc + 1) & 0xf; 64. *q++ = 0x10 | s->cc; ^ 65. if (first) 66. *q++ = 0; /* 0 offset */ libavformat/mpegtsenc.c:70:9: Array access: Offset added: [5, 189] (⇐ [4, 5] + [1, 184]) Size: 188 by call to `mpegts_write_section1` 68. if (len1 > len) 69. len1 = len; 70. memcpy(q, buf_ptr, len1); ^ 71. q += len1; 72. /* add known padding data */
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/mpegtsenc.c/#L70
d2a_code_trace_data_43858
char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; int i; int n, lold, l, l1, l2, num, j, type; const char *s; char *p; unsigned char *q; BUF_MEM *b = NULL; static const char hex[17] = "0123456789ABCDEF"; int gs_doit[4]; char tmp_buf[80]; #ifdef CHARSET_EBCDIC unsigned char ebcdic_buf[1024]; #endif if (buf == NULL) { if ((b = BUF_MEM_new()) == NULL) goto err; if (!BUF_MEM_grow(b, 200)) goto err; b->data[0] = '\0'; len = 200; } else if (len == 0) { return NULL; } if (a == NULL) { if (b) { buf = b->data; OPENSSL_free(b); } strncpy(buf, "NO X509_NAME", len); buf[len - 1] = '\0'; return buf; } len--; l = 0; for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { ne = sk_X509_NAME_ENTRY_value(a->entries, i); n = OBJ_obj2nid(ne->object); if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) { i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object); s = tmp_buf; } l1 = strlen(s); type = ne->value->type; num = ne->value->length; if (num > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { ascii2ebcdic(ebcdic_buf, q, (num > (int)sizeof(ebcdic_buf)) ? (int)sizeof(ebcdic_buf) : num); q = ebcdic_buf; } #endif if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) { gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0; for (j = 0; j < num; j++) if (q[j] != 0) gs_doit[j & 3] = 1; if (gs_doit[0] | gs_doit[1] | gs_doit[2]) gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; else { gs_doit[0] = gs_doit[1] = gs_doit[2] = 0; gs_doit[3] = 1; } } else gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; for (l2 = j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; l2++; #ifndef CHARSET_EBCDIC if ((q[j] < ' ') || (q[j] > '~')) l2 += 3; #else if ((os_toascii[q[j]] < os_toascii[' ']) || (os_toascii[q[j]] > os_toascii['~'])) l2 += 3; #endif } lold = l; l += 1 + l1 + 1 + l2; if (l > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; p = &(b->data[lold]); } else if (l > len) { break; } else p = &(buf[lold]); *(p++) = '/'; memcpy(p, s, (unsigned int)l1); p += l1; *(p++) = '='; #ifndef CHARSET_EBCDIC q = ne->value->data; #endif for (j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; #ifndef CHARSET_EBCDIC n = q[j]; if ((n < ' ') || (n > '~')) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = n; #else n = os_toascii[q[j]]; if ((n < os_toascii[' ']) || (n > os_toascii['~'])) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = q[j]; #endif } *p = '\0'; } if (b != NULL) { p = b->data; OPENSSL_free(b); } else p = buf; if (i == 0) *p = '\0'; return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); end: BUF_MEM_free(b); return (NULL); } crypto/x509/x_name.c:536: error: BUFFER_OVERRUN_L3 Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace crypto/x509/x_name.c:536:9: Call 534. l = 80 - 2 - obase; 535. 536. b = X509_NAME_oneline(name, NULL, 0); ^ 537. if (!b) 538. return 0; crypto/x509/x509_obj.c:73:1: <Offset trace> 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: Parameter `len` 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: <Length trace> 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:73:1: Parameter `*buf` 71. #define NAME_ONELINE_MAX (1024 * 1024) 72. 73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) 74. { 75. X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:105:9: Array access: Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline` 103. } 104. strncpy(buf, "NO X509_NAME", len); 105. buf[len - 1] = '\0'; ^ 106. return buf; 107. }
https://github.com/openssl/openssl/blob/24c2cd3967ed23acc0bd31a3781c4525e2e42a2c/crypto/x509/x509_obj.c/#L105
d2a_code_trace_data_43859
void *lh_delete(_LHASH *lh, const void *data) { unsigned long hash; LHASH_NODE *nn,**rn; void *ret; lh->error=0; rn=getrn(lh,data,&hash); if (*rn == NULL) { lh->num_no_delete++; return(NULL); } else { nn= *rn; *rn=nn->next; ret=nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes))) contract(lh); return(ret); } ssl/s3_clnt.c:351: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_get_certificate_request`. Showing all 13 steps of the trace ssl/s3_clnt.c:183:1: Parameter `s->ctx->sessions->num_items` 181. ssl3_get_client_method) 182. 183. > int ssl3_connect(SSL *s) 184. { 185. BUF_MEM *buf=NULL; ssl/s3_clnt.c:351:8: Call 349. case SSL3_ST_CR_CERT_REQ_A: 350. case SSL3_ST_CR_CERT_REQ_B: 351. ret=ssl3_get_certificate_request(s); ^ 352. if (ret <= 0) goto end; 353. s->state=SSL3_ST_CR_SRVR_DONE_A; ssl/s3_clnt.c:1675:1: Parameter `s->ctx->sessions->num_items` 1673. } 1674. 1675. > int ssl3_get_certificate_request(SSL *s) 1676. { 1677. int ok,ret=0; ssl/s3_clnt.c:1704:3: Call 1702. if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_REQUEST) 1703. { 1704. ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE); ^ 1705. SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST,SSL_R_WRONG_MESSAGE_TYPE); 1706. goto err; ssl/s3_pkt.c:1425:1: Parameter `s->ctx->sessions->num_items` 1423. } 1424. 1425. > int ssl3_send_alert(SSL *s, int level, int desc) 1426. { 1427. /* Map tls/ssl alert value to correct one */ ssl/s3_pkt.c:1434:3: Call 1432. /* If a fatal one, remove from cache */ 1433. if ((level == 2) && (s->session != NULL)) 1434. SSL_CTX_remove_session(s->ctx,s->session); ^ 1435. 1436. s->s3->alert_dispatch=1; ssl/ssl_sess.c:658:1: Parameter `ctx->sessions->num_items` 656. } 657. 658. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 659. { 660. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:660:9: Call 658. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 659. { 660. return remove_session_lock(ctx, c, 1); ^ 661. } 662. ssl/ssl_sess.c:663:1: Parameter `ctx->sessions->num_items` 661. } 662. 663. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 664. { 665. SSL_SESSION *r; ssl/ssl_sess.c:674:6: Call 672. { 673. ret=1; 674. r=lh_SSL_SESSION_delete(ctx->sessions,c); ^ 675. SSL_SESSION_list_remove(ctx,c); 676. } crypto/lhash/lhash.c:217:1: <LHS trace> 215. } 216. 217. > void *lh_delete(_LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:217:1: Parameter `lh->num_items` 215. } 216. 217. > void *lh_delete(_LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:240:2: Binary operation: ([0, max(0, s->ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_get_certificate_request` 238. } 239. 240. lh->num_items--; ^ 241. if ((lh->num_nodes > MIN_NODES) && 242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
https://github.com/openssl/openssl/blob/173350bccaf25d6114a7108ccceabb974f125fa4/crypto/lhash/lhash.c/#L240
d2a_code_trace_data_43860
void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD *rec, size_t md_size) { #if defined(CBC_MAC_ROTATE_IN_PLACE) unsigned char rotated_mac_buf[64 + EVP_MAX_MD_SIZE]; unsigned char *rotated_mac; #else unsigned char rotated_mac[EVP_MAX_MD_SIZE]; #endif size_t mac_end = rec->length; size_t mac_start = mac_end - md_size; size_t in_mac; size_t scan_start = 0; size_t i, j; size_t rotate_offset; OPENSSL_assert(rec->orig_len >= md_size); OPENSSL_assert(md_size <= EVP_MAX_MD_SIZE); #if defined(CBC_MAC_ROTATE_IN_PLACE) rotated_mac = rotated_mac_buf + ((0 - (size_t)rotated_mac_buf) & 63); #endif if (rec->orig_len > md_size + 255 + 1) scan_start = rec->orig_len - (md_size + 255 + 1); in_mac = 0; rotate_offset = 0; memset(rotated_mac, 0, md_size); for (i = scan_start, j = 0; i < rec->orig_len; i++) { size_t mac_started = constant_time_eq_s(i, mac_start); size_t mac_ended = constant_time_lt_s(i, mac_end); unsigned char b = rec->data[i]; in_mac |= mac_started; in_mac &= mac_ended; rotate_offset |= j & mac_started; rotated_mac[j++] |= b & in_mac; j &= constant_time_lt_s(j, md_size); } #if defined(CBC_MAC_ROTATE_IN_PLACE) j = 0; for (i = 0; i < md_size; i++) { ((volatile unsigned char *)rotated_mac)[rotate_offset ^ 32]; out[j++] = rotated_mac[rotate_offset++]; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #else memset(out, 0, md_size); rotate_offset = md_size - rotate_offset; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); for (i = 0; i < md_size; i++) { for (j = 0; j < md_size; j++) out[j] |= rotated_mac[i] & constant_time_eq_8_s(j, rotate_offset); rotate_offset++; rotate_offset &= constant_time_lt_s(rotate_offset, md_size); } #endif } ssl/record/ssl3_record.c:545: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [256, 320]):unsigned64 by call to `ssl3_cbc_copy_mac`. Showing all 9 steps of the trace ssl/record/ssl3_record.c:257:29: Call 255. if (!PACKET_get_1(&pkt, &type) 256. || !PACKET_get_net_2(&pkt, &version) 257. || !PACKET_get_net_2_len(&pkt, &thisrr->length)) { ^ 258. al = SSL_AD_DECODE_ERROR; 259. SSLerr(SSL_F_SSL3_GET_RECORD, ERR_R_INTERNAL_ERROR); ssl/packet_locl.h:164:8: Parameter `*data` 162. 163. /* Same as PACKET_get_net_2() but for a size_t */ 164. __owur static ossl_inline int PACKET_get_net_2_len(PACKET *pkt, size_t *data) ^ 165. { 166. unsigned int i; ssl/record/ssl3_record.c:413:9: Assignment 411. /* decrypt in place in 'thisrr->input' */ 412. thisrr->data = thisrr->input; 413. thisrr->orig_len = thisrr->length; ^ 414. 415. /* Mark this record as not read by upper layers yet */ ssl/record/ssl3_record.c:545:17: Call 543. */ 544. mac = mac_tmp; 545. ssl3_cbc_copy_mac(mac_tmp, thisrr, mac_size); ^ 546. thisrr->length -= mac_size; 547. } else { ssl/record/ssl3_record.c:1407:1: <LHS trace> 1405. #define CBC_MAC_ROTATE_IN_PLACE 1406. 1407. > void ssl3_cbc_copy_mac(unsigned char *out, 1408. const SSL3_RECORD *rec, size_t md_size) 1409. { ssl/record/ssl3_record.c:1407:1: Parameter `md_size` 1405. #define CBC_MAC_ROTATE_IN_PLACE 1406. 1407. > void ssl3_cbc_copy_mac(unsigned char *out, 1408. const SSL3_RECORD *rec, size_t md_size) 1409. { ssl/record/ssl3_record.c:1407:1: <RHS trace> 1405. #define CBC_MAC_ROTATE_IN_PLACE 1406. 1407. > void ssl3_cbc_copy_mac(unsigned char *out, 1408. const SSL3_RECORD *rec, size_t md_size) 1409. { ssl/record/ssl3_record.c:1407:1: Parameter `md_size` 1405. #define CBC_MAC_ROTATE_IN_PLACE 1406. 1407. > void ssl3_cbc_copy_mac(unsigned char *out, 1408. const SSL3_RECORD *rec, size_t md_size) 1409. { ssl/record/ssl3_record.c:1440:9: Binary operation: ([0, +oo] - [256, 320]):unsigned64 by call to `ssl3_cbc_copy_mac` 1438. /* This information is public so it's safe to branch based on it. */ 1439. if (rec->orig_len > md_size + 255 + 1) 1440. scan_start = rec->orig_len - (md_size + 255 + 1); ^ 1441. 1442. in_mac = 0;
https://github.com/openssl/openssl/blob/ffbaf06ade6dab6a0805a24087cf2e84c5db8d43/ssl/record/ssl3_record.c/#L1440
d2a_code_trace_data_43861
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/rsa/rsa_ossl.c:888: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_mont`. Showing all 74 steps of the trace crypto/rsa/rsa_ossl.c:591:1: Parameter `ctx->stack.depth` 589. } 590. 591. > static int rsa_ossl_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) 592. { 593. BIGNUM *r1, *m1, *vrfy, *r2, *m[RSA_MAX_PRIME_NUM - 2]; crypto/rsa/rsa_ossl.c:597:5: Call 595. RSA_PRIME_INFO *pinfo; 596. 597. BN_CTX_start(ctx); ^ 598. 599. r1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/rsa/rsa_ossl.c:599:10: Call 597. BN_CTX_start(ctx); 598. 599. r1 = BN_CTX_get(ctx); ^ 600. r2 = BN_CTX_get(ctx); 601. m1 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_ossl.c:600:10: Call 598. 599. r1 = BN_CTX_get(ctx); 600. r2 = BN_CTX_get(ctx); ^ 601. m1 = BN_CTX_get(ctx); 602. vrfy = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_ossl.c:601:10: Call 599. r1 = BN_CTX_get(ctx); 600. r2 = BN_CTX_get(ctx); 601. m1 = BN_CTX_get(ctx); ^ 602. vrfy = BN_CTX_get(ctx); 603. if (vrfy == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_ossl.c:602:12: Call 600. r2 = BN_CTX_get(ctx); 601. m1 = BN_CTX_get(ctx); 602. vrfy = BN_CTX_get(ctx); ^ 603. if (vrfy == NULL) 604. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/rsa/rsa_ossl.c:701:14: Call 699. BN_with_flags(c, I, BN_FLG_CONSTTIME); 700. 701. if (!BN_mod(r1, c, rsa->q, ctx)) { ^ 702. BN_free(c); 703. goto err; crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/rsa/rsa_ossl.c:726:14: Call 724. 725. /* compute I mod p */ 726. if (!BN_mod(r1, c, rsa->p, ctx)) { ^ 727. BN_free(c); 728. goto err; crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/rsa/rsa_ossl.c:810:10: Call 808. goto err; 809. 810. if (!BN_mul(r1, r0, rsa->iqmp, ctx)) ^ 811. goto err; 812. crypto/bn/bn_mul.c:497:1: Parameter `ctx->stack.depth` 495. #endif /* BN_RECURSION */ 496. 497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = bn_mul_fixed_top(r, a, b, ctx); crypto/bn/bn_mul.c:499:15: Call 497. int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = bn_mul_fixed_top(r, a, b, ctx); ^ 500. 501. bn_correct_top(r); crypto/bn/bn_mul.c:507:1: Parameter `ctx->stack.depth` 505. } 506. 507. > int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 508. { 509. int ret = 0; crypto/rsa/rsa_ossl.c:819:14: Call 817. BN_with_flags(pr1, r1, BN_FLG_CONSTTIME); 818. 819. if (!BN_mod(r0, pr1, rsa->p, ctx)) { ^ 820. BN_free(pr1); 821. goto err; crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/rsa/rsa_ossl.c:837:10: Call 835. if (!BN_add(r0, r0, rsa->p)) 836. goto err; 837. if (!BN_mul(r1, r0, rsa->q, ctx)) ^ 838. goto err; 839. if (!BN_add(r0, r1, m1)) crypto/bn/bn_mul.c:497:1: Parameter `ctx->stack.depth` 495. #endif /* BN_RECURSION */ 496. 497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = bn_mul_fixed_top(r, a, b, ctx); crypto/bn/bn_mul.c:499:15: Call 497. int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 498. { 499. int ret = bn_mul_fixed_top(r, a, b, ctx); ^ 500. 501. bn_correct_top(r); crypto/bn/bn_mul.c:507:1: Parameter `ctx->stack.depth` 505. } 506. 507. > int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 508. { 509. int ret = 0; crypto/rsa/rsa_ossl.c:888:18: Call 886. if (rsa->e && rsa->n) { 887. if (rsa->meth->bn_mod_exp == BN_mod_exp_mont) { 888. if (!BN_mod_exp_mont(vrfy, r0, rsa->e, rsa->n, ctx, ^ 889. rsa->_method_mod_n)) 890. goto err; crypto/bn/bn_exp.c:296:1: Parameter `ctx->stack.depth` 294. } 295. 296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 298. { crypto/bn/bn_exp.c:310:16: Call 308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) { 310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 311. } 312. crypto/bn/bn_exp.c:592:1: Parameter `ctx->stack.depth` 590. * http://www.daemonology.net/hyperthreading-considered-harmful/) 591. */ 592. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 593. const BIGNUM *m, BN_CTX *ctx, 594. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:636:5: Call 634. } 635. 636. BN_CTX_start(ctx); ^ 637. 638. /* crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_exp.c:647:14: Call 645. if ((mont = BN_MONT_CTX_new()) == NULL) 646. goto err; 647. if (!BN_MONT_CTX_set(mont, m, ctx)) ^ 648. goto err; 649. } crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth` 261. } 262. 263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 264. { 265. int i, ret = 0; crypto/bn/bn_mont.c:271:5: Call 269. return 0; 270. 271. BN_CTX_start(ctx); ^ 272. if ((Ri = BN_CTX_get(ctx)) == NULL) 273. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mont.c:272:15: Call 270. 271. BN_CTX_start(ctx); 272. if ((Ri = BN_CTX_get(ctx)) == NULL) ^ 273. goto err; 274. R = &(mont->RR); /* grab RR as a temp */ crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mont.c:351:19: Call 349. if (BN_is_one(&tmod)) 350. BN_zero(Ri); 351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 352. goto err; 353. if (!BN_lshift(Ri, Ri, BN_BITS2)) crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth` 122. BN_CTX *ctx); 123. 124. > BIGNUM *BN_mod_inverse(BIGNUM *in, 125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 126. { crypto/bn/bn_gcd.c:129:10: Call 127. BIGNUM *rv; 128. int noinv; 129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 130. if (noinv) 131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth` 133. } 134. 135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 137. int *pnoinv) crypto/bn/bn_gcd.c:155:16: Call 153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 155. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 156. } 157. crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth` 456. * not contain branches that may leak sensitive information. 457. */ 458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 459. const BIGNUM *a, const BIGNUM *n, 460. BN_CTX *ctx) crypto/bn/bn_gcd.c:469:5: Call 467. bn_check_top(n); 468. 469. BN_CTX_start(ctx); ^ 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_gcd.c:470:9: Call 468. 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); ^ 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:471:9: Call 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); ^ 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:472:9: Call 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); ^ 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:473:9: Call 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); ^ 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:474:9: Call 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); ^ 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:475:9: Call 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); ^ 476. T = BN_CTX_get(ctx); 477. if (T == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:476:9: Call 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); ^ 477. if (T == NULL) 478. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:504:18: Call 502. bn_init(&local_B); 503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 504. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 505. goto err; 506. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_mont` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43862
static const u_char * ngx_sha1_body(ngx_sha1_t *ctx, const u_char *data, size_t size) { uint32_t a, b, c, d, e, temp; uint32_t saved_a, saved_b, saved_c, saved_d, saved_e; uint32_t words[80]; ngx_uint_t i; const u_char *p; p = data; a = ctx->a; b = ctx->b; c = ctx->c; d = ctx->d; e = ctx->e; do { saved_a = a; saved_b = b; saved_c = c; saved_d = d; saved_e = e; for (i = 0; i < 16; i++) { words[i] = GET(i); } for (i = 16; i < 80; i++) { words[i] = ROTATE(1, words[i - 3] ^ words[i - 8] ^ words[i - 14] ^ words[i - 16]); } STEP(F1, a, b, c, d, e, words[0], 0x5a827999); STEP(F1, a, b, c, d, e, words[1], 0x5a827999); STEP(F1, a, b, c, d, e, words[2], 0x5a827999); STEP(F1, a, b, c, d, e, words[3], 0x5a827999); STEP(F1, a, b, c, d, e, words[4], 0x5a827999); STEP(F1, a, b, c, d, e, words[5], 0x5a827999); STEP(F1, a, b, c, d, e, words[6], 0x5a827999); STEP(F1, a, b, c, d, e, words[7], 0x5a827999); STEP(F1, a, b, c, d, e, words[8], 0x5a827999); STEP(F1, a, b, c, d, e, words[9], 0x5a827999); STEP(F1, a, b, c, d, e, words[10], 0x5a827999); STEP(F1, a, b, c, d, e, words[11], 0x5a827999); STEP(F1, a, b, c, d, e, words[12], 0x5a827999); STEP(F1, a, b, c, d, e, words[13], 0x5a827999); STEP(F1, a, b, c, d, e, words[14], 0x5a827999); STEP(F1, a, b, c, d, e, words[15], 0x5a827999); STEP(F1, a, b, c, d, e, words[16], 0x5a827999); STEP(F1, a, b, c, d, e, words[17], 0x5a827999); STEP(F1, a, b, c, d, e, words[18], 0x5a827999); STEP(F1, a, b, c, d, e, words[19], 0x5a827999); STEP(F2, a, b, c, d, e, words[20], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[21], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[22], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[23], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[24], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[25], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[26], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[27], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[28], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[29], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[30], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[31], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[32], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[33], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[34], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[35], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[36], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[37], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[38], 0x6ed9eba1); STEP(F2, a, b, c, d, e, words[39], 0x6ed9eba1); STEP(F3, a, b, c, d, e, words[40], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[41], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[42], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[43], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[44], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[45], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[46], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[47], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[48], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[49], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[50], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[51], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[52], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[53], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[54], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[55], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[56], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[57], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[58], 0x8f1bbcdc); STEP(F3, a, b, c, d, e, words[59], 0x8f1bbcdc); STEP(F2, a, b, c, d, e, words[60], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[61], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[62], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[63], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[64], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[65], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[66], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[67], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[68], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[69], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[70], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[71], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[72], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[73], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[74], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[75], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[76], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[77], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[78], 0xca62c1d6); STEP(F2, a, b, c, d, e, words[79], 0xca62c1d6); a += saved_a; b += saved_b; c += saved_c; d += saved_d; e += saved_e; p += 64; } while (size -= 64); ctx->a = a; ctx->b = b; ctx->c = c; ctx->d = d; ctx->e = e; return p; } src/core/ngx_sha1.c:273: error: Uninitialized Value The value read from words[_] was never initialized. src/core/ngx_sha1.c:273:9: 271. STEP(F2, a, b, c, d, e, words[75], 0xca62c1d6); 272. STEP(F2, a, b, c, d, e, words[76], 0xca62c1d6); 273. STEP(F2, a, b, c, d, e, words[77], 0xca62c1d6); ^ 274. STEP(F2, a, b, c, d, e, words[78], 0xca62c1d6); 275. STEP(F2, a, b, c, d, e, words[79], 0xca62c1d6);
https://github.com/nginx/nginx/blob/70f7141074896fb1ff3e5fc08407ea0f64f2076b/src/core/ngx_sha1.c/#L273
d2a_code_trace_data_43863
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; if (pkt->buf->length > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = (pkt->buf->length == 0) ? DEFAULT_BUF_SIZE : pkt->buf->length * 2; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; pkt->written += len; pkt->curr += len; return 1; } ssl/t1_lib.c:1043: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 4]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 12 steps of the trace ssl/t1_lib.c:1042:14: Call 1040. /* Add RI if renegotiating */ 1041. if (s->renegotiate) { 1042. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate) ^ 1043. || !WPACKET_sub_memcpy_u16(pkt, s->s3->previous_client_finished, 1044. s->s3->previous_client_finished_len)) { ssl/packet.c:238:1: Parameter `pkt->buf->length` 236. } 237. 238. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 239. { 240. unsigned char *data; ssl/t1_lib.c:1043:21: Call 1041. if (s->renegotiate) { 1042. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_renegotiate) 1043. || !WPACKET_sub_memcpy_u16(pkt, s->s3->previous_client_finished, ^ 1044. s->s3->previous_client_finished_len)) { 1045. SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); ssl/packet.c:294:1: Parameter `pkt->written` 292. } 293. 294. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len, 295. size_t lenbytes) 296. { ssl/packet.c:297:10: Call 295. size_t lenbytes) 296. { 297. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 298. || !WPACKET_memcpy(pkt, src, len) 299. || !WPACKET_close(pkt)) ssl/packet.c:201:1: Parameter `pkt->written` 199. } 200. 201. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 202. { 203. WPACKET_SUB *sub; ssl/packet.c:225:10: Call 223. } 224. 225. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 226. return 0; 227. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */ ssl/packet.c:15:1: <LHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `pkt->buf->length` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: <RHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `len` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:25:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 4]):unsigned64 by call to `WPACKET_sub_memcpy__` 23. return 0; 24. 25. if (pkt->buf->length - pkt->written < len) { ^ 26. size_t newlen; 27.
https://github.com/openssl/openssl/blob/84d5549e692e63a16fa1b11603e4098fc31746e9/ssl/packet.c/#L25
d2a_code_trace_data_43864
static int decode_audio_specific_config(AACContext *ac, AVCodecContext *avctx, MPEG4AudioConfig *m4ac, const uint8_t *data, int data_size) { GetBitContext gb; int i; init_get_bits(&gb, data, data_size * 8); if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) return -1; if (m4ac->sampling_index > 12) { av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index); return -1; } if (m4ac->sbr == 1 && m4ac->ps == -1) m4ac->ps = 1; skip_bits_long(&gb, i); switch (m4ac->object_type) { case AOT_AAC_MAIN: case AOT_AAC_LC: if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config)) return -1; break; default: av_log(avctx, AV_LOG_ERROR, "Audio object type %s%d is not supported.\n", m4ac->sbr == 1? "SBR+" : "", m4ac->object_type); return -1; } return get_bits_count(&gb); } libavcodec/aacdec.c:481: error: Null Dereference pointer `&gb->buffer` last assigned on line 465 could be null and is dereferenced by call to `decode_ga_specific_config()` at line 481, column 13. libavcodec/aacdec.c:457:1: start of procedure decode_audio_specific_config() 455. * @return Returns error status or number of consumed bits. <0 - error 456. */ 457. static int decode_audio_specific_config(AACContext *ac, ^ 458. AVCodecContext *avctx, 459. MPEG4AudioConfig *m4ac, libavcodec/aacdec.c:465:5: 463. int i; 464. 465. init_get_bits(&gb, data, data_size * 8); ^ 466. 467. if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) libavcodec/get_bits.h:391:1: start of procedure init_get_bits() 389. * responsible for checking for the buffer end yourself (take advantage of the padding)! 390. */ 391. static inline void init_get_bits(GetBitContext *s, ^ 392. const uint8_t *buffer, int bit_size) 393. { libavcodec/get_bits.h:394:5: 392. const uint8_t *buffer, int bit_size) 393. { 394. int buffer_size = (bit_size+7)>>3; ^ 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; libavcodec/get_bits.h:395:9: Taking true branch 393. { 394. int buffer_size = (bit_size+7)>>3; 395. if (buffer_size < 0 || bit_size < 0) { ^ 396. buffer_size = bit_size = 0; 397. buffer = NULL; libavcodec/get_bits.h:396:9: 394. int buffer_size = (bit_size+7)>>3; 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; ^ 397. buffer = NULL; 398. } libavcodec/get_bits.h:397:9: 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; 397. buffer = NULL; ^ 398. } 399. libavcodec/get_bits.h:400:5: 398. } 399. 400. s->buffer = buffer; ^ 401. s->size_in_bits = bit_size; 402. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:401:5: 399. 400. s->buffer = buffer; 401. s->size_in_bits = bit_size; ^ 402. s->buffer_end = buffer + buffer_size; 403. #ifdef ALT_BITSTREAM_READER libavcodec/get_bits.h:402:5: 400. s->buffer = buffer; 401. s->size_in_bits = bit_size; 402. s->buffer_end = buffer + buffer_size; ^ 403. #ifdef ALT_BITSTREAM_READER 404. s->index = 0; libavcodec/get_bits.h:404:5: 402. s->buffer_end = buffer + buffer_size; 403. #ifdef ALT_BITSTREAM_READER 404. s->index = 0; ^ 405. #elif defined A32_BITSTREAM_READER 406. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3); libavcodec/get_bits.h:410:1: return from a call to init_get_bits 408. skip_bits_long(s, 0); 409. #endif 410. } ^ 411. 412. static inline void align_get_bits(GetBitContext *s) libavcodec/aacdec.c:467:9: Taking false branch 465. init_get_bits(&gb, data, data_size * 8); 466. 467. if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) ^ 468. return -1; 469. if (m4ac->sampling_index > 12) { libavcodec/aacdec.c:469:9: Taking false branch 467. if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) 468. return -1; 469. if (m4ac->sampling_index > 12) { ^ 470. av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index); 471. return -1; libavcodec/aacdec.c:473:9: Taking true branch 471. return -1; 472. } 473. if (m4ac->sbr == 1 && m4ac->ps == -1) ^ 474. m4ac->ps = 1; 475. libavcodec/aacdec.c:473:27: Taking false branch 471. return -1; 472. } 473. if (m4ac->sbr == 1 && m4ac->ps == -1) ^ 474. m4ac->ps = 1; 475. libavcodec/aacdec.c:476:5: 474. m4ac->ps = 1; 475. 476. skip_bits_long(&gb, i); ^ 477. 478. switch (m4ac->object_type) { libavcodec/get_bits.h:173:1: start of procedure skip_bits_long() 171. } 172. 173. static inline void skip_bits_long(GetBitContext *s, int n){ ^ 174. s->index += n; 175. } libavcodec/get_bits.h:174:5: 172. 173. static inline void skip_bits_long(GetBitContext *s, int n){ 174. s->index += n; ^ 175. } 176. libavcodec/get_bits.h:175:1: return from a call to skip_bits_long 173. static inline void skip_bits_long(GetBitContext *s, int n){ 174. s->index += n; 175. } ^ 176. 177. #elif defined A32_BITSTREAM_READER libavcodec/aacdec.c:478:5: 476. skip_bits_long(&gb, i); 477. 478. switch (m4ac->object_type) { ^ 479. case AOT_AAC_MAIN: 480. case AOT_AAC_LC: libavcodec/aacdec.c:479:5: Switch condition is true. Entering switch case 477. 478. switch (m4ac->object_type) { 479. case AOT_AAC_MAIN: ^ 480. case AOT_AAC_LC: 481. if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config)) libavcodec/aacdec.c:481:13: 479. case AOT_AAC_MAIN: 480. case AOT_AAC_LC: 481. if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config)) ^ 482. return -1; 483. break;
https://github.com/libav/libav/blob/87e4d9b252bc6fa3b982f7050013069c9dc3e05b/libavcodec/aacdec.c/#L481
d2a_code_trace_data_43865
static int expand(OPENSSL_LHASH *lh) { OPENSSL_LH_NODE **n, **n1, **n2, *np; unsigned int p, pmax, nni, j; unsigned long hash; nni = lh->num_alloc_nodes; p = lh->p; pmax = lh->pmax; if (p + 1 >= pmax) { j = nni * 2; n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j); if (n == NULL) { lh->error++; return 0; } lh->b = n; memset(n + nni, 0, sizeof(*n) * (j - nni)); lh->pmax = nni; lh->num_alloc_nodes = j; lh->num_expand_reallocs++; lh->p = 0; } else { lh->p++; } lh->num_nodes++; lh->num_expands++; n1 = &(lh->b[p]); n2 = &(lh->b[p + pmax]); *n2 = NULL; for (np = *n1; np != NULL;) { hash = np->hash; if ((hash % nni) != p) { *n1 = (*n1)->next; np->next = *n2; *n2 = np; } else n1 = &((*n1)->next); np = *n1; } return 1; } test/sslapitest.c:3864: error: BUFFER_OVERRUN_L3 Offset added: [272, +oo] (⇐ [16, +oo] + [256, +oo]) Size: [1, +oo] by call to `TXT_DB_insert`. Showing all 24 steps of the trace test/sslapitest.c:3840:12: Call 3838. goto end; 3839. 3840. gNid = SRP_create_verifier(userid, password, &row[DB_srpsalt], ^ 3841. &row[DB_srpverifier], NULL, NULL); 3842. if (!TEST_ptr(gNid)) crypto/srp/srp_vfy.c:621:10: Call 619. } 620. 621. if (!SRP_create_verifier_BN(user, pass, &s, &v, N_bn, g_bn)) ^ 622. goto err; 623. crypto/srp/srp_vfy.c:687:9: Call 685. } 686. 687. x = SRP_Calc_x(salttmp, user, pass); ^ 688. 689. *verifier = BN_new(); crypto/srp/srp_lib.c:135:10: Call 133. goto err; 134. 135. if (!EVP_DigestInit_ex(ctxt, EVP_sha1(), NULL) ^ 136. || !EVP_DigestUpdate(ctxt, user, strlen(user)) 137. || !EVP_DigestUpdate(ctxt, ":", 1) crypto/evp/digest.c:88:20: Call 86. } else { 87. /* Ask if an ENGINE is reserved for this job */ 88. impl = ENGINE_get_digest_engine(type->type); ^ 89. } 90. if (impl != NULL) { crypto/engine/tb_digest.c:65:12: Call 63. ENGINE *ENGINE_get_digest_engine(int nid) 64. { 65. return engine_table_select(&digest_table, nid); ^ 66. } 67. crypto/engine/eng_table.c:216:10: Call 214. * operations. But don't worry about a fprintf(stderr). 215. */ 216. if (!int_table_check(table, 0)) ^ 217. goto end; 218. tmplate.nid = nid; crypto/engine/eng_table.c:72:15: Call 70. if (!create) 71. return 0; 72. if ((lh = lh_ENGINE_PILE_new(engine_pile_hash, engine_pile_cmp)) == NULL) ^ 73. return 0; 74. *t = (ENGINE_TABLE *)lh; crypto/engine/eng_int.h:173:1: Call 171. typedef struct st_engine_pile ENGINE_PILE; 172. 173. > DEFINE_LHASH_OF(ENGINE_PILE); 174. 175. #ifdef __cplusplus crypto/lhash/lhash.c:55:5: Assignment 53. ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h); 54. ret->num_nodes = MIN_NODES / 2; 55. ret->num_alloc_nodes = MIN_NODES; ^ 56. ret->pmax = MIN_NODES / 2; 57. ret->up_load = UP_LOAD; test/sslapitest.c:3864:17: Call 3862. || !TEST_ptr(row[DB_srptype]) 3863. || !TEST_ptr(row[DB_srpgN]) 3864. || !TEST_true(TXT_DB_insert(db, row))) ^ 3865. goto end; 3866. crypto/txt_db/txt_db.c:237:1: Parameter `(*db->index)->num_alloc_nodes` 235. } 236. 237. > int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *row) 238. { 239. int i; crypto/txt_db/txt_db.c:260:19: Call 258. if ((db->qual[i] != NULL) && (db->qual[i] (row) == 0)) 259. continue; 260. (void)lh_OPENSSL_STRING_insert(db->index[i], row); ^ 261. if (lh_OPENSSL_STRING_retrieve(db->index[i], row) == NULL) 262. goto err1; include/openssl/lhash.h:197:1: Parameter `lh->num_alloc_nodes` 195. LHASH_OF(type) 196. 197. > DEFINE_LHASH_OF(OPENSSL_STRING); 198. # ifdef _MSC_VER 199. /* include/openssl/lhash.h:197:1: Call 195. LHASH_OF(type) 196. 197. > DEFINE_LHASH_OF(OPENSSL_STRING); 198. # ifdef _MSC_VER 199. /* crypto/lhash/lhash.c:87:1: Parameter `lh->num_alloc_nodes` 85. } 86. 87. > void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data) 88. { 89. unsigned long hash; crypto/lhash/lhash.c:94:77: Call 92. 93. lh->error = 0; 94. if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh)) ^ 95. return NULL; /* 'lh->error++' already done in 'expand' */ 96. crypto/lhash/lhash.c:203:1: <Offset trace> 201. } 202. 203. > static int expand(OPENSSL_LHASH *lh) 204. { 205. OPENSSL_LH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:203:1: Parameter `lh->num_alloc_nodes` 201. } 202. 203. > static int expand(OPENSSL_LHASH *lh) 204. { 205. OPENSSL_LH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:209:5: Assignment 207. unsigned long hash; 208. 209. nni = lh->num_alloc_nodes; ^ 210. p = lh->p; 211. pmax = lh->pmax; crypto/lhash/lhash.c:203:1: <Length trace> 201. } 202. 203. > static int expand(OPENSSL_LHASH *lh) 204. { 205. OPENSSL_LH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:203:1: Parameter `lh->num_alloc_nodes` 201. } 202. 203. > static int expand(OPENSSL_LHASH *lh) 204. { 205. OPENSSL_LH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:209:5: Assignment 207. unsigned long hash; 208. 209. nni = lh->num_alloc_nodes; ^ 210. p = lh->p; 211. pmax = lh->pmax; crypto/lhash/lhash.c:220:9: Array access: Offset added: [272, +oo] (⇐ [16, +oo] + [256, +oo]) Size: [1, +oo] by call to `TXT_DB_insert` 218. } 219. lh->b = n; 220. memset(n + nni, 0, sizeof(*n) * (j - nni)); ^ 221. lh->pmax = nni; 222. lh->num_alloc_nodes = j;
https://github.com/openssl/openssl/blob/a8ca496ddb532d7f7dc356fd2b026697388d2384/crypto/lhash/lhash.c/#L220
d2a_code_trace_data_43866
static av_always_inline void put_qscale(MpegEncContext *s) { if(s->q_scale_type){ assert(s->qscale>=1 && s->qscale <=12); put_bits(&s->pb, 5, inv_non_linear_qscale[s->qscale]); }else{ put_bits(&s->pb, 5, s->qscale); } } libavcodec/mpegvideo_enc.c:1713: error: Buffer Overrun L2 Offset: [min(1, `s->qscale`), max(31, `s->qscale`)] Size: 13 by call to `mpeg1_encode_mb`. libavcodec/mpegvideo_enc.c:1457:1: Parameter `s->qscale` 1455. } 1456. 1457. static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count) ^ 1458. { 1459. int16_t weight[8][64]; libavcodec/mpegvideo_enc.c:1713:13: Call 1711. case CODEC_ID_MPEG2VIDEO: 1712. if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) 1713. mpeg1_encode_mb(s, s->block, motion_x, motion_y); ^ 1714. break; 1715. case CODEC_ID_MPEG4: libavcodec/mpeg12enc.c:660:1: Parameter `s->qscale` 658. } 659. 660. void mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y) ^ 661. { 662. if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6); libavcodec/mpeg12enc.c:663:41: Call 661. { 662. if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6); 663. else mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8); ^ 664. } 665. libavcodec/mpeg12enc.c:435:1: Parameter `s->qscale` 433. } 434. 435. static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, ^ 436. DCTELEM block[6][64], 437. int motion_x, int motion_y, libavcodec/mpeg12enc.c:477:17: Call 475. if(s->dquant && cbp){ 476. put_mb_modes(s, 2, 1, 0, 0); /* macroblock_type : macroblock_quant = 1 */ 477. put_qscale(s); ^ 478. }else{ 479. put_mb_modes(s, 1, 1, 0, 0); /* macroblock_type : macroblock_quant = 0 */ libavcodec/mpeg12enc.c:319:1: <Offset trace> 317. } 318. 319. static av_always_inline void put_qscale(MpegEncContext *s) ^ 320. { 321. if(s->q_scale_type){ libavcodec/mpeg12enc.c:319:1: Parameter `s->qscale` 317. } 318. 319. static av_always_inline void put_qscale(MpegEncContext *s) ^ 320. { 321. if(s->q_scale_type){ libavcodec/mpeg12enc.c:37:1: <Length trace> 35. 36. 37. static const uint8_t inv_non_linear_qscale[13] = { ^ 38. 0, 2, 4, 6, 8, 39. 9,10,11,12,13,14,15,16, libavcodec/mpeg12enc.c:37:1: Array declaration 35. 36. 37. static const uint8_t inv_non_linear_qscale[13] = { ^ 38. 0, 2, 4, 6, 8, 39. 9,10,11,12,13,14,15,16, libavcodec/mpeg12enc.c:323:29: Array access: Offset: [min(1, s->qscale), max(31, s->qscale)] Size: 13 by call to `mpeg1_encode_mb` 321. if(s->q_scale_type){ 322. assert(s->qscale>=1 && s->qscale <=12); 323. put_bits(&s->pb, 5, inv_non_linear_qscale[s->qscale]); ^ 324. }else{ 325. put_bits(&s->pb, 5, s->qscale);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpeg12enc.c/#L323
d2a_code_trace_data_43867
static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) { RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; int size, i, err; char *content; char url[1024]; if (!ff_network_init()) return AVERROR(EIO); content = av_malloc(SDP_MAX_SIZE); size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1); if (size <= 0) { av_free(content); return AVERROR_INVALIDDATA; } content[size] ='\0'; ff_sdp_parse(s, content); av_free(content); for (i = 0; i < rt->nb_rtsp_streams; i++) { char namebuf[50]; rtsp_st = rt->rtsp_streams[i]; getnameinfo((struct sockaddr*) &rtsp_st->sdp_ip, sizeof(rtsp_st->sdp_ip), namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST); ff_url_join(url, sizeof(url), "rtp", NULL, namebuf, rtsp_st->sdp_port, "?localport=%d&ttl=%d", rtsp_st->sdp_port, rtsp_st->sdp_ttl); if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) { err = AVERROR_INVALIDDATA; goto fail; } if ((err = rtsp_open_transport_ctx(s, rtsp_st))) goto fail; } return 0; fail: ff_rtsp_close_streams(s); ff_network_close(); return err; } libavformat/rtsp.c:1673: error: Null Dereference pointer `content` last assigned on line 1667 could be null and is dereferenced at line 1673, column 5. libavformat/rtsp.c:1654:1: start of procedure sdp_read_header() 1652. } 1653. 1654. static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) ^ 1655. { 1656. RTSPState *rt = s->priv_data; libavformat/rtsp.c:1656:5: 1654. static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) 1655. { 1656. RTSPState *rt = s->priv_data; ^ 1657. RTSPStream *rtsp_st; 1658. int size, i, err; libavformat/rtsp.c:1662:10: 1660. char url[1024]; 1661. 1662. if (!ff_network_init()) ^ 1663. return AVERROR(EIO); 1664. libavformat/network.h:49:1: start of procedure ff_network_init() 47. int ff_socket_nonblock(int socket, int enable); 48. 49. static inline int ff_network_init(void) ^ 50. { 51. #if HAVE_WINSOCK2_H libavformat/network.h:56:5: 54. return 0; 55. #endif 56. return 1; ^ 57. } 58. libavformat/network.h:57:1: return from a call to ff_network_init 55. #endif 56. return 1; 57. } ^ 58. 59. static inline void ff_network_close(void) libavformat/rtsp.c:1662:10: Taking false branch 1660. char url[1024]; 1661. 1662. if (!ff_network_init()) ^ 1663. return AVERROR(EIO); 1664. libavformat/rtsp.c:1667:5: 1665. /* read the whole sdp file */ 1666. /* XXX: better loading */ 1667. content = av_malloc(SDP_MAX_SIZE); ^ 1668. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1); 1669. if (size <= 0) { libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(FF_INTERNAL_MEM_TYPE size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(FF_INTERNAL_MEM_TYPE size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking true branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,16,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:84:9: 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,16,size)) 84. ptr = NULL; ^ 85. #elif HAVE_MEMALIGN 86. ptr = memalign(16,size); libavutil/mem.c:116:5: 114. ptr = malloc(size); 115. #endif 116. return ptr; ^ 117. } 118. libavutil/mem.c:117:1: return from a call to av_malloc 115. #endif 116. return ptr; 117. } ^ 118. 119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) libavformat/rtsp.c:1668:5: Skipping get_buffer(): empty list of specs 1666. /* XXX: better loading */ 1667. content = av_malloc(SDP_MAX_SIZE); 1668. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1); ^ 1669. if (size <= 0) { 1670. av_free(content); libavformat/rtsp.c:1669:9: Taking false branch 1667. content = av_malloc(SDP_MAX_SIZE); 1668. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1); 1669. if (size <= 0) { ^ 1670. av_free(content); 1671. return AVERROR_INVALIDDATA; libavformat/rtsp.c:1673:5: 1671. return AVERROR_INVALIDDATA; 1672. } 1673. content[size] ='\0'; ^ 1674. 1675. ff_sdp_parse(s, content);
https://github.com/libav/libav/blob/3cf8db9447a6c77550033acea84e30be2af7ad2c/libavformat/rtsp.c/#L1673
d2a_code_trace_data_43868
static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, OPENSSL_LH_DOALL_FUNC func, OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) { int i; OPENSSL_LH_NODE *a, *n; if (lh == NULL) return; for (i = lh->num_nodes - 1; i >= 0; i--) { a = lh->b[i]; while (a != NULL) { n = a->next; if (use_arg) func_arg(a->data, arg); else func(a->data); a = n; } } } ssl/ssl_lib.c:3149: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->ctx->sessions->num_nodes`)] - 1):unsigned32 by call to `SSL_free`. Showing all 17 steps of the trace ssl/ssl_lib.c:3029:1: Parameter `s->ctx->sessions->num_nodes` 3027. } 3028. 3029. > SSL *SSL_dup(SSL *s) 3030. { 3031. STACK_OF(X509_NAME) *sk; ssl/ssl_lib.c:3045:16: Call 3043. * Otherwise, copy configuration state, and session if set. 3044. */ 3045. if ((ret = SSL_new(SSL_get_SSL_CTX(s))) == NULL) ^ 3046. return (NULL); 3047. ssl/ssl_lib.c:518:1: Parameter `ctx->sessions->num_nodes` 516. } 517. 518. > SSL *SSL_new(SSL_CTX *ctx) 519. { 520. SSL *s; ssl/ssl_lib.c:3149:5: Call 3147. 3148. err: 3149. SSL_free(ret); ^ 3150. return NULL; 3151. } ssl/ssl_lib.c:926:1: Parameter `s->ctx->sessions->num_nodes` 924. } 925. 926. > void SSL_free(SSL *s) 927. { 928. int i; ssl/ssl_lib.c:998:5: Call 996. RECORD_LAYER_release(&s->rlayer); 997. 998. SSL_CTX_free(s->ctx); ^ 999. 1000. ASYNC_WAIT_CTX_free(s->waitctx); ssl/ssl_lib.c:2429:1: Parameter `a->sessions->num_nodes` 2427. } 2428. 2429. > void SSL_CTX_free(SSL_CTX *a) 2430. { 2431. int i; ssl/ssl_lib.c:2455:9: Call 2453. */ 2454. if (a->sessions != NULL) 2455. SSL_CTX_flush_sessions(a, 0); ^ 2456. 2457. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); ssl/ssl_sess.c:974:1: Parameter `s->sessions->num_nodes` 972. IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 973. 974. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 975. { 976. unsigned long i; ssl/ssl_sess.c:987:5: Call 985. i = lh_SSL_SESSION_get_down_load(s->sessions); 986. lh_SSL_SESSION_set_down_load(s->sessions, 0); 987. lh_SSL_SESSION_doall_TIMEOUT_PARAM(tp.cache, timeout_cb, &tp); ^ 988. lh_SSL_SESSION_set_down_load(s->sessions, i); 989. CRYPTO_THREAD_unlock(s->lock); ssl/ssl_sess.c:972:1: Parameter `lh->num_nodes` 970. } 971. 972. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 973. 974. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) ssl/ssl_sess.c:972:1: Call 970. } 971. 972. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 973. 974. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) crypto/lhash/lhash.c:182:1: Parameter `lh->num_nodes` 180. } 181. 182. > void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 183. { 184. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); crypto/lhash/lhash.c:184:5: Call 182. void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 183. { 184. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); ^ 185. } 186. crypto/lhash/lhash.c:150:1: <LHS trace> 148. } 149. 150. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 151. OPENSSL_LH_DOALL_FUNC func, 152. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:150:1: Parameter `lh->num_nodes` 148. } 149. 150. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 151. OPENSSL_LH_DOALL_FUNC func, 152. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:164:10: Binary operation: ([0, max(0, s->ctx->sessions->num_nodes)] - 1):unsigned32 by call to `SSL_free` 162. * memory leaks otherwise 163. */ 164. for (i = lh->num_nodes - 1; i >= 0; i--) { ^ 165. a = lh->b[i]; 166. while (a != NULL) {
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L164
d2a_code_trace_data_43869
static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size) { H264Context *h = s->priv_data; const uint8_t *buf_end = buf + buf_size; unsigned int pps_id; unsigned int slice_type; int state = -1; const uint8_t *ptr; int field_poc[2]; s->pict_type = AV_PICTURE_TYPE_I; s->key_frame = 0; s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; h->avctx= avctx; h->sei_recovery_frame_cnt = -1; h->sei_dpb_output_delay = 0; h->sei_cpb_removal_delay = -1; h->sei_buffering_period_present = 0; if (!buf_size) return 0; for(;;) { int src_length, dst_length, consumed; buf = avpriv_find_start_code(buf, buf_end, &state); if(buf >= buf_end) break; --buf; src_length = buf_end - buf; switch (state & 0x1f) { case NAL_SLICE: case NAL_IDR_SLICE: if (src_length > 20) src_length = 20; break; } ptr= ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); if (ptr==NULL || dst_length < 0) break; init_get_bits(&h->gb, ptr, 8*dst_length); switch(h->nal_unit_type) { case NAL_SPS: ff_h264_decode_seq_parameter_set(h); break; case NAL_PPS: ff_h264_decode_picture_parameter_set(h, h->gb.size_in_bits); break; case NAL_SEI: ff_h264_decode_sei(h); break; case NAL_IDR_SLICE: s->key_frame = 1; h->prev_frame_num = 0; h->prev_frame_num_offset = 0; h->prev_poc_msb = h->prev_poc_lsb = 0; case NAL_SLICE: get_ue_golomb(&h->gb); slice_type = get_ue_golomb_31(&h->gb); s->pict_type = golomb_to_pict_type[slice_type % 5]; if (h->sei_recovery_frame_cnt >= 0) { s->key_frame = 1; } pps_id= get_ue_golomb(&h->gb); if(pps_id>=MAX_PPS_COUNT) { av_log(h->avctx, AV_LOG_ERROR, "pps_id out of range\n"); return -1; } if(!h->pps_buffers[pps_id]) { av_log(h->avctx, AV_LOG_ERROR, "non-existing PPS referenced\n"); return -1; } h->pps= *h->pps_buffers[pps_id]; if(!h->sps_buffers[h->pps.sps_id]) { av_log(h->avctx, AV_LOG_ERROR, "non-existing SPS referenced\n"); return -1; } h->sps = *h->sps_buffers[h->pps.sps_id]; h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num); avctx->profile = ff_h264_get_profile(&h->sps); avctx->level = h->sps.level_idc; if(h->sps.frame_mbs_only_flag){ h->picture_structure= PICT_FRAME; }else{ if(get_bits1(&h->gb)) { h->picture_structure= PICT_TOP_FIELD + get_bits1(&h->gb); } else { h->picture_structure= PICT_FRAME; } } if (h->nal_unit_type == NAL_IDR_SLICE) get_ue_golomb(&h->gb); if (h->sps.poc_type == 0) { h->poc_lsb = get_bits(&h->gb, h->sps.log2_max_poc_lsb); if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME) h->delta_poc_bottom = get_se_golomb(&h->gb); } if (h->sps.poc_type == 1 && !h->sps.delta_pic_order_always_zero_flag) { h->delta_poc[0] = get_se_golomb(&h->gb); if (h->pps.pic_order_present == 1 && h->picture_structure == PICT_FRAME) h->delta_poc[1] = get_se_golomb(&h->gb); } ff_init_poc(h, field_poc, NULL); if(h->sps.pic_struct_present_flag) { switch (h->sei_pic_struct) { case SEI_PIC_STRUCT_TOP_FIELD: case SEI_PIC_STRUCT_BOTTOM_FIELD: s->repeat_pict = 0; break; case SEI_PIC_STRUCT_FRAME: case SEI_PIC_STRUCT_TOP_BOTTOM: case SEI_PIC_STRUCT_BOTTOM_TOP: s->repeat_pict = 1; break; case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: s->repeat_pict = 2; break; case SEI_PIC_STRUCT_FRAME_DOUBLING: s->repeat_pict = 3; break; case SEI_PIC_STRUCT_FRAME_TRIPLING: s->repeat_pict = 5; break; default: s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0; break; } } else { s->repeat_pict = h->picture_structure == PICT_FRAME ? 1 : 0; } if (h->picture_structure == PICT_FRAME) { s->picture_structure = AV_PICTURE_STRUCTURE_FRAME; if (h->sps.pic_struct_present_flag) { switch (h->sei_pic_struct) { case SEI_PIC_STRUCT_TOP_BOTTOM: case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: s->field_order = AV_FIELD_TT; break; case SEI_PIC_STRUCT_BOTTOM_TOP: case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: s->field_order = AV_FIELD_BB; break; default: s->field_order = AV_FIELD_PROGRESSIVE; break; } } else { if (field_poc[0] < field_poc[1]) s->field_order = AV_FIELD_TT; else if (field_poc[0] > field_poc[1]) s->field_order = AV_FIELD_BB; else s->field_order = AV_FIELD_PROGRESSIVE; } } else { if (h->picture_structure == PICT_TOP_FIELD) s->picture_structure = AV_PICTURE_STRUCTURE_TOP_FIELD; else s->picture_structure = AV_PICTURE_STRUCTURE_BOTTOM_FIELD; s->field_order = AV_FIELD_UNKNOWN; } return 0; } buf += consumed; } av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n"); return -1; } libavcodec/h264_parser.c:157: error: Null Dereference pointer `h->gb.buffer` last assigned on line 154 could be null and is dereferenced by call to `ff_h264_decode_seq_parameter_set()` at line 157, column 13. libavcodec/h264_parser.c:109:1: start of procedure parse_nal_units() 107. * @param buf_size size of the buffer. 108. */ 109. static inline int parse_nal_units(AVCodecParserContext *s, ^ 110. AVCodecContext *avctx, 111. const uint8_t *buf, int buf_size) libavcodec/h264_parser.c:113:5: 111. const uint8_t *buf, int buf_size) 112. { 113. H264Context *h = s->priv_data; ^ 114. const uint8_t *buf_end = buf + buf_size; 115. unsigned int pps_id; libavcodec/h264_parser.c:114:5: 112. { 113. H264Context *h = s->priv_data; 114. const uint8_t *buf_end = buf + buf_size; ^ 115. unsigned int pps_id; 116. unsigned int slice_type; libavcodec/h264_parser.c:117:5: 115. unsigned int pps_id; 116. unsigned int slice_type; 117. int state = -1; ^ 118. const uint8_t *ptr; 119. int field_poc[2]; libavcodec/h264_parser.c:122:5: 120. 121. /* set some sane default values */ 122. s->pict_type = AV_PICTURE_TYPE_I; ^ 123. s->key_frame = 0; 124. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; libavcodec/h264_parser.c:123:5: 121. /* set some sane default values */ 122. s->pict_type = AV_PICTURE_TYPE_I; 123. s->key_frame = 0; ^ 124. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; 125. libavcodec/h264_parser.c:124:5: 122. s->pict_type = AV_PICTURE_TYPE_I; 123. s->key_frame = 0; 124. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; ^ 125. 126. h->avctx= avctx; libavcodec/h264_parser.c:126:5: 124. s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN; 125. 126. h->avctx= avctx; ^ 127. h->sei_recovery_frame_cnt = -1; 128. h->sei_dpb_output_delay = 0; libavcodec/h264_parser.c:127:5: 125. 126. h->avctx= avctx; 127. h->sei_recovery_frame_cnt = -1; ^ 128. h->sei_dpb_output_delay = 0; 129. h->sei_cpb_removal_delay = -1; libavcodec/h264_parser.c:128:5: 126. h->avctx= avctx; 127. h->sei_recovery_frame_cnt = -1; 128. h->sei_dpb_output_delay = 0; ^ 129. h->sei_cpb_removal_delay = -1; 130. h->sei_buffering_period_present = 0; libavcodec/h264_parser.c:129:5: 127. h->sei_recovery_frame_cnt = -1; 128. h->sei_dpb_output_delay = 0; 129. h->sei_cpb_removal_delay = -1; ^ 130. h->sei_buffering_period_present = 0; 131. libavcodec/h264_parser.c:130:5: 128. h->sei_dpb_output_delay = 0; 129. h->sei_cpb_removal_delay = -1; 130. h->sei_buffering_period_present = 0; ^ 131. 132. if (!buf_size) libavcodec/h264_parser.c:132:10: Taking false branch 130. h->sei_buffering_period_present = 0; 131. 132. if (!buf_size) ^ 133. return 0; 134. libavcodec/h264_parser.c:293:5: Loop condition is true. Entering loop body 291. } 292. buf += consumed; 293. } ^ 294. /* didn't find a picture! */ 295. av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n"); libavcodec/h264_parser.c:137:9: Skipping avpriv_find_start_code(): empty list of specs 135. for(;;) { 136. int src_length, dst_length, consumed; 137. buf = avpriv_find_start_code(buf, buf_end, &state); ^ 138. if(buf >= buf_end) 139. break; libavcodec/h264_parser.c:138:12: Taking false branch 136. int src_length, dst_length, consumed; 137. buf = avpriv_find_start_code(buf, buf_end, &state); 138. if(buf >= buf_end) ^ 139. break; 140. --buf; libavcodec/h264_parser.c:140:9: 138. if(buf >= buf_end) 139. break; 140. --buf; ^ 141. src_length = buf_end - buf; 142. switch (state & 0x1f) { libavcodec/h264_parser.c:141:9: 139. break; 140. --buf; 141. src_length = buf_end - buf; ^ 142. switch (state & 0x1f) { 143. case NAL_SLICE: libavcodec/h264_parser.c:142:9: 140. --buf; 141. src_length = buf_end - buf; 142. switch (state & 0x1f) { ^ 143. case NAL_SLICE: 144. case NAL_IDR_SLICE: libavcodec/h264_parser.c:143:9: Switch condition is true. Entering switch case 141. src_length = buf_end - buf; 142. switch (state & 0x1f) { 143. case NAL_SLICE: ^ 144. case NAL_IDR_SLICE: 145. // Do not walk the whole buffer just to decode slice header libavcodec/h264_parser.c:146:17: Taking false branch 144. case NAL_IDR_SLICE: 145. // Do not walk the whole buffer just to decode slice header 146. if (src_length > 20) ^ 147. src_length = 20; 148. break; libavcodec/h264_parser.c:150:9: Skipping ff_h264_decode_nal(): empty list of specs 148. break; 149. } 150. ptr= ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); ^ 151. if (ptr==NULL || dst_length < 0) 152. break; libavcodec/h264_parser.c:151:13: Taking false branch 149. } 150. ptr= ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); 151. if (ptr==NULL || dst_length < 0) ^ 152. break; 153. libavcodec/h264_parser.c:151:26: Taking false branch 149. } 150. ptr= ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length); 151. if (ptr==NULL || dst_length < 0) ^ 152. break; 153. libavcodec/h264_parser.c:154:9: 152. break; 153. 154. init_get_bits(&h->gb, ptr, 8*dst_length); ^ 155. switch(h->nal_unit_type) { 156. case NAL_SPS: libavcodec/get_bits.h:375:1: start of procedure init_get_bits() 373. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. 374. */ 375. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, ^ 376. int bit_size) 377. { libavcodec/get_bits.h:379:5: 377. { 378. int buffer_size; 379. int ret = 0; ^ 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { libavcodec/get_bits.h:381:9: Taking true branch 379. int ret = 0; 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { ^ 382. buffer_size = bit_size = 0; 383. buffer = NULL; libavcodec/get_bits.h:382:9: 380. 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 382. buffer_size = bit_size = 0; ^ 383. buffer = NULL; 384. ret = AVERROR_INVALIDDATA; libavcodec/get_bits.h:383:9: 381. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 382. buffer_size = bit_size = 0; 383. buffer = NULL; ^ 384. ret = AVERROR_INVALIDDATA; 385. } libavcodec/get_bits.h:384:9: 382. buffer_size = bit_size = 0; 383. buffer = NULL; 384. ret = AVERROR_INVALIDDATA; ^ 385. } 386. libavcodec/get_bits.h:387:5: 385. } 386. 387. buffer_size = (bit_size + 7) >> 3; ^ 388. 389. s->buffer = buffer; libavcodec/get_bits.h:389:5: 387. buffer_size = (bit_size + 7) >> 3; 388. 389. s->buffer = buffer; ^ 390. s->size_in_bits = bit_size; 391. #if !UNCHECKED_BITSTREAM_READER libavcodec/get_bits.h:390:5: 388. 389. s->buffer = buffer; 390. s->size_in_bits = bit_size; ^ 391. #if !UNCHECKED_BITSTREAM_READER 392. s->size_in_bits_plus8 = bit_size + 8; libavcodec/get_bits.h:392:5: 390. s->size_in_bits = bit_size; 391. #if !UNCHECKED_BITSTREAM_READER 392. s->size_in_bits_plus8 = bit_size + 8; ^ 393. #endif 394. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:394:5: 392. s->size_in_bits_plus8 = bit_size + 8; 393. #endif 394. s->buffer_end = buffer + buffer_size; ^ 395. s->index = 0; 396. libavcodec/get_bits.h:395:5: 393. #endif 394. s->buffer_end = buffer + buffer_size; 395. s->index = 0; ^ 396. 397. return ret; libavcodec/get_bits.h:397:5: 395. s->index = 0; 396. 397. return ret; ^ 398. } 399. libavcodec/get_bits.h:398:1: return from a call to init_get_bits 396. 397. return ret; 398. } ^ 399. 400. /** libavcodec/h264_parser.c:155:9: 153. 154. init_get_bits(&h->gb, ptr, 8*dst_length); 155. switch(h->nal_unit_type) { ^ 156. case NAL_SPS: 157. ff_h264_decode_seq_parameter_set(h); libavcodec/h264_parser.c:156:9: Switch condition is true. Entering switch case 154. init_get_bits(&h->gb, ptr, 8*dst_length); 155. switch(h->nal_unit_type) { 156. case NAL_SPS: ^ 157. ff_h264_decode_seq_parameter_set(h); 158. break; libavcodec/h264_parser.c:157:13: 155. switch(h->nal_unit_type) { 156. case NAL_SPS: 157. ff_h264_decode_seq_parameter_set(h); ^ 158. break; 159. case NAL_PPS: libavcodec/h264_ps.c:298:1: start of procedure ff_h264_decode_seq_parameter_set() 296. } 297. 298. int ff_h264_decode_seq_parameter_set(H264Context *h){ ^ 299. int profile_idc, level_idc, constraint_set_flags = 0; 300. unsigned int sps_id; libavcodec/h264_ps.c:299:5: 297. 298. int ff_h264_decode_seq_parameter_set(H264Context *h){ 299. int profile_idc, level_idc, constraint_set_flags = 0; ^ 300. unsigned int sps_id; 301. int i, log2_max_frame_num_minus4; libavcodec/h264_ps.c:304:5: Skipping get_bits(): empty list of specs 302. SPS *sps; 303. 304. profile_idc= get_bits(&h->gb, 8); ^ 305. constraint_set_flags |= get_bits1(&h->gb) << 0; //constraint_set0_flag 306. constraint_set_flags |= get_bits1(&h->gb) << 1; //constraint_set1_flag libavcodec/h264_ps.c:305:5: 303. 304. profile_idc= get_bits(&h->gb, 8); 305. constraint_set_flags |= get_bits1(&h->gb) << 0; //constraint_set0_flag ^ 306. constraint_set_flags |= get_bits1(&h->gb) << 1; //constraint_set1_flag 307. constraint_set_flags |= get_bits1(&h->gb) << 2; //constraint_set2_flag libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:306:5: 304. profile_idc= get_bits(&h->gb, 8); 305. constraint_set_flags |= get_bits1(&h->gb) << 0; //constraint_set0_flag 306. constraint_set_flags |= get_bits1(&h->gb) << 1; //constraint_set1_flag ^ 307. constraint_set_flags |= get_bits1(&h->gb) << 2; //constraint_set2_flag 308. constraint_set_flags |= get_bits1(&h->gb) << 3; //constraint_set3_flag libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:307:5: 305. constraint_set_flags |= get_bits1(&h->gb) << 0; //constraint_set0_flag 306. constraint_set_flags |= get_bits1(&h->gb) << 1; //constraint_set1_flag 307. constraint_set_flags |= get_bits1(&h->gb) << 2; //constraint_set2_flag ^ 308. constraint_set_flags |= get_bits1(&h->gb) << 3; //constraint_set3_flag 309. get_bits(&h->gb, 4); // reserved libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; libavcodec/get_bits.h:276:5: 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; ^ 277. result &= 1; 278. #else libavcodec/get_bits.h:277:5: 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7; 277. result &= 1; ^ 278. #else 279. result <<= index & 7; libavcodec/get_bits.h:283:9: Taking true branch 281. #endif 282. #if !UNCHECKED_BITSTREAM_READER 283. if (s->index < s->size_in_bits_plus8) ^ 284. #endif 285. index++; libavcodec/get_bits.h:285:9: 283. if (s->index < s->size_in_bits_plus8) 284. #endif 285. index++; ^ 286. s->index = index; 287. libavcodec/get_bits.h:286:5: 284. #endif 285. index++; 286. s->index = index; ^ 287. 288. return result; libavcodec/get_bits.h:288:5: 286. s->index = index; 287. 288. return result; ^ 289. } 290. libavcodec/get_bits.h:289:1: return from a call to get_bits1 287. 288. return result; 289. } ^ 290. 291. static inline unsigned int show_bits1(GetBitContext *s) libavcodec/h264_ps.c:308:5: 306. constraint_set_flags |= get_bits1(&h->gb) << 1; //constraint_set1_flag 307. constraint_set_flags |= get_bits1(&h->gb) << 2; //constraint_set2_flag 308. constraint_set_flags |= get_bits1(&h->gb) << 3; //constraint_set3_flag ^ 309. get_bits(&h->gb, 4); // reserved 310. level_idc= get_bits(&h->gb, 8); libavcodec/get_bits.h:271:1: start of procedure get_bits1() 269. } 270. 271. static inline unsigned int get_bits1(GetBitContext *s) ^ 272. { 273. unsigned int index = s->index; libavcodec/get_bits.h:273:5: 271. static inline unsigned int get_bits1(GetBitContext *s) 272. { 273. unsigned int index = s->index; ^ 274. uint8_t result = s->buffer[index >> 3]; 275. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:274:5: 272. { 273. unsigned int index = s->index; 274. uint8_t result = s->buffer[index >> 3]; ^ 275. #ifdef BITSTREAM_READER_LE 276. result >>= index & 7;
https://github.com/libav/libav/blob/8a994b7406b3ab24a6444037da9d1659f3125a01/libavcodec/h264_parser.c/#L157
d2a_code_trace_data_43870
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/s3_lib.c:3748: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 12]):unsigned64 by call to `WPACKET_put_bytes__`. Showing all 11 steps of the trace ssl/s3_lib.c:3711:1: Parameter `pkt->written` 3709. } 3710. 3711. > int ssl3_get_req_cert_type(SSL *s, WPACKET *pkt) 3712. { 3713. uint32_t alg_k, alg_a = 0; ssl/s3_lib.c:3748:33: Call 3746. #endif 3747. #ifndef OPENSSL_NO_DSA 3748. if (!(alg_a & SSL_aDSS) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_SIGN)) ^ 3749. return 0; 3750. #endif ssl/packet.c:261:1: Parameter `pkt->written` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; ssl/packet.c:269:17: Call 267. 268. if (size > sizeof(unsigned int) 269. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 270. || !put_value(data, val, size)) 271. return 0; ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 12]):unsigned64 by call to `WPACKET_put_bytes__` 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_43871
static int adpcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) { ADPCMContext *c = avctx->priv_data; ADPCMChannelStatus *cs; int n, m, channel, i; int block_predictor[2]; short *samples; short *samples_end; const uint8_t *src; int st; unsigned char last_byte = 0; unsigned char nibble; int decode_top_nibble_next = 0; int diff_channel; uint32_t samples_in_chunk; int32_t previous_left_sample, previous_right_sample; int32_t current_left_sample, current_right_sample; int32_t next_left_sample, next_right_sample; int32_t coeff1l, coeff2l, coeff1r, coeff2r; uint8_t shift_left, shift_right; int count1, count2; if (!buf_size) return 0; if(*data_size/4 < buf_size + 8) return -1; samples = data; samples_end= samples + *data_size/2; *data_size= 0; src = buf; st = avctx->channels == 2 ? 1 : 0; switch(avctx->codec->id) { case CODEC_ID_ADPCM_IMA_QT: n = (buf_size - 2); channel = c->channel; cs = &(c->status[channel]); cs->predictor = (*src++) << 8; cs->predictor |= (*src & 0x80); cs->predictor &= 0xFF80; if(cs->predictor & 0x8000) cs->predictor -= 0x10000; cs->predictor = av_clip_int16(cs->predictor); cs->step_index = (*src++) & 0x7F; if (cs->step_index > 88){ av_log(avctx, AV_LOG_ERROR, "ERROR: step_index = %i\n", cs->step_index); cs->step_index = 88; } cs->step = step_table[cs->step_index]; if (st && channel) samples++; for(m=32; n>0 && m>0; n--, m--) { *samples = adpcm_ima_expand_nibble(cs, src[0] & 0x0F, 3); samples += avctx->channels; *samples = adpcm_ima_expand_nibble(cs, (src[0] >> 4) & 0x0F, 3); samples += avctx->channels; src ++; } if(st) { c->channel = (channel + 1) % 2; if(channel == 1) { return src - buf; } } break; case CODEC_ID_ADPCM_IMA_WAV: if (avctx->block_align != 0 && buf_size > avctx->block_align) buf_size = avctx->block_align; for(i=0; i<avctx->channels; i++){ cs = &(c->status[i]); cs->predictor = *samples++ = (int16_t)(src[0] + (src[1]<<8)); src+=2; cs->step_index = *src++; if (cs->step_index > 88){ av_log(avctx, AV_LOG_ERROR, "ERROR: step_index = %i\n", cs->step_index); cs->step_index = 88; } if (*src++) av_log(avctx, AV_LOG_ERROR, "unused byte should be null but is %d!!\n", src[-1]); } while(src < buf + buf_size){ for(m=0; m<4; m++){ for(i=0; i<=st; i++) *samples++ = adpcm_ima_expand_nibble(&c->status[i], src[4*i] & 0x0F, 3); for(i=0; i<=st; i++) *samples++ = adpcm_ima_expand_nibble(&c->status[i], src[4*i] >> 4 , 3); src++; } src += 4*st; } break; case CODEC_ID_ADPCM_4XM: cs = &(c->status[0]); c->status[0].predictor= (int16_t)(src[0] + (src[1]<<8)); src+=2; if(st){ c->status[1].predictor= (int16_t)(src[0] + (src[1]<<8)); src+=2; } c->status[0].step_index= (int16_t)(src[0] + (src[1]<<8)); src+=2; if(st){ c->status[1].step_index= (int16_t)(src[0] + (src[1]<<8)); src+=2; } if (cs->step_index < 0) cs->step_index = 0; if (cs->step_index > 88) cs->step_index = 88; m= (buf_size - (src - buf))>>st; for(i=0; i<m; i++) { *samples++ = adpcm_ima_expand_nibble(&c->status[0], src[i] & 0x0F, 4); if (st) *samples++ = adpcm_ima_expand_nibble(&c->status[1], src[i+m] & 0x0F, 4); *samples++ = adpcm_ima_expand_nibble(&c->status[0], src[i] >> 4, 4); if (st) *samples++ = adpcm_ima_expand_nibble(&c->status[1], src[i+m] >> 4, 4); } src += m<<st; break; case CODEC_ID_ADPCM_MS: if (avctx->block_align != 0 && buf_size > avctx->block_align) buf_size = avctx->block_align; n = buf_size - 7 * avctx->channels; if (n < 0) return -1; block_predictor[0] = av_clip(*src++, 0, 7); block_predictor[1] = 0; if (st) block_predictor[1] = av_clip(*src++, 0, 7); c->status[0].idelta = (int16_t)((*src & 0xFF) | ((src[1] << 8) & 0xFF00)); src+=2; if (st){ c->status[1].idelta = (int16_t)((*src & 0xFF) | ((src[1] << 8) & 0xFF00)); src+=2; } c->status[0].coeff1 = AdaptCoeff1[block_predictor[0]]; c->status[0].coeff2 = AdaptCoeff2[block_predictor[0]]; c->status[1].coeff1 = AdaptCoeff1[block_predictor[1]]; c->status[1].coeff2 = AdaptCoeff2[block_predictor[1]]; c->status[0].sample1 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00)); src+=2; if (st) c->status[1].sample1 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00)); if (st) src+=2; c->status[0].sample2 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00)); src+=2; if (st) c->status[1].sample2 = ((*src & 0xFF) | ((src[1] << 8) & 0xFF00)); if (st) src+=2; *samples++ = c->status[0].sample1; if (st) *samples++ = c->status[1].sample1; *samples++ = c->status[0].sample2; if (st) *samples++ = c->status[1].sample2; for(;n>0;n--) { *samples++ = adpcm_ms_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F); *samples++ = adpcm_ms_expand_nibble(&c->status[st], src[0] & 0x0F); src ++; } break; case CODEC_ID_ADPCM_IMA_DK4: if (avctx->block_align != 0 && buf_size > avctx->block_align) buf_size = avctx->block_align; c->status[0].predictor = (int16_t)(src[0] | (src[1] << 8)); c->status[0].step_index = src[2]; src += 4; *samples++ = c->status[0].predictor; if (st) { c->status[1].predictor = (int16_t)(src[0] | (src[1] << 8)); c->status[1].step_index = src[2]; src += 4; *samples++ = c->status[1].predictor; } while (src < buf + buf_size) { *samples++ = adpcm_ima_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F, 3); if (st) *samples++ = adpcm_ima_expand_nibble(&c->status[1], src[0] & 0x0F, 3); else *samples++ = adpcm_ima_expand_nibble(&c->status[0], src[0] & 0x0F, 3); src++; } break; case CODEC_ID_ADPCM_IMA_DK3: if (avctx->block_align != 0 && buf_size > avctx->block_align) buf_size = avctx->block_align; if(buf_size + 16 > (samples_end - samples)*3/8) return -1; c->status[0].predictor = (int16_t)(src[10] | (src[11] << 8)); c->status[1].predictor = (int16_t)(src[12] | (src[13] << 8)); c->status[0].step_index = src[14]; c->status[1].step_index = src[15]; src += 16; diff_channel = c->status[1].predictor; while (1) { DK3_GET_NEXT_NIBBLE(); adpcm_ima_expand_nibble(&c->status[0], nibble, 3); DK3_GET_NEXT_NIBBLE(); adpcm_ima_expand_nibble(&c->status[1], nibble, 3); diff_channel = (diff_channel + c->status[1].predictor) / 2; *samples++ = c->status[0].predictor + c->status[1].predictor; *samples++ = c->status[0].predictor - c->status[1].predictor; DK3_GET_NEXT_NIBBLE(); adpcm_ima_expand_nibble(&c->status[0], nibble, 3); diff_channel = (diff_channel + c->status[1].predictor) / 2; *samples++ = c->status[0].predictor + c->status[1].predictor; *samples++ = c->status[0].predictor - c->status[1].predictor; } break; case CODEC_ID_ADPCM_IMA_WS: while (src < buf + buf_size) { if (st) { *samples++ = adpcm_ima_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F, 3); *samples++ = adpcm_ima_expand_nibble(&c->status[1], src[0] & 0x0F, 3); } else { *samples++ = adpcm_ima_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F, 3); *samples++ = adpcm_ima_expand_nibble(&c->status[0], src[0] & 0x0F, 3); } src++; } break; case CODEC_ID_ADPCM_XA: while (buf_size >= 128) { xa_decode(samples, src, &c->status[0], &c->status[1], avctx->channels); src += 128; samples += 28 * 8; buf_size -= 128; } break; case CODEC_ID_ADPCM_IMA_EA_EACS: samples_in_chunk = bytestream_get_le32(&src) >> (1-st); if (samples_in_chunk > buf_size-4-(8<<st)) { src += buf_size - 4; break; } for (i=0; i<=st; i++) c->status[i].step_index = bytestream_get_le32(&src); for (i=0; i<=st; i++) c->status[i].predictor = bytestream_get_le32(&src); for (; samples_in_chunk; samples_in_chunk--, src++) { *samples++ = adpcm_ima_expand_nibble(&c->status[0], *src>>4, 3); *samples++ = adpcm_ima_expand_nibble(&c->status[st], *src&0x0F, 3); } break; case CODEC_ID_ADPCM_IMA_EA_SEAD: for (; src < buf+buf_size; src++) { *samples++ = adpcm_ima_expand_nibble(&c->status[0], src[0] >> 4, 6); *samples++ = adpcm_ima_expand_nibble(&c->status[st],src[0]&0x0F, 6); } break; case CODEC_ID_ADPCM_EA: samples_in_chunk = AV_RL32(src); if (samples_in_chunk >= ((buf_size - 12) * 2)) { src += buf_size; break; } src += 4; current_left_sample = (int16_t)AV_RL16(src); src += 2; previous_left_sample = (int16_t)AV_RL16(src); src += 2; current_right_sample = (int16_t)AV_RL16(src); src += 2; previous_right_sample = (int16_t)AV_RL16(src); src += 2; for (count1 = 0; count1 < samples_in_chunk/28;count1++) { coeff1l = ea_adpcm_table[(*src >> 4) & 0x0F]; coeff2l = ea_adpcm_table[((*src >> 4) & 0x0F) + 4]; coeff1r = ea_adpcm_table[*src & 0x0F]; coeff2r = ea_adpcm_table[(*src & 0x0F) + 4]; src++; shift_left = ((*src >> 4) & 0x0F) + 8; shift_right = (*src & 0x0F) + 8; src++; for (count2 = 0; count2 < 28; count2++) { next_left_sample = (((*src & 0xF0) << 24) >> shift_left); next_right_sample = (((*src & 0x0F) << 28) >> shift_right); src++; next_left_sample = (next_left_sample + (current_left_sample * coeff1l) + (previous_left_sample * coeff2l) + 0x80) >> 8; next_right_sample = (next_right_sample + (current_right_sample * coeff1r) + (previous_right_sample * coeff2r) + 0x80) >> 8; previous_left_sample = current_left_sample; current_left_sample = av_clip_int16(next_left_sample); previous_right_sample = current_right_sample; current_right_sample = av_clip_int16(next_right_sample); *samples++ = (unsigned short)current_left_sample; *samples++ = (unsigned short)current_right_sample; } } break; case CODEC_ID_ADPCM_EA_R1: case CODEC_ID_ADPCM_EA_R2: case CODEC_ID_ADPCM_EA_R3: { const int big_endian = avctx->codec->id == CODEC_ID_ADPCM_EA_R3; int32_t previous_sample, current_sample, next_sample; int32_t coeff1, coeff2; uint8_t shift; unsigned int channel; uint16_t *samplesC; const uint8_t *srcC; samples_in_chunk = (big_endian ? bytestream_get_be32(&src) : bytestream_get_le32(&src)) / 28; if (samples_in_chunk > UINT32_MAX/(28*avctx->channels) || 28*samples_in_chunk*avctx->channels > samples_end-samples) { src += buf_size - 4; break; } for (channel=0; channel<avctx->channels; channel++) { srcC = src + (big_endian ? bytestream_get_be32(&src) : bytestream_get_le32(&src)) + (avctx->channels-channel-1) * 4; samplesC = samples + channel; if (avctx->codec->id == CODEC_ID_ADPCM_EA_R1) { current_sample = (int16_t)bytestream_get_le16(&srcC); previous_sample = (int16_t)bytestream_get_le16(&srcC); } else { current_sample = c->status[channel].predictor; previous_sample = c->status[channel].prev_sample; } for (count1=0; count1<samples_in_chunk; count1++) { if (*srcC == 0xEE) { srcC++; current_sample = (int16_t)bytestream_get_be16(&srcC); previous_sample = (int16_t)bytestream_get_be16(&srcC); for (count2=0; count2<28; count2++) { *samplesC = (int16_t)bytestream_get_be16(&srcC); samplesC += avctx->channels; } } else { coeff1 = ea_adpcm_table[ (*srcC>>4) & 0x0F ]; coeff2 = ea_adpcm_table[((*srcC>>4) & 0x0F) + 4]; shift = (*srcC++ & 0x0F) + 8; for (count2=0; count2<28; count2++) { if (count2 & 1) next_sample = ((*srcC++ & 0x0F) << 28) >> shift; else next_sample = ((*srcC & 0xF0) << 24) >> shift; next_sample += (current_sample * coeff1) + (previous_sample * coeff2); next_sample = av_clip_int16(next_sample >> 8); previous_sample = current_sample; current_sample = next_sample; *samplesC = current_sample; samplesC += avctx->channels; } } } if (avctx->codec->id != CODEC_ID_ADPCM_EA_R1) { c->status[channel].predictor = current_sample; c->status[channel].prev_sample = previous_sample; } } src = src + buf_size - (4 + 4*avctx->channels); samples += 28 * samples_in_chunk * avctx->channels; break; } case CODEC_ID_ADPCM_EA_XAS: if (samples_end-samples < 32*4*avctx->channels || buf_size < (4+15)*4*avctx->channels) { src += buf_size; break; } for (channel=0; channel<avctx->channels; channel++) { int coeff[2][4], shift[4]; short *s2, *s = &samples[channel]; for (n=0; n<4; n++, s+=32*avctx->channels) { for (i=0; i<2; i++) coeff[i][n] = ea_adpcm_table[(src[0]&0x0F)+4*i]; shift[n] = (src[2]&0x0F) + 8; for (s2=s, i=0; i<2; i++, src+=2, s2+=avctx->channels) s2[0] = (src[0]&0xF0) + (src[1]<<8); } for (m=2; m<32; m+=2) { s = &samples[m*avctx->channels + channel]; for (n=0; n<4; n++, src++, s+=32*avctx->channels) { for (s2=s, i=0; i<8; i+=4, s2+=avctx->channels) { int level = ((*src & (0xF0>>i)) << (24+i)) >> shift[n]; int pred = s2[-1*avctx->channels] * coeff[0][n] + s2[-2*avctx->channels] * coeff[1][n]; s2[0] = av_clip_int16((level + pred + 0x80) >> 8); } } } } samples += 32*4*avctx->channels; break; case CODEC_ID_ADPCM_IMA_AMV: case CODEC_ID_ADPCM_IMA_SMJPEG: c->status[0].predictor = (int16_t)bytestream_get_le16(&src); c->status[0].step_index = bytestream_get_le16(&src); if (avctx->codec->id == CODEC_ID_ADPCM_IMA_AMV) src+=4; while (src < buf + buf_size) { char hi, lo; lo = *src & 0x0F; hi = (*src >> 4) & 0x0F; if (avctx->codec->id == CODEC_ID_ADPCM_IMA_AMV) FFSWAP(char, hi, lo); *samples++ = adpcm_ima_expand_nibble(&c->status[0], lo, 3); *samples++ = adpcm_ima_expand_nibble(&c->status[0], hi, 3); src++; } break; case CODEC_ID_ADPCM_CT: while (src < buf + buf_size) { if (st) { *samples++ = adpcm_ct_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F); *samples++ = adpcm_ct_expand_nibble(&c->status[1], src[0] & 0x0F); } else { *samples++ = adpcm_ct_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F); *samples++ = adpcm_ct_expand_nibble(&c->status[0], src[0] & 0x0F); } src++; } break; case CODEC_ID_ADPCM_SBPRO_4: case CODEC_ID_ADPCM_SBPRO_3: case CODEC_ID_ADPCM_SBPRO_2: if (!c->status[0].step_index) { *samples++ = 128 * (*src++ - 0x80); if (st) *samples++ = 128 * (*src++ - 0x80); c->status[0].step_index = 1; } if (avctx->codec->id == CODEC_ID_ADPCM_SBPRO_4) { while (src < buf + buf_size) { *samples++ = adpcm_sbpro_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F, 4, 0); *samples++ = adpcm_sbpro_expand_nibble(&c->status[st], src[0] & 0x0F, 4, 0); src++; } } else if (avctx->codec->id == CODEC_ID_ADPCM_SBPRO_3) { while (src < buf + buf_size && samples + 2 < samples_end) { *samples++ = adpcm_sbpro_expand_nibble(&c->status[0], (src[0] >> 5) & 0x07, 3, 0); *samples++ = adpcm_sbpro_expand_nibble(&c->status[0], (src[0] >> 2) & 0x07, 3, 0); *samples++ = adpcm_sbpro_expand_nibble(&c->status[0], src[0] & 0x03, 2, 0); src++; } } else { while (src < buf + buf_size && samples + 3 < samples_end) { *samples++ = adpcm_sbpro_expand_nibble(&c->status[0], (src[0] >> 6) & 0x03, 2, 2); *samples++ = adpcm_sbpro_expand_nibble(&c->status[st], (src[0] >> 4) & 0x03, 2, 2); *samples++ = adpcm_sbpro_expand_nibble(&c->status[0], (src[0] >> 2) & 0x03, 2, 2); *samples++ = adpcm_sbpro_expand_nibble(&c->status[st], src[0] & 0x03, 2, 2); src++; } } break; case CODEC_ID_ADPCM_SWF: { GetBitContext gb; const int *table; int k0, signmask, nb_bits, count; int size = buf_size*8; init_get_bits(&gb, buf, size); nb_bits = get_bits(&gb, 2)+2; table = swf_index_tables[nb_bits-2]; k0 = 1 << (nb_bits-2); signmask = 1 << (nb_bits-1); while (get_bits_count(&gb) <= size - 22*avctx->channels) { for (i = 0; i < avctx->channels; i++) { *samples++ = c->status[i].predictor = get_sbits(&gb, 16); c->status[i].step_index = get_bits(&gb, 6); } for (count = 0; get_bits_count(&gb) <= size - nb_bits*avctx->channels && count < 4095; count++) { int i; for (i = 0; i < avctx->channels; i++) { int delta = get_bits(&gb, nb_bits); int step = step_table[c->status[i].step_index]; long vpdiff = 0; int k = k0; do { if (delta & k) vpdiff += step; step >>= 1; k >>= 1; } while(k); vpdiff += step; if (delta & signmask) c->status[i].predictor -= vpdiff; else c->status[i].predictor += vpdiff; c->status[i].step_index += table[delta & (~signmask)]; c->status[i].step_index = av_clip(c->status[i].step_index, 0, 88); c->status[i].predictor = av_clip_int16(c->status[i].predictor); *samples++ = c->status[i].predictor; if (samples >= samples_end) { av_log(avctx, AV_LOG_ERROR, "allocated output buffer is too small\n"); return -1; } } } } src += buf_size; break; } case CODEC_ID_ADPCM_YAMAHA: while (src < buf + buf_size) { if (st) { *samples++ = adpcm_yamaha_expand_nibble(&c->status[0], src[0] & 0x0F); *samples++ = adpcm_yamaha_expand_nibble(&c->status[1], (src[0] >> 4) & 0x0F); } else { *samples++ = adpcm_yamaha_expand_nibble(&c->status[0], src[0] & 0x0F); *samples++ = adpcm_yamaha_expand_nibble(&c->status[0], (src[0] >> 4) & 0x0F); } src++; } break; case CODEC_ID_ADPCM_THP: { int table[2][16]; unsigned int samplecnt; int prev[2][2]; int ch; if (buf_size < 80) { av_log(avctx, AV_LOG_ERROR, "frame too small\n"); return -1; } src+=4; samplecnt = bytestream_get_be32(&src); for (i = 0; i < 32; i++) table[0][i] = (int16_t)bytestream_get_be16(&src); for (i = 0; i < 4; i++) prev[0][i] = (int16_t)bytestream_get_be16(&src); if (samplecnt >= (samples_end - samples) / (st + 1)) { av_log(avctx, AV_LOG_ERROR, "allocated output buffer is too small\n"); return -1; } for (ch = 0; ch <= st; ch++) { samples = (unsigned short *) data + ch; for (i = 0; i < samplecnt / 14; i++) { int index = (*src >> 4) & 7; unsigned int exp = 28 - (*src++ & 15); int factor1 = table[ch][index * 2]; int factor2 = table[ch][index * 2 + 1]; for (n = 0; n < 14; n++) { int32_t sampledat; if(n&1) sampledat= *src++ <<28; else sampledat= (*src&0xF0)<<24; sampledat = ((prev[ch][0]*factor1 + prev[ch][1]*factor2) >> 11) + (sampledat>>exp); *samples = av_clip_int16(sampledat); prev[ch][1] = prev[ch][0]; prev[ch][0] = *samples++; samples += st; } } } samples -= st; break; } default: return -1; } *data_size = (uint8_t *)samples - (uint8_t *)data; return src - buf; } libavcodec/adpcm.c:1339: error: Uninitialized Value The value read from shift[_] was never initialized. libavcodec/adpcm.c:1339:25: 1337. for (n=0; n<4; n++, src++, s+=32*avctx->channels) { 1338. for (s2=s, i=0; i<8; i+=4, s2+=avctx->channels) { 1339. int level = ((*src & (0xF0>>i)) << (24+i)) >> shift[n]; ^ 1340. int pred = s2[-1*avctx->channels] * coeff[0][n] 1341. + s2[-2*avctx->channels] * coeff[1][n];
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/adpcm.c/#L1339
d2a_code_trace_data_43872
static int ogg_new_buf(struct ogg *ogg, int idx) { struct ogg_stream *os = ogg->streams + idx; uint8_t *nb = av_malloc(os->bufsize); int size = os->bufpos - os->pstart; if(os->buf){ memcpy(nb, os->buf + os->pstart, size); av_free(os->buf); } os->buf = nb; os->bufpos = size; os->pstart = 0; return 0; } libavformat/oggdec.c:185: error: Null Dereference pointer `nb` last assigned on line 182 could be null and is dereferenced by call to `memcpy()` at line 185, column 9. libavformat/oggdec.c:178:1: start of procedure ogg_new_buf() 176. } 177. 178. static int ^ 179. ogg_new_buf(struct ogg *ogg, int idx) 180. { libavformat/oggdec.c:181:5: 179. ogg_new_buf(struct ogg *ogg, int idx) 180. { 181. struct ogg_stream *os = ogg->streams + idx; ^ 182. uint8_t *nb = av_malloc(os->bufsize); 183. int size = os->bufpos - os->pstart; libavformat/oggdec.c:182:5: 180. { 181. struct ogg_stream *os = ogg->streams + idx; 182. uint8_t *nb = av_malloc(os->bufsize); ^ 183. int size = os->bufpos - os->pstart; 184. if(os->buf){ libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(FF_INTERNAL_MEM_TYPE size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(FF_INTERNAL_MEM_TYPE size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking true branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) ^ 73. return NULL; 74. libavutil/mem.c:73:9: 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) 73. return NULL; ^ 74. 75. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:117:1: return from a call to av_malloc 115. #endif 116. return ptr; 117. } ^ 118. 119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) libavformat/oggdec.c:183:5: 181. struct ogg_stream *os = ogg->streams + idx; 182. uint8_t *nb = av_malloc(os->bufsize); 183. int size = os->bufpos - os->pstart; ^ 184. if(os->buf){ 185. memcpy(nb, os->buf + os->pstart, size); libavformat/oggdec.c:184:8: Taking true branch 182. uint8_t *nb = av_malloc(os->bufsize); 183. int size = os->bufpos - os->pstart; 184. if(os->buf){ ^ 185. memcpy(nb, os->buf + os->pstart, size); 186. av_free(os->buf); libavformat/oggdec.c:185:9: 183. int size = os->bufpos - os->pstart; 184. if(os->buf){ 185. memcpy(nb, os->buf + os->pstart, size); ^ 186. av_free(os->buf); 187. }
https://github.com/libav/libav/blob/d1c5fdf8920b75f3b824368b8336f18c74b68803/libavformat/oggdec.c/#L185
d2a_code_trace_data_43873
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; if (pkt->buf->length > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = (pkt->buf->length == 0) ? DEFAULT_BUF_SIZE : pkt->buf->length * 2; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; pkt->written += len; pkt->curr += len; return 1; } ssl/t1_lib.c:1061: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + 20]):unsigned64 by call to `WPACKET_sub_memcpy`. Showing all 20 steps of the trace ssl/t1_lib.c:1016:1: Parameter `pkt->written` 1014. } 1015. 1016. > int ssl_add_clienthello_tlsext(SSL *s, WPACKET *pkt, int *al) 1017. { 1018. #ifndef OPENSSL_NO_EC ssl/t1_lib.c:1055:14: Call 1053. if (s->tlsext_hostname != NULL) { 1054. /* Add TLS extension servername to the Client Hello message */ 1055. if (!WPACKET_put_bytes(pkt, TLSEXT_TYPE_server_name, 2) ^ 1056. /* Sub-packet for server_name extension */ 1057. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:226:1: Parameter `pkt->written` 224. } 225. 226. > int WPACKET_put_bytes(WPACKET *pkt, unsigned int val, size_t size) 227. { 228. unsigned char *data; ssl/t1_lib.c:1057:21: Call 1055. if (!WPACKET_put_bytes(pkt, TLSEXT_TYPE_server_name, 2) 1056. /* Sub-packet for server_name extension */ 1057. || !WPACKET_start_sub_packet_u16(pkt) ^ 1058. /* Sub-packet for servername list (always 1 hostname)*/ 1059. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:190:1: Parameter `pkt->written` 188. } 189. 190. > int WPACKET_start_sub_packet_len(WPACKET *pkt, size_t lenbytes) 191. { 192. WPACKET_SUB *sub; ssl/t1_lib.c:1059:21: Call 1057. || !WPACKET_start_sub_packet_u16(pkt) 1058. /* Sub-packet for servername list (always 1 hostname)*/ 1059. || !WPACKET_start_sub_packet_u16(pkt) ^ 1060. || !WPACKET_put_bytes(pkt, TLSEXT_NAMETYPE_host_name, 1) 1061. || !WPACKET_sub_memcpy(pkt, s->tlsext_hostname, ssl/packet.c:190:1: Parameter `pkt->written` 188. } 189. 190. > int WPACKET_start_sub_packet_len(WPACKET *pkt, size_t lenbytes) 191. { 192. WPACKET_SUB *sub; ssl/t1_lib.c:1060:21: Call 1058. /* Sub-packet for servername list (always 1 hostname)*/ 1059. || !WPACKET_start_sub_packet_u16(pkt) 1060. || !WPACKET_put_bytes(pkt, TLSEXT_NAMETYPE_host_name, 1) ^ 1061. || !WPACKET_sub_memcpy(pkt, s->tlsext_hostname, 1062. strlen(s->tlsext_hostname), 2) ssl/packet.c:226:1: Parameter `pkt->written` 224. } 225. 226. > int WPACKET_put_bytes(WPACKET *pkt, unsigned int val, size_t size) 227. { 228. unsigned char *data; ssl/t1_lib.c:1061:21: Call 1059. || !WPACKET_start_sub_packet_u16(pkt) 1060. || !WPACKET_put_bytes(pkt, TLSEXT_NAMETYPE_host_name, 1) 1061. || !WPACKET_sub_memcpy(pkt, s->tlsext_hostname, ^ 1062. strlen(s->tlsext_hostname), 2) 1063. || !WPACKET_close(pkt) ssl/packet.c:284:10: Call 282. int WPACKET_sub_memcpy(WPACKET *pkt, const void *src, size_t len, size_t lenbytes) 283. { 284. if (!WPACKET_start_sub_packet_len(pkt, lenbytes) ^ 285. || !WPACKET_memcpy(pkt, src, len) 286. || !WPACKET_close(pkt)) ssl/packet.c:190:1: Parameter `pkt->buf->length` 188. } 189. 190. > int WPACKET_start_sub_packet_len(WPACKET *pkt, size_t lenbytes) 191. { 192. WPACKET_SUB *sub; ssl/packet.c:285:17: Call 283. { 284. if (!WPACKET_start_sub_packet_len(pkt, lenbytes) 285. || !WPACKET_memcpy(pkt, src, len) ^ 286. || !WPACKET_close(pkt)) 287. return 0; ssl/packet.c:267:1: Parameter `pkt->written` 265. } 266. 267. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 268. { 269. unsigned char *dest; ssl/packet.c:274:10: Call 272. return 1; 273. 274. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 275. return 0; 276. ssl/packet.c:15:1: <LHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `pkt->buf->length` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: <RHS trace> 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:15:1: Parameter `len` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. /* Internal API, so should not fail */ ssl/packet.c:25:9: Binary operation: ([0, +oo] - [0, s->s3->previous_client_finished_len + pkt->written + 20]):unsigned64 by call to `WPACKET_sub_memcpy` 23. return 0; 24. 25. if (pkt->buf->length - pkt->written < len) { ^ 26. size_t newlen; 27.
https://github.com/openssl/openssl/blob/c0f9e23c6b8d1076796987d5a84557d410682d85/ssl/packet.c/#L25
d2a_code_trace_data_43874
DECLAREContigPutFunc(putgreytile) { int samplesperpixel = img->samplesperpixel; uint32** BWmap = img->BWmap; (void) y; while (h-- > 0) { for (x = w; x-- > 0;) { *cp++ = BWmap[*pp][0]; pp += samplesperpixel; } cp += toskew; pp += fromskew; } } libtiff/tif_getimage.c:1147: error: Integer Overflow L2 ([0, `w`] - 1):unsigned32. libtiff/tif_getimage.c:1140:1: <LHS trace> 1138. * 8-bit greyscale => colormap/RGB 1139. */ 1140. DECLAREContigPutFunc(putgreytile) ^ 1141. { 1142. int samplesperpixel = img->samplesperpixel; libtiff/tif_getimage.c:1140:1: Parameter `w` 1138. * 8-bit greyscale => colormap/RGB 1139. */ 1140. DECLAREContigPutFunc(putgreytile) ^ 1141. { 1142. int samplesperpixel = img->samplesperpixel; libtiff/tif_getimage.c:1147:7: Assignment 1145. (void) y; 1146. while (h-- > 0) { 1147. for (x = w; x-- > 0;) ^ 1148. { 1149. *cp++ = BWmap[*pp][0]; libtiff/tif_getimage.c:1147:14: Binary operation: ([0, w] - 1):unsigned32 1145. (void) y; 1146. while (h-- > 0) { 1147. for (x = w; x-- > 0;) ^ 1148. { 1149. *cp++ = BWmap[*pp][0];
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_getimage.c/#L1147
d2a_code_trace_data_43875
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/tak.c:145: error: Integer Overflow L2 ([1, +oo] - 6):unsigned32 by call to `bitstream_read`. libavcodec/tak.c:145:13: Call 143. avpriv_tak_parse_streaminfo(bc, ti); 144. 145. if (bitstream_read(bc, 6)) ^ 146. bitstream_skip(bc, 25); 147. bitstream_align(bc); libavcodec/bitstream.h:183:1: Parameter `n` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/bitstream.h:194:12: Call 192. } 193. 194. return get_val(bc, n); ^ 195. } 196. libavcodec/bitstream.h:130:1: <LHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `bc->bits_left` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: <RHS trace> 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Binary operation: ([1, +oo] - 6):unsigned32 by call to `bitstream_read` 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret;
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
d2a_code_trace_data_43876
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:3129: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 4]):unsigned64 by call to `WPACKET_put_bytes__`. Showing all 12 steps of the trace ssl/t1_lib.c:3129:10: Call 3127. if (sig_id == -1) 3128. return 0; 3129. if (!WPACKET_put_bytes_u8(pkt, md_id) || !WPACKET_put_bytes_u8(pkt, sig_id)) ^ 3130. return 0; 3131. 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:3129:47: Call 3127. if (sig_id == -1) 3128. return 0; 3129. if (!WPACKET_put_bytes_u8(pkt, md_id) || !WPACKET_put_bytes_u8(pkt, sig_id)) ^ 3130. return 0; 3131. ssl/packet.c:261:1: Parameter `pkt->written` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; ssl/packet.c:269:17: Call 267. 268. if (size > sizeof(unsigned int) 269. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 270. || !put_value(data, val, size)) 271. return 0; ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 4]):unsigned64 by call to `WPACKET_put_bytes__` 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_43877
static int decode_rle(CamtasiaContext *c, unsigned int srcsize) { unsigned char *src = c->decomp_buf; unsigned char *output, *output_end; int p1, p2, line=c->height, pos=0, i; uint16_t pix16; uint32_t pix32; output = c->pic.data[0] + (c->height - 1) * c->pic.linesize[0]; output_end = c->pic.data[0] + (c->height) * c->pic.linesize[0]; while(src < c->decomp_buf + srcsize) { p1 = *src++; if(p1 == 0) { p2 = *src++; if(p2 == 0) { output = c->pic.data[0] + (--line) * c->pic.linesize[0]; if (line < 0) return -1; pos = 0; continue; } else if(p2 == 1) { return 0; } else if(p2 == 2) { p1 = *src++; p2 = *src++; line -= p2; if (line < 0) return -1; pos += p1; output = c->pic.data[0] + line * c->pic.linesize[0] + pos * (c->bpp / 8); continue; } if (output + p2 * (c->bpp / 8) > output_end) { src += p2 * (c->bpp / 8); continue; } if ((c->bpp == 8) || (c->bpp == 24)) { for(i = 0; i < p2 * (c->bpp / 8); i++) { *output++ = *src++; } if(c->bpp == 8 && (p2 & 1)) { src++; } } else if (c->bpp == 16) { for(i = 0; i < p2; i++) { pix16 = AV_RL16(src); src += 2; *(uint16_t*)output = pix16; output += 2; } } else if (c->bpp == 32) { for(i = 0; i < p2; i++) { pix32 = AV_RL32(src); src += 4; *(uint32_t*)output = pix32; output += 4; } } pos += p2; } else { int pix[4]; switch(c->bpp){ case 8: pix[0] = *src++; break; case 16: pix16 = AV_RL16(src); src += 2; *(uint16_t*)pix = pix16; break; case 24: pix[0] = *src++; pix[1] = *src++; pix[2] = *src++; break; case 32: pix32 = AV_RL32(src); src += 4; *(uint32_t*)pix = pix32; break; } if (output + p1 * (c->bpp / 8) > output_end) continue; for(i = 0; i < p1; i++) { switch(c->bpp){ case 8: *output++ = pix[0]; break; case 16: *(uint16_t*)output = pix16; output += 2; break; case 24: *output++ = pix[0]; *output++ = pix[1]; *output++ = pix[2]; break; case 32: *(uint32_t*)output = pix32; output += 4; break; } } pos += p1; } } av_log(c->avctx, AV_LOG_ERROR, "Camtasia warning: no End-of-picture code\n"); return 1; } libavcodec/tscc.c:158: error: Uninitialized Value The value read from pix[_] was never initialized. libavcodec/tscc.c:158:26: 156. for(i = 0; i < p1; i++) { 157. switch(c->bpp){ 158. case 8: *output++ = pix[0]; ^ 159. break; 160. case 16: *(uint16_t*)output = pix16;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/tscc.c/#L158
d2a_code_trace_data_43878
c448_error_t c448_ed448_verify( const uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], const uint8_t *message, size_t message_len, uint8_t prehashed, const uint8_t *context, uint8_t context_len) { curve448_point_t pk_point, r_point; c448_error_t error = curve448_point_decode_like_eddsa_and_mul_by_ratio(pk_point, pubkey); curve448_scalar_t challenge_scalar; curve448_scalar_t response_scalar; if (C448_SUCCESS != error) return error; error = curve448_point_decode_like_eddsa_and_mul_by_ratio(r_point, signature); if (C448_SUCCESS != error) return error; { EVP_MD_CTX *hashctx = EVP_MD_CTX_new(); uint8_t challenge[2 * EDDSA_448_PRIVATE_BYTES]; if (hashctx == NULL || !hash_init_with_dom(hashctx, prehashed, 0, context, context_len) || !EVP_DigestUpdate(hashctx, signature, EDDSA_448_PUBLIC_BYTES) || !EVP_DigestUpdate(hashctx, pubkey, EDDSA_448_PUBLIC_BYTES) || !EVP_DigestUpdate(hashctx, message, message_len) || !EVP_DigestFinalXOF(hashctx, challenge, sizeof(challenge))) { EVP_MD_CTX_free(hashctx); return C448_FAILURE; } EVP_MD_CTX_free(hashctx); curve448_scalar_decode_long(challenge_scalar, challenge, sizeof(challenge)); OPENSSL_cleanse(challenge, sizeof(challenge)); } curve448_scalar_sub(challenge_scalar, curve448_scalar_zero, challenge_scalar); curve448_scalar_decode_long(response_scalar, &signature[EDDSA_448_PUBLIC_BYTES], EDDSA_448_PRIVATE_BYTES); curve448_base_double_scalarmul_non_secret(pk_point, response_scalar, pk_point, challenge_scalar); return c448_succeed_if(curve448_point_eq(pk_point, r_point)); } crypto/ec/curve448/eddsa.c:274: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 264, column 31 is not reachable after line 274, column 13. Showing all 45 steps of the trace crypto/ec/curve448/eddsa.c:241:1: start of procedure c448_ed448_verify() 239. } 240. 241. > c448_error_t c448_ed448_verify( 242. const uint8_t signature[EDDSA_448_SIGNATURE_BYTES], 243. const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], crypto/ec/curve448/eddsa.c:249:5: Skipping curve448_point_decode_like_eddsa_and_mul_by_ratio(): empty list of specs 247. { 248. curve448_point_t pk_point, r_point; 249. c448_error_t error = ^ 250. curve448_point_decode_like_eddsa_and_mul_by_ratio(pk_point, pubkey); 251. curve448_scalar_t challenge_scalar; crypto/ec/curve448/eddsa.c:254:9: Taking false branch 252. curve448_scalar_t response_scalar; 253. 254. if (C448_SUCCESS != error) ^ 255. return error; 256. crypto/ec/curve448/eddsa.c:257:5: Skipping curve448_point_decode_like_eddsa_and_mul_by_ratio(): empty list of specs 255. return error; 256. 257. error = ^ 258. curve448_point_decode_like_eddsa_and_mul_by_ratio(r_point, signature); 259. if (C448_SUCCESS != error) crypto/ec/curve448/eddsa.c:259:9: Taking false branch 257. error = 258. curve448_point_decode_like_eddsa_and_mul_by_ratio(r_point, signature); 259. if (C448_SUCCESS != error) ^ 260. return error; 261. crypto/ec/curve448/eddsa.c:264:9: 262. { 263. /* Compute the challenge */ 264. > EVP_MD_CTX *hashctx = EVP_MD_CTX_new(); 265. uint8_t challenge[2 * EDDSA_448_PRIVATE_BYTES]; 266. crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_new() 47. } 48. 49. > EVP_MD_CTX *EVP_MD_CTX_new(void) 50. { 51. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:51:5: 49. EVP_MD_CTX *EVP_MD_CTX_new(void) 50. { 51. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 52. } 53. crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking true branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:234:9: 232. FAILTEST(); 233. if (ret != NULL) 234. > memset(ret, 0, num); 235. return ret; 236. } crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:52:1: return from a call to EVP_MD_CTX_new 50. { 51. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 52. > } 53. 54. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) crypto/ec/curve448/eddsa.c:267:13: Taking false branch 265. uint8_t challenge[2 * EDDSA_448_PRIVATE_BYTES]; 266. 267. if (hashctx == NULL ^ 268. || !hash_init_with_dom(hashctx, prehashed, 0, context, 269. context_len) crypto/ec/curve448/eddsa.c:268:21: 266. 267. if (hashctx == NULL 268. > || !hash_init_with_dom(hashctx, prehashed, 0, context, 269. context_len) 270. || !EVP_DigestUpdate(hashctx, signature, EDDSA_448_PUBLIC_BYTES) crypto/ec/curve448/eddsa.c:48:1: start of procedure hash_init_with_dom() 46. } 47. 48. > static c448_error_t hash_init_with_dom(EVP_MD_CTX *hashctx, uint8_t prehashed, 49. uint8_t for_prehash, 50. const uint8_t *context, crypto/ec/curve448/eddsa.c:53:5: 51. size_t context_len) 52. { 53. > const char *dom_s = "SigEd448"; 54. uint8_t dom[2]; 55. crypto/ec/curve448/eddsa.c:56:9: Taking true branch 54. uint8_t dom[2]; 55. 56. if (context_len > UINT8_MAX) ^ 57. return C448_FAILURE; 58. crypto/ec/curve448/eddsa.c:57:9: 55. 56. if (context_len > UINT8_MAX) 57. > return C448_FAILURE; 58. 59. dom[0] = (uint8_t)(2 - (prehashed == 0 ? 1 : 0) crypto/ec/curve448/eddsa.c:70:1: return from a call to hash_init_with_dom 68. 69. return C448_SUCCESS; 70. > } 71. 72. /* In this file because it uses the hash */ crypto/ec/curve448/eddsa.c:268:21: Taking true branch 266. 267. if (hashctx == NULL 268. || !hash_init_with_dom(hashctx, prehashed, 0, context, ^ 269. context_len) 270. || !EVP_DigestUpdate(hashctx, signature, EDDSA_448_PUBLIC_BYTES) crypto/ec/curve448/eddsa.c:274:13: 272. || !EVP_DigestUpdate(hashctx, message, message_len) 273. || !EVP_DigestFinalXOF(hashctx, challenge, sizeof(challenge))) { 274. > EVP_MD_CTX_free(hashctx); 275. return C448_FAILURE; 276. } crypto/evp/digest.c:54:1: start of procedure EVP_MD_CTX_free() 52. } 53. 54. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 55. { 56. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:56:5: Skipping EVP_MD_CTX_reset(): empty list of specs 54. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 55. { 56. EVP_MD_CTX_reset(ctx); ^ 57. OPENSSL_free(ctx); 58. } crypto/evp/digest.c:57:5: 55. { 56. EVP_MD_CTX_reset(ctx); 57. > OPENSSL_free(ctx); 58. } 59. crypto/mem.c:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:298:30: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); ^ 300. return; 301. } crypto/mem.c:300:9: 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); 300. > return; 301. } 302. crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:58:1: return from a call to EVP_MD_CTX_free 56. EVP_MD_CTX_reset(ctx); 57. OPENSSL_free(ctx); 58. > } 59. 60. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
https://github.com/openssl/openssl/blob/275a7b9e5eef3af2834b734b42c5054149ff5e87/crypto/ec/curve448/eddsa.c/#L274
d2a_code_trace_data_43879
static void info_cb(const SSL *s, int where, int ret) { if (where & SSL_CB_ALERT) { HANDSHAKE_EX_DATA *ex_data = (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); if (where & SSL_CB_WRITE) { ex_data->alert_sent = ret; if (strcmp(SSL_alert_type_string(ret), "F") == 0 || strcmp(SSL_alert_desc_string(ret), "CN") == 0) ex_data->num_fatal_alerts_sent++; } else { ex_data->alert_received = ret; } } } test/handshake_helper.c:95: error: NULL_DEREFERENCE pointer `ex_data` last assigned on line 87 could be null and is dereferenced at line 95, column 13. Showing all 12 steps of the trace test/handshake_helper.c:84:1: start of procedure info_cb() 82. static int ex_data_idx; 83. 84. > static void info_cb(const SSL *s, int where, int ret) 85. { 86. if (where & SSL_CB_ALERT) { test/handshake_helper.c:86:9: Taking true branch 84. static void info_cb(const SSL *s, int where, int ret) 85. { 86. if (where & SSL_CB_ALERT) { ^ 87. HANDSHAKE_EX_DATA *ex_data = 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); test/handshake_helper.c:87:9: 85. { 86. if (where & SSL_CB_ALERT) { 87. > HANDSHAKE_EX_DATA *ex_data = 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 89. if (where & SSL_CB_WRITE) { ssl/ssl_lib.c:3729:1: start of procedure SSL_get_ex_data() 3727. } 3728. 3729. > void *SSL_get_ex_data(const SSL *s, int idx) 3730. { 3731. return (CRYPTO_get_ex_data(&s->ex_data, idx)); ssl/ssl_lib.c:3731:5: 3729. void *SSL_get_ex_data(const SSL *s, int idx) 3730. { 3731. > return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3732. } 3733. crypto/ex_data.c:387:1: start of procedure CRYPTO_get_ex_data() 385. * particular index in the class used by this variable 386. */ 387. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:389:9: Taking true branch 387. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 390. return NULL; 391. return sk_void_value(ad->sk, idx); crypto/ex_data.c:390:9: 388. { 389. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 390. > return NULL; 391. return sk_void_value(ad->sk, idx); 392. } crypto/ex_data.c:392:1: return from a call to CRYPTO_get_ex_data 390. return NULL; 391. return sk_void_value(ad->sk, idx); 392. > } ssl/ssl_lib.c:3732:1: return from a call to SSL_get_ex_data 3730. { 3731. return (CRYPTO_get_ex_data(&s->ex_data, idx)); 3732. > } 3733. 3734. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) test/handshake_helper.c:89:13: Taking false branch 87. HANDSHAKE_EX_DATA *ex_data = 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 89. if (where & SSL_CB_WRITE) { ^ 90. ex_data->alert_sent = ret; 91. if (strcmp(SSL_alert_type_string(ret), "F") == 0 test/handshake_helper.c:95:13: 93. ex_data->num_fatal_alerts_sent++; 94. } else { 95. > ex_data->alert_received = ret; 96. } 97. }
https://github.com/openssl/openssl/blob/0f5df0f1037590de12cc11eeab26fe29bf3f16a3/test/handshake_helper.c/#L95
d2a_code_trace_data_43880
static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n) { int i, best; int32_t lt, rt; uint64_t sum[4]; uint64_t score[4]; sum[0] = sum[1] = sum[2] = sum[3] = 0; for (i = 2; i < n; i++) { lt = left_ch[i] - 2 * left_ch[i - 1] + left_ch[i - 2]; rt = right_ch[i] - 2 * right_ch[i - 1] + right_ch[i - 2]; sum[2] += FFABS((lt + rt) >> 1); sum[3] += FFABS(lt - rt); sum[0] += FFABS(lt); sum[1] += FFABS(rt); } score[0] = sum[0] + sum[1]; score[1] = sum[0] + sum[3]; score[2] = sum[1] + sum[3]; score[3] = sum[2] + sum[3]; best = 0; for (i = 1; i < 4; i++) { if (score[i] < score[best]) best = i; } return best; } libavcodec/alacenc.c:219: error: Buffer Overrun L1 Offset: [3, `s->frame_size`] (⇐ 1 + [2, `s->frame_size` - 1]) Size: 2 by call to `estimate_stereo_mode`. libavcodec/alacenc.c:213:1: Parameter `s->sample_buf[*]` 211. } 212. 213. static void alac_stereo_decorrelation(AlacEncodeContext *s) ^ 214. { 215. int32_t *left = s->sample_buf[0], *right = s->sample_buf[1]; libavcodec/alacenc.c:215:5: Assignment 213. static void alac_stereo_decorrelation(AlacEncodeContext *s) 214. { 215. int32_t *left = s->sample_buf[0], *right = s->sample_buf[1]; ^ 216. int i, mode, n = s->frame_size; 217. int32_t tmp; libavcodec/alacenc.c:219:12: Call 217. int32_t tmp; 218. 219. mode = estimate_stereo_mode(left, right, n); ^ 220. 221. switch (mode) { libavcodec/alacenc.c:180:1: <Offset trace> 178. } 179. 180. static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n) ^ 181. { 182. int i, best; libavcodec/alacenc.c:180:1: Parameter `n` 178. } 179. 180. static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n) ^ 181. { 182. int i, best; libavcodec/alacenc.c:180:1: <Length trace> 178. } 179. 180. static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n) ^ 181. { 182. int i, best; libavcodec/alacenc.c:180:1: Parameter `*right_ch` 178. } 179. 180. static int estimate_stereo_mode(int32_t *left_ch, int32_t *right_ch, int n) ^ 181. { 182. int i, best; libavcodec/alacenc.c:191:14: Array access: Offset: [3, s->frame_size] (⇐ 1 + [2, s->frame_size - 1]) Size: 2 by call to `estimate_stereo_mode` 189. for (i = 2; i < n; i++) { 190. lt = left_ch[i] - 2 * left_ch[i - 1] + left_ch[i - 2]; 191. rt = right_ch[i] - 2 * right_ch[i - 1] + right_ch[i - 2]; ^ 192. sum[2] += FFABS((lt + rt) >> 1); 193. sum[3] += FFABS(lt - rt);
https://github.com/libav/libav/blob/a8cb1746c5b6307b2e820f965a7da8d907893b38/libavcodec/alacenc.c/#L191
d2a_code_trace_data_43881
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) { PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | (diff > (0 - (PTRDIFF_T)len))); return overlapped; } crypto/pem/pvkfmt.c:700: error: INTEGER_OVERFLOW_L2 (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate`. Showing all 7 steps of the trace crypto/pem/pvkfmt.c:700:14: Call 698. if (!EVP_DecryptInit_ex(cctx, EVP_rc4(), NULL, keybuf, NULL)) 699. goto err; 700. if (!EVP_DecryptUpdate(cctx, q, &enctmplen, p, inlen)) ^ 701. goto err; 702. if (!EVP_DecryptFinal_ex(cctx, q + enctmplen, &enctmplen)) crypto/evp/evp_enc.c:416:1: Parameter `ctx->cipher->block_size` 414. } 415. 416. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 417. const unsigned char *in, int inl) 418. { crypto/evp/evp_enc.c:422:5: Assignment 420. unsigned int b; 421. 422. b = ctx->cipher->block_size; ^ 423. 424. if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { crypto/evp/evp_enc.c:452:16: Call 450. /* see comment about PTRDIFF_T comparison above */ 451. if (((PTRDIFF_T)out == (PTRDIFF_T)in) 452. || is_partially_overlapping(out, in, b)) { ^ 453. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING); 454. return 0; crypto/evp/evp_enc.c:279:1: <RHS trace> 277. #endif 278. 279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 280. { 281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:279:1: Parameter `len` 277. #endif 278. 279. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len) 280. { 281. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2; crypto/evp/evp_enc.c:288:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_DecryptUpdate` 286. */ 287. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) | 288. (diff > (0 - (PTRDIFF_T)len))); ^ 289. 290. return overlapped;
https://github.com/openssl/openssl/blob/b1531d8e6cc95837e38b10d875ae64144c6fdf7a/crypto/evp/evp_enc.c/#L288
d2a_code_trace_data_43882
DH *ssl_get_auto_dh(SSL *s) { int dh_secbits = 80; if (s->cert->dh_tmp_auto == 2) return DH_get_1024_160(); if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { if (s->s3->tmp.new_cipher->strength_bits == 256) dh_secbits = 128; else dh_secbits = 80; } else { CERT_PKEY *cpk = ssl_get_server_send_pkey(s); dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); } if (dh_secbits >= 128) { DH *dhp = DH_new(); BIGNUM *p, *g; if (dhp == NULL) return NULL; g = BN_new(); if (g != NULL) BN_set_word(g, 2); if (dh_secbits >= 192) p = BN_get_rfc3526_prime_8192(NULL); else p = BN_get_rfc3526_prime_3072(NULL); if (p == NULL || g == NULL || !DH_set0_pqg(dhp, p, NULL, g)) { DH_free(dhp); BN_free(p); BN_free(g); return NULL; } return dhp; } if (dh_secbits >= 112) return DH_get_2048_224(); return DH_get_1024_160(); } ssl/t1_lib.c:4296: error: NULL_DEREFERENCE pointer `cpk` last assigned on line 4295 could be null and is dereferenced at line 4296, column 45. Showing all 30 steps of the trace ssl/t1_lib.c:4284:1: start of procedure ssl_get_auto_dh() 4282. 4283. #ifndef OPENSSL_NO_DH 4284. > DH *ssl_get_auto_dh(SSL *s) 4285. { 4286. int dh_secbits = 80; ssl/t1_lib.c:4286:5: 4284. DH *ssl_get_auto_dh(SSL *s) 4285. { 4286. > int dh_secbits = 80; 4287. if (s->cert->dh_tmp_auto == 2) 4288. return DH_get_1024_160(); ssl/t1_lib.c:4287:9: Taking false branch 4285. { 4286. int dh_secbits = 80; 4287. if (s->cert->dh_tmp_auto == 2) ^ 4288. return DH_get_1024_160(); 4289. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ssl/t1_lib.c:4289:9: Taking false branch 4287. if (s->cert->dh_tmp_auto == 2) 4288. return DH_get_1024_160(); 4289. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) { ^ 4290. if (s->s3->tmp.new_cipher->strength_bits == 256) 4291. dh_secbits = 128; ssl/t1_lib.c:4295:9: 4293. dh_secbits = 80; 4294. } else { 4295. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 4296. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 4297. } ssl/ssl_lib.c:2857:1: start of procedure ssl_get_server_send_pkey() 2855. } 2856. 2857. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s) 2858. { 2859. CERT *c; ssl/ssl_lib.c:2862:5: 2860. int i; 2861. 2862. > c = s->cert; 2863. if (!s->s3 || !s->s3->tmp.new_cipher) 2864. return NULL; ssl/ssl_lib.c:2863:10: Taking false branch 2861. 2862. c = s->cert; 2863. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2864. return NULL; 2865. ssl_set_masks(s); ssl/ssl_lib.c:2863:20: Taking false branch 2861. 2862. c = s->cert; 2863. if (!s->s3 || !s->s3->tmp.new_cipher) ^ 2864. return NULL; 2865. ssl_set_masks(s); ssl/ssl_lib.c:2865:5: Skipping ssl_set_masks(): empty list of specs 2863. if (!s->s3 || !s->s3->tmp.new_cipher) 2864. return NULL; 2865. ssl_set_masks(s); ^ 2866. 2867. i = ssl_get_server_cert_index(s); ssl/ssl_lib.c:2867:5: 2865. ssl_set_masks(s); 2866. 2867. > i = ssl_get_server_cert_index(s); 2868. 2869. /* This may or may not be an error. */ ssl/ssl_lib.c:2836:1: start of procedure ssl_get_server_cert_index() 2834. #endif 2835. 2836. > static int ssl_get_server_cert_index(const SSL *s) 2837. { 2838. int idx; ssl/ssl_lib.c:2839:5: 2837. { 2838. int idx; 2839. > idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2840. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) 2841. idx = SSL_PKEY_RSA_SIGN; ssl/ssl_ciph.c:1893:1: start of procedure ssl_cipher_get_cert_index() 1891. 1892. /* For a cipher return the index corresponding to the certificate type */ 1893. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c) 1894. { 1895. uint32_t alg_a; ssl/ssl_ciph.c:1897:5: 1895. uint32_t alg_a; 1896. 1897. > alg_a = c->algorithm_auth; 1898. 1899. if (alg_a & SSL_aECDSA) ssl/ssl_ciph.c:1899:9: Taking false branch 1897. alg_a = c->algorithm_auth; 1898. 1899. if (alg_a & SSL_aECDSA) ^ 1900. return SSL_PKEY_ECC; 1901. else if (alg_a & SSL_aDSS) ssl/ssl_ciph.c:1901:14: Taking false branch 1899. if (alg_a & SSL_aECDSA) 1900. return SSL_PKEY_ECC; 1901. else if (alg_a & SSL_aDSS) ^ 1902. return SSL_PKEY_DSA_SIGN; 1903. else if (alg_a & SSL_aRSA) ssl/ssl_ciph.c:1903:14: Taking true branch 1901. else if (alg_a & SSL_aDSS) 1902. return SSL_PKEY_DSA_SIGN; 1903. else if (alg_a & SSL_aRSA) ^ 1904. return SSL_PKEY_RSA_ENC; 1905. else if (alg_a & SSL_aGOST12) ssl/ssl_ciph.c:1904:9: 1902. return SSL_PKEY_DSA_SIGN; 1903. else if (alg_a & SSL_aRSA) 1904. > return SSL_PKEY_RSA_ENC; 1905. else if (alg_a & SSL_aGOST12) 1906. return SSL_PKEY_GOST_EC; ssl/ssl_ciph.c:1911:1: return from a call to ssl_cipher_get_cert_index 1909. 1910. return -1; 1911. > } 1912. 1913. const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr) ssl/ssl_lib.c:2840:9: Taking true branch 2838. int idx; 2839. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2840. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) ^ 2841. idx = SSL_PKEY_RSA_SIGN; 2842. if (idx == SSL_PKEY_GOST_EC) { ssl/ssl_lib.c:2840:37: Taking false branch 2838. int idx; 2839. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher); 2840. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) ^ 2841. idx = SSL_PKEY_RSA_SIGN; 2842. if (idx == SSL_PKEY_GOST_EC) { ssl/ssl_lib.c:2842:9: Taking false branch 2840. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509) 2841. idx = SSL_PKEY_RSA_SIGN; 2842. if (idx == SSL_PKEY_GOST_EC) { ^ 2843. if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509) 2844. idx = SSL_PKEY_GOST12_512; ssl/ssl_lib.c:2852:9: Taking false branch 2850. idx = -1; 2851. } 2852. if (idx == -1) ^ 2853. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2854. return idx; ssl/ssl_lib.c:2854:5: 2852. if (idx == -1) 2853. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2854. > return idx; 2855. } 2856. ssl/ssl_lib.c:2855:1: return from a call to ssl_get_server_cert_index 2853. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR); 2854. return idx; 2855. > } 2856. 2857. CERT_PKEY *ssl_get_server_send_pkey(SSL *s) ssl/ssl_lib.c:2870:9: Taking true branch 2868. 2869. /* This may or may not be an error. */ 2870. if (i < 0) ^ 2871. return NULL; 2872. ssl/ssl_lib.c:2871:9: 2869. /* This may or may not be an error. */ 2870. if (i < 0) 2871. > return NULL; 2872. 2873. /* May be NULL. */ ssl/ssl_lib.c:2875:1: return from a call to ssl_get_server_send_pkey 2873. /* May be NULL. */ 2874. return &c->pkeys[i]; 2875. > } 2876. 2877. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, ssl/t1_lib.c:4296:9: 4294. } else { 4295. CERT_PKEY *cpk = ssl_get_server_send_pkey(s); 4296. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey); 4297. } 4298.
https://github.com/openssl/openssl/blob/f7a39a5a3f7f91e0d1ba0030323eef26bc8ccddf/ssl/t1_lib.c/#L4296
d2a_code_trace_data_43883
static int vp3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; int i; init_get_bits(&gb, buf, buf_size * 8); if (s->theora && get_bits1(&gb)) { av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n"); return -1; } s->keyframe = !get_bits1(&gb); if (!s->theora) skip_bits(&gb, 1); for (i = 0; i < 3; i++) s->last_qps[i] = s->qps[i]; s->nqps=0; do{ s->qps[s->nqps++]= get_bits(&gb, 6); } while(s->theora >= 0x030200 && s->nqps<3 && get_bits1(&gb)); for (i = s->nqps; i < 3; i++) s->qps[i] = -1; if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n", s->keyframe?"key":"", avctx->frame_number+1, s->qps[0]); s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] || avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL : AVDISCARD_NONKEY); if (s->qps[0] != s->last_qps[0]) init_loop_filter(s); for (i = 0; i < s->nqps; i++) if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0]) init_dequantizer(s, i); if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe) return buf_size; s->current_frame.reference = 3; s->current_frame.pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; if (ff_thread_get_buffer(avctx, &s->current_frame) < 0) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); goto error; } if (!s->edge_emu_buffer) s->edge_emu_buffer = av_malloc(9*FFABS(s->current_frame.linesize[0])); if (s->keyframe) { if (!s->theora) { skip_bits(&gb, 4); skip_bits(&gb, 4); if (s->version) { s->version = get_bits(&gb, 5); if (avctx->frame_number == 0) av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version); } } if (s->version || s->theora) { if (get_bits1(&gb)) av_log(s->avctx, AV_LOG_ERROR, "Warning, unsupported keyframe coding type?!\n"); skip_bits(&gb, 2); } } else { if (!s->golden_frame.data[0]) { av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n"); s->golden_frame.reference = 3; s->golden_frame.pict_type = AV_PICTURE_TYPE_I; if (ff_thread_get_buffer(avctx, &s->golden_frame) < 0) { av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); goto error; } s->last_frame = s->golden_frame; s->last_frame.type = FF_BUFFER_TYPE_COPY; ff_thread_report_progress(&s->last_frame, INT_MAX, 0); } } memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment)); ff_thread_finish_setup(avctx); if (unpack_superblocks(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n"); goto error; } if (unpack_modes(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n"); goto error; } if (unpack_vectors(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n"); goto error; } if (unpack_block_qpis(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_block_qpis\n"); goto error; } if (unpack_dct_coeffs(s, &gb)){ av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n"); goto error; } for (i = 0; i < 3; i++) { int height = s->height >> (i && s->chroma_y_shift); if (s->flipped_image) s->data_offset[i] = 0; else s->data_offset[i] = (height-1) * s->current_frame.linesize[i]; } s->last_slice_end = 0; for (i = 0; i < s->c_superblock_height; i++) render_slice(s, i); for (i = 0; i < 3; i++) { int row = (s->height >> (3+(i && s->chroma_y_shift))) - 1; apply_loop_filter(s, i, row, row+1); } vp3_draw_horiz_band(s, s->avctx->height); *data_size=sizeof(AVFrame); *(AVFrame*)data= s->current_frame; if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME)) update_frames(avctx); return buf_size; error: ff_thread_report_progress(&s->current_frame, INT_MAX, 0); if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME)) avctx->release_buffer(avctx, &s->current_frame); return -1; } libavcodec/vp3.c:1910: error: Null Dereference pointer `&gb->buffer` last assigned on line 1908 could be null and is dereferenced by call to `get_bits1()` at line 1910, column 22. libavcodec/vp3.c:1898:1: start of procedure vp3_decode_frame() 1896. } 1897. 1898. static int vp3_decode_frame(AVCodecContext *avctx, ^ 1899. void *data, int *data_size, 1900. AVPacket *avpkt) libavcodec/vp3.c:1902:5: 1900. AVPacket *avpkt) 1901. { 1902. const uint8_t *buf = avpkt->data; ^ 1903. int buf_size = avpkt->size; 1904. Vp3DecodeContext *s = avctx->priv_data; libavcodec/vp3.c:1903:5: 1901. { 1902. const uint8_t *buf = avpkt->data; 1903. int buf_size = avpkt->size; ^ 1904. Vp3DecodeContext *s = avctx->priv_data; 1905. GetBitContext gb; libavcodec/vp3.c:1904:5: 1902. const uint8_t *buf = avpkt->data; 1903. int buf_size = avpkt->size; 1904. Vp3DecodeContext *s = avctx->priv_data; ^ 1905. GetBitContext gb; 1906. int i; libavcodec/vp3.c:1908:5: 1906. int i; 1907. 1908. init_get_bits(&gb, buf, buf_size * 8); ^ 1909. 1910. if (s->theora && get_bits1(&gb)) libavcodec/get_bits.h:339:1: start of procedure init_get_bits() 337. * @param bit_size the size of the buffer in bits 338. */ 339. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer, ^ 340. int bit_size) 341. { libavcodec/get_bits.h:342:5: 340. int bit_size) 341. { 342. int buffer_size = (bit_size+7)>>3; ^ 343. if (buffer_size < 0 || bit_size < 0) { 344. buffer_size = bit_size = 0; libavcodec/get_bits.h:343:9: Taking true branch 341. { 342. int buffer_size = (bit_size+7)>>3; 343. if (buffer_size < 0 || bit_size < 0) { ^ 344. buffer_size = bit_size = 0; 345. buffer = NULL; libavcodec/get_bits.h:344:9: 342. int buffer_size = (bit_size+7)>>3; 343. if (buffer_size < 0 || bit_size < 0) { 344. buffer_size = bit_size = 0; ^ 345. buffer = NULL; 346. } libavcodec/get_bits.h:345:9: 343. if (buffer_size < 0 || bit_size < 0) { 344. buffer_size = bit_size = 0; 345. buffer = NULL; ^ 346. } 347. libavcodec/get_bits.h:348:5: 346. } 347. 348. s->buffer = buffer; ^ 349. s->size_in_bits = bit_size; 350. #if !UNCHECKED_BITSTREAM_READER libavcodec/get_bits.h:349:5: 347. 348. s->buffer = buffer; 349. s->size_in_bits = bit_size; ^ 350. #if !UNCHECKED_BITSTREAM_READER 351. s->size_in_bits_plus8 = bit_size + 8; libavcodec/get_bits.h:351:5: 349. s->size_in_bits = bit_size; 350. #if !UNCHECKED_BITSTREAM_READER 351. s->size_in_bits_plus8 = bit_size + 8; ^ 352. #endif 353. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:353:5: 351. s->size_in_bits_plus8 = bit_size + 8; 352. #endif 353. s->buffer_end = buffer + buffer_size; ^ 354. s->index = 0; 355. } libavcodec/get_bits.h:354:5: 352. #endif 353. s->buffer_end = buffer + buffer_size; 354. s->index = 0; ^ 355. } 356. libavcodec/get_bits.h:355:1: return from a call to init_get_bits 353. s->buffer_end = buffer + buffer_size; 354. s->index = 0; 355. } ^ 356. 357. static inline void align_get_bits(GetBitContext *s) libavcodec/vp3.c:1910:9: Taking true branch 1908. init_get_bits(&gb, buf, buf_size * 8); 1909. 1910. if (s->theora && get_bits1(&gb)) ^ 1911. { 1912. av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n"); libavcodec/vp3.c:1910:22: 1908. init_get_bits(&gb, buf, buf_size * 8); 1909. 1910. if (s->theora && get_bits1(&gb)) ^ 1911. { 1912. av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n"); libavcodec/get_bits.h:255:1: start of procedure get_bits1() 253. } 254. 255. static inline unsigned int get_bits1(GetBitContext *s) ^ 256. { 257. unsigned int index = s->index; libavcodec/get_bits.h:257:5: 255. static inline unsigned int get_bits1(GetBitContext *s) 256. { 257. unsigned int index = s->index; ^ 258. uint8_t result = s->buffer[index>>3]; 259. #ifdef ALT_BITSTREAM_READER_LE libavcodec/get_bits.h:258:5: 256. { 257. unsigned int index = s->index; 258. uint8_t result = s->buffer[index>>3]; ^ 259. #ifdef ALT_BITSTREAM_READER_LE 260. result >>= index & 7;
https://github.com/libav/libav/blob/9f3c77dd2a4fa4accf102c2af1f22567652b8e0f/libavcodec/vp3.c/#L1910
d2a_code_trace_data_43884
static int ssl3_get_record(SSL *s) { int ssl_major,ssl_minor,al; int n,i,ret= -1; SSL3_RECORD *rr; SSL_SESSION *sess; unsigned char *p; unsigned char md[EVP_MAX_MD_SIZE]; short version; unsigned int mac_size; int clear=0,extra; rr= &(s->s3->rrec); sess=s->session; if (s->options & SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER) extra=SSL3_RT_MAX_EXTRA; else extra=0; again: if ( (s->rstate != SSL_ST_READ_BODY) || (s->packet_length < SSL3_RT_HEADER_LENGTH)) { n=ssl3_read_n(s,SSL3_RT_HEADER_LENGTH, SSL3_RT_MAX_PACKET_SIZE,0); if (n <= 0) return(n); s->rstate=SSL_ST_READ_BODY; p=s->packet; rr->type= *(p++); ssl_major= *(p++); ssl_minor= *(p++); version=(ssl_major<<8)|ssl_minor; n2s(p,rr->length); if (s->first_packet) { s->first_packet=0; } else { if (version != s->version) { SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_WRONG_VERSION_NUMBER); s->version=version; al=SSL_AD_PROTOCOL_VERSION; goto f_err; } } if ((version>>8) != SSL3_VERSION_MAJOR) { SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_WRONG_VERSION_NUMBER); goto err; } if (rr->length > (unsigned int)SSL3_RT_MAX_ENCRYPTED_LENGTH+extra) { al=SSL_AD_RECORD_OVERFLOW; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_PACKET_LENGTH_TOO_LONG); goto f_err; } } if (rr->length > (s->packet_length-SSL3_RT_HEADER_LENGTH)) { i=rr->length; n=ssl3_read_n(s,i,i,1); if (n <= 0) return(n); } s->rstate=SSL_ST_READ_HEADER; rr->input= &(s->packet[SSL3_RT_HEADER_LENGTH]); if (rr->length > (unsigned int)SSL3_RT_MAX_ENCRYPTED_LENGTH+extra) { al=SSL_AD_RECORD_OVERFLOW; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_ENCRYPTED_LENGTH_TOO_LONG); goto f_err; } rr->data=rr->input; if (!s->method->ssl3_enc->enc(s,0)) { al=SSL_AD_DECRYPT_ERROR; goto f_err; } #ifdef TLS_DEBUG printf("dec %d\n",rr->length); { unsigned int z; for (z=0; z<rr->length; z++) printf("%02X%c",rr->data[z],((z+1)%16)?' ':'\n'); } printf("\n"); #endif if ( (sess == NULL) || (s->enc_read_ctx == NULL) || (s->read_hash == NULL)) clear=1; if (!clear) { mac_size=EVP_MD_size(s->read_hash); if (rr->length > SSL3_RT_MAX_COMPRESSED_LENGTH+extra+mac_size) { al=SSL_AD_RECORD_OVERFLOW; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_PRE_MAC_LENGTH_TOO_LONG); goto f_err; } if (rr->length < mac_size) { al=SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_LENGTH_TOO_SHORT); goto f_err; } rr->length-=mac_size; i=s->method->ssl3_enc->mac(s,md,0); if (memcmp(md,&(rr->data[rr->length]),mac_size) != 0) { al=SSL_AD_BAD_RECORD_MAC; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_BAD_MAC_DECODE); ret= -1; goto f_err; } } if (s->expand != NULL) { if (rr->length > (unsigned int)SSL3_RT_MAX_COMPRESSED_LENGTH+extra) { al=SSL_AD_RECORD_OVERFLOW; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_COMPRESSED_LENGTH_TOO_LONG); goto f_err; } if (!do_uncompress(s)) { al=SSL_AD_DECOMPRESSION_FAILURE; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_BAD_DECOMPRESSION); goto f_err; } } if (rr->length > (unsigned int)SSL3_RT_MAX_PLAIN_LENGTH+extra) { al=SSL_AD_RECORD_OVERFLOW; SSLerr(SSL_F_SSL3_GET_RECORD,SSL_R_DATA_LENGTH_TOO_LONG); goto f_err; } rr->off=0; s->packet_length=0; if (rr->length == 0) goto again; return(1); f_err: ssl3_send_alert(s,SSL3_AL_FATAL,al); err: return(ret); } ssl/s3_pkt.c:307: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 5):unsigned32. Showing all 3 steps of the trace ssl/s3_pkt.c:231:1: <LHS trace> 229. */ 230. /* used only by ssl3_read_bytes */ 231. > static int ssl3_get_record(SSL *s) 232. { 233. int ssl_major,ssl_minor,al; ssl/s3_pkt.c:231:1: Parameter `s->packet_length` 229. */ 230. /* used only by ssl3_read_bytes */ 231. > static int ssl3_get_record(SSL *s) 232. { 233. int ssl_major,ssl_minor,al; ssl/s3_pkt.c:307:6: Binary operation: ([0, +oo] - 5):unsigned32 305. /* s->rstate == SSL_ST_READ_BODY, get and decode the data */ 306. 307. if (rr->length > (s->packet_length-SSL3_RT_HEADER_LENGTH)) ^ 308. { 309. /* now s->packet_length == SSL3_RT_HEADER_LENGTH */
https://github.com/openssl/openssl/blob/dab6f09573742df94c4767663565aca3863f8173/ssl/s3_pkt.c/#L307
d2a_code_trace_data_43885
BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v) { BIGNUM *kv = NULL, *gb = NULL; BIGNUM *B = NULL, *k = NULL; BN_CTX *bn_ctx; if (b == NULL || N == NULL || g == NULL || v == NULL || (bn_ctx = BN_CTX_new()) == NULL) return NULL; if ((kv = BN_new()) == NULL || (gb = BN_new()) == NULL || (B = BN_new()) == NULL) goto err; if (!BN_mod_exp(gb, g, b, N, bn_ctx) || (k = srp_Calc_k(N, g)) == NULL || !BN_mod_mul(kv, v, k, N, bn_ctx) || !BN_mod_add(B, gb, kv, N, bn_ctx)) { BN_free(B); B = NULL; } err: BN_CTX_free(bn_ctx); BN_clear_free(kv); BN_clear_free(gb); BN_free(k); return B; } crypto/srp/srp_lib.c:195: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 186, column 41 is not reachable after line 195, column 9. Showing all 124 steps of the trace crypto/srp/srp_lib.c:175:1: start of procedure SRP_Calc_B() 173. } 174. 175. > BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v) 176. { 177. BIGNUM *kv = NULL, *gb = NULL; crypto/srp/srp_lib.c:177:5: 175. BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v) 176. { 177. > BIGNUM *kv = NULL, *gb = NULL; 178. BIGNUM *B = NULL, *k = NULL; 179. BN_CTX *bn_ctx; crypto/srp/srp_lib.c:178:5: 176. { 177. BIGNUM *kv = NULL, *gb = NULL; 178. > BIGNUM *B = NULL, *k = NULL; 179. BN_CTX *bn_ctx; 180. crypto/srp/srp_lib.c:181:9: Taking false branch 179. BN_CTX *bn_ctx; 180. 181. if (b == NULL || N == NULL || g == NULL || v == NULL || ^ 182. (bn_ctx = BN_CTX_new()) == NULL) 183. return NULL; crypto/srp/srp_lib.c:181:22: Taking false branch 179. BN_CTX *bn_ctx; 180. 181. if (b == NULL || N == NULL || g == NULL || v == NULL || ^ 182. (bn_ctx = BN_CTX_new()) == NULL) 183. return NULL; crypto/srp/srp_lib.c:181:35: Taking false branch 179. BN_CTX *bn_ctx; 180. 181. if (b == NULL || N == NULL || g == NULL || v == NULL || ^ 182. (bn_ctx = BN_CTX_new()) == NULL) 183. return NULL; crypto/srp/srp_lib.c:181:48: Taking false branch 179. BN_CTX *bn_ctx; 180. 181. if (b == NULL || N == NULL || g == NULL || v == NULL || ^ 182. (bn_ctx = BN_CTX_new()) == NULL) 183. return NULL; crypto/srp/srp_lib.c:182:9: 180. 181. if (b == NULL || N == NULL || g == NULL || v == NULL || 182. > (bn_ctx = BN_CTX_new()) == NULL) 183. return NULL; 184. crypto/bn/bn_ctx.c:189:1: start of procedure BN_CTX_new() 187. 188. 189. > BN_CTX *BN_CTX_new(void) 190. { 191. BN_CTX *ret; crypto/bn/bn_ctx.c:193:9: 191. BN_CTX *ret; 192. 193. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_ctx.c:193:9: Taking false branch 191. BN_CTX *ret; 192. 193. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/bn/bn_ctx.c:198:5: 196. } 197. /* Initialise the structure */ 198. > BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. return ret; crypto/bn/bn_ctx.c:335:1: start of procedure BN_POOL_init() 333. /***********/ 334. 335. > static void BN_POOL_init(BN_POOL *p) 336. { 337. p->head = p->current = p->tail = NULL; crypto/bn/bn_ctx.c:337:5: 335. static void BN_POOL_init(BN_POOL *p) 336. { 337. > p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. } crypto/bn/bn_ctx.c:338:5: 336. { 337. p->head = p->current = p->tail = NULL; 338. > p->used = p->size = 0; 339. } 340. crypto/bn/bn_ctx.c:339:1: return from a call to BN_POOL_init 337. p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. > } 340. 341. static void BN_POOL_finish(BN_POOL *p) crypto/bn/bn_ctx.c:199:5: 197. /* Initialise the structure */ 198. BN_POOL_init(&ret->pool); 199. > BN_STACK_init(&ret->stack); 200. return ret; 201. } crypto/bn/bn_ctx.c:294:1: start of procedure BN_STACK_init() 292. /************/ 293. 294. > static void BN_STACK_init(BN_STACK *st) 295. { 296. st->indexes = NULL; crypto/bn/bn_ctx.c:296:5: 294. static void BN_STACK_init(BN_STACK *st) 295. { 296. > st->indexes = NULL; 297. st->depth = st->size = 0; 298. } crypto/bn/bn_ctx.c:297:5: 295. { 296. st->indexes = NULL; 297. > st->depth = st->size = 0; 298. } 299. crypto/bn/bn_ctx.c:298:1: return from a call to BN_STACK_init 296. st->indexes = NULL; 297. st->depth = st->size = 0; 298. > } 299. 300. static void BN_STACK_finish(BN_STACK *st) crypto/bn/bn_ctx.c:200:5: 198. BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. > return ret; 201. } 202. crypto/bn/bn_ctx.c:201:1: return from a call to BN_CTX_new 199. BN_STACK_init(&ret->stack); 200. return ret; 201. > } 202. 203. BN_CTX *BN_CTX_secure_new(void) crypto/srp/srp_lib.c:182:9: Taking false branch 180. 181. if (b == NULL || N == NULL || g == NULL || v == NULL || 182. (bn_ctx = BN_CTX_new()) == NULL) ^ 183. return NULL; 184. crypto/srp/srp_lib.c:185:9: 183. return NULL; 184. 185. > if ((kv = BN_new()) == NULL || 186. (gb = BN_new()) == NULL || (B = BN_new()) == NULL) 187. goto err; crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) crypto/srp/srp_lib.c:185:9: Taking false branch 183. return NULL; 184. 185. if ((kv = BN_new()) == NULL || ^ 186. (gb = BN_new()) == NULL || (B = BN_new()) == NULL) 187. goto err; crypto/srp/srp_lib.c:186:9: 184. 185. if ((kv = BN_new()) == NULL || 186. > (gb = BN_new()) == NULL || (B = BN_new()) == NULL) 187. goto err; 188. crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) crypto/srp/srp_lib.c:186:9: Taking false branch 184. 185. if ((kv = BN_new()) == NULL || 186. (gb = BN_new()) == NULL || (B = BN_new()) == NULL) ^ 187. goto err; 188. crypto/srp/srp_lib.c:186:36: 184. 185. if ((kv = BN_new()) == NULL || 186. > (gb = BN_new()) == NULL || (B = BN_new()) == NULL) 187. goto err; 188. crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) crypto/srp/srp_lib.c:186:36: Taking false branch 184. 185. if ((kv = BN_new()) == NULL || 186. (gb = BN_new()) == NULL || (B = BN_new()) == NULL) ^ 187. goto err; 188. crypto/srp/srp_lib.c:191:10: Taking false branch 189. /* B = g**b + k*v */ 190. 191. if (!BN_mod_exp(gb, g, b, N, bn_ctx) ^ 192. || (k = srp_Calc_k(N, g)) == NULL 193. || !BN_mod_mul(kv, v, k, N, bn_ctx) crypto/srp/srp_lib.c:192:12: Taking false branch 190. 191. if (!BN_mod_exp(gb, g, b, N, bn_ctx) 192. || (k = srp_Calc_k(N, g)) == NULL ^ 193. || !BN_mod_mul(kv, v, k, N, bn_ctx) 194. || !BN_mod_add(B, gb, kv, N, bn_ctx)) { crypto/srp/srp_lib.c:193:13: Taking true branch 191. if (!BN_mod_exp(gb, g, b, N, bn_ctx) 192. || (k = srp_Calc_k(N, g)) == NULL 193. || !BN_mod_mul(kv, v, k, N, bn_ctx) ^ 194. || !BN_mod_add(B, gb, kv, N, bn_ctx)) { 195. BN_free(B); crypto/srp/srp_lib.c:195:9: 193. || !BN_mod_mul(kv, v, k, N, bn_ctx) 194. || !BN_mod_add(B, gb, kv, N, bn_ctx)) { 195. > BN_free(B); 196. B = NULL; 197. } crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/srp/srp_lib.c/#L195
d2a_code_trace_data_43886
static ossl_inline void packet_forward(PACKET *pkt, size_t len) { pkt->curr += len; pkt->remaining -= len; } test/sslapitest.c:3129: error: INTEGER_OVERFLOW_L2 ([0, 9223372036854775807] - 34):unsigned64 by call to `PACKET_forward`. Showing all 15 steps of the trace test/sslapitest.c:3117:19: Assignment 3115. long len; 3116. unsigned char *data; 3117. PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0}; ^ 3118. unsigned int MFL_code = 0, type = 0; 3119. test/sslapitest.c:3123:10: Call 3121. goto end; 3122. 3123. if (!TEST_true( PACKET_buf_init( &pkt, data, len ) ) ^ 3124. /* Skip the record header */ 3125. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH) ssl/packet_locl.h:72:8: Parameter `pkt->remaining` 70. * is being used. 71. */ 72. __owur static ossl_inline int PACKET_buf_init(PACKET *pkt, ^ 73. const unsigned char *buf, 74. size_t len) test/sslapitest.c:3125:17: Call 3123. if (!TEST_true( PACKET_buf_init( &pkt, data, len ) ) 3124. /* Skip the record header */ 3125. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH) ^ 3126. /* Skip the handshake message header */ 3127. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH)) ssl/packet_locl.h:467:8: Parameter `len` 465. 466. /* Move the current reading position forward |len| bytes */ 467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len) ^ 468. { 469. if (PACKET_remaining(pkt) < len) test/sslapitest.c:3127:17: Call 3125. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH) 3126. /* Skip the handshake message header */ 3127. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH)) ^ 3128. /* Skip client version and random */ 3129. || !TEST_true(PACKET_forward(&pkt, CLIENT_VERSION_LEN ssl/packet_locl.h:467:8: Parameter `len` 465. 466. /* Move the current reading position forward |len| bytes */ 467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len) ^ 468. { 469. if (PACKET_remaining(pkt) < len) test/sslapitest.c:3129:17: Call 3127. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH)) 3128. /* Skip client version and random */ 3129. || !TEST_true(PACKET_forward(&pkt, CLIENT_VERSION_LEN ^ 3130. + SSL3_RANDOM_SIZE)) 3131. /* Skip session id */ ssl/packet_locl.h:467:8: Parameter `len` 465. 466. /* Move the current reading position forward |len| bytes */ 467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len) ^ 468. { 469. if (PACKET_remaining(pkt) < len) ssl/packet_locl.h:472:5: Call 470. return 0; 471. 472. packet_forward(pkt, len); ^ 473. 474. return 1; ssl/packet_locl.h:33:1: <LHS trace> 31. 32. /* Internal unchecked shorthand; don't use outside this file. */ 33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len) 34. { 35. pkt->curr += len; ssl/packet_locl.h:33:1: Parameter `pkt->remaining` 31. 32. /* Internal unchecked shorthand; don't use outside this file. */ 33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len) 34. { 35. pkt->curr += len; ssl/packet_locl.h:33:1: <RHS trace> 31. 32. /* Internal unchecked shorthand; don't use outside this file. */ 33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len) 34. { 35. pkt->curr += len; ssl/packet_locl.h:33:1: Parameter `len` 31. 32. /* Internal unchecked shorthand; don't use outside this file. */ 33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len) 34. { 35. pkt->curr += len; ssl/packet_locl.h:36:5: Binary operation: ([0, 9223372036854775807] - 34):unsigned64 by call to `PACKET_forward` 34. { 35. pkt->curr += len; 36. pkt->remaining -= len; ^ 37. } 38.
https://github.com/openssl/openssl/blob/9f5671c7e9f30dfa53b1a2b553f234c2761ceb66/ssl/packet_locl.h/#L36
d2a_code_trace_data_43887
char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) { const X509_NAME_ENTRY *ne; int i; int n, lold, l, l1, l2, num, j, type; const char *s; char *p; unsigned char *q; BUF_MEM *b = NULL; static const char hex[17] = "0123456789ABCDEF"; int gs_doit[4]; char tmp_buf[80]; #ifdef CHARSET_EBCDIC unsigned char ebcdic_buf[1024]; #endif if (buf == NULL) { if ((b = BUF_MEM_new()) == NULL) goto err; if (!BUF_MEM_grow(b, 200)) goto err; b->data[0] = '\0'; len = 200; } else if (len == 0) { return NULL; } if (a == NULL) { if (b) { buf = b->data; OPENSSL_free(b); } strncpy(buf, "NO X509_NAME", len); buf[len - 1] = '\0'; return buf; } len--; l = 0; for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { ne = sk_X509_NAME_ENTRY_value(a->entries, i); n = OBJ_obj2nid(ne->object); if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) { i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object); s = tmp_buf; } l1 = strlen(s); type = ne->value->type; num = ne->value->length; if (num > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_IA5STRING) { if (num > (int)sizeof(ebcdic_buf)) num = sizeof(ebcdic_buf); ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) { gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0; for (j = 0; j < num; j++) if (q[j] != 0) gs_doit[j & 3] = 1; if (gs_doit[0] | gs_doit[1] | gs_doit[2]) gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; else { gs_doit[0] = gs_doit[1] = gs_doit[2] = 0; gs_doit[3] = 1; } } else gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; for (l2 = j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; l2++; #ifndef CHARSET_EBCDIC if ((q[j] < ' ') || (q[j] > '~')) l2 += 3; #else if ((os_toascii[q[j]] < os_toascii[' ']) || (os_toascii[q[j]] > os_toascii['~'])) l2 += 3; #endif } lold = l; l += 1 + l1 + 1 + l2; if (l > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; p = &(b->data[lold]); } else if (l > len) { break; } else p = &(buf[lold]); *(p++) = '/'; memcpy(p, s, (unsigned int)l1); p += l1; *(p++) = '='; #ifndef CHARSET_EBCDIC q = ne->value->data; #endif for (j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; #ifndef CHARSET_EBCDIC n = q[j]; if ((n < ' ') || (n > '~')) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = n; #else n = os_toascii[q[j]]; if ((n < os_toascii[' ']) || (n > os_toascii['~'])) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = q[j]; #endif } *p = '\0'; } if (b != NULL) { p = b->data; OPENSSL_free(b); } else p = buf; if (i == 0) *p = '\0'; return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); end: BUF_MEM_free(b); return (NULL); } apps/apps.c:1139: error: BUFFER_OVERRUN_L3 Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace apps/apps.c:1139:15: Call 1137. } 1138. if (lflags == XN_FLAG_COMPAT) { 1139. buf = X509_NAME_oneline(nm, 0, 0); ^ 1140. BIO_puts(out, buf); 1141. BIO_puts(out, "\n"); crypto/x509/x509_obj.c:25:1: <Offset trace> 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: Parameter `len` 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: <Length trace> 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: Parameter `*buf` 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:57:9: Array access: Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline` 55. } 56. strncpy(buf, "NO X509_NAME", len); 57. buf[len - 1] = '\0'; ^ 58. return buf; 59. }
https://github.com/openssl/openssl/blob/cdb2a60347f988037d29adc7e4415e9c66c8a5a5/crypto/x509/x509_obj.c/#L57
d2a_code_trace_data_43888
STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, STACK_OF(SSL_CIPHER) *tls13_ciphersuites, STACK_OF(SSL_CIPHER) **cipher_list, STACK_OF(SSL_CIPHER) **cipher_list_by_id, const char *rule_str, CERT *c) { int ok, num_of_ciphers, num_of_alias_max, num_of_group_aliases, i; uint32_t disabled_mkey, disabled_auth, disabled_enc, disabled_mac; STACK_OF(SSL_CIPHER) *cipherstack; const char *rule_p; CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr; const SSL_CIPHER **ca_list = NULL; if (rule_str == NULL || cipher_list == NULL || cipher_list_by_id == NULL) return NULL; #ifndef OPENSSL_NO_EC if (!check_suiteb_cipher_list(ssl_method, c, &rule_str)) return NULL; #endif disabled_mkey = disabled_mkey_mask; disabled_auth = disabled_auth_mask; disabled_enc = disabled_enc_mask; disabled_mac = disabled_mac_mask; num_of_ciphers = ssl_method->num_ciphers(); co_list = OPENSSL_malloc(sizeof(*co_list) * num_of_ciphers); if (co_list == NULL) { SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); return NULL; } ssl_cipher_collect_ciphers(ssl_method, num_of_ciphers, disabled_mkey, disabled_auth, disabled_enc, disabled_mac, co_list, &head, &tail); ssl_cipher_apply_rule(0, SSL_kECDHE, SSL_aECDSA, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, SSL_AES ^ SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_ADD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, 0, SSL_MD5, 0, 0, CIPHER_ORD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, SSL_aNULL, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kRSA, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kPSK, 0, 0, 0, 0, 0, CIPHER_ORD, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, SSL_RC4, 0, 0, 0, CIPHER_ORD, -1, &head, &tail); if (!ssl_cipher_strength_sort(&head, &tail)) { OPENSSL_free(co_list); return NULL; } ssl_cipher_apply_rule(0, 0, 0, 0, 0, TLS1_2_VERSION, 0, CIPHER_BUMP, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_BUMP, -1, &head, &tail); ssl_cipher_apply_rule(0, SSL_kDHE | SSL_kECDHE, 0, 0, SSL_AEAD, 0, 0, CIPHER_BUMP, -1, &head, &tail); ssl_cipher_apply_rule(0, 0, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head, &tail); num_of_group_aliases = OSSL_NELEM(cipher_aliases); num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1; ca_list = OPENSSL_malloc(sizeof(*ca_list) * num_of_alias_max); if (ca_list == NULL) { OPENSSL_free(co_list); SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); return NULL; } ssl_cipher_collect_aliases(ca_list, num_of_group_aliases, disabled_mkey, disabled_auth, disabled_enc, disabled_mac, head); ok = 1; rule_p = rule_str; if (strncmp(rule_str, "DEFAULT", 7) == 0) { ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, &head, &tail, ca_list, c); rule_p += 7; if (*rule_p == ':') rule_p++; } if (ok && (strlen(rule_p) > 0)) ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c); OPENSSL_free(ca_list); if (!ok) { OPENSSL_free(co_list); return NULL; } if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL) { OPENSSL_free(co_list); return NULL; } for (i = 0; i < sk_SSL_CIPHER_num(tls13_ciphersuites); i++) { if (!sk_SSL_CIPHER_push(cipherstack, sk_SSL_CIPHER_value(tls13_ciphersuites, i))) { sk_SSL_CIPHER_free(cipherstack); return NULL; } } for (curr = head; curr != NULL; curr = curr->next) { if (curr->active) { if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher)) { OPENSSL_free(co_list); sk_SSL_CIPHER_free(cipherstack); return NULL; } #ifdef CIPHER_DEBUG fprintf(stderr, "<%s>\n", curr->cipher->name); #endif } } OPENSSL_free(co_list); if (!update_cipher_list_by_id(cipher_list_by_id, cipherstack)) { sk_SSL_CIPHER_free(cipherstack); return NULL; } sk_SSL_CIPHER_free(*cipher_list); *cipher_list = cipherstack; return cipherstack; } test/clienthellotest.c:102: error: BUFFER_OVERRUN_L1 Offset: 7 Size: 1 by call to `SSL_CTX_set_cipher_list`. Showing all 10 steps of the trace test/clienthellotest.c:102:14: Call 100. * that is too long for this test we use a restricted ciphersuite list 101. */ 102. if (!TEST_true(SSL_CTX_set_cipher_list(ctx, ""))) ^ 103. goto end; 104. /* Fall through */ ssl/ssl_lib.c:2511:1: Parameter `*str` 2509. 2510. /** specify the ciphers to be used by default by the SSL_CTX */ 2511. > int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) 2512. { 2513. STACK_OF(SSL_CIPHER) *sk; ssl/ssl_lib.c:2515:10: Call 2513. STACK_OF(SSL_CIPHER) *sk; 2514. 2515. sk = ssl_create_cipher_list(ctx->method, ctx->tls13_ciphersuites, ^ 2516. &ctx->cipher_list, &ctx->cipher_list_by_id, str, 2517. ctx->cert); ssl/ssl_ciph.c:1403:1: <Length trace> 1401. } 1402. 1403. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, 1404. STACK_OF(SSL_CIPHER) *tls13_ciphersuites, 1405. STACK_OF(SSL_CIPHER) **cipher_list, ssl/ssl_ciph.c:1403:1: Parameter `*rule_str` 1401. } 1402. 1403. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, 1404. STACK_OF(SSL_CIPHER) *tls13_ciphersuites, 1405. STACK_OF(SSL_CIPHER) **cipher_list, ssl/ssl_ciph.c:1423:10: Call 1421. return NULL; 1422. #ifndef OPENSSL_NO_EC 1423. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str)) ^ 1424. return NULL; 1425. #endif ssl/ssl_ciph.c:1223:1: Parameter `**prule_str` 1221. 1222. #ifndef OPENSSL_NO_EC 1223. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c, 1224. const char **prule_str) 1225. { ssl/ssl_ciph.c:1572:5: Assignment 1570. */ 1571. ok = 1; 1572. rule_p = rule_str; ^ 1573. if (strncmp(rule_str, "DEFAULT", 7) == 0) { 1574. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, ssl/ssl_ciph.c:1576:9: Assignment 1574. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, 1575. &head, &tail, ca_list, c); 1576. rule_p += 7; ^ 1577. if (*rule_p == ':') 1578. rule_p++; ssl/ssl_ciph.c:1577:13: Array access: Offset: 7 Size: 1 by call to `SSL_CTX_set_cipher_list` 1575. &head, &tail, ca_list, c); 1576. rule_p += 7; 1577. if (*rule_p == ':') ^ 1578. rule_p++; 1579. }
https://github.com/openssl/openssl/blob/4845aeba4c49e1bd65259a5014d7e3ab38657d42/ssl/ssl_ciph.c/#L1577
d2a_code_trace_data_43889
static const char *skip_space(const char *s) { while (ossl_isspace(*s)) s++; return s; } test/property_test.c:341: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, 50] by call to `ossl_method_store_add`. Showing all 25 steps of the trace test/property_test.c:324:1: Array declaration 322. } 323. 324. > static int test_query_cache_stochastic(void) 325. { 326. const int max = 10000, tail = 10; test/property_test.c:341:14: Call 339. v[i] = 2 * i; 340. BIO_snprintf(buf, sizeof(buf), "n=%d\n", i); 341. if (!TEST_true(ossl_method_store_add(store, i, buf, "abc", NULL)) ^ 342. || !TEST_true(ossl_method_store_cache_set(store, i, buf, v + i)) 343. || !TEST_true(ossl_method_store_cache_set(store, i, "n=1234", crypto/property/property.c:186:1: Parameter `*properties` 184. } 185. 186. > int ossl_method_store_add(OSSL_METHOD_STORE *store, 187. int nid, const char *properties, 188. void *method, void (*method_destruct)(void *)) crypto/property/property.c:215:33: Call 213. ossl_method_cache_flush(store, nid); 214. if ((impl->properties = ossl_prop_defn_get(properties)) == NULL) { 215. if ((impl->properties = ossl_parse_property(properties)) == NULL) ^ 216. goto err; 217. ossl_prop_defn_set(properties, impl->properties); crypto/property/property_parse.c:315:1: Parameter `*defn` 313. } 314. 315. > OSSL_PROPERTY_LIST *ossl_parse_property(const char *defn) 316. { 317. PROPERTY_DEFINITION *prop = NULL; crypto/property/property_parse.c:320:5: Assignment 318. OSSL_PROPERTY_LIST *res = NULL; 319. STACK_OF(PROPERTY_DEFINITION) *sk; 320. const char *s = defn; ^ 321. int done; 322. crypto/property/property_parse.c:326:9: Call 324. return NULL; 325. 326. s = skip_space(s); ^ 327. done = *s == '\0'; 328. while (!done) { crypto/property/property_parse.c:50:1: Parameter `*s` 48. DEFINE_STACK_OF(PROPERTY_DEFINITION) 49. 50. > static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) crypto/property/property_parse.c:54:5: Assignment 52. while (ossl_isspace(*s)) 53. s++; 54. return s; ^ 55. } 56. crypto/property/property_parse.c:326:5: Assignment 324. return NULL; 325. 326. s = skip_space(s); ^ 327. done = *s == '\0'; 328. while (!done) { crypto/property/property_parse.c:333:14: Call 331. goto err; 332. memset(&prop->v, 0, sizeof(prop->v)); 333. if (!parse_name(&s, 1, &prop->name_idx)) ^ 334. goto err; 335. prop->oper = PROPERTY_OPER_EQ; crypto/property/property_parse.c:81:1: Parameter `**t` 79. } 80. 81. > static int parse_name(const char *t[], int create, OSSL_PROPERTY_IDX *idx) 82. { 83. char name[100]; crypto/property/property_parse.c:340:13: Call 338. goto err; 339. } 340. if (match_ch(&s, '=')) { ^ 341. if (!parse_value(&s, prop, 1)) { 342. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); crypto/property/property_parse.c:57:1: Parameter `**t` 55. } 56. 57. > static int match_ch(const char *t[], char m) 58. { 59. const char *s = *t; crypto/property/property_parse.c:341:18: Call 339. } 340. if (match_ch(&s, '=')) { 341. if (!parse_value(&s, prop, 1)) { ^ 342. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE); 343. goto err; crypto/property/property_parse.c:244:1: Parameter `**t` 242. } 243. 244. > static int parse_value(const char *t[], PROPERTY_DEFINITION *res, int create) 245. { 246. const char *s = *t; crypto/property/property_parse.c:246:5: Assignment 244. static int parse_value(const char *t[], PROPERTY_DEFINITION *res, int create) 245. { 246. const char *s = *t; ^ 247. int r = 0; 248. crypto/property/property_parse.c:250:9: Assignment 248. 249. if (*s == '"' || *s == '\'') { 250. s++; ^ 251. r = parse_string(&s, s[-1], res, create); 252. } else if (*s == '+') { crypto/property/property_parse.c:251:13: Call 249. if (*s == '"' || *s == '\'') { 250. s++; 251. r = parse_string(&s, s[-1], res, create); ^ 252. } else if (*s == '+') { 253. s++; crypto/property/property_parse.c:183:1: Parameter `**t` 181. } 182. 183. > static int parse_string(const char *t[], char delim, PROPERTY_DEFINITION *res, 184. const int create) 185. { crypto/property/property_parse.c:187:5: Assignment 185. { 186. char v[1000]; 187. const char *s = *t; ^ 188. size_t i = 0; 189. int err = 0; crypto/property/property_parse.c:204:10: Call 202. } 203. v[i] = '\0'; 204. *t = skip_space(s + 1); ^ 205. if (err) 206. PROPerr(PROP_F_PARSE_STRING, PROP_R_STRING_TOO_LONG); crypto/property/property_parse.c:50:1: <Length trace> 48. DEFINE_STACK_OF(PROPERTY_DEFINITION) 49. 50. > static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) crypto/property/property_parse.c:50:1: Parameter `*s` 48. DEFINE_STACK_OF(PROPERTY_DEFINITION) 49. 50. > static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) crypto/property/property_parse.c:52:12: Array access: Offset: [2, +oo] Size: [1, 50] by call to `ossl_method_store_add` 50. static const char *skip_space(const char *s) 51. { 52. while (ossl_isspace(*s)) ^ 53. s++; 54. return s;
https://github.com/openssl/openssl/blob/4460ad90af0338abe31286f29b36baf2e41abf19/crypto/property/property_parse.c/#L52
d2a_code_trace_data_43890
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; } avconv.c:2704: error: Integer Overflow L2 ([1, 2147483616] + 32):signed32 by call to `process_input_packet`. avconv.c:2704:13: Call 2702. ist = input_streams[i]; 2703. if (!input_files[ist->file_index]->eof_reached && ist->decoding_needed) { 2704. process_input_packet(ist, NULL, 0); ^ 2705. } 2706. } avconv.c:1407:19: Call 1405. break; 1406. case AVMEDIA_TYPE_VIDEO: 1407. ret = decode_video (ist, repeating ? NULL : &avpkt, &got_output); ^ 1408. if (repeating && !got_output) 1409. ; avconv.c:2704:13: Call 2702. ist = input_streams[i]; 2703. if (!input_files[ist->file_index]->eof_reached && ist->decoding_needed) { 2704. process_input_packet(ist, NULL, 0); ^ 2705. } 2706. } avconv.c:1373:1: Parameter `ist->decoded_frame->nb_samples` 1371. 1372. /* pkt = NULL means EOF (needed to flush decoder buffers) */ 1373. static void process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof) ^ 1374. { 1375. int i; avconv.c:1404:19: Call 1402. switch (ist->dec_ctx->codec_type) { 1403. case AVMEDIA_TYPE_AUDIO: 1404. ret = decode_audio (ist, repeating ? NULL : &avpkt, &got_output); ^ 1405. break; 1406. case AVMEDIA_TYPE_VIDEO: avconv.c:1164:1: Parameter `ist->decoded_frame->nb_samples` 1162. } 1163. 1164. static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) ^ 1165. { 1166. AVFrame *decoded_frame, *f; avconv.c:1240:19: Call 1238. if (i < ist->nb_filters - 1) { 1239. f = ist->filter_frame; 1240. err = av_frame_ref(f, decoded_frame); ^ 1241. if (err < 0) 1242. break; libavutil/frame.c:199:1: Parameter `src->nb_samples` 197. } 198. 199. int av_frame_ref(AVFrame *dst, const AVFrame *src) ^ 200. { 201. int i, ret = 0; libavutil/frame.c:207:5: Assignment 205. dst->height = src->height; 206. dst->channel_layout = src->channel_layout; 207. dst->nb_samples = src->nb_samples; ^ 208. 209. ret = av_frame_copy_props(dst, src); libavutil/frame.c:215:15: Call 213. /* duplicate the frame data if it's not refcounted */ 214. if (!src->buf[0]) { 215. ret = av_frame_get_buffer(dst, 32); ^ 216. if (ret < 0) 217. return ret; libavutil/frame.c:186:1: Parameter `frame->nb_samples` 184. } 185. 186. int av_frame_get_buffer(AVFrame *frame, int align) ^ 187. { 188. if (frame->format < 0) libavutil/frame.c:194:16: Call 192. return get_video_buffer(frame, align); 193. else if (frame->nb_samples > 0 && frame->channel_layout) 194. return get_audio_buffer(frame, align); ^ 195. 196. return AVERROR(EINVAL); libavutil/frame.c:137:1: Parameter `frame->nb_samples` 135. } 136. 137. static int get_audio_buffer(AVFrame *frame, int align) ^ 138. { 139. int channels = av_get_channel_layout_nb_channels(frame->channel_layout); libavutil/frame.c:145:15: Call 143. 144. if (!frame->linesize[0]) { 145. ret = av_samples_get_buffer_size(&frame->linesize[0], channels, ^ 146. frame->nb_samples, frame->format, 147. 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 `process_input_packet` 122. return AVERROR(EINVAL); 123. align = 1; 124. nb_samples = FFALIGN(nb_samples, 32); ^ 125. } 126.
https://github.com/libav/libav/blob/ccea588f831906084b8c8235222920e6984beb72/libavutil/samplefmt.c/#L124
d2a_code_trace_data_43891
void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) { BN_ULONG *rr; if (na < nb) { int itmp; BN_ULONG *ltmp; itmp = na; na = nb; nb = itmp; ltmp = a; a = b; b = ltmp; } rr = &(r[na]); if (nb <= 0) { (void)bn_mul_words(r, a, na, 0); return; } else rr[0] = bn_mul_words(r, a, na, b[0]); for (;;) { if (--nb <= 0) return; rr[1] = bn_mul_add_words(&(r[1]), a, na, b[1]); if (--nb <= 0) return; rr[2] = bn_mul_add_words(&(r[2]), a, na, b[2]); if (--nb <= 0) return; rr[3] = bn_mul_add_words(&(r[3]), a, na, b[3]); if (--nb <= 0) return; rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]); rr += 4; r += 4; b += 4; } } crypto/ec/ecdh_ossl.c:136: error: BUFFER_OVERRUN_L3 Offset: [4, +oo] (⇐ [0, +oo] + 4) Size: [0, 8388607] by call to `BN_mul`. Showing all 10 steps of the trace crypto/ec/ecdh_ossl.c:135:14: Call 133. 134. if (EC_KEY_get_flags(ecdh) & EC_FLAG_COFACTOR_ECDH) { 135. if (!EC_GROUP_get_cofactor(group, x, NULL) || ^ 136. !BN_mul(x, x, priv_key, ctx)) { 137. ECerr(EC_F_ECDH_SIMPLE_COMPUTE_KEY, ERR_R_MALLOC_FAILURE); crypto/ec/ec_lib.c:380:1: Parameter `cofactor->d` 378. } 379. 380. > int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, 381. BN_CTX *ctx) 382. { crypto/ec/ecdh_ossl.c:136:14: Call 134. if (EC_KEY_get_flags(ecdh) & EC_FLAG_COFACTOR_ECDH) { 135. if (!EC_GROUP_get_cofactor(group, x, NULL) || 136. !BN_mul(x, x, priv_key, ctx)) { ^ 137. ECerr(EC_F_ECDH_SIMPLE_COMPUTE_KEY, ERR_R_MALLOC_FAILURE); 138. goto err; crypto/bn/bn_mul.c:882:1: Parameter `*a->d` 880. #endif /* BN_RECURSION */ 881. 882. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 883. { 884. int ret = 0; crypto/bn/bn_mul.c:963:17: Call 961. if (bn_wexpand(rr, k * 4) == NULL) 962. goto err; 963. bn_mul_part_recursive(rr->d, a->d, b->d, ^ 964. j, al - j, bl - j, t->d); 965. } else { /* al <= j || bl <= j */ crypto/bn/bn_mul.c:533:1: Parameter `*a` 531. */ 532. /* tnX may not be negative but less than n */ 533. > void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, 534. int tna, int tnb, BN_ULONG *t) 535. { crypto/bn/bn_mul.c:541:9: Call 539. 540. if (n < 8) { 541. bn_mul_normal(r, a, n + tna, b, n + tnb); ^ 542. return; 543. } crypto/bn/bn_mul.c:1036:1: <Length trace> 1034. } 1035. 1036. > void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) 1037. { 1038. BN_ULONG *rr; crypto/bn/bn_mul.c:1036:1: Parameter `*b` 1034. } 1035. 1036. > void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) 1037. { 1038. BN_ULONG *rr; crypto/bn/bn_mul.c:1071:50: Array access: Offset: [4, +oo] (⇐ [0, +oo] + 4) Size: [0, 8388607] by call to `BN_mul` 1069. if (--nb <= 0) 1070. return; 1071. rr[4] = bn_mul_add_words(&(r[4]), a, na, b[4]); ^ 1072. rr += 4; 1073. r += 4;
https://github.com/openssl/openssl/blob/fdfb8c848679d74fd492e3b306500f2da0570c17/crypto/bn/bn_mul.c/#L1071
d2a_code_trace_data_43892
static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict) { const char *codec_string = encoder ? "encoder" : "decoder"; AVCodec *codec; if(!name) return CODEC_ID_NONE; codec = encoder ? avcodec_find_encoder_by_name(name) : avcodec_find_decoder_by_name(name); if(!codec) { fprintf(stderr, "Unknown %s '%s'\n", codec_string, name); ffmpeg_exit(1); } if(codec->type != type) { fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name); ffmpeg_exit(1); } if(codec->capabilities & CODEC_CAP_EXPERIMENTAL && strict > FF_COMPLIANCE_EXPERIMENTAL) { fprintf(stderr, "%s '%s' is experimental and might produce bad " "results.\nAdd '-strict experimental' if you want to use it.\n", codec_string, codec->name); codec = encoder ? avcodec_find_encoder(codec->id) : avcodec_find_decoder(codec->id); if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL)) fprintf(stderr, "Or use the non experimental %s '%s'.\n", codec_string, codec->name); ffmpeg_exit(1); } return codec->id; } ffmpeg.c:3126: error: Null Dereference pointer `codec` last assigned on line 3119 could be null and is dereferenced at line 3126, column 8. ffmpeg.c:3112:1: start of procedure find_codec_or_die() 3110. } 3111. 3112. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict) ^ 3113. { 3114. const char *codec_string = encoder ? "encoder" : "decoder"; ffmpeg.c:3114:32: Condition is true 3112. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict) 3113. { 3114. const char *codec_string = encoder ? "encoder" : "decoder"; ^ 3115. AVCodec *codec; 3116. ffmpeg.c:3114:5: 3112. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict) 3113. { 3114. const char *codec_string = encoder ? "encoder" : "decoder"; ^ 3115. AVCodec *codec; 3116. ffmpeg.c:3117:9: Taking false branch 3115. AVCodec *codec; 3116. 3117. if(!name) ^ 3118. return CODEC_ID_NONE; 3119. codec = encoder ? ffmpeg.c:3119:13: Condition is true 3117. if(!name) 3118. return CODEC_ID_NONE; 3119. codec = encoder ? ^ 3120. avcodec_find_encoder_by_name(name) : 3121. avcodec_find_decoder_by_name(name); ffmpeg.c:3119:5: 3117. if(!name) 3118. return CODEC_ID_NONE; 3119. codec = encoder ? ^ 3120. avcodec_find_encoder_by_name(name) : 3121. avcodec_find_decoder_by_name(name); ffmpeg.c:3122:9: Taking true branch 3120. avcodec_find_encoder_by_name(name) : 3121. avcodec_find_decoder_by_name(name); 3122. if(!codec) { ^ 3123. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name); 3124. ffmpeg_exit(1); ffmpeg.c:3123:9: 3121. avcodec_find_decoder_by_name(name); 3122. if(!codec) { 3123. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name); ^ 3124. ffmpeg_exit(1); 3125. } ffmpeg.c:3124:9: Skipping ffmpeg_exit(): empty list of specs 3122. if(!codec) { 3123. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name); 3124. ffmpeg_exit(1); ^ 3125. } 3126. if(codec->type != type) { ffmpeg.c:3126:8: 3124. ffmpeg_exit(1); 3125. } 3126. if(codec->type != type) { ^ 3127. fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name); 3128. ffmpeg_exit(1);
https://github.com/libav/libav/blob/41e21e4db623ebd77f431a6f30cf21d62d9e1f33/ffmpeg.c/#L3126
d2a_code_trace_data_43893
STACK *SSL_dup_CA_list(STACK *sk) { int i; STACK *ret; X509_NAME *name; ret=sk_new_null(); for (i=0; i<sk_num(sk); i++) { name=X509_NAME_dup((X509_NAME *)sk_value(sk,i)); if ((name == NULL) || !sk_push(ret,(char *)name)) { sk_pop_free(ret,X509_NAME_free); return(NULL); } } return(ret); } ssl/ssl_cert.c:467: error: MEMORY_LEAK memory dynamically allocated by call to `sk_new()` at line 461, column 6 is not reachable after line 467, column 4. Showing all 45 steps of the trace ssl/ssl_cert.c:455:1: start of procedure SSL_dup_CA_list() 453. } 454. 455. > STACK *SSL_dup_CA_list(STACK *sk) 456. { 457. int i; ssl/ssl_cert.c:461:2: 459. X509_NAME *name; 460. 461. > ret=sk_new_null(); 462. for (i=0; i<sk_num(sk); i++) 463. { crypto/stack/stack.c:112:1: start of procedure sk_new() 110. } 111. 112. > STACK *sk_new(int (*c)()) 113. { 114. STACK *ret; crypto/stack/stack.c:117:6: Taking false branch 115. int i; 116. 117. if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL) ^ 118. goto err0; 119. if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL) crypto/stack/stack.c:119:6: Taking false branch 117. if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL) 118. goto err0; 119. if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL) ^ 120. goto err1; 121. for (i=0; i<MIN_NODES; i++) crypto/stack/stack.c:121:7: 119. if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL) 120. goto err1; 121. > for (i=0; i<MIN_NODES; i++) 122. ret->data[i]=NULL; 123. ret->comp=c; crypto/stack/stack.c:121:12: Loop condition is true. Entering loop body 119. if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL) 120. goto err1; 121. for (i=0; i<MIN_NODES; i++) ^ 122. ret->data[i]=NULL; 123. ret->comp=c; crypto/stack/stack.c:122:3: 120. goto err1; 121. for (i=0; i<MIN_NODES; i++) 122. > ret->data[i]=NULL; 123. ret->comp=c; 124. ret->num_alloc=MIN_NODES; crypto/stack/stack.c:121:25: 119. if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL) 120. goto err1; 121. > for (i=0; i<MIN_NODES; i++) 122. ret->data[i]=NULL; 123. ret->comp=c; crypto/stack/stack.c:121:12: Loop condition is false. Leaving loop 119. if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL) 120. goto err1; 121. for (i=0; i<MIN_NODES; i++) ^ 122. ret->data[i]=NULL; 123. ret->comp=c; crypto/stack/stack.c:123:2: 121. for (i=0; i<MIN_NODES; i++) 122. ret->data[i]=NULL; 123. > ret->comp=c; 124. ret->num_alloc=MIN_NODES; 125. ret->num=0; crypto/stack/stack.c:124:2: 122. ret->data[i]=NULL; 123. ret->comp=c; 124. > ret->num_alloc=MIN_NODES; 125. ret->num=0; 126. ret->sorted=0; crypto/stack/stack.c:125:2: 123. ret->comp=c; 124. ret->num_alloc=MIN_NODES; 125. > ret->num=0; 126. ret->sorted=0; 127. return(ret); crypto/stack/stack.c:126:2: 124. ret->num_alloc=MIN_NODES; 125. ret->num=0; 126. > ret->sorted=0; 127. return(ret); 128. err1: crypto/stack/stack.c:127:2: 125. ret->num=0; 126. ret->sorted=0; 127. > return(ret); 128. err1: 129. Free((char *)ret); crypto/stack/stack.c:132:2: return from a call to sk_new 130. err0: 131. return(NULL); 132. } ^ 133. 134. int sk_insert(STACK *st, char *data, int loc) ssl/ssl_cert.c:462:7: 460. 461. ret=sk_new_null(); 462. > for (i=0; i<sk_num(sk); i++) 463. { 464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i)); ssl/ssl_cert.c:462:12: 460. 461. ret=sk_new_null(); 462. > for (i=0; i<sk_num(sk); i++) 463. { 464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i)); crypto/stack/stack.c:287:1: start of procedure sk_num() 285. } 286. 287. > int sk_num(STACK *st) 288. { 289. if(st == NULL) return -1; crypto/stack/stack.c:289:5: Taking false branch 287. int sk_num(STACK *st) 288. { 289. if(st == NULL) return -1; ^ 290. return st->num; 291. } crypto/stack/stack.c:290:2: 288. { 289. if(st == NULL) return -1; 290. > return st->num; 291. } 292. crypto/stack/stack.c:291:1: return from a call to sk_num 289. if(st == NULL) return -1; 290. return st->num; 291. > } 292. 293. char *sk_value(STACK *st, int i) ssl/ssl_cert.c:462:12: Loop condition is true. Entering loop body 460. 461. ret=sk_new_null(); 462. for (i=0; i<sk_num(sk); i++) ^ 463. { 464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i)); ssl/ssl_cert.c:464:3: 462. for (i=0; i<sk_num(sk); i++) 463. { 464. > name=X509_NAME_dup((X509_NAME *)sk_value(sk,i)); 465. if ((name == NULL) || !sk_push(ret,(char *)name)) 466. { crypto/stack/stack.c:293:1: start of procedure sk_value() 291. } 292. 293. > char *sk_value(STACK *st, int i) 294. { 295. if(st == NULL) return NULL; crypto/stack/stack.c:295:5: Taking false branch 293. char *sk_value(STACK *st, int i) 294. { 295. if(st == NULL) return NULL; ^ 296. return st->data[i]; 297. } crypto/stack/stack.c:296:2: 294. { 295. if(st == NULL) return NULL; 296. > return st->data[i]; 297. } 298. crypto/stack/stack.c:297:1: return from a call to sk_value 295. if(st == NULL) return NULL; 296. return st->data[i]; 297. > } 298. 299. char *sk_set(STACK *st, int i, char *value) crypto/x509/x_all.c:353:1: start of procedure X509_NAME_dup() 351. } 352. 353. > X509_NAME *X509_NAME_dup(X509_NAME *xn) 354. { 355. return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, crypto/x509/x_all.c:355:2: 353. X509_NAME *X509_NAME_dup(X509_NAME *xn) 354. { 355. > return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, 356. (char *(*)())d2i_X509_NAME,(char *)xn)); 357. } crypto/asn1/a_dup.c:65:1: start of procedure ASN1_dup() 63. #define READ_CHUNK 2048 64. 65. > char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x) 66. { 67. unsigned char *b,*p; crypto/asn1/a_dup.c:71:6: Taking false branch 69. char *ret; 70. 71. if (x == NULL) return(NULL); ^ 72. 73. i=(long)i2d(x,NULL); crypto/asn1/a_dup.c:73:2: Skipping __function_pointer__(): unresolved function pointer 71. if (x == NULL) return(NULL); 72. 73. i=(long)i2d(x,NULL); ^ 74. b=(unsigned char *)Malloc((unsigned int)i+10); 75. if (b == NULL) crypto/asn1/a_dup.c:74:2: 72. 73. i=(long)i2d(x,NULL); 74. > b=(unsigned char *)Malloc((unsigned int)i+10); 75. if (b == NULL) 76. { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } crypto/asn1/a_dup.c:75:6: Taking false branch 73. i=(long)i2d(x,NULL); 74. b=(unsigned char *)Malloc((unsigned int)i+10); 75. if (b == NULL) ^ 76. { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } 77. p= b; crypto/asn1/a_dup.c:77:2: 75. if (b == NULL) 76. { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } 77. > p= b; 78. i=i2d(x,&p); 79. p= b; crypto/asn1/a_dup.c:78:2: Skipping __function_pointer__(): unresolved function pointer 76. { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } 77. p= b; 78. i=i2d(x,&p); ^ 79. p= b; 80. ret=d2i(NULL,&p,i); crypto/asn1/a_dup.c:79:2: 77. p= b; 78. i=i2d(x,&p); 79. > p= b; 80. ret=d2i(NULL,&p,i); 81. Free((char *)b); crypto/asn1/a_dup.c:80:2: Skipping __function_pointer__(): unresolved function pointer 78. i=i2d(x,&p); 79. p= b; 80. ret=d2i(NULL,&p,i); ^ 81. Free((char *)b); 82. return(ret); crypto/asn1/a_dup.c:81:2: 79. p= b; 80. ret=d2i(NULL,&p,i); 81. > Free((char *)b); 82. return(ret); 83. } crypto/asn1/a_dup.c:82:2: 80. ret=d2i(NULL,&p,i); 81. Free((char *)b); 82. > return(ret); 83. } crypto/asn1/a_dup.c:83:2: return from a call to ASN1_dup 81. Free((char *)b); 82. return(ret); 83. } ^ crypto/x509/x_all.c:357:2: return from a call to X509_NAME_dup 355. return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, 356. (char *(*)())d2i_X509_NAME,(char *)xn)); 357. } ^ 358. 359. X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne) ssl/ssl_cert.c:465:8: Taking true branch 463. { 464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i)); 465. if ((name == NULL) || !sk_push(ret,(char *)name)) ^ 466. { 467. sk_pop_free(ret,X509_NAME_free); ssl/ssl_cert.c:467:4: Skipping sk_pop_free(): empty list of specs 465. if ((name == NULL) || !sk_push(ret,(char *)name)) 466. { 467. sk_pop_free(ret,X509_NAME_free); ^ 468. return(NULL); 469. }
https://github.com/openssl/openssl/blob/c1c96de01c5a9bd1b715f6968bf9972141c2ade6/ssl/ssl_cert.c/#L467
d2a_code_trace_data_43894
static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, const unsigned char *name, size_t namelen) { char *copy; if (namelen == 0) namelen = name ? strlen((char *)name) : 0; else if (name && memchr(name, '\0', namelen > 1 ? namelen-1 : namelen)) return 0; if (name && name[namelen-1] == '\0') --namelen; if (mode == SET_HOST && id->hosts) { string_stack_free(id->hosts); id->hosts = NULL; } if (name == NULL || namelen == 0) return 1; copy = BUF_strndup((char *)name, namelen); if (copy == NULL) return 0; if (id->hosts == NULL && (id->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { OPENSSL_free(copy); return 0; } if (!sk_OPENSSL_STRING_push(id->hosts, copy)) { OPENSSL_free(copy); if (sk_OPENSSL_STRING_num(id->hosts) == 0) { sk_OPENSSL_STRING_free(id->hosts); id->hosts = NULL; } return 0; } return 1; } crypto/x509/x509_vpm.c:94: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64. Showing all 3 steps of the trace crypto/x509/x509_vpm.c:80:1: <LHS trace> 78. #define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free) 79. 80. > static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, 81. const unsigned char *name, size_t namelen) 82. { crypto/x509/x509_vpm.c:80:1: Parameter `namelen` 78. #define string_stack_free(sk) sk_OPENSSL_STRING_pop_free(sk, str_free) 79. 80. > static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, 81. const unsigned char *name, size_t namelen) 82. { crypto/x509/x509_vpm.c:94:3: Binary operation: ([0, +oo] - 1):unsigned64 92. return 0; 93. if (name && name[namelen-1] == '\0') 94. --namelen; ^ 95. 96. if (mode == SET_HOST && id->hosts)
https://github.com/openssl/openssl/blob/eef1827f89ebb82d3bcb5391fa15e05061bab4b2/crypto/x509/x509_vpm.c/#L94
d2a_code_trace_data_43895
int cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify) { EVP_MD_CTX *mctx = EVP_MD_CTX_new(); unsigned char md[EVP_MAX_MD_SIZE]; unsigned int mdlen; int r = 0; CMS_DigestedData *dd; if (mctx == NULL) { CMSerr(CMS_F_CMS_DIGESTEDDATA_DO_FINAL, ERR_R_MALLOC_FAILURE); goto err; } dd = cms->d.digestedData; if (!cms_DigestAlgorithm_find_ctx(mctx, chain, dd->digestAlgorithm)) goto err; if (EVP_DigestFinal_ex(mctx, md, &mdlen) <= 0) goto err; if (verify) { if (mdlen != (unsigned int)dd->digest->length) { CMSerr(CMS_F_CMS_DIGESTEDDATA_DO_FINAL, CMS_R_MESSAGEDIGEST_WRONG_LENGTH); goto err; } if (memcmp(md, dd->digest->data, mdlen)) CMSerr(CMS_F_CMS_DIGESTEDDATA_DO_FINAL, CMS_R_VERIFICATION_FAILURE); else r = 1; } else { if (!ASN1_STRING_set(dd->digest, md, mdlen)) goto err; r = 1; } err: EVP_MD_CTX_free(mctx); return r; } crypto/cms/cms_dd.c:95: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 57, column 24 is not reachable after line 95, column 5. Showing all 84 steps of the trace crypto/cms/cms_dd.c:55:1: start of procedure cms_DigestedData_do_final() 53. } 54. 55. > int cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify) 56. { 57. EVP_MD_CTX *mctx = EVP_MD_CTX_new(); crypto/cms/cms_dd.c:57:5: 55. int cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify) 56. { 57. > EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 58. unsigned char md[EVP_MAX_MD_SIZE]; 59. unsigned int mdlen; crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new() 42. } 43. 44. > EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:46:5: 44. EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. } 48. crypto/mem.c:197:1: start of procedure CRYPTO_zalloc() 195. } 196. 197. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 198. { 199. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:199:5: 197. void *CRYPTO_zalloc(size_t num, const char *file, int line) 198. { 199. > void *ret = CRYPTO_malloc(num, file, line); 200. 201. FAILTEST(); crypto/mem.c:169:1: start of procedure CRYPTO_malloc() 167. #endif 168. 169. > void *CRYPTO_malloc(size_t num, const char *file, int line) 170. { 171. void *ret = NULL; crypto/mem.c:171:5: 169. void *CRYPTO_malloc(size_t num, const char *file, int line) 170. { 171. > void *ret = NULL; 172. 173. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:173:9: Taking false branch 171. void *ret = NULL; 172. 173. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 174. return malloc_impl(num, file, line); 175. crypto/mem.c:176:9: Taking false branch 174. return malloc_impl(num, file, line); 175. 176. if (num == 0) ^ 177. return NULL; 178. crypto/mem.c:180:5: 178. 179. FAILTEST(); 180. > allow_customize = 0; 181. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 182. if (call_malloc_debug) { crypto/mem.c:190:5: 188. } 189. #else 190. > osslargused(file); osslargused(line); 191. ret = malloc(num); 192. #endif crypto/mem.c:190:24: 188. } 189. #else 190. > osslargused(file); osslargused(line); 191. ret = malloc(num); 192. #endif crypto/mem.c:191:5: 189. #else 190. osslargused(file); osslargused(line); 191. > ret = malloc(num); 192. #endif 193. crypto/mem.c:194:5: 192. #endif 193. 194. > return ret; 195. } 196. crypto/mem.c:195:1: return from a call to CRYPTO_malloc 193. 194. return ret; 195. > } 196. 197. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:202:9: Taking true branch 200. 201. FAILTEST(); 202. if (ret != NULL) ^ 203. memset(ret, 0, num); 204. return ret; crypto/mem.c:203:9: 201. FAILTEST(); 202. if (ret != NULL) 203. > memset(ret, 0, num); 204. return ret; 205. } crypto/mem.c:204:5: 202. if (ret != NULL) 203. memset(ret, 0, num); 204. > return ret; 205. } 206. crypto/mem.c:205:1: return from a call to CRYPTO_zalloc 203. memset(ret, 0, num); 204. return ret; 205. > } 206. 207. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. > } 48. 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) crypto/cms/cms_dd.c:60:5: 58. unsigned char md[EVP_MAX_MD_SIZE]; 59. unsigned int mdlen; 60. > int r = 0; 61. CMS_DigestedData *dd; 62. crypto/cms/cms_dd.c:63:9: Taking false branch 61. CMS_DigestedData *dd; 62. 63. if (mctx == NULL) { ^ 64. CMSerr(CMS_F_CMS_DIGESTEDDATA_DO_FINAL, ERR_R_MALLOC_FAILURE); 65. goto err; crypto/cms/cms_dd.c:68:5: 66. } 67. 68. > dd = cms->d.digestedData; 69. 70. if (!cms_DigestAlgorithm_find_ctx(mctx, chain, dd->digestAlgorithm)) crypto/cms/cms_dd.c:70:10: 68. dd = cms->d.digestedData; 69. 70. > if (!cms_DigestAlgorithm_find_ctx(mctx, chain, dd->digestAlgorithm)) 71. goto err; 72. crypto/cms/cms_lib.c:311:1: start of procedure cms_DigestAlgorithm_find_ctx() 309. /* Locate a message digest content from a BIO chain based on SignerInfo */ 310. 311. > int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain, 312. X509_ALGOR *mdalg) 313. { crypto/cms/cms_lib.c:316:5: 314. int nid; 315. const ASN1_OBJECT *mdoid; 316. > X509_ALGOR_get0(&mdoid, NULL, NULL, mdalg); 317. nid = OBJ_obj2nid(mdoid); 318. /* Look for digest type to match signature */ crypto/asn1/x_algor.c:53:1: start of procedure X509_ALGOR_get0() 51. } 52. 53. > void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, 54. const void **ppval, const X509_ALGOR *algor) 55. { crypto/asn1/x_algor.c:56:9: Taking true branch 54. const void **ppval, const X509_ALGOR *algor) 55. { 56. if (paobj) ^ 57. *paobj = algor->algorithm; 58. if (pptype) { crypto/asn1/x_algor.c:57:9: 55. { 56. if (paobj) 57. > *paobj = algor->algorithm; 58. if (pptype) { 59. if (algor->parameter == NULL) { crypto/asn1/x_algor.c:58:9: Taking false branch 56. if (paobj) 57. *paobj = algor->algorithm; 58. if (pptype) { ^ 59. if (algor->parameter == NULL) { 60. *pptype = V_ASN1_UNDEF; crypto/asn1/x_algor.c:58:5: 56. if (paobj) 57. *paobj = algor->algorithm; 58. > if (pptype) { 59. if (algor->parameter == NULL) { 60. *pptype = V_ASN1_UNDEF; crypto/asn1/x_algor.c:67:1: return from a call to X509_ALGOR_get0 65. *ppval = algor->parameter->value.ptr; 66. } 67. > } 68. 69. /* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */ crypto/cms/cms_lib.c:317:5: 315. const ASN1_OBJECT *mdoid; 316. X509_ALGOR_get0(&mdoid, NULL, NULL, mdalg); 317. > nid = OBJ_obj2nid(mdoid); 318. /* Look for digest type to match signature */ 319. for (;;) { crypto/objects/obj_dat.c:317:1: start of procedure OBJ_obj2nid() 315. IMPLEMENT_OBJ_BSEARCH_CMP_FN(const ASN1_OBJECT *, unsigned int, obj); 316. 317. > int OBJ_obj2nid(const ASN1_OBJECT *a) 318. { 319. const unsigned int *op; crypto/objects/obj_dat.c:322:9: Taking false branch 320. ADDED_OBJ ad, *adp; 321. 322. if (a == NULL) ^ 323. return NID_undef; 324. if (a->nid != 0) crypto/objects/obj_dat.c:324:9: Taking false branch 322. if (a == NULL) 323. return NID_undef; 324. if (a->nid != 0) ^ 325. return a->nid; 326. crypto/objects/obj_dat.c:327:9: Taking false branch 325. return a->nid; 326. 327. if (a->length == 0) ^ 328. return NID_undef; 329. crypto/objects/obj_dat.c:330:9: Taking true branch 328. return NID_undef; 329. 330. if (added != NULL) { ^ 331. ad.type = ADDED_DATA; 332. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ crypto/objects/obj_dat.c:331:9: 329. 330. if (added != NULL) { 331. > ad.type = ADDED_DATA; 332. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 333. adp = lh_ADDED_OBJ_retrieve(added, &ad); crypto/objects/obj_dat.c:332:9: 330. if (added != NULL) { 331. ad.type = ADDED_DATA; 332. > ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 333. adp = lh_ADDED_OBJ_retrieve(added, &ad); 334. if (adp != NULL) crypto/objects/obj_dat.c:333:9: 331. ad.type = ADDED_DATA; 332. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 333. > adp = lh_ADDED_OBJ_retrieve(added, &ad); 334. if (adp != NULL) 335. return adp->obj->nid; crypto/objects/obj_lcl.h:14:1: start of procedure lh_ADDED_OBJ_retrieve() 12. DEFINE_LHASH_OF(OBJ_NAME); 13. typedef struct added_obj_st ADDED_OBJ; 14. > DEFINE_LHASH_OF(ADDED_OBJ); crypto/lhash/lhash.c:134:1: start of procedure OPENSSL_LH_retrieve() 132. } 133. 134. > void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data) 135. { 136. unsigned long hash; crypto/lhash/lhash.c:141:5: 139. int scratch; 140. 141. > lh->error = 0; 142. rn = getrn(lh, data, &hash); 143. crypto/lhash/lhash.c:142:5: Skipping getrn(): empty list of specs 140. 141. lh->error = 0; 142. rn = getrn(lh, data, &hash); ^ 143. 144. if (*rn == NULL) { crypto/lhash/lhash.c:144:9: Taking false branch 142. rn = getrn(lh, data, &hash); 143. 144. if (*rn == NULL) { ^ 145. CRYPTO_atomic_add(&lh->num_retrieve_miss, 1, &scratch, lh->retrieve_stats_lock); 146. return NULL; crypto/lhash/lhash.c:148:9: 146. return NULL; 147. } else { 148. > ret = (*rn)->data; 149. CRYPTO_atomic_add(&lh->num_retrieve, 1, &scratch, lh->retrieve_stats_lock); 150. } crypto/lhash/lhash.c:149:9: 147. } else { 148. ret = (*rn)->data; 149. > CRYPTO_atomic_add(&lh->num_retrieve, 1, &scratch, lh->retrieve_stats_lock); 150. } 151. return ret; crypto/threads_pthread.c:152:1: start of procedure CRYPTO_atomic_add() 150. } 151. 152. > int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) 153. { 154. # if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) crypto/threads_pthread.c:155:9: Taking false branch 153. { 154. # if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) 155. if (__atomic_is_lock_free(sizeof(*val), val)) { ^ 156. *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL); 157. return 1; crypto/threads_pthread.c:160:10: 158. } 159. # endif 160. > if (!CRYPTO_THREAD_write_lock(lock)) 161. return 0; 162. crypto/threads_pthread.c:64:1: start of procedure CRYPTO_THREAD_write_lock() 62. } 63. 64. > int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) 65. { 66. # ifdef USE_RWLOCK crypto/threads_pthread.c:67:9: Taking true branch 65. { 66. # ifdef USE_RWLOCK 67. if (pthread_rwlock_wrlock(lock) != 0) ^ 68. return 0; 69. # else crypto/threads_pthread.c:68:9: 66. # ifdef USE_RWLOCK 67. if (pthread_rwlock_wrlock(lock) != 0) 68. > return 0; 69. # else 70. if (pthread_mutex_lock(lock) != 0) crypto/threads_pthread.c:75:1: return from a call to CRYPTO_THREAD_write_lock 73. 74. return 1; 75. > } 76. 77. int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock) crypto/threads_pthread.c:160:10: Taking true branch 158. } 159. # endif 160. if (!CRYPTO_THREAD_write_lock(lock)) ^ 161. return 0; 162. crypto/threads_pthread.c:161:9: 159. # endif 160. if (!CRYPTO_THREAD_write_lock(lock)) 161. > return 0; 162. 163. *val += amount; crypto/threads_pthread.c:170:1: return from a call to CRYPTO_atomic_add 168. 169. return 1; 170. > } 171. 172. # ifdef OPENSSL_SYS_UNIX crypto/lhash/lhash.c:151:5: 149. CRYPTO_atomic_add(&lh->num_retrieve, 1, &scratch, lh->retrieve_stats_lock); 150. } 151. > return ret; 152. } 153. crypto/lhash/lhash.c:152:1: return from a call to OPENSSL_LH_retrieve 150. } 151. return ret; 152. > } 153. 154. static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, crypto/objects/obj_lcl.h:14:1: return from a call to lh_ADDED_OBJ_retrieve 12. DEFINE_LHASH_OF(OBJ_NAME); 13. typedef struct added_obj_st ADDED_OBJ; 14. > DEFINE_LHASH_OF(ADDED_OBJ); crypto/objects/obj_dat.c:334:13: Taking true branch 332. ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */ 333. adp = lh_ADDED_OBJ_retrieve(added, &ad); 334. if (adp != NULL) ^ 335. return adp->obj->nid; 336. } crypto/objects/obj_dat.c:335:13: 333. adp = lh_ADDED_OBJ_retrieve(added, &ad); 334. if (adp != NULL) 335. > return adp->obj->nid; 336. } 337. op = OBJ_bsearch_obj(&a, obj_objs, NUM_OBJ); crypto/objects/obj_dat.c:341:1: return from a call to OBJ_obj2nid 339. return NID_undef; 340. return nid_objs[*op].nid; 341. > } 342. 343. /* crypto/cms/cms_lib.c:336:5: Loop condition is true. Entering loop body 334. return EVP_MD_CTX_copy_ex(mctx, mtmp); 335. chain = BIO_next(chain); 336. } ^ 337. } 338. crypto/cms/cms_lib.c:321:9: Skipping BIO_find_type(): empty list of specs 319. for (;;) { 320. EVP_MD_CTX *mtmp; 321. chain = BIO_find_type(chain, BIO_TYPE_MD); ^ 322. if (chain == NULL) { 323. CMSerr(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX, crypto/cms/cms_lib.c:322:13: Taking true branch 320. EVP_MD_CTX *mtmp; 321. chain = BIO_find_type(chain, BIO_TYPE_MD); 322. if (chain == NULL) { ^ 323. CMSerr(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX, 324. CMS_R_NO_MATCHING_DIGEST); crypto/cms/cms_lib.c:323:13: Skipping ERR_put_error(): empty list of specs 321. chain = BIO_find_type(chain, BIO_TYPE_MD); 322. if (chain == NULL) { 323. CMSerr(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX, ^ 324. CMS_R_NO_MATCHING_DIGEST); 325. return 0; crypto/cms/cms_lib.c:325:13: 323. CMSerr(CMS_F_CMS_DIGESTALGORITHM_FIND_CTX, 324. CMS_R_NO_MATCHING_DIGEST); 325. > return 0; 326. } 327. BIO_get_md_ctx(chain, &mtmp); crypto/cms/cms_lib.c:337:1: return from a call to cms_DigestAlgorithm_find_ctx 335. chain = BIO_next(chain); 336. } 337. > } 338. 339. static STACK_OF(CMS_CertificateChoices) crypto/cms/cms_dd.c:70:10: Taking true branch 68. dd = cms->d.digestedData; 69. 70. if (!cms_DigestAlgorithm_find_ctx(mctx, chain, dd->digestAlgorithm)) ^ 71. goto err; 72. crypto/cms/cms_dd.c:94:2: 92. } 93. 94. > err: 95. EVP_MD_CTX_free(mctx); 96. crypto/cms/cms_dd.c:95:5: 93. 94. err: 95. > EVP_MD_CTX_free(mctx); 96. 97. return r; crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free() 47. } 48. 49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); ^ 52. OPENSSL_free(ctx); 53. } crypto/evp/digest.c:52:5: 50. { 51. EVP_MD_CTX_reset(ctx); 52. > OPENSSL_free(ctx); 53. } 54. crypto/mem.c:264:1: start of procedure CRYPTO_free() 262. } 263. 264. > void CRYPTO_free(void *str, const char *file, int line) 265. { 266. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:266:9: Taking true branch 264. void CRYPTO_free(void *str, const char *file, int line) 265. { 266. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 267. free_impl(str, file, line); 268. return; crypto/mem.c:266:30: Taking true branch 264. void CRYPTO_free(void *str, const char *file, int line) 265. { 266. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 267. free_impl(str, file, line); 268. return; crypto/mem.c:267:9: Skipping __function_pointer__(): unresolved function pointer 265. { 266. if (free_impl != NULL && free_impl != &CRYPTO_free) { 267. free_impl(str, file, line); ^ 268. return; 269. } crypto/mem.c:268:9: 266. if (free_impl != NULL && free_impl != &CRYPTO_free) { 267. free_impl(str, file, line); 268. > return; 269. } 270. crypto/mem.c:282:1: return from a call to CRYPTO_free 280. free(str); 281. #endif 282. > } 283. 284. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free 51. EVP_MD_CTX_reset(ctx); 52. OPENSSL_free(ctx); 53. > } 54. 55. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
https://github.com/openssl/openssl/blob/b842fcbb37cf3cded72dd7706abd8d54a10cd508/crypto/cms/cms_dd.c/#L95
d2a_code_trace_data_43896
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:402: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_mont_consttime`. Showing all 47 steps of the trace test/bntest.c:402:10: Call 400. BN_bntest_rand(a, 1024, 0, 0); 401. BN_zero(p); 402. if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) ^ 403. goto err; 404. if (!TEST_BN_eq_one(d)) crypto/bn/bn_exp.c:592:1: Parameter `ctx->stack.depth` 590. * http://www.daemonology.net/hyperthreading-considered-harmful/) 591. */ 592. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 593. const BIGNUM *m, BN_CTX *ctx, 594. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:636:5: Call 634. } 635. 636. BN_CTX_start(ctx); ^ 637. 638. /* crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_exp.c:647:14: Call 645. if ((mont = BN_MONT_CTX_new()) == NULL) 646. goto err; 647. if (!BN_MONT_CTX_set(mont, m, ctx)) ^ 648. goto err; 649. } crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth` 261. } 262. 263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 264. { 265. int i, ret = 0; crypto/bn/bn_mont.c:271:5: Call 269. return 0; 270. 271. BN_CTX_start(ctx); ^ 272. if ((Ri = BN_CTX_get(ctx)) == NULL) 273. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mont.c:272:15: Call 270. 271. BN_CTX_start(ctx); 272. if ((Ri = BN_CTX_get(ctx)) == NULL) ^ 273. goto err; 274. R = &(mont->RR); /* grab RR as a temp */ crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mont.c:351:19: Call 349. if (BN_is_one(&tmod)) 350. BN_zero(Ri); 351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 352. goto err; 353. if (!BN_lshift(Ri, Ri, BN_BITS2)) crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth` 122. BN_CTX *ctx); 123. 124. > BIGNUM *BN_mod_inverse(BIGNUM *in, 125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 126. { crypto/bn/bn_gcd.c:129:10: Call 127. BIGNUM *rv; 128. int noinv; 129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 130. if (noinv) 131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth` 133. } 134. 135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 137. int *pnoinv) crypto/bn/bn_gcd.c:155:16: Call 153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 155. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 156. } 157. crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth` 456. * not contain branches that may leak sensitive information. 457. */ 458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 459. const BIGNUM *a, const BIGNUM *n, 460. BN_CTX *ctx) crypto/bn/bn_gcd.c:469:5: Call 467. bn_check_top(n); 468. 469. BN_CTX_start(ctx); ^ 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_gcd.c:470:9: Call 468. 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); ^ 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:471:9: Call 469. BN_CTX_start(ctx); 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); ^ 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:472:9: Call 470. A = BN_CTX_get(ctx); 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); ^ 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:473:9: Call 471. B = BN_CTX_get(ctx); 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); ^ 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:474:9: Call 472. X = BN_CTX_get(ctx); 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); ^ 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:475:9: Call 473. D = BN_CTX_get(ctx); 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); ^ 476. T = BN_CTX_get(ctx); 477. if (T == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:476:9: Call 474. M = BN_CTX_get(ctx); 475. Y = BN_CTX_get(ctx); 476. T = BN_CTX_get(ctx); ^ 477. if (T == NULL) 478. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_gcd.c:504:18: Call 502. bn_init(&local_B); 503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 504. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 505. goto err; 506. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp_mont_consttime` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43897
static int tree_add_unmatched(X509_POLICY_LEVEL *curr, const X509_POLICY_CACHE *cache, const ASN1_OBJECT *id, X509_POLICY_NODE *node, X509_POLICY_TREE *tree) { X509_POLICY_DATA *data; if (id == NULL) id = node->data->valid_policy; data = policy_data_new(NULL, id, node_critical(node)); if (data == NULL) return 0; data->qualifier_set = cache->anyPolicy->qualifier_set; data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; if (!level_add_node(curr, data, node, tree)) { policy_data_free(data); return 0; } return 1; } crypto/x509v3/pcy_tree.c:360: error: MEMORY_LEAK memory dynamically allocated by call to `policy_data_new()` at line 353, column 12 is not reachable after line 360, column 10. Showing all 82 steps of the trace crypto/x509v3/pcy_tree.c:341:1: start of procedure tree_add_unmatched() 339. */ 340. 341. > static int tree_add_unmatched(X509_POLICY_LEVEL *curr, 342. const X509_POLICY_CACHE *cache, 343. const ASN1_OBJECT *id, crypto/x509v3/pcy_tree.c:347:9: Taking false branch 345. { 346. X509_POLICY_DATA *data; 347. if (id == NULL) ^ 348. id = node->data->valid_policy; 349. /* crypto/x509v3/pcy_tree.c:353:5: 351. * node. 352. */ 353. > data = policy_data_new(NULL, id, node_critical(node)); 354. 355. if (data == NULL) crypto/x509v3/pcy_data.c:88:1: start of procedure policy_data_new() 86. */ 87. 88. > X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, 89. const ASN1_OBJECT *cid, int crit) 90. { crypto/x509v3/pcy_data.c:93:10: Taking true branch 91. X509_POLICY_DATA *ret; 92. ASN1_OBJECT *id; 93. if (!policy && !cid) ^ 94. return NULL; 95. if (cid) { crypto/x509v3/pcy_data.c:93:21: Taking false branch 91. X509_POLICY_DATA *ret; 92. ASN1_OBJECT *id; 93. if (!policy && !cid) ^ 94. return NULL; 95. if (cid) { crypto/x509v3/pcy_data.c:95:9: Taking true branch 93. if (!policy && !cid) 94. return NULL; 95. if (cid) { ^ 96. id = OBJ_dup(cid); 97. if (!id) crypto/x509v3/pcy_data.c:96:9: Skipping OBJ_dup(): empty list of specs 94. return NULL; 95. if (cid) { 96. id = OBJ_dup(cid); ^ 97. if (!id) 98. return NULL; crypto/x509v3/pcy_data.c:97:14: Taking false branch 95. if (cid) { 96. id = OBJ_dup(cid); 97. if (!id) ^ 98. return NULL; 99. } else crypto/x509v3/pcy_data.c:101:5: 99. } else 100. id = NULL; 101. > ret = OPENSSL_zalloc(sizeof(*ret)); 102. if (ret == NULL) 103. return NULL; crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/x509v3/pcy_data.c:102:9: Taking false branch 100. id = NULL; 101. ret = OPENSSL_zalloc(sizeof(*ret)); 102. if (ret == NULL) ^ 103. return NULL; 104. ret->expected_policy_set = sk_ASN1_OBJECT_new_null(); crypto/x509v3/pcy_data.c:104:5: 102. if (ret == NULL) 103. return NULL; 104. > ret->expected_policy_set = sk_ASN1_OBJECT_new_null(); 105. if (ret->expected_policy_set == NULL) { 106. OPENSSL_free(ret); include/openssl/asn1.h:569:1: start of procedure sk_ASN1_OBJECT_new_null() 567. DECLARE_ASN1_ITEM(ASN1_OBJECT) 568. 569. > DEFINE_STACK_OF(ASN1_OBJECT) 570. 571. ASN1_STRING *ASN1_STRING_new(void); crypto/stack/stack.c:145:1: start of procedure sk_new_null() 143. } 144. 145. > _STACK *sk_new_null(void) 146. { 147. return sk_new((int (*)(const void *, const void *))0); crypto/stack/stack.c:147:5: 145. _STACK *sk_new_null(void) 146. { 147. > return sk_new((int (*)(const void *, const void *))0); 148. } 149. crypto/stack/stack.c:150:1: start of procedure sk_new() 148. } 149. 150. > _STACK *sk_new(int (*c) (const void *, const void *)) 151. { 152. _STACK *ret; crypto/stack/stack.c:154:9: 152. _STACK *ret; 153. 154. > if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/stack/stack.c:154:9: Taking false branch 152. _STACK *ret; 153. 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) ^ 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) crypto/stack/stack.c:156:9: 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. > if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) 157. goto err; 158. ret->comp = c; crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/stack/stack.c:156:9: Taking false branch 154. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL) 155. goto err; 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) ^ 157. goto err; 158. ret->comp = c; crypto/stack/stack.c:158:5: 156. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL) 157. goto err; 158. > ret->comp = c; 159. ret->num_alloc = MIN_NODES; 160. return (ret); crypto/stack/stack.c:159:5: 157. goto err; 158. ret->comp = c; 159. > ret->num_alloc = MIN_NODES; 160. return (ret); 161. crypto/stack/stack.c:160:5: 158. ret->comp = c; 159. ret->num_alloc = MIN_NODES; 160. > return (ret); 161. 162. err: crypto/stack/stack.c:165:1: return from a call to sk_new 163. OPENSSL_free(ret); 164. return (NULL); 165. > } 166. 167. int sk_insert(_STACK *st, void *data, int loc) crypto/stack/stack.c:148:1: return from a call to sk_new_null 146. { 147. return sk_new((int (*)(const void *, const void *))0); 148. > } 149. 150. _STACK *sk_new(int (*c) (const void *, const void *)) include/openssl/asn1.h:569:1: return from a call to sk_ASN1_OBJECT_new_null 567. DECLARE_ASN1_ITEM(ASN1_OBJECT) 568. 569. > DEFINE_STACK_OF(ASN1_OBJECT) 570. 571. ASN1_STRING *ASN1_STRING_new(void); crypto/x509v3/pcy_data.c:105:9: Taking false branch 103. return NULL; 104. ret->expected_policy_set = sk_ASN1_OBJECT_new_null(); 105. if (ret->expected_policy_set == NULL) { ^ 106. OPENSSL_free(ret); 107. ASN1_OBJECT_free(id); crypto/x509v3/pcy_data.c:111:9: Taking false branch 109. } 110. 111. if (crit) ^ 112. ret->flags = POLICY_DATA_FLAG_CRITICAL; 113. crypto/x509v3/pcy_data.c:114:9: Taking true branch 112. ret->flags = POLICY_DATA_FLAG_CRITICAL; 113. 114. if (id) ^ 115. ret->valid_policy = id; 116. else { crypto/x509v3/pcy_data.c:115:9: 113. 114. if (id) 115. > ret->valid_policy = id; 116. else { 117. ret->valid_policy = policy->policyid; crypto/x509v3/pcy_data.c:121:9: Taking false branch 119. } 120. 121. if (policy) { ^ 122. ret->qualifier_set = policy->qualifiers; 123. policy->qualifiers = NULL; crypto/x509v3/pcy_data.c:126:5: 124. } 125. 126. > return ret; 127. } crypto/x509v3/pcy_data.c:127:1: return from a call to policy_data_new 125. 126. return ret; 127. > } crypto/x509v3/pcy_tree.c:355:9: Taking false branch 353. data = policy_data_new(NULL, id, node_critical(node)); 354. 355. if (data == NULL) ^ 356. return 0; 357. /* Curr may not have anyPolicy */ crypto/x509v3/pcy_tree.c:358:5: 356. return 0; 357. /* Curr may not have anyPolicy */ 358. > data->qualifier_set = cache->anyPolicy->qualifier_set; 359. data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; 360. if (!level_add_node(curr, data, node, tree)) { crypto/x509v3/pcy_tree.c:359:5: 357. /* Curr may not have anyPolicy */ 358. data->qualifier_set = cache->anyPolicy->qualifier_set; 359. > data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; 360. if (!level_add_node(curr, data, node, tree)) { 361. policy_data_free(data); crypto/x509v3/pcy_tree.c:360:10: Skipping level_add_node(): empty list of specs 358. data->qualifier_set = cache->anyPolicy->qualifier_set; 359. data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; 360. if (!level_add_node(curr, data, node, tree)) { ^ 361. policy_data_free(data); 362. return 0;
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/x509v3/pcy_tree.c/#L360
d2a_code_trace_data_43898
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/statem/statem_srvr.c:1209: error: INTEGER_OVERFLOW_L2 ([0, 1+max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl_parse_clienthello_tlsext`. Showing all 15 steps of the trace ssl/statem/statem_srvr.c:882:1: Parameter `s->initial_ctx->sessions->num_items` 880. } 881. 882. > MSG_PROCESS_RETURN tls_process_client_hello(SSL *s, PACKET *pkt) 883. { 884. int i, al = SSL_AD_INTERNAL_ERROR; ssl/statem/statem_srvr.c:1209:14: Call 1207. /* TLS extensions */ 1208. if (s->version >= SSL3_VERSION) { 1209. if (!ssl_parse_clienthello_tlsext(s, &extensions)) { ^ 1210. SSLerr(SSL_F_TLS_PROCESS_CLIENT_HELLO, SSL_R_PARSE_TLSEXT); 1211. goto err; ssl/t1_lib.c:2210:1: Parameter `s->initial_ctx->sessions->num_items` 2208. } 2209. 2210. > int ssl_parse_clienthello_tlsext(SSL *s, PACKET *pkt) 2211. { 2212. int al = -1; ssl/t1_lib.c:2215:9: Call 2213. custom_ext_init(&s->cert->srv_ext); 2214. if (ssl_scan_clienthello_tlsext(s, pkt, &al) <= 0) { 2215. ssl3_send_alert(s, SSL3_AL_FATAL, al); ^ 2216. return 0; 2217. } ssl/s3_msg.c:64:1: Parameter `s->initial_ctx->sessions->num_items` 62. } 63. 64. > int ssl3_send_alert(SSL *s, int level, int desc) 65. { 66. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:75:9: Call 73. /* If a fatal one, remove from cache */ 74. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 75. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 76. 77. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items` 689. } 690. 691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:693:12: Call 691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ^ 694. } 695. ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items` 694. } 695. 696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 697. { 698. SSL_SESSION *r; ssl/ssl_sess.c:706:17: Call 704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 705. ret = 1; 706. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 707. SSL_SESSION_list_remove(ctx, c); 708. } ssl/ssl_locl.h:581:1: Parameter `lh->num_items` 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:581:1: Call 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, 1+max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl_parse_clienthello_tlsext` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_43899
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); } apps/s_client.c:244: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mod_exp`. Showing all 34 steps of the trace apps/s_client.c:231:1: Parameter `N->top` 229. # define SRP_NUMBER_ITERATIONS_FOR_PRIME 64 230. 231. > static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g) 232. { 233. BN_CTX *bn_ctx = BN_CTX_new(); apps/s_client.c:237:53: Call 235. BIGNUM *r = BN_new(); 236. int ret = 237. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) && ^ 238. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 && 239. p != NULL && BN_rshift1(p, N) && crypto/bn/bn_lib.c:867:1: Parameter `a->top` 865. } 866. 867. > int BN_is_odd(const BIGNUM *a) 868. { 869. return (a->top > 0) && (a->d[0] & 1); apps/s_client.c:238:9: Call 236. int ret = 237. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) && 238. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 && ^ 239. p != NULL && BN_rshift1(p, N) && 240. /* p = (N-1)/2 */ crypto/bn/bn_prime.c:147:1: Parameter `a->top` 145. } 146. 147. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 148. BN_GENCB *cb) 149. { crypto/bn/bn_prime.c:150:12: Call 148. BN_GENCB *cb) 149. { 150. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); ^ 151. } 152. crypto/bn/bn_prime.c:153:1: Parameter `a->top` 151. } 152. 153. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 154. int do_trial_division, BN_GENCB *cb) 155. { crypto/bn/bn_prime.c:162:9: Call 160. BN_MONT_CTX *mont = NULL; 161. 162. if (BN_cmp(a, BN_value_one()) <= 0) ^ 163. return 0; 164. crypto/bn/bn_lib.c:577:1: Parameter `a->top` 575. } 576. 577. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 578. { 579. int i; apps/s_client.c:239:22: Call 237. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) && 238. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 && 239. p != NULL && BN_rshift1(p, N) && ^ 240. /* p = (N-1)/2 */ 241. BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 && crypto/bn/bn_shift.c:54:9: Call 52. bn_check_top(a); 53. 54. if (BN_is_zero(a)) { ^ 55. BN_zero(r); 56. return (1); crypto/bn/bn_lib.c:852:1: Parameter `a->top` 850. } 851. 852. > int BN_is_zero(const BIGNUM *a) 853. { 854. return a->top == 0; apps/s_client.c:244:9: Call 242. r != NULL && 243. /* verify g^((N-1)/2) == -1 (mod N) */ 244. BN_mod_exp(r, g, p, N, bn_ctx) && ^ 245. BN_add_word(r, 1) && BN_cmp(r, N) == 0; 246. crypto/bn/bn_exp.c:91:1: Parameter `m->top` 89. } 90. 91. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 92. BN_CTX *ctx) 93. { crypto/bn/bn_exp.c:136:9: Call 134. 135. #ifdef MONT_MUL_MOD 136. if (BN_is_odd(m)) { ^ 137. # ifdef MONT_EXP_WORD 138. if (a->top == 1 && !a->neg crypto/bn/bn_lib.c:867:1: Parameter `a->top` 865. } 866. 867. > int BN_is_odd(const BIGNUM *a) 868. { 869. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_exp.c:141:19: Call 139. && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)) { 140. BN_ULONG A = a->d[0]; 141. ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL); ^ 142. } else 143. # endif crypto/bn/bn_exp.c:1091:1: Parameter `m->top` 1089. } 1090. 1091. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, 1092. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 1093. { crypto/bn/bn_exp.c:1126:10: Call 1124. bn_check_top(m); 1125. 1126. if (!BN_is_odd(m)) { ^ 1127. BNerr(BN_F_BN_MOD_EXP_MONT_WORD, BN_R_CALLED_WITH_EVEN_MODULUS); 1128. return (0); crypto/bn/bn_lib.c:867:1: Parameter `a->top` 865. } 866. 867. > int BN_is_odd(const BIGNUM *a) 868. { 869. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_exp.c:1181:22: Call 1179. r_is_one = 0; 1180. } else { 1181. if (!BN_MOD_MUL_WORD(r, w, m)) ^ 1182. goto err; 1183. } crypto/bn/bn_div.c:205:31: Call 203. 204. /* First we normalise the numbers */ 205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); ^ 206. if (!(BN_lshift(sdiv, divisor, norm_shift))) 207. goto err; crypto/bn/bn_lib.c:167:9: Assignment 165. 166. if (BN_is_zero(a)) 167. return 0; ^ 168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); 169. } crypto/bn/bn_div.c:205:5: Assignment 203. 204. /* First we normalise the numbers */ 205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); ^ 206. if (!(BN_lshift(sdiv, divisor, norm_shift))) 207. goto err; crypto/bn/bn_div.c:206:11: Call 204. /* First we normalise the numbers */ 205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); 206. if (!(BN_lshift(sdiv, divisor, norm_shift))) ^ 207. goto err; 208. sdiv->neg = 0; crypto/bn/bn_shift.c: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_mod_exp` 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/757264207ad8650a89ea903d48ad89f61d56ea9c/crypto/bn/bn_shift.c/#L112
d2a_code_trace_data_43900
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, int32_t sb_samples[SBLIMIT]) { int32_t tmp[32]; register MPA_INT *synth_buf; register const MPA_INT *w, *w2, *p; int j, offset, v; OUT_INT *samples2; #if FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif dct32(tmp, sb_samples); offset = *synth_buf_offset; synth_buf = synth_buf_ptr + offset; for(j=0;j<32;j++) { v = tmp[j]; #if FRAC_BITS <= 15 v = av_clip_int16(v); #endif synth_buf[j] = v; } memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(sum, +=, w, p); p = synth_buf + 48; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); samples += incr; w++; for(j=1;j<16;j++) { sum2 = 0; p = synth_buf + 16 + j; SUM8P2(sum, +=, sum2, -=, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p); *samples = round_sample(&sum); samples += incr; sum += sum2; *samples2 = round_sample(&sum); samples2 -= incr; w++; w2--; } p = synth_buf + 32; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; offset = (offset - 32) & 511; *synth_buf_offset = offset; } libavcodec/mpc.c:60: error: Buffer Overrun L2 Offset: [17+min(0, `c->synth_buf_offset[*]`), 32+max(511, `c->synth_buf_offset[*]`)] Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]` 49. * Process decoded Musepack data and produce PCM 50. */ 51. static void mpc_synth(MPCContext *c, int16_t *out) ^ 52. { 53. int dither_state = 0; libavcodec/mpc.c:60:13: Call 58. samples_ptr = samples + ch; 59. for(i = 0; i < SAMPLES_PER_BAND; i++) { 60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 61. mpa_window, &dither_state, 62. samples_ptr, 2, libavcodec/mpegaudiodec.c:906:9: <Length trace> 904. /* we calculate two samples at the same time to avoid one memory 905. access per two sample */ 906. for(j=1;j<16;j++) { ^ 907. sum2 = 0; 908. p = synth_buf + 16 + j; libavcodec/mpegaudiodec.c:906:9: Assignment 904. /* we calculate two samples at the same time to avoid one memory 905. access per two sample */ 906. for(j=1;j<16;j++) { ^ 907. sum2 = 0; 908. p = synth_buf + 16 + j; libavcodec/mpegaudiodec.c:908:9: Assignment 906. for(j=1;j<16;j++) { 907. sum2 = 0; 908. p = synth_buf + 16 + j; ^ 909. SUM8P2(sum, +=, sum2, -=, w, w2, p); 910. p = synth_buf + 48 - j; libavcodec/mpegaudiodec.c:909:9: Array access: Offset: [17+min(0, c->synth_buf_offset[*]), 32+max(511, c->synth_buf_offset[*])] Size: 2 by call to `ff_mpa_synth_filter` 907. sum2 = 0; 908. p = synth_buf + 16 + j; 909. SUM8P2(sum, +=, sum2, -=, w, w2, p); ^ 910. p = synth_buf + 48 - j; 911. SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L909
d2a_code_trace_data_43901
IMPLEMENT_new_ctx(cfb, CFB, 256) providers/common/ciphers/aes.c:306: error: NULL_DEREFERENCE pointer `ctx` last assigned on line 306 could be null and is dereferenced at line 306, column 1. Showing all 18 steps of the trace providers/common/ciphers/aes.c:306:1: start of procedure aes_256_cfb_newctx() 304. IMPLEMENT_new_params(cfb1, CFB) 305. IMPLEMENT_new_params(cfb8, CFB) 306. > IMPLEMENT_new_ctx(cfb, CFB, 256) 307. IMPLEMENT_new_ctx(cfb, CFB, 192) 308. IMPLEMENT_new_ctx(cfb, CFB, 128) crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE) crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking false branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) providers/common/ciphers/aes.c:306:1: 304. IMPLEMENT_new_params(cfb1, CFB) 305. IMPLEMENT_new_params(cfb8, CFB) 306. > IMPLEMENT_new_ctx(cfb, CFB, 256) 307. IMPLEMENT_new_ctx(cfb, CFB, 192) 308. IMPLEMENT_new_ctx(cfb, CFB, 128)
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L306
d2a_code_trace_data_43902
static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts) { InputStream *ist = s->opaque; const enum AVPixelFormat *p; int ret; for (p = pix_fmts; *p != -1; p++) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p); const HWAccel *hwaccel; if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) break; hwaccel = get_hwaccel(*p); if (!hwaccel || (ist->active_hwaccel_id && ist->active_hwaccel_id != hwaccel->id) || (ist->hwaccel_id != HWACCEL_AUTO && ist->hwaccel_id != hwaccel->id)) continue; ret = hwaccel->init(s); if (ret < 0) { if (ist->hwaccel_id == hwaccel->id) { av_log(NULL, AV_LOG_FATAL, "%s hwaccel requested for input stream #%d:%d, " "but cannot be initialized.\n", hwaccel->name, ist->file_index, ist->st->index); return AV_PIX_FMT_NONE; } continue; } if (ist->hw_frames_ctx) { s->hw_frames_ctx = av_buffer_ref(ist->hw_frames_ctx); if (!s->hw_frames_ctx) return AV_PIX_FMT_NONE; } ist->active_hwaccel_id = hwaccel->id; ist->hwaccel_pix_fmt = *p; break; } return *p; } avconv.c:1613: error: Null Dereference pointer `desc` last assigned on line 1610 could be null and is dereferenced at line 1613, column 15. avconv.c:1603:1: start of procedure get_format() 1601. } 1602. 1603. static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts) ^ 1604. { 1605. InputStream *ist = s->opaque; avconv.c:1605:5: 1603. static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat *pix_fmts) 1604. { 1605. InputStream *ist = s->opaque; ^ 1606. const enum AVPixelFormat *p; 1607. int ret; avconv.c:1609:10: 1607. int ret; 1608. 1609. for (p = pix_fmts; *p != -1; p++) { ^ 1610. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p); 1611. const HWAccel *hwaccel; avconv.c:1609:24: Loop condition is true. Entering loop body 1607. int ret; 1608. 1609. for (p = pix_fmts; *p != -1; p++) { ^ 1610. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p); 1611. const HWAccel *hwaccel; avconv.c:1610:9: 1608. 1609. for (p = pix_fmts; *p != -1; p++) { 1610. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p); ^ 1611. const HWAccel *hwaccel; 1612. libavutil/pixdesc.c:1768:1: start of procedure av_pix_fmt_desc_get() 1766. } 1767. 1768. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) ^ 1769. { 1770. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) libavutil/pixdesc.c:1770:9: Taking false branch 1768. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1769. { 1770. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1771. return NULL; 1772. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1770:24: Taking true branch 1768. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt) 1769. { 1770. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) ^ 1771. return NULL; 1772. return &av_pix_fmt_descriptors[pix_fmt]; libavutil/pixdesc.c:1771:9: 1769. { 1770. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) 1771. return NULL; ^ 1772. return &av_pix_fmt_descriptors[pix_fmt]; 1773. } libavutil/pixdesc.c:1773:1: return from a call to av_pix_fmt_desc_get 1771. return NULL; 1772. return &av_pix_fmt_descriptors[pix_fmt]; 1773. } ^ 1774. 1775. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev) avconv.c:1613:15: 1611. const HWAccel *hwaccel; 1612. 1613. if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) ^ 1614. break; 1615.
https://github.com/libav/libav/blob/25bacd0a0c32ae682e6f411b1ac9020aeaabca72/avconv.c/#L1613
d2a_code_trace_data_43903
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/statem/statem_dtls.c:715: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `dtls1_retrieve_buffered_fragment`. Showing all 15 steps of the trace ssl/statem/statem_dtls.c:705:1: Parameter `s->initial_ctx->sessions->num_items` 703. } 704. 705. > static int dtls_get_reassembled_message(SSL *s, long *len) 706. { 707. unsigned char wire[DTLS1_HM_HEADER_LENGTH]; ssl/statem/statem_dtls.c:715:21: Call 713. redo: 714. /* see if we have the required fragment already */ 715. if ((frag_len = dtls1_retrieve_buffered_fragment(s, &ok)) || ok) { ^ 716. if (ok) 717. s->init_num = frag_len; ssl/statem/statem_dtls.c:437:1: Parameter `s->initial_ctx->sessions->num_items` 435. } 436. 437. > static int dtls1_retrieve_buffered_fragment(SSL *s, int *ok) 438. { 439. /*- ssl/statem/statem_dtls.c:481:9: Call 479. } 480. 481. ssl3_send_alert(s, SSL3_AL_FATAL, al); ^ 482. s->init_num = 0; 483. *ok = 0; ssl/s3_msg.c:64:1: Parameter `s->initial_ctx->sessions->num_items` 62. } 63. 64. > int ssl3_send_alert(SSL *s, int level, int desc) 65. { 66. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:75:9: Call 73. /* If a fatal one, remove from cache */ 74. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 75. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 76. 77. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items` 689. } 690. 691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:693:12: Call 691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ^ 694. } 695. ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items` 694. } 695. 696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 697. { 698. SSL_SESSION *r; ssl/ssl_sess.c:706:17: Call 704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 705. ret = 1; 706. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 707. SSL_SESSION_list_remove(ctx, c); 708. } ssl/ssl_locl.h:581:1: Parameter `lh->num_items` 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:581:1: Call 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `dtls1_retrieve_buffered_fragment` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_43904
static void opt_output_file(const char *filename) { AVFormatContext *oc; int err, use_video, use_audio, use_subtitle; int input_has_video, input_has_audio, input_has_subtitle; AVFormatParameters params, *ap = &params; AVOutputFormat *file_oformat; AVMetadataTag *tag = NULL; if (!strcmp(filename, "-")) filename = "pipe:"; oc = avformat_alloc_context(); if (!oc) { print_error(filename, AVERROR(ENOMEM)); ffmpeg_exit(1); } if (last_asked_format) { file_oformat = av_guess_format(last_asked_format, NULL, NULL); if (!file_oformat) { fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format); ffmpeg_exit(1); } last_asked_format = NULL; } else { file_oformat = av_guess_format(NULL, filename, NULL); if (!file_oformat) { fprintf(stderr, "Unable to find a suitable output format for '%s'\n", filename); ffmpeg_exit(1); } } oc->oformat = file_oformat; av_strlcpy(oc->filename, filename, sizeof(oc->filename)); if (!strcmp(file_oformat->name, "ffm") && av_strstart(filename, "http:", NULL)) { int err = read_ffserver_streams(oc, filename); if (err < 0) { print_error(filename, err); ffmpeg_exit(1); } } else { use_video = file_oformat->video_codec != CODEC_ID_NONE || video_stream_copy || video_codec_name; use_audio = file_oformat->audio_codec != CODEC_ID_NONE || audio_stream_copy || audio_codec_name; use_subtitle = file_oformat->subtitle_codec != CODEC_ID_NONE || subtitle_stream_copy || subtitle_codec_name; if (nb_input_files > 0) { check_audio_video_sub_inputs(&input_has_video, &input_has_audio, &input_has_subtitle); if (!input_has_video) use_video = 0; if (!input_has_audio) use_audio = 0; if (!input_has_subtitle) use_subtitle = 0; } if (audio_disable) use_audio = 0; if (video_disable) use_video = 0; if (subtitle_disable) use_subtitle = 0; if (use_video) new_video_stream(oc, nb_output_files); if (use_audio) new_audio_stream(oc, nb_output_files); if (use_subtitle) new_subtitle_stream(oc, nb_output_files); oc->timestamp = recording_timestamp; while ((tag = av_metadata_get(metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) av_metadata_set2(&oc->metadata, tag->key, tag->value, 0); av_metadata_free(&metadata); } output_files[nb_output_files++] = oc; if (oc->oformat->flags & AVFMT_NEEDNUMBER) { if (!av_filename_number_test(oc->filename)) { print_error(oc->filename, AVERROR_NUMEXPECTED); ffmpeg_exit(1); } } if (!(oc->oformat->flags & AVFMT_NOFILE)) { if (!file_overwrite && (strchr(filename, ':') == NULL || filename[1] == ':' || av_strstart(filename, "file:", NULL))) { if (url_exist(filename)) { if (!using_stdin) { fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename); fflush(stderr); if (!read_yesno()) { fprintf(stderr, "Not overwriting - exiting\n"); ffmpeg_exit(1); } } else { fprintf(stderr,"File '%s' already exists. Exiting.\n", filename); ffmpeg_exit(1); } } } if ((err = url_fopen(&oc->pb, filename, URL_WRONLY)) < 0) { print_error(filename, err); ffmpeg_exit(1); } } memset(ap, 0, sizeof(*ap)); if (av_set_parameters(oc, ap) < 0) { fprintf(stderr, "%s: Invalid encoding parameters\n", oc->filename); ffmpeg_exit(1); } oc->preload= (int)(mux_preload*AV_TIME_BASE); oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE); oc->loop_output = loop_output; oc->flags |= AVFMT_FLAG_NONBLOCK; set_context_opts(oc, avformat_opts, AV_OPT_FLAG_ENCODING_PARAM, NULL); nb_streamid_map = 0; av_freep(&forced_key_frames); } ffmpeg.c:3700: error: Null Dereference pointer `file_oformat` last assigned on line 3689 could be null and is dereferenced at line 3700, column 17. ffmpeg.c:3663:1: start of procedure opt_output_file() 3661. } 3662. 3663. static void opt_output_file(const char *filename) ^ 3664. { 3665. AVFormatContext *oc; ffmpeg.c:3668:5: 3666. int err, use_video, use_audio, use_subtitle; 3667. int input_has_video, input_has_audio, input_has_subtitle; 3668. AVFormatParameters params, *ap = &params; ^ 3669. AVOutputFormat *file_oformat; 3670. AVMetadataTag *tag = NULL; ffmpeg.c:3670:5: 3668. AVFormatParameters params, *ap = &params; 3669. AVOutputFormat *file_oformat; 3670. AVMetadataTag *tag = NULL; ^ 3671. 3672. if (!strcmp(filename, "-")) ffmpeg.c:3672:10: Taking false branch 3670. AVMetadataTag *tag = NULL; 3671. 3672. if (!strcmp(filename, "-")) ^ 3673. filename = "pipe:"; 3674. ffmpeg.c:3675:5: 3673. filename = "pipe:"; 3674. 3675. oc = avformat_alloc_context(); ^ 3676. if (!oc) { 3677. print_error(filename, AVERROR(ENOMEM)); libavformat/options.c:82:1: start of procedure avformat_alloc_context() 80. } 81. 82. AVFormatContext *avformat_alloc_context(void) ^ 83. { 84. AVFormatContext *ic; libavformat/options.c:85:5: 83. { 84. AVFormatContext *ic; 85. ic = av_malloc(sizeof(AVFormatContext)); ^ 86. if (!ic) return ic; 87. avformat_get_context_defaults(ic); libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(FF_INTERNAL_MEM_TYPE size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(FF_INTERNAL_MEM_TYPE size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking false branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,16,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:116:5: 114. ptr = malloc(size); 115. #endif 116. return ptr; ^ 117. } 118. libavutil/mem.c:117:1: return from a call to av_malloc 115. #endif 116. return ptr; 117. } ^ 118. 119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) libavformat/options.c:86:10: Taking false branch 84. AVFormatContext *ic; 85. ic = av_malloc(sizeof(AVFormatContext)); 86. if (!ic) return ic; ^ 87. avformat_get_context_defaults(ic); 88. ic->av_class = &av_format_context_class; libavformat/options.c:87:5: Skipping avformat_get_context_defaults(): empty list of specs 85. ic = av_malloc(sizeof(AVFormatContext)); 86. if (!ic) return ic; 87. avformat_get_context_defaults(ic); ^ 88. ic->av_class = &av_format_context_class; 89. return ic; libavformat/options.c:88:5: 86. if (!ic) return ic; 87. avformat_get_context_defaults(ic); 88. ic->av_class = &av_format_context_class; ^ 89. return ic; 90. } libavformat/options.c:89:5: 87. avformat_get_context_defaults(ic); 88. ic->av_class = &av_format_context_class; 89. return ic; ^ 90. } 91. libavformat/options.c:90:1: return from a call to avformat_alloc_context 88. ic->av_class = &av_format_context_class; 89. return ic; 90. } ^ 91. 92. #if FF_API_ALLOC_FORMAT_CONTEXT ffmpeg.c:3676:10: Taking false branch 3674. 3675. oc = avformat_alloc_context(); 3676. if (!oc) { ^ 3677. print_error(filename, AVERROR(ENOMEM)); 3678. ffmpeg_exit(1); ffmpeg.c:3681:9: Taking false branch 3679. } 3680. 3681. if (last_asked_format) { ^ 3682. file_oformat = av_guess_format(last_asked_format, NULL, NULL); 3683. if (!file_oformat) { ffmpeg.c:3689:9: Skipping av_guess_format(): empty list of specs 3687. last_asked_format = NULL; 3688. } else { 3689. file_oformat = av_guess_format(NULL, filename, NULL); ^ 3690. if (!file_oformat) { 3691. fprintf(stderr, "Unable to find a suitable output format for '%s'\n", ffmpeg.c:3690:14: Taking true branch 3688. } else { 3689. file_oformat = av_guess_format(NULL, filename, NULL); 3690. if (!file_oformat) { ^ 3691. fprintf(stderr, "Unable to find a suitable output format for '%s'\n", 3692. filename); ffmpeg.c:3691:13: 3689. file_oformat = av_guess_format(NULL, filename, NULL); 3690. if (!file_oformat) { 3691. fprintf(stderr, "Unable to find a suitable output format for '%s'\n", ^ 3692. filename); 3693. ffmpeg_exit(1); ffmpeg.c:3693:13: Skipping ffmpeg_exit(): empty list of specs 3691. fprintf(stderr, "Unable to find a suitable output format for '%s'\n", 3692. filename); 3693. ffmpeg_exit(1); ^ 3694. } 3695. } ffmpeg.c:3697:5: 3695. } 3696. 3697. oc->oformat = file_oformat; ^ 3698. av_strlcpy(oc->filename, filename, sizeof(oc->filename)); 3699. ffmpeg.c:3698:5: 3696. 3697. oc->oformat = file_oformat; 3698. av_strlcpy(oc->filename, filename, sizeof(oc->filename)); ^ 3699. 3700. if (!strcmp(file_oformat->name, "ffm") && libavutil/avstring.c:64:1: start of procedure av_strlcpy() 62. } 63. 64. size_t av_strlcpy(char *dst, const char *src, size_t size) ^ 65. { 66. size_t len = 0; libavutil/avstring.c:66:5: 64. size_t av_strlcpy(char *dst, const char *src, size_t size) 65. { 66. size_t len = 0; ^ 67. while (++len < size && *src) 68. *dst++ = *src++; libavutil/avstring.c:67:12: Loop condition is true. Entering loop body 65. { 66. size_t len = 0; 67. while (++len < size && *src) ^ 68. *dst++ = *src++; 69. if (len <= size) libavutil/avstring.c:67:28: Loop condition is false. Leaving loop 65. { 66. size_t len = 0; 67. while (++len < size && *src) ^ 68. *dst++ = *src++; 69. if (len <= size) libavutil/avstring.c:69:9: Taking true branch 67. while (++len < size && *src) 68. *dst++ = *src++; 69. if (len <= size) ^ 70. *dst = 0; 71. return len + strlen(src) - 1; libavutil/avstring.c:70:9: 68. *dst++ = *src++; 69. if (len <= size) 70. *dst = 0; ^ 71. return len + strlen(src) - 1; 72. } libavutil/avstring.c:71:5: 69. if (len <= size) 70. *dst = 0; 71. return len + strlen(src) - 1; ^ 72. } 73. libavutil/avstring.c:72:1: return from a call to av_strlcpy 70. *dst = 0; 71. return len + strlen(src) - 1; 72. } ^ 73. 74. size_t av_strlcat(char *dst, const char *src, size_t size) ffmpeg.c:3700:10: 3698. av_strlcpy(oc->filename, filename, sizeof(oc->filename)); 3699. 3700. if (!strcmp(file_oformat->name, "ffm") && ^ 3701. av_strstart(filename, "http:", NULL)) { 3702. /* special case for files sent to ffserver: we get the stream
https://github.com/libav/libav/blob/129983408d0d064db656742a3d3d4c038420f48c/ffmpeg.c/#L3700
d2a_code_trace_data_43905
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_exp2.c:111: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_to_montgomery`. Showing all 38 steps of the trace crypto/bn/bn_exp2.c:16:1: Parameter `ctx->stack.depth` 14. #define TABLE_SIZE 32 15. 16. > int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, 17. const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, 18. BN_CTX *ctx, BN_MONT_CTX *in_mont) crypto/bn/bn_exp2.c:48:5: Call 46. bits = (bits1 > bits2) ? bits1 : bits2; 47. 48. BN_CTX_start(ctx); ^ 49. d = BN_CTX_get(ctx); 50. r = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_exp2.c:49:9: Call 47. 48. BN_CTX_start(ctx); 49. d = BN_CTX_get(ctx); ^ 50. r = BN_CTX_get(ctx); 51. val1[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp2.c:50:9: Call 48. BN_CTX_start(ctx); 49. d = BN_CTX_get(ctx); 50. r = BN_CTX_get(ctx); ^ 51. val1[0] = BN_CTX_get(ctx); 52. val2[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp2.c:51:15: Call 49. d = BN_CTX_get(ctx); 50. r = BN_CTX_get(ctx); 51. val1[0] = BN_CTX_get(ctx); ^ 52. val2[0] = BN_CTX_get(ctx); 53. if (val2[0] == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp2.c:52:15: Call 50. r = BN_CTX_get(ctx); 51. val1[0] = BN_CTX_get(ctx); 52. val2[0] = BN_CTX_get(ctx); ^ 53. if (val2[0] == NULL) 54. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp2.c:83:10: Call 81. } 82. 83. if (!BN_to_montgomery(val1[0], a_mod_m, mont, ctx)) ^ 84. goto err; 85. if (window1 > 1) { crypto/bn/bn_lib.c:889:1: Parameter `ctx->stack.depth` 887. } 888. 889. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 890. BN_CTX *ctx) 891. { crypto/bn/bn_lib.c:892:12: Call 890. BN_CTX *ctx) 891. { 892. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 893. } 894. crypto/bn/bn_mont.c:26:1: Parameter `ctx->stack.depth` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:29:15: Call 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { 29. int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx); ^ 30. 31. bn_correct_top(r); crypto/bn/bn_mont.c:37:1: Parameter `ctx->stack.depth` 35. } 36. 37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 38. BN_MONT_CTX *mont, BN_CTX *ctx) 39. { crypto/bn/bn_exp2.c:111:10: Call 109. goto err; 110. } 111. if (!BN_to_montgomery(val2[0], a_mod_m, mont, ctx)) ^ 112. goto err; 113. if (window2 > 1) { crypto/bn/bn_lib.c:889:1: Parameter `ctx->stack.depth` 887. } 888. 889. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 890. BN_CTX *ctx) 891. { crypto/bn/bn_lib.c:892:12: Call 890. BN_CTX *ctx) 891. { 892. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 893. } 894. crypto/bn/bn_mont.c:26:1: Parameter `ctx->stack.depth` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:29:15: Call 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { 29. int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx); ^ 30. 31. bn_correct_top(r); crypto/bn/bn_mont.c:37:1: Parameter `ctx->stack.depth` 35. } 36. 37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 38. BN_MONT_CTX *mont, BN_CTX *ctx) 39. { crypto/bn/bn_mont.c:60:5: Call 58. return 0; 59. 60. BN_CTX_start(ctx); ^ 61. tmp = BN_CTX_get(ctx); 62. if (tmp == NULL) crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mont.c:61:11: Call 59. 60. BN_CTX_start(ctx); 61. tmp = BN_CTX_get(ctx); ^ 62. if (tmp == NULL) 63. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mont.c:67:14: Call 65. bn_check_top(tmp); 66. if (a == b) { 67. if (!bn_sqr_fixed_top(tmp, a, ctx)) ^ 68. goto err; 69. } else { crypto/bn/bn_sqr.c:42:5: Call 40. } 41. 42. BN_CTX_start(ctx); ^ 43. rr = (a != r) ? r : BN_CTX_get(ctx); 44. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_sqr.c:104:5: Call 102. bn_check_top(rr); 103. bn_check_top(tmp); 104. BN_CTX_end(ctx); ^ 105. return ret; 106. } crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_to_montgomery` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43906
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } apps/s_client.c:421: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp`. Showing all 26 steps of the trace apps/s_client.c:413:3: Call 411. int ret = 412. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) && 413. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) && ^ 414. p != NULL && BN_rshift1(p, N) && 415. crypto/bn/bn_prime.c:238:1: Parameter `ctx_passed->stack.depth` 236. } 237. 238. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb) 239. { 240. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); crypto/bn/bn_prime.c:240:9: Call 238. int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb) 239. { 240. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); ^ 241. } 242. crypto/bn/bn_prime.c:243:1: Parameter `ctx_passed->stack.depth` 241. } 242. 243. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 244. int do_trial_division, BN_GENCB *cb) 245. { apps/s_client.c:417:3: Call 415. 416. /* p = (N-1)/2 */ 417. BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) && ^ 418. r != NULL && 419. crypto/bn/bn_prime.c:238:1: Parameter `ctx_passed->stack.depth` 236. } 237. 238. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb) 239. { 240. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); crypto/bn/bn_prime.c:240:9: Call 238. int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, BN_GENCB *cb) 239. { 240. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb); ^ 241. } 242. crypto/bn/bn_prime.c:243:1: Parameter `ctx_passed->stack.depth` 241. } 242. 243. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 244. int do_trial_division, BN_GENCB *cb) 245. { apps/s_client.c:421:3: Call 419. 420. /* verify g^((N-1)/2) == -1 (mod N) */ 421. BN_mod_exp(r, g, p, N, bn_ctx) && ^ 422. BN_add_word(r, 1) && 423. BN_cmp(r, N) == 0; crypto/bn/bn_exp.c:177:1: Parameter `ctx->stack.depth` 175. 176. 177. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 178. BN_CTX *ctx) 179. { crypto/bn/bn_exp.c:242:9: Call 240. #endif 241. #ifdef RECP_MUL_MOD 242. { ret=BN_mod_exp_recp(r,a,p,m,ctx); } ^ 243. #else 244. { ret=BN_mod_exp_simple(r,a,p,m,ctx); } crypto/bn/bn_exp.c:252:1: Parameter `ctx->stack.depth` 250. 251. 252. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 253. const BIGNUM *m, BN_CTX *ctx) 254. { crypto/bn/bn_exp.c:277:2: Call 275. } 276. 277. BN_CTX_start(ctx); ^ 278. aa = BN_CTX_get(ctx); 279. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:257:1: Parameter `ctx->stack.depth` 255. } 256. 257. > void BN_CTX_start(BN_CTX *ctx) 258. { 259. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_exp.c:295:7: Call 293. } 294. 295. if (!BN_nnmod(val[0],a,m,ctx)) goto err; /* 1 */ ^ 296. if (BN_is_zero(val[0])) 297. { crypto/bn/bn_mod.c:129:1: Parameter `ctx->stack.depth` 127. 128. 129. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 130. { 131. /* like BN_mod, but returns non-negative remainder crypto/bn/bn_mod.c:134:8: Call 132. * (i.e., 0 <= r < |d| always holds) */ 133. 134. if (!(BN_mod(r,m,d,ctx))) ^ 135. return 0; 136. if (!r->neg) crypto/bn/bn_div.c:183:1: Parameter `ctx->stack.depth` 181. * If 'dv' or 'rm' is NULL, the respective value is not returned. 182. */ 183. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 184. BN_CTX *ctx) 185. { crypto/bn/bn_div.c:228:2: Call 226. } 227. 228. BN_CTX_start(ctx); ^ 229. tmp=BN_CTX_get(ctx); 230. snum=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:257:1: Parameter `ctx->stack.depth` 255. } 256. 257. > void BN_CTX_start(BN_CTX *ctx) 258. { 259. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:443:2: Call 441. } 442. if (no_branch) bn_correct_top(res); 443. BN_CTX_end(ctx); ^ 444. return(1); 445. err: crypto/bn/bn_ctx.c:272:1: Parameter `ctx->stack.depth` 270. } 271. 272. > void BN_CTX_end(BN_CTX *ctx) 273. { 274. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:279:21: Call 277. else 278. { 279. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 280. /* Does this stack frame have anything to release? */ 281. if(fp < ctx->used) crypto/bn/bn_ctx.c:353:1: <LHS trace> 351. } 352. 353. > static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:353:1: Parameter `st->depth` 351. } 352. 353. > static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:355:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_exp` 353. static unsigned int BN_STACK_pop(BN_STACK *st) 354. { 355. return st->indexes[--(st->depth)]; ^ 356. } 357.
https://github.com/openssl/openssl/blob/27dfffd5b75ee1db114e32f6dc73e266513889c5/crypto/bn/bn_ctx.c/#L355
d2a_code_trace_data_43907
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1802: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_nnmod`. Showing all 14 steps of the trace test/bntest.c:1762:1: Parameter `ctx->stack.depth` 1760. } 1761. 1762. > int test_sqrt(BIO *bp, BN_CTX *ctx) 1763. { 1764. BN_GENCB cb; test/bntest.c:1802:18: Call 1800. if (!BN_bntest_rand(r, 256, 0, 3)) 1801. goto err; 1802. if (!BN_nnmod(r, r, p, ctx)) ^ 1803. goto err; 1804. if (!BN_mod_sqr(r, r, p, ctx)) crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:193:5: Call 191. } 192. 193. BN_CTX_start(ctx); ^ 194. tmp = BN_CTX_get(ctx); 195. snum = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:416:5: Call 414. if (no_branch) 415. bn_correct_top(res); 416. BN_CTX_end(ctx); ^ 417. return (1); 418. err: crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <Offset trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: <Length trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_nnmod` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_43908
void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) { #ifdef POLY1305_ASM poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks; #endif size_t rem, num; if ((num = ctx->num)) { rem = POLY1305_BLOCK_SIZE - num; if (len >= rem) { memcpy(ctx->data + num, inp, rem); poly1305_blocks(ctx->opaque, ctx->data, POLY1305_BLOCK_SIZE, 1); inp += rem; len -= rem; } else { memcpy(ctx->data + num, inp, len); ctx->num = num + len; return; } } rem = len % POLY1305_BLOCK_SIZE; len -= rem; if (len >= POLY1305_BLOCK_SIZE) { poly1305_blocks(ctx->opaque, inp, len, 1); inp += len; } if (rem) memcpy(ctx->data, inp, rem); ctx->num = rem; } crypto/evp/e_chacha20_poly1305.c:279: error: INTEGER_OVERFLOW_L2 ([-15, +oo] - [-15, 15]):unsigned64 by call to `Poly1305_Update`. Showing all 8 steps of the trace crypto/evp/e_chacha20_poly1305.c:233:1: Parameter `len` 231. } 232. 233. > static int chacha20_poly1305_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 234. const unsigned char *in, size_t len) 235. { crypto/evp/e_chacha20_poly1305.c:279:17: Call 277. actx->len.text += plen; 278. } else { /* ciphertext */ 279. Poly1305_Update(POLY1305_ctx(actx), in, plen); ^ 280. chacha_cipher(ctx, out, in, plen); 281. in += plen; crypto/poly1305/poly1305.c:466:1: <LHS trace> 464. #endif 465. 466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 467. { 468. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:466:1: Parameter `len` 464. #endif 465. 466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 467. { 468. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:466:1: <RHS trace> 464. #endif 465. 466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 467. { 468. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:466:1: Parameter `len` 464. #endif 465. 466. > void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len) 467. { 468. #ifdef POLY1305_ASM crypto/poly1305/poly1305.c:494:5: Assignment 492. } 493. 494. rem = len % POLY1305_BLOCK_SIZE; ^ 495. len -= rem; 496. crypto/poly1305/poly1305.c:495:5: Binary operation: ([-15, +oo] - [-15, 15]):unsigned64 by call to `Poly1305_Update` 493. 494. rem = len % POLY1305_BLOCK_SIZE; 495. len -= rem; ^ 496. 497. if (len >= POLY1305_BLOCK_SIZE) {
https://github.com/openssl/openssl/blob/740b2b9a6cf31b02916a4d18f868e8a95934c083/crypto/poly1305/poly1305.c/#L495
d2a_code_trace_data_43909
static void opt_output_file(void *optctx, const char *filename) { OptionsContext *o = optctx; AVFormatContext *oc; int i, err; AVOutputFormat *file_oformat; OutputStream *ost; InputStream *ist; if (!strcmp(filename, "-")) filename = "pipe:"; oc = avformat_alloc_context(); if (!oc) { print_error(filename, AVERROR(ENOMEM)); exit_program(1); } if (o->format) { file_oformat = av_guess_format(o->format, NULL, NULL); if (!file_oformat) { av_log(NULL, AV_LOG_FATAL, "Requested output format '%s' is not a suitable output format\n", o->format); exit_program(1); } } else { file_oformat = av_guess_format(NULL, filename, NULL); if (!file_oformat) { av_log(NULL, AV_LOG_FATAL, "Unable to find a suitable output format for '%s'\n", filename); exit_program(1); } } oc->oformat = file_oformat; oc->interrupt_callback = int_cb; av_strlcpy(oc->filename, filename, sizeof(oc->filename)); if (!strcmp(file_oformat->name, "ffm") && av_strstart(filename, "http:", NULL)) { int err = read_avserver_streams(o, oc, filename); if (err < 0) { print_error(filename, err); exit_program(1); } } else if (!o->nb_stream_maps) { #define NEW_STREAM(type, index)\ if (index >= 0) {\ ost = new_ ## type ## _stream(o, oc);\ ost->source_index = index;\ ost->sync_ist = &input_streams[index];\ input_streams[index].discard = 0;\ } if (!o->video_disable && oc->oformat->video_codec != CODEC_ID_NONE) { int area = 0, idx = -1; for (i = 0; i < nb_input_streams; i++) { ist = &input_streams[i]; if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ist->st->codec->width * ist->st->codec->height > area) { area = ist->st->codec->width * ist->st->codec->height; idx = i; } } NEW_STREAM(video, idx); } if (!o->audio_disable && oc->oformat->audio_codec != CODEC_ID_NONE) { int channels = 0, idx = -1; for (i = 0; i < nb_input_streams; i++) { ist = &input_streams[i]; if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && ist->st->codec->channels > channels) { channels = ist->st->codec->channels; idx = i; } } NEW_STREAM(audio, idx); } if (!o->subtitle_disable && oc->oformat->subtitle_codec != CODEC_ID_NONE) { for (i = 0; i < nb_input_streams; i++) if (input_streams[i].st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) { NEW_STREAM(subtitle, i); break; } } } else { for (i = 0; i < o->nb_stream_maps; i++) { StreamMap *map = &o->stream_maps[i]; if (map->disabled) continue; ist = &input_streams[input_files[map->file_index].ist_index + map->stream_index]; switch (ist->st->codec->codec_type) { case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc); break; case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc); break; case AVMEDIA_TYPE_SUBTITLE: ost = new_subtitle_stream(o, oc); break; case AVMEDIA_TYPE_DATA: ost = new_data_stream(o, oc); break; case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc); break; default: av_log(NULL, AV_LOG_FATAL, "Cannot map stream #%d:%d - unsupported type.\n", map->file_index, map->stream_index); exit_program(1); } ost->source_index = input_files[map->file_index].ist_index + map->stream_index; ost->sync_ist = &input_streams[input_files[map->sync_file_index].ist_index + map->sync_stream_index]; ist->discard = 0; } } for (i = 0; i < o->nb_attachments; i++) { AVIOContext *pb; uint8_t *attachment; const char *p; int64_t len; if ((err = avio_open2(&pb, o->attachments[i], AVIO_FLAG_READ, &int_cb, NULL)) < 0) { av_log(NULL, AV_LOG_FATAL, "Could not open attachment file %s.\n", o->attachments[i]); exit_program(1); } if ((len = avio_size(pb)) <= 0) { av_log(NULL, AV_LOG_FATAL, "Could not get size of the attachment %s.\n", o->attachments[i]); exit_program(1); } if (!(attachment = av_malloc(len))) { av_log(NULL, AV_LOG_FATAL, "Attachment %s too large to fit into memory.\n", o->attachments[i]); exit_program(1); } avio_read(pb, attachment, len); ost = new_attachment_stream(o, oc); ost->stream_copy = 0; ost->source_index = -1; ost->attachment_filename = o->attachments[i]; ost->st->codec->extradata = attachment; ost->st->codec->extradata_size = len; p = strrchr(o->attachments[i], '/'); av_dict_set(&ost->st->metadata, "filename", (p && *p) ? p + 1 : o->attachments[i], AV_DICT_DONT_OVERWRITE); avio_close(pb); } output_files = grow_array(output_files, sizeof(*output_files), &nb_output_files, nb_output_files + 1); output_files[nb_output_files - 1].ctx = oc; output_files[nb_output_files - 1].ost_index = nb_output_streams - oc->nb_streams; output_files[nb_output_files - 1].recording_time = o->recording_time; output_files[nb_output_files - 1].start_time = o->start_time; output_files[nb_output_files - 1].limit_filesize = o->limit_filesize; av_dict_copy(&output_files[nb_output_files - 1].opts, format_opts, 0); if (oc->oformat->flags & AVFMT_NEEDNUMBER) { if (!av_filename_number_test(oc->filename)) { print_error(oc->filename, AVERROR(EINVAL)); exit_program(1); } } if (!(oc->oformat->flags & AVFMT_NOFILE)) { assert_file_overwrite(filename); if ((err = avio_open2(&oc->pb, filename, AVIO_FLAG_WRITE, &oc->interrupt_callback, &output_files[nb_output_files - 1].opts)) < 0) { print_error(filename, err); exit_program(1); } } if (o->mux_preload) { uint8_t buf[64]; snprintf(buf, sizeof(buf), "%d", (int)(o->mux_preload*AV_TIME_BASE)); av_dict_set(&output_files[nb_output_files - 1].opts, "preload", buf, 0); } oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE); oc->flags |= AVFMT_FLAG_NONBLOCK; if (o->chapters_input_file >= nb_input_files) { if (o->chapters_input_file == INT_MAX) { o->chapters_input_file = -1; for (i = 0; i < nb_input_files; i++) if (input_files[i].ctx->nb_chapters) { o->chapters_input_file = i; break; } } else { av_log(NULL, AV_LOG_FATAL, "Invalid input file index %d in chapter mapping.\n", o->chapters_input_file); exit_program(1); } } if (o->chapters_input_file >= 0) copy_chapters(&input_files[o->chapters_input_file], &output_files[nb_output_files - 1], !o->metadata_chapters_manual); for (i = 0; i < o->nb_meta_data_maps; i++) { AVFormatContext *files[2]; AVDictionary **meta[2]; int j; #define METADATA_CHECK_INDEX(index, nb_elems, desc)\ if ((index) < 0 || (index) >= (nb_elems)) {\ av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps\n",\ (desc), (index));\ exit_program(1);\ } int in_file_index = o->meta_data_maps[i][1].file; if (in_file_index < 0) continue; METADATA_CHECK_INDEX(in_file_index, nb_input_files, "input file") files[0] = oc; files[1] = input_files[in_file_index].ctx; for (j = 0; j < 2; j++) { MetadataMap *map = &o->meta_data_maps[i][j]; switch (map->type) { case 'g': meta[j] = &files[j]->metadata; break; case 's': METADATA_CHECK_INDEX(map->index, files[j]->nb_streams, "stream") meta[j] = &files[j]->streams[map->index]->metadata; break; case 'c': METADATA_CHECK_INDEX(map->index, files[j]->nb_chapters, "chapter") meta[j] = &files[j]->chapters[map->index]->metadata; break; case 'p': METADATA_CHECK_INDEX(map->index, files[j]->nb_programs, "program") meta[j] = &files[j]->programs[map->index]->metadata; break; } } av_dict_copy(meta[0], *meta[1], AV_DICT_DONT_OVERWRITE); } if (!o->metadata_global_manual && nb_input_files) av_dict_copy(&oc->metadata, input_files[0].ctx->metadata, AV_DICT_DONT_OVERWRITE); if (!o->metadata_streams_manual) for (i = output_files[nb_output_files - 1].ost_index; i < nb_output_streams; i++) { InputStream *ist; if (output_streams[i].source_index < 0) continue; ist = &input_streams[output_streams[i].source_index]; av_dict_copy(&output_streams[i].st->metadata, ist->st->metadata, AV_DICT_DONT_OVERWRITE); } for (i = 0; i < o->nb_metadata; i++) { AVDictionary **m; char type, *val; int index = 0; val = strchr(o->metadata[i].u.str, '='); if (!val) { av_log(NULL, AV_LOG_FATAL, "No '=' character in metadata string %s.\n", o->metadata[i].u.str); exit_program(1); } *val++ = 0; parse_meta_type(o->metadata[i].specifier, &type, &index); switch (type) { case 'g': m = &oc->metadata; break; case 's': if (index < 0 || index >= oc->nb_streams) { av_log(NULL, AV_LOG_FATAL, "Invalid stream index %d in metadata specifier.\n", index); exit_program(1); } m = &oc->streams[index]->metadata; break; case 'c': if (index < 0 || index >= oc->nb_chapters) { av_log(NULL, AV_LOG_FATAL, "Invalid chapter index %d in metadata specifier.\n", index); exit_program(1); } m = &oc->chapters[index]->metadata; break; default: av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", o->metadata[i].specifier); exit_program(1); } av_dict_set(m, o->metadata[i].u.str, *val ? val : NULL, 0); } reset_options(o); } avconv.c:3580: error: Null Dereference pointer `oc` last assigned on line 3559 could be null and is dereferenced at line 3580, column 5. avconv.c:3547:1: start of procedure opt_output_file() 3545. } 3546. 3547. static void opt_output_file(void *optctx, const char *filename) ^ 3548. { 3549. OptionsContext *o = optctx; avconv.c:3549:5: 3547. static void opt_output_file(void *optctx, const char *filename) 3548. { 3549. OptionsContext *o = optctx; ^ 3550. AVFormatContext *oc; 3551. int i, err; avconv.c:3556:10: Taking true branch 3554. InputStream *ist; 3555. 3556. if (!strcmp(filename, "-")) ^ 3557. filename = "pipe:"; 3558. avconv.c:3557:9: 3555. 3556. if (!strcmp(filename, "-")) 3557. filename = "pipe:"; ^ 3558. 3559. oc = avformat_alloc_context(); avconv.c:3559:5: 3557. filename = "pipe:"; 3558. 3559. oc = avformat_alloc_context(); ^ 3560. if (!oc) { 3561. print_error(filename, AVERROR(ENOMEM)); libavformat/options.c:141:1: start of procedure avformat_alloc_context() 139. } 140. 141. AVFormatContext *avformat_alloc_context(void) ^ 142. { 143. AVFormatContext *ic; libavformat/options.c:144:5: 142. { 143. AVFormatContext *ic; 144. ic = av_malloc(sizeof(AVFormatContext)); ^ 145. if (!ic) return ic; 146. avformat_get_context_defaults(ic); libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(size_t size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(size_t size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking false branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:114:5: 112. ptr = malloc(size); 113. #endif 114. return ptr; ^ 115. } 116. libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavformat/options.c:145:10: Taking true branch 143. AVFormatContext *ic; 144. ic = av_malloc(sizeof(AVFormatContext)); 145. if (!ic) return ic; ^ 146. avformat_get_context_defaults(ic); 147. return ic; libavformat/options.c:145:14: 143. AVFormatContext *ic; 144. ic = av_malloc(sizeof(AVFormatContext)); 145. if (!ic) return ic; ^ 146. avformat_get_context_defaults(ic); 147. return ic; libavformat/options.c:148:1: return from a call to avformat_alloc_context 146. avformat_get_context_defaults(ic); 147. return ic; 148. } ^ 149. 150. const AVClass *avformat_get_class(void) avconv.c:3560:10: Taking true branch 3558. 3559. oc = avformat_alloc_context(); 3560. if (!oc) { ^ 3561. print_error(filename, AVERROR(ENOMEM)); 3562. exit_program(1); avconv.c:3561:9: 3559. oc = avformat_alloc_context(); 3560. if (!oc) { 3561. print_error(filename, AVERROR(ENOMEM)); ^ 3562. exit_program(1); 3563. } cmdutils.c:436:1: start of procedure print_error() 434. } 435. 436. void print_error(const char *filename, int err) ^ 437. { 438. char errbuf[128]; cmdutils.c:439:5: 437. { 438. char errbuf[128]; 439. const char *errbuf_ptr = errbuf; ^ 440. 441. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) cmdutils.c:441:9: Taking true branch 439. const char *errbuf_ptr = errbuf; 440. 441. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) ^ 442. errbuf_ptr = strerror(AVUNERROR(err)); 443. av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr); cmdutils.c:442:9: Skipping strerror(): method has no implementation 440. 441. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) 442. errbuf_ptr = strerror(AVUNERROR(err)); ^ 443. av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr); 444. } cmdutils.c:443:5: Skipping av_log(): empty list of specs 441. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) 442. errbuf_ptr = strerror(AVUNERROR(err)); 443. av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr); ^ 444. } 445. cmdutils.c:444:1: return from a call to print_error 442. errbuf_ptr = strerror(AVUNERROR(err)); 443. av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr); 444. } ^ 445. 446. static int warned_cfg = 0; avconv.c:3562:9: Skipping exit_program(): empty list of specs 3560. if (!oc) { 3561. print_error(filename, AVERROR(ENOMEM)); 3562. exit_program(1); ^ 3563. } 3564. avconv.c:3565:9: Taking true branch 3563. } 3564. 3565. if (o->format) { ^ 3566. file_oformat = av_guess_format(o->format, NULL, NULL); 3567. if (!file_oformat) { avconv.c:3566:9: Skipping av_guess_format(): empty list of specs 3564. 3565. if (o->format) { 3566. file_oformat = av_guess_format(o->format, NULL, NULL); ^ 3567. if (!file_oformat) { 3568. av_log(NULL, AV_LOG_FATAL, "Requested output format '%s' is not a suitable output format\n", o->format); avconv.c:3567:14: Taking false branch 3565. if (o->format) { 3566. file_oformat = av_guess_format(o->format, NULL, NULL); 3567. if (!file_oformat) { ^ 3568. av_log(NULL, AV_LOG_FATAL, "Requested output format '%s' is not a suitable output format\n", o->format); 3569. exit_program(1); avconv.c:3580:5: 3578. } 3579. 3580. oc->oformat = file_oformat; ^ 3581. oc->interrupt_callback = int_cb; 3582. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
https://github.com/libav/libav/blob/e1edfbcb240cace69d92701e6910c2b03555b7d7/avconv.c/#L3580
d2a_code_trace_data_43910
static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, OPENSSL_LH_DOALL_FUNC func, OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) { int i; OPENSSL_LH_NODE *a, *n; if (lh == NULL) return; for (i = lh->num_nodes - 1; i >= 0; i--) { a = lh->b[i]; while (a != NULL) { n = a->next; if (use_arg) func_arg(a->data, arg); else func(a->data); a = n; } } } test/sslcorrupttest.c:238: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `SSL_free`. Showing all 17 steps of the trace test/sslcorrupttest.c:206:10: Call 204. 205. /* BIO is freed by create_ssl_connection on error */ 206. if (!create_ssl_objects(sctx, cctx, &server, &client, NULL, ^ 207. c_to_s_fbio)) { 208. printf("Unable to create SSL objects\n"); test/ssltestlib.c:579:21: Call 577. 578. if (*sssl == NULL) 579. serverssl = SSL_new(serverctx); ^ 580. else 581. serverssl = *sssl; ssl/ssl_lib.c:519:1: Parameter `ctx->sessions->num_nodes` 517. } 518. 519. > SSL *SSL_new(SSL_CTX *ctx) 520. { 521. SSL *s; test/sslcorrupttest.c:238:5: Call 236. testresult = 1; 237. end: 238. SSL_free(server); ^ 239. SSL_free(client); 240. SSL_CTX_free(sctx); ssl/ssl_lib.c:961:1: Parameter `s->ctx->sessions->num_nodes` 959. } 960. 961. > void SSL_free(SSL *s) 962. { 963. int i; ssl/ssl_lib.c:1026:5: Call 1024. RECORD_LAYER_release(&s->rlayer); 1025. 1026. SSL_CTX_free(s->ctx); ^ 1027. 1028. ASYNC_WAIT_CTX_free(s->waitctx); ssl/ssl_lib.c:2581:1: Parameter `a->sessions->num_nodes` 2579. } 2580. 2581. > void SSL_CTX_free(SSL_CTX *a) 2582. { 2583. int i; ssl/ssl_lib.c:2607:9: Call 2605. */ 2606. if (a->sessions != NULL) 2607. SSL_CTX_flush_sessions(a, 0); ^ 2608. 2609. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data); ssl/ssl_sess.c:991:1: Parameter `s->sessions->num_nodes` 989. IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 990. 991. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 992. { 993. unsigned long i; ssl/ssl_sess.c:1004:5: Call 1002. i = lh_SSL_SESSION_get_down_load(s->sessions); 1003. lh_SSL_SESSION_set_down_load(s->sessions, 0); 1004. lh_SSL_SESSION_doall_TIMEOUT_PARAM(tp.cache, timeout_cb, &tp); ^ 1005. lh_SSL_SESSION_set_down_load(s->sessions, i); 1006. CRYPTO_THREAD_unlock(s->lock); ssl/ssl_sess.c:989:1: Parameter `lh->num_nodes` 987. } 988. 989. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 990. 991. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) ssl/ssl_sess.c:989:1: Call 987. } 988. 989. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM); 990. 991. void SSL_CTX_flush_sessions(SSL_CTX *s, long t) crypto/lhash/lhash.c:182:1: Parameter `lh->num_nodes` 180. } 181. 182. > void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 183. { 184. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); crypto/lhash/lhash.c:184:5: Call 182. void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg) 183. { 184. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg); ^ 185. } 186. crypto/lhash/lhash.c:150:1: <LHS trace> 148. } 149. 150. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 151. OPENSSL_LH_DOALL_FUNC func, 152. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:150:1: Parameter `lh->num_nodes` 148. } 149. 150. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg, 151. OPENSSL_LH_DOALL_FUNC func, 152. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg) crypto/lhash/lhash.c:164:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `SSL_free` 162. * memory leaks otherwise 163. */ 164. for (i = lh->num_nodes - 1; i >= 0; i--) { ^ 165. a = lh->b[i]; 166. while (a != NULL) {
https://github.com/openssl/openssl/blob/6a69e8694af23dae1d1927813932f4296d133416/crypto/lhash/lhash.c/#L164
d2a_code_trace_data_43911
int test_mul(BIO *bp) { BIGNUM *a, *b, *c, *d, *e; int i; BN_CTX *ctx; ctx = BN_CTX_new(); if (ctx == NULL) EXIT(1); a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); for (i = 0; i < num0 + num1; i++) { if (i <= num1) { BN_bntest_rand(a, 100, 0, 0); BN_bntest_rand(b, 100, 0, 0); } else BN_bntest_rand(b, i - num1, 0, 0); a->neg = rand_neg(); b->neg = rand_neg(); BN_mul(c, a, b, ctx); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " * "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, c); BIO_puts(bp, "\n"); } BN_div(d, e, c, a, ctx); BN_sub(d, d, b); if (!BN_is_zero(d) || !BN_is_zero(e)) { fprintf(stderr, "Multiplication test failed!\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); BN_CTX_free(ctx); return (1); } test/bntest.c:690: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 658, column 9 is not reachable after line 690, column 5. Showing all 171 steps of the trace test/bntest.c:647:1: start of procedure test_mul() 645. } 646. 647. > int test_mul(BIO *bp) 648. { 649. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:653:5: 651. BN_CTX *ctx; 652. 653. > ctx = BN_CTX_new(); 654. if (ctx == NULL) 655. EXIT(1); crypto/bn/bn_ctx.c:189:1: start of procedure BN_CTX_new() 187. 188. 189. > BN_CTX *BN_CTX_new(void) 190. { 191. BN_CTX *ret; crypto/bn/bn_ctx.c:193:9: 191. BN_CTX *ret; 192. 193. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_ctx.c:193:9: Taking false branch 191. BN_CTX *ret; 192. 193. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 194. BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE); 195. return NULL; crypto/bn/bn_ctx.c:198:5: 196. } 197. /* Initialise the structure */ 198. > BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. return ret; crypto/bn/bn_ctx.c:335:1: start of procedure BN_POOL_init() 333. /***********/ 334. 335. > static void BN_POOL_init(BN_POOL *p) 336. { 337. p->head = p->current = p->tail = NULL; crypto/bn/bn_ctx.c:337:5: 335. static void BN_POOL_init(BN_POOL *p) 336. { 337. > p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. } crypto/bn/bn_ctx.c:338:5: 336. { 337. p->head = p->current = p->tail = NULL; 338. > p->used = p->size = 0; 339. } 340. crypto/bn/bn_ctx.c:339:1: return from a call to BN_POOL_init 337. p->head = p->current = p->tail = NULL; 338. p->used = p->size = 0; 339. > } 340. 341. static void BN_POOL_finish(BN_POOL *p) crypto/bn/bn_ctx.c:199:5: 197. /* Initialise the structure */ 198. BN_POOL_init(&ret->pool); 199. > BN_STACK_init(&ret->stack); 200. return ret; 201. } crypto/bn/bn_ctx.c:294:1: start of procedure BN_STACK_init() 292. /************/ 293. 294. > static void BN_STACK_init(BN_STACK *st) 295. { 296. st->indexes = NULL; crypto/bn/bn_ctx.c:296:5: 294. static void BN_STACK_init(BN_STACK *st) 295. { 296. > st->indexes = NULL; 297. st->depth = st->size = 0; 298. } crypto/bn/bn_ctx.c:297:5: 295. { 296. st->indexes = NULL; 297. > st->depth = st->size = 0; 298. } 299. crypto/bn/bn_ctx.c:298:1: return from a call to BN_STACK_init 296. st->indexes = NULL; 297. st->depth = st->size = 0; 298. > } 299. 300. static void BN_STACK_finish(BN_STACK *st) crypto/bn/bn_ctx.c:200:5: 198. BN_POOL_init(&ret->pool); 199. BN_STACK_init(&ret->stack); 200. > return ret; 201. } 202. crypto/bn/bn_ctx.c:201:1: return from a call to BN_CTX_new 199. BN_STACK_init(&ret->stack); 200. return ret; 201. > } 202. 203. BN_CTX *BN_CTX_secure_new(void) test/bntest.c:654:9: Taking false branch 652. 653. ctx = BN_CTX_new(); 654. if (ctx == NULL) ^ 655. EXIT(1); 656. test/bntest.c:657:5: 655. EXIT(1); 656. 657. > a = BN_new(); 658. b = BN_new(); 659. c = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:658:5: 656. 657. a = BN_new(); 658. > b = BN_new(); 659. c = BN_new(); 660. d = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:659:5: 657. a = BN_new(); 658. b = BN_new(); 659. > c = BN_new(); 660. d = BN_new(); 661. e = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:660:5: 658. b = BN_new(); 659. c = BN_new(); 660. > d = BN_new(); 661. e = BN_new(); 662. crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:661:5: 659. c = BN_new(); 660. d = BN_new(); 661. > e = BN_new(); 662. 663. for (i = 0; i < num0 + num1; i++) { crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:663:10: 661. e = BN_new(); 662. 663. > for (i = 0; i < num0 + num1; i++) { 664. if (i <= num1) { 665. BN_bntest_rand(a, 100, 0, 0); test/bntest.c:663:17: Loop condition is false. Leaving loop 661. e = BN_new(); 662. 663. for (i = 0; i < num0 + num1; i++) { ^ 664. if (i <= num1) { 665. BN_bntest_rand(a, 100, 0, 0); test/bntest.c:689:5: 687. } 688. } 689. > BN_free(a); 690. BN_free(b); 691. BN_free(c); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a) test/bntest.c:690:5: 688. } 689. BN_free(a); 690. > BN_free(b); 691. BN_free(c); 692. BN_free(d); crypto/bn/bn_lib.c:252:1: start of procedure BN_free() 250. } 251. 252. > void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) crypto/bn/bn_lib.c:254:9: Taking false branch 252. void BN_free(BIGNUM *a) 253. { 254. if (a == NULL) ^ 255. return; 256. bn_check_top(a); crypto/bn/bn_lib.c:257:10: 255. return; 256. bn_check_top(a); 257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags() 963. } 964. 965. > int BN_get_flags(const BIGNUM *b, int n) 966. { 967. return b->flags & n; crypto/bn/bn_lib.c:967:5: 965. int BN_get_flags(const BIGNUM *b, int n) 966. { 967. > return b->flags & n; 968. } 969. crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags 966. { 967. return b->flags & n; 968. > } 969. 970. /* Populate a BN_GENCB structure with an "old"-style callback */ crypto/bn/bn_lib.c:257:10: Taking false branch 255. return; 256. bn_check_top(a); 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) ^ 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) crypto/bn/bn_lib.c:259:9: Taking false branch 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. if (a->flags & BN_FLG_MALLOCED) ^ 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:263:9: 261. else { 262. #if OPENSSL_API_COMPAT < 0x00908000L 263. > a->flags |= BN_FLG_FREE; 264. #endif 265. a->d = NULL; crypto/bn/bn_lib.c:265:9: 263. a->flags |= BN_FLG_FREE; 264. #endif 265. > a->d = NULL; 266. } 267. } crypto/bn/bn_lib.c:259:5: 257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA)) 258. bn_free_d(a); 259. > if (a->flags & BN_FLG_MALLOCED) 260. OPENSSL_free(a); 261. else { crypto/bn/bn_lib.c:267:1: return from a call to BN_free 265. a->d = NULL; 266. } 267. > } 268. 269. void bn_init(BIGNUM *a)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L690
d2a_code_trace_data_43912
char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) { const X509_NAME_ENTRY *ne; int i; int n, lold, l, l1, l2, num, j, type; const char *s; char *p; unsigned char *q; BUF_MEM *b = NULL; static const char hex[17] = "0123456789ABCDEF"; int gs_doit[4]; char tmp_buf[80]; #ifdef CHARSET_EBCDIC unsigned char ebcdic_buf[1024]; #endif if (buf == NULL) { if ((b = BUF_MEM_new()) == NULL) goto err; if (!BUF_MEM_grow(b, 200)) goto err; b->data[0] = '\0'; len = 200; } else if (len == 0) { return NULL; } if (a == NULL) { if (b) { buf = b->data; OPENSSL_free(b); } strncpy(buf, "NO X509_NAME", len); buf[len - 1] = '\0'; return buf; } len--; l = 0; for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { ne = sk_X509_NAME_ENTRY_value(a->entries, i); n = OBJ_obj2nid(ne->object); if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) { i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object); s = tmp_buf; } l1 = strlen(s); type = ne->value->type; num = ne->value->length; if (num > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } q = ne->value->data; #ifdef CHARSET_EBCDIC if (type == V_ASN1_GENERALSTRING || type == V_ASN1_VISIBLESTRING || type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || type == V_ASN1_IA5STRING) { if (num > (int)sizeof(ebcdic_buf)) num = sizeof(ebcdic_buf); ascii2ebcdic(ebcdic_buf, q, num); q = ebcdic_buf; } #endif if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) { gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0; for (j = 0; j < num; j++) if (q[j] != 0) gs_doit[j & 3] = 1; if (gs_doit[0] | gs_doit[1] | gs_doit[2]) gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; else { gs_doit[0] = gs_doit[1] = gs_doit[2] = 0; gs_doit[3] = 1; } } else gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1; for (l2 = j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; l2++; #ifndef CHARSET_EBCDIC if ((q[j] < ' ') || (q[j] > '~')) l2 += 3; #else if ((os_toascii[q[j]] < os_toascii[' ']) || (os_toascii[q[j]] > os_toascii['~'])) l2 += 3; #endif } lold = l; l += 1 + l1 + 1 + l2; if (l > NAME_ONELINE_MAX) { X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG); goto end; } if (b != NULL) { if (!BUF_MEM_grow(b, l + 1)) goto err; p = &(b->data[lold]); } else if (l > len) { break; } else p = &(buf[lold]); *(p++) = '/'; memcpy(p, s, (unsigned int)l1); p += l1; *(p++) = '='; #ifndef CHARSET_EBCDIC q = ne->value->data; #endif for (j = 0; j < num; j++) { if (!gs_doit[j & 3]) continue; #ifndef CHARSET_EBCDIC n = q[j]; if ((n < ' ') || (n > '~')) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = n; #else n = os_toascii[q[j]]; if ((n < os_toascii[' ']) || (n > os_toascii['~'])) { *(p++) = '\\'; *(p++) = 'x'; *(p++) = hex[(n >> 4) & 0x0f]; *(p++) = hex[n & 0x0f]; } else *(p++) = q[j]; #endif } *p = '\0'; } if (b != NULL) { p = b->data; OPENSSL_free(b); } else p = buf; if (i == 0) *p = '\0'; return (p); err: X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE); end: BUF_MEM_free(b); return (NULL); } apps/x509.c:729: error: BUFFER_OVERRUN_L3 Offset added: [200, 256] Size: [1, 2147483644] by call to `X509_NAME_oneline`. Showing all 6 steps of the trace apps/x509.c:729:17: Call 727. int len; 728. 729. X509_NAME_oneline(X509_get_subject_name(x), buf, sizeof buf); ^ 730. BIO_printf(out, "/*\n" 731. " * Subject: %s\n", buf); crypto/x509/x509_obj.c:25:1: <Offset trace> 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: Parameter `len` 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: <Length trace> 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:25:1: Parameter `*buf` 23. #define NAME_ONELINE_MAX (1024 * 1024) 24. 25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len) 26. { 27. const X509_NAME_ENTRY *ne; crypto/x509/x509_obj.c:56:9: Array access: Offset added: [200, 256] Size: [1, 2147483644] by call to `X509_NAME_oneline` 54. OPENSSL_free(b); 55. } 56. strncpy(buf, "NO X509_NAME", len); ^ 57. buf[len - 1] = '\0'; 58. return buf;
https://github.com/openssl/openssl/blob/645c694d85c8f48c74e7db8730ead874656c781e/crypto/x509/x509_obj.c/#L56
d2a_code_trace_data_43913
static int decode_audio_specific_config(AACContext *ac, AVCodecContext *avctx, MPEG4AudioConfig *m4ac, const uint8_t *data, int data_size) { GetBitContext gb; int i; av_dlog(avctx, "extradata size %d\n", avctx->extradata_size); for (i = 0; i < avctx->extradata_size; i++) av_dlog(avctx, "%02x ", avctx->extradata[i]); av_dlog(avctx, "\n"); init_get_bits(&gb, data, data_size * 8); if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) return -1; if (m4ac->sampling_index > 12) { av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index); return -1; } if (m4ac->sbr == 1 && m4ac->ps == -1) m4ac->ps = 1; skip_bits_long(&gb, i); switch (m4ac->object_type) { case AOT_AAC_MAIN: case AOT_AAC_LC: case AOT_AAC_LTP: if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config)) return -1; break; default: av_log(avctx, AV_LOG_ERROR, "Audio object type %s%d is not supported.\n", m4ac->sbr == 1? "SBR+" : "", m4ac->object_type); return -1; } av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n", m4ac->object_type, m4ac->chan_config, m4ac->sampling_index, m4ac->sample_rate, m4ac->sbr, m4ac->ps); return get_bits_count(&gb); } libavcodec/aacdec.c:488: error: Null Dereference pointer `&gb->buffer` last assigned on line 471 could be null and is dereferenced by call to `decode_ga_specific_config()` at line 488, column 13. libavcodec/aacdec.c:458:1: start of procedure decode_audio_specific_config() 456. * @return Returns error status or number of consumed bits. <0 - error 457. */ 458. static int decode_audio_specific_config(AACContext *ac, ^ 459. AVCodecContext *avctx, 460. MPEG4AudioConfig *m4ac, libavcodec/aacdec.c:467:10: 465. 466. av_dlog(avctx, "extradata size %d\n", avctx->extradata_size); 467. for (i = 0; i < avctx->extradata_size; i++) ^ 468. av_dlog(avctx, "%02x ", avctx->extradata[i]); 469. av_dlog(avctx, "\n"); libavcodec/aacdec.c:467:17: Loop condition is false. Leaving loop 465. 466. av_dlog(avctx, "extradata size %d\n", avctx->extradata_size); 467. for (i = 0; i < avctx->extradata_size; i++) ^ 468. av_dlog(avctx, "%02x ", avctx->extradata[i]); 469. av_dlog(avctx, "\n"); libavcodec/aacdec.c:471:5: 469. av_dlog(avctx, "\n"); 470. 471. init_get_bits(&gb, data, data_size * 8); ^ 472. 473. if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) libavcodec/get_bits.h:391:1: start of procedure init_get_bits() 389. * responsible for checking for the buffer end yourself (take advantage of the padding)! 390. */ 391. static inline void init_get_bits(GetBitContext *s, ^ 392. const uint8_t *buffer, int bit_size) 393. { libavcodec/get_bits.h:394:5: 392. const uint8_t *buffer, int bit_size) 393. { 394. int buffer_size = (bit_size+7)>>3; ^ 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; libavcodec/get_bits.h:395:9: Taking true branch 393. { 394. int buffer_size = (bit_size+7)>>3; 395. if (buffer_size < 0 || bit_size < 0) { ^ 396. buffer_size = bit_size = 0; 397. buffer = NULL; libavcodec/get_bits.h:396:9: 394. int buffer_size = (bit_size+7)>>3; 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; ^ 397. buffer = NULL; 398. } libavcodec/get_bits.h:397:9: 395. if (buffer_size < 0 || bit_size < 0) { 396. buffer_size = bit_size = 0; 397. buffer = NULL; ^ 398. } 399. libavcodec/get_bits.h:400:5: 398. } 399. 400. s->buffer = buffer; ^ 401. s->size_in_bits = bit_size; 402. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:401:5: 399. 400. s->buffer = buffer; 401. s->size_in_bits = bit_size; ^ 402. s->buffer_end = buffer + buffer_size; 403. #ifdef ALT_BITSTREAM_READER libavcodec/get_bits.h:402:5: 400. s->buffer = buffer; 401. s->size_in_bits = bit_size; 402. s->buffer_end = buffer + buffer_size; ^ 403. #ifdef ALT_BITSTREAM_READER 404. s->index = 0; libavcodec/get_bits.h:404:5: 402. s->buffer_end = buffer + buffer_size; 403. #ifdef ALT_BITSTREAM_READER 404. s->index = 0; ^ 405. #elif defined A32_BITSTREAM_READER 406. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3); libavcodec/get_bits.h:410:1: return from a call to init_get_bits 408. skip_bits_long(s, 0); 409. #endif 410. } ^ 411. 412. static inline void align_get_bits(GetBitContext *s) libavcodec/aacdec.c:473:9: Taking false branch 471. init_get_bits(&gb, data, data_size * 8); 472. 473. if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) ^ 474. return -1; 475. if (m4ac->sampling_index > 12) { libavcodec/aacdec.c:475:9: Taking false branch 473. if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) 474. return -1; 475. if (m4ac->sampling_index > 12) { ^ 476. av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index); 477. return -1; libavcodec/aacdec.c:479:9: Taking true branch 477. return -1; 478. } 479. if (m4ac->sbr == 1 && m4ac->ps == -1) ^ 480. m4ac->ps = 1; 481. libavcodec/aacdec.c:479:27: Taking false branch 477. return -1; 478. } 479. if (m4ac->sbr == 1 && m4ac->ps == -1) ^ 480. m4ac->ps = 1; 481. libavcodec/aacdec.c:482:5: 480. m4ac->ps = 1; 481. 482. skip_bits_long(&gb, i); ^ 483. 484. switch (m4ac->object_type) { libavcodec/get_bits.h:173:1: start of procedure skip_bits_long() 171. } 172. 173. static inline void skip_bits_long(GetBitContext *s, int n){ ^ 174. s->index += n; 175. } libavcodec/get_bits.h:174:5: 172. 173. static inline void skip_bits_long(GetBitContext *s, int n){ 174. s->index += n; ^ 175. } 176. libavcodec/get_bits.h:175:1: return from a call to skip_bits_long 173. static inline void skip_bits_long(GetBitContext *s, int n){ 174. s->index += n; 175. } ^ 176. 177. #elif defined A32_BITSTREAM_READER libavcodec/aacdec.c:484:5: 482. skip_bits_long(&gb, i); 483. 484. switch (m4ac->object_type) { ^ 485. case AOT_AAC_MAIN: 486. case AOT_AAC_LC: libavcodec/aacdec.c:485:5: Switch condition is true. Entering switch case 483. 484. switch (m4ac->object_type) { 485. case AOT_AAC_MAIN: ^ 486. case AOT_AAC_LC: 487. case AOT_AAC_LTP: libavcodec/aacdec.c:488:13: 486. case AOT_AAC_LC: 487. case AOT_AAC_LTP: 488. if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config)) ^ 489. return -1; 490. break;
https://github.com/libav/libav/blob/cfc2a0cf848e71fcec0861a73b26c2c96a201357/libavcodec/aacdec.c/#L488
d2a_code_trace_data_43914
int opt_verify(int opt, X509_VERIFY_PARAM *vpm) { int i; ossl_intmax_t t = 0; ASN1_OBJECT *otmp; X509_PURPOSE *xptmp; const X509_VERIFY_PARAM *vtmp; assert(vpm != NULL); assert(opt > OPT_V__FIRST); assert(opt < OPT_V__LAST); switch ((enum range)opt) { case OPT_V__FIRST: case OPT_V__LAST: return 0; case OPT_V_POLICY: otmp = OBJ_txt2obj(opt_arg(), 0); if (otmp == NULL) { BIO_printf(bio_err, "%s: Invalid Policy %s\n", prog, opt_arg()); return 0; } X509_VERIFY_PARAM_add0_policy(vpm, otmp); break; case OPT_V_PURPOSE: i = X509_PURPOSE_get_by_sname(opt_arg()); if (i < 0) { BIO_printf(bio_err, "%s: Invalid purpose %s\n", prog, opt_arg()); return 0; } xptmp = X509_PURPOSE_get0(i); i = X509_PURPOSE_get_id(xptmp); if (!X509_VERIFY_PARAM_set_purpose(vpm, i)) { BIO_printf(bio_err, "%s: Internal error setting purpose %s\n", prog, opt_arg()); return 0; } break; case OPT_V_VERIFY_NAME: vtmp = X509_VERIFY_PARAM_lookup(opt_arg()); if (vtmp == NULL) { BIO_printf(bio_err, "%s: Invalid verify name %s\n", prog, opt_arg()); return 0; } X509_VERIFY_PARAM_set1(vpm, vtmp); break; case OPT_V_VERIFY_DEPTH: i = atoi(opt_arg()); if (i >= 0) X509_VERIFY_PARAM_set_depth(vpm, i); break; case OPT_V_ATTIME: if (!opt_imax(opt_arg(), &t)) return 0; if (t != (time_t)t) { BIO_printf(bio_err, "%s: epoch time out of range %s\n", prog, opt_arg()); return 0; } X509_VERIFY_PARAM_set_time(vpm, (time_t)t); break; case OPT_V_VERIFY_HOSTNAME: if (!X509_VERIFY_PARAM_set1_host(vpm, opt_arg(), 0)) return 0; break; case OPT_V_VERIFY_EMAIL: if (!X509_VERIFY_PARAM_set1_email(vpm, opt_arg(), 0)) return 0; break; case OPT_V_VERIFY_IP: if (!X509_VERIFY_PARAM_set1_ip_asc(vpm, opt_arg())) return 0; break; case OPT_V_IGNORE_CRITICAL: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_IGNORE_CRITICAL); break; case OPT_V_ISSUER_CHECKS: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CB_ISSUER_CHECK); break; case OPT_V_CRL_CHECK: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CRL_CHECK); break; case OPT_V_CRL_CHECK_ALL: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); break; case OPT_V_POLICY_CHECK: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_POLICY_CHECK); break; case OPT_V_EXPLICIT_POLICY: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_EXPLICIT_POLICY); break; case OPT_V_INHIBIT_ANY: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_INHIBIT_ANY); break; case OPT_V_INHIBIT_MAP: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_INHIBIT_MAP); break; case OPT_V_X509_STRICT: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_X509_STRICT); break; case OPT_V_EXTENDED_CRL: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_EXTENDED_CRL_SUPPORT); break; case OPT_V_USE_DELTAS: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_USE_DELTAS); break; case OPT_V_POLICY_PRINT: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NOTIFY_POLICY); break; case OPT_V_CHECK_SS_SIG: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_CHECK_SS_SIGNATURE); break; case OPT_V_TRUSTED_FIRST: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_TRUSTED_FIRST); break; case OPT_V_SUITEB_128_ONLY: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_128_LOS_ONLY); break; case OPT_V_SUITEB_128: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_128_LOS); break; case OPT_V_SUITEB_192: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_SUITEB_192_LOS); break; case OPT_V_PARTIAL_CHAIN: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_PARTIAL_CHAIN); break; case OPT_V_NO_ALT_CHAINS: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NO_ALT_CHAINS); break; case OPT_V_NO_CHECK_TIME: X509_VERIFY_PARAM_set_flags(vpm, X509_V_FLAG_NO_CHECK_TIME); break; } return 1; } apps/opt.c:510: error: NULL_DEREFERENCE pointer `xptmp` last assigned on line 507 could be null and is dereferenced by call to `X509_PURPOSE_get_id()` at line 510, column 13. Showing all 31 steps of the trace apps/opt.c:474:1: start of procedure opt_verify() 472. enum range { OPT_V_ENUM }; 473. 474. > int opt_verify(int opt, X509_VERIFY_PARAM *vpm) 475. { 476. int i; apps/opt.c:477:5: 475. { 476. int i; 477. > ossl_intmax_t t = 0; 478. ASN1_OBJECT *otmp; 479. X509_PURPOSE *xptmp; apps/opt.c:482:5: Condition is true 480. const X509_VERIFY_PARAM *vtmp; 481. 482. assert(vpm != NULL); ^ 483. assert(opt > OPT_V__FIRST); 484. assert(opt < OPT_V__LAST); apps/opt.c:483:5: Condition is true 481. 482. assert(vpm != NULL); 483. assert(opt > OPT_V__FIRST); ^ 484. assert(opt < OPT_V__LAST); 485. apps/opt.c:484:5: Condition is true 482. assert(vpm != NULL); 483. assert(opt > OPT_V__FIRST); 484. assert(opt < OPT_V__LAST); ^ 485. 486. switch ((enum range)opt) { apps/opt.c:486:5: 484. assert(opt < OPT_V__LAST); 485. 486. > switch ((enum range)opt) { 487. case OPT_V__FIRST: 488. case OPT_V__LAST: apps/opt.c:487:5: Switch condition is false. Skipping switch case 485. 486. switch ((enum range)opt) { 487. case OPT_V__FIRST: ^ 488. case OPT_V__LAST: 489. return 0; apps/opt.c:488:5: Switch condition is false. Skipping switch case 486. switch ((enum range)opt) { 487. case OPT_V__FIRST: 488. case OPT_V__LAST: ^ 489. return 0; 490. case OPT_V_POLICY: apps/opt.c:490:5: Switch condition is false. Skipping switch case 488. case OPT_V__LAST: 489. return 0; 490. case OPT_V_POLICY: ^ 491. otmp = OBJ_txt2obj(opt_arg(), 0); 492. if (otmp == NULL) { apps/opt.c:498:5: Switch condition is true. Entering switch case 496. X509_VERIFY_PARAM_add0_policy(vpm, otmp); 497. break; 498. case OPT_V_PURPOSE: ^ 499. /* purpose name -> purpose index */ 500. i = X509_PURPOSE_get_by_sname(opt_arg()); apps/opt.c:500:9: 498. case OPT_V_PURPOSE: 499. /* purpose name -> purpose index */ 500. > i = X509_PURPOSE_get_by_sname(opt_arg()); 501. if (i < 0) { 502. BIO_printf(bio_err, "%s: Invalid purpose %s\n", prog, opt_arg()); apps/opt.c:777:1: start of procedure opt_arg() 775. 776. /* Return the most recent flag parameter. */ 777. > char *opt_arg(void) 778. { 779. return arg; apps/opt.c:779:5: 777. char *opt_arg(void) 778. { 779. > return arg; 780. } 781. apps/opt.c:780:1: return from a call to opt_arg 778. { 779. return arg; 780. > } 781. 782. /* Return the most recent flag. */ apps/opt.c:500:9: Skipping X509_PURPOSE_get_by_sname(): empty list of specs 498. case OPT_V_PURPOSE: 499. /* purpose name -> purpose index */ 500. i = X509_PURPOSE_get_by_sname(opt_arg()); ^ 501. if (i < 0) { 502. BIO_printf(bio_err, "%s: Invalid purpose %s\n", prog, opt_arg()); apps/opt.c:501:13: Taking false branch 499. /* purpose name -> purpose index */ 500. i = X509_PURPOSE_get_by_sname(opt_arg()); 501. if (i < 0) { ^ 502. BIO_printf(bio_err, "%s: Invalid purpose %s\n", prog, opt_arg()); 503. return 0; apps/opt.c:507:9: 505. 506. /* purpose index -> purpose object */ 507. > xptmp = X509_PURPOSE_get0(i); 508. 509. /* purpose object -> purpose value */ crypto/x509v3/v3_purp.c:162:1: start of procedure X509_PURPOSE_get0() 160. } 161. 162. > X509_PURPOSE *X509_PURPOSE_get0(int idx) 163. { 164. if (idx < 0) crypto/x509v3/v3_purp.c:164:9: Taking false branch 162. X509_PURPOSE *X509_PURPOSE_get0(int idx) 163. { 164. if (idx < 0) ^ 165. return NULL; 166. if (idx < (int)X509_PURPOSE_COUNT) crypto/x509v3/v3_purp.c:166:9: Taking false branch 164. if (idx < 0) 165. return NULL; 166. if (idx < (int)X509_PURPOSE_COUNT) ^ 167. return xstandard + idx; 168. return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT); crypto/x509v3/v3_purp.c:168:5: 166. if (idx < (int)X509_PURPOSE_COUNT) 167. return xstandard + idx; 168. > return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT); 169. } 170. include/openssl/x509v3.h:499:1: start of procedure sk_X509_PURPOSE_value() 497. # define X509V3_ADD_SILENT 0x10 498. 499. > DEFINE_STACK_OF(X509_PURPOSE) 500. 501. DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) crypto/stack/stack.c:323:1: start of procedure sk_value() 321. } 322. 323. > void *sk_value(const _STACK *st, int i) 324. { 325. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:325:10: Taking true branch 323. void *sk_value(const _STACK *st, int i) 324. { 325. if (!st || (i < 0) || (i >= st->num)) ^ 326. return NULL; 327. return st->data[i]; crypto/stack/stack.c:326:9: 324. { 325. if (!st || (i < 0) || (i >= st->num)) 326. > return NULL; 327. return st->data[i]; 328. } crypto/stack/stack.c:328:1: return from a call to sk_value 326. return NULL; 327. return st->data[i]; 328. > } 329. 330. void *sk_set(_STACK *st, int i, void *value) include/openssl/x509v3.h:499:1: return from a call to sk_X509_PURPOSE_value 497. # define X509V3_ADD_SILENT 0x10 498. 499. > DEFINE_STACK_OF(X509_PURPOSE) 500. 501. DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) crypto/x509v3/v3_purp.c:169:1: return from a call to X509_PURPOSE_get0 167. return xstandard + idx; 168. return sk_X509_PURPOSE_value(xptable, idx - X509_PURPOSE_COUNT); 169. > } 170. 171. int X509_PURPOSE_get_by_sname(char *sname) apps/opt.c:510:9: 508. 509. /* purpose object -> purpose value */ 510. > i = X509_PURPOSE_get_id(xptmp); 511. 512. if (!X509_VERIFY_PARAM_set_purpose(vpm, i)) { crypto/x509v3/v3_purp.c:281:1: start of procedure X509_PURPOSE_get_id() 279. } 280. 281. > int X509_PURPOSE_get_id(X509_PURPOSE *xp) 282. { 283. return xp->purpose; crypto/x509v3/v3_purp.c:283:5: 281. int X509_PURPOSE_get_id(X509_PURPOSE *xp) 282. { 283. > return xp->purpose; 284. } 285.
https://github.com/openssl/openssl/blob/0daccd4dc1f1ac62181738a91714f35472e50f3c/apps/opt.c/#L510
d2a_code_trace_data_43915
static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track) { MOVStts *ctts_entries; uint32_t entries = 0; uint32_t atom_size; int i; ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); ctts_entries[0].count = 1; ctts_entries[0].duration = track->cluster[0].cts; for (i=1; i<track->entry; i++) { if (track->cluster[i].cts == ctts_entries[entries].duration) { ctts_entries[entries].count++; } else { entries++; ctts_entries[entries].duration = track->cluster[i].cts; ctts_entries[entries].count = 1; } } entries++; atom_size = 16 + (entries * 8); avio_wb32(pb, atom_size); ffio_wfourcc(pb, "ctts"); avio_wb32(pb, 0); avio_wb32(pb, entries); for (i=0; i<entries; i++) { avio_wb32(pb, ctts_entries[i].count); avio_wb32(pb, ctts_entries[i].duration); } av_free(ctts_entries); return atom_size; } libavformat/movenc.c:1083: error: Null Dereference pointer `ctts_entries` last assigned on line 1082 could be null and is dereferenced at line 1083, column 5. libavformat/movenc.c:1075:1: start of procedure mov_write_ctts_tag() 1073. } 1074. 1075. static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track) ^ 1076. { 1077. MOVStts *ctts_entries; libavformat/movenc.c:1078:5: 1076. { 1077. MOVStts *ctts_entries; 1078. uint32_t entries = 0; ^ 1079. uint32_t atom_size; 1080. int i; libavformat/movenc.c:1082:5: 1080. int i; 1081. 1082. ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */ ^ 1083. ctts_entries[0].count = 1; 1084. ctts_entries[0].duration = track->cluster[0].cts; 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:71:5: 69. #endif 70. 71. assert(size); ^ 72. 73. /* let's disallow possible ambiguous cases */ libavutil/mem.c:74:9: Taking true branch 72. 73. /* let's disallow possible ambiguous cases */ 74. if (size > (INT_MAX-32) || !size) ^ 75. return NULL; 76. libavutil/mem.c:75:9: 73. /* let's disallow possible ambiguous cases */ 74. if (size > (INT_MAX-32) || !size) 75. return NULL; ^ 76. 77. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:117:1: return from a call to av_malloc 115. #endif 116. return ptr; 117. } ^ 118. 119. void *av_realloc(void *ptr, size_t size) libavformat/movenc.c:1083:5: 1081. 1082. ctts_entries = av_malloc((track->entry + 1) * sizeof(*ctts_entries)); /* worst case */ 1083. ctts_entries[0].count = 1; ^ 1084. ctts_entries[0].duration = track->cluster[0].cts; 1085. for (i=1; i<track->entry; i++) {
https://github.com/libav/libav/blob/ed7bdd8647a3d0f534c2af0d244fc8744ff262a0/libavformat/movenc.c/#L1083
d2a_code_trace_data_43916
static int opt_attach(OptionsContext *o, const char *opt, const char *arg) { o->attachments = grow_array(o->attachments, sizeof(*o->attachments), &o->nb_attachments, o->nb_attachments + 1); o->attachments[o->nb_attachments - 1] = arg; return 0; } avconv.c:2743: error: Null Dereference pointer `o->attachments` last assigned on line 2741 could be null and is dereferenced at line 2743, column 5. avconv.c:2739:1: start of procedure opt_attach() 2737. } 2738. 2739. static int opt_attach(OptionsContext *o, const char *opt, const char *arg) ^ 2740. { 2741. o->attachments = grow_array(o->attachments, sizeof(*o->attachments), avconv.c:2741:5: 2739. static int opt_attach(OptionsContext *o, const char *opt, const char *arg) 2740. { 2741. o->attachments = grow_array(o->attachments, sizeof(*o->attachments), ^ 2742. &o->nb_attachments, o->nb_attachments + 1); 2743. o->attachments[o->nb_attachments - 1] = arg; cmdutils.c:1056:1: start of procedure grow_array() 1054. #endif /* CONFIG_AVFILTER */ 1055. 1056. void *grow_array(void *array, int elem_size, int *size, int new_size) ^ 1057. { 1058. if (new_size >= INT_MAX / elem_size) { cmdutils.c:1058:9: Taking true branch 1056. void *grow_array(void *array, int elem_size, int *size, int new_size) 1057. { 1058. if (new_size >= INT_MAX / elem_size) { ^ 1059. av_log(NULL, AV_LOG_ERROR, "Array too big.\n"); 1060. exit_program(1); cmdutils.c:1059:9: Skipping av_log(): empty list of specs 1057. { 1058. if (new_size >= INT_MAX / elem_size) { 1059. av_log(NULL, AV_LOG_ERROR, "Array too big.\n"); ^ 1060. exit_program(1); 1061. } cmdutils.c:1060:9: Skipping exit_program(): empty list of specs 1058. if (new_size >= INT_MAX / elem_size) { 1059. av_log(NULL, AV_LOG_ERROR, "Array too big.\n"); 1060. exit_program(1); ^ 1061. } 1062. if (*size < new_size) { cmdutils.c:1062:9: Taking true branch 1060. exit_program(1); 1061. } 1062. if (*size < new_size) { ^ 1063. uint8_t *tmp = av_realloc(array, new_size*elem_size); 1064. if (!tmp) { cmdutils.c:1063:9: 1061. } 1062. if (*size < new_size) { 1063. uint8_t *tmp = av_realloc(array, new_size*elem_size); ^ 1064. if (!tmp) { 1065. av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); libavutil/mem.c:117:1: start of procedure av_realloc() 115. } 116. 117. void *av_realloc(void *ptr, size_t size) ^ 118. { 119. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:124:8: Taking false branch 122. 123. /* let's disallow possible ambiguous cases */ 124. if(size > (INT_MAX-16) ) ^ 125. return NULL; 126. libavutil/mem.c:133:5: 131. return (char*)realloc((char*)ptr - diff, size + diff) + diff; 132. #else 133. return realloc(ptr, size); ^ 134. #endif 135. } libavutil/mem.c:135:1: return from a call to av_realloc 133. return realloc(ptr, size); 134. #endif 135. } ^ 136. 137. void av_free(void *ptr) cmdutils.c:1064:14: Taking true branch 1062. if (*size < new_size) { 1063. uint8_t *tmp = av_realloc(array, new_size*elem_size); 1064. if (!tmp) { ^ 1065. av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); 1066. exit_program(1); cmdutils.c:1065:13: Skipping av_log(): empty list of specs 1063. uint8_t *tmp = av_realloc(array, new_size*elem_size); 1064. if (!tmp) { 1065. av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); ^ 1066. exit_program(1); 1067. } cmdutils.c:1066:13: Skipping exit_program(): empty list of specs 1064. if (!tmp) { 1065. av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); 1066. exit_program(1); ^ 1067. } 1068. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); cmdutils.c:1068:9: 1066. exit_program(1); 1067. } 1068. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); ^ 1069. *size = new_size; 1070. return tmp; cmdutils.c:1069:9: 1067. } 1068. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); 1069. *size = new_size; ^ 1070. return tmp; 1071. } cmdutils.c:1070:9: 1068. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); 1069. *size = new_size; 1070. return tmp; ^ 1071. } 1072. return array; cmdutils.c:1073:1: return from a call to grow_array 1071. } 1072. return array; 1073. } ^ avconv.c:2743:5: 2741. o->attachments = grow_array(o->attachments, sizeof(*o->attachments), 2742. &o->nb_attachments, o->nb_attachments + 1); 2743. o->attachments[o->nb_attachments - 1] = arg; ^ 2744. return 0; 2745. }
https://github.com/libav/libav/blob/e1edfbcb240cace69d92701e6910c2b03555b7d7/avconv.c/#L2743
d2a_code_trace_data_43917
c448_error_t c448_ed448_verify( const uint8_t signature[EDDSA_448_SIGNATURE_BYTES], const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], const uint8_t *message, size_t message_len, uint8_t prehashed, const uint8_t *context, uint8_t context_len) { curve448_point_t pk_point, r_point; c448_error_t error = curve448_point_decode_like_eddsa_and_mul_by_ratio(pk_point, pubkey); curve448_scalar_t challenge_scalar; curve448_scalar_t response_scalar; if (C448_SUCCESS != error) return error; error = curve448_point_decode_like_eddsa_and_mul_by_ratio(r_point, signature); if (C448_SUCCESS != error) return error; { EVP_MD_CTX *hashctx = EVP_MD_CTX_new(); uint8_t challenge[2 * EDDSA_448_PRIVATE_BYTES]; if (hashctx == NULL || !hash_init_with_dom(hashctx, prehashed, 0, context, context_len) || !EVP_DigestUpdate(hashctx, signature, EDDSA_448_PUBLIC_BYTES) || !EVP_DigestUpdate(hashctx, pubkey, EDDSA_448_PUBLIC_BYTES) || !EVP_DigestUpdate(hashctx, message, message_len) || !EVP_DigestFinalXOF(hashctx, challenge, sizeof(challenge))) { EVP_MD_CTX_free(hashctx); return C448_FAILURE; } EVP_MD_CTX_free(hashctx); curve448_scalar_decode_long(challenge_scalar, challenge, sizeof(challenge)); OPENSSL_cleanse(challenge, sizeof(challenge)); } curve448_scalar_sub(challenge_scalar, curve448_scalar_zero, challenge_scalar); curve448_scalar_decode_long(response_scalar, &signature[EDDSA_448_PUBLIC_BYTES], EDDSA_448_PRIVATE_BYTES); curve448_base_double_scalarmul_non_secret(pk_point, response_scalar, pk_point, challenge_scalar); return c448_succeed_if(curve448_point_eq(pk_point, r_point)); } crypto/ec/curve448/eddsa.c:277: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 267, column 31 is not reachable after line 277, column 13. Showing all 45 steps of the trace crypto/ec/curve448/eddsa.c:244:1: start of procedure c448_ed448_verify() 242. } 243. 244. > c448_error_t c448_ed448_verify( 245. const uint8_t signature[EDDSA_448_SIGNATURE_BYTES], 246. const uint8_t pubkey[EDDSA_448_PUBLIC_BYTES], crypto/ec/curve448/eddsa.c:252:5: Skipping curve448_point_decode_like_eddsa_and_mul_by_ratio(): empty list of specs 250. { 251. curve448_point_t pk_point, r_point; 252. c448_error_t error = ^ 253. curve448_point_decode_like_eddsa_and_mul_by_ratio(pk_point, pubkey); 254. curve448_scalar_t challenge_scalar; crypto/ec/curve448/eddsa.c:257:9: Taking false branch 255. curve448_scalar_t response_scalar; 256. 257. if (C448_SUCCESS != error) ^ 258. return error; 259. crypto/ec/curve448/eddsa.c:260:5: Skipping curve448_point_decode_like_eddsa_and_mul_by_ratio(): empty list of specs 258. return error; 259. 260. error = ^ 261. curve448_point_decode_like_eddsa_and_mul_by_ratio(r_point, signature); 262. if (C448_SUCCESS != error) crypto/ec/curve448/eddsa.c:262:9: Taking false branch 260. error = 261. curve448_point_decode_like_eddsa_and_mul_by_ratio(r_point, signature); 262. if (C448_SUCCESS != error) ^ 263. return error; 264. crypto/ec/curve448/eddsa.c:267:9: 265. { 266. /* Compute the challenge */ 267. > EVP_MD_CTX *hashctx = EVP_MD_CTX_new(); 268. uint8_t challenge[2 * EDDSA_448_PRIVATE_BYTES]; 269. crypto/evp/digest.c:44:1: start of procedure EVP_MD_CTX_new() 42. } 43. 44. > EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); crypto/evp/digest.c:46:5: 44. EVP_MD_CTX *EVP_MD_CTX_new(void) 45. { 46. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. } 48. crypto/mem.c:228:1: start of procedure CRYPTO_zalloc() 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:5: 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. > void *ret = CRYPTO_malloc(num, file, line); 231. 232. FAILTEST(); crypto/mem.c:192:1: start of procedure CRYPTO_malloc() 190. #endif 191. 192. > void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. void *ret = NULL; crypto/mem.c:194:5: 192. void *CRYPTO_malloc(size_t num, const char *file, int line) 193. { 194. > void *ret = NULL; 195. 196. INCREMENT(malloc_count); crypto/mem.c:197:9: Taking false branch 195. 196. INCREMENT(malloc_count); 197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 198. return malloc_impl(num, file, line); 199. crypto/mem.c:200:9: Taking false branch 198. return malloc_impl(num, file, line); 199. 200. if (num == 0) ^ 201. return NULL; 202. crypto/mem.c:204:9: Taking true branch 202. 203. FAILTEST(); 204. if (allow_customize) { ^ 205. /* 206. * Disallow customization after the first allocation. We only set this crypto/mem.c:210:9: 208. * allocation. 209. */ 210. > allow_customize = 0; 211. } 212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:221:5: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:221:19: 219. } 220. #else 221. > (void)(file); (void)(line); 222. ret = malloc(num); 223. #endif crypto/mem.c:222:5: 220. #else 221. (void)(file); (void)(line); 222. > ret = malloc(num); 223. #endif 224. crypto/mem.c:225:5: 223. #endif 224. 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_malloc 224. 225. return ret; 226. > } 227. 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:233:9: Taking true branch 231. 232. FAILTEST(); 233. if (ret != NULL) ^ 234. memset(ret, 0, num); 235. return ret; crypto/mem.c:234:9: 232. FAILTEST(); 233. if (ret != NULL) 234. > memset(ret, 0, num); 235. return ret; 236. } crypto/mem.c:235:5: 233. if (ret != NULL) 234. memset(ret, 0, num); 235. > return ret; 236. } 237. crypto/mem.c:236:1: return from a call to CRYPTO_zalloc 234. memset(ret, 0, num); 235. return ret; 236. > } 237. 238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:47:1: return from a call to EVP_MD_CTX_new 45. { 46. return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); 47. > } 48. 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) crypto/ec/curve448/eddsa.c:270:13: Taking false branch 268. uint8_t challenge[2 * EDDSA_448_PRIVATE_BYTES]; 269. 270. if (hashctx == NULL ^ 271. || !hash_init_with_dom(hashctx, prehashed, 0, context, 272. context_len) crypto/ec/curve448/eddsa.c:271:21: 269. 270. if (hashctx == NULL 271. > || !hash_init_with_dom(hashctx, prehashed, 0, context, 272. context_len) 273. || !EVP_DigestUpdate(hashctx, signature, EDDSA_448_PUBLIC_BYTES) crypto/ec/curve448/eddsa.c:48:1: start of procedure hash_init_with_dom() 46. } 47. 48. > static c448_error_t hash_init_with_dom(EVP_MD_CTX *hashctx, uint8_t prehashed, 49. uint8_t for_prehash, 50. const uint8_t *context, crypto/ec/curve448/eddsa.c:53:5: 51. size_t context_len) 52. { 53. > const char *dom_s = "SigEd448"; 54. uint8_t dom[2]; 55. crypto/ec/curve448/eddsa.c:56:9: Taking true branch 54. uint8_t dom[2]; 55. 56. if (context_len > UINT8_MAX) ^ 57. return C448_FAILURE; 58. crypto/ec/curve448/eddsa.c:57:9: 55. 56. if (context_len > UINT8_MAX) 57. > return C448_FAILURE; 58. 59. dom[0] = (uint8_t)(2 - (prehashed == 0 ? 1 : 0) crypto/ec/curve448/eddsa.c:71:1: return from a call to hash_init_with_dom 69. 70. return C448_SUCCESS; 71. > } 72. 73. /* In this file because it uses the hash */ crypto/ec/curve448/eddsa.c:271:21: Taking true branch 269. 270. if (hashctx == NULL 271. || !hash_init_with_dom(hashctx, prehashed, 0, context, ^ 272. context_len) 273. || !EVP_DigestUpdate(hashctx, signature, EDDSA_448_PUBLIC_BYTES) crypto/ec/curve448/eddsa.c:277:13: 275. || !EVP_DigestUpdate(hashctx, message, message_len) 276. || !EVP_DigestFinalXOF(hashctx, challenge, sizeof(challenge))) { 277. > EVP_MD_CTX_free(hashctx); 278. return C448_FAILURE; 279. } crypto/evp/digest.c:49:1: start of procedure EVP_MD_CTX_free() 47. } 48. 49. > void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); crypto/evp/digest.c:51:5: Skipping EVP_MD_CTX_reset(): empty list of specs 49. void EVP_MD_CTX_free(EVP_MD_CTX *ctx) 50. { 51. EVP_MD_CTX_reset(ctx); ^ 52. OPENSSL_free(ctx); 53. } crypto/evp/digest.c:52:5: 50. { 51. EVP_MD_CTX_reset(ctx); 52. > OPENSSL_free(ctx); 53. } 54. crypto/mem.c:295:1: start of procedure CRYPTO_free() 293. } 294. 295. > void CRYPTO_free(void *str, const char *file, int line) 296. { 297. INCREMENT(free_count); crypto/mem.c:298:9: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:298:30: Taking true branch 296. { 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 299. free_impl(str, file, line); 300. return; crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer 297. INCREMENT(free_count); 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); ^ 300. return; 301. } crypto/mem.c:300:9: 298. if (free_impl != NULL && free_impl != &CRYPTO_free) { 299. free_impl(str, file, line); 300. > return; 301. } 302. crypto/mem.c:314:1: return from a call to CRYPTO_free 312. free(str); 313. #endif 314. > } 315. 316. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/evp/digest.c:53:1: return from a call to EVP_MD_CTX_free 51. EVP_MD_CTX_reset(ctx); 52. OPENSSL_free(ctx); 53. > } 54. 55. int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
https://github.com/openssl/openssl/blob/fbccfedf9bb0840e6c2db54b66ac511b85a3f587/crypto/ec/curve448/eddsa.c/#L277
d2a_code_trace_data_43918
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } r->neg = a->neg; nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } crypto/dsa/dsa_ossl.c:81: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `dsa_sign_setup`. Showing all 19 steps of the trace crypto/dsa/dsa_ossl.c:49:1: Parameter `dsa->g->top` 47. } 48. 49. > static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) 50. { 51. BIGNUM *kinv = NULL; crypto/dsa/dsa_ossl.c:81:10: Call 79. goto err; 80. redo: 81. if (!dsa_sign_setup(dsa, ctx, &kinv, &ret->r, dgst, dlen)) ^ 82. goto err; 83. crypto/dsa/dsa_ossl.c:133:1: Parameter `dsa->g->top` 131. } 132. 133. > static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, 134. BIGNUM **kinvp, BIGNUM **rp, 135. const unsigned char *dgst, int dlen) crypto/dsa/dsa_ossl.c:199:18: Call 197. goto err; 198. } else { 199. if (!BN_mod_exp_mont(r, dsa->g, k, dsa->p, ctx, dsa->method_mont_p)) ^ 200. goto err; 201. } crypto/bn/bn_exp.c:300:1: Parameter `a->top` 298. } 299. 300. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 301. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 302. { crypto/bn/bn_exp.c:312:16: Call 310. 311. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 312. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 313. } 314. crypto/bn/bn_exp.c:600:1: Parameter `a->top` 598. * http://www.daemonology.net/hyperthreading-considered-harmful/) 599. */ 600. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 601. const BIGNUM *m, BN_CTX *ctx, 602. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:753:14: Call 751. /* prepare a^1 in Montgomery domain */ 752. if (a->neg || BN_ucmp(a, m) >= 0) { 753. if (!BN_mod(&am, a, m, ctx)) ^ 754. goto err; 755. if (!BN_to_montgomery(&am, &am, mont, ctx)) crypto/bn/bn_div.c:140:1: Parameter `num->top` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/bn/bn_div.c:210:11: Call 208. sdiv->neg = 0; 209. norm_shift += BN_BITS2; 210. if (!(BN_lshift(snum, num, norm_shift))) ^ 211. goto err; 212. snum->neg = 0; crypto/bn/bn_shift.c:81:1: <Offset trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `n` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:96:5: Assignment 94. 95. r->neg = a->neg; 96. nw = n / BN_BITS2; ^ 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) 98. return (0); crypto/bn/bn_shift.c:81:1: <Length trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `*r->d` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:9: Call 95. r->neg = a->neg; 96. nw = n / BN_BITS2; 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 98. return (0); 99. lb = n % BN_BITS2; crypto/bn/bn_lib.c:1016:1: Parameter `*a->d` 1014. } 1015. 1016. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 1017. { 1018. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_shift.c:102:5: Assignment 100. rb = BN_BITS2 - lb; 101. f = a->d; 102. t = r->d; ^ 103. t[a->top + nw] = 0; 104. if (lb == 0) crypto/bn/bn_shift.c:110:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `dsa_sign_setup` 108. for (i = a->top - 1; i >= 0; i--) { 109. l = f[i]; 110. t[nw + i + 1] |= (l >> rb) & BN_MASK2; ^ 111. t[nw + i] = (l << lb) & BN_MASK2; 112. }
https://github.com/openssl/openssl/blob/69588edbaa424beb71c6a9b1be416588232cb78c/crypto/bn/bn_shift.c/#L110
d2a_code_trace_data_43919
static void fill_decode_caches(H264Context *h, int mb_type){ MpegEncContext * const s = &h->s; int topleft_xy, top_xy, topright_xy, left_xy[2]; int topleft_type, top_type, topright_type, left_type[2]; const uint8_t * left_block= h->left_block; int i; topleft_xy = h->topleft_mb_xy ; top_xy = h->top_mb_xy ; topright_xy = h->topright_mb_xy; left_xy[0] = h->left_mb_xy[0] ; left_xy[1] = h->left_mb_xy[1] ; topleft_type = h->topleft_type ; top_type = h->top_type ; topright_type= h->topright_type ; left_type[0] = h->left_type[0] ; left_type[1] = h->left_type[1] ; if(!IS_SKIP(mb_type)){ if(IS_INTRA(mb_type)){ int type_mask= h->pps.constrained_intra_pred ? IS_INTRA(-1) : -1; h->topleft_samples_available= h->top_samples_available= h->left_samples_available= 0xFFFF; h->topright_samples_available= 0xEEEA; if(!(top_type & type_mask)){ h->topleft_samples_available= 0xB3FF; h->top_samples_available= 0x33FF; h->topright_samples_available= 0x26EA; } if(IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[0])){ if(IS_INTERLACED(mb_type)){ if(!(left_type[0] & type_mask)){ h->topleft_samples_available&= 0xDFFF; h->left_samples_available&= 0x5FFF; } if(!(left_type[1] & type_mask)){ h->topleft_samples_available&= 0xFF5F; h->left_samples_available&= 0xFF5F; } }else{ int left_typei = h->slice_table[left_xy[0] + s->mb_stride ] == h->slice_num ? s->current_picture.mb_type[left_xy[0] + s->mb_stride] : 0; assert(left_xy[0] == left_xy[1]); if(!((left_typei & type_mask) && (left_type[0] & type_mask))){ h->topleft_samples_available&= 0xDF5F; h->left_samples_available&= 0x5F5F; } } }else{ if(!(left_type[0] & type_mask)){ h->topleft_samples_available&= 0xDF5F; h->left_samples_available&= 0x5F5F; } } if(!(topleft_type & type_mask)) h->topleft_samples_available&= 0x7FFF; if(!(topright_type & type_mask)) h->topright_samples_available&= 0xFBFF; if(IS_INTRA4x4(mb_type)){ if(IS_INTRA4x4(top_type)){ AV_COPY32(h->intra4x4_pred_mode_cache+4+8*0, h->intra4x4_pred_mode + h->mb2br_xy[top_xy]); }else{ h->intra4x4_pred_mode_cache[4+8*0]= h->intra4x4_pred_mode_cache[5+8*0]= h->intra4x4_pred_mode_cache[6+8*0]= h->intra4x4_pred_mode_cache[7+8*0]= 2 - 3*!(top_type & type_mask); } for(i=0; i<2; i++){ if(IS_INTRA4x4(left_type[i])){ int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]]; h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= mode[6-left_block[0+2*i]]; h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= mode[6-left_block[1+2*i]]; }else{ h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= 2 - 3*!(left_type[i] & type_mask); } } } } if(top_type){ AV_COPY32(&h->non_zero_count_cache[4+8*0], &h->non_zero_count[top_xy][4+3*8]); h->non_zero_count_cache[1+8*0]= h->non_zero_count[top_xy][1+1*8]; h->non_zero_count_cache[2+8*0]= h->non_zero_count[top_xy][2+1*8]; h->non_zero_count_cache[1+8*3]= h->non_zero_count[top_xy][1+2*8]; h->non_zero_count_cache[2+8*3]= h->non_zero_count[top_xy][2+2*8]; }else { h->non_zero_count_cache[1+8*0]= h->non_zero_count_cache[2+8*0]= h->non_zero_count_cache[1+8*3]= h->non_zero_count_cache[2+8*3]= AV_WN32A(&h->non_zero_count_cache[4+8*0], CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040); } for (i=0; i<2; i++) { if(left_type[i]){ h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+0+2*i]]; h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count[left_xy[i]][left_block[8+1+2*i]]; h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+4+2*i]]; h->non_zero_count_cache[0+8*4 + 8*i]= h->non_zero_count[left_xy[i]][left_block[8+5+2*i]]; }else{ h->non_zero_count_cache[3+8*1 + 2*8*i]= h->non_zero_count_cache[3+8*2 + 2*8*i]= h->non_zero_count_cache[0+8*1 + 8*i]= h->non_zero_count_cache[0+8*4 + 8*i]= CABAC && !IS_INTRA(mb_type) ? 0 : 64; } } if( CABAC ) { if(top_type) { h->top_cbp = h->cbp_table[top_xy]; } else if(IS_INTRA(mb_type)) { h->top_cbp = 0x1CF; } else { h->top_cbp = 0x00F; } if (left_type[0]) { h->left_cbp = h->cbp_table[left_xy[0]] & 0x1f0; } else if(IS_INTRA(mb_type)) { h->left_cbp = 0x1CF; } else { h->left_cbp = 0x00F; } if (left_type[0]) { h->left_cbp |= ((h->cbp_table[left_xy[0]]>>((left_block[0]&(~1))+1))&0x1) << 1; } if (left_type[1]) { h->left_cbp |= ((h->cbp_table[left_xy[1]]>>((left_block[2]&(~1))+1))&0x1) << 3; } } } #if 1 if(IS_INTER(mb_type) || (IS_DIRECT(mb_type) && h->direct_spatial_mv_pred)){ int list; for(list=0; list<h->list_count; list++){ if(!USES_LIST(mb_type, list)){ continue; } assert(!(IS_DIRECT(mb_type) && !h->direct_spatial_mv_pred)); h->mv_cache_clean[list]= 0; if(USES_LIST(top_type, list)){ const int b_xy= h->mb2b_xy[top_xy] + 3*h->b_stride; const int b8_xy= h->mb2b8_xy[top_xy] + h->b8_stride; AV_COPY128(h->mv_cache[list][scan8[0] + 0 - 1*8], s->current_picture.motion_val[list][b_xy + 0]); h->ref_cache[list][scan8[0] + 0 - 1*8]= h->ref_cache[list][scan8[0] + 1 - 1*8]= s->current_picture.ref_index[list][b8_xy + 0]; h->ref_cache[list][scan8[0] + 2 - 1*8]= h->ref_cache[list][scan8[0] + 3 - 1*8]= s->current_picture.ref_index[list][b8_xy + 1]; }else{ AV_ZERO128(h->mv_cache[list][scan8[0] + 0 - 1*8]); AV_WN32A(&h->ref_cache[list][scan8[0] + 0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101); } for(i=0; i<2; i++){ int cache_idx = scan8[0] - 1 + i*2*8; if(USES_LIST(left_type[i], list)){ const int b_xy= h->mb2b_xy[left_xy[i]] + 3; const int b8_xy= h->mb2b8_xy[left_xy[i]] + 1; AV_COPY32(h->mv_cache[list][cache_idx ], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0+i*2]]); AV_COPY32(h->mv_cache[list][cache_idx+8], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[1+i*2]]); h->ref_cache[list][cache_idx ]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[0+i*2]>>1)]; h->ref_cache[list][cache_idx+8]= s->current_picture.ref_index[list][b8_xy + h->b8_stride*(left_block[1+i*2]>>1)]; }else{ AV_ZERO32(h->mv_cache [list][cache_idx ]); AV_ZERO32(h->mv_cache [list][cache_idx+8]); h->ref_cache[list][cache_idx ]= h->ref_cache[list][cache_idx+8]= (left_type[i]) ? LIST_NOT_USED : PART_NOT_AVAILABLE; } } if(USES_LIST(topleft_type, list)){ const int b_xy = h->mb2b_xy [topleft_xy] + 3 + h->b_stride + (h->topleft_partition & 2*h->b_stride); const int b8_xy= h->mb2b8_xy[topleft_xy] + 1 + (h->topleft_partition & h->b8_stride); AV_COPY32(h->mv_cache[list][scan8[0] - 1 - 1*8], s->current_picture.motion_val[list][b_xy]); h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy]; }else{ AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]); h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE; } if(USES_LIST(topright_type, list)){ const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride; const int b8_xy= h->mb2b8_xy[topright_xy] + h->b8_stride; AV_COPY32(h->mv_cache[list][scan8[0] + 4 - 1*8], s->current_picture.motion_val[list][b_xy]); h->ref_cache[list][scan8[0] + 4 - 1*8]= s->current_picture.ref_index[list][b8_xy]; }else{ AV_ZERO32(h->mv_cache [list][scan8[0] + 4 - 1*8]); h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE; } if((mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2)) && !FRAME_MBAFF) continue; if(!(mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2))) { h->ref_cache[list][scan8[5 ]+1] = h->ref_cache[list][scan8[7 ]+1] = h->ref_cache[list][scan8[13]+1] = h->ref_cache[list][scan8[4 ]] = h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE; AV_ZERO32(h->mv_cache [list][scan8[5 ]+1]); AV_ZERO32(h->mv_cache [list][scan8[7 ]+1]); AV_ZERO32(h->mv_cache [list][scan8[13]+1]); AV_ZERO32(h->mv_cache [list][scan8[4 ]]); AV_ZERO32(h->mv_cache [list][scan8[12]]); if( CABAC ) { if(USES_LIST(top_type, list)){ const int b_xy= h->mb2br_xy[top_xy]; AV_COPY64(h->mvd_cache[list][scan8[0] + 0 - 1*8], h->mvd_table[list][b_xy + 0]); }else{ AV_ZERO64(h->mvd_cache[list][scan8[0] + 0 - 1*8]); } if(USES_LIST(left_type[0], list)){ const int b_xy= h->mb2br_xy[left_xy[0]] + 6; AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 0*8], h->mvd_table[list][b_xy - left_block[0]]); AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 1*8], h->mvd_table[list][b_xy - left_block[1]]); }else{ AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 0*8]); AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 1*8]); } if(USES_LIST(left_type[1], list)){ const int b_xy= h->mb2br_xy[left_xy[1]] + 6; AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 2*8], h->mvd_table[list][b_xy - left_block[2]]); AV_COPY16(h->mvd_cache[list][scan8[0] - 1 + 3*8], h->mvd_table[list][b_xy - left_block[3]]); }else{ AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 2*8]); AV_ZERO16(h->mvd_cache [list][scan8[0] - 1 + 3*8]); } AV_ZERO16(h->mvd_cache [list][scan8[5 ]+1]); AV_ZERO16(h->mvd_cache [list][scan8[7 ]+1]); AV_ZERO16(h->mvd_cache [list][scan8[13]+1]); AV_ZERO16(h->mvd_cache [list][scan8[4 ]]); AV_ZERO16(h->mvd_cache [list][scan8[12]]); if(h->slice_type_nos == FF_B_TYPE){ fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1); if(IS_DIRECT(top_type)){ AV_WN32A(&h->direct_cache[scan8[0] - 1*8], 0x01010101*(MB_TYPE_DIRECT2>>1)); }else if(IS_8X8(top_type)){ int b8_xy = 4*top_xy; h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy + 2]; h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 3]; }else{ AV_WN32A(&h->direct_cache[scan8[0] - 1*8], 0x01010101*(MB_TYPE_16x16>>1)); } if(IS_DIRECT(left_type[0])) h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_DIRECT2>>1; else if(IS_8X8(left_type[0])) h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[4*left_xy[0] + 1 + (left_block[0]&~1)]; else h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_16x16>>1; if(IS_DIRECT(left_type[1])) h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_DIRECT2>>1; else if(IS_8X8(left_type[1])) h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[4*left_xy[1] + 1 + (left_block[2]&~1)]; else h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_16x16>>1; } } } if(FRAME_MBAFF){ #define MAP_MVS\ MAP_F2F(scan8[0] - 1 - 1*8, topleft_type)\ MAP_F2F(scan8[0] + 0 - 1*8, top_type)\ MAP_F2F(scan8[0] + 1 - 1*8, top_type)\ MAP_F2F(scan8[0] + 2 - 1*8, top_type)\ MAP_F2F(scan8[0] + 3 - 1*8, top_type)\ MAP_F2F(scan8[0] + 4 - 1*8, topright_type)\ MAP_F2F(scan8[0] - 1 + 0*8, left_type[0])\ MAP_F2F(scan8[0] - 1 + 1*8, left_type[0])\ MAP_F2F(scan8[0] - 1 + 2*8, left_type[1])\ MAP_F2F(scan8[0] - 1 + 3*8, left_type[1]) if(MB_FIELD){ #define MAP_F2F(idx, mb_type)\ if(!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\ h->ref_cache[list][idx] <<= 1;\ h->mv_cache[list][idx][1] /= 2;\ h->mvd_cache[list][idx][1] >>=1;\ } MAP_MVS #undef MAP_F2F }else{ #define MAP_F2F(idx, mb_type)\ if(IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0){\ h->ref_cache[list][idx] >>= 1;\ h->mv_cache[list][idx][1] <<= 1;\ h->mvd_cache[list][idx][1] <<= 1;\ } MAP_MVS #undef MAP_F2F } } } } #endif h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]); } libavcodec/h264.h:1471: error: Buffer Overrun L2 Offset: [1, 6] (⇐ [0, 3] + [1, 3]) Size: 4 by call to `fill_decode_caches`. libavcodec/h264.h:1470:13: Call 1468. mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP; 1469. if(h->direct_spatial_mv_pred){ 1470. fill_decode_neighbors(h, mb_type); ^ 1471. fill_decode_caches(h, mb_type); //FIXME check what is needed and what not ... 1472. } libavcodec/h264.h:759:5: Array declaration 757. const int mb_xy= h->mb_xy; 758. int topleft_xy, top_xy, topright_xy, left_xy[2]; 759. static const uint8_t left_block_options[4][16]={ ^ 760. {0,1,2,3,7,10,8,11,7+0*8, 7+1*8, 7+2*8, 7+3*8, 2+0*8, 2+3*8, 2+1*8, 2+2*8}, 761. {2,2,3,3,8,11,8,11,7+2*8, 7+2*8, 7+3*8, 7+3*8, 2+1*8, 2+2*8, 2+1*8, 2+2*8}, libavcodec/h264.h:776:5: Assignment 774. topright_xy= top_xy + 1; 775. left_xy[1] = left_xy[0] = mb_xy-1; 776. h->left_block = left_block_options[0]; ^ 777. if(FRAME_MBAFF){ 778. const int left_mb_field_flag = IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]); libavcodec/h264.h:1471:9: Call 1469. if(h->direct_spatial_mv_pred){ 1470. fill_decode_neighbors(h, mb_type); 1471. fill_decode_caches(h, mb_type); //FIXME check what is needed and what not ... ^ 1472. } 1473. ff_h264_pred_direct_motion(h, &mb_type); libavcodec/h264.h:896:21: <Offset trace> 894. h->intra4x4_pred_mode_cache[7+8*0]= 2 - 3*!(top_type & type_mask); 895. } 896. for(i=0; i<2; i++){ ^ 897. if(IS_INTRA4x4(left_type[i])){ 898. int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]]; libavcodec/h264.h:896:21: Assignment 894. h->intra4x4_pred_mode_cache[7+8*0]= 2 - 3*!(top_type & type_mask); 895. } 896. for(i=0; i<2; i++){ ^ 897. if(IS_INTRA4x4(left_type[i])){ 898. int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]]; libavcodec/h264.h:824:1: <Length trace> 822. } 823. 824. static void fill_decode_caches(H264Context *h, int mb_type){ ^ 825. MpegEncContext * const s = &h->s; 826. int topleft_xy, top_xy, topright_xy, left_xy[2]; libavcodec/h264.h:824:1: Parameter `*h->left_block` 822. } 823. 824. static void fill_decode_caches(H264Context *h, int mb_type){ ^ 825. MpegEncContext * const s = &h->s; 826. int topleft_xy, top_xy, topright_xy, left_xy[2]; libavcodec/h264.h:828:5: Assignment 826. int topleft_xy, top_xy, topright_xy, left_xy[2]; 827. int topleft_type, top_type, topright_type, left_type[2]; 828. const uint8_t * left_block= h->left_block; ^ 829. int i; 830. libavcodec/h264.h:900:76: Array access: Offset: [1, 6] (⇐ [0, 3] + [1, 3]) Size: 4 by call to `fill_decode_caches` 898. int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[left_xy[i]]; 899. h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]= mode[6-left_block[0+2*i]]; 900. h->intra4x4_pred_mode_cache[3+8*2 + 2*8*i]= mode[6-left_block[1+2*i]]; ^ 901. }else{ 902. h->intra4x4_pred_mode_cache[3+8*1 + 2*8*i]=
https://github.com/libav/libav/blob/479e1e617078476f14598cd62769b4c9ca4025e2/libavcodec/h264.h/#L900
d2a_code_trace_data_43920
static ossl_inline unsigned int constant_time_is_zero(unsigned int a) { return constant_time_msb(~a & (a - 1)); } crypto/rsa/rsa_oaep.c:190: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero`. Showing all 7 steps of the trace crypto/rsa/rsa_oaep.c:190:35: Call 188. goto cleanup; 189. 190. good &= constant_time_is_zero(CRYPTO_memcmp(db, phash, mdlen)); ^ 191. 192. found_one_byte = 0; crypto/cryptlib.c:475:5: Assignment 473. const volatile unsigned char *a = in_a; 474. const volatile unsigned char *b = in_b; 475. unsigned char x = 0; ^ 476. 477. for (i = 0; i < len; i++) crypto/cryptlib.c:480:5: Assignment 478. x |= a[i] ^ b[i]; 479. 480. return x; ^ 481. } crypto/rsa/rsa_oaep.c:190:13: Call 188. goto cleanup; 189. 190. good &= constant_time_is_zero(CRYPTO_memcmp(db, phash, mdlen)); ^ 191. 192. found_one_byte = 0; include/internal/constant_time_locl.h:165:1: <LHS trace> 163. } 164. 165. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a) 166. { 167. return constant_time_msb(~a & (a - 1)); include/internal/constant_time_locl.h:165:1: Parameter `a` 163. } 164. 165. > static ossl_inline unsigned int constant_time_is_zero(unsigned int a) 166. { 167. return constant_time_msb(~a & (a - 1)); include/internal/constant_time_locl.h:167:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero` 165. static ossl_inline unsigned int constant_time_is_zero(unsigned int a) 166. { 167. return constant_time_msb(~a & (a - 1)); ^ 168. } 169.
https://github.com/openssl/openssl/blob/b59e1bed7da7933d4c6af750fe3f0300b57874fe/include/internal/constant_time_locl.h/#L167
d2a_code_trace_data_43921
int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) { char *v; int gmt = 0; int i; int y = 0, M = 0, d = 0, h = 0, m = 0, s = 0; char *f = NULL; int f_len = 0; i = tm->length; v = (char *)tm->data; if (i < 12) goto err; if (v[i - 1] == 'Z') gmt = 1; for (i = 0; i < 12; i++) if ((v[i] > '9') || (v[i] < '0')) goto err; y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 + (v[2] - '0') * 10 + (v[3] - '0'); M = (v[4] - '0') * 10 + (v[5] - '0'); if ((M > 12) || (M < 1)) goto err; d = (v[6] - '0') * 10 + (v[7] - '0'); h = (v[8] - '0') * 10 + (v[9] - '0'); m = (v[10] - '0') * 10 + (v[11] - '0'); if (tm->length >= 14 && (v[12] >= '0') && (v[12] <= '9') && (v[13] >= '0') && (v[13] <= '9')) { s = (v[12] - '0') * 10 + (v[13] - '0'); if (tm->length >= 15 && v[14] == '.') { int l = tm->length; f = &v[14]; f_len = 1; while (14 + f_len < l && f[f_len] >= '0' && f[f_len] <= '9') ++f_len; } } if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", _asn1_mon[M - 1], d, h, m, s, f_len, f, y, (gmt) ? " GMT" : "") <= 0) return (0); else return (1); err: BIO_write(bp, "Bad time value", 14); return (0); } apps/ts.c:607: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `TS_TST_INFO_print_bio`. Showing all 13 steps of the trace apps/ts.c:591:20: Call 589. } 590. } else { 591. response = create_response(conf, section, engine, queryfile, ^ 592. passin, inkey, md, signer, chain, policy); 593. if (response != NULL) apps/ts.c:716:10: Call 714. if (!TS_CONF_set_def_policy(conf, section, policy, resp_ctx)) 715. goto end; 716. if (!TS_CONF_set_policies(conf, section, resp_ctx)) ^ 717. goto end; 718. if (!TS_CONF_set_digests(conf, section, resp_ctx)) crypto/ts/ts_conf.c:313:29: Call 311. 312. /* If no other policy is specified, that's fine. */ 313. if (policies && (list = X509V3_parse_list(policies)) == NULL) { ^ 314. ts_CONF_invalid(section, ENV_OTHER_POLICIES); 315. goto err; crypto/x509v3/v3_utl.c:266:17: Assignment 264. if (c == ':') { 265. state = HDR_VALUE; 266. *p = 0; ^ 267. ntmp = strip_spaces(q); 268. if (!ntmp) { apps/ts.c:607:18: Call 605. if (token_out) { 606. TS_TST_INFO *tst_info = TS_RESP_get_tst_info(response); 607. if (!TS_TST_INFO_print_bio(out_bio, tst_info)) ^ 608. goto end; 609. } else { crypto/ts/ts_rsp_print.c:118:1: Parameter `*a->time->data` 116. } 117. 118. > int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a) 119. { 120. int v; crypto/ts/ts_rsp_print.c:141:5: Call 139. 140. BIO_printf(bio, "Time stamp: "); 141. ASN1_GENERALIZEDTIME_print(bio, a->time); ^ 142. BIO_write(bio, "\n", 1); 143. crypto/asn1/a_gentm.c:260:1: <Offset trace> 258. }; 259. 260. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 261. { 262. char *v; crypto/asn1/a_gentm.c:260:1: Parameter `*tm->data` 258. }; 259. 260. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 261. { 262. char *v; crypto/asn1/a_gentm.c:281:5: Assignment 279. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 280. + (v[2] - '0') * 10 + (v[3] - '0'); 281. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 282. if ((M > 12) || (M < 1)) 283. goto err; crypto/asn1/a_gentm.c:255:1: <Length trace> 253. } 254. 255. > const char *_asn1_mon[12] = { 256. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 257. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:255:1: Array declaration 253. } 254. 255. > const char *_asn1_mon[12] = { 256. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 257. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:302:20: Array access: Offset: [-529, +oo] Size: 12 by call to `TS_TST_INFO_print_bio` 300. 301. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 302. _asn1_mon[M - 1], d, h, m, s, f_len, f, y, ^ 303. (gmt) ? " GMT" : "") <= 0) 304. return (0);
https://github.com/openssl/openssl/blob/2234212c3dde887e0b7fa08277d035cd132e2cce/crypto/asn1/a_gentm.c/#L302
d2a_code_trace_data_43922
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } test/sslapitest.c:2099: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/sslapitest.c:2020:10: Call 2018. } 2019. 2020. if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, ^ 2021. &clientssl, NULL, NULL)) 2022. || !TEST_true(create_ssl_connection(serverssl, clientssl, test/ssltestlib.c:559:15: Call 557. if (*sssl != NULL) 558. serverssl = *sssl; 559. else if (!TEST_ptr(serverssl = SSL_new(serverctx))) ^ 560. goto error; 561. if (*cssl != NULL) ssl/ssl_lib.c:522:1: Parameter `ctx->sessions->num_items` 520. } 521. 522. > SSL *SSL_new(SSL_CTX *ctx) 523. { 524. SSL *s; test/sslapitest.c:2099:5: Call 2097. end: 2098. SSL_SESSION_free(sess); 2099. SSL_free(serverssl); ^ 2100. SSL_free(clientssl); 2101. SSL_CTX_free(sctx2); 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_43923
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return NULL; } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return ret; } test/sslapitest.c:3213: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 16 steps of the trace test/sslapitest.c:3184:11: Call 3182. goto end; 3183. 3184. con = SSL_new(ctx); ^ 3185. if (!TEST_ptr(con)) 3186. goto end; ssl/ssl_lib.c:608:1: Parameter `ctx->sessions->num_items` 606. } 607. 608. > SSL *SSL_new(SSL_CTX *ctx) 609. { 610. SSL *s; test/sslapitest.c:3213:5: Call 3211. 3212. end: 3213. SSL_free(con); ^ 3214. SSL_CTX_free(ctx); 3215. ssl/ssl_lib.c:1074:1: Parameter `s->session_ctx->sessions->num_items` 1072. } 1073. 1074. > void SSL_free(SSL *s) 1075. { 1076. int i; ssl/ssl_lib.c:1105:9: Call 1103. /* Make the next call work :-) */ 1104. if (s->session != NULL) { 1105. ssl_clear_bad_session(s); ^ 1106. SSL_SESSION_free(s->session); 1107. } ssl/ssl_sess.c:1112:1: Parameter `s->session_ctx->sessions->num_items` 1110. } 1111. 1112. > int ssl_clear_bad_session(SSL *s) 1113. { 1114. if ((s->session != NULL) && ssl/ssl_sess.c:1117:9: Call 1115. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1116. !(SSL_in_init(s) || SSL_in_before(s))) { 1117. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1118. return 1; 1119. } else ssl/ssl_sess.c:729:1: Parameter `ctx->sessions->num_items` 727. } 728. 729. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 730. { 731. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:731:12: Call 729. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 730. { 731. return remove_session_lock(ctx, c, 1); ^ 732. } 733. ssl/ssl_sess.c:734:1: Parameter `ctx->sessions->num_items` 732. } 733. 734. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 735. { 736. SSL_SESSION *r; ssl/ssl_sess.c:744:17: Call 742. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 743. ret = 1; 744. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 745. SSL_SESSION_list_remove(ctx, c); 746. } ssl/ssl_locl.h:713:1: Parameter `lh->num_items` 711. } TLSEXT_INDEX; 712. 713. > DEFINE_LHASH_OF(SSL_SESSION); 714. /* Needed in ssl_cert.c */ 715. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:713:1: Call 711. } TLSEXT_INDEX; 712. 713. > DEFINE_LHASH_OF(SSL_SESSION); 714. /* Needed in ssl_cert.c */ 715. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:119:1: <LHS trace> 117. } 118. 119. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 120. { 121. unsigned long hash; crypto/lhash/lhash.c:119:1: Parameter `lh->num_items` 117. } 118. 119. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 120. { 121. unsigned long hash; crypto/lhash/lhash.c:139:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free` 137. } 138. 139. lh->num_items--; ^ 140. if ((lh->num_nodes > MIN_NODES) && 141. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/9f5671c7e9f30dfa53b1a2b553f234c2761ceb66/crypto/lhash/lhash.c/#L139
d2a_code_trace_data_43924
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } test/rsa_sp800_56b_test.c:443: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `rsa_sp800_56b_check_keypair`. Showing all 25 steps of the trace test/rsa_sp800_56b_test.c:443:14: Call 441. && TEST_ptr(ctx = BN_CTX_new()) 442. /* NULL parameters */ 443. && TEST_false(rsa_sp800_56b_check_keypair(key, NULL, -1, 2048)) ^ 444. /* load key */ 445. && TEST_ptr(p = bn_load_new(cav_p, sizeof(cav_p))) crypto/rsa/rsa_sp800_56b_check.c:316:1: Parameter `rsa->dmp1->top` 314. * 6.4.1.3.3 "rsakpv2 - crt" 315. */ 316. > int rsa_sp800_56b_check_keypair(const RSA *rsa, const BIGNUM *efixed, 317. int strength, int nbits) 318. { crypto/rsa/rsa_sp800_56b_check.c:377:14: Call 375. && rsa_check_private_exponent(rsa, nbits, ctx) 376. /* 6.4.1.2.3 (Step 7): Check the CRT components */ 377. && rsa_check_crt_components(rsa, ctx); ^ 378. if (ret != 1) 379. RSAerr(RSA_F_RSA_SP800_56B_CHECK_KEYPAIR, RSA_R_INVALID_KEYPAIR); crypto/rsa/rsa_sp800_56b_check.c:24:1: Parameter `rsa->dmp1->top` 22. * 6.4.1.3.3: rsakpv2-crt Step 7 23. */ 24. > int rsa_check_crt_components(const RSA *rsa, BN_CTX *ctx) 25. { 26. int ret = 0; crypto/rsa/rsa_sp800_56b_check.c:48:15: Call 46. && BN_sub_word(q1, 1) 47. /* (a) 1 < dP < (p – 1). */ 48. && (BN_cmp(rsa->dmp1, BN_value_one()) > 0) ^ 49. && (BN_cmp(rsa->dmp1, p1) < 0) 50. /* (b) 1 < dQ < (q - 1). */ crypto/bn/bn_lib.c:581:1: Parameter `a->top` 579. } 580. 581. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 582. { 583. int i; crypto/rsa/rsa_sp800_56b_check.c:49:15: Call 47. /* (a) 1 < dP < (p – 1). */ 48. && (BN_cmp(rsa->dmp1, BN_value_one()) > 0) 49. && (BN_cmp(rsa->dmp1, p1) < 0) ^ 50. /* (b) 1 < dQ < (q - 1). */ 51. && (BN_cmp(rsa->dmq1, BN_value_one()) > 0) crypto/bn/bn_lib.c:581:1: Parameter `a->top` 579. } 580. 581. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 582. { 583. int i; crypto/rsa/rsa_sp800_56b_check.c:57:14: Call 55. && (BN_cmp(rsa->iqmp, rsa->p) < 0) 56. /* (d) 1 = (dP . e) mod (p - 1)*/ 57. && BN_mod_mul(r, rsa->dmp1, rsa->e, p1, ctx) ^ 58. && BN_is_one(r) 59. /* (e) 1 = (dQ . e) mod (q - 1) */ crypto/bn/bn_mod.c:193:1: Parameter `a->top` 191. 192. /* slow but works */ 193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 194. BN_CTX *ctx) 195. { crypto/bn/bn_mod.c:207:14: Call 205. goto err; 206. if (a == b) { 207. if (!BN_sqr(t, a, ctx)) ^ 208. goto err; 209. } else { crypto/bn/bn_sqr.c:17:1: Parameter `*r->d` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int ret = bn_sqr_fixed_top(r, a, ctx); crypto/bn/bn_sqr.c:19:15: Call 17. int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int ret = bn_sqr_fixed_top(r, a, ctx); ^ 20. 21. bn_correct_top(r); crypto/bn/bn_sqr.c:27:1: Parameter `a->top` 25. } 26. 27. > int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 28. { 29. int max, al; crypto/bn/bn_sqr.c:35:5: Assignment 33. bn_check_top(a); 34. 35. al = a->top; ^ 36. if (al <= 0) { 37. r->top = 0; crypto/bn/bn_sqr.c:84:17: Call 82. if (bn_wexpand(tmp, max) == NULL) 83. goto err; 84. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 85. } 86. } crypto/bn/bn_sqr.c:109:1: <Offset trace> 107. 108. /* tmp must have 2*n words */ 109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 110. { 111. int i, j, max; crypto/bn/bn_sqr.c:109:1: Parameter `n` 107. 108. /* tmp must have 2*n words */ 109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 110. { 111. int i, j, max; crypto/bn/bn_sqr.c:120:5: Assignment 118. rp[0] = rp[max - 1] = 0; 119. rp++; 120. j = n; ^ 121. 122. if (--j > 0) { crypto/bn/bn_sqr.c:122:9: Assignment 120. j = n; 121. 122. if (--j > 0) { ^ 123. ap++; 124. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:109:1: <Length trace> 107. 108. /* tmp must have 2*n words */ 109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 110. { 111. int i, j, max; crypto/bn/bn_sqr.c:109:1: Parameter `*r` 107. 108. /* tmp must have 2*n words */ 109. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 110. { 111. int i, j, max; crypto/bn/bn_sqr.c:117:5: Assignment 115. max = n * 2; 116. ap = a; 117. rp = r; ^ 118. rp[0] = rp[max - 1] = 0; 119. rp++; crypto/bn/bn_sqr.c:119:5: Assignment 117. rp = r; 118. rp[0] = rp[max - 1] = 0; 119. rp++; ^ 120. j = n; 121. crypto/bn/bn_sqr.c:124:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `rsa_sp800_56b_check_keypair` 122. if (--j > 0) { 123. ap++; 124. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 125. rp += 2; 126. }
https://github.com/openssl/openssl/blob/260a16f33682a819414fcba6161708a5e6bdff50/crypto/bn/bn_sqr.c/#L124
d2a_code_trace_data_43925
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:1099: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1099:17: 1097. 1098. if(mx>xmax || mx<xmin || my>ymax || my<ymin) continue; 1099. CHECK_MV(mx,my) ^ 1100. } 1101. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1099
d2a_code_trace_data_43926
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:1057: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + 7]):unsigned64 by call to `WPACKET_put_bytes__`. Showing all 11 steps of the trace ssl/t1_lib.c:1016:1: Parameter `pkt->written` 1014. } 1015. 1016. > int ssl_add_clienthello_tlsext(SSL *s, WPACKET *pkt, int *al) 1017. { 1018. #ifndef OPENSSL_NO_EC ssl/t1_lib.c:1057:14: Call 1055. if (s->tlsext_hostname != NULL) { 1056. /* Add TLS extension servername to the Client Hello message */ 1057. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name) ^ 1058. /* Sub-packet for server_name extension */ 1059. || !WPACKET_start_sub_packet_u16(pkt) ssl/packet.c:261:1: Parameter `pkt->written` 259. } 260. 261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 262. { 263. unsigned char *data; ssl/packet.c:269:17: Call 267. 268. if (size > sizeof(unsigned int) 269. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 270. || !put_value(data, val, size)) 271. return 0; ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [0, s->s3->previous_client_finished_len + pkt->written + 7]):unsigned64 by call to `WPACKET_put_bytes__` 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_43927
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } ssl/ssl_lib.c:669: error: INTEGER_OVERFLOW_L2 ([0, max(0, `ctx->sessions->num_items`)] - 1):unsigned64 by call to `SSL_free`. Showing all 15 steps of the trace ssl/ssl_lib.c:518:1: Parameter `ctx->sessions->num_items` 516. } 517. 518. > SSL *SSL_new(SSL_CTX *ctx) 519. { 520. SSL *s; ssl/ssl_lib.c:669:5: Call 667. return s; 668. err: 669. SSL_free(s); ^ 670. SSLerr(SSL_F_SSL_NEW, ERR_R_MALLOC_FAILURE); 671. return NULL; ssl/ssl_lib.c:926:1: Parameter `s->initial_ctx->sessions->num_items` 924. } 925. 926. > void SSL_free(SSL *s) 927. { 928. int i; ssl/ssl_lib.c:963:9: Call 961. /* Make the next call work :-) */ 962. if (s->session != NULL) { 963. ssl_clear_bad_session(s); ^ 964. SSL_SESSION_free(s->session); 965. } ssl/ssl_sess.c:992:1: Parameter `s->initial_ctx->sessions->num_items` 990. } 991. 992. > int ssl_clear_bad_session(SSL *s) 993. { 994. if ((s->session != NULL) && ssl/ssl_sess.c:997:9: Call 995. !(s->shutdown & SSL_SENT_SHUTDOWN) && 996. !(SSL_in_init(s) || SSL_in_before(s))) { 997. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 998. return (1); 999. } else ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items` 689. } 690. 691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:693:12: Call 691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 692. { 693. return remove_session_lock(ctx, c, 1); ^ 694. } 695. ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items` 694. } 695. 696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 697. { 698. SSL_SESSION *r; ssl/ssl_sess.c:706:17: Call 704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 705. ret = 1; 706. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 707. SSL_SESSION_list_remove(ctx, c); 708. } ssl/ssl_locl.h:581:1: Parameter `lh->num_items` 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:581:1: Call 579. }; 580. 581. > DEFINE_LHASH_OF(SSL_SESSION); 582. /* Needed in ssl_cert.c */ 583. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:103:1: <LHS trace> 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:103:1: Parameter `lh->num_items` 101. } 102. 103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 104. { 105. unsigned long hash; crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, ctx->sessions->num_items)] - 1):unsigned64 by call to `SSL_free` 121. } 122. 123. lh->num_items--; ^ 124. if ((lh->num_nodes > MIN_NODES) && 125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_43928
static void compute_imdct(MPADecodeContext *s, GranuleDef *g, int32_t *sb_samples, int32_t *mdct_buf) { int32_t *ptr, *win, *win1, *buf, *out_ptr, *ptr1; int32_t out2[12]; int i, j, mdct_long_end, v, sblimit; ptr = g->sb_hybrid + 576; ptr1 = g->sb_hybrid + 2 * 18; while (ptr >= ptr1) { ptr -= 6; v = ptr[0] | ptr[1] | ptr[2] | ptr[3] | ptr[4] | ptr[5]; if (v != 0) break; } sblimit = ((ptr - g->sb_hybrid) / 18) + 1; if (g->block_type == 2) { if (g->switch_point) mdct_long_end = 2; else mdct_long_end = 0; } else { mdct_long_end = sblimit; } buf = mdct_buf; ptr = g->sb_hybrid; for(j=0;j<mdct_long_end;j++) { out_ptr = sb_samples + j; if (g->switch_point && j < 2) win1 = mdct_win[0]; else win1 = mdct_win[g->block_type]; win = win1 + ((4 * 36) & -(j & 1)); imdct36(out_ptr, buf, ptr, win); out_ptr += 18*SBLIMIT; ptr += 18; buf += 18; } for(j=mdct_long_end;j<sblimit;j++) { win = mdct_win[2] + ((4 * 36) & -(j & 1)); out_ptr = sb_samples + j; for(i=0; i<6; i++){ *out_ptr = buf[i]; out_ptr += SBLIMIT; } imdct12(out2, ptr + 0); for(i=0;i<6;i++) { *out_ptr = MULH(out2[i], win[i]) + buf[i + 6*1]; buf[i + 6*2] = MULH(out2[i + 6], win[i + 6]); out_ptr += SBLIMIT; } imdct12(out2, ptr + 1); for(i=0;i<6;i++) { *out_ptr = MULH(out2[i], win[i]) + buf[i + 6*2]; buf[i + 6*0] = MULH(out2[i + 6], win[i + 6]); out_ptr += SBLIMIT; } imdct12(out2, ptr + 2); for(i=0;i<6;i++) { buf[i + 6*0] = MULH(out2[i], win[i]) + buf[i + 6*0]; buf[i + 6*1] = MULH(out2[i + 6], win[i + 6]); buf[i + 6*2] = 0; } ptr += 18; buf += 18; } for(j=sblimit;j<SBLIMIT;j++) { out_ptr = sb_samples + j; for(i=0;i<18;i++) { *out_ptr = buf[i]; buf[i] = 0; out_ptr += SBLIMIT; } buf += 18; } } libavcodec/mpegaudiodec.c:2278: error: Buffer Overrun L1 Offset: [12, +oo] (⇐ [0, +oo] + [12, 17]) Size: 2 by call to `compute_imdct`. libavcodec/mpegaudiodec.c:2015:1: Parameter `s->mdct_buf[*]` 2013. 2014. /* main layer3 decoding function */ 2015. static int mp_decode_layer3(MPADecodeContext *s) ^ 2016. { 2017. int nb_granules, main_data_begin, private_bits; libavcodec/mpegaudiodec.c:2278:13: Call 2276. sample_dump(1, g->sb_hybrid, 576); 2277. #endif 2278. compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]); ^ 2279. #if defined(DEBUG) 2280. sample_dump(2, &s->sb_samples[ch][18 * gr][0], 576); libavcodec/mpegaudiodec.c:1938:13: <Offset trace> 1936. } 1937. imdct12(out2, ptr + 0); 1938. for(i=0;i<6;i++) { ^ 1939. *out_ptr = MULH(out2[i], win[i]) + buf[i + 6*1]; 1940. buf[i + 6*2] = MULH(out2[i + 6], win[i + 6]); libavcodec/mpegaudiodec.c:1938:13: Assignment 1936. } 1937. imdct12(out2, ptr + 0); 1938. for(i=0;i<6;i++) { ^ 1939. *out_ptr = MULH(out2[i], win[i]) + buf[i + 6*1]; 1940. buf[i + 6*2] = MULH(out2[i + 6], win[i + 6]); libavcodec/mpegaudiodec.c:1881:1: <Length trace> 1879. } 1880. 1881. static void compute_imdct(MPADecodeContext *s, ^ 1882. GranuleDef *g, 1883. int32_t *sb_samples, libavcodec/mpegaudiodec.c:1881:1: Parameter `*mdct_buf` 1879. } 1880. 1881. static void compute_imdct(MPADecodeContext *s, ^ 1882. GranuleDef *g, 1883. int32_t *sb_samples, libavcodec/mpegaudiodec.c:1911:5: Assignment 1909. } 1910. 1911. buf = mdct_buf; ^ 1912. ptr = g->sb_hybrid; 1913. for(j=0;j<mdct_long_end;j++) { libavcodec/mpegaudiodec.c:1940:13: Array access: Offset: [12, +oo] (⇐ [0, +oo] + [12, 17]) Size: 2 by call to `compute_imdct` 1938. for(i=0;i<6;i++) { 1939. *out_ptr = MULH(out2[i], win[i]) + buf[i + 6*1]; 1940. buf[i + 6*2] = MULH(out2[i + 6], win[i + 6]); ^ 1941. out_ptr += SBLIMIT; 1942. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L1940
d2a_code_trace_data_43929
static int mxf_read_primer_pack(MXFContext *mxf) { ByteIOContext *pb = mxf->fc->pb; int item_num = get_be32(pb); int item_len = get_be32(pb); if (item_len != 18) { av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n"); return -1; } if (item_num > UINT_MAX / item_len) return -1; mxf->local_tags_count = item_num; mxf->local_tags = av_malloc(item_num*item_len); if (!mxf->local_tags) return -1; get_buffer(pb, mxf->local_tags, item_num*item_len); return 0; } libavformat/mxf.c:388: error: Integer Overflow L2 ([-oo, 238609294] × 18):signed32. libavformat/mxf.c:378:20: <LHS trace> 376. { 377. ByteIOContext *pb = mxf->fc->pb; 378. int item_num = get_be32(pb); ^ 379. int item_len = get_be32(pb); 380. libavformat/mxf.c:378:20: Call 376. { 377. ByteIOContext *pb = mxf->fc->pb; 378. int item_num = get_be32(pb); ^ 379. int item_len = get_be32(pb); 380. libavformat/aviobuf.c:477:11: Call 475. { 476. unsigned int val; 477. val = get_be16(s) << 16; ^ 478. val |= get_be16(s); 479. return val; libavformat/aviobuf.c:462:11: Call 460. { 461. unsigned int val; 462. val = get_byte(s) << 8; ^ 463. val |= get_byte(s); 464. return val; libavformat/aviobuf.c:348:13: Assignment 346. return *s->buf_ptr++; 347. else 348. return 0; ^ 349. } 350. } libavformat/aviobuf.c:462:5: Assignment 460. { 461. unsigned int val; 462. val = get_byte(s) << 8; ^ 463. val |= get_byte(s); 464. return val; libavformat/aviobuf.c:463:5: Assignment 461. unsigned int val; 462. val = get_byte(s) << 8; 463. val |= get_byte(s); ^ 464. return val; 465. } libavformat/aviobuf.c:464:5: Assignment 462. val = get_byte(s) << 8; 463. val |= get_byte(s); 464. return val; ^ 465. } 466. libavformat/aviobuf.c:477:5: Assignment 475. { 476. unsigned int val; 477. val = get_be16(s) << 16; ^ 478. val |= get_be16(s); 479. return val; libavformat/aviobuf.c:478:5: Assignment 476. unsigned int val; 477. val = get_be16(s) << 16; 478. val |= get_be16(s); ^ 479. return val; 480. } libavformat/aviobuf.c:479:5: Assignment 477. val = get_be16(s) << 16; 478. val |= get_be16(s); 479. return val; ^ 480. } 481. libavformat/mxf.c:378:5: Assignment 376. { 377. ByteIOContext *pb = mxf->fc->pb; 378. int item_num = get_be32(pb); ^ 379. int item_len = get_be32(pb); 380. libavformat/mxf.c:379:20: <RHS trace> 377. ByteIOContext *pb = mxf->fc->pb; 378. int item_num = get_be32(pb); 379. int item_len = get_be32(pb); ^ 380. 381. if (item_len != 18) { libavformat/mxf.c:379:20: Call 377. ByteIOContext *pb = mxf->fc->pb; 378. int item_num = get_be32(pb); 379. int item_len = get_be32(pb); ^ 380. 381. if (item_len != 18) { libavformat/aviobuf.c:477:11: Call 475. { 476. unsigned int val; 477. val = get_be16(s) << 16; ^ 478. val |= get_be16(s); 479. return val; libavformat/aviobuf.c:462:11: Call 460. { 461. unsigned int val; 462. val = get_byte(s) << 8; ^ 463. val |= get_byte(s); 464. return val; libavformat/aviobuf.c:348:13: Assignment 346. return *s->buf_ptr++; 347. else 348. return 0; ^ 349. } 350. } libavformat/aviobuf.c:462:5: Assignment 460. { 461. unsigned int val; 462. val = get_byte(s) << 8; ^ 463. val |= get_byte(s); 464. return val; libavformat/aviobuf.c:463:5: Assignment 461. unsigned int val; 462. val = get_byte(s) << 8; 463. val |= get_byte(s); ^ 464. return val; 465. } libavformat/aviobuf.c:464:5: Assignment 462. val = get_byte(s) << 8; 463. val |= get_byte(s); 464. return val; ^ 465. } 466. libavformat/aviobuf.c:477:5: Assignment 475. { 476. unsigned int val; 477. val = get_be16(s) << 16; ^ 478. val |= get_be16(s); 479. return val; libavformat/aviobuf.c:478:5: Assignment 476. unsigned int val; 477. val = get_be16(s) << 16; 478. val |= get_be16(s); ^ 479. return val; 480. } libavformat/aviobuf.c:479:5: Assignment 477. val = get_be16(s) << 16; 478. val |= get_be16(s); 479. return val; ^ 480. } 481. libavformat/mxf.c:379:5: Assignment 377. ByteIOContext *pb = mxf->fc->pb; 378. int item_num = get_be32(pb); 379. int item_len = get_be32(pb); ^ 380. 381. if (item_len != 18) { libavformat/mxf.c:388:23: Binary operation: ([-oo, 238609294] × 18):signed32 386. return -1; 387. mxf->local_tags_count = item_num; 388. mxf->local_tags = av_malloc(item_num*item_len); ^ 389. if (!mxf->local_tags) 390. return -1;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/mxf.c/#L388
d2a_code_trace_data_43930
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) { int i, j, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l, tmp; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_RSHIFT, BN_R_INVALID_SHIFT); return 0; } nw = n / BN_BITS2; rb = n % BN_BITS2; lb = BN_BITS2 - rb; if (nw >= a->top || a->top == 0) { BN_zero(r); return 1; } i = (BN_num_bits(a) - n + (BN_BITS2 - 1)) / BN_BITS2; if (r != a) { if (bn_wexpand(r, i) == NULL) return 0; r->neg = a->neg; } else { if (n == 0) return 1; } f = &(a->d[nw]); t = r->d; j = a->top - nw; r->top = i; if (rb == 0) { for (i = j; i != 0; i--) *(t++) = *(f++); } else { l = *(f++); for (i = j - 1; i != 0; i--) { tmp = (l >> rb) & BN_MASK2; l = *(f++); *(t++) = (tmp | (l << lb)) & BN_MASK2; } if ((l = (l >> rb) & BN_MASK2)) *(t) = l; } if (!r->top) r->neg = 0; bn_check_top(r); return 1; } crypto/bn/bn_prime.c:208: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `BN_rshift`. Showing all 11 steps of the trace crypto/bn/bn_prime.c:190:10: Call 188. BN_CTX_start(ctx); 189. 190. A1 = BN_CTX_get(ctx); ^ 191. A3 = BN_CTX_get(ctx); 192. A1_odd = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:360:1: Parameter `*a->d` 358. } 359. 360. > int BN_set_word(BIGNUM *a, BN_ULONG w) 361. { 362. bn_check_top(a); crypto/bn/bn_lib.c:363:9: Call 361. { 362. bn_check_top(a); 363. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 364. return 0; 365. a->neg = 0; crypto/bn/bn_lcl.h:651:1: Parameter `*a->d` 649. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 650. 651. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 652. { 653. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_prime.c:208:10: Call 206. while (!BN_is_bit_set(A1, k)) 207. k++; 208. if (!BN_rshift(A1_odd, A1, k)) ^ 209. goto err; 210. crypto/bn/bn_shift.c:122:1: <Length trace> 120. } 121. 122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 123. { 124. int i, j, nw, lb, rb; crypto/bn/bn_shift.c:122:1: Parameter `*a->d` 120. } 121. 122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 123. { 124. int i, j, nw, lb, rb; crypto/bn/bn_shift.c:153:5: Assignment 151. } 152. 153. f = &(a->d[nw]); ^ 154. t = r->d; 155. j = a->top - nw; crypto/bn/bn_shift.c:162:15: Assignment 160. *(t++) = *(f++); 161. } else { 162. l = *(f++); ^ 163. for (i = j - 1; i != 0; i--) { 164. tmp = (l >> rb) & BN_MASK2; crypto/bn/bn_shift.c:165:17: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_rshift` 163. for (i = j - 1; i != 0; i--) { 164. tmp = (l >> rb) & BN_MASK2; 165. l = *(f++); ^ 166. *(t++) = (tmp | (l << lb)) & BN_MASK2; 167. }
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_shift.c/#L165
d2a_code_trace_data_43931
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } crypto/ec/ecdsa_ossl.c:244: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `bn_mul_mont_fixed_top`. Showing all 17 steps of the trace crypto/ec/ecdsa_ossl.c:212:10: Call 210. if (8 * dgst_len > i) 211. dgst_len = (i + 7) / 8; 212. if (!BN_bin2bn(dgst, dgst_len, m)) { ^ 213. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); 214. goto err; crypto/bn/bn_lib.c:372:1: Parameter `ret->top` 370. } 371. 372. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) 373. { 374. unsigned int i, m; crypto/ec/ecdsa_ossl.c:244:17: Call 242. */ 243. if (!bn_to_mont_fixed_top(s, ret->r, group->mont_data, ctx) 244. || !bn_mul_mont_fixed_top(s, s, priv_key, group->mont_data, ctx)) { ^ 245. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); 246. goto err; crypto/bn/bn_mont.c:37:1: Parameter `b->top` 35. } 36. 37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 38. BN_MONT_CTX *mont, BN_CTX *ctx) 39. { crypto/bn/bn_mont.c:67:14: Call 65. bn_check_top(tmp); 66. if (a == b) { 67. if (!BN_sqr(tmp, a, ctx)) ^ 68. goto err; 69. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:99:1: <Offset trace> 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:99:1: Parameter `n` 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:110:5: Assignment 108. rp[0] = rp[max - 1] = 0; 109. rp++; 110. j = n; ^ 111. 112. if (--j > 0) { crypto/bn/bn_sqr.c:112:9: Assignment 110. j = n; 111. 112. if (--j > 0) { ^ 113. ap++; 114. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:99:1: <Length trace> 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:99:1: Parameter `*r` 97. 98. /* tmp must have 2*n words */ 99. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 100. { 101. int i, j, max; crypto/bn/bn_sqr.c:107:5: Assignment 105. max = n * 2; 106. ap = a; 107. rp = r; ^ 108. rp[0] = rp[max - 1] = 0; 109. rp++; crypto/bn/bn_sqr.c:109:5: Assignment 107. rp = r; 108. rp[0] = rp[max - 1] = 0; 109. rp++; ^ 110. j = n; 111. crypto/bn/bn_sqr.c:114:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `bn_mul_mont_fixed_top` 112. if (--j > 0) { 113. ap++; 114. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 115. rp += 2; 116. }
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_sqr.c/#L114
d2a_code_trace_data_43932
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, MPA_INT *window, int *dither_state, OUT_INT *samples, int incr, int32_t sb_samples[SBLIMIT]) { int32_t tmp[32]; register MPA_INT *synth_buf; register const MPA_INT *w, *w2, *p; int j, offset, v; OUT_INT *samples2; #if FRAC_BITS <= 15 int sum, sum2; #else int64_t sum, sum2; #endif dct32(tmp, sb_samples); offset = *synth_buf_offset; synth_buf = synth_buf_ptr + offset; for(j=0;j<32;j++) { v = tmp[j]; #if FRAC_BITS <= 15 v = av_clip_int16(v); #endif synth_buf[j] = v; } memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT)); samples2 = samples + 31 * incr; w = window; w2 = window + 31; sum = *dither_state; p = synth_buf + 16; SUM8(sum, +=, w, p); p = synth_buf + 48; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); samples += incr; w++; for(j=1;j<16;j++) { sum2 = 0; p = synth_buf + 16 + j; SUM8P2(sum, +=, sum2, -=, w, w2, p); p = synth_buf + 48 - j; SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p); *samples = round_sample(&sum); samples += incr; sum += sum2; *samples2 = round_sample(&sum); samples2 -= incr; w++; w2--; } p = synth_buf + 32; SUM8(sum, -=, w + 32, p); *samples = round_sample(&sum); *dither_state= sum; offset = (offset - 32) & 511; *synth_buf_offset = offset; } libavcodec/mpc.c:60: error: Buffer Overrun L2 Offset: [416+min(0, `c->synth_buf_offset[*]`), 417+max(511, `c->synth_buf_offset[*]`)] (⇐ [32+min(0, `c->synth_buf_offset[*]`), 33+max(511, `c->synth_buf_offset[*]`)] + 384) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]` 49. * Process decoded Musepack data and produce PCM 50. */ 51. static void mpc_synth(MPCContext *c, int16_t *out) ^ 52. { 53. int dither_state = 0; libavcodec/mpc.c:60:13: Call 58. samples_ptr = samples + ch; 59. for(i = 0; i < SAMPLES_PER_BAND; i++) { 60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 61. mpa_window, &dither_state, 62. samples_ptr, 2, libavcodec/mpegaudiodec.c:858:1: <Length trace> 856. 32 samples. */ 857. /* XXX: optimize by avoiding ring buffer usage */ 858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 859. MPA_INT *window, int *dither_state, 860. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr` 856. 32 samples. */ 857. /* XXX: optimize by avoiding ring buffer usage */ 858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset, ^ 859. MPA_INT *window, int *dither_state, 860. OUT_INT *samples, int incr, libavcodec/mpegaudiodec.c:877:5: Assignment 875. 876. offset = *synth_buf_offset; 877. synth_buf = synth_buf_ptr + offset; ^ 878. 879. for(j=0;j<32;j++) { libavcodec/mpegaudiodec.c:922:5: Assignment 920. } 921. 922. p = synth_buf + 32; ^ 923. SUM8(sum, -=, w + 32, p); 924. *samples = round_sample(&sum); libavcodec/mpegaudiodec.c:923:5: Array access: Offset: [416+min(0, c->synth_buf_offset[*]), 417+max(511, c->synth_buf_offset[*])] (⇐ [32+min(0, c->synth_buf_offset[*]), 33+max(511, c->synth_buf_offset[*])] + 384) Size: 2 by call to `ff_mpa_synth_filter` 921. 922. p = synth_buf + 32; 923. SUM8(sum, -=, w + 32, p); ^ 924. *samples = round_sample(&sum); 925. *dither_state= sum;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L923
d2a_code_trace_data_43933
static void info_cb(const SSL *s, int where, int ret) { if (where & SSL_CB_ALERT) { HANDSHAKE_EX_DATA *ex_data = (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); if (where & SSL_CB_WRITE) { ex_data->alert_sent = ret; if (strcmp(SSL_alert_type_string(ret), "F") == 0 || strcmp(SSL_alert_desc_string(ret), "CN") == 0) ex_data->num_fatal_alerts_sent++; } else { ex_data->alert_received = ret; } } } test/handshake_helper.c:90: error: NULL_DEREFERENCE pointer `ex_data` last assigned on line 87 could be null and is dereferenced at line 90, column 13. Showing all 12 steps of the trace test/handshake_helper.c:84:1: start of procedure info_cb() 82. static int ex_data_idx; 83. 84. > static void info_cb(const SSL *s, int where, int ret) 85. { 86. if (where & SSL_CB_ALERT) { test/handshake_helper.c:86:9: Taking true branch 84. static void info_cb(const SSL *s, int where, int ret) 85. { 86. if (where & SSL_CB_ALERT) { ^ 87. HANDSHAKE_EX_DATA *ex_data = 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); test/handshake_helper.c:87:9: 85. { 86. if (where & SSL_CB_ALERT) { 87. > HANDSHAKE_EX_DATA *ex_data = 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 89. if (where & SSL_CB_WRITE) { ssl/ssl_lib.c:4014:1: start of procedure SSL_get_ex_data() 4012. } 4013. 4014. > void *SSL_get_ex_data(const SSL *s, int idx) 4015. { 4016. return CRYPTO_get_ex_data(&s->ex_data, idx); ssl/ssl_lib.c:4016:5: 4014. void *SSL_get_ex_data(const SSL *s, int idx) 4015. { 4016. > return CRYPTO_get_ex_data(&s->ex_data, idx); 4017. } 4018. crypto/ex_data.c:393:1: start of procedure CRYPTO_get_ex_data() 391. * particular index in the class used by this variable 392. */ 393. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:395:9: Taking true branch 393. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 396. return NULL; 397. return sk_void_value(ad->sk, idx); crypto/ex_data.c:396:9: 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 396. > return NULL; 397. return sk_void_value(ad->sk, idx); 398. } crypto/ex_data.c:398:1: return from a call to CRYPTO_get_ex_data 396. return NULL; 397. return sk_void_value(ad->sk, idx); 398. > } ssl/ssl_lib.c:4017:1: return from a call to SSL_get_ex_data 4015. { 4016. return CRYPTO_get_ex_data(&s->ex_data, idx); 4017. > } 4018. 4019. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) test/handshake_helper.c:89:13: Taking true branch 87. HANDSHAKE_EX_DATA *ex_data = 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 89. if (where & SSL_CB_WRITE) { ^ 90. ex_data->alert_sent = ret; 91. if (strcmp(SSL_alert_type_string(ret), "F") == 0 test/handshake_helper.c:90:13: 88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 89. if (where & SSL_CB_WRITE) { 90. > ex_data->alert_sent = ret; 91. if (strcmp(SSL_alert_type_string(ret), "F") == 0 92. || strcmp(SSL_alert_desc_string(ret), "CN") == 0)
https://github.com/openssl/openssl/blob/e43e6b1951de931ca500c6964496e76651332f5e/test/handshake_helper.c/#L90
d2a_code_trace_data_43934
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/exptest.c:67: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp`. Showing all 25 steps of the trace test/exptest.c:67:10: Call 65. goto err; 66. 67. if (!TEST_true(BN_mod_exp(r, a, p, m, ctx))) ^ 68. goto err; 69. crypto/bn/bn_exp.c:89:1: Parameter `ctx->stack.depth` 87. } 88. 89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 90. BN_CTX *ctx) 91. { crypto/bn/bn_exp.c:149:15: Call 147. #ifdef RECP_MUL_MOD 148. { 149. ret = BN_mod_exp_recp(r, a, p, m, ctx); ^ 150. } 151. #else crypto/bn/bn_exp.c:161:1: Parameter `ctx->stack.depth` 159. } 160. 161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 162. const BIGNUM *m, BN_CTX *ctx) 163. { crypto/bn/bn_exp.c:191:5: Call 189. } 190. 191. BN_CTX_start(ctx); ^ 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_exp.c:192:10: Call 190. 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); ^ 193. val[0] = BN_CTX_get(ctx); 194. if (val[0] == NULL) crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:193:14: Call 191. BN_CTX_start(ctx); 192. aa = BN_CTX_get(ctx); 193. val[0] = BN_CTX_get(ctx); ^ 194. if (val[0] == NULL) 195. goto err; crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_exp.c:210:10: Call 208. } 209. 210. if (!BN_nnmod(val[0], a, m, ctx)) ^ 211. goto err; /* 1 */ 212. if (BN_is_zero(val[0])) { crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43935
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) { int i, j, max; const BN_ULONG *ap; BN_ULONG *rp; max = n * 2; ap = a; rp = r; rp[0] = rp[max - 1] = 0; rp++; j = n; if (--j > 0) { ap++; rp[j] = bn_mul_words(rp, ap, j, ap[-1]); rp += 2; } for (i = n - 2; i > 0; i--) { j--; ap++; rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]); rp += 2; } bn_add_words(r, r, r, max); bn_sqr_words(tmp, a, n); bn_add_words(r, r, tmp, max); } test/bntest.c:1078: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont_consttime`. Showing all 21 steps of the trace test/bntest.c:1075:5: Call 1073. e = BN_new(); 1074. 1075. BN_one(a); ^ 1076. BN_one(b); 1077. BN_zero(c); crypto/bn/bn_lib.c:463:1: Parameter `a->top` 461. } 462. 463. > int BN_set_word(BIGNUM *a, BN_ULONG w) 464. { 465. bn_check_top(a); test/bntest.c:1078:9: Call 1076. BN_one(b); 1077. BN_zero(c); 1078. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { ^ 1079. fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus " 1080. "succeeded\n"); crypto/bn/bn_exp.c:601:1: Parameter `a->top` 599. * http://www.daemonology.net/hyperthreading-considered-harmful/) 600. */ 601. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 602. const BIGNUM *m, BN_CTX *ctx, 603. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:758:17: Call 756. if (!BN_to_montgomery(&am, &am, mont, ctx)) 757. goto err; 758. } else if (!BN_to_montgomery(&am, a, mont, ctx)) ^ 759. goto err; 760. crypto/bn/bn_lib.c:945:1: Parameter `a->top` 943. } 944. 945. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 946. BN_CTX *ctx) 947. { crypto/bn/bn_lib.c:948:12: Call 946. BN_CTX *ctx) 947. { 948. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 949. } 950. crypto/bn/bn_mont.c:26:1: Parameter `a->top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:53:14: Call 51. bn_check_top(tmp); 52. if (a == b) { 53. if (!BN_sqr(tmp, a, ctx)) ^ 54. goto err; 55. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:105:1: <Offset trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `n` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:116:5: Assignment 114. rp[0] = rp[max - 1] = 0; 115. rp++; 116. j = n; ^ 117. 118. if (--j > 0) { crypto/bn/bn_sqr.c:118:9: Assignment 116. j = n; 117. 118. if (--j > 0) { ^ 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:105:1: <Length trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `*r` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:113:5: Assignment 111. max = n * 2; 112. ap = a; 113. rp = r; ^ 114. rp[0] = rp[max - 1] = 0; 115. rp++; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp = r; 114. rp[0] = rp[max - 1] = 0; 115. rp++; ^ 116. j = n; 117. crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_exp_mont_consttime` 118. if (--j > 0) { 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 121. rp += 2; 122. }
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_sqr.c/#L120
d2a_code_trace_data_43936
ngx_int_t ngx_http_set_exten(ngx_http_request_t *r) { ngx_int_t i; r->exten.len = 0; r->exten.data = NULL; for (i = r->uri.len - 1; i > 1; i--) { if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') { r->exten.len = r->uri.len - i - 1; r->exten.data = &r->uri.data[i + 1]; break; } else if (r->uri.data[i] == '/') { break; } } return NGX_OK; } src/http/ngx_http_script.c:1077: error: Integer Overflow L2 ([0, +oo] - 1):unsigned64 by call to `ngx_http_set_exten`. src/http/ngx_http_script.c:1077:13: Call 1075. } 1076. 1077. if (ngx_http_set_exten(r) != NGX_OK) { ^ 1078. e->ip = ngx_http_script_exit; 1079. e->status = NGX_HTTP_INTERNAL_SERVER_ERROR; src/http/ngx_http_core_module.c:1614:1: <LHS trace> 1612. 1613. 1614. ngx_int_t ^ 1615. ngx_http_set_exten(ngx_http_request_t *r) 1616. { src/http/ngx_http_core_module.c:1614:1: Parameter `r->uri.len` 1612. 1613. 1614. ngx_int_t ^ 1615. ngx_http_set_exten(ngx_http_request_t *r) 1616. { src/http/ngx_http_core_module.c:1622:10: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_http_set_exten` 1620. r->exten.data = NULL; 1621. 1622. for (i = r->uri.len - 1; i > 1; i--) { ^ 1623. if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') { 1624.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/http/ngx_http_core_module.c/#L1622
d2a_code_trace_data_43937
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:1064: error: Uninitialized Value The value read from xmin was never initialized. libavcodec/motion_est_template.c:1064:9: 1062. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1063. CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift) 1064. CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift) ^ 1065. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) 1066. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1064
d2a_code_trace_data_43938
ERR_STATE *ERR_get_state(void) { ERR_STATE *state = NULL; if (!RUN_ONCE(&err_init, err_do_init)) return NULL; if (!OPENSSL_init_crypto(0, NULL)) return NULL; state = CRYPTO_THREAD_get_local(&err_thread_local); if (state == NULL) { state = OPENSSL_zalloc(sizeof(*state)); if (state == NULL) return NULL; if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { ERR_STATE_free(state); return NULL; } OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL); } return state; } crypto/err/err.c:687: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_zalloc()` at line 681, column 17 is not reachable after line 687, column 13. Showing all 40 steps of the trace crypto/err/err.c:663:1: start of procedure ERR_get_state() 661. } 662. 663. > ERR_STATE *ERR_get_state(void) 664. { 665. ERR_STATE *state = NULL; crypto/err/err.c:665:5: 663. ERR_STATE *ERR_get_state(void) 664. { 665. > ERR_STATE *state = NULL; 666. 667. if (!RUN_ONCE(&err_init, err_do_init)) crypto/err/err.c:667:10: 665. ERR_STATE *state = NULL; 666. 667. > if (!RUN_ONCE(&err_init, err_do_init)) 668. return NULL; 669. crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once() 103. } 104. 105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 106. { 107. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:107:9: Taking false branch 105. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 106. { 107. if (pthread_once(once, init) != 0) ^ 108. return 0; 109. crypto/threads_pthread.c:110:5: 108. return 0; 109. 110. > return 1; 111. } 112. crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once 109. 110. return 1; 111. > } 112. 113. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/err/err.c:667:10: Condition is true 665. ERR_STATE *state = NULL; 666. 667. if (!RUN_ONCE(&err_init, err_do_init)) ^ 668. return NULL; 669. crypto/err/err.c:667:10: Taking false branch 665. ERR_STATE *state = NULL; 666. 667. if (!RUN_ONCE(&err_init, err_do_init)) ^ 668. return NULL; 669. crypto/err/err.c:675:10: Taking false branch 673. * Needed on any platform that doesn't define OPENSSL_USE_NODELETE. 674. */ 675. if (!OPENSSL_init_crypto(0, NULL)) ^ 676. return NULL; 677. crypto/err/err.c:678:5: 676. return NULL; 677. 678. > state = CRYPTO_THREAD_get_local(&err_thread_local); 679. 680. if (state == NULL) { 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/err/err.c:680:9: Taking true branch 678. state = CRYPTO_THREAD_get_local(&err_thread_local); 679. 680. if (state == NULL) { ^ 681. state = OPENSSL_zalloc(sizeof(*state)); 682. if (state == NULL) crypto/err/err.c:681:9: 679. 680. if (state == NULL) { 681. > state = OPENSSL_zalloc(sizeof(*state)); 682. if (state == NULL) 683. return NULL; crypto/mem.c:218:1: start of procedure CRYPTO_zalloc() 216. } 217. 218. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 219. { 220. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:220:5: 218. void *CRYPTO_zalloc(size_t num, const char *file, int line) 219. { 220. > void *ret = CRYPTO_malloc(num, file, line); 221. 222. FAILTEST(); crypto/mem.c:189:1: start of procedure CRYPTO_malloc() 187. #endif 188. 189. > void *CRYPTO_malloc(size_t num, const char *file, int line) 190. { 191. void *ret = NULL; crypto/mem.c:191:5: 189. void *CRYPTO_malloc(size_t num, const char *file, int line) 190. { 191. > void *ret = NULL; 192. 193. INCREMENT(malloc_count); crypto/mem.c:194:9: Taking false branch 192. 193. INCREMENT(malloc_count); 194. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 195. return malloc_impl(num, file, line); 196. crypto/mem.c:197:9: Taking false branch 195. return malloc_impl(num, file, line); 196. 197. if (num == 0) ^ 198. return NULL; 199. crypto/mem.c:201:5: 199. 200. FAILTEST(); 201. > allow_customize = 0; 202. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 203. if (call_malloc_debug) { crypto/mem.c:211:5: 209. } 210. #else 211. > (void)(file); (void)(line); 212. ret = malloc(num); 213. #endif crypto/mem.c:211:19: 209. } 210. #else 211. > (void)(file); (void)(line); 212. ret = malloc(num); 213. #endif crypto/mem.c:212:5: 210. #else 211. (void)(file); (void)(line); 212. > ret = malloc(num); 213. #endif 214. crypto/mem.c:215:5: 213. #endif 214. 215. > return ret; 216. } 217. crypto/mem.c:216:1: return from a call to CRYPTO_malloc 214. 215. return ret; 216. > } 217. 218. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:223:9: Taking true branch 221. 222. FAILTEST(); 223. if (ret != NULL) ^ 224. memset(ret, 0, num); 225. return ret; crypto/mem.c:224:9: 222. FAILTEST(); 223. if (ret != NULL) 224. > memset(ret, 0, num); 225. return ret; 226. } crypto/mem.c:225:5: 223. if (ret != NULL) 224. memset(ret, 0, num); 225. > return ret; 226. } 227. crypto/mem.c:226:1: return from a call to CRYPTO_zalloc 224. memset(ret, 0, num); 225. return ret; 226. > } 227. 228. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/err/err.c:682:13: Taking false branch 680. if (state == NULL) { 681. state = OPENSSL_zalloc(sizeof(*state)); 682. if (state == NULL) ^ 683. return NULL; 684. crypto/err/err.c:685:14: 683. return NULL; 684. 685. > if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) 686. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { 687. ERR_STATE_free(state); 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 true branch 379. struct thread_local_inits_st *locals; 380. 381. if (!OPENSSL_init_crypto(0, NULL)) ^ 382. return 0; 383. crypto/init.c:382:9: 380. 381. if (!OPENSSL_init_crypto(0, NULL)) 382. > return 0; 383. 384. locals = ossl_init_get_thread_local(1); crypto/init.c:406:1: return from a call to ossl_init_thread_start 404. 405. return 1; 406. > } 407. 408. void OPENSSL_cleanup(void) crypto/err/err.c:685:14: Taking true branch 683. return NULL; 684. 685. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) ^ 686. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { 687. ERR_STATE_free(state); crypto/err/err.c:687:13: Skipping ERR_STATE_free(): empty list of specs 685. if (!ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE) 686. || !CRYPTO_THREAD_set_local(&err_thread_local, state)) { 687. ERR_STATE_free(state); ^ 688. return NULL; 689. }
https://github.com/openssl/openssl/blob/066904cceef26bbb5c63c237d20829fb0db82ddc/crypto/err/err.c/#L687
d2a_code_trace_data_43939
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/sm2_internal_test.c:282: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `EC_POINT_mul`. Showing all 32 steps of the trace test/sm2_internal_test.c:271:10: Call 269. BIGNUM *s = NULL; 270. 271. if (!TEST_true(BN_hex2bn(&priv, privkey_hex))) ^ 272. goto done; 273. crypto/bn/bn_print.c:166:5: Assignment 164. j = i; /* least significant 'hex' */ 165. m = 0; 166. h = 0; ^ 167. while (j > 0) { 168. m = (BN_BYTES * 2 <= j) ? BN_BYTES * 2 : j; crypto/bn/bn_print.c:184:5: Assignment 182. j -= BN_BYTES * 2; 183. } 184. ret->top = h; ^ 185. bn_correct_top(ret); 186. test/sm2_internal_test.c:277:17: Call 275. if (!TEST_ptr(key) 276. || !TEST_true(EC_KEY_set_group(key, group)) 277. || !TEST_true(EC_KEY_set_private_key(key, priv))) ^ 278. goto done; 279. crypto/ec/ec_key.c:438:1: Parameter `priv_key->top` 436. } 437. 438. > int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key) 439. { 440. if (key->group == NULL || key->group->meth == NULL) test/sm2_internal_test.c:282:17: Call 280. pt = EC_POINT_new(group); 281. if (!TEST_ptr(pt) 282. || !TEST_true(EC_POINT_mul(group, pt, priv, NULL, NULL, NULL)) ^ 283. || !TEST_true(EC_KEY_set_public_key(key, pt))) 284. goto done; crypto/ec/ec_lib.c:929:1: Parameter `group->order->top` 927. } 928. 929. > int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, 930. const EC_POINT *point, const BIGNUM *p_scalar, BN_CTX *ctx) 931. { crypto/ec/ec_lib.c:940:12: Call 938. scalars[0] = p_scalar; 939. 940. return EC_POINTs_mul(group, r, g_scalar, ^ 941. (point != NULL 942. && p_scalar != NULL), points, scalars, ctx); crypto/ec/ec_lib.c:918:1: Parameter `group->order->top` 916. */ 917. 918. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 919. size_t num, const EC_POINT *points[], 920. const BIGNUM *scalars[], BN_CTX *ctx) crypto/ec/ec_lib.c:924:16: Call 922. if (group->meth->mul == 0) 923. /* use default */ 924. return ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx); ^ 925. 926. return group->meth->mul(group, r, scalar, num, points, scalars, ctx); crypto/ec/ec_mult.c:342:1: Parameter `group->order->top` 340. * in the addition if scalar != NULL 341. */ 342. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, 343. size_t num, const EC_POINT *points[], const BIGNUM *scalars[], 344. BN_CTX *ctx) crypto/ec/ec_mult.c:393:16: Call 391. * constant time version. 392. */ 393. return ec_mul_consttime(group, r, scalar, NULL, ctx); ^ 394. } 395. if ((scalar == NULL) && (num == 1)) { crypto/ec/ec_mult.c:131:1: Parameter `group->order->top` 129. * Returns 1 on success, 0 otherwise. 130. */ 131. > static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r, 132. const BIGNUM *scalar, const EC_POINT *point, 133. BN_CTX *ctx) crypto/ec/ec_mult.c:147:18: Call 145. BN_CTX_start(ctx); 146. 147. order_bits = BN_num_bits(group->order); ^ 148. 149. s = EC_POINT_new(group); crypto/bn/bn_lib.c:139:9: Call 137. bn_check_top(a); 138. 139. if (BN_is_zero(a)) ^ 140. return 0; 141. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); crypto/bn/bn_lib.c:845:1: Parameter `a->top` 843. } 844. 845. > int BN_is_zero(const BIGNUM *a) 846. { 847. return a->top == 0; crypto/ec/ec_mult.c:189:14: Call 187. * constant-timeness 188. */ 189. if (!BN_nnmod(k, k, group->order, ctx)) ^ 190. goto err; 191. } crypto/bn/bn_mod.c:13:1: Parameter `d->top` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:199:31: Call 197. 198. /* First we normalise the numbers */ 199. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); ^ 200. if (!(BN_lshift(sdiv, divisor, norm_shift))) 201. goto err; crypto/bn/bn_lib.c:140:9: Assignment 138. 139. if (BN_is_zero(a)) 140. return 0; ^ 141. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); 142. } crypto/bn/bn_div.c:199:5: Assignment 197. 198. /* First we normalise the numbers */ 199. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); ^ 200. if (!(BN_lshift(sdiv, divisor, norm_shift))) 201. goto err; crypto/bn/bn_div.c:200:11: Call 198. /* First we normalise the numbers */ 199. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2); 200. if (!(BN_lshift(sdiv, divisor, norm_shift))) ^ 201. goto err; 202. sdiv->neg = 0; crypto/bn/bn_shift.c:83:1: <Offset trace> 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:83:1: Parameter `n` 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:5: Assignment 95. } 96. 97. nw = n / BN_BITS2; ^ 98. if (bn_wexpand(r, a->top + nw + 1) == NULL) 99. return 0; crypto/bn/bn_shift.c:83:1: <Length trace> 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:83:1: Parameter `*r->d` 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/bn/bn_shift.c:98:9: Call 96. 97. nw = n / BN_BITS2; 98. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 99. return 0; 100. r->neg = a->neg; crypto/bn/bn_lib.c:941:1: Parameter `*a->d` 939. } 940. 941. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 942. { 943. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_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 `EC_POINT_mul` 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/630fe1da888490b7dfef3fe0928b813ddff5d51a/crypto/bn/bn_shift.c/#L112
d2a_code_trace_data_43940
static void cpSeparateBufToContigBuf(uint8* out, uint8* in, uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp, int bytes_per_sample) { while (rows-- > 0) { uint32 j = cols; while (j-- > 0) { int n = bytes_per_sample; while( n-- ) { *out++ = *in++; } out += (spp-1)*bytes_per_sample; } out += outskew; in += inskew; } } tools/tiffcp.c:1106: error: Integer Overflow L2 ([0, `rows`] - 1):unsigned32. tools/tiffcp.c:1101:1: <LHS trace> 1099. } 1100. 1101. static void ^ 1102. cpSeparateBufToContigBuf(uint8* out, uint8* in, 1103. uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp, tools/tiffcp.c:1101:1: Parameter `rows` 1099. } 1100. 1101. static void ^ 1102. cpSeparateBufToContigBuf(uint8* out, uint8* in, 1103. uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp, tools/tiffcp.c:1106:9: Binary operation: ([0, rows] - 1):unsigned32 1104. int bytes_per_sample) 1105. { 1106. while (rows-- > 0) { ^ 1107. uint32 j = cols; 1108. while (j-- > 0) {
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/tools/tiffcp.c/#L1106
d2a_code_trace_data_43941
static int compat_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) { AVCodecInternal *avci = avctx->internal; int ret; av_assert0(avci->compat_decode_consumed == 0); *got_frame = 0; avci->compat_decode = 1; if (avci->compat_decode_partial_size > 0 && avci->compat_decode_partial_size != pkt->size) { av_log(avctx, AV_LOG_ERROR, "Got unexpected packet size after a partial decode\n"); ret = AVERROR(EINVAL); goto finish; } if (!avci->compat_decode_partial_size) { ret = avcodec_send_packet(avctx, pkt); if (ret == AVERROR_EOF) ret = 0; else if (ret == AVERROR(EAGAIN)) { ret = AVERROR_BUG; goto finish; } else if (ret < 0) goto finish; } while (ret >= 0) { ret = avcodec_receive_frame(avctx, frame); if (ret < 0) { if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) ret = 0; goto finish; } if (frame != avci->compat_decode_frame) { if (!avctx->refcounted_frames) { ret = unrefcount_frame(avci, frame); if (ret < 0) goto finish; } *got_frame = 1; frame = avci->compat_decode_frame; } else { if (!avci->compat_decode_warned) { av_log(avctx, AV_LOG_WARNING, "The deprecated avcodec_decode_* " "API cannot return all the frames for this decoder. " "Some frames will be dropped. Update your code to the " "new decoding API to fix this.\n"); avci->compat_decode_warned = 1; } } if (avci->draining || (!avctx->codec->bsfs && avci->compat_decode_consumed < pkt->size)) break; } finish: if (ret == 0) { if (avctx->codec->bsfs) ret = pkt->size; else ret = FFMIN(avci->compat_decode_consumed, pkt->size); } avci->compat_decode_consumed = 0; avci->compat_decode_partial_size = (ret >= 0) ? pkt->size - ret : 0; return ret; } libavcodec/decode.c:661: error: Uninitialized Value The value read from ret was never initialized. libavcodec/decode.c:661:41: 659. } 660. avci->compat_decode_consumed = 0; 661. avci->compat_decode_partial_size = (ret >= 0) ? pkt->size - ret : 0; ^ 662. 663. return ret;
https://github.com/libav/libav/blob/839010aca9713b5cd6ebe7a1db7e805c3625b168/libavcodec/decode.c/#L661
d2a_code_trace_data_43942
PUT_HEVC_QPEL_HV(2, 1) libavcodec/hevcdsp_template.c:983: error: Buffer Overrun L3 Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h2v1_10`. libavcodec/hevcdsp_template.c:983:1: Call 981. QPEL(12) 982. QPEL(8) 983. QPEL(4) ^ 984. 985. static inline void FUNC(put_hevc_epel_pixels)(int16_t *dst, ptrdiff_t dststride, libavcodec/hevcdsp_template.c:904:1: <Offset trace> 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) 904. PUT_HEVC_QPEL_HV(2, 1) ^ 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) libavcodec/hevcdsp_template.c:904:1: Assignment 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) 904. PUT_HEVC_QPEL_HV(2, 1) ^ 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) libavcodec/hevcdsp_template.c:904:1: <Length trace> 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) 904. PUT_HEVC_QPEL_HV(2, 1) ^ 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) libavcodec/hevcdsp_template.c:904:1: Array declaration 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) 904. PUT_HEVC_QPEL_HV(2, 1) ^ 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) libavcodec/hevcdsp_template.c:904:1: Assignment 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) 904. PUT_HEVC_QPEL_HV(2, 1) ^ 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3) libavcodec/hevcdsp_template.c:904:1: Array access: Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h2v1_10` 902. PUT_HEVC_QPEL_HV(1, 2) 903. PUT_HEVC_QPEL_HV(1, 3) 904. PUT_HEVC_QPEL_HV(2, 1) ^ 905. PUT_HEVC_QPEL_HV(2, 2) 906. PUT_HEVC_QPEL_HV(2, 3)
https://github.com/libav/libav/blob/688417399c69aadd4c287bdb0dec82ef8799011c/libavcodec/hevcdsp_template.c/#L904
d2a_code_trace_data_43943
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *A, *a = NULL; const BN_ULONG *B; int i; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b, BN_FLG_SECURE)) a = A = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = A = OPENSSL_zalloc(words * sizeof(*a)); if (A == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } #if 1 B = b->d; if (B != NULL) { for (i = b->top >> 2; i > 0; i--, A += 4, B += 4) { BN_ULONG a0, a1, a2, a3; a0 = B[0]; a1 = B[1]; a2 = B[2]; a3 = B[3]; A[0] = a0; A[1] = a1; A[2] = a2; A[3] = a3; } switch (b->top & 3) { case 3: A[2] = B[2]; case 2: A[1] = B[1]; case 1: A[0] = B[0]; case 0: ; } } #else memset(A, 0, sizeof(*A) * words); memcpy(A, b->d, sizeof(b->d[0]) * b->top); #endif return (a); } test/bntest.c:2022: error: BUFFER_OVERRUN_L3 Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_bntest_rand`. Showing all 19 steps of the trace test/bntest.c:2020:5: Call 2018. d = BN_new(); 2019. e = BN_new(); 2020. BN_one(c); ^ 2021. 2022. BN_bntest_rand(a, 200, 0, 0); crypto/bn/bn_lib.c:463:1: Parameter `*a->d` 461. } 462. 463. > int BN_set_word(BIGNUM *a, BN_ULONG w) 464. { 465. bn_check_top(a); crypto/bn/bn_lib.c:466:9: Call 464. { 465. bn_check_top(a); 466. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 467. return (0); 468. a->neg = 0; crypto/bn/bn_lcl.h:676:1: Parameter `*a->d` 674. int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx); 675. 676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 677. { 678. if (bits > (INT_MAX - BN_BITS2 + 1)) test/bntest.c:2022:5: Call 2020. BN_one(c); 2021. 2022. BN_bntest_rand(a, 200, 0, 0); ^ 2023. a->neg = rand_neg(); 2024. for (i = 0; i < num0; i++) { crypto/bn/bn_rand.c:106:1: Parameter `*rnd->d` 104. } 105. 106. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(2, rnd, bits, top, bottom); crypto/bn/bn_rand.c:108:12: Call 106. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(2, rnd, bits, top, bottom); ^ 109. } 110. crypto/bn/bn_rand.c:17:1: Parameter `*rnd->d` 15. #include <openssl/sha.h> 16. 17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) 18. { 19. unsigned char *buf = NULL; crypto/bn/bn_rand.c:26:9: Call 24. if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY) 25. goto toosmall; 26. BN_zero(rnd); ^ 27. return 1; 28. } crypto/bn/bn_lib.c:463:1: Parameter `*a->d` 461. } 462. 463. > int BN_set_word(BIGNUM *a, BN_ULONG w) 464. { 465. bn_check_top(a); crypto/bn/bn_lib.c:466:9: Call 464. { 465. bn_check_top(a); 466. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 467. return (0); 468. a->neg = 0; crypto/bn/bn_lcl.h:676:1: Parameter `*a->d` 674. int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx); 675. 676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 677. { 678. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_lcl.h:684:12: Call 682. return a; 683. 684. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 685. } 686. crypto/bn/bn_lib.c:323:1: Parameter `*b->d` 321. */ 322. 323. > BIGNUM *bn_expand2(BIGNUM *b, int words) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:328:23: Call 326. 327. if (words > b->dmax) { 328. BN_ULONG *a = bn_expand_internal(b, words); ^ 329. if (!a) 330. return NULL; crypto/bn/bn_lib.c:246:1: <Length trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *A, *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `*b->d` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *A, *a = NULL; crypto/bn/bn_lib.c:272:5: Assignment 270. 271. #if 1 272. B = b->d; ^ 273. /* Check if the previous number needs to be copied */ 274. if (B != NULL) { crypto/bn/bn_lib.c:289:18: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_bntest_rand` 287. a1 = B[1]; 288. a2 = B[2]; 289. a3 = B[3]; ^ 290. A[0] = a0; 291. A[1] = a1;
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_lib.c/#L289
d2a_code_trace_data_43944
static int dv_extract_audio(uint8_t* frame, uint8_t* pcm, uint8_t* pcm2, const DVprofile *sys) { int size, chan, i, j, d, of, smpls, freq, quant, half_ch; uint16_t lc, rc; const uint8_t* as_pack; as_pack = dv_extract_pack(frame, dv_audio_source); if (!as_pack) return 0; smpls = as_pack[1] & 0x3f; freq = (as_pack[4] >> 3) & 0x07; quant = as_pack[4] & 0x07; if (quant > 1) return -1; size = (sys->audio_min_samples[freq] + smpls) * 4; half_ch = sys->difseg_size/2; for (chan = 0; chan < sys->n_difchan; chan++) { for (i = 0; i < sys->difseg_size; i++) { frame += 6 * 80; if (quant == 1 && i == half_ch) { if (!pcm2) break; else pcm = pcm2; } for (j = 0; j < 9; j++) { for (d = 8; d < 80; d += 2) { if (quant == 0) { of = sys->audio_shuffle[i][j] + (d - 8)/2 * sys->audio_stride; if (of*2 >= size) continue; pcm[of*2] = frame[d+1]; pcm[of*2+1] = frame[d]; if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00) pcm[of*2+1] = 0; } else { lc = ((uint16_t)frame[d] << 4) | ((uint16_t)frame[d+2] >> 4); rc = ((uint16_t)frame[d+1] << 4) | ((uint16_t)frame[d+2] & 0x0f); lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc)); rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc)); of = sys->audio_shuffle[i%half_ch][j] + (d - 8)/3 * sys->audio_stride; if (of*2 >= size) continue; pcm[of*2] = lc & 0xff; pcm[of*2+1] = lc >> 8; of = sys->audio_shuffle[i%half_ch+half_ch][j] + (d - 8)/3 * sys->audio_stride; pcm[of*2] = rc & 0xff; pcm[of*2+1] = rc >> 8; ++d; } } frame += 16 * 80; } } if(!pcm2) break; pcm = pcm2; } return size; } libavformat/avidec.c:699: error: Buffer Overrun L2 Offset: [0, 7] Size: 3 by call to `dv_produce_packet`. libavformat/avidec.c:690:13: Assignment 688. 689. if(ast->has_pal && pkt->data && pkt->size<(unsigned)INT_MAX/2){ 690. ast->has_pal=0; ^ 691. pkt->size += 4*256; 692. pkt->data = av_realloc(pkt->data, pkt->size + FF_INPUT_BUFFER_PADDING_SIZE); libavformat/avidec.c:699:20: Call 697. if (ENABLE_DV_DEMUXER && avi->dv_demux) { 698. dstr = pkt->destruct; 699. size = dv_produce_packet(avi->dv_demux, pkt, ^ 700. pkt->data, pkt->size); 701. pkt->destruct = dstr; libavformat/dv.c:309:1: Parameter `*buf` 307. } 308. 309. int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, ^ 310. uint8_t* buf, int buf_size) 311. { libavformat/dv.c:315:20: Call 313. 314. if (buf_size < DV_PROFILE_BYTES || 315. !(c->sys = dv_frame_profile(buf)) || ^ 316. buf_size < c->sys->frame_size) { 317. return -1; /* Broken frame, or not enough data */ libavcodec/dvdata.h:2664:1: Parameter `*frame` 2662. #define DV_MAX_FRAME_SIZE 288000 2663. 2664. static inline const DVprofile* dv_frame_profile(const uint8_t* frame) ^ 2665. { 2666. if ((frame[3] & 0x80) == 0) { /* DSF flag */ libavformat/dv.c:322:12: Call 320. /* Queueing audio packet */ 321. /* FIXME: in case of no audio/bad audio we have to do something */ 322. size = dv_extract_audio_info(c, buf); ^ 323. for (i=0; i<c->ach; i++) { 324. c->audio_pkt[i].size = size; libavformat/dv.c:182:1: Parameter `*frame` 180. } 181. 182. static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame) ^ 183. { 184. const uint8_t* as_pack; libavformat/dv.c:187:15: Call 185. int freq, stype, smpls, quant, i, ach; 186. 187. as_pack = dv_extract_pack(frame, dv_audio_source); ^ 188. if (!as_pack || !c->sys) { /* No audio ? */ 189. c->ach = 0; libavformat/dv.c:72:1: Parameter `t` 70. * to have a fallback mechanism for complete search of missing packs. 71. */ 72. static const uint8_t* dv_extract_pack(uint8_t* frame, enum dv_pack_type t) ^ 73. { 74. int offs; libavformat/dv.c:327:5: Call 325. c->audio_pkt[i].pts = c->abytes * 30000*8 / c->ast[i]->codec->bit_rate; 326. } 327. dv_extract_audio(buf, c->audio_buf[0], c->audio_buf[1], c->sys); ^ 328. c->abytes += size; 329. libavformat/dv.c:101:1: <Offset trace> 99. * are converted into 16bit linear ones. 100. */ 101. static int dv_extract_audio(uint8_t* frame, uint8_t* pcm, uint8_t* pcm2, ^ 102. const DVprofile *sys) 103. { libavformat/dv.c:101:1: Parameter `*frame` 99. * are converted into 16bit linear ones. 100. */ 101. static int dv_extract_audio(uint8_t* frame, uint8_t* pcm, uint8_t* pcm2, ^ 102. const DVprofile *sys) 103. { libavformat/dv.c:108:15: Call 106. const uint8_t* as_pack; 107. 108. as_pack = dv_extract_pack(frame, dv_audio_source); ^ 109. if (!as_pack) /* No audio ? */ 110. return 0; libavformat/dv.c:72:1: Parameter `t` 70. * to have a fallback mechanism for complete search of missing packs. 71. */ 72. static const uint8_t* dv_extract_pack(uint8_t* frame, enum dv_pack_type t) ^ 73. { 74. int offs; libavformat/dv.c:113:5: Assignment 111. 112. smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */ 113. freq = (as_pack[4] >> 3) & 0x07; /* 0 - 48KHz, 1 - 44,1kHz, 2 - 32 kHz */ ^ 114. quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */ 115. libavformat/dv.c:101:1: <Length trace> 99. * are converted into 16bit linear ones. 100. */ 101. static int dv_extract_audio(uint8_t* frame, uint8_t* pcm, uint8_t* pcm2, ^ 102. const DVprofile *sys) 103. { libavformat/dv.c:101:1: Parameter `sys->audio_min_samples[*]` 99. * are converted into 16bit linear ones. 100. */ 101. static int dv_extract_audio(uint8_t* frame, uint8_t* pcm, uint8_t* pcm2, ^ 102. const DVprofile *sys) 103. { libavformat/dv.c:119:13: Array access: Offset: [0, 7] Size: 3 by call to `dv_produce_packet` 117. return -1; /* Unsupported quantization */ 118. 119. size = (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */ ^ 120. half_ch = sys->difseg_size/2; 121.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/dv.c/#L119
d2a_code_trace_data_43945
int RAND_poll(void) { int ret = 0; RAND_POOL *pool = NULL; const RAND_METHOD *meth = RAND_get_rand_method(); if (meth == RAND_OpenSSL()) { RAND_DRBG *drbg = RAND_DRBG_get0_global(); if (drbg == NULL) return 0; CRYPTO_THREAD_write_lock(drbg->lock); ret = rand_drbg_restart(drbg, NULL, 0, 0); CRYPTO_THREAD_unlock(drbg->lock); return ret; } else { pool = RAND_POOL_new(RAND_DRBG_STRENGTH, RAND_DRBG_STRENGTH / 8, DRBG_MINMAX_FACTOR * (RAND_DRBG_STRENGTH / 8)); if (pool == NULL) return 0; if (RAND_POOL_acquire_entropy(pool) == 0) goto err; if (meth->add == NULL || meth->add(RAND_POOL_buffer(pool), RAND_POOL_length(pool), (RAND_POOL_entropy(pool) / 8.0)) == 0) goto err; ret = 1; } err: RAND_POOL_free(pool); return ret; } crypto/rand/rand_lib.c:264: error: NULL_DEREFERENCE pointer `meth` last assigned on line 238 could be null and is dereferenced at line 264, column 13. Showing all 24 steps of the trace crypto/rand/rand_lib.c:232:1: start of procedure RAND_poll() 230. * configurable via the --with-rand-seed configure option. 231. */ 232. > int RAND_poll(void) 233. { 234. int ret = 0; crypto/rand/rand_lib.c:234:5: 232. int RAND_poll(void) 233. { 234. > int ret = 0; 235. 236. RAND_POOL *pool = NULL; crypto/rand/rand_lib.c:236:5: 234. int ret = 0; 235. 236. > RAND_POOL *pool = NULL; 237. 238. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:238:5: 236. RAND_POOL *pool = NULL; 237. 238. > const RAND_METHOD *meth = RAND_get_rand_method(); 239. 240. if (meth == RAND_OpenSSL()) { crypto/rand/rand_lib.c:548:1: start of procedure RAND_get_rand_method() 546. } 547. 548. > const RAND_METHOD *RAND_get_rand_method(void) 549. { 550. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:550:5: 548. const RAND_METHOD *RAND_get_rand_method(void) 549. { 550. > const RAND_METHOD *tmp_meth = NULL; 551. 552. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:552:10: 550. const RAND_METHOD *tmp_meth = NULL; 551. 552. > if (!RUN_ONCE(&rand_init, do_rand_init)) 553. return NULL; 554. crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once() 103. } 104. 105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 106. { 107. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:107:9: Taking true branch 105. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 106. { 107. if (pthread_once(once, init) != 0) ^ 108. return 0; 109. crypto/threads_pthread.c:108:9: 106. { 107. if (pthread_once(once, init) != 0) 108. > return 0; 109. 110. return 1; crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once 109. 110. return 1; 111. > } 112. 113. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/rand/rand_lib.c:552:10: Condition is false 550. const RAND_METHOD *tmp_meth = NULL; 551. 552. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 553. return NULL; 554. crypto/rand/rand_lib.c:552:10: Taking true branch 550. const RAND_METHOD *tmp_meth = NULL; 551. 552. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 553. return NULL; 554. crypto/rand/rand_lib.c:553:9: 551. 552. if (!RUN_ONCE(&rand_init, do_rand_init)) 553. > return NULL; 554. 555. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:576:1: return from a call to RAND_get_rand_method 574. CRYPTO_THREAD_unlock(rand_meth_lock); 575. return tmp_meth; 576. > } 577. 578. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:240:9: 238. const RAND_METHOD *meth = RAND_get_rand_method(); 239. 240. > if (meth == RAND_OpenSSL()) { 241. /* fill random pool and seed the default DRBG */ 242. RAND_DRBG *drbg = RAND_DRBG_get0_global(); crypto/rand/drbg_lib.c:675:1: start of procedure RAND_OpenSSL() 673. }; 674. 675. > RAND_METHOD *RAND_OpenSSL(void) 676. { 677. return &rand_meth; crypto/rand/drbg_lib.c:677:5: 675. RAND_METHOD *RAND_OpenSSL(void) 676. { 677. > return &rand_meth; 678. } crypto/rand/drbg_lib.c:678:1: return from a call to RAND_OpenSSL 676. { 677. return &rand_meth; 678. > } crypto/rand/rand_lib.c:240:9: Taking false branch 238. const RAND_METHOD *meth = RAND_get_rand_method(); 239. 240. if (meth == RAND_OpenSSL()) { ^ 241. /* fill random pool and seed the default DRBG */ 242. RAND_DRBG *drbg = RAND_DRBG_get0_global(); crypto/rand/rand_lib.c:255:9: Skipping RAND_POOL_new(): empty list of specs 253. } else { 254. /* fill random pool and seed the current legacy RNG */ 255. pool = RAND_POOL_new(RAND_DRBG_STRENGTH, ^ 256. RAND_DRBG_STRENGTH / 8, 257. DRBG_MINMAX_FACTOR * (RAND_DRBG_STRENGTH / 8)); crypto/rand/rand_lib.c:258:13: Taking false branch 256. RAND_DRBG_STRENGTH / 8, 257. DRBG_MINMAX_FACTOR * (RAND_DRBG_STRENGTH / 8)); 258. if (pool == NULL) ^ 259. return 0; 260. crypto/rand/rand_lib.c:261:13: Taking false branch 259. return 0; 260. 261. if (RAND_POOL_acquire_entropy(pool) == 0) ^ 262. goto err; 263. crypto/rand/rand_lib.c:264:13: 262. goto err; 263. 264. > if (meth->add == NULL 265. || meth->add(RAND_POOL_buffer(pool), 266. RAND_POOL_length(pool),
https://github.com/openssl/openssl/blob/e0b625f9db00509af9004b7907d44b78f332754a/crypto/rand/rand_lib.c/#L264
d2a_code_trace_data_43946
static void compute_stereo(MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1) { int i, j, k, l; int32_t v1, v2; int sf_max, tmp0, tmp1, sf, len, non_zero_found; int32_t (*is_tab)[16]; int32_t *tab0, *tab1; int non_zero_found_short[3]; if (s->mode_ext & MODE_EXT_I_STEREO) { if (!s->lsf) { is_tab = is_table; sf_max = 7; } else { is_tab = is_table_lsf[g1->scalefac_compress & 1]; sf_max = 16; } tab0 = g0->sb_hybrid + 576; tab1 = g1->sb_hybrid + 576; non_zero_found_short[0] = 0; non_zero_found_short[1] = 0; non_zero_found_short[2] = 0; k = (13 - g1->short_start) * 3 + g1->long_end - 3; for(i = 12;i >= g1->short_start;i--) { if (i != 11) k -= 3; len = band_size_short[s->sample_rate_index][i]; for(l=2;l>=0;l--) { tab0 -= len; tab1 -= len; if (!non_zero_found_short[l]) { for(j=0;j<len;j++) { if (tab1[j] != 0) { non_zero_found_short[l] = 1; goto found1; } } sf = g1->scale_factors[k + l]; if (sf >= sf_max) goto found1; v1 = is_tab[0][sf]; v2 = is_tab[1][sf]; for(j=0;j<len;j++) { tmp0 = tab0[j]; tab0[j] = MULL(tmp0, v1); tab1[j] = MULL(tmp0, v2); } } else { found1: if (s->mode_ext & MODE_EXT_MS_STEREO) { for(j=0;j<len;j++) { tmp0 = tab0[j]; tmp1 = tab1[j]; tab0[j] = MULL(tmp0 + tmp1, ISQRT2); tab1[j] = MULL(tmp0 - tmp1, ISQRT2); } } } } } non_zero_found = non_zero_found_short[0] | non_zero_found_short[1] | non_zero_found_short[2]; for(i = g1->long_end - 1;i >= 0;i--) { len = band_size_long[s->sample_rate_index][i]; tab0 -= len; tab1 -= len; if (!non_zero_found) { for(j=0;j<len;j++) { if (tab1[j] != 0) { non_zero_found = 1; goto found2; } } k = (i == 21) ? 20 : i; sf = g1->scale_factors[k]; if (sf >= sf_max) goto found2; v1 = is_tab[0][sf]; v2 = is_tab[1][sf]; for(j=0;j<len;j++) { tmp0 = tab0[j]; tab0[j] = MULL(tmp0, v1); tab1[j] = MULL(tmp0, v2); } } else { found2: if (s->mode_ext & MODE_EXT_MS_STEREO) { for(j=0;j<len;j++) { tmp0 = tab0[j]; tmp1 = tab1[j]; tab0[j] = MULL(tmp0 + tmp1, ISQRT2); tab1[j] = MULL(tmp0 - tmp1, ISQRT2); } } } } } else if (s->mode_ext & MODE_EXT_MS_STEREO) { tab0 = g0->sb_hybrid; tab1 = g1->sb_hybrid; for(i=0;i<576;i++) { tmp0 = tab0[i]; tmp1 = tab1[i]; tab0[i] = tmp0 + tmp1; tab1[i] = tmp0 - tmp1; } } } libavcodec/mpegaudiodec.c:2265: error: Buffer Overrun L2 Offset: [-oo, 60] Size: 40 by call to `compute_stereo`. libavcodec/mpegaudiodec.c:2088:13: Call 2086. } 2087. ff_region_offset2size(g); 2088. ff_compute_band_indexes(s, g); ^ 2089. 2090. g->preflag = 0; libavcodec/mpegaudiodec.c:174:17: Assignment 172. exponents as long blocks (XXX: check this!) */ 173. if (s->sample_rate_index <= 2) 174. g->long_end = 8; ^ 175. else if (s->sample_rate_index != 8) 176. g->long_end = 6; libavcodec/mpegaudiodec.c:2265:13: Call 2263. 2264. if (s->nb_channels == 2) 2265. compute_stereo(s, &granules[0][gr], &granules[1][gr]); ^ 2266. 2267. for(ch=0;ch<s->nb_channels;ch++) { libavcodec/mpegaudiodec.c:1707:17: <Offset trace> 1705. k -= 3; 1706. len = band_size_short[s->sample_rate_index][i]; 1707. for(l=2;l>=0;l--) { ^ 1708. tab0 -= len; 1709. tab1 -= len; libavcodec/mpegaudiodec.c:1707:17: Assignment 1705. k -= 3; 1706. len = band_size_short[s->sample_rate_index][i]; 1707. for(l=2;l>=0;l--) { ^ 1708. tab0 -= len; 1709. tab1 -= len; libavcodec/mpegaudiodec.c:1675:1: <Length trace> 1673. #define ISQRT2 FIXR(0.70710678118654752440) 1674. 1675. static void compute_stereo(MPADecodeContext *s, ^ 1676. GranuleDef *g0, GranuleDef *g1) 1677. { libavcodec/mpegaudiodec.c:1675:1: Parameter `g1->scale_factors[*]` 1673. #define ISQRT2 FIXR(0.70710678118654752440) 1674. 1675. static void compute_stereo(MPADecodeContext *s, ^ 1676. GranuleDef *g0, GranuleDef *g1) 1677. { libavcodec/mpegaudiodec.c:1718:26: Array access: Offset: [-oo, 60] Size: 40 by call to `compute_stereo` 1716. } 1717. } 1718. sf = g1->scale_factors[k + l]; ^ 1719. if (sf >= sf_max) 1720. goto found1;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L1718
d2a_code_trace_data_43947
static int check_crl_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *cert_path, STACK_OF(X509) *crl_path) { X509 *cert_ta, *crl_ta; cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); if (!X509_cmp(cert_ta, crl_ta)) return 1; return 0; } crypto/x509/x509_vfy.c:1201: error: NULL_DEREFERENCE pointer `crl_ta` last assigned on line 1200 could be null and is dereferenced by call to `X509_cmp()` at line 1201, column 7. Showing all 32 steps of the trace crypto/x509/x509_vfy.c:1194:1: start of procedure check_crl_chain() 1192. */ 1193. 1194. > static int check_crl_chain(X509_STORE_CTX *ctx, 1195. STACK_OF(X509) *cert_path, 1196. STACK_OF(X509) *crl_path) crypto/x509/x509_vfy.c:1199:12: Condition is true 1197. { 1198. X509 *cert_ta, *crl_ta; 1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); ^ 1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); 1201. if (!X509_cmp(cert_ta, crl_ta)) crypto/x509/x509_vfy.c:1199:12: Condition is true 1197. { 1198. X509 *cert_ta, *crl_ta; 1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); ^ 1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); 1201. if (!X509_cmp(cert_ta, crl_ta)) crypto/x509/x509_vfy.c:1199:2: 1197. { 1198. X509 *cert_ta, *crl_ta; 1199. > cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); 1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); 1201. if (!X509_cmp(cert_ta, crl_ta)) crypto/stack/stack.c:294:1: start of procedure sk_num() 292. } 293. 294. > int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; crypto/stack/stack.c:296:5: Taking false branch 294. int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; ^ 297. return st->num; 298. } crypto/stack/stack.c:297:2: 295. { 296. if(st == NULL) return -1; 297. > return st->num; 298. } 299. crypto/stack/stack.c:298:1: return from a call to sk_num 296. if(st == NULL) return -1; 297. return st->num; 298. > } 299. 300. void *sk_value(const _STACK *st, int i) crypto/stack/stack.c:300:1: start of procedure sk_value() 298. } 299. 300. > void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:302:6: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:13: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:24: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:303:2: 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. > return st->data[i]; 304. } 305. crypto/stack/stack.c:304:1: return from a call to sk_value 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. > } 305. 306. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:1200:11: Condition is true 1198. X509 *cert_ta, *crl_ta; 1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); 1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); ^ 1201. if (!X509_cmp(cert_ta, crl_ta)) 1202. return 1; crypto/x509/x509_vfy.c:1200:11: Condition is true 1198. X509 *cert_ta, *crl_ta; 1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); 1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); ^ 1201. if (!X509_cmp(cert_ta, crl_ta)) 1202. return 1; crypto/x509/x509_vfy.c:1200:2: 1198. X509 *cert_ta, *crl_ta; 1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); 1200. > crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); 1201. if (!X509_cmp(cert_ta, crl_ta)) 1202. return 1; crypto/stack/stack.c:294:1: start of procedure sk_num() 292. } 293. 294. > int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; crypto/stack/stack.c:296:5: Taking false branch 294. int sk_num(const _STACK *st) 295. { 296. if(st == NULL) return -1; ^ 297. return st->num; 298. } crypto/stack/stack.c:297:2: 295. { 296. if(st == NULL) return -1; 297. > return st->num; 298. } 299. crypto/stack/stack.c:298:1: return from a call to sk_num 296. if(st == NULL) return -1; 297. return st->num; 298. > } 299. 300. void *sk_value(const _STACK *st, int i) crypto/stack/stack.c:300:1: start of procedure sk_value() 298. } 299. 300. > void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; crypto/stack/stack.c:302:6: Taking false branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:13: Taking true branch 300. void *sk_value(const _STACK *st, int i) 301. { 302. if(!st || (i < 0) || (i >= st->num)) return NULL; ^ 303. return st->data[i]; 304. } crypto/stack/stack.c:302:39: 300. void *sk_value(const _STACK *st, int i) 301. { 302. > if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. } crypto/stack/stack.c:304:1: return from a call to sk_value 302. if(!st || (i < 0) || (i >= st->num)) return NULL; 303. return st->data[i]; 304. > } 305. 306. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:1201:7: 1199. cert_ta = sk_X509_value(cert_path, sk_X509_num(cert_path) - 1); 1200. crl_ta = sk_X509_value(crl_path, sk_X509_num(crl_path) - 1); 1201. > if (!X509_cmp(cert_ta, crl_ta)) 1202. return 1; 1203. return 0; crypto/x509/x509_cmp.c:179:1: start of procedure X509_cmp() 177. * with an evil cast. 178. */ 179. > int X509_cmp(const X509 *a, const X509 *b) 180. { 181. /* ensure hash is valid */ crypto/x509/x509_cmp.c:182:2: Skipping X509_check_purpose(): empty list of specs 180. { 181. /* ensure hash is valid */ 182. X509_check_purpose((X509 *)a, -1, 0); ^ 183. X509_check_purpose((X509 *)b, -1, 0); 184. crypto/x509/x509_cmp.c:183:2: Skipping X509_check_purpose(): empty list of specs 181. /* ensure hash is valid */ 182. X509_check_purpose((X509 *)a, -1, 0); 183. X509_check_purpose((X509 *)b, -1, 0); ^ 184. 185. return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH); crypto/x509/x509_cmp.c:185:2: 183. X509_check_purpose((X509 *)b, -1, 0); 184. 185. > return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH); 186. } 187. #endif crypto/x509/x509_cmp.c:186:1: return from a call to X509_cmp 184. 185. return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH); 186. > } 187. #endif 188.
https://github.com/openssl/openssl/blob/bbb19418e672007590c65a12aa24e1b59927b2cc/crypto/x509/x509_vfy.c/#L1201
d2a_code_trace_data_43948
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *A, *a = NULL; const BN_ULONG *B; int i; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b, BN_FLG_SECURE)) a = A = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = A = OPENSSL_zalloc(words * sizeof(*a)); if (A == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } #if 1 B = b->d; if (B != NULL) { for (i = b->top >> 2; i > 0; i--, A += 4, B += 4) { BN_ULONG a0, a1, a2, a3; a0 = B[0]; a1 = B[1]; a2 = B[2]; a3 = B[3]; A[0] = a0; A[1] = a1; A[2] = a2; A[3] = a3; } switch (b->top & 3) { case 3: A[2] = B[2]; case 2: A[1] = B[1]; case 1: A[0] = B[0]; case 0: ; } } #else memset(A, 0, sizeof(*A) * words); memcpy(A, b->d, sizeof(b->d[0]) * b->top); #endif return (a); } test/bntest.c:1934: error: BUFFER_OVERRUN_L3 Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_bntest_rand`. Showing all 19 steps of the trace test/bntest.c:1928:5: Call 1926. c = BN_new(); 1927. d = BN_new(); 1928. BN_one(c); ^ 1929. 1930. if (a_) crypto/bn/bn_lib.c:463:1: Parameter `*a->d` 461. } 462. 463. > int BN_set_word(BIGNUM *a, BN_ULONG w) 464. { 465. bn_check_top(a); crypto/bn/bn_lib.c:466:9: Call 464. { 465. bn_check_top(a); 466. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 467. return (0); 468. a->neg = 0; crypto/bn/bn_lcl.h:676:1: Parameter `*a->d` 674. int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx); 675. 676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 677. { 678. if (bits > (INT_MAX - BN_BITS2 + 1)) test/bntest.c:1934:9: Call 1932. else { 1933. a = BN_new(); 1934. BN_bntest_rand(a, 200, 0, 0); ^ 1935. a->neg = rand_neg(); 1936. } crypto/bn/bn_rand.c:106:1: Parameter `*rnd->d` 104. } 105. 106. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(2, rnd, bits, top, bottom); crypto/bn/bn_rand.c:108:12: Call 106. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(2, rnd, bits, top, bottom); ^ 109. } 110. crypto/bn/bn_rand.c:17:1: Parameter `*rnd->d` 15. #include <openssl/sha.h> 16. 17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) 18. { 19. unsigned char *buf = NULL; crypto/bn/bn_rand.c:26:9: Call 24. if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY) 25. goto toosmall; 26. BN_zero(rnd); ^ 27. return 1; 28. } crypto/bn/bn_lib.c:463:1: Parameter `*a->d` 461. } 462. 463. > int BN_set_word(BIGNUM *a, BN_ULONG w) 464. { 465. bn_check_top(a); crypto/bn/bn_lib.c:466:9: Call 464. { 465. bn_check_top(a); 466. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 467. return (0); 468. a->neg = 0; crypto/bn/bn_lcl.h:676:1: Parameter `*a->d` 674. int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx); 675. 676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 677. { 678. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_lcl.h:684:12: Call 682. return a; 683. 684. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 685. } 686. crypto/bn/bn_lib.c:323:1: Parameter `*b->d` 321. */ 322. 323. > BIGNUM *bn_expand2(BIGNUM *b, int words) 324. { 325. bn_check_top(b); crypto/bn/bn_lib.c:328:23: Call 326. 327. if (words > b->dmax) { 328. BN_ULONG *a = bn_expand_internal(b, words); ^ 329. if (!a) 330. return NULL; crypto/bn/bn_lib.c:246:1: <Length trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *A, *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `*b->d` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *A, *a = NULL; crypto/bn/bn_lib.c:272:5: Assignment 270. 271. #if 1 272. B = b->d; ^ 273. /* Check if the previous number needs to be copied */ 274. if (B != NULL) { crypto/bn/bn_lib.c:289:18: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_bntest_rand` 287. a1 = B[1]; 288. a2 = B[2]; 289. a3 = B[3]; ^ 290. A[0] = a0; 291. A[1] = a1;
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_lib.c/#L289
d2a_code_trace_data_43949
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) { int i, j, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l, tmp; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_RSHIFT, BN_R_INVALID_SHIFT); return 0; } nw = n / BN_BITS2; rb = n % BN_BITS2; lb = BN_BITS2 - rb; if (nw >= a->top || a->top == 0) { BN_zero(r); return (1); } i = (BN_num_bits(a) - n + (BN_BITS2 - 1)) / BN_BITS2; if (r != a) { if (bn_wexpand(r, i) == NULL) return (0); r->neg = a->neg; } else { if (n == 0) return 1; } f = &(a->d[nw]); t = r->d; j = a->top - nw; r->top = i; if (rb == 0) { for (i = j; i != 0; i--) *(t++) = *(f++); } else { l = *(f++); for (i = j - 1; i != 0; i--) { tmp = (l >> rb) & BN_MASK2; l = *(f++); *(t++) = (tmp | (l << lb)) & BN_MASK2; } if ((l = (l >> rb) & BN_MASK2)) *(t) = l; } if (!r->top) r->neg = 0; bn_check_top(r); return (1); } crypto/bn/bn_prime.c:210: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `BN_rshift`. Showing all 11 steps of the trace crypto/bn/bn_prime.c:190:10: Call 188. BN_CTX_start(ctx); 189. 190. A1 = BN_CTX_get(ctx); ^ 191. A1_odd = BN_CTX_get(ctx); 192. check = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:395:1: Parameter `*a->d` 393. } 394. 395. > int BN_set_word(BIGNUM *a, BN_ULONG w) 396. { 397. bn_check_top(a); crypto/bn/bn_lib.c:398:9: Call 396. { 397. bn_check_top(a); 398. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 399. return (0); 400. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `*a->d` 658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 659. 660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 661. { 662. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_prime.c:210:10: Call 208. while (!BN_is_bit_set(A1, k)) 209. k++; 210. if (!BN_rshift(A1_odd, A1, k)) ^ 211. goto err; 212. crypto/bn/bn_shift.c:122:1: <Length trace> 120. } 121. 122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 123. { 124. int i, j, nw, lb, rb; crypto/bn/bn_shift.c:122:1: Parameter `*a->d` 120. } 121. 122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) 123. { 124. int i, j, nw, lb, rb; crypto/bn/bn_shift.c:153:5: Assignment 151. } 152. 153. f = &(a->d[nw]); ^ 154. t = r->d; 155. j = a->top - nw; crypto/bn/bn_shift.c:162:15: Assignment 160. *(t++) = *(f++); 161. } else { 162. l = *(f++); ^ 163. for (i = j - 1; i != 0; i--) { 164. tmp = (l >> rb) & BN_MASK2; crypto/bn/bn_shift.c:165:17: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_rshift` 163. for (i = j - 1; i != 0; i--) { 164. tmp = (l >> rb) & BN_MASK2; 165. l = *(f++); ^ 166. *(t++) = (tmp | (l << lb)) & BN_MASK2; 167. }
https://github.com/openssl/openssl/blob/757264207ad8650a89ea903d48ad89f61d56ea9c/crypto/bn/bn_shift.c/#L165
d2a_code_trace_data_43950
int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; int i; a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); BN_one(a); BN_one(b); BN_zero(c); if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus " "succeeded\n"); return 0; } BN_set_word(c, 16); if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus " "succeeded\n"); return 0; } BN_bntest_rand(c, 30, 0, 1); for (i = 0; i < num2; i++) { BN_bntest_rand(a, 20 + i * 5, 0, 0); BN_bntest_rand(b, 2 + i, 0, 0); if (!BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) return (00); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " ^ "); BN_print(bp, b); BIO_puts(bp, " % "); BN_print(bp, c); BIO_puts(bp, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); } BN_exp(e, a, b, ctx); BN_sub(e, e, d); BN_div(a, b, e, c, ctx); if (!BN_is_zero(b)) { fprintf(stderr, "Modulo exponentiation test failed!\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); return (1); } test/bntest.c:1064: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 1047, column 9 is not reachable after line 1064, column 17. Showing all 154 steps of the trace test/bntest.c:1042:1: start of procedure test_mod_exp_mont_consttime() 1040. } 1041. 1042. > int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx) 1043. { 1044. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:1047:5: 1045. int i; 1046. 1047. > a = BN_new(); 1048. b = BN_new(); 1049. c = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1048:5: 1046. 1047. a = BN_new(); 1048. > b = BN_new(); 1049. c = BN_new(); 1050. d = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1049:5: 1047. a = BN_new(); 1048. b = BN_new(); 1049. > c = BN_new(); 1050. d = BN_new(); 1051. e = BN_new(); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1050:5: 1048. b = BN_new(); 1049. c = BN_new(); 1050. > d = BN_new(); 1051. e = BN_new(); 1052. crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1051:5: 1049. c = BN_new(); 1050. d = BN_new(); 1051. > e = BN_new(); 1052. 1053. BN_one(a); crypto/bn/bn_lib.c:277:1: start of procedure BN_new() 275. } 276. 277. > BIGNUM *BN_new(void) 278. { 279. BIGNUM *ret; crypto/bn/bn_lib.c:281:9: 279. BIGNUM *ret; 280. 281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/mem.c:157:1: start of procedure CRYPTO_zalloc() 155. } 156. 157. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:159:5: 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) 158. { 159. > void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:161:9: Taking true branch 159. void *ret = CRYPTO_malloc(num, file, line); 160. 161. if (ret != NULL) ^ 162. memset(ret, 0, num); 163. return ret; crypto/mem.c:162:9: 160. 161. if (ret != NULL) 162. > memset(ret, 0, num); 163. return ret; 164. } crypto/mem.c:163:5: 161. if (ret != NULL) 162. memset(ret, 0, num); 163. > return ret; 164. } 165. crypto/mem.c:164:1: return from a call to CRYPTO_zalloc 162. memset(ret, 0, num); 163. return ret; 164. > } 165. 166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) crypto/bn/bn_lib.c:281:9: Taking false branch 279. BIGNUM *ret; 280. 281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { ^ 282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE); 283. return (NULL); crypto/bn/bn_lib.c:285:5: 283. return (NULL); 284. } 285. > ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. return (ret); crypto/bn/bn_lib.c:287:5: 285. ret->flags = BN_FLG_MALLOCED; 286. bn_check_top(ret); 287. > return (ret); 288. } 289. crypto/bn/bn_lib.c:288:1: return from a call to BN_new 286. bn_check_top(ret); 287. return (ret); 288. > } 289. 290. BIGNUM *BN_secure_new(void) test/bntest.c:1053:5: 1051. e = BN_new(); 1052. 1053. > BN_one(a); 1054. BN_one(b); 1055. BN_zero(c); crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is true 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:1054:5: 1052. 1053. BN_one(a); 1054. > BN_one(b); 1055. BN_zero(c); 1056. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is true 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:1055:5: 1053. BN_one(a); 1054. BN_one(b); 1055. > BN_zero(c); 1056. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { 1057. fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus " crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is false 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:1056:9: Taking false branch 1054. BN_one(b); 1055. BN_zero(c); 1056. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { ^ 1057. fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus " 1058. "succeeded\n"); test/bntest.c:1062:5: 1060. } 1061. 1062. > BN_set_word(c, 16); 1063. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { 1064. fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus " crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is true 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:1063:9: Taking true branch 1061. 1062. BN_set_word(c, 16); 1063. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { ^ 1064. fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus " 1065. "succeeded\n"); test/bntest.c:1064:9: 1062. BN_set_word(c, 16); 1063. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { 1064. > fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus " 1065. "succeeded\n"); 1066. return 0;
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L1064
d2a_code_trace_data_43951
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return NULL; } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return ret; } test/servername_test.c:209: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace test/servername_test.c:191:17: Call 189. TLS1_VERSION, TLS_MAX_VERSION, 190. &sctx, &cctx, cert, privkey)) 191. || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, ^ 192. NULL, NULL))) 193. goto end; test/ssltestlib.c:635:15: Call 633. if (*sssl != NULL) 634. serverssl = *sssl; 635. else if (!TEST_ptr(serverssl = SSL_new(serverctx))) ^ 636. goto error; 637. if (*cssl != NULL) ssl/ssl_lib.c:669:1: Parameter `ctx->sessions->num_items` 667. } 668. 669. > SSL *SSL_new(SSL_CTX *ctx) 670. { 671. SSL *s; test/servername_test.c:209:5: Call 207. testresult = 1; 208. end: 209. SSL_free(serverssl); ^ 210. SSL_free(clientssl); 211. SSL_CTX_free(sctx); ssl/ssl_lib.c:1131:1: Parameter `s->session_ctx->sessions->num_items` 1129. } 1130. 1131. > void SSL_free(SSL *s) 1132. { 1133. int i; ssl/ssl_lib.c:1162:9: Call 1160. /* Make the next call work :-) */ 1161. if (s->session != NULL) { 1162. ssl_clear_bad_session(s); ^ 1163. SSL_SESSION_free(s->session); 1164. } ssl/ssl_sess.c:1124:1: Parameter `s->session_ctx->sessions->num_items` 1122. } 1123. 1124. > int ssl_clear_bad_session(SSL *s) 1125. { 1126. if ((s->session != NULL) && ssl/ssl_sess.c:1129:9: Call 1127. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1128. !(SSL_in_init(s) || SSL_in_before(s))) { 1129. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1130. return 1; 1131. } else ssl/ssl_sess.c:742:1: Parameter `ctx->sessions->num_items` 740. } 741. 742. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 743. { 744. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:744:12: Call 742. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 743. { 744. return remove_session_lock(ctx, c, 1); ^ 745. } 746. ssl/ssl_sess.c:747:1: Parameter `ctx->sessions->num_items` 745. } 746. 747. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 748. { 749. SSL_SESSION *r; ssl/ssl_sess.c:757:17: Call 755. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) { 756. ret = 1; 757. r = lh_SSL_SESSION_delete(ctx->sessions, r); ^ 758. SSL_SESSION_list_remove(ctx, r); 759. } ssl/ssl_locl.h:728:1: Parameter `lh->num_items` 726. } TLSEXT_INDEX; 727. 728. > DEFINE_LHASH_OF(SSL_SESSION); 729. /* Needed in ssl_cert.c */ 730. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:728:1: Call 726. } TLSEXT_INDEX; 727. 728. > DEFINE_LHASH_OF(SSL_SESSION); 729. /* Needed in ssl_cert.c */ 730. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:128:1: <LHS trace> 126. } 127. 128. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 129. { 130. unsigned long hash; crypto/lhash/lhash.c:128:1: Parameter `lh->num_items` 126. } 127. 128. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 129. { 130. unsigned long hash; crypto/lhash/lhash.c:148:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free` 146. } 147. 148. lh->num_items--; ^ 149. if ((lh->num_nodes > MIN_NODES) && 150. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/427e91d928ce7a1c583e4bba761cb17a85ac95b4/crypto/lhash/lhash.c/#L148
d2a_code_trace_data_43952
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) { int line_size; int sample_size = av_get_bytes_per_sample(sample_fmt); int planar = av_sample_fmt_is_planar(sample_fmt); if (!sample_size || nb_samples <= 0 || nb_channels <= 0) return AVERROR(EINVAL); if (!align) { if (nb_samples > INT_MAX - 31) return AVERROR(EINVAL); align = 1; nb_samples = FFALIGN(nb_samples, 32); } if (nb_channels > INT_MAX / align || (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size) return AVERROR(EINVAL); line_size = planar ? FFALIGN(nb_samples * sample_size, align) : FFALIGN(nb_samples * sample_size * nb_channels, align); if (linesize) *linesize = line_size; return planar ? line_size * nb_channels : line_size; } libavresample/utils.c:400: error: Integer Overflow L2 ([1, 2147483616] + 32):signed32 by call to `ff_audio_data_realloc`. libavresample/utils.c:367:15: Call 365. if (input) { 366. /* initialize input_buffer with input data */ 367. ret = ff_audio_data_init(&input_buffer, input, in_plane_size, ^ 368. avr->in_channels, in_samples, 369. avr->in_sample_fmt, 1, "input"); libavresample/audio_data.c:65:1: Parameter `a->nb_samples` 63. } 64. 65. int ff_audio_data_init(AudioData *a, uint8_t **src, int plane_size, int channels, ^ 66. int nb_samples, enum AVSampleFormat sample_fmt, 67. int read_only, const char *name) libavresample/utils.c:400:23: Call 398. applicable */ 399. if (avr->in_convert_needed) { 400. ret = ff_audio_data_realloc(avr->in_buffer, ^ 401. current_buffer->nb_samples); 402. if (ret < 0) libavresample/audio_data.c:153:1: Parameter `nb_samples` 151. } 152. 153. int ff_audio_data_realloc(AudioData *a, int nb_samples) ^ 154. { 155. int ret, new_buf_size, plane_size, p; libavresample/audio_data.c:165:20: Call 163. return AVERROR(EINVAL); 164. 165. new_buf_size = av_samples_get_buffer_size(&plane_size, ^ 166. a->allocated_channels, nb_samples, 167. a->sample_fmt, 0); libavutil/samplefmt.c:108:1: <LHS trace> 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:108:1: Parameter `nb_samples` 106. } 107. 108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, ^ 109. enum AVSampleFormat sample_fmt, int align) 110. { libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `ff_audio_data_realloc` 122. return AVERROR(EINVAL); 123. align = 1; 124. nb_samples = FFALIGN(nb_samples, 32); ^ 125. } 126.
https://github.com/libav/libav/blob/0e830094ad0dc251613a0aa3234d9c5c397e02e6/libavutil/samplefmt.c/#L124
d2a_code_trace_data_43953
static int ct_base64_decode(const char *in, unsigned char **out) { size_t inlen = strlen(in); int outlen; unsigned char *outbuf = NULL; if (inlen == 0) { *out = NULL; return 0; } outlen = (inlen / 4) * 3; outbuf = OPENSSL_malloc(outlen); if (outbuf == NULL) { CTerr(CT_F_CT_BASE64_DECODE, ERR_R_MALLOC_FAILURE); goto err; } outlen = EVP_DecodeBlock(outbuf, (unsigned char *)in, inlen); if (outlen < 0) { CTerr(CT_F_CT_BASE64_DECODE, CT_R_BASE64_DECODE_ERROR); goto err; } while (in[--inlen] == '=') { --outlen; } *out = outbuf; return outlen; err: OPENSSL_free(outbuf); return -1; } test/ct_test.c:458: error: BUFFER_OVERRUN_L1 Offset: [-oo, -1] Size: 1 by call to `SCT_new_from_base64`. Showing all 10 steps of the trace test/ct_test.c:446:1: Array declaration 444. } 445. 446. > static int test_encode_tls_sct() 447. { 448. const char log_id[] = "3xwuwRUAlFJHqWFoMl3cXHlZ6PfG04j8AC4LvT9012Q="; test/ct_test.c:458:10: Call 456. 457. fixture.sct_list = sk_SCT_new_null(); 458. if (!TEST_ptr(sct = SCT_new_from_base64(SCT_VERSION_V1, log_id, ^ 459. CT_LOG_ENTRY_TYPE_X509, timestamp, 460. extensions, signature))) crypto/ct/ct_b64.c:60:1: Parameter `*extensions_base64` 58. } 59. 60. > SCT *SCT_new_from_base64(unsigned char version, const char *logid_base64, 61. ct_log_entry_type_t entry_type, uint64_t timestamp, 62. const char *extensions_base64, crypto/ct/ct_b64.c:93:14: Call 91. dec = NULL; 92. 93. declen = ct_base64_decode(extensions_base64, &dec); ^ 94. if (declen < 0) { 95. CTerr(CT_F_SCT_NEW_FROM_BASE64, X509_R_BASE64_DECODE_ERROR); crypto/ct/ct_b64.c:24:1: <Offset trace> 22. * the caller. Do not provide a pre-allocated string in |out|. 23. */ 24. > static int ct_base64_decode(const char *in, unsigned char **out) 25. { 26. size_t inlen = strlen(in); crypto/ct/ct_b64.c:24:1: Parameter `in->strlen` 22. * the caller. Do not provide a pre-allocated string in |out|. 23. */ 24. > static int ct_base64_decode(const char *in, unsigned char **out) 25. { 26. size_t inlen = strlen(in); crypto/ct/ct_b64.c:26:5: Assignment 24. static int ct_base64_decode(const char *in, unsigned char **out) 25. { 26. size_t inlen = strlen(in); ^ 27. int outlen; 28. unsigned char *outbuf = NULL; crypto/ct/ct_b64.c:24:1: <Length trace> 22. * the caller. Do not provide a pre-allocated string in |out|. 23. */ 24. > static int ct_base64_decode(const char *in, unsigned char **out) 25. { 26. size_t inlen = strlen(in); crypto/ct/ct_b64.c:24:1: Parameter `*in` 22. * the caller. Do not provide a pre-allocated string in |out|. 23. */ 24. > static int ct_base64_decode(const char *in, unsigned char **out) 25. { 26. size_t inlen = strlen(in); crypto/ct/ct_b64.c:49:12: Array access: Offset: [-oo, -1] Size: 1 by call to `SCT_new_from_base64` 47. 48. /* Subtract padding bytes from |outlen| */ 49. while (in[--inlen] == '=') { ^ 50. --outlen; 51. }
https://github.com/openssl/openssl/blob/424aa352458486d67e1e9cd3d3990dc06a60ba4a/crypto/ct/ct_b64.c/#L49