id
stringlengths
25
25
content
stringlengths
649
72.1k
max_stars_repo_path
stringlengths
91
133
d2a_code_trace_data_43754
static int vorbis_parse_audio_packet(vorbis_context *vc) { GetBitContext *gb=&vc->gb; uint_fast8_t previous_window=0,next_window=0; uint_fast8_t mode_number; uint_fast16_t blocksize; int_fast32_t i,j; uint_fast8_t no_residue[vc->audio_channels]; uint_fast8_t do_not_decode[vc->audio_channels]; vorbis_mapping *mapping; float *ch_res_ptr=vc->channel_residues; float *ch_floor_ptr=vc->channel_floors; uint_fast8_t res_chan[vc->audio_channels]; uint_fast8_t res_num=0; int_fast16_t retlen=0; uint_fast16_t saved_start=0; float fadd_bias = vc->add_bias; if (get_bits1(gb)) { av_log(vc->avccontext, AV_LOG_ERROR, "Not a Vorbis I audio packet.\n"); return -1; } if (vc->mode_count==1) { mode_number=0; } else { mode_number=get_bits(gb, ilog(vc->mode_count-1)); } vc->mode_number=mode_number; mapping=&vc->mappings[vc->modes[mode_number].mapping]; AV_DEBUG(" Mode number: %d , mapping: %d , blocktype %d \n", mode_number, vc->modes[mode_number].mapping, vc->modes[mode_number].blockflag); if (vc->modes[mode_number].blockflag) { previous_window=get_bits1(gb); next_window=get_bits1(gb); } blocksize=vc->blocksize[vc->modes[mode_number].blockflag]; memset(ch_res_ptr, 0, sizeof(float)*vc->audio_channels*blocksize/2); memset(ch_floor_ptr, 0, sizeof(float)*vc->audio_channels*blocksize/2); for(i=0;i<vc->audio_channels;++i) { vorbis_floor *floor; if (mapping->submaps>1) { floor=&vc->floors[mapping->submap_floor[mapping->mux[i]]]; } else { floor=&vc->floors[mapping->submap_floor[0]]; } no_residue[i]=floor->decode(vc, &floor->data, ch_floor_ptr); ch_floor_ptr+=blocksize/2; } for(i=mapping->coupling_steps-1;i>=0;--i) { if (!(no_residue[mapping->magnitude[i]] & no_residue[mapping->angle[i]])) { no_residue[mapping->magnitude[i]]=0; no_residue[mapping->angle[i]]=0; } } for(i=0;i<mapping->submaps;++i) { vorbis_residue *residue; uint_fast8_t ch=0; for(j=0;j<vc->audio_channels;++j) { if ((mapping->submaps==1) || (i=mapping->mux[j])) { res_chan[j]=res_num; if (no_residue[j]) { do_not_decode[ch]=1; } else { do_not_decode[ch]=0; } ++ch; ++res_num; } } residue=&vc->residues[mapping->submap_residue[i]]; vorbis_residue_decode(vc, residue, ch, do_not_decode, ch_res_ptr, blocksize/2); ch_res_ptr+=ch*blocksize/2; } for(i=mapping->coupling_steps-1;i>=0;--i) { float *mag, *ang; mag=vc->channel_residues+res_chan[mapping->magnitude[i]]*blocksize/2; ang=vc->channel_residues+res_chan[mapping->angle[i]]*blocksize/2; vc->dsp.vorbis_inverse_coupling(mag, ang, blocksize/2); } for(j=0, ch_floor_ptr=vc->channel_floors;j<vc->audio_channels;++j,ch_floor_ptr+=blocksize/2) { ch_res_ptr=vc->channel_residues+res_chan[j]*blocksize/2; vc->dsp.vector_fmul(ch_floor_ptr, ch_res_ptr, blocksize/2); } for(j=0;j<vc->audio_channels;++j) { uint_fast8_t step=vc->audio_channels; uint_fast16_t k; float *saved=vc->saved+j*vc->blocksize[1]/2; float *ret=vc->ret; const float *lwin=vc->win[1]; const float *swin=vc->win[0]; float *buf=vc->buf; float *buf_tmp=vc->buf_tmp; ch_floor_ptr=vc->channel_floors+j*blocksize/2; saved_start=vc->saved_start; vc->mdct[0].fft.imdct_calc(&vc->mdct[vc->modes[mode_number].blockflag], buf, ch_floor_ptr, buf_tmp); if (vc->modes[mode_number].blockflag) { if (previous_window) { vc->dsp.vector_fmul_add_add(ret+j, buf, lwin, saved, vc->add_bias, vc->blocksize[1]/2, step); retlen=vc->blocksize[1]/2; } else { int len = (vc->blocksize[1]-vc->blocksize[0])/4; buf += len; vc->dsp.vector_fmul_add_add(ret+j, buf, swin, saved, vc->add_bias, vc->blocksize[0]/2, step); k = vc->blocksize[0]/2*step + j; buf += vc->blocksize[0]/2; if(vc->exp_bias){ for(i=0; i<len; i++, k+=step) ((uint32_t*)ret)[k] = ((uint32_t*)buf)[i] + vc->exp_bias; } else { for(i=0; i<len; i++, k+=step) ret[k] = buf[i] + fadd_bias; } buf=vc->buf; retlen=vc->blocksize[0]/2+len; } if (next_window) { buf += vc->blocksize[1]/2; vc->dsp.vector_fmul_reverse(saved, buf, lwin, vc->blocksize[1]/2); saved_start=0; } else { saved_start=(vc->blocksize[1]-vc->blocksize[0])/4; buf += vc->blocksize[1]/2; for(i=0; i<saved_start; i++) ((uint32_t*)saved)[i] = ((uint32_t*)buf)[i] + vc->exp_bias; vc->dsp.vector_fmul_reverse(saved+saved_start, buf+saved_start, swin, vc->blocksize[0]/2); } } else { if(vc->add_bias) { for(k=j, i=0;i<saved_start;++i, k+=step) ret[k] = saved[i] + fadd_bias; } else { for(k=j, i=0;i<saved_start;++i, k+=step) ret[k] = saved[i]; } vc->dsp.vector_fmul_add_add(ret+k, buf, swin, saved+saved_start, vc->add_bias, vc->blocksize[0]/2, step); retlen=saved_start+vc->blocksize[0]/2; buf += vc->blocksize[0]/2; vc->dsp.vector_fmul_reverse(saved, buf, swin, vc->blocksize[0]/2); saved_start=0; } } vc->saved_start=saved_start; return retlen*vc->audio_channels; } libavcodec/vorbis_dec.c:1500: error: Uninitialized Value The value read from res_chan[_] was never initialized. libavcodec/vorbis_dec.c:1500:9: 1498. 1499. for(j=0, ch_floor_ptr=vc->channel_floors;j<vc->audio_channels;++j,ch_floor_ptr+=blocksize/2) { 1500. ch_res_ptr=vc->channel_residues+res_chan[j]*blocksize/2; ^ 1501. vc->dsp.vector_fmul(ch_floor_ptr, ch_res_ptr, blocksize/2); 1502. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vorbis_dec.c/#L1500
d2a_code_trace_data_43755
static int sab_diamond_search(MpegEncContext * s, int *best, int dmin, int src_index, int ref_index, int const penalty_factor, int size, int h, int flags) { MotionEstContext * const c= &s->me; me_cmp_func cmpf, chroma_cmpf; Minima minima[MAX_SAB_SIZE]; const int minima_count= FFABS(c->dia_size); int i, j; LOAD_COMMON LOAD_COMMON2 int map_generation= c->map_generation; cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; for(j=i=0; i<ME_MAP_SIZE && j<MAX_SAB_SIZE; i++){ uint32_t key= map[i]; key += (1<<(ME_MAP_MV_BITS-1)) + (1<<(2*ME_MAP_MV_BITS-1)); if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue; minima[j].height= score_map[i]; minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS; minima[j].y= key & ((1<<ME_MAP_MV_BITS)-1); minima[j].x-= (1<<(ME_MAP_MV_BITS-1)); minima[j].y-= (1<<(ME_MAP_MV_BITS-1)); if( minima[j].x > xmax || minima[j].x < xmin || minima[j].y > ymax || minima[j].y < ymin) continue; minima[j].checked=0; if(minima[j].x || minima[j].y) minima[j].height+= (mv_penalty[((minima[j].x)<<shift)-pred_x] + mv_penalty[((minima[j].y)<<shift)-pred_y])*penalty_factor; j++; } qsort(minima, j, sizeof(Minima), minima_cmp); for(; j<minima_count; j++){ minima[j].height=256*256*256*64; minima[j].checked=0; minima[j].x= minima[j].y=0; } for(i=0; i<minima_count; i++){ const int x= minima[i].x; const int y= minima[i].y; int d; if(minima[i].checked) continue; if( x >= xmax || x <= xmin || y >= ymax || y <= ymin) continue; SAB_CHECK_MV(x-1, y) SAB_CHECK_MV(x+1, y) SAB_CHECK_MV(x , y-1) SAB_CHECK_MV(x , y+1) minima[i].checked= 1; } best[0]= minima[0].x; best[1]= minima[0].y; dmin= minima[0].height; if( best[0] < xmax && best[0] > xmin && best[1] < ymax && best[1] > ymin){ int d; CHECK_MV(best[0]-1, best[1]) CHECK_MV(best[0]+1, best[1]) CHECK_MV(best[0], best[1]-1) CHECK_MV(best[0], best[1]+1) } return dmin; } libavcodec/motion_est_template.c:843: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:843:15: 841. // all entries in map should be in range except if the mv overflows their ME_MAP_MV_BITS bits space 842. if( minima[j].x > xmax || minima[j].x < xmin 843. || minima[j].y > ymax || minima[j].y < ymin) ^ 844. continue; 845.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L843
d2a_code_trace_data_43756
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:1146: error: Integer Overflow L2 ([0, `h`] - 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 `h` 1138. * 8-bit greyscale => colormap/RGB 1139. */ 1140. DECLAREContigPutFunc(putgreytile) ^ 1141. { 1142. int samplesperpixel = img->samplesperpixel; libtiff/tif_getimage.c:1146:12: Binary operation: ([0, h] - 1):unsigned32 1144. 1145. (void) y; 1146. while (h-- > 0) { ^ 1147. for (x = w; x-- > 0;) 1148. {
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_getimage.c/#L1146
d2a_code_trace_data_43757
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:1078: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:1078:17: 1076. (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) 1077. if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line 1078. CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, ^ 1079. (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) 1080. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1078
d2a_code_trace_data_43758
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:3582: error: Null Dereference pointer `oc` last assigned on line 3560 could be null and is dereferenced at line 3582, column 5. ffmpeg.c:3548:1: start of procedure opt_output_file() 3546. } 3547. 3548. static void opt_output_file(const char *filename) ^ 3549. { 3550. AVFormatContext *oc; ffmpeg.c:3553:5: 3551. int err, use_video, use_audio, use_subtitle; 3552. int input_has_video, input_has_audio, input_has_subtitle; 3553. AVFormatParameters params, *ap = &params; ^ 3554. AVOutputFormat *file_oformat; 3555. AVMetadataTag *tag = NULL; ffmpeg.c:3555:5: 3553. AVFormatParameters params, *ap = &params; 3554. AVOutputFormat *file_oformat; 3555. AVMetadataTag *tag = NULL; ^ 3556. 3557. if (!strcmp(filename, "-")) ffmpeg.c:3557:10: Taking false branch 3555. AVMetadataTag *tag = NULL; 3556. 3557. if (!strcmp(filename, "-")) ^ 3558. filename = "pipe:"; 3559. ffmpeg.c:3560:5: 3558. filename = "pipe:"; 3559. 3560. oc = avformat_alloc_context(); ^ 3561. if (!oc) { 3562. 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(unsigned int size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(unsigned int size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-16) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking 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, unsigned int size) libavformat/options.c:86:10: Taking true branch 84. AVFormatContext *ic; 85. ic = av_malloc(sizeof(AVFormatContext)); 86. if (!ic) return ic; ^ 87. avformat_get_context_defaults(ic); 88. ic->av_class = &av_format_context_class; libavformat/options.c:86:14: 84. AVFormatContext *ic; 85. ic = av_malloc(sizeof(AVFormatContext)); 86. if (!ic) return ic; ^ 87. avformat_get_context_defaults(ic); 88. ic->av_class = &av_format_context_class; libavformat/options.c:90:1: return from a call to avformat_alloc_context 88. ic->av_class = &av_format_context_class; 89. return ic; 90. } ^ 91. 92. #if FF_API_ALLOC_FORMAT_CONTEXT ffmpeg.c:3561:10: Taking true branch 3559. 3560. oc = avformat_alloc_context(); 3561. if (!oc) { ^ 3562. print_error(filename, AVERROR(ENOMEM)); 3563. ffmpeg_exit(1); ffmpeg.c:3562:9: 3560. oc = avformat_alloc_context(); 3561. if (!oc) { 3562. print_error(filename, AVERROR(ENOMEM)); ^ 3563. ffmpeg_exit(1); 3564. } cmdutils.c:342:1: start of procedure print_error() 340. } 341. 342. void print_error(const char *filename, int err) ^ 343. { 344. char errbuf[128]; cmdutils.c:345:5: 343. { 344. char errbuf[128]; 345. const char *errbuf_ptr = errbuf; ^ 346. 347. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) cmdutils.c:347:9: 345. const char *errbuf_ptr = errbuf; 346. 347. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) ^ 348. errbuf_ptr = strerror(AVUNERROR(err)); 349. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); libavutil/error.c:22:1: start of procedure av_strerror() 20. #include "avstring.h" 21. 22. int av_strerror(int errnum, char *errbuf, size_t errbuf_size) ^ 23. { 24. int ret = 0; libavutil/error.c:24:5: 22. int av_strerror(int errnum, char *errbuf, size_t errbuf_size) 23. { 24. int ret = 0; ^ 25. const char *errstr = NULL; 26. libavutil/error.c:25:5: 23. { 24. int ret = 0; 25. const char *errstr = NULL; ^ 26. 27. switch (errnum) { libavutil/error.c:27:5: 25. const char *errstr = NULL; 26. 27. switch (errnum) { ^ 28. case AVERROR_EOF: errstr = "End of file"; break; 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; libavutil/error.c:28:5: Switch condition is false. Skipping switch case 26. 27. switch (errnum) { 28. case AVERROR_EOF: errstr = "End of file"; break; ^ 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; 30. case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; libavutil/error.c:29:5: Switch condition is false. Skipping switch case 27. switch (errnum) { 28. case AVERROR_EOF: errstr = "End of file"; break; 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; ^ 30. case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; 31. case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break; libavutil/error.c:30:5: Switch condition is false. Skipping switch case 28. case AVERROR_EOF: errstr = "End of file"; break; 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; 30. case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; ^ 31. case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break; 32. } libavutil/error.c:31:5: Switch condition is false. Skipping switch case 29. case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break; 30. case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break; 31. case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break; ^ 32. } 33. libavutil/error.c:34:9: Taking false branch 32. } 33. 34. if (errstr) { ^ 35. av_strlcpy(errbuf, errstr, errbuf_size); 36. } else { libavutil/error.c:38:9: 36. } else { 37. #if HAVE_STRERROR_R 38. ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size); ^ 39. #else 40. ret = -1; libavutil/error.c:42:13: Taking false branch 40. ret = -1; 41. #endif 42. if (ret < 0) ^ 43. snprintf(errbuf, errbuf_size, "Error number %d occurred", errnum); 44. } libavutil/error.c:46:5: 44. } 45. 46. return ret; ^ 47. } libavutil/error.c:47:1: return from a call to av_strerror 45. 46. return ret; 47. } ^ cmdutils.c:347:9: Taking false branch 345. const char *errbuf_ptr = errbuf; 346. 347. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) ^ 348. errbuf_ptr = strerror(AVUNERROR(err)); 349. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); cmdutils.c:349:5: 347. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) 348. errbuf_ptr = strerror(AVUNERROR(err)); 349. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); ^ 350. } 351. cmdutils.c:350:1: return from a call to print_error 348. errbuf_ptr = strerror(AVUNERROR(err)); 349. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr); 350. } ^ 351. 352. static int warned_cfg = 0; ffmpeg.c:3563:9: Skipping ffmpeg_exit(): empty list of specs 3561. if (!oc) { 3562. print_error(filename, AVERROR(ENOMEM)); 3563. ffmpeg_exit(1); ^ 3564. } 3565. ffmpeg.c:3566:9: Taking true branch 3564. } 3565. 3566. if (last_asked_format) { ^ 3567. file_oformat = av_guess_format(last_asked_format, NULL, NULL); 3568. if (!file_oformat) { ffmpeg.c:3567:9: Skipping av_guess_format(): empty list of specs 3565. 3566. if (last_asked_format) { 3567. file_oformat = av_guess_format(last_asked_format, NULL, NULL); ^ 3568. if (!file_oformat) { 3569. fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format); ffmpeg.c:3568:14: Taking false branch 3566. if (last_asked_format) { 3567. file_oformat = av_guess_format(last_asked_format, NULL, NULL); 3568. if (!file_oformat) { ^ 3569. fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format); 3570. ffmpeg_exit(1); ffmpeg.c:3572:9: 3570. ffmpeg_exit(1); 3571. } 3572. last_asked_format = NULL; ^ 3573. } else { 3574. file_oformat = av_guess_format(NULL, filename, NULL); ffmpeg.c:3582:5: 3580. } 3581. 3582. oc->oformat = file_oformat; ^ 3583. av_strlcpy(oc->filename, filename, sizeof(oc->filename)); 3584.
https://github.com/libav/libav/blob/eced8fa02ea237abd9c6a6e9287bb7524addb8f4/ffmpeg.c/#L3582
d2a_code_trace_data_43759
static int _dopr(char **sbuffer, char **buffer, size_t *maxlen, size_t *retlen, int *truncated, const char *format, va_list args) { char ch; LLONG value; LDOUBLE fvalue; char *strvalue; int min; int max; int state; int flags; int cflags; size_t currlen; state = DP_S_DEFAULT; flags = currlen = cflags = min = 0; max = -1; ch = *format++; while (state != DP_S_DONE) { if (ch == '\0' || (buffer == NULL && currlen >= *maxlen)) state = DP_S_DONE; switch (state) { case DP_S_DEFAULT: if (ch == '%') state = DP_S_FLAGS; else if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch)) return 0; ch = *format++; break; case DP_S_FLAGS: switch (ch) { case '-': flags |= DP_F_MINUS; ch = *format++; break; case '+': flags |= DP_F_PLUS; ch = *format++; break; case ' ': flags |= DP_F_SPACE; ch = *format++; break; case '#': flags |= DP_F_NUM; ch = *format++; break; case '0': flags |= DP_F_ZERO; ch = *format++; break; default: state = DP_S_MIN; break; } break; case DP_S_MIN: if (isdigit((unsigned char)ch)) { min = 10 * min + char_to_int(ch); ch = *format++; } else if (ch == '*') { min = va_arg(args, int); ch = *format++; state = DP_S_DOT; } else state = DP_S_DOT; break; case DP_S_DOT: if (ch == '.') { state = DP_S_MAX; ch = *format++; } else state = DP_S_MOD; break; case DP_S_MAX: if (isdigit((unsigned char)ch)) { if (max < 0) max = 0; max = 10 * max + char_to_int(ch); ch = *format++; } else if (ch == '*') { max = va_arg(args, int); ch = *format++; state = DP_S_MOD; } else state = DP_S_MOD; break; case DP_S_MOD: switch (ch) { case 'h': cflags = DP_C_SHORT; ch = *format++; break; case 'l': if (*format == 'l') { cflags = DP_C_LLONG; format++; } else cflags = DP_C_LONG; ch = *format++; break; case 'q': cflags = DP_C_LLONG; ch = *format++; break; case 'L': cflags = DP_C_LDOUBLE; ch = *format++; break; default: break; } state = DP_S_CONV; break; case DP_S_CONV: switch (ch) { case 'd': case 'i': switch (cflags) { case DP_C_SHORT: value = (short int)va_arg(args, int); break; case DP_C_LONG: value = va_arg(args, long int); break; case DP_C_LLONG: value = va_arg(args, LLONG); break; default: value = va_arg(args, int); break; } if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min, max, flags)) return 0; break; case 'X': flags |= DP_F_UP; case 'x': case 'o': case 'u': flags |= DP_F_UNSIGNED; switch (cflags) { case DP_C_SHORT: value = (unsigned short int)va_arg(args, unsigned int); break; case DP_C_LONG: value = (LLONG) va_arg(args, unsigned long int); break; case DP_C_LLONG: value = va_arg(args, unsigned LLONG); break; default: value = (LLONG) va_arg(args, unsigned int); break; } if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, ch == 'o' ? 8 : (ch == 'u' ? 10 : 16), min, max, flags)) return 0; break; case 'f': if (cflags == DP_C_LDOUBLE) fvalue = va_arg(args, LDOUBLE); else fvalue = va_arg(args, double); if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max, flags, F_FORMAT)) return 0; break; case 'E': flags |= DP_F_UP; case 'e': if (cflags == DP_C_LDOUBLE) fvalue = va_arg(args, LDOUBLE); else fvalue = va_arg(args, double); if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max, flags, E_FORMAT)) return 0; break; case 'G': flags |= DP_F_UP; case 'g': if (cflags == DP_C_LDOUBLE) fvalue = va_arg(args, LDOUBLE); else fvalue = va_arg(args, double); if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max, flags, G_FORMAT)) return 0; break; case 'c': if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, va_arg(args, int))) return 0; break; case 's': strvalue = va_arg(args, char *); if (max < 0) { if (buffer) max = INT_MAX; else max = *maxlen; } if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue, flags, min, max)) return 0; break; case 'p': value = (size_t)va_arg(args, void *); if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 16, min, max, flags | DP_F_NUM)) return 0; break; case 'n': if (cflags == DP_C_SHORT) { short int *num; num = va_arg(args, short int *); *num = currlen; } else if (cflags == DP_C_LONG) { long int *num; num = va_arg(args, long int *); *num = (long int)currlen; } else if (cflags == DP_C_LLONG) { LLONG *num; num = va_arg(args, LLONG *); *num = (LLONG) currlen; } else { int *num; num = va_arg(args, int *); *num = currlen; } break; case '%': if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch)) return 0; break; case 'w': ch = *format++; break; default: break; } ch = *format++; state = DP_S_DEFAULT; flags = cflags = min = 0; max = -1; break; case DP_S_DONE: break; default: break; } } if (buffer == NULL) { *truncated = (currlen > *maxlen - 1); if (*truncated) currlen = *maxlen - 1; } if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0')) return 0; *retlen = currlen - 1; return 1; } crypto/bn/bn_print.c:110: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `BIO_snprintf`. Showing all 12 steps of the trace crypto/bn/bn_print.c:73:9: Call 71. * <= BN_num_bits(a)/10 + BN_num_bits/1000 + 1 + 1 72. */ 73. i = BN_num_bits(a) * 3; ^ 74. num = (i / 10 + i / 1000 + 1) + 1; 75. bn_data_num = num / BN_DEC_NUM + 1; 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_print.c:73:5: Assignment 71. * <= BN_num_bits(a)/10 + BN_num_bits/1000 + 1 + 1 72. */ 73. i = BN_num_bits(a) * 3; ^ 74. num = (i / 10 + i / 1000 + 1) + 1; 75. bn_data_num = num / BN_DEC_NUM + 1; crypto/bn/bn_print.c:74:5: Assignment 72. */ 73. i = BN_num_bits(a) * 3; 74. num = (i / 10 + i / 1000 + 1) + 1; ^ 75. bn_data_num = num / BN_DEC_NUM + 1; 76. bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG)); crypto/bn/bn_print.c:110:9: Call 108. * order. 109. */ 110. BIO_snprintf(p, BUF_REMAIN, BN_DEC_FMT1, *lp); ^ 111. while (*p) 112. p++; crypto/bio/b_print.c:913:1: Parameter `n` 911. * function should be renamed, but to what?) 912. */ 913. > int BIO_snprintf(char *buf, size_t n, const char *format, ...) 914. { 915. va_list args; crypto/bio/b_print.c:920:11: Call 918. va_start(args, format); 919. 920. ret = BIO_vsnprintf(buf, n, format, args); ^ 921. 922. va_end(args); crypto/bio/b_print.c:926:1: Parameter `n` 924. } 925. 926. > int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) 927. { 928. size_t retlen; crypto/bio/b_print.c:931:9: Call 929. int truncated; 930. 931. if(!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args)) ^ 932. return -1; 933. crypto/bio/b_print.c:102:1: <LHS trace> 100. #define OSSL_MAX(p,q) ((p >= q) ? p : q) 101. 102. > static int 103. _dopr(char **sbuffer, 104. char **buffer, crypto/bio/b_print.c:102:1: Parameter `*maxlen` 100. #define OSSL_MAX(p,q) ((p >= q) ? p : q) 101. 102. > static int 103. _dopr(char **sbuffer, 104. char **buffer, crypto/bio/b_print.c:371:23: Binary operation: ([0, +oo] - 1):unsigned64 by call to `BIO_snprintf` 369. */ 370. if (buffer == NULL) { 371. *truncated = (currlen > *maxlen - 1); ^ 372. if (*truncated) 373. currlen = *maxlen - 1;
https://github.com/openssl/openssl/blob/8b9afbc0fc7f8be0049d389d34d9416fa377e2aa/crypto/bio/b_print.c/#L371
d2a_code_trace_data_43760
u_char * ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) { u_char *p, zero, *last; int d; float f, scale; size_t len, slen; int64_t i64; uint64_t ui64; ngx_msec_t ms; ngx_uint_t width, sign, hex, max_width, frac_width, i; ngx_str_t *v; ngx_variable_value_t *vv; if (max == 0) { return buf; } last = buf + max; while (*fmt && buf < last) { if (*fmt == '%') { i64 = 0; ui64 = 0; zero = (u_char) ((*++fmt == '0') ? '0' : ' '); width = 0; sign = 1; hex = 0; max_width = 0; frac_width = 0; slen = (size_t) -1; while (*fmt >= '0' && *fmt <= '9') { width = width * 10 + *fmt++ - '0'; } for ( ;; ) { switch (*fmt) { case 'u': sign = 0; fmt++; continue; case 'm': max_width = 1; fmt++; continue; case 'X': hex = 2; sign = 0; fmt++; continue; case 'x': hex = 1; sign = 0; fmt++; continue; case '.': fmt++; while (*fmt >= '0' && *fmt <= '9') { frac_width = frac_width * 10 + *fmt++ - '0'; } break; case '*': slen = va_arg(args, size_t); fmt++; continue; default: break; } break; } switch (*fmt) { case 'V': v = va_arg(args, ngx_str_t *); len = v->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, v->data, len); fmt++; continue; case 'v': vv = va_arg(args, ngx_variable_value_t *); len = vv->len; len = (buf + len < last) ? len : (size_t) (last - buf); buf = ngx_cpymem(buf, vv->data, len); fmt++; continue; case 's': p = va_arg(args, u_char *); if (slen == (size_t) -1) { while (*p && buf < last) { *buf++ = *p++; } } else { len = (buf + slen < last) ? slen : (size_t) (last - buf); buf = ngx_cpymem(buf, p, len); } fmt++; continue; case 'O': i64 = (int64_t) va_arg(args, off_t); sign = 1; break; case 'P': i64 = (int64_t) va_arg(args, ngx_pid_t); sign = 1; break; case 'T': i64 = (int64_t) va_arg(args, time_t); sign = 1; break; case 'M': ms = (ngx_msec_t) va_arg(args, ngx_msec_t); if ((ngx_msec_int_t) ms == -1) { sign = 1; i64 = -1; } else { sign = 0; ui64 = (uint64_t) ms; } break; case 'z': if (sign) { i64 = (int64_t) va_arg(args, ssize_t); } else { ui64 = (uint64_t) va_arg(args, size_t); } break; case 'i': if (sign) { i64 = (int64_t) va_arg(args, ngx_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_uint_t); } if (max_width) { width = NGX_INT_T_LEN; } break; case 'd': if (sign) { i64 = (int64_t) va_arg(args, int); } else { ui64 = (uint64_t) va_arg(args, u_int); } break; case 'l': if (sign) { i64 = (int64_t) va_arg(args, long); } else { ui64 = (uint64_t) va_arg(args, u_long); } break; case 'D': if (sign) { i64 = (int64_t) va_arg(args, int32_t); } else { ui64 = (uint64_t) va_arg(args, uint32_t); } break; case 'L': if (sign) { i64 = va_arg(args, int64_t); } else { ui64 = va_arg(args, uint64_t); } break; case 'A': if (sign) { i64 = (int64_t) va_arg(args, ngx_atomic_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t); } if (max_width) { width = NGX_ATOMIC_T_LEN; } break; case 'f': f = (float) va_arg(args, double); if (f < 0) { *buf++ = '-'; f = -f; } ui64 = (int64_t) f; buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width); if (frac_width) { if (buf < last) { *buf++ = '.'; } scale = 1.0; for (i = 0; i < frac_width; i++) { scale *= 10.0; } ui64 = (uint64_t) ((f - (int64_t) ui64) * scale); buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width); } fmt++; continue; #if !(NGX_WIN32) case 'r': i64 = (int64_t) va_arg(args, rlim_t); sign = 1; break; #endif case 'p': ui64 = (uintptr_t) va_arg(args, void *); hex = 2; sign = 0; zero = '0'; width = NGX_PTR_SIZE * 2; break; case 'c': d = va_arg(args, int); *buf++ = (u_char) (d & 0xff); fmt++; continue; case 'Z': *buf++ = '\0'; fmt++; continue; case 'N': #if (NGX_WIN32) *buf++ = CR; #endif *buf++ = LF; fmt++; continue; case '%': *buf++ = '%'; fmt++; continue; default: *buf++ = *fmt++; continue; } if (sign) { if (i64 < 0) { *buf++ = '-'; ui64 = (uint64_t) -i64; } else { ui64 = (uint64_t) i64; } } buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width); fmt++; } else { *buf++ = *fmt++; } } return buf; } src/http/ngx_http_request.c:1278: error: Buffer Overrun L2 Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`. src/http/ngx_http_request.c:1278:5: Call 1276. } 1277. 1278. ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, ^ 1279. "client sent duplicate header line: \"%V: %V\", " 1280. "previous value: \"%V: %V\"", src/core/ngx_log.c:67:1: Array declaration 65. #if (NGX_HAVE_VARIADIC_MACROS) 66. 67. void ^ 68. ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, 69. const char *fmt, ...) src/core/ngx_log.c:88:5: Assignment 86. } 87. 88. last = errstr + NGX_MAX_ERROR_STR; ^ 89. 90. ngx_memcpy(errstr, ngx_cached_err_log_time.data, src/core/ngx_log.c:133:13: Call 131. ? " (%d: " : " (%Xd: ", err); 132. #else 133. p = ngx_snprintf(p, last - p, " (%d: ", err); ^ 134. #endif 135. src/core/ngx_string.c:109:1: Parameter `max` 107. 108. 109. u_char * ngx_cdecl ^ 110. ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...) 111. { src/core/ngx_string.c:116:9: Call 114. 115. va_start(args, fmt); 116. p = ngx_vsnprintf(buf, max, fmt, args); ^ 117. va_end(args); 118. src/core/ngx_string.c:123:1: <Length trace> 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:123:1: Parameter `*buf` 121. 122. 123. u_char * ^ 124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) 125. { src/core/ngx_string.c:244:25: Array access: Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core` 242. if (slen == (size_t) -1) { 243. while (*p && buf < last) { 244. *buf++ = *p++; ^ 245. } 246.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L244
d2a_code_trace_data_43761
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecdsa_ossl.c:281: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 17 steps of the trace crypto/ec/ecdsa_ossl.c:260:18: Call 258. do { 259. if (in_kinv == NULL || in_r == NULL) { 260. if (!ecdsa_sign_setup(eckey, ctx, &kinv, &ret->r, dgst, dgst_len)) { ^ 261. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_ECDSA_LIB); 262. goto err; crypto/ec/ecdsa_ossl.c:34:1: Parameter `ctx_in->stack.depth` 32. } 33. 34. > static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, 35. BIGNUM **kinvp, BIGNUM **rp, 36. const unsigned char *dgst, int dlen) crypto/ec/ecdsa_ossl.c:281:14: Call 279. goto err; 280. } 281. if (!BN_mod_mul(s, s, ckinv, order, ctx)) { ^ 282. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB); 283. goto err; crypto/bn/bn_mod.c:73:1: Parameter `ctx->stack.depth` 71. 72. /* slow but works */ 73. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 74. BN_CTX *ctx) 75. { crypto/bn/bn_mod.c:83:5: Call 81. bn_check_top(m); 82. 83. BN_CTX_start(ctx); ^ 84. if ((t = BN_CTX_get(ctx)) == NULL) 85. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mod.c:87:14: Call 85. goto err; 86. if (a == b) { 87. if (!BN_sqr(t, a, ctx)) ^ 88. goto err; 89. } else { crypto/bn/bn_sqr.c:32:5: Call 30. } 31. 32. BN_CTX_start(ctx); ^ 33. rr = (a != r) ? r : BN_CTX_get(ctx); 34. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_sqr.c:100:5: Call 98. bn_check_top(rr); 99. bn_check_top(tmp); 100. BN_CTX_end(ctx); ^ 101. return (ret); 102. } crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <Offset trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: <Length trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/d7c42d71ba407a4b3c26ed58263ae225976bbac3/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_43762
int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) { int i; BN_ULONG aa, bb; aa = a[n - 1]; bb = b[n - 1]; if (aa != bb) return ((aa > bb) ? 1 : -1); for (i = n - 2; i >= 0; i--) { aa = a[i]; bb = b[i]; if (aa != bb) return ((aa > bb) ? 1 : -1); } return (0); } test/bntest.c:1924: error: BUFFER_OVERRUN_L3 Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp`. Showing all 27 steps of the trace test/bntest.c:1922:5: Call 1920. || !TEST_ptr(r = BN_new())) 1921. goto err; 1922. BN_zero(zero); ^ 1923. 1924. if (!TEST_true(BN_mod_exp(r, a, zero, BN_value_one(), NULL)) crypto/bn/bn_lib.c:395:1: Parameter `*a->d` 393. } 394. 395. > int BN_set_word(BIGNUM *a, BN_ULONG w) 396. { 397. bn_check_top(a); crypto/bn/bn_lib.c:398:9: Call 396. { 397. bn_check_top(a); 398. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 399. return (0); 400. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `*a->d` 658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 659. 660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 661. { 662. if (bits > (INT_MAX - BN_BITS2 + 1)) test/bntest.c:1924:10: Call 1922. BN_zero(zero); 1923. 1924. if (!TEST_true(BN_mod_exp(r, a, zero, BN_value_one(), NULL)) ^ 1925. || !TEST_BN_eq_zero(r) 1926. || !TEST_true(BN_mod_exp_mont(r, a, zero, BN_value_one(), crypto/bn/bn_exp.c:91:1: Parameter `*a->d` 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:144:19: Call 142. } else 143. # endif 144. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 145. } else 146. #endif crypto/bn/bn_exp.c:294:1: Parameter `*a->d` 292. } 293. 294. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 295. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 296. { crypto/bn/bn_exp.c:306:16: Call 304. 305. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 306. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 307. } 308. crypto/bn/bn_exp.c:594:1: Parameter `*a->d` 592. * http://www.daemonology.net/hyperthreading-considered-harmful/) 593. */ 594. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 595. const BIGNUM *m, BN_CTX *ctx, 596. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:751:17: Call 749. if (!BN_to_montgomery(&am, &am, mont, ctx)) 750. goto err; 751. } else if (!BN_to_montgomery(&am, a, mont, ctx)) ^ 752. goto err; 753. crypto/bn/bn_lib.c:877:1: Parameter `*a->d` 875. } 876. 877. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont, 878. BN_CTX *ctx) 879. { crypto/bn/bn_lib.c:880:12: Call 878. BN_CTX *ctx) 879. { 880. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx); ^ 881. } 882. crypto/bn/bn_mont.c:26:1: Parameter `*a->d` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:56:14: Call 54. goto err; 55. } else { 56. if (!BN_mul(tmp, a, b, ctx)) ^ 57. goto err; 58. } crypto/bn/bn_mul.c:495:1: Parameter `*a->d` 493. #endif /* BN_RECURSION */ 494. 495. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) 496. { 497. int ret = 0; crypto/bn/bn_mul.c:575:17: Call 573. if (bn_wexpand(rr, k * 4) == NULL) 574. goto err; 575. bn_mul_part_recursive(rr->d, a->d, b->d, ^ 576. j, al - j, bl - j, t->d); 577. } else { /* al <= j || bl <= j */ crypto/bn/bn_mul.c:320:1: Parameter `n` 318. */ 319. /* tnX may not be negative but less than n */ 320. > void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, 321. int tna, int tnb, BN_ULONG *t) 322. { crypto/bn/bn_mul.c:333:10: Call 331. 332. /* r=(a[0]-a[1])*(b[1]-b[0]) */ 333. c1 = bn_cmp_part_words(a, &(a[n]), tna, n - tna); ^ 334. c2 = bn_cmp_part_words(&(b[n]), b, tnb, tnb - n); 335. neg = 0; crypto/bn/bn_lib.c:735:1: Parameter `cl` 733. */ 734. 735. > int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl) 736. { 737. int n, i; crypto/bn/bn_lib.c:752:12: Call 750. } 751. } 752. return bn_cmp_words(a, b, cl); ^ 753. } 754. crypto/bn/bn_lib.c:708:1: <Offset trace> 706. } 707. 708. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) 709. { 710. int i; crypto/bn/bn_lib.c:708:1: Parameter `n` 706. } 707. 708. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) 709. { 710. int i; crypto/bn/bn_lib.c:717:10: Assignment 715. if (aa != bb) 716. return ((aa > bb) ? 1 : -1); 717. for (i = n - 2; i >= 0; i--) { ^ 718. aa = a[i]; 719. bb = b[i]; crypto/bn/bn_lib.c:708:1: <Length trace> 706. } 707. 708. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) 709. { 710. int i; crypto/bn/bn_lib.c:708:1: Parameter `*b` 706. } 707. 708. > int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) 709. { 710. int i; crypto/bn/bn_lib.c:719:14: Array access: Offset: [8, +oo] (⇐ [8, +oo] + [0, +oo]) Size: [0, 8388607] by call to `BN_mod_exp` 717. for (i = n - 2; i >= 0; i--) { 718. aa = a[i]; 719. bb = b[i]; ^ 720. if (aa != bb) 721. return ((aa > bb) ? 1 : -1);
https://github.com/openssl/openssl/blob/3f97052392cb10fca5309212bf720685262ad4a6/crypto/bn/bn_lib.c/#L719
d2a_code_trace_data_43763
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/ec/ecp_smpl.c:1033: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_add_quick`. Showing all 18 steps of the trace crypto/ec/ecp_smpl.c:976:10: Call 974. 975. BN_CTX_start(ctx); 976. rh = BN_CTX_get(ctx); ^ 977. tmp = BN_CTX_get(ctx); 978. Z4 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:366:15: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/bn/bn_lib.c:366:5: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/ec/ecp_smpl.c:1033:14: Call 1031. 1032. /* rh := (rh + a)*X */ 1033. if (!BN_mod_add_quick(rh, rh, group->a, p)) ^ 1034. goto err; 1035. if (!field_mul(group, rh, rh, point->X, ctx)) crypto/bn/bn_mod.c:94:1: Parameter `*r->d` 92. } 93. 94. > int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 95. const BIGNUM *m) 96. { crypto/bn/bn_mod.c:97:15: Call 95. const BIGNUM *m) 96. { 97. int ret = bn_mod_add_fixed_top(r, a, b, m); ^ 98. 99. if (ret) crypto/bn/bn_mod.c:48:1: Parameter `*r->d` 46. * move depending on whether or not subtraction borrowed. 47. */ 48. > int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 49. const BIGNUM *m) 50. { crypto/bn/bn_mod.c:56:9: Call 54. const BN_ULONG *ap, *bp; 55. 56. if (bn_wexpand(r, mtop) == NULL) ^ 57. return 0; 58. crypto/bn/bn_lib.c:948:1: Parameter `*a->d` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:245:1: Parameter `*b->d` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `*b->d` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_add_quick` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/793f19e47c69558e39c702da75c27e0509baf379/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_43764
static inline unsigned int constant_time_is_zero(unsigned int a) { return constant_time_msb(~a & (a - 1)); } crypto/constant_time_locl.h:157: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero`. Showing all 5 steps of the trace crypto/constant_time_locl.h:155:1: Parameter `a` 153. } 154. 155. > static inline unsigned int constant_time_eq(unsigned int a, unsigned int b) 156. { 157. return constant_time_is_zero(a ^ b); crypto/constant_time_locl.h:157:9: Call 155. static inline unsigned int constant_time_eq(unsigned int a, unsigned int b) 156. { 157. return constant_time_is_zero(a ^ b); ^ 158. } 159. crypto/constant_time_locl.h:145:1: <LHS trace> 143. } 144. 145. > static inline unsigned int constant_time_is_zero(unsigned int a) 146. { 147. return constant_time_msb(~a & (a - 1)); crypto/constant_time_locl.h:145:1: Parameter `a` 143. } 144. 145. > static inline unsigned int constant_time_is_zero(unsigned int a) 146. { 147. return constant_time_msb(~a & (a - 1)); crypto/constant_time_locl.h:147:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `constant_time_is_zero` 145. static inline unsigned int constant_time_is_zero(unsigned int a) 146. { 147. return constant_time_msb(~a & (a - 1)); ^ 148. } 149.
https://github.com/openssl/openssl/blob/360928b7d0f16dde70e26841bbf9e1af727e8b8f/crypto/constant_time_locl.h/#L147
d2a_code_trace_data_43765
static int ssl_cipher_process_rulestr(const char *rule_str, CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p, const SSL_CIPHER **ca_list, CERT *c) { unsigned long alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, algo_strength; const char *l, *buf; int j, multi, found, rule, retval, ok, buflen; unsigned long cipher_id = 0; char ch; retval = 1; l = rule_str; for (;;) { ch = *l; if (ch == '\0') break; if (ch == '-') { rule = CIPHER_DEL; l++; } else if (ch == '+') { rule = CIPHER_ORD; l++; } else if (ch == '!') { rule = CIPHER_KILL; l++; } else if (ch == '@') { rule = CIPHER_SPECIAL; l++; } else { rule = CIPHER_ADD; } if (ITEM_SEP(ch)) { l++; continue; } alg_mkey = 0; alg_auth = 0; alg_enc = 0; alg_mac = 0; alg_ssl = 0; algo_strength = 0; for (;;) { ch = *l; buf = l; buflen = 0; #ifndef CHARSET_EBCDIC while ( ((ch >= 'A') && (ch <= 'Z')) || ((ch >= '0') && (ch <= '9')) || ((ch >= 'a') && (ch <= 'z')) || (ch == '-') || (ch == '.') || (ch == '=')) #else while ( isalnum(ch) || (ch == '-') || (ch == '.') || (ch == '=')) #endif { ch = *(++l); buflen++; } if (buflen == 0) { SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR, SSL_R_INVALID_COMMAND); retval = found = 0; l++; break; } if (rule == CIPHER_SPECIAL) { found = 0; break; } if (ch == '+') { multi=1; l++; } else multi=0; j = found = 0; cipher_id = 0; while (ca_list[j]) { if (!strncmp(buf, ca_list[j]->name, buflen) && (ca_list[j]->name[buflen] == '\0')) { found = 1; break; } else j++; } if (!found) break; if (ca_list[j]->algorithm_mkey) { if (alg_mkey) { alg_mkey &= ca_list[j]->algorithm_mkey; if (!alg_mkey) { found = 0; break; } } else alg_mkey = ca_list[j]->algorithm_mkey; } if (ca_list[j]->algorithm_auth) { if (alg_auth) { alg_auth &= ca_list[j]->algorithm_auth; if (!alg_auth) { found = 0; break; } } else alg_auth = ca_list[j]->algorithm_auth; } if (ca_list[j]->algorithm_enc) { if (alg_enc) { alg_enc &= ca_list[j]->algorithm_enc; if (!alg_enc) { found = 0; break; } } else alg_enc = ca_list[j]->algorithm_enc; } if (ca_list[j]->algorithm_mac) { if (alg_mac) { alg_mac &= ca_list[j]->algorithm_mac; if (!alg_mac) { found = 0; break; } } else alg_mac = ca_list[j]->algorithm_mac; } if (ca_list[j]->algo_strength & SSL_EXP_MASK) { if (algo_strength & SSL_EXP_MASK) { algo_strength &= (ca_list[j]->algo_strength & SSL_EXP_MASK) | ~SSL_EXP_MASK; if (!(algo_strength & SSL_EXP_MASK)) { found = 0; break; } } else algo_strength |= ca_list[j]->algo_strength & SSL_EXP_MASK; } if (ca_list[j]->algo_strength & SSL_STRONG_MASK) { if (algo_strength & SSL_STRONG_MASK) { algo_strength &= (ca_list[j]->algo_strength & SSL_STRONG_MASK) | ~SSL_STRONG_MASK; if (!(algo_strength & SSL_STRONG_MASK)) { found = 0; break; } } else algo_strength |= ca_list[j]->algo_strength & SSL_STRONG_MASK; } if (ca_list[j]->valid) { cipher_id = ca_list[j]->id; } else { if (ca_list[j]->algorithm_ssl) { if (alg_ssl) { alg_ssl &= ca_list[j]->algorithm_ssl; if (!alg_ssl) { found = 0; break; } } else alg_ssl = ca_list[j]->algorithm_ssl; } } if (!multi) break; } if (rule == CIPHER_SPECIAL) { ok = 0; if ((buflen == 8) && !strncmp(buf, "STRENGTH", 8)) ok = ssl_cipher_strength_sort(head_p, tail_p); else if (buflen == 10 && !strncmp(buf, "SECLEVEL=", 9)) { int level = buf[9] - '0'; if (level < 0 || level > 5) { SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR, SSL_R_INVALID_COMMAND); } else { c->sec_level = level; ok = 1; } } else SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR, SSL_R_INVALID_COMMAND); if (ok == 0) retval = 0; while ((*l != '\0') && !ITEM_SEP(*l)) l++; } else if (found) { ssl_cipher_apply_rule(cipher_id, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, algo_strength, rule, -1, head_p, tail_p); } else { while ((*l != '\0') && !ITEM_SEP(*l)) l++; } if (*l == '\0') break; } return(retval); } ssl/ssl_lib.c:2069: error: BUFFER_OVERRUN_L3 Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: [6, 25] by call to `ssl_create_cipher_list`. Showing all 12 steps of the trace ssl/ssl_lib.c:2071:3: Array declaration 2069. ssl_create_cipher_list(ret->method, 2070. &ret->cipher_list,&ret->cipher_list_by_id, 2071. meth->version == SSL2_VERSION ? "SSLv2" : SSL_DEFAULT_CIPHER_LIST, ret->cert); ^ 2072. if (ret->cipher_list == NULL 2073. || sk_SSL_CIPHER_num(ret->cipher_list) <= 0) ssl/ssl_lib.c:2069:2: Call 2067. if (ret->cert_store == NULL) goto err; 2068. 2069. ssl_create_cipher_list(ret->method, ^ 2070. &ret->cipher_list,&ret->cipher_list_by_id, 2071. meth->version == SSL2_VERSION ? "SSLv2" : SSL_DEFAULT_CIPHER_LIST, ret->cert); ssl/ssl_ciph.c:1460:1: Parameter `*rule_str` 1458. #endif 1459. 1460. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, 1461. STACK_OF(SSL_CIPHER) **cipher_list, 1462. STACK_OF(SSL_CIPHER) **cipher_list_by_id, ssl/ssl_ciph.c:1478:7: Call 1476. return NULL; 1477. #ifndef OPENSSL_NO_EC 1478. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str)) ^ 1479. return NULL; 1480. #endif ssl/ssl_ciph.c:1400:1: Parameter `**prule_str` 1398. } 1399. #ifndef OPENSSL_NO_EC 1400. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c, 1401. const char **prule_str) 1402. { ssl/ssl_ciph.c:1577:2: Assignment 1575. */ 1576. ok = 1; 1577. rule_p = rule_str; ^ 1578. if (strncmp(rule_str,"DEFAULT",7) == 0) 1579. { ssl/ssl_ciph.c:1588:8: Call 1586. 1587. if (ok && (strlen(rule_p) > 0)) 1588. ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c); ^ 1589. 1590. OPENSSL_free((void *)ca_list); /* Not needed anymore */ ssl/ssl_ciph.c:1134:1: <Length trace> 1132. } 1133. 1134. > static int ssl_cipher_process_rulestr(const char *rule_str, 1135. CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p, 1136. const SSL_CIPHER **ca_list, CERT *c) ssl/ssl_ciph.c:1134:1: Parameter `*rule_str` 1132. } 1133. 1134. > static int ssl_cipher_process_rulestr(const char *rule_str, 1135. CIPHER_ORDER **head_p, CIPHER_ORDER **tail_p, 1136. const SSL_CIPHER **ca_list, CERT *c) ssl/ssl_ciph.c:1145:2: Assignment 1143. 1144. retval = 1; 1145. l = rule_str; ^ 1146. for (;;) 1147. { ssl/ssl_ciph.c:1179:4: Assignment 1177. { 1178. ch = *l; 1179. buf = l; ^ 1180. buflen = 0; 1181. #ifndef CHARSET_EBCDIC ssl/ssl_ciph.c:1357:17: Array access: Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: [6, 25] by call to `ssl_create_cipher_list` 1355. else if (buflen == 10 && !strncmp(buf, "SECLEVEL=", 9)) 1356. { 1357. int level = buf[9] - '0'; ^ 1358. if (level < 0 || level > 5) 1359. {
https://github.com/openssl/openssl/blob/dbb7654dc189992966ecd95ca66f7a3bb011ab9b/ssl/ssl_ciph.c/#L1357
d2a_code_trace_data_43766
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) { bn_check_top(b); if (a == b) return a; if (bn_wexpand(a, b->top) == NULL) return NULL; if (b->top > 0) memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); a->neg = b->neg; a->top = b->top; a->flags |= b->flags & BN_FLG_FIXED_TOP; bn_check_top(a); return a; } crypto/bn/bn_exp.c:210: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_nnmod`. Showing all 19 steps of the trace crypto/bn/bn_exp.c:161:1: Parameter `m->top` 159. } 160. 161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 162. const BIGNUM *m, BN_CTX *ctx) 163. { crypto/bn/bn_exp.c:200:14: Call 198. if (m->neg) { 199. /* ignore sign of 'm' */ 200. if (!BN_copy(aa, m)) ^ 201. goto err; 202. aa->neg = 0; crypto/bn/bn_lib.c:281:1: Parameter `b->top` 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); 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 `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:209:1: Parameter `divisor->top` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:214:9: Call 212. int ret; 213. 214. if (BN_is_zero(divisor)) { ^ 215. BNerr(BN_F_BN_DIV, BN_R_DIV_BY_ZERO); 216. return 0; crypto/bn/bn_lib.c:864:1: Parameter `a->top` 862. } 863. 864. > int BN_is_zero(const BIGNUM *a) 865. { 866. return a->top == 0; crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:264:1: Parameter `divisor->top` 262. * divisor's length is considered public; 263. */ 264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 265. const BIGNUM *divisor, BN_CTX *ctx) 266. { crypto/bn/bn_div.c:289:10: Call 287. 288. /* First we normalise the numbers */ 289. if (!BN_copy(sdiv, divisor)) ^ 290. goto err; 291. norm_shift = bn_left_align(sdiv); crypto/bn/bn_lib.c:281:1: <Offset trace> 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: Parameter `b->top` 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: <Length trace> 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:281:1: Parameter `*a->d` 279. } 280. 281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 282. { 283. bn_check_top(b); crypto/bn/bn_lib.c:287:9: Call 285. if (a == b) 286. return a; 287. if (bn_wexpand(a, b->top) == NULL) ^ 288. return NULL; 289. crypto/bn/bn_lib.c:960:1: Parameter `*a->d` 958. } 959. 960. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 961. { 962. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:291:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_nnmod` 289. 290. if (b->top > 0) 291. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top); ^ 292. 293. a->neg = b->neg;
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L291
d2a_code_trace_data_43767
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } test/ectest.c:1890: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_GF2m_add`. Showing all 19 steps of the trace test/ectest.c:1890:14: Call 1888. if (type == NID_X9_62_characteristic_two_field) { 1889. /* test for binary curves */ 1890. if (!TEST_true(BN_GF2m_add(x, x, field))) ^ 1891. goto err; 1892. } else crypto/bn/bn_gf2m.c:252:1: Parameter `r->top` 250. * could be equal; r is the bitwise XOR of a and b. 251. */ 252. > int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 253. { 254. int i; crypto/bn/bn_gf2m.c:268:9: Call 266. } 267. 268. if (bn_wexpand(r, at->top) == NULL) ^ 269. return 0; 270. crypto/bn/bn_lib.c:962:1: Parameter `a->top` 960. } 961. 962. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:964:37: Call 962. BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 965. } 966. crypto/bn/bn_lib.c:245:1: Parameter `b->top` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `words` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:224:13: Call 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/mem.c:228:1: Parameter `num` 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:17: Call 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/mem.c:230:5: Assignment 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:235:5: Assignment 233. if (ret != NULL) 234. memset(ret, 0, num); 235. return ret; ^ 236. } 237. crypto/bn/bn_lib.c:224:9: Assignment 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_GF2m_add` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/260a16f33682a819414fcba6161708a5e6bdff50/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_43768
int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) { int i, level = 1; ossl_uintmax_t n = posn; void **p; if (sa == NULL) return 0; for (level = 1; level < SA_BLOCK_MAX_LEVELS; level++) if ((n >>= OPENSSL_SA_BLOCK_BITS) == 0) break; for (;sa->levels < level; sa->levels++) { p = alloc_node(); if (p == NULL) return 0; p[0] = sa->nodes; sa->nodes = p; } if (sa->top < posn) sa->top = posn; p = sa->nodes; for (level = sa->levels - 1; level > 0; level--) { i = (posn >> (OPENSSL_SA_BLOCK_BITS * level)) & SA_BLOCK_MASK; if (p[i] == NULL && (p[i] = alloc_node()) == NULL) return 0; p = p[i]; } p += posn & SA_BLOCK_MASK; if (val == NULL && *p != NULL) sa->nelem--; else if (val != NULL && *p == NULL) sa->nelem++; *p = val; return 1; } test/sparse_array_test.c:138: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `ossl_sa_char_set`. Showing all 6 steps of the trace test/sparse_array_test.c:138:13: Call 136. if (n == cases[i].n && strcmp(value, cases[i].v) == 0) { 137. doall_data->res = 1; 138. ossl_sa_char_set(doall_data->sa, n, NULL); ^ 139. return; 140. } test/sparse_array_test.c:28:1: Parameter `sa->nelem` 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) test/sparse_array_test.c:28:1: Call 26. #endif 27. 28. > DEFINE_SPARSE_ARRAY_OF(char); 29. 30. static int test_sparse_array(void) crypto/sparse_array.c:183:1: <LHS trace> 181. } 182. 183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) 184. { 185. int i, level = 1; crypto/sparse_array.c:183:1: Parameter `sa->nelem` 181. } 182. 183. > int OPENSSL_SA_set(OPENSSL_SA *sa, ossl_uintmax_t posn, void *val) 184. { 185. int i, level = 1; crypto/sparse_array.c:215:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ossl_sa_char_set` 213. p += posn & SA_BLOCK_MASK; 214. if (val == NULL && *p != NULL) 215. sa->nelem--; ^ 216. else if (val != NULL && *p == NULL) 217. sa->nelem++;
https://github.com/openssl/openssl/blob/8ab53b193a8e95bb2998744bc184146eb1ddcc23/crypto/sparse_array.c/#L215
d2a_code_trace_data_43769
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/bn/bn_gcd.c:437: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_nnmod`. Showing all 32 steps of the trace 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:161:5: Call 159. bn_check_top(n); 160. 161. BN_CTX_start(ctx); ^ 162. A = BN_CTX_get(ctx); 163. 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:162:9: Call 160. 161. BN_CTX_start(ctx); 162. A = BN_CTX_get(ctx); ^ 163. B = BN_CTX_get(ctx); 164. 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:163:9: Call 161. BN_CTX_start(ctx); 162. A = BN_CTX_get(ctx); 163. B = BN_CTX_get(ctx); ^ 164. X = BN_CTX_get(ctx); 165. 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:164:9: Call 162. A = BN_CTX_get(ctx); 163. B = BN_CTX_get(ctx); 164. X = BN_CTX_get(ctx); ^ 165. D = BN_CTX_get(ctx); 166. 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:165:9: Call 163. B = BN_CTX_get(ctx); 164. X = BN_CTX_get(ctx); 165. D = BN_CTX_get(ctx); ^ 166. M = BN_CTX_get(ctx); 167. 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:166:9: Call 164. X = BN_CTX_get(ctx); 165. D = BN_CTX_get(ctx); 166. M = BN_CTX_get(ctx); ^ 167. Y = BN_CTX_get(ctx); 168. 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:167:9: Call 165. D = BN_CTX_get(ctx); 166. M = BN_CTX_get(ctx); 167. Y = BN_CTX_get(ctx); ^ 168. T = BN_CTX_get(ctx); 169. 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:168:9: Call 166. M = BN_CTX_get(ctx); 167. Y = BN_CTX_get(ctx); 168. T = BN_CTX_get(ctx); ^ 169. if (T == NULL) 170. 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:437:18: Call 435. goto err; 436. } else { 437. if (!BN_nnmod(R, Y, n, ctx)) ^ 438. goto err; 439. } crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:280:5: Call 278. bn_check_top(rm); 279. 280. BN_CTX_start(ctx); ^ 281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 282. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_div.c:450:5: Call 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); 450. BN_CTX_end(ctx); ^ 451. return 1; 452. err: crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_nnmod` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43770
static int epzs_motion_search4(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d, dmin; int map_generation; const int penalty_factor= c->penalty_factor; const int size=1; const int h=8; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON int flags= c->flags; LOAD_COMMON2 cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; map_generation= update_map_generation(c); dmin = 1000000; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) }else{ CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) } if(dmin>64*4){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1162: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1162:9: 1160. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, 1161. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1162. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) ^ 1163. }else{ 1164. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1162
d2a_code_trace_data_43771
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); } crypto/x509v3/v3_scts.c:161: error: BUFFER_OVERRUN_L3 Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print`. Showing all 11 steps of the trace crypto/x509v3/v3_scts.c:151:5: Call 149. char genstr[20]; 150. gen = ASN1_GENERALIZEDTIME_new(); 151. ASN1_GENERALIZEDTIME_adj(gen, (time_t)0, ^ 152. (int)(timestamp / 86400000), 153. (timestamp % 86400000) / 1000); crypto/asn1/a_gentm.c:216:1: Parameter `*s->data` 214. } 215. 216. > ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, 217. time_t t, int offset_day, 218. long offset_sec) crypto/x509v3/v3_scts.c:160:5: Call 158. BIO_snprintf(genstr, sizeof(genstr), "%.14s.%03dZ", 159. ASN1_STRING_data(gen), (unsigned int)(timestamp % 1000)); 160. ASN1_GENERALIZEDTIME_set_string(gen, genstr); ^ 161. ASN1_GENERALIZEDTIME_print(out, gen); 162. ASN1_GENERALIZEDTIME_free(gen); crypto/asn1/a_gentm.c:191:1: Parameter `*s->data` 189. } 190. 191. > int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) 192. { 193. ASN1_GENERALIZEDTIME t; crypto/x509v3/v3_scts.c:161:5: Call 159. ASN1_STRING_data(gen), (unsigned int)(timestamp % 1000)); 160. ASN1_GENERALIZEDTIME_set_string(gen, genstr); 161. ASN1_GENERALIZEDTIME_print(out, gen); ^ 162. ASN1_GENERALIZEDTIME_free(gen); 163. } crypto/asn1/a_gentm.c:266:1: <Offset trace> 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:266:1: Parameter `*tm->data` 264. }; 265. 266. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm) 267. { 268. char *v; crypto/asn1/a_gentm.c:287:5: Assignment 285. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100 286. + (v[2] - '0') * 10 + (v[3] - '0'); 287. M = (v[4] - '0') * 10 + (v[5] - '0'); ^ 288. if ((M > 12) || (M < 1)) 289. goto err; crypto/asn1/a_gentm.c:261:1: <Length trace> 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:261:1: Array declaration 259. } 260. 261. > const char *_asn1_mon[12] = { 262. "Jan", "Feb", "Mar", "Apr", "May", "Jun", 263. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" crypto/asn1/a_gentm.c:308:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print` 306. 307. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s", 308. _asn1_mon[M - 1], d, h, m, s, f_len, f, y, ^ 309. (gmt) ? " GMT" : "") <= 0) 310. return (0);
https://github.com/openssl/openssl/blob/01b7851aa27aa144372f5484da916be042d9aa4f/crypto/asn1/a_gentm.c/#L308
d2a_code_trace_data_43772
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/extensions_clnt.c:354: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 6]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 14 steps of the trace ssl/statem/extensions_clnt.c:353:17: Call 351. TLSEXT_TYPE_application_layer_protocol_negotiation) 352. /* Sub-packet ALPN extension */ 353. || !WPACKET_start_sub_packet_u16(pkt) ^ 354. || !WPACKET_sub_memcpy_u16(pkt, s->ext.alpn, s->ext.alpn_len) 355. || !WPACKET_close(pkt)) { ssl/packet.c:252:1: Parameter `pkt->buf->length` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/statem/extensions_clnt.c:354:17: Call 352. /* Sub-packet ALPN extension */ 353. || !WPACKET_start_sub_packet_u16(pkt) 354. || !WPACKET_sub_memcpy_u16(pkt, s->ext.alpn, s->ext.alpn_len) ^ 355. || !WPACKET_close(pkt)) { 356. SSLerr(SSL_F_TLS_CONSTRUCT_CTOS_ALPN, ERR_R_INTERNAL_ERROR); ssl/packet.c:345:1: Parameter `pkt->written` 343. } 344. 345. > int WPACKET_sub_memcpy__(WPACKET *pkt, const void *src, size_t len, 346. size_t lenbytes) 347. { ssl/packet.c:348:10: Call 346. size_t lenbytes) 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 349. || !WPACKET_memcpy(pkt, src, len) 350. || !WPACKET_close(pkt)) ssl/packet.c:252:1: Parameter `pkt->written` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/packet.c:276:10: Call 274. } 275. 276. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars)) ^ 277. return 0; 278. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */ ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 6]):unsigned64 by call to `WPACKET_sub_memcpy__` 47. return 0; 48. 49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 50. size_t newlen; 51. size_t reflen;
https://github.com/openssl/openssl/blob/f61c5ca6ca183bf0a51651857e3efb02a98889ad/ssl/packet.c/#L49
d2a_code_trace_data_43773
static int cook_decode_init(AVCodecContext *avctx) { COOKContext *q = avctx->priv_data; const uint8_t *edata_ptr = avctx->extradata; if (avctx->extradata_size <= 0) { av_log(avctx,AV_LOG_ERROR,"Necessary extradata missing!\n"); return -1; } else { av_log(avctx,AV_LOG_DEBUG,"codecdata_length=%d\n",avctx->extradata_size); if (avctx->extradata_size >= 8){ q->cookversion = bytestream_get_be32(&edata_ptr); q->samples_per_frame = bytestream_get_be16(&edata_ptr); q->subbands = bytestream_get_be16(&edata_ptr); } if (avctx->extradata_size >= 16){ bytestream_get_be32(&edata_ptr); q->js_subband_start = bytestream_get_be16(&edata_ptr); q->js_vlc_bits = bytestream_get_be16(&edata_ptr); } } q->sample_rate = avctx->sample_rate; q->nb_channels = avctx->channels; q->bit_rate = avctx->bit_rate; av_init_random(1, &q->random_state); q->samples_per_channel = q->samples_per_frame / q->nb_channels; q->bits_per_subpacket = avctx->block_align * 8; q->log2_numvector_size = 5; q->total_subbands = q->subbands; av_log(NULL,AV_LOG_DEBUG,"q->cookversion=%x\n",q->cookversion); q->joint_stereo = 0; switch (q->cookversion) { case MONO: if (q->nb_channels != 1) { av_log(avctx,AV_LOG_ERROR,"Container channels != 1, report sample!\n"); return -1; } av_log(avctx,AV_LOG_DEBUG,"MONO\n"); break; case STEREO: if (q->nb_channels != 1) { q->bits_per_subpacket = q->bits_per_subpacket/2; } av_log(avctx,AV_LOG_DEBUG,"STEREO\n"); break; case JOINT_STEREO: if (q->nb_channels != 2) { av_log(avctx,AV_LOG_ERROR,"Container channels != 2, report sample!\n"); return -1; } av_log(avctx,AV_LOG_DEBUG,"JOINT_STEREO\n"); if (avctx->extradata_size >= 16){ q->total_subbands = q->subbands + q->js_subband_start; q->joint_stereo = 1; } if (q->samples_per_channel > 256) { q->log2_numvector_size = 6; } if (q->samples_per_channel > 512) { q->log2_numvector_size = 7; } break; case MC_COOK: av_log(avctx,AV_LOG_ERROR,"MC_COOK not supported!\n"); return -1; break; default: av_log(avctx,AV_LOG_ERROR,"Unknown Cook version, report sample!\n"); return -1; break; } q->numvector_size = (1 << q->log2_numvector_size); init_rootpow2table(q); init_pow2table(q); init_gain_table(q); init_cplscales_table(q); if (init_cook_vlc_tables(q) != 0) return -1; if(avctx->block_align >= UINT_MAX/2) return -1; if (q->nb_channels==2 && q->joint_stereo==0) { q->decoded_bytes_buffer = av_mallocz(avctx->block_align/2 + DECODE_BYTES_PAD2(avctx->block_align/2) + FF_INPUT_BUFFER_PADDING_SIZE); } else { q->decoded_bytes_buffer = av_mallocz(avctx->block_align + DECODE_BYTES_PAD1(avctx->block_align) + FF_INPUT_BUFFER_PADDING_SIZE); } if (q->decoded_bytes_buffer == NULL) return -1; q->gains1.now = q->gain_1; q->gains1.previous = q->gain_2; q->gains2.now = q->gain_3; q->gains2.previous = q->gain_4; if ( init_cook_mlt(q) != 0 ) return -1; if (1) { q->scalar_dequant = scalar_dequant_float; q->decouple = decouple_float; q->imlt_window = imlt_window_float; q->interpolate = interpolate_float; q->saturate_output = saturate_output_float; } if (q->total_subbands > 53) { av_log(avctx,AV_LOG_ERROR,"total_subbands > 53, report sample!\n"); return -1; } if (q->subbands > 50) { av_log(avctx,AV_LOG_ERROR,"subbands > 50, report sample!\n"); return -1; } if ((q->samples_per_channel == 256) || (q->samples_per_channel == 512) || (q->samples_per_channel == 1024)) { } else { av_log(avctx,AV_LOG_ERROR,"unknown amount of samples_per_channel = %d, report sample!\n",q->samples_per_channel); return -1; } if ((q->js_vlc_bits > 6) || (q->js_vlc_bits < 0)) { av_log(avctx,AV_LOG_ERROR,"q->js_vlc_bits = %d, only >= 0 and <= 6 allowed!\n",q->js_vlc_bits); return -1; } #ifdef COOKDEBUG dump_cook_context(q); #endif return 0; } libavcodec/cook.c:1144: error: Integer Overflow L2 ([-oo, 2147483646] + 3):signed32. libavcodec/cook.c:1038:1: <LHS trace> 1036. */ 1037. 1038. static int cook_decode_init(AVCodecContext *avctx) ^ 1039. { 1040. COOKContext *q = avctx->priv_data; libavcodec/cook.c:1038:1: Parameter `avctx->block_align` 1036. */ 1037. 1038. static int cook_decode_init(AVCodecContext *avctx) ^ 1039. { 1040. COOKContext *q = avctx->priv_data; libavcodec/cook.c:1144:11: Binary operation: ([-oo, 2147483646] + 3):signed32 1142. if (q->nb_channels==2 && q->joint_stereo==0) { 1143. q->decoded_bytes_buffer = 1144. av_mallocz(avctx->block_align/2 ^ 1145. + DECODE_BYTES_PAD2(avctx->block_align/2) 1146. + FF_INPUT_BUFFER_PADDING_SIZE);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/cook.c/#L1144
d2a_code_trace_data_43774
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } test/bntest.c:1950: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mul`. Showing all 12 steps of the trace test/bntest.c:1920:1: Parameter `ctx->stack.depth` 1918. } 1919. 1920. > int test_lshift(BIO *bp, BN_CTX *ctx, BIGNUM *a_) 1921. { 1922. BIGNUM *a, *b, *c, *d; test/bntest.c:1950:9: Call 1948. BIO_puts(bp, "\n"); 1949. } 1950. BN_mul(d, a, c, ctx); ^ 1951. BN_sub(d, d, b); 1952. if (!BN_is_zero(d)) { crypto/bn/bn_mul.c:854:5: Call 852. top = al + bl; 853. 854. BN_CTX_start(ctx); ^ 855. if ((r == a) || (r == b)) { 856. if ((rr = BN_CTX_get(ctx)) == NULL) 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_mul.c:979:5: Call 977. err: 978. bn_check_top(r); 979. BN_CTX_end(ctx); ^ 980. return (ret); 981. } 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_mul` 271. static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; ^ 274. } 275.
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_43775
static int mp_decode_layer3(MPADecodeContext *s) { int nb_granules, main_data_begin, private_bits; int gr, ch, blocksplit_flag, i, j, k, n, bits_pos; GranuleDef granules[2][2], *g; int16_t exponents[576]; if (s->lsf) { main_data_begin = get_bits(&s->gb, 8); private_bits = get_bits(&s->gb, s->nb_channels); nb_granules = 1; } else { main_data_begin = get_bits(&s->gb, 9); if (s->nb_channels == 2) private_bits = get_bits(&s->gb, 3); else private_bits = get_bits(&s->gb, 5); nb_granules = 2; for(ch=0;ch<s->nb_channels;ch++) { granules[ch][0].scfsi = 0; granules[ch][1].scfsi = get_bits(&s->gb, 4); } } for(gr=0;gr<nb_granules;gr++) { for(ch=0;ch<s->nb_channels;ch++) { dprintf(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch); g = &granules[ch][gr]; g->part2_3_length = get_bits(&s->gb, 12); g->big_values = get_bits(&s->gb, 9); if(g->big_values > 288){ av_log(s->avctx, AV_LOG_ERROR, "big_values too big\n"); return -1; } g->global_gain = get_bits(&s->gb, 8); if ((s->mode_ext & (MODE_EXT_MS_STEREO | MODE_EXT_I_STEREO)) == MODE_EXT_MS_STEREO) g->global_gain -= 2; if (s->lsf) g->scalefac_compress = get_bits(&s->gb, 9); else g->scalefac_compress = get_bits(&s->gb, 4); blocksplit_flag = get_bits1(&s->gb); if (blocksplit_flag) { g->block_type = get_bits(&s->gb, 2); if (g->block_type == 0){ av_log(NULL, AV_LOG_ERROR, "invalid block type\n"); return -1; } g->switch_point = get_bits1(&s->gb); for(i=0;i<2;i++) g->table_select[i] = get_bits(&s->gb, 5); for(i=0;i<3;i++) g->subblock_gain[i] = get_bits(&s->gb, 3); ff_init_short_region(s, g); } else { int region_address1, region_address2; g->block_type = 0; g->switch_point = 0; for(i=0;i<3;i++) g->table_select[i] = get_bits(&s->gb, 5); region_address1 = get_bits(&s->gb, 4); region_address2 = get_bits(&s->gb, 3); dprintf(s->avctx, "region1=%d region2=%d\n", region_address1, region_address2); ff_init_long_region(s, g, region_address1, region_address2); } ff_region_offset2size(g); ff_compute_band_indexes(s, g); g->preflag = 0; if (!s->lsf) g->preflag = get_bits1(&s->gb); g->scalefac_scale = get_bits1(&s->gb); g->count1table_select = get_bits1(&s->gb); dprintf(s->avctx, "block_type=%d switch_point=%d\n", g->block_type, g->switch_point); } } if (!s->adu_mode) { const uint8_t *ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3); assert((get_bits_count(&s->gb) & 7) == 0); dprintf(s->avctx, "seekback: %d\n", main_data_begin); memcpy(s->last_buf + s->last_buf_size, ptr, EXTRABYTES); s->in_gb= s->gb; init_get_bits(&s->gb, s->last_buf, s->last_buf_size*8); skip_bits_long(&s->gb, 8*(s->last_buf_size - main_data_begin)); } for(gr=0;gr<nb_granules;gr++) { for(ch=0;ch<s->nb_channels;ch++) { g = &granules[ch][gr]; if(get_bits_count(&s->gb)<0){ av_log(NULL, AV_LOG_ERROR, "mdb:%d, lastbuf:%d skipping granule %d\n", main_data_begin, s->last_buf_size, gr); skip_bits_long(&s->gb, g->part2_3_length); memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid)); if(get_bits_count(&s->gb) >= s->gb.size_in_bits && s->in_gb.buffer){ skip_bits_long(&s->in_gb, get_bits_count(&s->gb) - s->gb.size_in_bits); s->gb= s->in_gb; s->in_gb.buffer=NULL; } continue; } bits_pos = get_bits_count(&s->gb); if (!s->lsf) { uint8_t *sc; int slen, slen1, slen2; slen1 = slen_table[0][g->scalefac_compress]; slen2 = slen_table[1][g->scalefac_compress]; dprintf(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2); if (g->block_type == 2) { n = g->switch_point ? 17 : 18; j = 0; if(slen1){ for(i=0;i<n;i++) g->scale_factors[j++] = get_bits(&s->gb, slen1); }else{ for(i=0;i<n;i++) g->scale_factors[j++] = 0; } if(slen2){ for(i=0;i<18;i++) g->scale_factors[j++] = get_bits(&s->gb, slen2); for(i=0;i<3;i++) g->scale_factors[j++] = 0; }else{ for(i=0;i<21;i++) g->scale_factors[j++] = 0; } } else { sc = granules[ch][0].scale_factors; j = 0; for(k=0;k<4;k++) { n = (k == 0 ? 6 : 5); if ((g->scfsi & (0x8 >> k)) == 0) { slen = (k < 2) ? slen1 : slen2; if(slen){ for(i=0;i<n;i++) g->scale_factors[j++] = get_bits(&s->gb, slen); }else{ for(i=0;i<n;i++) g->scale_factors[j++] = 0; } } else { for(i=0;i<n;i++) { g->scale_factors[j] = sc[j]; j++; } } } g->scale_factors[j++] = 0; } #if defined(DEBUG) { dprintf(s->avctx, "scfsi=%x gr=%d ch=%d scale_factors:\n", g->scfsi, gr, ch); for(i=0;i<j;i++) dprintf(s->avctx, " %d", g->scale_factors[i]); dprintf(s->avctx, "\n"); } #endif } else { int tindex, tindex2, slen[4], sl, sf; if (g->block_type == 2) { tindex = g->switch_point ? 2 : 1; } else { tindex = 0; } sf = g->scalefac_compress; if ((s->mode_ext & MODE_EXT_I_STEREO) && ch == 1) { sf >>= 1; if (sf < 180) { lsf_sf_expand(slen, sf, 6, 6, 0); tindex2 = 3; } else if (sf < 244) { lsf_sf_expand(slen, sf - 180, 4, 4, 0); tindex2 = 4; } else { lsf_sf_expand(slen, sf - 244, 3, 0, 0); tindex2 = 5; } } else { if (sf < 400) { lsf_sf_expand(slen, sf, 5, 4, 4); tindex2 = 0; } else if (sf < 500) { lsf_sf_expand(slen, sf - 400, 5, 4, 0); tindex2 = 1; } else { lsf_sf_expand(slen, sf - 500, 3, 0, 0); tindex2 = 2; g->preflag = 1; } } j = 0; for(k=0;k<4;k++) { n = lsf_nsf_table[tindex2][tindex][k]; sl = slen[k]; if(sl){ for(i=0;i<n;i++) g->scale_factors[j++] = get_bits(&s->gb, sl); }else{ for(i=0;i<n;i++) g->scale_factors[j++] = 0; } } for(;j<40;j++) g->scale_factors[j] = 0; #if defined(DEBUG) { dprintf(s->avctx, "gr=%d ch=%d scale_factors:\n", gr, ch); for(i=0;i<40;i++) dprintf(s->avctx, " %d", g->scale_factors[i]); dprintf(s->avctx, "\n"); } #endif } exponents_from_scale_factors(s, g, exponents); huffman_decode(s, g, exponents, bits_pos + g->part2_3_length); #if defined(DEBUG) sample_dump(0, g->sb_hybrid, 576); #endif } if (s->nb_channels == 2) compute_stereo(s, &granules[0][gr], &granules[1][gr]); for(ch=0;ch<s->nb_channels;ch++) { g = &granules[ch][gr]; reorder_block(s, g); #if defined(DEBUG) sample_dump(0, g->sb_hybrid, 576); #endif s->compute_antialias(s, g); #if defined(DEBUG) sample_dump(1, g->sb_hybrid, 576); #endif compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]); #if defined(DEBUG) sample_dump(2, &s->sb_samples[ch][18 * gr][0], 576); #endif } } if(get_bits_count(&s->gb)<0) skip_bits_long(&s->gb, -get_bits_count(&s->gb)); return nb_granules * 18; } libavcodec/mpegaudiodec.c:2120: error: Buffer Overrun L3 Offset added: 2304 Size: [0, +oo]. libavcodec/mpegaudiodec.c:2265:13: <Length trace> 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: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:1675:1: Parameter `g0->sb_hybrid[*]` 1673. #define ISQRT2 FIXR(0.70710678118654752440) 1674. 1675. static void compute_stereo(MPADecodeContext *s, ^ 1676. GranuleDef *g0, GranuleDef *g1) 1677. { libavcodec/mpegaudiodec.c:2120:17: Array access: Offset added: 2304 Size: [0, +oo] 2118. main_data_begin, s->last_buf_size, gr); 2119. skip_bits_long(&s->gb, g->part2_3_length); 2120. memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid)); ^ 2121. if(get_bits_count(&s->gb) >= s->gb.size_in_bits && s->in_gb.buffer){ 2122. skip_bits_long(&s->in_gb, get_bits_count(&s->gb) - s->gb.size_in_bits);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L2120
d2a_code_trace_data_43776
int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy) { int rv, start_idx, i; if (x == NULL) { x = sk_X509_value(sk, 0); start_idx = 1; } else start_idx = 0; rv = ssl_security_cert(s, NULL, x, vfy, 1); if (rv != 1) return rv; for (i = start_idx; i < sk_X509_num(sk); i++) { x = sk_X509_value(sk, i); rv = ssl_security_cert(s, NULL, x, vfy, 0); if (rv != 1) return rv; } return 1; } ssl/t1_lib.c:4396: error: NULL_DEREFERENCE pointer `null` is dereferenced by call to `ssl_security_cert()` at line 4396, column 10. Showing all 11 steps of the trace ssl/t1_lib.c:4387:1: start of procedure ssl_security_cert_chain() 4385. */ 4386. 4387. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy) 4388. { 4389. int rv, start_idx, i; ssl/t1_lib.c:4390:9: Taking true branch 4388. { 4389. int rv, start_idx, i; 4390. if (x == NULL) { ^ 4391. x = sk_X509_value(sk, 0); 4392. start_idx = 1; ssl/t1_lib.c:4391:9: 4389. int rv, start_idx, i; 4390. if (x == NULL) { 4391. > x = sk_X509_value(sk, 0); 4392. start_idx = 1; 4393. } else include/openssl/x509.h:97:1: start of procedure sk_X509_value() 95. typedef struct x509_cinf_st X509_CINF; 96. 97. > DEFINE_STACK_OF(X509) 98. 99. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:284:1: start of procedure OPENSSL_sk_value() 282. } 283. 284. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) 285. { 286. if (st == NULL || i < 0 || i >= st->num) crypto/stack/stack.c:286:9: Taking true branch 284. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) 285. { 286. if (st == NULL || i < 0 || i >= st->num) ^ 287. return NULL; 288. return (void *)st->data[i]; crypto/stack/stack.c:287:9: 285. { 286. if (st == NULL || i < 0 || i >= st->num) 287. > return NULL; 288. return (void *)st->data[i]; 289. } crypto/stack/stack.c:289:1: return from a call to OPENSSL_sk_value 287. return NULL; 288. return (void *)st->data[i]; 289. > } 290. 291. void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data) include/openssl/x509.h:97:1: return from a call to sk_X509_value 95. typedef struct x509_cinf_st X509_CINF; 96. 97. > DEFINE_STACK_OF(X509) 98. 99. /* This is used for a table of trust checking functions */ ssl/t1_lib.c:4392:9: 4390. if (x == NULL) { 4391. x = sk_X509_value(sk, 0); 4392. > start_idx = 1; 4393. } else 4394. start_idx = 0; ssl/t1_lib.c:4396:5: 4394. start_idx = 0; 4395. 4396. > rv = ssl_security_cert(s, NULL, x, vfy, 1); 4397. if (rv != 1) 4398. return rv;
https://github.com/openssl/openssl/blob/0d9824c1712b6cacd9b0ecfba26fb66ae4badfb4/ssl/t1_lib.c/#L4396
d2a_code_trace_data_43777
static LHASH_NODE **getrn(_LHASH *lh, const void *data, unsigned long *rhash) { LHASH_NODE **ret, *n1; unsigned long hash, nn; LHASH_COMP_FN_TYPE cf; hash = (*(lh->hash)) (data); lh->num_hash_calls++; *rhash = hash; nn = hash % lh->pmax; if (nn < lh->p) nn = hash % lh->num_alloc_nodes; cf = lh->comp; ret = &(lh->b[(int)nn]); for (n1 = *ret; n1 != NULL; n1 = n1->next) { lh->num_hash_comps++; if (n1->hash != hash) { ret = &(n1->next); continue; } lh->num_comp_calls++; if (cf(n1->data, data) == 0) break; ret = &(n1->next); } return (ret); } crypto/lhash/lhash.c:166: error: USE_AFTER_FREE call to `getrn()` eventually accesses memory that was invalidated by call to `free()` on line 164 indirectly during the call to `expand()`. Showing all 14 steps of the trace crypto/lhash/lhash.c:156:1: invalidation part of the trace starts here 154. } 155. 156. > void *lh_insert(_LHASH *lh, void *data) 157. { 158. unsigned long hash; crypto/lhash/lhash.c:156:1: parameter `lh` of lh_insert 154. } 155. 156. > void *lh_insert(_LHASH *lh, void *data) 157. { 158. unsigned long hash; crypto/lhash/lhash.c:164:9: when calling `expand` here 162. lh->error = 0; 163. if (lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) 164. expand(lh); ^ 165. 166. rn = getrn(lh, data, &hash); crypto/lhash/lhash.c:279:1: parameter `lh` of expand 277. } 278. 279. > static void expand(_LHASH *lh) 280. { 281. LHASH_NODE **n, **n1, **n2, *np; crypto/lhash/lhash.c:306:13: when calling `CRYPTO_realloc` here 304. if ((lh->p) >= lh->pmax) { 305. j = (int)lh->num_alloc_nodes * 2; 306. n = OPENSSL_realloc(lh->b, (int)(sizeof(LHASH_NODE *) * j)); ^ 307. if (n == NULL) { 308. /* fputs("realloc error in lhash",stderr); */ crypto/mem.c:166:1: parameter `str` of CRYPTO_realloc 164. } 165. 166. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) 167. { 168. if (str == NULL) crypto/mem.c:172:9: when calling `CRYPTO_free` here 170. 171. if (num == 0) { 172. CRYPTO_free(str); ^ 173. return NULL; 174. } crypto/mem.c:234:1: parameter `str` of CRYPTO_free 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: was invalidated by call to `free()` 243. } 244. #else 245. free(str); ^ 246. #endif 247. } crypto/lhash/lhash.c:156:1: use-after-lifetime part of the trace starts here 154. } 155. 156. > void *lh_insert(_LHASH *lh, void *data) 157. { 158. unsigned long hash; crypto/lhash/lhash.c:156:1: parameter `lh` of lh_insert 154. } 155. 156. > void *lh_insert(_LHASH *lh, void *data) 157. { 158. unsigned long hash; crypto/lhash/lhash.c:166:10: when calling `getrn` here 164. expand(lh); 165. 166. rn = getrn(lh, data, &hash); ^ 167. 168. if (*rn == NULL) { crypto/lhash/lhash.c:358:1: parameter `lh` of getrn 356. } 357. 358. > static LHASH_NODE **getrn(_LHASH *lh, const void *data, unsigned long *rhash) 359. { 360. LHASH_NODE **ret, *n1; crypto/lhash/lhash.c:373:5: invalid access occurs here 371. 372. cf = lh->comp; 373. ret = &(lh->b[(int)nn]); ^ 374. for (n1 = *ret; n1 != NULL; n1 = n1->next) { 375. lh->num_hash_comps++;
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/lhash/lhash.c/#L373
d2a_code_trace_data_43778
static inline void pred_direct_motion(H264Context * const h, int *mb_type){ MpegEncContext * const s = &h->s; const int mb_xy = s->mb_x + s->mb_y*s->mb_stride; const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride; const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy]; const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy]; const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy]; const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy]; const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy]; const int is_b8x8 = IS_8X8(*mb_type); unsigned int sub_mb_type; int i8, i4; #define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM) if(IS_8X8(mb_type_col) && !h->sps.direct_8x8_inference_flag){ sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1; }else if(!is_b8x8 && (mb_type_col & MB_TYPE_16x16_OR_INTRA)){ sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; }else{ sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1; } if(!is_b8x8) *mb_type |= MB_TYPE_DIRECT2; if(MB_FIELD) *mb_type |= MB_TYPE_INTERLACED; tprintf(s->avctx, "mb_type = %08x, sub_mb_type = %08x, is_b8x8 = %d, mb_type_col = %08x\n", *mb_type, sub_mb_type, is_b8x8, mb_type_col); if(h->direct_spatial_mv_pred){ int ref[2]; int mv[2][2]; int list; for(list=0; list<2; list++){ int refa = h->ref_cache[list][scan8[0] - 1]; int refb = h->ref_cache[list][scan8[0] - 8]; int refc = h->ref_cache[list][scan8[0] - 8 + 4]; if(refc == -2) refc = h->ref_cache[list][scan8[0] - 8 - 1]; ref[list] = refa; if(ref[list] < 0 || (refb < ref[list] && refb >= 0)) ref[list] = refb; if(ref[list] < 0 || (refc < ref[list] && refc >= 0)) ref[list] = refc; if(ref[list] < 0) ref[list] = -1; } if(ref[0] < 0 && ref[1] < 0){ ref[0] = ref[1] = 0; mv[0][0] = mv[0][1] = mv[1][0] = mv[1][1] = 0; }else{ for(list=0; list<2; list++){ if(ref[list] >= 0) pred_motion(h, 0, 4, list, ref[list], &mv[list][0], &mv[list][1]); else mv[list][0] = mv[list][1] = 0; } } if(ref[1] < 0){ if(!is_b8x8) *mb_type &= ~MB_TYPE_L1; sub_mb_type &= ~MB_TYPE_L1; }else if(ref[0] < 0){ if(!is_b8x8) *mb_type &= ~MB_TYPE_L0; sub_mb_type &= ~MB_TYPE_L0; } if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){ int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride; int mb_types_col[2]; int b8_stride = h->b8_stride; int b4_stride = h->b_stride; *mb_type = (*mb_type & ~MB_TYPE_16x16) | MB_TYPE_8x8; if(IS_INTERLACED(*mb_type)){ mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy]; mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; if(s->mb_y&1){ l1ref0 -= 2*b8_stride; l1ref1 -= 2*b8_stride; l1mv0 -= 4*b4_stride; l1mv1 -= 4*b4_stride; } b8_stride *= 3; b4_stride *= 6; }else{ int cur_poc = s->current_picture_ptr->poc; int *col_poc = h->ref_list[1]->field_poc; int col_parity = FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc); int dy = 2*col_parity - (s->mb_y&1); mb_types_col[0] = mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy + col_parity*s->mb_stride]; l1ref0 += dy*b8_stride; l1ref1 += dy*b8_stride; l1mv0 += 2*dy*b4_stride; l1mv1 += 2*dy*b4_stride; b8_stride = 0; } for(i8=0; i8<4; i8++){ int x8 = i8&1; int y8 = i8>>1; int xy8 = x8+y8*b8_stride; int xy4 = 3*x8+y8*b4_stride; int a=0, b=0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_types_col[y8]) && ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1) || (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){ if(ref[0] > 0) a= pack16to32(mv[0][0],mv[0][1]); if(ref[1] > 0) b= pack16to32(mv[1][0],mv[1][1]); }else{ a= pack16to32(mv[0][0],mv[0][1]); b= pack16to32(mv[1][0],mv[1][1]); } fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4); } }else if(IS_16X16(*mb_type)){ int a=0, b=0; fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_type_col) && ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1) || (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1 && (h->x264_build>33 || !h->x264_build)))){ if(ref[0] > 0) a= pack16to32(mv[0][0],mv[0][1]); if(ref[1] > 0) b= pack16to32(mv[1][0],mv[1][1]); }else{ a= pack16to32(mv[0][0],mv[0][1]); b= pack16to32(mv[1][0],mv[1][1]); } fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4); fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4); }else{ for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4); fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0 || (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0 && (h->x264_build>33 || !h->x264_build)))){ const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1; if(IS_SUB_8X8(sub_mb_type)){ const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ if(ref[0] == 0) fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); if(ref[1] == 0) fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); } }else for(i4=0; i4<4; i4++){ const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride]; if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ if(ref[0] == 0) *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0; if(ref[1] == 0) *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0; } } } } } }else{ const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]}; const int *dist_scale_factor = h->dist_scale_factor; if(FRAME_MBAFF){ if(IS_INTERLACED(*mb_type)){ map_col_to_list0[0] = h->map_col_to_list0_field[0]; map_col_to_list0[1] = h->map_col_to_list0_field[1]; dist_scale_factor = h->dist_scale_factor_field; } if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){ const int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride; int mb_types_col[2]; int y_shift; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1 | (is_b8x8 ? 0 : MB_TYPE_DIRECT2) | (*mb_type & MB_TYPE_INTERLACED); sub_mb_type = MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_16x16; if(IS_INTERLACED(*mb_type)){ mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy]; mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; if(s->mb_y&1){ l1ref0 -= 2*h->b8_stride; l1ref1 -= 2*h->b8_stride; l1mv0 -= 4*h->b_stride; l1mv1 -= 4*h->b_stride; } y_shift = 0; if( (mb_types_col[0] & MB_TYPE_16x16_OR_INTRA) && (mb_types_col[1] & MB_TYPE_16x16_OR_INTRA) && !is_b8x8) *mb_type |= MB_TYPE_16x8; else *mb_type |= MB_TYPE_8x8; }else{ int dy = (s->mb_y&1) ? 1 : 2; mb_types_col[0] = mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; l1ref0 += dy*h->b8_stride; l1ref1 += dy*h->b8_stride; l1mv0 += 2*dy*h->b_stride; l1mv1 += 2*dy*h->b_stride; y_shift = 2; if((mb_types_col[0] & (MB_TYPE_16x16_OR_INTRA|MB_TYPE_16x8)) && !is_b8x8) *mb_type |= MB_TYPE_16x16; else *mb_type |= MB_TYPE_8x8; } for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; int ref0, scale; const int16_t (*l1mv)[2]= l1mv0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1); if(IS_INTRA(mb_types_col[y8])){ fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1); fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); continue; } ref0 = l1ref0[x8 + (y8*2>>y_shift)*h->b8_stride]; if(ref0 >= 0) ref0 = map_col_to_list0[0][ref0*2>>y_shift]; else{ ref0 = map_col_to_list0[1][l1ref1[x8 + (y8*2>>y_shift)*h->b8_stride]*2>>y_shift]; l1mv= l1mv1; } scale = dist_scale_factor[ref0]; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); { const int16_t *mv_col = l1mv[x8*3 + (y8*6>>y_shift)*h->b_stride]; int my_col = (mv_col[1]<<y_shift)/2; int mx = (scale * mv_col[0] + 128) >> 8; int my = (scale * my_col + 128) >> 8; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4); } } return; } } if(IS_16X16(*mb_type)){ int ref, mv0, mv1; fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1); if(IS_INTRA(mb_type_col)){ ref=mv0=mv1=0; }else{ const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0]] : map_col_to_list0[1][l1ref1[0]]; const int scale = dist_scale_factor[ref0]; const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0]; int mv_l0[2]; mv_l0[0] = (scale * mv_col[0] + 128) >> 8; mv_l0[1] = (scale * mv_col[1] + 128) >> 8; ref= ref0; mv0= pack16to32(mv_l0[0],mv_l0[1]); mv1= pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); } fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1); fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, mv0, 4); fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, mv1, 4); }else{ for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; int ref0, scale; const int16_t (*l1mv)[2]= l1mv0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1); if(IS_INTRA(mb_type_col)){ fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1); fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); continue; } ref0 = l1ref0[x8 + y8*h->b8_stride]; if(ref0 >= 0) ref0 = map_col_to_list0[0][ref0]; else{ ref0 = map_col_to_list0[1][l1ref1[x8 + y8*h->b8_stride]]; l1mv= l1mv1; } scale = dist_scale_factor[ref0]; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); if(IS_SUB_8X8(sub_mb_type)){ const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; int mx = (scale * mv_col[0] + 128) >> 8; int my = (scale * mv_col[1] + 128) >> 8; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4); }else for(i4=0; i4<4; i4++){ const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride]; int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]]; mv_l0[0] = (scale * mv_col[0] + 128) >> 8; mv_l0[1] = (scale * mv_col[1] + 128) >> 8; *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); } } } } } libavcodec/h264.c:1106: error: Uninitialized Value The value read from ref[_] was never initialized. libavcodec/h264.c:1106:20: 1104. if(ref[0] > 0) 1105. a= pack16to32(mv[0][0],mv[0][1]); 1106. if(ref[1] > 0) ^ 1107. b= pack16to32(mv[1][0],mv[1][1]); 1108. }else{
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1106
d2a_code_trace_data_43779
static int avi_write_idx1(AVFormatContext *s) { ByteIOContext *pb = s->pb; AVIContext *avi = s->priv_data; offset_t idx_chunk; int i; char tag[5]; if (!url_is_streamed(pb)) { AVIIentry* ie = 0, *tie; int entry[MAX_STREAMS]; int empty, stream_id = -1; idx_chunk = start_tag(pb, "idx1"); memset(&entry[0], 0, sizeof(entry)); do { empty = 1; for (i=0; i<s->nb_streams; i++) { if (avi->indexes[i].entry <= entry[i]) continue; tie = avi_get_ientry(&avi->indexes[i], entry[i]); if (empty || tie->pos < ie->pos) { ie = tie; stream_id = i; } empty = 0; } if (!empty) { avi_stream2fourcc(&tag[0], stream_id, s->streams[stream_id]->codec->codec_type); put_tag(pb, &tag[0]); put_le32(pb, ie->flags); put_le32(pb, ie->pos); put_le32(pb, ie->len); entry[stream_id]++; } } while (!empty); end_tag(pb, idx_chunk); avi_write_counters(s, avi->riff_id); } return 0; } libavformat/avienc.c:452: error: Buffer Overrun L3 Offset: [-1, +oo] Size: 20. libavformat/avienc.c:433:9: <Offset trace> 431. AVIIentry* ie = 0, *tie; 432. int entry[MAX_STREAMS]; 433. int empty, stream_id = -1; ^ 434. 435. idx_chunk = start_tag(pb, "idx1"); libavformat/avienc.c:433:9: Assignment 431. AVIIentry* ie = 0, *tie; 432. int entry[MAX_STREAMS]; 433. int empty, stream_id = -1; ^ 434. 435. idx_chunk = start_tag(pb, "idx1"); libavformat/avienc.c:422:1: <Length trace> 420. } 421. 422. static int avi_write_idx1(AVFormatContext *s) ^ 423. { 424. ByteIOContext *pb = s->pb; libavformat/avienc.c:422:1: Parameter `s->streams[*]` 420. } 421. 422. static int avi_write_idx1(AVFormatContext *s) ^ 423. { 424. ByteIOContext *pb = s->pb; libavformat/avienc.c:452:35: Array access: Offset: [-1, +oo] Size: 20 450. if (!empty) { 451. avi_stream2fourcc(&tag[0], stream_id, 452. s->streams[stream_id]->codec->codec_type); ^ 453. put_tag(pb, &tag[0]); 454. put_le32(pb, ie->flags);
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/avienc.c/#L452
d2a_code_trace_data_43780
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecp_smpl.c:1401: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_inverse`. Showing all 40 steps of the trace crypto/ec/ecp_smpl.c:1378:1: Parameter `ctx->stack.depth` 1376. * Since we don't have a Mont structure here, SCA hardening is with blinding. 1377. */ 1378. > int ec_GFp_simple_field_inv(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, 1379. BN_CTX *ctx) 1380. { crypto/ec/ecp_smpl.c:1388:5: Call 1386. return 0; 1387. 1388. BN_CTX_start(ctx); ^ 1389. if ((e = BN_CTX_get(ctx)) == NULL) 1390. 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/ec/ecp_smpl.c:1401:10: Call 1399. goto err; 1400. /* r := 1/(a * e) */ 1401. if (!BN_mod_inverse(r, r, group->field, ctx)) { ^ 1402. ECerr(EC_F_EC_GFP_SIMPLE_FIELD_INV, EC_R_CANNOT_INVERT); 1403. goto err; 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_inverse` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43781
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/bn/bn_prime.c:256: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_mul`. Showing all 37 steps of the trace crypto/bn/bn_prime.c:249:10: Call 247. BN_MONT_CTX *mont) 248. { 249. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ ^ 250. return -1; 251. if (BN_is_one(w)) crypto/bn/bn_exp.c:296:1: Parameter `a->top` 294. } 295. 296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 298. { crypto/bn/bn_prime.c:251:9: Call 249. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ 250. return -1; 251. if (BN_is_one(w)) ^ 252. return 0; /* probably prime */ 253. if (BN_cmp(w, a1) == 0) crypto/bn/bn_lib.c:869:1: Parameter `a->top` 867. } 868. 869. > int BN_is_one(const BIGNUM *a) 870. { 871. return BN_abs_is_word(a, 1) && !a->neg; crypto/bn/bn_lib.c:871:12: Call 869. int BN_is_one(const BIGNUM *a) 870. { 871. return BN_abs_is_word(a, 1) && !a->neg; ^ 872. } 873. crypto/bn/bn_lib.c:859:1: Parameter `a->top` 857. } 858. 859. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 860. { 861. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_prime.c:253:9: Call 251. if (BN_is_one(w)) 252. return 0; /* probably prime */ 253. if (BN_cmp(w, a1) == 0) ^ 254. return 0; /* w == -1 (mod a), 'a' is probably prime */ 255. while (--k) { crypto/bn/bn_lib.c:579:1: Parameter `a->top` 577. } 578. 579. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 580. { 581. int i; crypto/bn/bn_prime.c:256:14: Call 254. return 0; /* w == -1 (mod a), 'a' is probably prime */ 255. while (--k) { 256. if (!BN_mod_mul(w, w, w, a, ctx)) /* w := w^2 mod a */ ^ 257. return -1; 258. if (BN_is_one(w)) crypto/bn/bn_mod.c:193:1: Parameter `r->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:213:10: Call 211. goto err; 212. } 213. if (!BN_nnmod(r, t, m, ctx)) ^ 214. goto err; 215. bn_check_top(r); crypto/bn/bn_mod.c:13:1: Parameter `r->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:209:1: Parameter `rm->top` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:264:1: Parameter `rm->top` 262. * divisor's length is considered public; 263. */ 264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 265. const BIGNUM *divisor, BN_CTX *ctx) 266. { crypto/bn/bn_div.c:449:9: Call 447. snum->flags |= BN_FLG_FIXED_TOP; 448. if (rm != NULL) 449. bn_rshift_fixed_top(rm, snum, norm_shift); ^ 450. BN_CTX_end(ctx); 451. return 1; crypto/bn/bn_shift.c:214:1: Parameter `r->top` 212. * |n < BN_BITS2| or |n / BN_BITS2| being non-secret. 213. */ 214. > int bn_rshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n) 215. { 216. int i, top, nw; crypto/bn/bn_shift.c:229:9: Call 227. if (nw >= a->top) { 228. /* shouldn't happen, but formally required */ 229. BN_zero(r); ^ 230. return 1; 231. } crypto/bn/bn_lib.c:359:1: Parameter `a->top` 357. } 358. 359. > int BN_set_word(BIGNUM *a, BN_ULONG w) 360. { 361. bn_check_top(a); crypto/bn/bn_lib.c:362:9: Call 360. { 361. bn_check_top(a); 362. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 363. return 0; 364. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `a->top` 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_lcl.h:668:12: Call 666. return a; 667. 668. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 669. } 670. crypto/bn/bn_lib.c:245:1: Parameter `b->top` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `words` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:224:13: Call 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/mem.c:228:1: Parameter `num` 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:17: Call 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/mem.c:230:5: Assignment 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:235:5: Assignment 233. if (ret != NULL) 234. memset(ret, 0, num); 235. return ret; ^ 236. } 237. crypto/bn/bn_lib.c:224:9: Assignment 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_mul` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_43782
static int http_parse_request(HTTPContext *c) { char *p; enum RedirType redir_type; char cmd[32]; char info[1024], filename[1024]; char url[1024], *q; char protocol[32]; char msg[1024]; const char *mime_type; FFStream *stream; int i; char ratebuf[32]; char *useragent = 0; p = c->buffer; get_word(cmd, sizeof(cmd), (const char **)&p); av_strlcpy(c->method, cmd, sizeof(c->method)); if (!strcmp(cmd, "GET")) c->post = 0; else if (!strcmp(cmd, "POST")) c->post = 1; else return -1; get_word(url, sizeof(url), (const char **)&p); av_strlcpy(c->url, url, sizeof(c->url)); get_word(protocol, sizeof(protocol), (const char **)&p); if (strcmp(protocol, "HTTP/1.0") && strcmp(protocol, "HTTP/1.1")) return -1; av_strlcpy(c->protocol, protocol, sizeof(c->protocol)); if (ffserver_debug) http_log("New connection: %s %s\n", cmd, url); p = strchr(url, '?'); if (p) { av_strlcpy(info, p, sizeof(info)); *p = '\0'; } else info[0] = '\0'; av_strlcpy(filename, url + ((*url == '/') ? 1 : 0), sizeof(filename)-1); for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) { if (strncasecmp(p, "User-Agent:", 11) == 0) { useragent = p + 11; if (*useragent && *useragent != '\n' && isspace(*useragent)) useragent++; break; } p = strchr(p, '\n'); if (!p) break; p++; } redir_type = REDIR_NONE; if (match_ext(filename, "asx")) { redir_type = REDIR_ASX; filename[strlen(filename)-1] = 'f'; } else if (match_ext(filename, "asf") && (!useragent || strncasecmp(useragent, "NSPlayer", 8) != 0)) { redir_type = REDIR_ASF; } else if (match_ext(filename, "rpm,ram")) { redir_type = REDIR_RAM; strcpy(filename + strlen(filename)-2, "m"); } else if (match_ext(filename, "rtsp")) { redir_type = REDIR_RTSP; compute_real_filename(filename, sizeof(filename) - 1); } else if (match_ext(filename, "sdp")) { redir_type = REDIR_SDP; compute_real_filename(filename, sizeof(filename) - 1); } if (!strlen(filename)) av_strlcpy(filename, "index.html", sizeof(filename) - 1); stream = first_stream; while (stream != NULL) { if (!strcmp(stream->filename, filename) && validate_acl(stream, c)) break; stream = stream->next; } if (stream == NULL) { snprintf(msg, sizeof(msg), "File '%s' not found", url); goto send_error; } c->stream = stream; memcpy(c->feed_streams, stream->feed_streams, sizeof(c->feed_streams)); memset(c->switch_feed_streams, -1, sizeof(c->switch_feed_streams)); if (stream->stream_type == STREAM_TYPE_REDIRECT) { c->http_error = 301; q = c->buffer; q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 301 Moved\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Location: %s\r\n", stream->feed_filename); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: text/html\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<html><head><title>Moved</title></head><body>\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "You should be <a href=\"%s\">redirected</a>.\r\n", stream->feed_filename); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</body></html>\r\n"); c->buffer_ptr = c->buffer; c->buffer_end = q; c->state = HTTPSTATE_SEND_HEADER; return 0; } if (extract_rates(ratebuf, sizeof(ratebuf), c->buffer)) { if (modify_current_stream(c, ratebuf)) { for (i = 0; i < sizeof(c->feed_streams) / sizeof(c->feed_streams[0]); i++) { if (c->switch_feed_streams[i] >= 0) do_switch_stream(c, i); } } } if (stream->feed_opened) { snprintf(msg, sizeof(msg), "This feed is already being received."); goto send_error; } if (c->post == 0 && stream->stream_type == STREAM_TYPE_LIVE) current_bandwidth += stream->bandwidth; if (c->post == 0 && max_bandwidth < current_bandwidth) { c->http_error = 200; q = c->buffer; q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 Server too busy\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: text/html\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<html><head><title>Too busy</title></head><body>\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<p>The server is too busy to serve your request at this time.</p>\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<p>The bandwidth being served (including your stream) is %dkbit/sec, and this exceeds the limit of %dkbit/sec.</p>\r\n", current_bandwidth, max_bandwidth); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</body></html>\r\n"); c->buffer_ptr = c->buffer; c->buffer_end = q; c->state = HTTPSTATE_SEND_HEADER; return 0; } if (redir_type != REDIR_NONE) { char *hostinfo = 0; for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) { if (strncasecmp(p, "Host:", 5) == 0) { hostinfo = p + 5; break; } p = strchr(p, '\n'); if (!p) break; p++; } if (hostinfo) { char *eoh; char hostbuf[260]; while (isspace(*hostinfo)) hostinfo++; eoh = strchr(hostinfo, '\n'); if (eoh) { if (eoh[-1] == '\r') eoh--; if (eoh - hostinfo < sizeof(hostbuf) - 1) { memcpy(hostbuf, hostinfo, eoh - hostinfo); hostbuf[eoh - hostinfo] = 0; c->http_error = 200; q = c->buffer; switch(redir_type) { case REDIR_ASX: q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 ASX Follows\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: video/x-ms-asf\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ASX Version=\"3\">\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<ENTRY><REF HREF=\"http://%s/%s%s\"/></ENTRY>\r\n", hostbuf, filename, info); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</ASX>\r\n"); break; case REDIR_RAM: q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 RAM Follows\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: audio/x-pn-realaudio\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "# Autogenerated by ffserver\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "http://%s/%s%s\r\n", hostbuf, filename, info); break; case REDIR_ASF: q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 ASF Redirect follows\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: video/x-ms-asf\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "[Reference]\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Ref1=http://%s/%s%s\r\n", hostbuf, filename, info); break; case REDIR_RTSP: { char hostname[256], *p; av_strlcpy(hostname, hostbuf, sizeof(hostname)); p = strrchr(hostname, ':'); if (p) *p = '\0'; q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 RTSP Redirect follows\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: application/x-rtsp\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "rtsp://%s:%d/%s\r\n", hostname, ntohs(my_rtsp_addr.sin_port), filename); } break; case REDIR_SDP: { uint8_t *sdp_data; int sdp_data_size, len; struct sockaddr_in my_addr; q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 OK\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: application/sdp\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); len = sizeof(my_addr); getsockname(c->fd, (struct sockaddr *)&my_addr, &len); sdp_data_size = prepare_sdp_description(stream, &sdp_data, my_addr.sin_addr); if (sdp_data_size > 0) { memcpy(q, sdp_data, sdp_data_size); q += sdp_data_size; *q = '\0'; av_free(sdp_data); } } break; default: abort(); break; } c->buffer_ptr = c->buffer; c->buffer_end = q; c->state = HTTPSTATE_SEND_HEADER; return 0; } } } snprintf(msg, sizeof(msg), "ASX/RAM file not handled"); goto send_error; } stream->conns_served++; if (c->post) { if (!stream->is_feed) { char *logline = 0; int client_id = 0; for (p = c->buffer; *p && *p != '\r' && *p != '\n'; ) { if (strncasecmp(p, "Pragma: log-line=", 17) == 0) { logline = p; break; } if (strncasecmp(p, "Pragma: client-id=", 18) == 0) client_id = strtol(p + 18, 0, 10); p = strchr(p, '\n'); if (!p) break; p++; } if (logline) { char *eol = strchr(logline, '\n'); logline += 17; if (eol) { if (eol[-1] == '\r') eol--; http_log("%.*s\n", (int) (eol - logline), logline); c->suppress_log = 1; } } #ifdef DEBUG_WMP http_log("\nGot request:\n%s\n", c->buffer); #endif if (client_id && extract_rates(ratebuf, sizeof(ratebuf), c->buffer)) { HTTPContext *wmpc; for (wmpc = first_http_ctx; wmpc; wmpc = wmpc->next) { if (wmpc->wmp_client_id == client_id) break; } if (wmpc && modify_current_stream(wmpc, ratebuf)) wmpc->switch_pending = 1; } snprintf(msg, sizeof(msg), "POST command not handled"); c->stream = 0; goto send_error; } if (http_start_receive_data(c) < 0) { snprintf(msg, sizeof(msg), "could not open feed"); goto send_error; } c->http_error = 0; c->state = HTTPSTATE_RECEIVE_DATA; return 0; } #ifdef DEBUG_WMP if (strcmp(stream->filename + strlen(stream->filename) - 4, ".asf") == 0) http_log("\nGot request:\n%s\n", c->buffer); #endif if (c->stream->stream_type == STREAM_TYPE_STATUS) goto send_stats; if (open_input_stream(c, info) < 0) { snprintf(msg, sizeof(msg), "Input stream corresponding to '%s' not found", url); goto send_error; } q = c->buffer; q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 200 OK\r\n"); mime_type = c->stream->fmt->mime_type; if (!mime_type) mime_type = "application/x-octet-stream"; q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Pragma: no-cache\r\n"); if (!strcmp(c->stream->fmt->name,"asf_stream")) { c->wmp_client_id = av_random(&random_state) & 0x7fffffff; q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Server: Cougar 4.1.0.3923\r\nCache-Control: no-cache\r\nPragma: client-id=%d\r\nPragma: features=\"broadcast\"\r\n", c->wmp_client_id); } q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-Type: %s\r\n", mime_type); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); c->http_error = 0; c->buffer_ptr = c->buffer; c->buffer_end = q; c->state = HTTPSTATE_SEND_HEADER; return 0; send_error: c->http_error = 404; q = c->buffer; q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "HTTP/1.0 404 Not Found\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: %s\r\n", "text/html"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<HTML>\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<HEAD><TITLE>404 Not Found</TITLE></HEAD>\n"); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<BODY>%s</BODY>\n", msg); q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</HTML>\n"); c->buffer_ptr = c->buffer; c->buffer_end = q; c->state = HTTPSTATE_SEND_HEADER; return 0; send_stats: compute_stats(c); c->http_error = 200; c->state = HTTPSTATE_SEND_HEADER; return 0; } ffserver.c:1246: error: Buffer Overrun L3 Offset: [-1, +oo] (⇐ [-2, +oo] + 1) Size: 1024. ffserver.c:1174:1: <Length trace> 1172. 1173. /* parse http request and prepare header */ 1174. static int http_parse_request(HTTPContext *c) ^ 1175. { 1176. char *p; ffserver.c:1174:1: Array declaration 1172. 1173. /* parse http request and prepare header */ 1174. static int http_parse_request(HTTPContext *c) ^ 1175. { 1176. char *p; ffserver.c:1246:9: Array access: Offset: [-1, +oo] (⇐ [-2, +oo] + 1) Size: 1024 1244. } else if (match_ext(filename, "rpm,ram")) { 1245. redir_type = REDIR_RAM; 1246. strcpy(filename + strlen(filename)-2, "m"); ^ 1247. } else if (match_ext(filename, "rtsp")) { 1248. redir_type = REDIR_RTSP;
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/ffserver.c/#L1246
d2a_code_trace_data_43783
int RAND_pseudo_bytes(unsigned char *buf, int num) { const RAND_METHOD *meth = RAND_get_rand_method(); if (meth->pseudorand != NULL) return meth->pseudorand(buf, num); return -1; } crypto/rand/rand_lib.c:823: error: NULL_DEREFERENCE pointer `meth` last assigned on line 821 could be null and is dereferenced at line 823, column 9. Showing all 14 steps of the trace crypto/rand/rand_lib.c:819:1: start of procedure RAND_pseudo_bytes() 817. 818. #if OPENSSL_API_COMPAT < 0x10100000L 819. > int RAND_pseudo_bytes(unsigned char *buf, int num) 820. { 821. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:821:5: 819. int RAND_pseudo_bytes(unsigned char *buf, int num) 820. { 821. > const RAND_METHOD *meth = RAND_get_rand_method(); 822. 823. if (meth->pseudorand != NULL) crypto/rand/rand_lib.c:714:1: start of procedure RAND_get_rand_method() 712. } 713. 714. > const RAND_METHOD *RAND_get_rand_method(void) 715. { 716. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:716:5: 714. const RAND_METHOD *RAND_get_rand_method(void) 715. { 716. > const RAND_METHOD *tmp_meth = NULL; 717. 718. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:718:10: 716. const RAND_METHOD *tmp_meth = NULL; 717. 718. > if (!RUN_ONCE(&rand_init, do_rand_init)) 719. return NULL; 720. crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once() 109. } 110. 111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) crypto/threads_pthread.c:113:9: Taking true branch 111. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) 112. { 113. if (pthread_once(once, init) != 0) ^ 114. return 0; 115. crypto/threads_pthread.c:114:9: 112. { 113. if (pthread_once(once, init) != 0) 114. > return 0; 115. 116. return 1; crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once 115. 116. return 1; 117. > } 118. 119. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *)) crypto/rand/rand_lib.c:718:10: Condition is false 716. const RAND_METHOD *tmp_meth = NULL; 717. 718. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 719. return NULL; 720. crypto/rand/rand_lib.c:718:10: Taking true branch 716. const RAND_METHOD *tmp_meth = NULL; 717. 718. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 719. return NULL; 720. crypto/rand/rand_lib.c:719:9: 717. 718. if (!RUN_ONCE(&rand_init, do_rand_init)) 719. > return NULL; 720. 721. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:742:1: return from a call to RAND_get_rand_method 740. CRYPTO_THREAD_unlock(rand_meth_lock); 741. return tmp_meth; 742. > } 743. 744. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:823:9: 821. const RAND_METHOD *meth = RAND_get_rand_method(); 822. 823. > if (meth->pseudorand != NULL) 824. return meth->pseudorand(buf, num); 825. return -1;
https://github.com/openssl/openssl/blob/92ebf6c4c21ff4b41ba1fd69af74b2039e138114/crypto/rand/rand_lib.c/#L823
d2a_code_trace_data_43784
static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al) { #ifndef OPENSSL_NO_RSA unsigned char *encdata = NULL; EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *pctx = NULL; size_t enclen; unsigned char *pms = NULL; size_t pmslen = 0; if (s->session->peer == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pkey = X509_get0_pubkey(s->session->peer); if (EVP_PKEY_get0_RSA(pkey) == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); return 0; } pmslen = SSL_MAX_MASTER_KEY_LENGTH; pms = OPENSSL_malloc(pmslen); if (pms == NULL) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE); *al = SSL_AD_INTERNAL_ERROR; return 0; } pms[0] = s->client_version >> 8; pms[1] = s->client_version & 0xff; if (RAND_bytes(pms + 2, (int)(pmslen - 2)) <= 0) { goto err; } if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } pctx = EVP_PKEY_CTX_new(pkey, NULL); if (pctx == NULL || EVP_PKEY_encrypt_init(pctx) <= 0 || EVP_PKEY_encrypt(pctx, NULL, &enclen, pms, pmslen) <= 0) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_EVP_LIB); goto err; } if (!WPACKET_allocate_bytes(pkt, enclen, &encdata) || EVP_PKEY_encrypt(pctx, encdata, &enclen, pms, pmslen) <= 0) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT); goto err; } EVP_PKEY_CTX_free(pctx); pctx = NULL; # ifdef PKCS1_CHECK if (s->options & SSL_OP_PKCS1_CHECK_1) (*p)[1]++; if (s->options & SSL_OP_PKCS1_CHECK_2) tmp_buf[0] = 0x70; # endif if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) { SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); goto err; } s->s3->tmp.pms = pms; s->s3->tmp.pmslen = pmslen; return 1; err: OPENSSL_clear_free(pms, pmslen); EVP_PKEY_CTX_free(pctx); return 0; #else SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); *al = SSL_AD_INTERNAL_ERROR; return 0; #endif } ssl/statem/statem_clnt.c:2384: error: NULL_DEREFERENCE pointer `pkey` last assigned on line 2383 could be null and is dereferenced by call to `EVP_PKEY_get0_RSA()` at line 2384, column 9. Showing all 30 steps of the trace ssl/statem/statem_clnt.c:2365:1: start of procedure tls_construct_cke_rsa() 2363. } 2364. 2365. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt, int *al) 2366. { 2367. #ifndef OPENSSL_NO_RSA ssl/statem/statem_clnt.c:2368:5: 2366. { 2367. #ifndef OPENSSL_NO_RSA 2368. > unsigned char *encdata = NULL; 2369. EVP_PKEY *pkey = NULL; 2370. EVP_PKEY_CTX *pctx = NULL; ssl/statem/statem_clnt.c:2369:5: 2367. #ifndef OPENSSL_NO_RSA 2368. unsigned char *encdata = NULL; 2369. > EVP_PKEY *pkey = NULL; 2370. EVP_PKEY_CTX *pctx = NULL; 2371. size_t enclen; ssl/statem/statem_clnt.c:2370:5: 2368. unsigned char *encdata = NULL; 2369. EVP_PKEY *pkey = NULL; 2370. > EVP_PKEY_CTX *pctx = NULL; 2371. size_t enclen; 2372. unsigned char *pms = NULL; ssl/statem/statem_clnt.c:2372:5: 2370. EVP_PKEY_CTX *pctx = NULL; 2371. size_t enclen; 2372. > unsigned char *pms = NULL; 2373. size_t pmslen = 0; 2374. ssl/statem/statem_clnt.c:2373:5: 2371. size_t enclen; 2372. unsigned char *pms = NULL; 2373. > size_t pmslen = 0; 2374. 2375. if (s->session->peer == NULL) { ssl/statem/statem_clnt.c:2375:9: Taking false branch 2373. size_t pmslen = 0; 2374. 2375. if (s->session->peer == NULL) { ^ 2376. /* 2377. * We should always have a server certificate with SSL_kRSA. ssl/statem/statem_clnt.c:2383:5: 2381. } 2382. 2383. > pkey = X509_get0_pubkey(s->session->peer); 2384. if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2385. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); crypto/x509/x509_cmp.c:265:1: start of procedure X509_get0_pubkey() 263. } 264. 265. > EVP_PKEY *X509_get0_pubkey(const X509 *x) 266. { 267. if (x == NULL) crypto/x509/x509_cmp.c:267:9: Taking false branch 265. EVP_PKEY *X509_get0_pubkey(const X509 *x) 266. { 267. if (x == NULL) ^ 268. return NULL; 269. return X509_PUBKEY_get0(x->cert_info.key); crypto/x509/x509_cmp.c:269:5: 267. if (x == NULL) 268. return NULL; 269. > return X509_PUBKEY_get0(x->cert_info.key); 270. } 271. crypto/x509/x_pubkey.c:140:1: start of procedure X509_PUBKEY_get0() 138. } 139. 140. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 141. { 142. EVP_PKEY *ret = NULL; crypto/x509/x_pubkey.c:142:5: 140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) 141. { 142. > EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) crypto/x509/x_pubkey.c:144:9: Taking false branch 142. EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) ^ 145. return NULL; 146. crypto/x509/x_pubkey.c:144:24: Taking false branch 142. EVP_PKEY *ret = NULL; 143. 144. if (key == NULL || key->public_key == NULL) ^ 145. return NULL; 146. crypto/x509/x_pubkey.c:147:9: Taking false branch 145. return NULL; 146. 147. if (key->pkey != NULL) ^ 148. return key->pkey; 149. crypto/x509/x_pubkey.c:158:5: 156. * in the queue. 157. */ 158. > x509_pubkey_decode(&ret, key); 159. /* If decode doesn't fail something bad happened */ 160. if (ret != NULL) { crypto/x509/x_pubkey.c:103:1: start of procedure x509_pubkey_decode() 101. 102. 103. > static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key) 104. { 105. EVP_PKEY *pkey = EVP_PKEY_new(); crypto/x509/x_pubkey.c:105:5: Skipping EVP_PKEY_new(): empty list of specs 103. static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key) 104. { 105. EVP_PKEY *pkey = EVP_PKEY_new(); ^ 106. 107. if (pkey == NULL) { crypto/x509/x_pubkey.c:107:9: Taking true branch 105. EVP_PKEY *pkey = EVP_PKEY_new(); 106. 107. if (pkey == NULL) { ^ 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); 109. return -1; crypto/x509/x_pubkey.c:108:9: Skipping ERR_put_error(): empty list of specs 106. 107. if (pkey == NULL) { 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); ^ 109. return -1; 110. } crypto/x509/x_pubkey.c:109:9: 107. if (pkey == NULL) { 108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE); 109. > return -1; 110. } 111. crypto/x509/x_pubkey.c:138:1: return from a call to x509_pubkey_decode 136. EVP_PKEY_free(pkey); 137. return 0; 138. > } 139. 140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key) crypto/x509/x_pubkey.c:160:9: Taking false branch 158. x509_pubkey_decode(&ret, key); 159. /* If decode doesn't fail something bad happened */ 160. if (ret != NULL) { ^ 161. X509err(X509_F_X509_PUBKEY_GET0, ERR_R_INTERNAL_ERROR); 162. EVP_PKEY_free(ret); crypto/x509/x_pubkey.c:165:5: 163. } 164. 165. > return NULL; 166. } 167. crypto/x509/x_pubkey.c:166:1: return from a call to X509_PUBKEY_get0 164. 165. return NULL; 166. > } 167. 168. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) crypto/x509/x509_cmp.c:270:1: return from a call to X509_get0_pubkey 268. return NULL; 269. return X509_PUBKEY_get0(x->cert_info.key); 270. > } 271. 272. EVP_PKEY *X509_get_pubkey(X509 *x) ssl/statem/statem_clnt.c:2384:9: 2382. 2383. pkey = X509_get0_pubkey(s->session->peer); 2384. > if (EVP_PKEY_get0_RSA(pkey) == NULL) { 2385. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR); 2386. return 0; crypto/evp/p_lib.c:261:1: start of procedure EVP_PKEY_get0_RSA() 259. } 260. 261. > RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) 262. { 263. if (pkey->type != EVP_PKEY_RSA) { crypto/evp/p_lib.c:263:9: 261. RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) 262. { 263. > if (pkey->type != EVP_PKEY_RSA) { 264. EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY); 265. return NULL;
https://github.com/openssl/openssl/blob/5d8ce306349aabcf40da0324242025aac3cc56e4/ssl/statem/statem_clnt.c/#L2384
d2a_code_trace_data_43785
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:1059: error: Uninitialized Value The value read from xmin was never initialized. libavcodec/motion_est_template.c:1059:9: 1057. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1) 1058. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1) 1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) ) ^ 1060. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) ) 1061. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1059
d2a_code_trace_data_43786
STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) { int i, idx, cnt; STACK_OF(X509) *sk = NULL; X509 *x; X509_OBJECT *obj; CRYPTO_THREAD_write_lock(ctx->ctx->lock); idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); if (idx < 0) { X509_OBJECT *xobj = X509_OBJECT_new(); CRYPTO_THREAD_unlock(ctx->ctx->lock); if (xobj == NULL) return NULL; if (!X509_STORE_CTX_get_by_subject(ctx, X509_LU_X509, nm, xobj)) { X509_OBJECT_free(xobj); return NULL; } X509_OBJECT_free(xobj); CRYPTO_THREAD_write_lock(ctx->ctx->lock); idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); if (idx < 0) { CRYPTO_THREAD_unlock(ctx->ctx->lock); return NULL; } } sk = sk_X509_new_null(); for (i = 0; i < cnt; i++, idx++) { obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); x = obj->data.x509; X509_up_ref(x); if (!sk_X509_push(sk, x)) { CRYPTO_THREAD_unlock(ctx->ctx->lock); X509_free(x); sk_X509_pop_free(sk, X509_free); return NULL; } } CRYPTO_THREAD_unlock(ctx->ctx->lock); return sk; } crypto/x509/x509_lu.c:527: error: NULL_DEREFERENCE pointer `obj` last assigned on line 526 could be null and is dereferenced at line 527, column 13. Showing all 25 steps of the trace crypto/x509/x509_lu.c:492:1: start of procedure X509_STORE_CTX_get1_certs() 490. } 491. 492. > STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *ctx, X509_NAME *nm) 493. { 494. int i, idx, cnt; crypto/x509/x509_lu.c:495:5: 493. { 494. int i, idx, cnt; 495. > STACK_OF(X509) *sk = NULL; 496. X509 *x; 497. X509_OBJECT *obj; crypto/x509/x509_lu.c:499:5: 497. X509_OBJECT *obj; 498. 499. > CRYPTO_THREAD_write_lock(ctx->ctx->lock); 500. idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); 501. if (idx < 0) { crypto/threads_pthread.c:36:1: start of procedure CRYPTO_THREAD_write_lock() 34. } 35. 36. > int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) 37. { 38. if (pthread_rwlock_wrlock(lock) != 0) crypto/threads_pthread.c:38:9: Taking true branch 36. int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock) 37. { 38. if (pthread_rwlock_wrlock(lock) != 0) ^ 39. return 0; 40. crypto/threads_pthread.c:39:9: 37. { 38. if (pthread_rwlock_wrlock(lock) != 0) 39. > return 0; 40. 41. return 1; crypto/threads_pthread.c:42:1: return from a call to CRYPTO_THREAD_write_lock 40. 41. return 1; 42. > } 43. 44. int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock) crypto/x509/x509_lu.c:500:5: Skipping x509_object_idx_cnt(): empty list of specs 498. 499. CRYPTO_THREAD_write_lock(ctx->ctx->lock); 500. idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); ^ 501. if (idx < 0) { 502. /* crypto/x509/x509_lu.c:501:9: Taking false branch 499. CRYPTO_THREAD_write_lock(ctx->ctx->lock); 500. idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_X509, nm, &cnt); 501. if (idx < 0) { ^ 502. /* 503. * Nothing found in cache: do lookup to possibly add new objects to crypto/x509/x509_lu.c:524:5: 522. } 523. 524. > sk = sk_X509_new_null(); 525. for (i = 0; i < cnt; i++, idx++) { 526. obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); include/openssl/x509.h:104:1: start of procedure sk_X509_new_null() 102. typedef struct x509_cinf_st X509_CINF; 103. 104. > DEFINE_STACK_OF(X509) 105. 106. /* This is used for a table of trust checking functions */ crypto/stack/stack.c:92:1: start of procedure OPENSSL_sk_new_null() 90. } 91. 92. > OPENSSL_STACK *OPENSSL_sk_new_null(void) 93. { 94. return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL); crypto/stack/stack.c:94:5: Skipping OPENSSL_sk_new(): empty list of specs 92. OPENSSL_STACK *OPENSSL_sk_new_null(void) 93. { 94. return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL); ^ 95. } 96. crypto/stack/stack.c:95:1: return from a call to OPENSSL_sk_new_null 93. { 94. return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL); 95. > } 96. 97. OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c) include/openssl/x509.h:104:1: return from a call to sk_X509_new_null 102. typedef struct x509_cinf_st X509_CINF; 103. 104. > DEFINE_STACK_OF(X509) 105. 106. /* This is used for a table of trust checking functions */ crypto/x509/x509_lu.c:525:10: 523. 524. sk = sk_X509_new_null(); 525. > for (i = 0; i < cnt; i++, idx++) { 526. obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); 527. x = obj->data.x509; crypto/x509/x509_lu.c:525:17: Loop condition is true. Entering loop body 523. 524. sk = sk_X509_new_null(); 525. for (i = 0; i < cnt; i++, idx++) { ^ 526. obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); 527. x = obj->data.x509; crypto/x509/x509_lu.c:526:9: 524. sk = sk_X509_new_null(); 525. for (i = 0; i < cnt; i++, idx++) { 526. > obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); 527. x = obj->data.x509; 528. X509_up_ref(x); include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_value() 52. 53. DEFINE_STACK_OF(X509_LOOKUP) 54. > DEFINE_STACK_OF(X509_OBJECT) 55. DEFINE_STACK_OF(X509_VERIFY_PARAM) 56. crypto/stack/stack.c:272:1: start of procedure OPENSSL_sk_value() 270. } 271. 272. > void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) 273. { 274. if (st == NULL || i < 0 || i >= st->num) crypto/stack/stack.c:274:9: Taking true branch 272. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) 273. { 274. if (st == NULL || i < 0 || i >= st->num) ^ 275. return NULL; 276. return st->data[i]; crypto/stack/stack.c:275:9: 273. { 274. if (st == NULL || i < 0 || i >= st->num) 275. > return NULL; 276. return st->data[i]; 277. } crypto/stack/stack.c:277:1: return from a call to OPENSSL_sk_value 275. return NULL; 276. return st->data[i]; 277. > } 278. 279. void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, void *value) include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_value 52. 53. DEFINE_STACK_OF(X509_LOOKUP) 54. > DEFINE_STACK_OF(X509_OBJECT) 55. DEFINE_STACK_OF(X509_VERIFY_PARAM) 56. crypto/x509/x509_lu.c:527:9: 525. for (i = 0; i < cnt; i++, idx++) { 526. obj = sk_X509_OBJECT_value(ctx->ctx->objs, idx); 527. > x = obj->data.x509; 528. X509_up_ref(x); 529. if (!sk_X509_push(sk, x)) {
https://github.com/openssl/openssl/blob/b2de11c58b57e7f0d58c6f8a1d4177705650647e/crypto/x509/x509_lu.c/#L527
d2a_code_trace_data_43787
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/dh/dh_key.c:170: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set_locked`. Showing all 29 steps of the trace crypto/dh/dh_key.c:161:5: Call 159. if (ctx == NULL) 160. goto err; 161. BN_CTX_start(ctx); ^ 162. tmp = BN_CTX_get(ctx); 163. crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/dh/dh_key.c:170:16: Call 168. 169. if (dh->flags & DH_FLAG_CACHE_MONT_P) { 170. mont = BN_MONT_CTX_set_locked(&dh->method_mont_p, ^ 171. dh->lock, dh->p, ctx); 172. BN_set_flags(dh->priv_key, BN_FLG_CONSTTIME); crypto/bn/bn_mont.c:398:1: Parameter `ctx->stack.depth` 396. } 397. 398. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock, 399. const BIGNUM *mod, BN_CTX *ctx) 400. { crypto/bn/bn_mont.c:420:10: Call 418. if (ret == NULL) 419. return NULL; 420. if (!BN_MONT_CTX_set(ret, mod, ctx)) { ^ 421. BN_MONT_CTX_free(ret); 422. return NULL; crypto/bn/bn_mont.c:247:1: Parameter `ctx->stack.depth` 245. } 246. 247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 248. { 249. int ret = 0; crypto/bn/bn_mont.c:255:5: Call 253. return 0; 254. 255. BN_CTX_start(ctx); ^ 256. if ((Ri = BN_CTX_get(ctx)) == NULL) 257. goto err; crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_mont.c:326:14: Call 324. tmod.top = buf[0] != 0 ? 1 : 0; 325. /* Ri = R^-1 mod N */ 326. if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL) ^ 327. goto err; 328. if (!BN_lshift(Ri, Ri, BN_BITS2)) crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth` 122. BN_CTX *ctx); 123. 124. > BIGNUM *BN_mod_inverse(BIGNUM *in, 125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 126. { crypto/bn/bn_gcd.c:129:10: Call 127. BIGNUM *rv; 128. int noinv; 129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv); ^ 130. if (noinv) 131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE); crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth` 133. } 134. 135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in, 136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx, 137. int *pnoinv) crypto/bn/bn_gcd.c:148:16: Call 146. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) 147. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) { 148. return BN_mod_inverse_no_branch(in, a, n, ctx); ^ 149. } 150. crypto/bn/bn_gcd.c:455:1: Parameter `ctx->stack.depth` 453. * not contain branches that may leak sensitive information. 454. */ 455. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, 456. const BIGNUM *a, const BIGNUM *n, 457. BN_CTX *ctx) crypto/bn/bn_gcd.c:466:5: Call 464. bn_check_top(n); 465. 466. BN_CTX_start(ctx); ^ 467. A = BN_CTX_get(ctx); 468. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:501:18: Call 499. bn_init(&local_B); 500. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME); 501. if (!BN_nnmod(B, &local_B, A, ctx)) ^ 502. goto err; 503. /* Ensure local_B goes out of scope before any further use of B */ crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c: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_MONT_CTX_set_locked` 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/ec772a817afc0f788c38006f623204a7d76221ec/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_43788
void TIFFSwabArrayOfLong(register uint32* lp, tmsize_t n) { register unsigned char *cp; register unsigned char t; assert(sizeof(uint32)==4); while (n-- > 0) { cp = (unsigned char *)lp; t = cp[3]; cp[3] = cp[0]; cp[0] = t; t = cp[2]; cp[2] = cp[1]; cp[1] = t; lp++; } } libtiff/tif_dirwrite.c:712: error: Buffer Overrun L3 Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, +oo] by call to `TIFFWriteDirectoryTagRationalArray`. libtiff/tif_dirwrite.c:712:11: Call 710. break; 711. case TIFF_RATIONAL: 712. if (!TIFFWriteDirectoryTagRationalArray(tif,&ndir,dir,tif->tif_dir.td_customValues[m].info->field_tag,tif->tif_dir.td_customValues[m].count,tif->tif_dir.td_customValues[m].value)) ^ 713. goto bad; 714. break; libtiff/tif_dirwrite.c:1303:1: Parameter `count` 1301. } 1302. 1303. static int ^ 1304. TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value) 1305. { libtiff/tif_dirwrite.c:1311:9: Call 1309. return(1); 1310. } 1311. return(TIFFWriteDirectoryTagCheckedRationalArray(tif,ndir,dir,tag,count,value)); ^ 1312. } 1313. libtiff/tif_dirwrite.c:1991:1: Parameter `count` 1989. } 1990. 1991. static int ^ 1992. TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value) 1993. { libtiff/tif_dirwrite.c:2001:4: Call 1999. int o; 2000. assert(sizeof(uint32)==4); 2001. m=_TIFFmalloc(count*2*sizeof(uint32)); ^ 2002. if (m==NULL) 2003. { libtiff/tif_unix.c:253:1: Parameter `s` 251. #endif 252. 253. void* ^ 254. _TIFFmalloc(tmsize_t s) 255. { libtiff/tif_unix.c:256:10: Array declaration 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_unix.c:256:2: Assignment 254. _TIFFmalloc(tmsize_t s) 255. { 256. return (malloc((size_t) s)); ^ 257. } 258. libtiff/tif_dirwrite.c:2001:2: Assignment 1999. int o; 2000. assert(sizeof(uint32)==4); 2001. m=_TIFFmalloc(count*2*sizeof(uint32)); ^ 2002. if (m==NULL) 2003. { libtiff/tif_dirwrite.c:2031:3: Call 2029. } 2030. if (tif->tif_flags&TIFF_SWAB) 2031. TIFFSwabArrayOfLong(m,count*2); ^ 2032. o=TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_RATIONAL,count,count*8,&m[0]); 2033. _TIFFfree(m); libtiff/tif_swab.c:104:1: <Length trace> 102. 103. #ifndef TIFFSwabArrayOfLong 104. void ^ 105. TIFFSwabArrayOfLong(register uint32* lp, tmsize_t n) 106. { libtiff/tif_swab.c:104:1: Parameter `*lp` 102. 103. #ifndef TIFFSwabArrayOfLong 104. void ^ 105. TIFFSwabArrayOfLong(register uint32* lp, tmsize_t n) 106. { libtiff/tif_swab.c:112:3: Assignment 110. /* XXX unroll loop some */ 111. while (n-- > 0) { 112. cp = (unsigned char *)lp; ^ 113. t = cp[3]; cp[3] = cp[0]; cp[0] = t; 114. t = cp[2]; cp[2] = cp[1]; cp[1] = t; libtiff/tif_swab.c:113:7: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, +oo] by call to `TIFFWriteDirectoryTagRationalArray` 111. while (n-- > 0) { 112. cp = (unsigned char *)lp; 113. t = cp[3]; cp[3] = cp[0]; cp[0] = t; ^ 114. t = cp[2]; cp[2] = cp[1]; cp[1] = t; 115. lp++;
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L113
d2a_code_trace_data_43789
static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, long max) { const unsigned char *p = *pp; unsigned long ret = 0; int i; if (max-- < 1) return 0; if (*p == 0x80) { *inf = 1; p++; } else { *inf = 0; i = *p & 0x7f; if (*p++ & 0x80) { if (max < i + 1) return 0; while (i > 0 && *p == 0) { p++; i--; } if (i > (int)sizeof(long)) return 0; while (i > 0) { ret <<= 8; ret |= *p++; i--; } if (ret > LONG_MAX) return 0; } else ret = i; } *pp = p; *rl = (long)ret; return 1; } crypto/pkcs12/p12_decr.c:99: error: BUFFER_OVERRUN_L3 Offset: [2, +oo] Size: [1, +oo] by call to `ASN1_item_d2i`. Showing all 25 steps of the trace crypto/pkcs12/p12_decr.c:87:10: Call 85. int outlen; 86. 87. if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length, ^ 88. &out, &outlen, 0)) { 89. PKCS12err(PKCS12_F_PKCS12_ITEM_DECRYPT_D2I, crypto/pkcs12/p12_decr.c:19:1: Parameter `**data` 17. * OPENSSL_malloc'ed buffer 18. */ 19. > unsigned char *PKCS12_pbe_crypt(const X509_ALGOR *algor, 20. const char *pass, int passlen, 21. const unsigned char *in, int inlen, crypto/pkcs12/p12_decr.c:93:5: Assignment 91. return NULL; 92. } 93. p = out; ^ 94. OSSL_TRACE_BEGIN(PKCS12_DECRYPT) { 95. BIO_printf(trc_out, "\n"); crypto/pkcs12/p12_decr.c:99:11: Call 97. BIO_printf(trc_out, "\n"); 98. } OSSL_TRACE_END(PKCS12_DECRYPT); 99. ret = ASN1_item_d2i(NULL, &p, outlen, it); ^ 100. if (zbuf) 101. OPENSSL_cleanse(out, outlen); crypto/asn1/tasn_dec.c:105:1: Parameter `**in` 103. */ 104. 105. > ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval, 106. const unsigned char **in, long len, 107. const ASN1_ITEM *it) crypto/asn1/tasn_dec.c:114:9: Call 112. pval = &ptmpval; 113. asn1_tlc_clear_nc(&c); 114. if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0) ^ 115. return *pval; 116. return NULL; crypto/asn1/tasn_dec.c:119:1: Parameter `**in` 117. } 118. 119. > int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, 120. const ASN1_ITEM *it, 121. int tag, int aclass, char opt, ASN1_TLC *ctx) crypto/asn1/tasn_dec.c:124:10: Call 122. { 123. int rv; 124. rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0); ^ 125. if (rv <= 0) 126. ASN1_item_ex_free(pval, it); crypto/asn1/tasn_dec.c:135:1: Parameter `**in` 133. */ 134. 135. > static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in, 136. long len, const ASN1_ITEM *it, 137. int tag, int aclass, char opt, ASN1_TLC *ctx, crypto/asn1/tasn_dec.c:178:20: Call 176. goto err; 177. } 178. return asn1_template_ex_d2i(pval, in, len, ^ 179. it->templates, opt, ctx, depth); 180. } crypto/asn1/tasn_dec.c:437:1: Parameter `**in` 435. */ 436. 437. > static int asn1_template_ex_d2i(ASN1_VALUE **val, 438. const unsigned char **in, long inlen, 439. const ASN1_TEMPLATE *tt, char opt, crypto/asn1/tasn_dec.c:452:5: Assignment 450. aclass = flags & ASN1_TFLG_TAG_CLASS; 451. 452. p = *in; ^ 453. 454. /* Check if EXPLICIT tag expected */ crypto/asn1/tasn_dec.c:461:15: Call 459. * where it starts: so read in EXPLICIT header to get the info. 460. */ 461. ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst, ^ 462. &p, inlen, tt->tag, aclass, opt, ctx); 463. q = p; crypto/asn1/tasn_dec.c:1078:1: Parameter `**in` 1076. */ 1077. 1078. > static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, 1079. char *inf, char *cst, 1080. const unsigned char **in, long len, crypto/asn1/tasn_dec.c:1087:5: Assignment 1085. long plen; 1086. const unsigned char *p, *q; 1087. p = *in; ^ 1088. q = p; 1089. crypto/asn1/tasn_dec.c:1097:13: Call 1095. p += ctx->hdrlen; 1096. } else { 1097. i = ASN1_get_object(&p, &plen, &ptag, &pclass, len); ^ 1098. if (ctx) { 1099. ctx->ret = i; crypto/asn1/asn1_lib.c:44:1: Parameter `**pp` 42. } 43. 44. > int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, 45. int *pclass, long omax) 46. { crypto/asn1/asn1_lib.c:49:5: Assignment 47. int i, ret; 48. long l; 49. const unsigned char *p = *pp; ^ 50. int tag, xclass, inf; 51. long max = omax; crypto/asn1/asn1_lib.c:78:9: Assignment 76. } else { 77. tag = i; 78. p++; ^ 79. if (--max == 0) 80. goto err; crypto/asn1/asn1_lib.c:84:10: Call 82. *ptag = tag; 83. *pclass = xclass; 84. if (!asn1_get_length(&p, &inf, plength, max)) ^ 85. goto err; 86. crypto/asn1/asn1_lib.c:112:1: <Length trace> 110. * are stored most significant digit first. 111. */ 112. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, 113. long max) 114. { crypto/asn1/asn1_lib.c:112:1: Parameter `**pp` 110. * are stored most significant digit first. 111. */ 112. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, 113. long max) 114. { crypto/asn1/asn1_lib.c:115:5: Assignment 113. long max) 114. { 115. const unsigned char *p = *pp; ^ 116. unsigned long ret = 0; 117. int i; crypto/asn1/asn1_lib.c:127:14: Assignment 125. *inf = 0; 126. i = *p & 0x7f; 127. if (*p++ & 0x80) { ^ 128. if (max < i + 1) 129. return 0; crypto/asn1/asn1_lib.c:131:29: Array access: Offset: [2, +oo] Size: [1, +oo] by call to `ASN1_item_d2i` 129. return 0; 130. /* Skip leading zeroes */ 131. while (i > 0 && *p == 0) { ^ 132. p++; 133. i--;
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/asn1/asn1_lib.c/#L131
d2a_code_trace_data_43790
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/extensions_clnt.c:354: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 8]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 18 steps of the trace ssl/statem/extensions_clnt.c:338:1: Parameter `pkt->written` 336. #endif 337. 338. > int tls_construct_ctos_alpn(SSL *s, WPACKET *pkt, X509 *x, size_t chainidx, 339. int *al) 340. { ssl/statem/extensions_clnt.c:350:10: Call 348. return 1; 349. 350. if (!WPACKET_put_bytes_u16(pkt, ^ 351. TLSEXT_TYPE_application_layer_protocol_negotiation) 352. /* Sub-packet ALPN extension */ ssl/packet.c:289:1: Parameter `pkt->written` 287. } 288. 289. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 290. { 291. unsigned char *data; ssl/statem/extensions_clnt.c:353:17: Call 351. TLSEXT_TYPE_application_layer_protocol_negotiation) 352. /* Sub-packet ALPN extension */ 353. || !WPACKET_start_sub_packet_u16(pkt) ^ 354. || !WPACKET_sub_memcpy_u16(pkt, s->ext.alpn, s->ext.alpn_len) 355. || !WPACKET_close(pkt)) { ssl/packet.c:252:1: Parameter `pkt->written` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/statem/extensions_clnt.c:354:17: Call 352. /* Sub-packet ALPN extension */ 353. || !WPACKET_start_sub_packet_u16(pkt) 354. || !WPACKET_sub_memcpy_u16(pkt, s->ext.alpn, s->ext.alpn_len) ^ 355. || !WPACKET_close(pkt)) { 356. SSLerr(SSL_F_TLS_CONSTRUCT_CTOS_ALPN, ERR_R_INTERNAL_ERROR); ssl/packet.c:348:10: Call 346. size_t lenbytes) 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 349. || !WPACKET_memcpy(pkt, src, len) 350. || !WPACKET_close(pkt)) ssl/packet.c:252:1: Parameter `pkt->buf->length` 250. } 251. 252. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 253. { 254. WPACKET_SUB *sub; ssl/packet.c:349:17: Call 347. { 348. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) 349. || !WPACKET_memcpy(pkt, src, len) ^ 350. || !WPACKET_close(pkt)) 351. return 0; ssl/packet.c:330:1: Parameter `pkt->written` 328. } 329. 330. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 331. { 332. unsigned char *dest; ssl/packet.c:337:10: Call 335. return 1; 336. 337. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 338. return 0; 339. ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 8]):unsigned64 by call to `WPACKET_sub_memcpy__` 47. return 0; 48. 49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 50. size_t newlen; 51. size_t reflen;
https://github.com/openssl/openssl/blob/f61c5ca6ca183bf0a51651857e3efb02a98889ad/ssl/packet.c/#L49
d2a_code_trace_data_43791
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:86: error: Integer Overflow L2 ([1, +oo] - 6):unsigned32 by call to `bitstream_read`. libavcodec/mpc7.c:86:19: Call 84. c->IS = bitstream_read_bit(&bc); 85. c->MSS = bitstream_read_bit(&bc); 86. c->maxbands = bitstream_read(&bc, 6); ^ 87. if(c->maxbands >= BANDS){ 88. av_log(avctx, AV_LOG_ERROR, "Too many bands: %i\n", c->maxbands); 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_43792
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:1855: error: Null Dereference pointer `&gb->buffer` last assigned on line 1853 could be null and is dereferenced by call to `get_bits1()` at line 1855, column 22. libavcodec/vp3.c:1843:1: start of procedure vp3_decode_frame() 1841. } 1842. 1843. static int vp3_decode_frame(AVCodecContext *avctx, ^ 1844. void *data, int *data_size, 1845. AVPacket *avpkt) libavcodec/vp3.c:1847:5: 1845. AVPacket *avpkt) 1846. { 1847. const uint8_t *buf = avpkt->data; ^ 1848. int buf_size = avpkt->size; 1849. Vp3DecodeContext *s = avctx->priv_data; libavcodec/vp3.c:1848:5: 1846. { 1847. const uint8_t *buf = avpkt->data; 1848. int buf_size = avpkt->size; ^ 1849. Vp3DecodeContext *s = avctx->priv_data; 1850. GetBitContext gb; libavcodec/vp3.c:1849:5: 1847. const uint8_t *buf = avpkt->data; 1848. int buf_size = avpkt->size; 1849. Vp3DecodeContext *s = avctx->priv_data; ^ 1850. GetBitContext gb; 1851. int i; libavcodec/vp3.c:1853:5: 1851. int i; 1852. 1853. init_get_bits(&gb, buf, buf_size * 8); ^ 1854. 1855. if (s->theora && get_bits1(&gb)) libavcodec/get_bits.h:383:1: start of procedure init_get_bits() 381. * responsible for checking for the buffer end yourself (take advantage of the padding)! 382. */ 383. static inline void init_get_bits(GetBitContext *s, ^ 384. const uint8_t *buffer, int bit_size) 385. { libavcodec/get_bits.h:386:5: 384. const uint8_t *buffer, int bit_size) 385. { 386. int buffer_size = (bit_size+7)>>3; ^ 387. if (buffer_size < 0 || bit_size < 0) { 388. buffer_size = bit_size = 0; libavcodec/get_bits.h:387:9: Taking true branch 385. { 386. int buffer_size = (bit_size+7)>>3; 387. if (buffer_size < 0 || bit_size < 0) { ^ 388. buffer_size = bit_size = 0; 389. buffer = NULL; libavcodec/get_bits.h:388:9: 386. int buffer_size = (bit_size+7)>>3; 387. if (buffer_size < 0 || bit_size < 0) { 388. buffer_size = bit_size = 0; ^ 389. buffer = NULL; 390. } libavcodec/get_bits.h:389:9: 387. if (buffer_size < 0 || bit_size < 0) { 388. buffer_size = bit_size = 0; 389. buffer = NULL; ^ 390. } 391. libavcodec/get_bits.h:392:5: 390. } 391. 392. s->buffer = buffer; ^ 393. s->size_in_bits = bit_size; 394. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:393:5: 391. 392. s->buffer = buffer; 393. s->size_in_bits = bit_size; ^ 394. s->buffer_end = buffer + buffer_size; 395. #ifdef ALT_BITSTREAM_READER libavcodec/get_bits.h:394:5: 392. s->buffer = buffer; 393. s->size_in_bits = bit_size; 394. s->buffer_end = buffer + buffer_size; ^ 395. #ifdef ALT_BITSTREAM_READER 396. s->index = 0; libavcodec/get_bits.h:396:5: 394. s->buffer_end = buffer + buffer_size; 395. #ifdef ALT_BITSTREAM_READER 396. s->index = 0; ^ 397. #elif defined A32_BITSTREAM_READER 398. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3); libavcodec/get_bits.h:402:1: return from a call to init_get_bits 400. skip_bits_long(s, 0); 401. #endif 402. } ^ 403. 404. static inline void align_get_bits(GetBitContext *s) libavcodec/vp3.c:1855:9: Taking true branch 1853. init_get_bits(&gb, buf, buf_size * 8); 1854. 1855. if (s->theora && get_bits1(&gb)) ^ 1856. { 1857. av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n"); libavcodec/vp3.c:1855:22: 1853. init_get_bits(&gb, buf, buf_size * 8); 1854. 1855. if (s->theora && get_bits1(&gb)) ^ 1856. { 1857. av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n"); libavcodec/get_bits.h:303:1: start of procedure get_bits1() 301. } 302. 303. static inline unsigned int get_bits1(GetBitContext *s){ ^ 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; libavcodec/get_bits.h:305:5: 303. static inline unsigned int get_bits1(GetBitContext *s){ 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; ^ 306. uint8_t result = s->buffer[index>>3]; 307. #ifdef ALT_BITSTREAM_READER_LE libavcodec/get_bits.h:306:5: 304. #ifdef ALT_BITSTREAM_READER 305. unsigned int index = s->index; 306. uint8_t result = s->buffer[index>>3]; ^ 307. #ifdef ALT_BITSTREAM_READER_LE 308. result >>= index & 7;
https://github.com/libav/libav/blob/f3a29b750a5979ae6847879fba758faf1fae88d0/libavcodec/vp3.c/#L1855
d2a_code_trace_data_43793
static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ if(block->type & BLOCK_INTRA){ int x, y; const int color = block->color[plane_index]; const int color4= color*0x01010101; if(b_w==32){ for(y=0; y < b_h; y++){ *(uint32_t*)&dst[0 + y*stride]= color4; *(uint32_t*)&dst[4 + y*stride]= color4; *(uint32_t*)&dst[8 + y*stride]= color4; *(uint32_t*)&dst[12+ y*stride]= color4; *(uint32_t*)&dst[16+ y*stride]= color4; *(uint32_t*)&dst[20+ y*stride]= color4; *(uint32_t*)&dst[24+ y*stride]= color4; *(uint32_t*)&dst[28+ y*stride]= color4; } }else if(b_w==16){ for(y=0; y < b_h; y++){ *(uint32_t*)&dst[0 + y*stride]= color4; *(uint32_t*)&dst[4 + y*stride]= color4; *(uint32_t*)&dst[8 + y*stride]= color4; *(uint32_t*)&dst[12+ y*stride]= color4; } }else if(b_w==8){ for(y=0; y < b_h; y++){ *(uint32_t*)&dst[0 + y*stride]= color4; *(uint32_t*)&dst[4 + y*stride]= color4; } }else if(b_w==4){ for(y=0; y < b_h; y++){ *(uint32_t*)&dst[0 + y*stride]= color4; } }else{ for(y=0; y < b_h; y++){ for(x=0; x < b_w; x++){ dst[x + y*stride]= color; } } } }else{ uint8_t *src= s->last_picture[block->ref].data[plane_index]; const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; int mx= block->mx*scale; int my= block->my*scale; const int dx= mx&15; const int dy= my&15; const int tab_index= 3 - (b_w>>2) + (b_w>>4); sx += (mx>>4) - (HTAPS_MAX/2-1); sy += (my>>4) - (HTAPS_MAX/2-1); src += sx + sy*stride; if( (unsigned)sx >= w - b_w - (HTAPS_MAX-2) || (unsigned)sy >= h - b_h - (HTAPS_MAX-2)){ ff_emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+HTAPS_MAX-1, b_h+HTAPS_MAX-1, sx, sy, w, h); src= tmp + MB_SIZE; } assert(b_w>1 && b_h>1); assert((tab_index>=0 && tab_index<4) || b_w==32); if((dx&3) || (dy&3) || !(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h) || (b_w&(b_w-1)) || !s->plane[plane_index].fast_mc ) mc_block(&s->plane[plane_index], dst, src, tmp, stride, b_w, b_h, dx, dy); else if(b_w==32){ int y; for(y=0; y<b_h; y+=16){ s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + y*stride, src + 3 + (y+3)*stride,stride); s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + 16 + y*stride, src + 19 + (y+3)*stride,stride); } }else if(b_w==b_h) s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst,src + 3 + 3*stride,stride); else if(b_w==2*b_h){ s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst ,src + 3 + 3*stride,stride); s->dsp.put_h264_qpel_pixels_tab[tab_index+1][dy+(dx>>2)](dst+b_h,src + 3 + b_h + 3*stride,stride); }else{ assert(2*b_w==b_h); s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst ,src + 3 + 3*stride ,stride); s->dsp.put_h264_qpel_pixels_tab[tab_index ][dy+(dx>>2)](dst+b_w*stride,src + 3 + 3*stride+b_w*stride,stride); } } } libavcodec/snow.c:2366: error: Buffer Overrun L2 Offset: [0, 18] Size: 16. libavcodec/snow.c:2302:1: <Offset trace> 2300. mca( 8, 8,8) 2301. 2302. static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ ^ 2303. if(block->type & BLOCK_INTRA){ 2304. int x, y; libavcodec/snow.c:2302:1: Parameter `s->mv_scale` 2300. mca( 8, 8,8) 2301. 2302. static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ ^ 2303. if(block->type & BLOCK_INTRA){ 2304. int x, y; libavcodec/snow.c:2343:26: Assignment 2341. }else{ 2342. uint8_t *src= s->last_picture[block->ref].data[plane_index]; 2343. const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; ^ 2344. int mx= block->mx*scale; 2345. int my= block->my*scale; libavcodec/snow.c:2343:9: Assignment 2341. }else{ 2342. uint8_t *src= s->last_picture[block->ref].data[plane_index]; 2343. const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; ^ 2344. int mx= block->mx*scale; 2345. int my= block->my*scale; libavcodec/snow.c:2344:9: Assignment 2342. uint8_t *src= s->last_picture[block->ref].data[plane_index]; 2343. const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; 2344. int mx= block->mx*scale; ^ 2345. int my= block->my*scale; 2346. const int dx= mx&15; libavcodec/snow.c:2346:9: Assignment 2344. int mx= block->mx*scale; 2345. int my= block->my*scale; 2346. const int dx= mx&15; ^ 2347. const int dy= my&15; 2348. const int tab_index= 3 - (b_w>>2) + (b_w>>4); libavcodec/snow.c:2302:1: <Length trace> 2300. mca( 8, 8,8) 2301. 2302. static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ ^ 2303. if(block->type & BLOCK_INTRA){ 2304. int x, y; libavcodec/snow.c:2302:1: Parameter `s->dsp.put_h264_qpel_pixels_tab[*][*]` 2300. mca( 8, 8,8) 2301. 2302. static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){ ^ 2303. if(block->type & BLOCK_INTRA){ 2304. int x, y; libavcodec/snow.c:2366:17: Array access: Offset: [0, 18] Size: 16 2364. int y; 2365. for(y=0; y<b_h; y+=16){ 2366. s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + y*stride, src + 3 + (y+3)*stride,stride); ^ 2367. s->dsp.put_h264_qpel_pixels_tab[0][dy+(dx>>2)](dst + 16 + y*stride, src + 19 + (y+3)*stride,stride); 2368. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/snow.c/#L2366
d2a_code_trace_data_43794
static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) { tls_curve_info *cinfo; if (curve[0]) return 1; if ((curve[1] < 1) || ((size_t)curve[1] > sizeof(nid_list)/sizeof(nid_list[0]))) return 0; cinfo = &nid_list[curve[1]-1]; return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve); } ssl/t1_lib.c:523: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: 28 by call to `tls_curve_allowed`. Showing all 7 steps of the trace ssl/t1_lib.c:275:1: Array declaration 273. }; 274. 275. > static const unsigned char eccurves_default[] = 276. { 277. 0,14, /* sect571r1 (14) */ ssl/t1_lib.c:523:10: Call 521. if (pref[0] == tsupp[0] && pref[1] == tsupp[1]) 522. { 523. if (!tls_curve_allowed(s, pref, SSL_SECOP_CURVE_SHARED)) ^ 524. continue; 525. if (nmatch == k) ssl/t1_lib.c:429:1: <Offset trace> 427. 428. /* See if curve is allowed by security callback */ 429. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 430. { 431. tls_curve_info *cinfo; ssl/t1_lib.c:429:1: Parameter `*curve` 427. 428. /* See if curve is allowed by security callback */ 429. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 430. { 431. tls_curve_info *cinfo; ssl/t1_lib.c:235:1: <Length trace> 233. #define TLS_CURVE_PRIME 0x0 234. 235. > static tls_curve_info nid_list[] = 236. { 237. {NID_sect163k1, 80, TLS_CURVE_CHAR2},/* sect163k1 (1) */ ssl/t1_lib.c:235:1: Array declaration 233. #define TLS_CURVE_PRIME 0x0 234. 235. > static tls_curve_info nid_list[] = 236. { 237. {NID_sect163k1, 80, TLS_CURVE_CHAR2},/* sect163k1 (1) */ ssl/t1_lib.c:437:2: Array access: Offset: [-1, +oo] Size: 28 by call to `tls_curve_allowed` 435. sizeof(nid_list)/sizeof(nid_list[0]))) 436. return 0; 437. cinfo = &nid_list[curve[1]-1]; ^ 438. return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve); 439. }
https://github.com/openssl/openssl/blob/dbb7654dc189992966ecd95ca66f7a3bb011ab9b/ssl/t1_lib.c/#L437
d2a_code_trace_data_43795
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { assert(pkt->subs != NULL && len != 0); if (pkt->subs == NULL || len == 0) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->buf->length - pkt->written < len) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } *allocbytes = (unsigned char *)pkt->buf->data + pkt->curr; return 1; } ssl/statem/statem_srvr.c:860: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 5]):unsigned64 by call to `WPACKET_sub_memcpy__`. Showing all 16 steps of the trace ssl/statem/statem_srvr.c:855:1: Parameter `pkt->written` 853. #endif 854. 855. > int dtls_raw_hello_verify_request(WPACKET *pkt, unsigned char *cookie, 856. size_t cookie_len) 857. { ssl/statem/statem_srvr.c:859:10: Call 857. { 858. /* Always use DTLS 1.0 version: see RFC 6347 */ 859. if (!WPACKET_put_bytes_u16(pkt, DTLS1_VERSION) ^ 860. || !WPACKET_sub_memcpy_u8(pkt, cookie, cookie_len)) 861. return 0; 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/statem/statem_srvr.c:860:17: Call 858. /* Always use DTLS 1.0 version: see RFC 6347 */ 859. if (!WPACKET_put_bytes_u16(pkt, DTLS1_VERSION) 860. || !WPACKET_sub_memcpy_u8(pkt, cookie, cookie_len)) ^ 861. return 0; 862. ssl/packet.c:320:10: Call 318. size_t lenbytes) 319. { 320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) ^ 321. || !WPACKET_memcpy(pkt, src, len) 322. || !WPACKET_close(pkt)) ssl/packet.c:224:1: Parameter `pkt->buf->length` 222. } 223. 224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 225. { 226. WPACKET_SUB *sub; ssl/packet.c:321:17: Call 319. { 320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes) 321. || !WPACKET_memcpy(pkt, src, len) ^ 322. || !WPACKET_close(pkt)) 323. return 0; ssl/packet.c:302:1: Parameter `pkt->written` 300. } 301. 302. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 303. { 304. unsigned char *dest; ssl/packet.c:309:10: Call 307. return 1; 308. 309. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 310. return 0; 311. ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:36:1: <LHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `pkt->buf->length` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: <RHS trace> 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:36:1: Parameter `len` 34. } 35. 36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 37. { 38. /* Internal API, so should not fail */ ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 5]):unsigned64 by call to `WPACKET_sub_memcpy__` 44. return 0; 45. 46. if (pkt->buf->length - pkt->written < len) { ^ 47. size_t newlen; 48. size_t reflen;
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/packet.c/#L46
d2a_code_trace_data_43796
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:107: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_clear`. Showing all 17 steps of the trace test/sslapitest.c:93:10: Call 91. } 92. 93. if (!create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, NULL)) { ^ 94. printf("Unable to create SSL objects\n"); 95. goto end; test/ssltestlib.c:579:21: Call 577. 578. if (*sssl == NULL) 579. serverssl = SSL_new(serverctx); ^ 580. else 581. serverssl = *sssl; ssl/ssl_lib.c:519:1: Parameter `ctx->sessions->num_items` 517. } 518. 519. > SSL *SSL_new(SSL_CTX *ctx) 520. { 521. SSL *s; test/sslapitest.c:107:10: Call 105. * doesn't leak (when using enable-crypto-mdebug). 106. */ 107. if (!SSL_clear(serverssl)) { ^ 108. printf("Unexpected failure from SSL_clear()\n"); 109. goto end; ssl/ssl_lib.c:442:1: Parameter `s->initial_ctx->sessions->num_items` 440. } 441. 442. > int SSL_clear(SSL *s) 443. { 444. if (s->method == NULL) { ssl/ssl_lib.c:449:9: Call 447. } 448. 449. if (ssl_clear_bad_session(s)) { ^ 450. SSL_SESSION_free(s->session); 451. s->session = NULL; ssl/ssl_sess.c:1026:1: Parameter `s->initial_ctx->sessions->num_items` 1024. } 1025. 1026. > int ssl_clear_bad_session(SSL *s) 1027. { 1028. if ((s->session != NULL) && ssl/ssl_sess.c:1031:9: Call 1029. !(s->shutdown & SSL_SENT_SHUTDOWN) && 1030. !(SSL_in_init(s) || SSL_in_before(s))) { 1031. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 1032. return (1); 1033. } else ssl/ssl_sess.c:715:1: Parameter `ctx->sessions->num_items` 713. } 714. 715. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 716. { 717. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:717:12: Call 715. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 716. { 717. return remove_session_lock(ctx, c, 1); ^ 718. } 719. ssl/ssl_sess.c:720:1: Parameter `ctx->sessions->num_items` 718. } 719. 720. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 721. { 722. SSL_SESSION *r; ssl/ssl_sess.c:730:17: Call 728. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 729. ret = 1; 730. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 731. SSL_SESSION_list_remove(ctx, c); 732. } ssl/ssl_locl.h:605:1: Parameter `lh->num_items` 603. }; 604. 605. > DEFINE_LHASH_OF(SSL_SESSION); 606. /* Needed in ssl_cert.c */ 607. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:605:1: Call 603. }; 604. 605. > DEFINE_LHASH_OF(SSL_SESSION); 606. /* Needed in ssl_cert.c */ 607. 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_clear` 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/1ea01427c5195dafa4f00202237c5b7a389f034b/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_43797
static void rtmp_calc_digest(const uint8_t *src, int len, int gap, const uint8_t *key, int keylen, uint8_t *dst) { struct AVSHA *sha; uint8_t hmac_buf[64+32] = {0}; int i; sha = av_mallocz(av_sha_size); if (keylen < 64) { memcpy(hmac_buf, key, keylen); } else { av_sha_init(sha, 256); av_sha_update(sha,key, keylen); av_sha_final(sha, hmac_buf); } for (i = 0; i < 64; i++) hmac_buf[i] ^= HMAC_IPAD_VAL; av_sha_init(sha, 256); av_sha_update(sha, hmac_buf, 64); if (gap <= 0) { av_sha_update(sha, src, len); } else { av_sha_update(sha, src, gap); av_sha_update(sha, src + gap + 32, len - gap - 32); } av_sha_final(sha, hmac_buf + 64); for (i = 0; i < 64; i++) hmac_buf[i] ^= HMAC_IPAD_VAL ^ HMAC_OPAD_VAL; av_sha_init(sha, 256); av_sha_update(sha, hmac_buf, 64+32); av_sha_final(sha, dst); av_free(sha); } libavformat/rtmpproto.c:384: error: Null Dereference pointer `sha` last assigned on line 379 could be null and is dereferenced by call to `av_sha_init()` at line 384, column 9. libavformat/rtmpproto.c:372:1: start of procedure rtmp_calc_digest() 370. * @param dst buffer where calculated digest will be stored (32 bytes) 371. */ 372. static void rtmp_calc_digest(const uint8_t *src, int len, int gap, ^ 373. const uint8_t *key, int keylen, uint8_t *dst) 374. { libavformat/rtmpproto.c:376:5: 374. { 375. struct AVSHA *sha; 376. uint8_t hmac_buf[64+32] = {0}; ^ 377. int i; 378. libavformat/rtmpproto.c:379:5: 377. int i; 378. 379. sha = av_mallocz(av_sha_size); ^ 380. 381. if (keylen < 64) { libavutil/mem.c:154:1: start of procedure av_mallocz() 152. } 153. 154. void *av_mallocz(size_t size) ^ 155. { 156. void *ptr = av_malloc(size); libavutil/mem.c:156:5: 154. void *av_mallocz(size_t size) 155. { 156. void *ptr = av_malloc(size); ^ 157. if (ptr) 158. memset(ptr, 0, size); libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(size_t size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(size_t size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking true branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:73:9: 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) 73. return NULL; ^ 74. 75. #if CONFIG_MEMALIGN_HACK libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavutil/mem.c:157:9: Taking false branch 155. { 156. void *ptr = av_malloc(size); 157. if (ptr) ^ 158. memset(ptr, 0, size); 159. return ptr; libavutil/mem.c:159:5: 157. if (ptr) 158. memset(ptr, 0, size); 159. return ptr; ^ 160. } 161. libavutil/mem.c:160:1: return from a call to av_mallocz 158. memset(ptr, 0, size); 159. return ptr; 160. } ^ 161. 162. char *av_strdup(const char *s) libavformat/rtmpproto.c:381:9: Taking false branch 379. sha = av_mallocz(av_sha_size); 380. 381. if (keylen < 64) { ^ 382. memcpy(hmac_buf, key, keylen); 383. } else { libavformat/rtmpproto.c:384:9: 382. memcpy(hmac_buf, key, keylen); 383. } else { 384. av_sha_init(sha, 256); ^ 385. av_sha_update(sha,key, keylen); 386. av_sha_final(sha, hmac_buf); libavutil/sha.c:245:1: start of procedure av_sha_init() 243. 244. 245. int av_sha_init(AVSHA* ctx, int bits) ^ 246. { 247. ctx->digest_len = bits >> 5; libavutil/sha.c:247:5: 245. int av_sha_init(AVSHA* ctx, int bits) 246. { 247. ctx->digest_len = bits >> 5; ^ 248. switch (bits) { 249. case 160: // SHA-1
https://github.com/libav/libav/blob/be64629a135642f20325e1422352707bb81d5c91/libavformat/rtmpproto.c/#L384
d2a_code_trace_data_43798
static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) { int j; size_t len; const char *s, *ss, *p; if (dir == NULL || !*dir) { X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY); return 0; } s = dir; p = s; do { if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) { BY_DIR_ENTRY *ent; ss = s; s = p + 1; len = p - ss; if (len == 0) continue; for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) { ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j); if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0) break; } if (j < sk_BY_DIR_ENTRY_num(ctx->dirs)) continue; if (ctx->dirs == NULL) { ctx->dirs = sk_BY_DIR_ENTRY_new_null(); if (!ctx->dirs) { X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE); return 0; } } ent = OPENSSL_malloc(sizeof(*ent)); if (ent == NULL) return 0; ent->dir_type = type; ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp); ent->dir = OPENSSL_strndup(ss, len); if (ent->dir == NULL || ent->hashes == NULL) { by_dir_entry_free(ent); return 0; } if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) { by_dir_entry_free(ent); return 0; } } } while (*p++ != '\0'); return 1; } crypto/x509/by_dir.c:197: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_strndup()` at line 191, column 24 is not reachable after line 197, column 17. Showing all 103 steps of the trace crypto/x509/by_dir.c:151:1: start of procedure add_cert_dir() 149. } 150. 151. > static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) 152. { 153. int j; crypto/x509/by_dir.c:157:9: Taking false branch 155. const char *s, *ss, *p; 156. 157. if (dir == NULL || !*dir) { ^ 158. X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY); 159. return 0; crypto/x509/by_dir.c:157:25: Taking false branch 155. const char *s, *ss, *p; 156. 157. if (dir == NULL || !*dir) { ^ 158. X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY); 159. return 0; crypto/x509/by_dir.c:162:5: 160. } 161. 162. > s = dir; 163. p = s; 164. do { crypto/x509/by_dir.c:163:5: 161. 162. s = dir; 163. > p = s; 164. do { 165. if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) { crypto/x509/by_dir.c:165:14: Taking true branch 163. p = s; 164. do { 165. if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) { ^ 166. BY_DIR_ENTRY *ent; 167. ss = s; crypto/x509/by_dir.c:167:13: 165. if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) { 166. BY_DIR_ENTRY *ent; 167. > ss = s; 168. s = p + 1; 169. len = p - ss; crypto/x509/by_dir.c:168:13: 166. BY_DIR_ENTRY *ent; 167. ss = s; 168. > s = p + 1; 169. len = p - ss; 170. if (len == 0) crypto/x509/by_dir.c:169:13: 167. ss = s; 168. s = p + 1; 169. > len = p - ss; 170. if (len == 0) 171. continue; crypto/x509/by_dir.c:170:17: Taking false branch 168. s = p + 1; 169. len = p - ss; 170. if (len == 0) ^ 171. continue; 172. for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) { crypto/x509/by_dir.c:172:18: 170. if (len == 0) 171. continue; 172. > for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) { 173. ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j); 174. if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0) crypto/x509/by_dir.c:172:25: 170. if (len == 0) 171. continue; 172. > for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) { 173. ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j); 174. if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0) crypto/x509/x509_lcl.h:142:1: start of procedure sk_BY_DIR_ENTRY_num() 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. DEFINE_STACK_OF(BY_DIR_HASH) 142. > DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 144. DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) crypto/stack/stack.c:277:1: start of procedure OPENSSL_sk_num() 275. } 276. 277. > int OPENSSL_sk_num(const OPENSSL_STACK *st) 278. { 279. if (st == NULL) crypto/stack/stack.c:279:9: Taking true branch 277. int OPENSSL_sk_num(const OPENSSL_STACK *st) 278. { 279. if (st == NULL) ^ 280. return -1; 281. return st->num; crypto/stack/stack.c:280:9: 278. { 279. if (st == NULL) 280. > return -1; 281. return st->num; 282. } crypto/stack/stack.c:282:1: return from a call to OPENSSL_sk_num 280. return -1; 281. return st->num; 282. > } 283. 284. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) crypto/x509/x509_lcl.h:142:1: return from a call to sk_BY_DIR_ENTRY_num 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. DEFINE_STACK_OF(BY_DIR_HASH) 142. > DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 144. DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) crypto/x509/by_dir.c:172:25: Loop condition is false. Leaving loop 170. if (len == 0) 171. continue; 172. for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) { ^ 173. ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j); 174. if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0) crypto/x509/by_dir.c:177:17: 175. break; 176. } 177. > if (j < sk_BY_DIR_ENTRY_num(ctx->dirs)) 178. continue; 179. if (ctx->dirs == NULL) { crypto/x509/x509_lcl.h:142:1: start of procedure sk_BY_DIR_ENTRY_num() 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. DEFINE_STACK_OF(BY_DIR_HASH) 142. > DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 144. DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) crypto/stack/stack.c:277:1: start of procedure OPENSSL_sk_num() 275. } 276. 277. > int OPENSSL_sk_num(const OPENSSL_STACK *st) 278. { 279. if (st == NULL) crypto/stack/stack.c:279:9: Taking true branch 277. int OPENSSL_sk_num(const OPENSSL_STACK *st) 278. { 279. if (st == NULL) ^ 280. return -1; 281. return st->num; crypto/stack/stack.c:280:9: 278. { 279. if (st == NULL) 280. > return -1; 281. return st->num; 282. } crypto/stack/stack.c:282:1: return from a call to OPENSSL_sk_num 280. return -1; 281. return st->num; 282. > } 283. 284. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) crypto/x509/x509_lcl.h:142:1: return from a call to sk_BY_DIR_ENTRY_num 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. DEFINE_STACK_OF(BY_DIR_HASH) 142. > DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 144. DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) crypto/x509/by_dir.c:177:17: Taking false branch 175. break; 176. } 177. if (j < sk_BY_DIR_ENTRY_num(ctx->dirs)) ^ 178. continue; 179. if (ctx->dirs == NULL) { crypto/x509/by_dir.c:179:17: Taking true branch 177. if (j < sk_BY_DIR_ENTRY_num(ctx->dirs)) 178. continue; 179. if (ctx->dirs == NULL) { ^ 180. ctx->dirs = sk_BY_DIR_ENTRY_new_null(); 181. if (!ctx->dirs) { crypto/x509/by_dir.c:180:17: 178. continue; 179. if (ctx->dirs == NULL) { 180. > ctx->dirs = sk_BY_DIR_ENTRY_new_null(); 181. if (!ctx->dirs) { 182. X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE); crypto/x509/x509_lcl.h:142:1: start of procedure sk_BY_DIR_ENTRY_new_null() 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. DEFINE_STACK_OF(BY_DIR_HASH) 142. > DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 144. DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) crypto/stack/stack.c:99:1: start of procedure OPENSSL_sk_new_null() 97. } 98. 99. > OPENSSL_STACK *OPENSSL_sk_new_null(void) 100. { 101. return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL); crypto/stack/stack.c:101:5: Skipping OPENSSL_sk_new(): empty list of specs 99. OPENSSL_STACK *OPENSSL_sk_new_null(void) 100. { 101. return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL); ^ 102. } 103. crypto/stack/stack.c:102:1: return from a call to OPENSSL_sk_new_null 100. { 101. return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL); 102. > } 103. 104. OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c) crypto/x509/x509_lcl.h:142:1: return from a call to sk_BY_DIR_ENTRY_new_null 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. DEFINE_STACK_OF(BY_DIR_HASH) 142. > DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 144. DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) crypto/x509/by_dir.c:181:22: Taking false branch 179. if (ctx->dirs == NULL) { 180. ctx->dirs = sk_BY_DIR_ENTRY_new_null(); 181. if (!ctx->dirs) { ^ 182. X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE); 183. return 0; crypto/x509/by_dir.c:186:13: 184. } 185. } 186. > ent = OPENSSL_malloc(sizeof(*ent)); 187. if (ent == NULL) 188. return 0; crypto/mem.c:170:1: start of procedure CRYPTO_malloc() 168. #endif 169. 170. > void *CRYPTO_malloc(size_t num, const char *file, int line) 171. { 172. void *ret = NULL; crypto/mem.c:172:5: 170. void *CRYPTO_malloc(size_t num, const char *file, int line) 171. { 172. > void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:174:9: Taking true branch 172. void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 175. return malloc_impl(num, file, line); 176. crypto/mem.c:174:32: Taking true branch 172. void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 175. return malloc_impl(num, file, line); 176. crypto/mem.c:175:9: Skipping __function_pointer__(): unresolved function pointer 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) 175. return malloc_impl(num, file, line); ^ 176. 177. if (num == 0) crypto/mem.c:196:1: return from a call to CRYPTO_malloc 194. 195. return ret; 196. > } 197. 198. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/x509/by_dir.c:187:17: Taking false branch 185. } 186. ent = OPENSSL_malloc(sizeof(*ent)); 187. if (ent == NULL) ^ 188. return 0; 189. ent->dir_type = type; crypto/x509/by_dir.c:189:13: 187. if (ent == NULL) 188. return 0; 189. > ent->dir_type = type; 190. ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp); 191. ent->dir = OPENSSL_strndup(ss, len); crypto/x509/by_dir.c:190:13: 188. return 0; 189. ent->dir_type = type; 190. > ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp); 191. ent->dir = OPENSSL_strndup(ss, len); 192. if (ent->dir == NULL || ent->hashes == NULL) { crypto/x509/x509_lcl.h:141:1: start of procedure sk_BY_DIR_HASH_new() 139. typedef struct lookup_dir_hashes_st BY_DIR_HASH; 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. > DEFINE_STACK_OF(BY_DIR_HASH) 142. DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; crypto/x509/x509_lcl.h:141:1: return from a call to sk_BY_DIR_HASH_new 139. typedef struct lookup_dir_hashes_st BY_DIR_HASH; 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. > DEFINE_STACK_OF(BY_DIR_HASH) 142. DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; crypto/x509/by_dir.c:191:13: 189. ent->dir_type = type; 190. ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp); 191. > ent->dir = OPENSSL_strndup(ss, len); 192. if (ent->dir == NULL || ent->hashes == NULL) { 193. by_dir_entry_free(ent); crypto/o_str.c:39:1: start of procedure CRYPTO_strndup() 37. } 38. 39. > char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line) 40. { 41. size_t maxlen; crypto/o_str.c:44:9: Taking false branch 42. char *ret; 43. 44. if (str == NULL) ^ 45. return NULL; 46. crypto/o_str.c:47:5: 45. return NULL; 46. 47. > maxlen = OPENSSL_strnlen(str, s); 48. 49. ret = CRYPTO_malloc(maxlen + 1, file, line); crypto/o_str.c:72:1: start of procedure OPENSSL_strnlen() 70. } 71. 72. > size_t OPENSSL_strnlen(const char *str, size_t maxlen) 73. { 74. const char *p; crypto/o_str.c:76:10: 74. const char *p; 75. 76. > for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ; 77. 78. return p - str; crypto/o_str.c:76:19: Loop condition is true. Entering loop body 74. const char *p; 75. 76. for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ; ^ 77. 78. return p - str; crypto/o_str.c:76:36: Loop condition is true. Entering loop body 74. const char *p; 75. 76. for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ; ^ 77. 78. return p - str; crypto/o_str.c:76:48: 74. const char *p; 75. 76. > for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ; 77. 78. return p - str; crypto/o_str.c:76:19: Loop condition is true. Entering loop body 74. const char *p; 75. 76. for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ; ^ 77. 78. return p - str; crypto/o_str.c:76:36: Loop condition is false. Leaving loop 74. const char *p; 75. 76. for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ; ^ 77. 78. return p - str; crypto/o_str.c:78:5: 76. for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ; 77. 78. > return p - str; 79. } 80. crypto/o_str.c:79:1: return from a call to OPENSSL_strnlen 77. 78. return p - str; 79. > } 80. 81. size_t OPENSSL_strlcpy(char *dst, const char *src, size_t size) crypto/o_str.c:49:5: 47. maxlen = OPENSSL_strnlen(str, s); 48. 49. > ret = CRYPTO_malloc(maxlen + 1, file, line); 50. if (ret) { 51. memcpy(ret, str, maxlen); crypto/mem.c:170:1: start of procedure CRYPTO_malloc() 168. #endif 169. 170. > void *CRYPTO_malloc(size_t num, const char *file, int line) 171. { 172. void *ret = NULL; crypto/mem.c:172:5: 170. void *CRYPTO_malloc(size_t num, const char *file, int line) 171. { 172. > void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:174:9: Taking false branch 172. void *ret = NULL; 173. 174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 175. return malloc_impl(num, file, line); 176. crypto/mem.c:177:9: Taking false branch 175. return malloc_impl(num, file, line); 176. 177. if (num == 0) ^ 178. return NULL; 179. crypto/mem.c:181:5: 179. 180. FAILTEST(); 181. > allow_customize = 0; 182. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 183. if (call_malloc_debug) { crypto/mem.c:191:5: 189. } 190. #else 191. > (void)(file); (void)(line); 192. ret = malloc(num); 193. #endif crypto/mem.c:191:19: 189. } 190. #else 191. > (void)(file); (void)(line); 192. ret = malloc(num); 193. #endif crypto/mem.c:192:5: 190. #else 191. (void)(file); (void)(line); 192. > ret = malloc(num); 193. #endif 194. crypto/mem.c:195:5: 193. #endif 194. 195. > return ret; 196. } 197. crypto/mem.c:196:1: return from a call to CRYPTO_malloc 194. 195. return ret; 196. > } 197. 198. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/o_str.c:50:9: Taking true branch 48. 49. ret = CRYPTO_malloc(maxlen + 1, file, line); 50. if (ret) { ^ 51. memcpy(ret, str, maxlen); 52. ret[maxlen] = '\0'; crypto/o_str.c:51:9: 49. ret = CRYPTO_malloc(maxlen + 1, file, line); 50. if (ret) { 51. > memcpy(ret, str, maxlen); 52. ret[maxlen] = '\0'; 53. } crypto/o_str.c:52:9: 50. if (ret) { 51. memcpy(ret, str, maxlen); 52. > ret[maxlen] = '\0'; 53. } 54. return ret; crypto/o_str.c:54:5: 52. ret[maxlen] = '\0'; 53. } 54. > return ret; 55. } 56. crypto/o_str.c:55:1: return from a call to CRYPTO_strndup 53. } 54. return ret; 55. > } 56. 57. void *CRYPTO_memdup(const void *data, size_t siz, const char* file, int line) crypto/x509/by_dir.c:192:17: Taking false branch 190. ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp); 191. ent->dir = OPENSSL_strndup(ss, len); 192. if (ent->dir == NULL || ent->hashes == NULL) { ^ 193. by_dir_entry_free(ent); 194. return 0; crypto/x509/by_dir.c:192:37: Taking false branch 190. ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp); 191. ent->dir = OPENSSL_strndup(ss, len); 192. if (ent->dir == NULL || ent->hashes == NULL) { ^ 193. by_dir_entry_free(ent); 194. return 0; crypto/x509/by_dir.c:196:18: 194. return 0; 195. } 196. > if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) { 197. by_dir_entry_free(ent); 198. return 0; crypto/x509/x509_lcl.h:142:1: start of procedure sk_BY_DIR_ENTRY_push() 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. DEFINE_STACK_OF(BY_DIR_HASH) 142. > DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 144. DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) crypto/stack/stack.c:219:1: start of procedure OPENSSL_sk_push() 217. } 218. 219. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data) 220. { 221. return (OPENSSL_sk_insert(st, data, st->num)); crypto/stack/stack.c:221:5: Skipping OPENSSL_sk_insert(): empty list of specs 219. int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data) 220. { 221. return (OPENSSL_sk_insert(st, data, st->num)); ^ 222. } 223. crypto/stack/stack.c:222:1: return from a call to OPENSSL_sk_push 220. { 221. return (OPENSSL_sk_insert(st, data, st->num)); 222. > } 223. 224. int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data) crypto/x509/x509_lcl.h:142:1: return from a call to sk_BY_DIR_ENTRY_push 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. DEFINE_STACK_OF(BY_DIR_HASH) 142. > DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; 144. DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) crypto/x509/by_dir.c:196:18: Taking true branch 194. return 0; 195. } 196. if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) { ^ 197. by_dir_entry_free(ent); 198. return 0; crypto/x509/by_dir.c:197:17: 195. } 196. if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) { 197. > by_dir_entry_free(ent); 198. return 0; 199. } crypto/x509/by_dir.c:133:1: start of procedure by_dir_entry_free() 131. } 132. 133. > static void by_dir_entry_free(BY_DIR_ENTRY *ent) 134. { 135. OPENSSL_free(ent->dir); crypto/x509/by_dir.c:135:5: 133. static void by_dir_entry_free(BY_DIR_ENTRY *ent) 134. { 135. > OPENSSL_free(ent->dir); 136. sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free); 137. OPENSSL_free(ent); crypto/mem.c:265:1: start of procedure CRYPTO_free() 263. } 264. 265. > void CRYPTO_free(void *str, const char *file, int line) 266. { 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:267:9: Taking true branch 265. void CRYPTO_free(void *str, const char *file, int line) 266. { 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 268. free_impl(str, file, line); 269. return; crypto/mem.c:267:30: Taking true branch 265. void CRYPTO_free(void *str, const char *file, int line) 266. { 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 268. free_impl(str, file, line); 269. return; crypto/mem.c:268:9: Skipping __function_pointer__(): unresolved function pointer 266. { 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { 268. free_impl(str, file, line); ^ 269. return; 270. } crypto/mem.c:269:9: 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { 268. free_impl(str, file, line); 269. > return; 270. } 271. crypto/mem.c:283:1: return from a call to CRYPTO_free 281. free(str); 282. #endif 283. > } 284. 285. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/x509/by_dir.c:136:5: 134. { 135. OPENSSL_free(ent->dir); 136. > sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free); 137. OPENSSL_free(ent); 138. } crypto/x509/x509_lcl.h:141:1: start of procedure sk_BY_DIR_HASH_pop_free() 139. typedef struct lookup_dir_hashes_st BY_DIR_HASH; 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. > DEFINE_STACK_OF(BY_DIR_HASH) 142. DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; crypto/x509/x509_lcl.h:141:1: return from a call to sk_BY_DIR_HASH_pop_free 139. typedef struct lookup_dir_hashes_st BY_DIR_HASH; 140. typedef struct lookup_dir_entry_st BY_DIR_ENTRY; 141. > DEFINE_STACK_OF(BY_DIR_HASH) 142. DEFINE_STACK_OF(BY_DIR_ENTRY) 143. typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; crypto/x509/by_dir.c:137:5: 135. OPENSSL_free(ent->dir); 136. sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free); 137. > OPENSSL_free(ent); 138. } 139. crypto/mem.c:265:1: start of procedure CRYPTO_free() 263. } 264. 265. > void CRYPTO_free(void *str, const char *file, int line) 266. { 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:267:9: Taking false branch 265. void CRYPTO_free(void *str, const char *file, int line) 266. { 267. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 268. free_impl(str, file, line); 269. return; crypto/mem.c:281:5: 279. } 280. #else 281. > free(str); 282. #endif 283. } crypto/mem.c:283:1: return from a call to CRYPTO_free 281. free(str); 282. #endif 283. > } 284. 285. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line) crypto/x509/by_dir.c:138:1: return from a call to by_dir_entry_free 136. sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free); 137. OPENSSL_free(ent); 138. > } 139. 140. static void free_dir(X509_LOOKUP *lu)
https://github.com/openssl/openssl/blob/53a73768a7f17dba012615ea79960d724b310856/crypto/x509/by_dir.c/#L197
d2a_code_trace_data_43799
static int digest_test_run(EVP_TEST *t) { DIGEST_DATA *mdata = t->data; size_t i; EVP_MD_CTX *mctx; unsigned char md[EVP_MAX_MD_SIZE]; unsigned int md_len; t->err = "TEST_FAILURE"; if (!TEST_ptr(mctx = EVP_MD_CTX_new())) goto err; if (!EVP_DigestInit_ex(mctx, mdata->digest, NULL)) { t->err = "DIGESTINIT_ERROR"; goto err; } for (i = 0; i < mdata->nrpt; i++) if (!EVP_DigestUpdate(mctx, mdata->input, mdata->input_len)) { t->err = "DIGESTUPDATE_ERROR"; goto err; } if (!EVP_DigestFinal(mctx, md, &md_len)) { t->err = "DIGESTFINAL_ERROR"; goto err; } if (md_len != mdata->output_len) { t->err = "DIGEST_LENGTH_MISMATCH"; goto err; } if (!compare_mem(mdata->output, mdata->output_len, md, md_len)) { t->err = "DIGEST_MISMATCH"; goto err; } t->err = NULL; err: EVP_MD_CTX_free(mctx); return 1; } test/evp_test.c:704: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 677, column 10 is not reachable after line 704, column 5. Showing all 42 steps of the trace test/evp_test.c:668:1: start of procedure digest_test_run() 666. } 667. 668. > static int digest_test_run(EVP_TEST *t) 669. { 670. DIGEST_DATA *mdata = t->data; test/evp_test.c:670:5: 668. static int digest_test_run(EVP_TEST *t) 669. { 670. > DIGEST_DATA *mdata = t->data; 671. size_t i; 672. EVP_MD_CTX *mctx; test/evp_test.c:676:5: 674. unsigned int md_len; 675. 676. > t->err = "TEST_FAILURE"; 677. if (!TEST_ptr(mctx = EVP_MD_CTX_new())) 678. goto err; test/evp_test.c:677:10: 675. 676. t->err = "TEST_FAILURE"; 677. > if (!TEST_ptr(mctx = EVP_MD_CTX_new())) 678. goto err; 679. 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:186:1: start of procedure CRYPTO_zalloc() 184. } 185. 186. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 187. { 188. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:188:5: 186. void *CRYPTO_zalloc(size_t num, const char *file, int line) 187. { 188. > void *ret = CRYPTO_malloc(num, file, line); 189. 190. FAILTEST(); crypto/mem.c:158:1: start of procedure CRYPTO_malloc() 156. #endif 157. 158. > void *CRYPTO_malloc(size_t num, const char *file, int line) 159. { 160. void *ret = NULL; crypto/mem.c:160:5: 158. void *CRYPTO_malloc(size_t num, const char *file, int line) 159. { 160. > void *ret = NULL; 161. 162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) crypto/mem.c:162:9: Taking false branch 160. void *ret = NULL; 161. 162. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc) ^ 163. return malloc_impl(num, file, line); 164. crypto/mem.c:165:9: Taking false branch 163. return malloc_impl(num, file, line); 164. 165. if (num == 0) ^ 166. return NULL; 167. crypto/mem.c:169:5: 167. 168. FAILTEST(); 169. > allow_customize = 0; 170. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 171. if (call_malloc_debug) { crypto/mem.c:179:5: 177. } 178. #else 179. > osslargused(file); osslargused(line); 180. ret = malloc(num); 181. #endif crypto/mem.c:179:24: 177. } 178. #else 179. > osslargused(file); osslargused(line); 180. ret = malloc(num); 181. #endif crypto/mem.c:180:5: 178. #else 179. osslargused(file); osslargused(line); 180. > ret = malloc(num); 181. #endif 182. crypto/mem.c:183:5: 181. #endif 182. 183. > return ret; 184. } 185. crypto/mem.c:184:1: return from a call to CRYPTO_malloc 182. 183. return ret; 184. > } 185. 186. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/mem.c:191:9: Taking true branch 189. 190. FAILTEST(); 191. if (ret != NULL) ^ 192. memset(ret, 0, num); 193. return ret; crypto/mem.c:192:9: 190. FAILTEST(); 191. if (ret != NULL) 192. > memset(ret, 0, num); 193. return ret; 194. } crypto/mem.c:193:5: 191. if (ret != NULL) 192. memset(ret, 0, num); 193. > return ret; 194. } 195. crypto/mem.c:194:1: return from a call to CRYPTO_zalloc 192. memset(ret, 0, num); 193. return ret; 194. > } 195. 196. 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) test/testutil/tests.c:462:1: start of procedure test_ptr() 460. } 461. 462. > int test_ptr(const char *file, int line, const char *s, const void *p) 463. { 464. if (p != NULL) test/testutil/tests.c:464:9: Taking true branch 462. int test_ptr(const char *file, int line, const char *s, const void *p) 463. { 464. if (p != NULL) ^ 465. return 1; 466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:465:9: 463. { 464. if (p != NULL) 465. > return 1; 466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 467. return 0; test/testutil/tests.c:468:1: return from a call to test_ptr 466. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 467. return 0; 468. > } 469. 470. int test_true(const char *file, int line, const char *s, int b) test/evp_test.c:677:10: Taking false branch 675. 676. t->err = "TEST_FAILURE"; 677. if (!TEST_ptr(mctx = EVP_MD_CTX_new())) ^ 678. goto err; 679. test/evp_test.c:680:10: Taking true branch 678. goto err; 679. 680. if (!EVP_DigestInit_ex(mctx, mdata->digest, NULL)) { ^ 681. t->err = "DIGESTINIT_ERROR"; 682. goto err; test/evp_test.c:681:9: 679. 680. if (!EVP_DigestInit_ex(mctx, mdata->digest, NULL)) { 681. > t->err = "DIGESTINIT_ERROR"; 682. goto err; 683. } test/evp_test.c:703:2: 701. t->err = NULL; 702. 703. > err: 704. EVP_MD_CTX_free(mctx); 705. return 1; test/evp_test.c:704:5: 702. 703. err: 704. > EVP_MD_CTX_free(mctx); 705. return 1; 706. } 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:253:1: start of procedure CRYPTO_free() 251. } 252. 253. > void CRYPTO_free(void *str, const char *file, int line) 254. { 255. if (free_impl != NULL && free_impl != &CRYPTO_free) { crypto/mem.c:255:9: Taking true branch 253. void CRYPTO_free(void *str, const char *file, int line) 254. { 255. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 256. free_impl(str, file, line); 257. return; crypto/mem.c:255:30: Taking true branch 253. void CRYPTO_free(void *str, const char *file, int line) 254. { 255. if (free_impl != NULL && free_impl != &CRYPTO_free) { ^ 256. free_impl(str, file, line); 257. return; crypto/mem.c:256:9: Skipping __function_pointer__(): unresolved function pointer 254. { 255. if (free_impl != NULL && free_impl != &CRYPTO_free) { 256. free_impl(str, file, line); ^ 257. return; 258. } crypto/mem.c:257:9: 255. if (free_impl != NULL && free_impl != &CRYPTO_free) { 256. free_impl(str, file, line); 257. > return; 258. } 259. crypto/mem.c:271:1: return from a call to CRYPTO_free 269. free(str); 270. #endif 271. > } 272. 273. 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/69b4c01fd26e6eb72b156ed3014522c3295a7669/test/evp_test.c/#L704
d2a_code_trace_data_43800
int 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; if (!ossl_assert(rec->orig_len >= md_size && md_size <= EVP_MAX_MD_SIZE)) return 0; #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 return 1; } ssl/record/ssl3_record.c:1955: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [0, 17728]):unsigned64 by call to `dtls1_process_record`. Showing all 10 steps of the trace ssl/record/ssl3_record.c:1776:1: Parameter `s->session->ext.max_fragment_len_mode` 1774. */ 1775. /* used only by dtls1_read_bytes */ 1776. > int dtls1_get_record(SSL *s) 1777. { 1778. int ssl_major, ssl_minor; ssl/record/ssl3_record.c:1955:10: Call 1953. } 1954. 1955. if (!dtls1_process_record(s, bitmap)) { ^ 1956. if (ossl_statem_in_error(s)) { 1957. /* dtls1_process_record() called SSLfatal */ ssl/record/ssl3_record.c:1553:1: Parameter `s->rlayer.rrec.length` 1551. } 1552. 1553. > int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap) 1554. { 1555. int i; ssl/record/ssl3_record.c:1689:18: Call 1687. */ 1688. mac = mac_tmp; 1689. if (!ssl3_cbc_copy_mac(mac_tmp, rr, mac_size)) { ^ 1690. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_DTLS1_PROCESS_RECORD, 1691. ERR_R_INTERNAL_ERROR); ssl/record/ssl3_record.c:1478:1: <LHS trace> 1476. #define CBC_MAC_ROTATE_IN_PLACE 1477. 1478. > int ssl3_cbc_copy_mac(unsigned char *out, 1479. const SSL3_RECORD *rec, size_t md_size) 1480. { ssl/record/ssl3_record.c:1478:1: Parameter `rec->length` 1476. #define CBC_MAC_ROTATE_IN_PLACE 1477. 1478. > int ssl3_cbc_copy_mac(unsigned char *out, 1479. const SSL3_RECORD *rec, size_t md_size) 1480. { ssl/record/ssl3_record.c:1491:5: Assignment 1489. * mac_end is the index of |rec->data| just after the end of the MAC. 1490. */ 1491. size_t mac_end = rec->length; ^ 1492. size_t mac_start = mac_end - md_size; 1493. size_t in_mac; ssl/record/ssl3_record.c:1478:1: <RHS trace> 1476. #define CBC_MAC_ROTATE_IN_PLACE 1477. 1478. > int ssl3_cbc_copy_mac(unsigned char *out, 1479. const SSL3_RECORD *rec, size_t md_size) 1480. { ssl/record/ssl3_record.c:1478:1: Parameter `md_size` 1476. #define CBC_MAC_ROTATE_IN_PLACE 1477. 1478. > int ssl3_cbc_copy_mac(unsigned char *out, 1479. const SSL3_RECORD *rec, size_t md_size) 1480. { ssl/record/ssl3_record.c:1492:5: Binary operation: ([0, +oo] - [0, 17728]):unsigned64 by call to `dtls1_process_record` 1490. */ 1491. size_t mac_end = rec->length; 1492. size_t mac_start = mac_end - md_size; ^ 1493. size_t in_mac; 1494. /*
https://github.com/openssl/openssl/blob/a8ea8018fa187e22fb4989450b550589e20f62c2/ssl/record/ssl3_record.c/#L1492
d2a_code_trace_data_43801
int test_div(BIO *bp, BN_CTX *ctx) { BIGNUM *a, *b, *c, *d, *e; int i; a = BN_new(); b = BN_new(); c = BN_new(); d = BN_new(); e = BN_new(); BN_one(a); BN_zero(b); if (BN_div(d, c, a, b, ctx)) { fprintf(stderr, "Division by zero succeeded!\n"); return 0; } for (i = 0; i < num0 + num1; i++) { if (i < num1) { BN_bntest_rand(a, 400, 0, 0); BN_copy(b, a); BN_lshift(a, a, i); BN_add_word(a, i); } else BN_bntest_rand(b, 50 + 3 * (i - num1), 0, 0); a->neg = rand_neg(); b->neg = rand_neg(); BN_div(d, c, a, b, ctx); if (bp != NULL) { if (!results) { BN_print(bp, a); BIO_puts(bp, " / "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, d); BIO_puts(bp, "\n"); if (!results) { BN_print(bp, a); BIO_puts(bp, " % "); BN_print(bp, b); BIO_puts(bp, " - "); } BN_print(bp, c); BIO_puts(bp, "\n"); } BN_mul(e, d, b, ctx); BN_add(d, e, c); BN_sub(d, d, a); if (!BN_is_zero(d)) { fprintf(stderr, "Division test failed!\n"); return 0; } } BN_free(a); BN_free(b); BN_free(c); BN_free(d); BN_free(e); return (1); } test/bntest.c:496: error: MEMORY_LEAK memory dynamically allocated by call to `BN_new()` at line 444, column 9 is not reachable after line 496, column 5. Showing all 147 steps of the trace test/bntest.c:439:1: start of procedure test_div() 437. } 438. 439. > int test_div(BIO *bp, BN_CTX *ctx) 440. { 441. BIGNUM *a, *b, *c, *d, *e; test/bntest.c:444:5: 442. int i; 443. 444. > a = BN_new(); 445. b = BN_new(); 446. 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:445:5: 443. 444. a = BN_new(); 445. > b = BN_new(); 446. c = BN_new(); 447. 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:446:5: 444. a = BN_new(); 445. b = BN_new(); 446. > c = BN_new(); 447. d = BN_new(); 448. 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:447:5: 445. b = BN_new(); 446. c = BN_new(); 447. > d = BN_new(); 448. e = BN_new(); 449. 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:448:5: 446. c = BN_new(); 447. d = BN_new(); 448. > e = BN_new(); 449. 450. 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:450:5: 448. e = BN_new(); 449. 450. > BN_one(a); 451. BN_zero(b); 452. 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:451:5: 449. 450. BN_one(a); 451. > BN_zero(b); 452. 453. if (BN_div(d, c, a, b, ctx)) { crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word() 528. } 529. 530. > int BN_set_word(BIGNUM *a, BN_ULONG w) 531. { 532. bn_check_top(a); crypto/bn/bn_lib.c:533:9: Condition is true 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:533:9: Taking false branch 531. { 532. bn_check_top(a); 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 534. return (0); 535. a->neg = 0; crypto/bn/bn_lib.c:535:5: 533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) 534. return (0); 535. > a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); crypto/bn/bn_lib.c:536:5: 534. return (0); 535. a->neg = 0; 536. > a->d[0] = w; 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); crypto/bn/bn_lib.c:537:15: Condition is false 535. a->neg = 0; 536. a->d[0] = w; 537. a->top = (w ? 1 : 0); ^ 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:537:5: 535. a->neg = 0; 536. a->d[0] = w; 537. > a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. return (1); crypto/bn/bn_lib.c:539:5: 537. a->top = (w ? 1 : 0); 538. bn_check_top(a); 539. > return (1); 540. } 541. crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word 538. bn_check_top(a); 539. return (1); 540. > } 541. 542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) test/bntest.c:453:9: Taking false branch 451. BN_zero(b); 452. 453. if (BN_div(d, c, a, b, ctx)) { ^ 454. fprintf(stderr, "Division by zero succeeded!\n"); 455. return 0; test/bntest.c:458:10: 456. } 457. 458. > for (i = 0; i < num0 + num1; i++) { 459. if (i < num1) { 460. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:458:17: Loop condition is false. Leaving loop 456. } 457. 458. for (i = 0; i < num0 + num1; i++) { ^ 459. if (i < num1) { 460. BN_bntest_rand(a, 400, 0, 0); test/bntest.c:496:5: 494. } 495. } 496. > BN_free(a); 497. BN_free(b); 498. 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)
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L496
d2a_code_trace_data_43802
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/ec/ecp_smpl.c:1011: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_sub_quick`. Showing all 27 steps of the trace crypto/ec/ecp_smpl.c:976:10: Call 974. 975. BN_CTX_start(ctx); 976. rh = BN_CTX_get(ctx); ^ 977. tmp = BN_CTX_get(ctx); 978. Z4 = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:229:5: Call 227. } 228. /* OK, make sure the returned bignum is "zero" */ 229. BN_zero(ret); ^ 230. ctx->used++; 231. CTXDBG_RET(ctx, ret); crypto/bn/bn_lib.c:366:15: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/bn/bn_lib.c:366:5: Assignment 364. a->neg = 0; 365. a->d[0] = w; 366. a->top = (w ? 1 : 0); ^ 367. a->flags &= ~BN_FLG_FIXED_TOP; 368. bn_check_top(a); crypto/ec/ecp_smpl.c:1011:18: Call 1009. if (!BN_mod_add_quick(tmp, tmp, Z4, p)) 1010. goto err; 1011. if (!BN_mod_sub_quick(rh, rh, tmp, p)) ^ 1012. goto err; 1013. if (!field_mul(group, rh, rh, point->X, ctx)) crypto/bn/bn_mod.c:116:1: Parameter `r->top` 114. * less than m 115. */ 116. > int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 117. const BIGNUM *m) 118. { crypto/bn/bn_mod.c:119:10: Call 117. const BIGNUM *m) 118. { 119. if (!BN_sub(r, a, b)) ^ 120. return 0; 121. if (r->neg) crypto/bn/bn_add.c:45:1: Parameter `r->top` 43. 44. /* signed sub of b from a. */ 45. > int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 46. { 47. int ret, r_neg, cmp_res; crypto/bn/bn_add.c:54:15: Call 52. if (a->neg != b->neg) { 53. r_neg = a->neg; 54. ret = BN_uadd(r, a, b); ^ 55. } else { 56. cmp_res = BN_ucmp(a, b); crypto/bn/bn_add.c:76:1: Parameter `r->top` 74. 75. /* unsigned add of b to a, r can be equal to a or b. */ 76. > int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b) 77. { 78. int max, min, dif; crypto/bn/bn_add.c:96:9: Call 94. dif = max - min; 95. 96. if (bn_wexpand(r, max + 1) == NULL) ^ 97. return 0; 98. crypto/bn/bn_lib.c:948:1: Parameter `a->top` 946. } 947. 948. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:950:37: Call 948. BIGNUM *bn_wexpand(BIGNUM *a, int words) 949. { 950. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 951. } 952. crypto/bn/bn_lib.c:245:1: Parameter `b->top` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `words` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:224:13: Call 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/mem.c:228:1: Parameter `num` 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:17: Call 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/mem.c:230:5: Assignment 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:235:5: Assignment 233. if (ret != NULL) 234. memset(ret, 0, num); 235. return ret; ^ 236. } 237. crypto/bn/bn_lib.c:224:9: Assignment 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_sub_quick` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/4cc968df403ed9321d0df722aba33323ae575ce0/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_43803
static int select_server_ctx(SSL *s, void *arg, int ignore) { const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); HANDSHAKE_EX_DATA *ex_data = (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); if (servername == NULL) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_NOACK; } if (strcmp(servername, "server2") == 0) { SSL_CTX *new_ctx = (SSL_CTX*)arg; SSL_set_SSL_CTX(s, new_ctx); SSL_clear_options(s, 0xFFFFFFFFL); SSL_set_options(s, SSL_CTX_get_options(new_ctx)); ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; return SSL_TLSEXT_ERR_OK; } else if (strcmp(servername, "server1") == 0) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_OK; } else if (ignore) { ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; return SSL_TLSEXT_ERR_NOACK; } else { return SSL_TLSEXT_ERR_ALERT_FATAL; } } test/handshake_helper.c:128: error: NULL_DEREFERENCE pointer `ex_data` last assigned on line 109 could be null and is dereferenced at line 128, column 9. Showing all 49 steps of the trace test/handshake_helper.c:106:1: start of procedure select_server_ctx() 104. * An empty SNI extension also returns SSL_TSLEXT_ERR_NOACK. 105. */ 106. > static int select_server_ctx(SSL *s, void *arg, int ignore) 107. { 108. const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); test/handshake_helper.c:108:5: 106. static int select_server_ctx(SSL *s, void *arg, int ignore) 107. { 108. > const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); 109. HANDSHAKE_EX_DATA *ex_data = 110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); ssl/ssl_lib.c:2597:1: start of procedure SSL_get_servername() 2595. */ 2596. 2597. > const char *SSL_get_servername(const SSL *s, const int type) 2598. { 2599. if (type != TLSEXT_NAMETYPE_host_name) ssl/ssl_lib.c:2599:9: Taking false branch 2597. const char *SSL_get_servername(const SSL *s, const int type) 2598. { 2599. if (type != TLSEXT_NAMETYPE_host_name) ^ 2600. return NULL; 2601. ssl/ssl_lib.c:2602:12: Condition is true 2600. return NULL; 2601. 2602. return s->session && !s->ext.hostname ? ^ 2603. s->session->ext.hostname : s->ext.hostname; 2604. } ssl/ssl_lib.c:2602:27: Condition is true 2600. return NULL; 2601. 2602. return s->session && !s->ext.hostname ? ^ 2603. s->session->ext.hostname : s->ext.hostname; 2604. } ssl/ssl_lib.c:2602:12: 2600. return NULL; 2601. 2602. > return s->session && !s->ext.hostname ? 2603. s->session->ext.hostname : s->ext.hostname; 2604. } ssl/ssl_lib.c:2602:5: 2600. return NULL; 2601. 2602. > return s->session && !s->ext.hostname ? 2603. s->session->ext.hostname : s->ext.hostname; 2604. } ssl/ssl_lib.c:2604:1: return from a call to SSL_get_servername 2602. return s->session && !s->ext.hostname ? 2603. s->session->ext.hostname : s->ext.hostname; 2604. > } 2605. 2606. int SSL_get_servername_type(const SSL *s) test/handshake_helper.c:109:5: 107. { 108. const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); 109. > HANDSHAKE_EX_DATA *ex_data = 110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 111. ssl/ssl_lib.c:4014:1: start of procedure SSL_get_ex_data() 4012. } 4013. 4014. > void *SSL_get_ex_data(const SSL *s, int idx) 4015. { 4016. return CRYPTO_get_ex_data(&s->ex_data, idx); ssl/ssl_lib.c:4016:5: 4014. void *SSL_get_ex_data(const SSL *s, int idx) 4015. { 4016. > return CRYPTO_get_ex_data(&s->ex_data, idx); 4017. } 4018. crypto/ex_data.c:393:1: start of procedure CRYPTO_get_ex_data() 391. * particular index in the class used by this variable 392. */ 393. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) crypto/ex_data.c:395:9: Taking true branch 393. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx) 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) ^ 396. return NULL; 397. return sk_void_value(ad->sk, idx); crypto/ex_data.c:396:9: 394. { 395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk)) 396. > return NULL; 397. return sk_void_value(ad->sk, idx); 398. } crypto/ex_data.c:398:1: return from a call to CRYPTO_get_ex_data 396. return NULL; 397. return sk_void_value(ad->sk, idx); 398. > } ssl/ssl_lib.c:4017:1: return from a call to SSL_get_ex_data 4015. { 4016. return CRYPTO_get_ex_data(&s->ex_data, idx); 4017. > } 4018. 4019. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg) test/handshake_helper.c:112:9: Taking false branch 110. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx)); 111. 112. if (servername == NULL) { ^ 113. ex_data->servername = SSL_TEST_SERVERNAME_SERVER1; 114. return SSL_TLSEXT_ERR_NOACK; test/handshake_helper.c:117:9: Taking true branch 115. } 116. 117. if (strcmp(servername, "server2") == 0) { ^ 118. SSL_CTX *new_ctx = (SSL_CTX*)arg; 119. SSL_set_SSL_CTX(s, new_ctx); test/handshake_helper.c:118:9: 116. 117. if (strcmp(servername, "server2") == 0) { 118. > SSL_CTX *new_ctx = (SSL_CTX*)arg; 119. SSL_set_SSL_CTX(s, new_ctx); 120. /* test/handshake_helper.c:119:9: 117. if (strcmp(servername, "server2") == 0) { 118. SSL_CTX *new_ctx = (SSL_CTX*)arg; 119. > SSL_set_SSL_CTX(s, new_ctx); 120. /* 121. * Copy over all the SSL_CTX options - reasonable behavior ssl/ssl_lib.c:3851:1: start of procedure SSL_set_SSL_CTX() 3849. } 3850. 3851. > SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx) 3852. { 3853. CERT *new_cert; ssl/ssl_lib.c:3854:9: Taking false branch 3852. { 3853. CERT *new_cert; 3854. if (ssl->ctx == ctx) ^ 3855. return ssl->ctx; 3856. if (ctx == NULL) ssl/ssl_lib.c:3856:9: Taking false branch 3854. if (ssl->ctx == ctx) 3855. return ssl->ctx; 3856. if (ctx == NULL) ^ 3857. ctx = ssl->session_ctx; 3858. new_cert = ssl_cert_dup(ctx->cert); ssl/ssl_lib.c:3858:5: Skipping ssl_cert_dup(): empty list of specs 3856. if (ctx == NULL) 3857. ctx = ssl->session_ctx; 3858. new_cert = ssl_cert_dup(ctx->cert); ^ 3859. if (new_cert == NULL) { 3860. return NULL; ssl/ssl_lib.c:3859:9: Taking false branch 3857. ctx = ssl->session_ctx; 3858. new_cert = ssl_cert_dup(ctx->cert); 3859. if (new_cert == NULL) { ^ 3860. return NULL; 3861. } ssl/ssl_lib.c:3863:10: Taking false branch 3861. } 3862. 3863. if (!custom_exts_copy_flags(&new_cert->custext, &ssl->cert->custext)) { ^ 3864. ssl_cert_free(new_cert); 3865. return NULL; ssl/ssl_lib.c:3868:5: 3866. } 3867. 3868. > ssl_cert_free(ssl->cert); 3869. ssl->cert = new_cert; 3870. ssl/ssl_cert.c:224:1: start of procedure ssl_cert_free() 222. } 223. 224. > void ssl_cert_free(CERT *c) 225. { 226. int i; ssl/ssl_cert.c:228:9: Taking true branch 226. int i; 227. 228. if (c == NULL) ^ 229. return; 230. ssl/ssl_cert.c:229:9: 227. 228. if (c == NULL) 229. > return; 230. 231. CRYPTO_DOWN_REF(&c->references, &i, c->lock); ssl/ssl_cert.c:254:1: return from a call to ssl_cert_free 252. CRYPTO_THREAD_lock_free(c->lock); 253. OPENSSL_free(c); 254. > } 255. 256. int ssl_cert_set0_chain(SSL *s, SSL_CTX *ctx, STACK_OF(X509) *chain) ssl/ssl_lib.c:3869:5: 3867. 3868. ssl_cert_free(ssl->cert); 3869. > ssl->cert = new_cert; 3870. 3871. /* ssl/ssl_lib.c:3875:10: Condition is false 3873. * so setter APIs must prevent invalid lengths from entering the system. 3874. */ 3875. if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx))) ^ 3876. return NULL; 3877. ssl/ssl_lib.c:3875:10: Taking true branch 3873. * so setter APIs must prevent invalid lengths from entering the system. 3874. */ 3875. if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx))) ^ 3876. return NULL; 3877. ssl/ssl_lib.c:3876:9: 3874. */ 3875. if (!ossl_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx))) 3876. > return NULL; 3877. 3878. /* ssl/ssl_lib.c:3896:1: return from a call to SSL_set_SSL_CTX 3894. 3895. return ssl->ctx; 3896. > } 3897. 3898. int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx) test/handshake_helper.c:125:9: 123. * contexts differ/conflict 124. */ 125. > SSL_clear_options(s, 0xFFFFFFFFL); 126. SSL_set_options(s, SSL_CTX_get_options(new_ctx)); 127. ssl/ssl_lib.c:4438:1: start of procedure SSL_clear_options() 4436. } 4437. 4438. > unsigned long SSL_clear_options(SSL *s, unsigned long op) 4439. { 4440. return s->options &= ~op; ssl/ssl_lib.c:4440:5: 4438. unsigned long SSL_clear_options(SSL *s, unsigned long op) 4439. { 4440. > return s->options &= ~op; 4441. } 4442. ssl/ssl_lib.c:4441:1: return from a call to SSL_clear_options 4439. { 4440. return s->options &= ~op; 4441. > } 4442. 4443. STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s) test/handshake_helper.c:126:9: 124. */ 125. SSL_clear_options(s, 0xFFFFFFFFL); 126. > SSL_set_options(s, SSL_CTX_get_options(new_ctx)); 127. 128. ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; ssl/ssl_lib.c:4413:1: start of procedure SSL_CTX_get_options() 4411. * control interface. 4412. */ 4413. > unsigned long SSL_CTX_get_options(const SSL_CTX *ctx) 4414. { 4415. return ctx->options; ssl/ssl_lib.c:4415:5: 4413. unsigned long SSL_CTX_get_options(const SSL_CTX *ctx) 4414. { 4415. > return ctx->options; 4416. } 4417. ssl/ssl_lib.c:4416:1: return from a call to SSL_CTX_get_options 4414. { 4415. return ctx->options; 4416. > } 4417. 4418. unsigned long SSL_get_options(const SSL *s) ssl/ssl_lib.c:4428:1: start of procedure SSL_set_options() 4426. } 4427. 4428. > unsigned long SSL_set_options(SSL *s, unsigned long op) 4429. { 4430. return s->options |= op; ssl/ssl_lib.c:4430:5: 4428. unsigned long SSL_set_options(SSL *s, unsigned long op) 4429. { 4430. > return s->options |= op; 4431. } 4432. ssl/ssl_lib.c:4431:1: return from a call to SSL_set_options 4429. { 4430. return s->options |= op; 4431. > } 4432. 4433. unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op) test/handshake_helper.c:128:9: 126. SSL_set_options(s, SSL_CTX_get_options(new_ctx)); 127. 128. > ex_data->servername = SSL_TEST_SERVERNAME_SERVER2; 129. return SSL_TLSEXT_ERR_OK; 130. } else if (strcmp(servername, "server1") == 0) {
https://github.com/openssl/openssl/blob/e43e6b1951de931ca500c6964496e76651332f5e/test/handshake_helper.c/#L128
d2a_code_trace_data_43804
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return NULL; } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return ret; } ssl/record/rec_layer_s3.c:1511: error: INTEGER_OVERFLOW_L2 ([0, max(0, `s->session_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`. Showing all 13 steps of the trace ssl/record/rec_layer_s3.c:1199:1: Parameter `s->session_ctx->sessions->num_items` 1197. * none of our business 1198. */ 1199. > int ssl3_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, 1200. size_t len, int peek, size_t *readbytes) 1201. { ssl/record/rec_layer_s3.c:1511:9: Call 1509. SSL3_RECORD_set_length(rr, 0); 1510. SSL3_RECORD_set_read(rr); 1511. ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_NO_RENEGOTIATION); ^ 1512. goto start; 1513. } ssl/s3_msg.c:62:1: Parameter `s->session_ctx->sessions->num_items` 60. } 61. 62. > int ssl3_send_alert(SSL *s, int level, int desc) 63. { 64. /* Map tls/ssl alert value to correct one */ ssl/s3_msg.c:76:9: Call 74. /* If a fatal one, remove from cache */ 75. if ((level == SSL3_AL_FATAL) && (s->session != NULL)) 76. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 77. 78. s->s3->alert_dispatch = 1; ssl/ssl_sess.c:737:1: Parameter `ctx->sessions->num_items` 735. } 736. 737. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 738. { 739. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:739:12: Call 737. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 738. { 739. return remove_session_lock(ctx, c, 1); ^ 740. } 741. ssl/ssl_sess.c:742:1: Parameter `ctx->sessions->num_items` 740. } 741. 742. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 743. { 744. SSL_SESSION *r; ssl/ssl_sess.c:752:17: Call 750. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 751. ret = 1; 752. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 753. SSL_SESSION_list_remove(ctx, c); 754. } 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, max(0, s->session_ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_send_alert` 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/a8ea8018fa187e22fb4989450b550589e20f62c2/crypto/lhash/lhash.c/#L139
d2a_code_trace_data_43805
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/sm2/sm2_sign.c:108: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_add`. Showing all 17 steps of the trace crypto/sm2/sm2_sign.c:82:5: Call 80. goto done; 81. 82. BN_CTX_start(ctx); ^ 83. 84. k = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/sm2/sm2_sign.c:108:13: Call 106. goto done; 107. 108. if (BN_mod_add(r, e, x1, order, ctx) == 0) ^ 109. goto done; 110. crypto/bn/bn_mod.c:28:1: Parameter `ctx->stack.depth` 26. } 27. 28. > int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 29. BN_CTX *ctx) 30. { crypto/bn/bn_mod.c:33:12: Call 31. if (!BN_add(r, a, b)) 32. return 0; 33. return BN_nnmod(r, r, m, ctx); ^ 34. } 35. crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth` 11. #include "bn_lcl.h" 12. 13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) 14. { 15. /* crypto/bn/bn_mod.c:20:11: Call 18. */ 19. 20. if (!(BN_mod(r, m, d, ctx))) ^ 21. return 0; 22. if (!r->neg) crypto/bn/bn_div.c:190:5: Call 188. } 189. 190. BN_CTX_start(ctx); ^ 191. res = (dv == NULL) ? BN_CTX_get(ctx) : dv; 192. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes` 179. } 180. 181. > void BN_CTX_start(BN_CTX *ctx) 182. { 183. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_div.c:410:5: Call 408. if (no_branch) 409. bn_correct_top(res); 410. BN_CTX_end(ctx); ^ 411. return 1; 412. err: crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes` 193. } 194. 195. > void BN_CTX_end(BN_CTX *ctx) 196. { 197. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:201:27: Call 199. ctx->err_stack--; 200. else { 201. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 202. /* Does this stack frame have anything to release? */ 203. if (fp < ctx->used) crypto/bn/bn_ctx.c:271:1: <Offset trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `st->depth` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: <Length trace> 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes` 269. } 270. 271. > static unsigned int BN_STACK_pop(BN_STACK *st) 272. { 273. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_add` 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/440bce8f813fa661437ce52378c3df38e2fd073b/crypto/bn/bn_ctx.c/#L273
d2a_code_trace_data_43806
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } test/testutil/tests.c:648: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_set_word`. Showing all 15 steps of the trace test/testutil/tests.c:646:10: Call 644. return 1; 645. bw = BN_new(); 646. aa = BN_dup(a); ^ 647. BN_set_negative(aa, 0); 648. BN_set_word(bw, w); crypto/bn/bn_lib.c:315:10: Call 313. if (t == NULL) 314. return NULL; 315. if (!BN_copy(t, a)) { ^ 316. BN_free(t); 317. return NULL; crypto/bn/bn_lib.c:323:1: Parameter `*a->d` 321. } 322. 323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 324. { 325. bn_check_top(b); test/testutil/tests.c:648:5: Call 646. aa = BN_dup(a); 647. BN_set_negative(aa, 0); 648. BN_set_word(bw, w); ^ 649. test_fail_bignum_message(NULL, file, line, "BIGNUM", bns, ws, "abs==", 650. aa, bw); 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_lcl.h:668:12: Call 666. return a; 667. 668. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 669. } 670. crypto/bn/bn_lib.c:284:1: Parameter `*b->d` 282. */ 283. 284. > BIGNUM *bn_expand2(BIGNUM *b, int words) 285. { 286. bn_check_top(b); crypto/bn/bn_lib.c:289:23: Call 287. 288. if (words > b->dmax) { 289. BN_ULONG *a = bn_expand_internal(b, words); ^ 290. if (!a) 291. return NULL; crypto/bn/bn_lib.c:246:1: <Offset trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `b->top` 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: <Length trace> 244. /* This is used by bn_expand2() */ 245. /* The caller MUST check that words > b->dmax before calling this */ 246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 247. { 248. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:246:1: Parameter `*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 = NULL; crypto/bn/bn_lib.c:271:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_set_word` 269. assert(b->top <= words); 270. if (b->top > 0) 271. memcpy(a, b->d, sizeof(*a) * b->top); ^ 272. 273. return a;
https://github.com/openssl/openssl/blob/3f97052392cb10fca5309212bf720685262ad4a6/crypto/bn/bn_lib.c/#L271
d2a_code_trace_data_43807
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_master(); 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:272: error: NULL_DEREFERENCE pointer `meth` last assigned on line 246 could be null and is dereferenced at line 272, column 13. Showing all 24 steps of the trace crypto/rand/rand_lib.c:240:1: start of procedure RAND_poll() 238. * configurable via the --with-rand-seed configure option. 239. */ 240. > int RAND_poll(void) 241. { 242. int ret = 0; crypto/rand/rand_lib.c:242:5: 240. int RAND_poll(void) 241. { 242. > int ret = 0; 243. 244. RAND_POOL *pool = NULL; crypto/rand/rand_lib.c:244:5: 242. int ret = 0; 243. 244. > RAND_POOL *pool = NULL; 245. 246. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:246:5: 244. RAND_POOL *pool = NULL; 245. 246. > const RAND_METHOD *meth = RAND_get_rand_method(); 247. 248. if (meth == RAND_OpenSSL()) { crypto/rand/rand_lib.c:556:1: start of procedure RAND_get_rand_method() 554. } 555. 556. > const RAND_METHOD *RAND_get_rand_method(void) 557. { 558. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:558:5: 556. const RAND_METHOD *RAND_get_rand_method(void) 557. { 558. > const RAND_METHOD *tmp_meth = NULL; 559. 560. if (!RUN_ONCE(&rand_init, do_rand_init)) crypto/rand/rand_lib.c:560:10: 558. const RAND_METHOD *tmp_meth = NULL; 559. 560. > if (!RUN_ONCE(&rand_init, do_rand_init)) 561. return NULL; 562. 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:560:10: Condition is false 558. const RAND_METHOD *tmp_meth = NULL; 559. 560. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 561. return NULL; 562. crypto/rand/rand_lib.c:560:10: Taking true branch 558. const RAND_METHOD *tmp_meth = NULL; 559. 560. if (!RUN_ONCE(&rand_init, do_rand_init)) ^ 561. return NULL; 562. crypto/rand/rand_lib.c:561:9: 559. 560. if (!RUN_ONCE(&rand_init, do_rand_init)) 561. > return NULL; 562. 563. CRYPTO_THREAD_write_lock(rand_meth_lock); crypto/rand/rand_lib.c:584:1: return from a call to RAND_get_rand_method 582. CRYPTO_THREAD_unlock(rand_meth_lock); 583. return tmp_meth; 584. > } 585. 586. #ifndef OPENSSL_NO_ENGINE crypto/rand/rand_lib.c:248:9: 246. const RAND_METHOD *meth = RAND_get_rand_method(); 247. 248. > if (meth == RAND_OpenSSL()) { 249. /* fill random pool and seed the master DRBG */ 250. RAND_DRBG *drbg = RAND_DRBG_get0_master(); crypto/rand/drbg_lib.c:852:1: start of procedure RAND_OpenSSL() 850. }; 851. 852. > RAND_METHOD *RAND_OpenSSL(void) 853. { 854. return &rand_meth; crypto/rand/drbg_lib.c:854:5: 852. RAND_METHOD *RAND_OpenSSL(void) 853. { 854. > return &rand_meth; 855. } crypto/rand/drbg_lib.c:855:1: return from a call to RAND_OpenSSL 853. { 854. return &rand_meth; 855. > } crypto/rand/rand_lib.c:248:9: Taking false branch 246. const RAND_METHOD *meth = RAND_get_rand_method(); 247. 248. if (meth == RAND_OpenSSL()) { ^ 249. /* fill random pool and seed the master DRBG */ 250. RAND_DRBG *drbg = RAND_DRBG_get0_master(); crypto/rand/rand_lib.c:263:9: Skipping RAND_POOL_new(): empty list of specs 261. } else { 262. /* fill random pool and seed the current legacy RNG */ 263. pool = RAND_POOL_new(RAND_DRBG_STRENGTH, ^ 264. RAND_DRBG_STRENGTH / 8, 265. DRBG_MINMAX_FACTOR * (RAND_DRBG_STRENGTH / 8)); crypto/rand/rand_lib.c:266:13: Taking false branch 264. RAND_DRBG_STRENGTH / 8, 265. DRBG_MINMAX_FACTOR * (RAND_DRBG_STRENGTH / 8)); 266. if (pool == NULL) ^ 267. return 0; 268. crypto/rand/rand_lib.c:269:13: Taking false branch 267. return 0; 268. 269. if (RAND_POOL_acquire_entropy(pool) == 0) ^ 270. goto err; 271. crypto/rand/rand_lib.c:272:13: 270. goto err; 271. 272. > if (meth->add == NULL 273. || meth->add(RAND_POOL_buffer(pool), 274. RAND_POOL_length(pool),
https://github.com/openssl/openssl/blob/24d06e8ca07f705635a072dcb6ad08c2555c9025/crypto/rand/rand_lib.c/#L272
d2a_code_trace_data_43808
int tls_choose_sigalg(SSL *s, int *al) { const SIGALG_LOOKUP *lu = NULL; s->s3->tmp.cert = NULL; s->s3->tmp.sigalg = NULL; if (SSL_IS_TLS13(s)) { size_t i; #ifndef OPENSSL_NO_EC int curve = -1, skip_ec = 0; #endif for (i = 0; i < s->cert->shared_sigalgslen; i++) { lu = s->cert->shared_sigalgs[i]; if (lu->hash == NID_sha1 || lu->hash == NID_sha224 || lu->sig == EVP_PKEY_DSA || lu->sig == EVP_PKEY_RSA) continue; if (!tls1_lookup_md(lu, NULL)) continue; if (!ssl_has_cert(s, lu->sig_idx)) continue; if (lu->sig == EVP_PKEY_EC) { #ifndef OPENSSL_NO_EC if (curve == -1) { EC_KEY *ec = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[SSL_PKEY_ECC].privatekey); curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); if (EC_KEY_get_conv_form(ec) != POINT_CONVERSION_UNCOMPRESSED) skip_ec = 1; } if (skip_ec || (lu->curve != NID_undef && curve != lu->curve)) continue; #else continue; #endif } break; } if (i == s->cert->shared_sigalgslen) { if (al == NULL) return 1; *al = SSL_AD_HANDSHAKE_FAILURE; SSLerr(SSL_F_TLS_CHOOSE_SIGALG, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM); return 0; } } else { if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aCERT)) return 1; if (!s->server && !ssl_has_cert(s, s->cert->key - s->cert->pkeys)) return 1; if (SSL_USE_SIGALGS(s)) { if (s->s3->tmp.peer_sigalgs != NULL) { size_t i; #ifndef OPENSSL_NO_EC int curve; if (tls1_suiteb(s)) { EC_KEY *ec = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[SSL_PKEY_ECC].privatekey); curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); } else { curve = -1; } #endif for (i = 0; i < s->cert->shared_sigalgslen; i++) { lu = s->cert->shared_sigalgs[i]; if (s->server) { if (!tls12_check_cert_sigalg(s, lu)) continue; } else if (lu->sig_idx != s->cert->key - s->cert->pkeys) { continue; } #ifndef OPENSSL_NO_EC if (curve == -1 || lu->curve == curve) #endif break; } if (i == s->cert->shared_sigalgslen) { if (al == NULL) return 1; *al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_TLS_CHOOSE_SIGALG, ERR_R_INTERNAL_ERROR); return 0; } } else { const uint16_t *sent_sigs; size_t sent_sigslen, i; if ((lu = tls1_get_legacy_sigalg(s, -1)) == NULL) { if (al == NULL) return 1; *al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_TLS_CHOOSE_SIGALG, ERR_R_INTERNAL_ERROR); return 0; } sent_sigslen = tls12_get_psigalgs(s, 1, &sent_sigs); for (i = 0; i < sent_sigslen; i++, sent_sigs++) { if (lu->sigalg == *sent_sigs) break; } if (i == sent_sigslen) { if (al == NULL) return 1; SSLerr(SSL_F_TLS_CHOOSE_SIGALG, SSL_R_WRONG_SIGNATURE_TYPE); *al = SSL_AD_ILLEGAL_PARAMETER; return 0; } } } else { if ((lu = tls1_get_legacy_sigalg(s, -1)) == NULL) { if (al == NULL) return 1; *al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_TLS_CHOOSE_SIGALG, ERR_R_INTERNAL_ERROR); return 0; } } } s->s3->tmp.cert = &s->cert->pkeys[lu->sig_idx]; s->cert->key = s->s3->tmp.cert; s->s3->tmp.sigalg = lu; return 1; } ssl/t1_lib.c:2365: error: NULL_DEREFERENCE pointer `ec` last assigned on line 2364 could be null and is dereferenced by call to `EC_KEY_get0_group()` at line 2365, column 53. Showing all 29 steps of the trace ssl/t1_lib.c:2296:1: start of procedure tls_choose_sigalg() 2294. * to the server. In this case no error is set. 2295. */ 2296. > int tls_choose_sigalg(SSL *s, int *al) 2297. { 2298. const SIGALG_LOOKUP *lu = NULL; ssl/t1_lib.c:2298:5: 2296. int tls_choose_sigalg(SSL *s, int *al) 2297. { 2298. > const SIGALG_LOOKUP *lu = NULL; 2299. 2300. s->s3->tmp.cert = NULL; ssl/t1_lib.c:2300:5: 2298. const SIGALG_LOOKUP *lu = NULL; 2299. 2300. > s->s3->tmp.cert = NULL; 2301. s->s3->tmp.sigalg = NULL; 2302. ssl/t1_lib.c:2301:5: 2299. 2300. s->s3->tmp.cert = NULL; 2301. > s->s3->tmp.sigalg = NULL; 2302. 2303. if (SSL_IS_TLS13(s)) { ssl/t1_lib.c:2303:9: Taking false branch 2301. s->s3->tmp.sigalg = NULL; 2302. 2303. if (SSL_IS_TLS13(s)) { ^ 2304. size_t i; 2305. #ifndef OPENSSL_NO_EC ssl/t1_lib.c:2351:15: Taking false branch 2349. } else { 2350. /* If ciphersuite doesn't require a cert nothing to do */ 2351. if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aCERT)) ^ 2352. return 1; 2353. if (!s->server && !ssl_has_cert(s, s->cert->key - s->cert->pkeys)) ssl/t1_lib.c:2353:14: Taking true branch 2351. if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aCERT)) 2352. return 1; 2353. if (!s->server && !ssl_has_cert(s, s->cert->key - s->cert->pkeys)) ^ 2354. return 1; 2355. ssl/t1_lib.c:2353:28: 2351. if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aCERT)) 2352. return 1; 2353. > if (!s->server && !ssl_has_cert(s, s->cert->key - s->cert->pkeys)) 2354. return 1; 2355. ssl/ssl_locl.h:2069:1: start of procedure ssl_has_cert() 2067. 2068. /* Returns true if certificate and private key for 'idx' are present */ 2069. > static ossl_inline int ssl_has_cert(const SSL *s, int idx) 2070. { 2071. if (idx < 0 || idx >= SSL_PKEY_NUM) ssl/ssl_locl.h:2071:9: Taking false branch 2069. static ossl_inline int ssl_has_cert(const SSL *s, int idx) 2070. { 2071. if (idx < 0 || idx >= SSL_PKEY_NUM) ^ 2072. return 0; 2073. return s->cert->pkeys[idx].x509 != NULL ssl/ssl_locl.h:2071:20: Taking false branch 2069. static ossl_inline int ssl_has_cert(const SSL *s, int idx) 2070. { 2071. if (idx < 0 || idx >= SSL_PKEY_NUM) ^ 2072. return 0; 2073. return s->cert->pkeys[idx].x509 != NULL ssl/ssl_locl.h:2073:12: Condition is true 2071. if (idx < 0 || idx >= SSL_PKEY_NUM) 2072. return 0; 2073. return s->cert->pkeys[idx].x509 != NULL ^ 2074. && s->cert->pkeys[idx].privatekey != NULL; 2075. } ssl/ssl_locl.h:2074:12: Condition is true 2072. return 0; 2073. return s->cert->pkeys[idx].x509 != NULL 2074. && s->cert->pkeys[idx].privatekey != NULL; ^ 2075. } 2076. ssl/ssl_locl.h:2073:12: 2071. if (idx < 0 || idx >= SSL_PKEY_NUM) 2072. return 0; 2073. > return s->cert->pkeys[idx].x509 != NULL 2074. && s->cert->pkeys[idx].privatekey != NULL; 2075. } ssl/ssl_locl.h:2073:5: 2071. if (idx < 0 || idx >= SSL_PKEY_NUM) 2072. return 0; 2073. > return s->cert->pkeys[idx].x509 != NULL 2074. && s->cert->pkeys[idx].privatekey != NULL; 2075. } ssl/ssl_locl.h:2075:1: return from a call to ssl_has_cert 2073. return s->cert->pkeys[idx].x509 != NULL 2074. && s->cert->pkeys[idx].privatekey != NULL; 2075. > } 2076. 2077. # ifndef OPENSSL_UNIT_TEST ssl/t1_lib.c:2353:28: Taking false branch 2351. if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aCERT)) 2352. return 1; 2353. if (!s->server && !ssl_has_cert(s, s->cert->key - s->cert->pkeys)) ^ 2354. return 1; 2355. ssl/t1_lib.c:2356:13: Taking true branch 2354. return 1; 2355. 2356. if (SSL_USE_SIGALGS(s)) { ^ 2357. if (s->s3->tmp.peer_sigalgs != NULL) { 2358. size_t i; ssl/t1_lib.c:2357:17: Taking true branch 2355. 2356. if (SSL_USE_SIGALGS(s)) { 2357. if (s->s3->tmp.peer_sigalgs != NULL) { ^ 2358. size_t i; 2359. #ifndef OPENSSL_NO_EC ssl/t1_lib.c:2363:21: Taking true branch 2361. 2362. /* For Suite B need to match signature algorithm to curve */ 2363. if (tls1_suiteb(s)) { ^ 2364. EC_KEY *ec = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[SSL_PKEY_ECC].privatekey); 2365. curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); ssl/t1_lib.c:2364:21: 2362. /* For Suite B need to match signature algorithm to curve */ 2363. if (tls1_suiteb(s)) { 2364. > EC_KEY *ec = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[SSL_PKEY_ECC].privatekey); 2365. curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); 2366. } else { crypto/evp/p_lib.c:346:1: start of procedure EVP_PKEY_get0_EC_KEY() 344. } 345. 346. > EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) 347. { 348. if (pkey->type != EVP_PKEY_EC) { crypto/evp/p_lib.c:348:9: Taking true branch 346. EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) 347. { 348. if (pkey->type != EVP_PKEY_EC) { ^ 349. EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY); 350. return NULL; crypto/evp/p_lib.c:349:9: Skipping ERR_put_error(): empty list of specs 347. { 348. if (pkey->type != EVP_PKEY_EC) { 349. EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY); ^ 350. return NULL; 351. } crypto/evp/p_lib.c:350:9: 348. if (pkey->type != EVP_PKEY_EC) { 349. EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY); 350. > return NULL; 351. } 352. return pkey->pkey.ec; crypto/evp/p_lib.c:353:1: return from a call to EVP_PKEY_get0_EC_KEY 351. } 352. return pkey->pkey.ec; 353. > } 354. 355. EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) ssl/t1_lib.c:2365:21: 2363. if (tls1_suiteb(s)) { 2364. EC_KEY *ec = EVP_PKEY_get0_EC_KEY(s->cert->pkeys[SSL_PKEY_ECC].privatekey); 2365. > curve = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); 2366. } else { 2367. curve = -1; crypto/ec/ec_key.c:419:1: start of procedure EC_KEY_get0_group() 417. } 418. 419. > const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key) 420. { 421. return key->group; crypto/ec/ec_key.c:421:5: 419. const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key) 420. { 421. > return key->group; 422. } 423.
https://github.com/openssl/openssl/blob/045d078aefdf8d5b077485630bfd21b09980d2ec/ssl/t1_lib.c/#L2365
d2a_code_trace_data_43809
static int interlaced_search(MpegEncContext *s, int ref_index, int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select) { MotionEstContext * const c= &s->me; const int size=0; const int h=8; int block; int P[10][2]; uint8_t * const mv_penalty= c->current_mv_penalty; int same=1; const int stride= 2*s->linesize; int dmin_sum= 0; const int mot_stride= s->mb_stride; const int xy= s->mb_x + s->mb_y*mot_stride; c->ymin>>=1; c->ymax>>=1; c->stride<<=1; c->uvstride<<=1; init_interlaced_ref(s, ref_index); for(block=0; block<2; block++){ int field_select; int best_dmin= INT_MAX; int best_field= -1; for(field_select=0; field_select<2; field_select++){ int dmin, mx_i, my_i; int16_t (*mv_table)[2]= mv_tables[block][field_select]; if(user_field_select){ assert(field_select==0 || field_select==1); assert(field_select_tables[block][xy]==0 || field_select_tables[block][xy]==1); if(field_select_tables[block][xy] != field_select) continue; } P_LEFT[0] = mv_table[xy - 1][0]; P_LEFT[1] = mv_table[xy - 1][1]; if(P_LEFT[0] > (c->xmax<<1)) P_LEFT[0] = (c->xmax<<1); c->pred_x= P_LEFT[0]; c->pred_y= P_LEFT[1]; if(!s->first_slice_line){ P_TOP[0] = mv_table[xy - mot_stride][0]; P_TOP[1] = mv_table[xy - mot_stride][1]; P_TOPRIGHT[0] = mv_table[xy - mot_stride + 1][0]; P_TOPRIGHT[1] = mv_table[xy - mot_stride + 1][1]; if(P_TOP[1] > (c->ymax<<1)) P_TOP[1] = (c->ymax<<1); if(P_TOPRIGHT[0] < (c->xmin<<1)) P_TOPRIGHT[0]= (c->xmin<<1); if(P_TOPRIGHT[0] > (c->xmax<<1)) P_TOPRIGHT[0]= (c->xmax<<1); if(P_TOPRIGHT[1] > (c->ymax<<1)) P_TOPRIGHT[1]= (c->ymax<<1); P_MEDIAN[0]= mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]); P_MEDIAN[1]= mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]); } P_MV1[0]= mx; P_MV1[1]= my / 2; dmin = epzs_motion_search2(s, &mx_i, &my_i, P, block, field_select+ref_index, mv_table, (1<<16)>>1); dmin= c->sub_motion_search(s, &mx_i, &my_i, dmin, block, field_select+ref_index, size, h); mv_table[xy][0]= mx_i; mv_table[xy][1]= my_i; if(s->dsp.me_sub_cmp[0] != s->dsp.mb_cmp[0]){ int dxy; uint8_t *ref= c->ref[field_select+ref_index][0] + (mx_i>>1) + (my_i>>1)*stride; dxy = ((my_i & 1) << 1) | (mx_i & 1); if(s->no_rounding){ s->dsp.put_no_rnd_pixels_tab[size][dxy](c->scratchpad, ref , stride, h); }else{ s->dsp.put_pixels_tab [size][dxy](c->scratchpad, ref , stride, h); } dmin= s->dsp.mb_cmp[size](s, c->src[block][0], c->scratchpad, stride, h); dmin+= (mv_penalty[mx_i-c->pred_x] + mv_penalty[my_i-c->pred_y] + 1)*c->mb_penalty_factor; }else dmin+= c->mb_penalty_factor; dmin += field_select != block; if(dmin < best_dmin){ best_dmin= dmin; best_field= field_select; } } { int16_t (*mv_table)[2]= mv_tables[block][best_field]; if(mv_table[xy][0] != mx) same=0; if(mv_table[xy][1]&1) same=0; if(mv_table[xy][1]*2 != my) same=0; if(best_field != block) same=0; } field_select_tables[block][xy]= best_field; dmin_sum += best_dmin; } c->ymin<<=1; c->ymax<<=1; c->stride>>=1; c->uvstride>>=1; if(same) return INT_MAX; switch(c->avctx->mb_cmp&0xFF){ case FF_CMP_RD: return dmin_sum; default: return dmin_sum+ 11*c->mb_penalty_factor; } } libavcodec/motion_est.c:1938: error: Buffer Overrun L2 Offset: [1, 2] (⇐ 1 + [0, 1]) Size: 2 by call to `interlaced_search`. libavcodec/motion_est.c:1838:1: Parameter `s->b_field_mv_table[*]` 1836. } 1837. 1838. void ff_estimate_b_frame_motion(MpegEncContext * s, ^ 1839. int mb_x, int mb_y) 1840. { libavcodec/motion_est.c:1938:16: Call 1936. s->b_forw_mv_table[xy][0], s->b_forw_mv_table[xy][1], 0); 1937. c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_MV; 1938. bimin= interlaced_search(s, 2, ^ 1939. s->b_field_mv_table[1], s->b_field_select_table[1], 1940. s->b_back_mv_table[xy][0], s->b_back_mv_table[xy][1], 0); libavcodec/motion_est.c:893:1: <Offset trace> 891. } 892. 893. static int interlaced_search(MpegEncContext *s, int ref_index, ^ 894. int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select) 895. { libavcodec/motion_est.c:893:1: Parameter `**field_select_tables` 891. } 892. 893. static int interlaced_search(MpegEncContext *s, int ref_index, ^ 894. int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select) 895. { libavcodec/motion_est.c:893:1: <Length trace> 891. } 892. 893. static int interlaced_search(MpegEncContext *s, int ref_index, ^ 894. int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select) 895. { libavcodec/motion_est.c:893:1: Parameter `*mv_tables` 891. } 892. 893. static int interlaced_search(MpegEncContext *s, int ref_index, ^ 894. int16_t (*mv_tables[2][2])[2], uint8_t *field_select_tables[2], int mx, int my, int user_field_select) 895. { libavcodec/motion_est.c:921:37: Array access: Offset: [1, 2] (⇐ 1 + [0, 1]) Size: 2 by call to `interlaced_search` 919. for(field_select=0; field_select<2; field_select++){ 920. int dmin, mx_i, my_i; 921. int16_t (*mv_table)[2]= mv_tables[block][field_select]; ^ 922. 923. if(user_field_select){
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L921
d2a_code_trace_data_43810
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:1059: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:1059:9: 1057. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1) 1058. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1) 1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) ) ^ 1060. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) ) 1061. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1059
d2a_code_trace_data_43811
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) { int i, nw, lb, rb; BN_ULONG *t, *f; BN_ULONG l; bn_check_top(r); bn_check_top(a); if (n < 0) { BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT); return 0; } r->neg = a->neg; nw = n / BN_BITS2; if (bn_wexpand(r, a->top + nw + 1) == NULL) return (0); lb = n % BN_BITS2; rb = BN_BITS2 - lb; f = a->d; t = r->d; t[a->top + nw] = 0; if (lb == 0) for (i = a->top - 1; i >= 0; i--) t[nw + i] = f[i]; else for (i = a->top - 1; i >= 0; i--) { l = f[i]; t[nw + i + 1] |= (l >> rb) & BN_MASK2; t[nw + i] = (l << lb) & BN_MASK2; } memset(t, 0, sizeof(*t) * nw); r->top = a->top + nw + 1; bn_correct_top(r); bn_check_top(r); return (1); } test/srptest.c:180: error: BUFFER_OVERRUN_L3 Offset: [1, +oo] Size: [0, 8388607] by call to `SRP_create_verifier_BN`. Showing all 20 steps of the trace test/srptest.c:180:10: Call 178. BN_hex2bn(&s, "BEB25379D1A8581EB5A727673A2441EE"); 179. /* Set up server's password entry */ 180. if (!SRP_create_verifier_BN("alice", "password123", &s, &v, GN->N, ^ 181. GN->g)) { 182. fprintf(stderr, "Failed to create SRP verifier\n"); crypto/srp/srp_vfy.c:630:1: Parameter `g->top` 628. * BIGNUMS. 629. */ 630. > int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 631. BIGNUM **verifier, const BIGNUM *N, 632. const BIGNUM *g) crypto/srp/srp_vfy.c:661:10: Call 659. goto err; 660. 661. if (!BN_mod_exp(*verifier, g, x, N, bn_ctx)) { ^ 662. BN_clear_free(*verifier); 663. goto err; crypto/bn/bn_exp.c:90:1: Parameter `a->top` 88. } 89. 90. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 91. BN_CTX *ctx) 92. { crypto/bn/bn_exp.c:150:19: Call 148. } else 149. # endif 150. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL); ^ 151. } else 152. #endif crypto/bn/bn_exp.c:300:1: Parameter `a->top` 298. } 299. 300. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 301. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 302. { crypto/bn/bn_exp.c:312:16: Call 310. 311. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) { 312. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 313. } 314. crypto/bn/bn_exp.c:600:1: Parameter `a->top` 598. * http://www.daemonology.net/hyperthreading-considered-harmful/) 599. */ 600. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 601. const BIGNUM *m, BN_CTX *ctx, 602. BN_MONT_CTX *in_mont) crypto/bn/bn_exp.c:753:14: Call 751. /* prepare a^1 in Montgomery domain */ 752. if (a->neg || BN_ucmp(a, m) >= 0) { 753. if (!BN_mod(&am, a, m, ctx)) ^ 754. goto err; 755. if (!BN_to_montgomery(&am, &am, mont, ctx)) crypto/bn/bn_div.c:140:1: Parameter `num->top` 138. * If 'dv' or 'rm' is NULL, the respective value is not returned. 139. */ 140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 141. BN_CTX *ctx) 142. { crypto/bn/bn_div.c:210:11: Call 208. sdiv->neg = 0; 209. norm_shift += BN_BITS2; 210. if (!(BN_lshift(snum, num, norm_shift))) ^ 211. goto err; 212. snum->neg = 0; crypto/bn/bn_shift.c:81:1: <Offset trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `n` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:96:5: Assignment 94. 95. r->neg = a->neg; 96. nw = n / BN_BITS2; ^ 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) 98. return (0); crypto/bn/bn_shift.c:81:1: <Length trace> 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:81:1: Parameter `*r->d` 79. } 80. 81. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 82. { 83. int i, nw, lb, rb; crypto/bn/bn_shift.c:97:9: Call 95. r->neg = a->neg; 96. nw = n / BN_BITS2; 97. if (bn_wexpand(r, a->top + nw + 1) == NULL) ^ 98. return (0); 99. lb = n % BN_BITS2; crypto/bn/bn_lib.c: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 `SRP_create_verifier_BN` 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/b90506e995d44dee0ef4dd0324b56b59154256c2/crypto/bn/bn_shift.c/#L110
d2a_code_trace_data_43812
static int decode_header_trees(SmackVContext *smk) { GetBitContext gb; int mmap_size, mclr_size, full_size, type_size; mmap_size = AV_RL32(smk->avctx->extradata); mclr_size = AV_RL32(smk->avctx->extradata + 4); full_size = AV_RL32(smk->avctx->extradata + 8); type_size = AV_RL32(smk->avctx->extradata + 12); init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); smk->mmap_tbl = av_malloc(sizeof(int) * 2); if (!smk->mmap_tbl) return AVERROR(ENOMEM); smk->mmap_tbl[0] = 0; smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n"); smk->mclr_tbl = av_malloc(sizeof(int) * 2); if (!smk->mclr_tbl) return AVERROR(ENOMEM); smk->mclr_tbl[0] = 0; smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n"); smk->full_tbl = av_malloc(sizeof(int) * 2); if (!smk->full_tbl) return AVERROR(ENOMEM); smk->full_tbl[0] = 0; smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size)) return -1; } if(!get_bits1(&gb)) { av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n"); smk->type_tbl = av_malloc(sizeof(int) * 2); if (!smk->type_tbl) return AVERROR(ENOMEM); smk->type_tbl[0] = 0; smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1; } else { if (smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size)) return -1; } return 0; } libavcodec/smacker.c:306: error: Null Dereference pointer `&gb->buffer` last assigned on line 304 could be null and is dereferenced by call to `get_bits1()` at line 306, column 9. libavcodec/smacker.c:295:1: start of procedure decode_header_trees() 293. } 294. 295. static int decode_header_trees(SmackVContext *smk) { ^ 296. GetBitContext gb; 297. int mmap_size, mclr_size, full_size, type_size; libavcodec/smacker.c:299:5: 297. int mmap_size, mclr_size, full_size, type_size; 298. 299. mmap_size = AV_RL32(smk->avctx->extradata); ^ 300. mclr_size = AV_RL32(smk->avctx->extradata + 4); 301. full_size = AV_RL32(smk->avctx->extradata + 8); libavcodec/smacker.c:300:5: 298. 299. mmap_size = AV_RL32(smk->avctx->extradata); 300. mclr_size = AV_RL32(smk->avctx->extradata + 4); ^ 301. full_size = AV_RL32(smk->avctx->extradata + 8); 302. type_size = AV_RL32(smk->avctx->extradata + 12); libavcodec/smacker.c:301:5: 299. mmap_size = AV_RL32(smk->avctx->extradata); 300. mclr_size = AV_RL32(smk->avctx->extradata + 4); 301. full_size = AV_RL32(smk->avctx->extradata + 8); ^ 302. type_size = AV_RL32(smk->avctx->extradata + 12); 303. libavcodec/smacker.c:302:5: 300. mclr_size = AV_RL32(smk->avctx->extradata + 4); 301. full_size = AV_RL32(smk->avctx->extradata + 8); 302. type_size = AV_RL32(smk->avctx->extradata + 12); ^ 303. 304. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); libavcodec/smacker.c:304:5: 302. type_size = AV_RL32(smk->avctx->extradata + 12); 303. 304. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); ^ 305. 306. if(!get_bits1(&gb)) { libavcodec/get_bits.h:376:1: start of procedure init_get_bits() 374. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. 375. */ 376. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, ^ 377. int bit_size) 378. { libavcodec/get_bits.h:380:5: 378. { 379. int buffer_size; 380. int ret = 0; ^ 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { libavcodec/get_bits.h:382:9: Taking true branch 380. int ret = 0; 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { ^ 383. bit_size = 0; 384. buffer = NULL; libavcodec/get_bits.h:383:9: 381. 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 383. bit_size = 0; ^ 384. buffer = NULL; 385. ret = AVERROR_INVALIDDATA; libavcodec/get_bits.h:384:9: 382. if (bit_size > INT_MAX - 7 || bit_size < 0 || !buffer) { 383. bit_size = 0; 384. buffer = NULL; ^ 385. ret = AVERROR_INVALIDDATA; 386. } libavcodec/get_bits.h:385:9: 383. bit_size = 0; 384. buffer = NULL; 385. ret = AVERROR_INVALIDDATA; ^ 386. } 387. libavcodec/get_bits.h:388:5: 386. } 387. 388. buffer_size = (bit_size + 7) >> 3; ^ 389. 390. s->buffer = buffer; libavcodec/get_bits.h:390:5: 388. buffer_size = (bit_size + 7) >> 3; 389. 390. s->buffer = buffer; ^ 391. s->size_in_bits = bit_size; 392. #if !UNCHECKED_BITSTREAM_READER libavcodec/get_bits.h:391:5: 389. 390. s->buffer = buffer; 391. s->size_in_bits = bit_size; ^ 392. #if !UNCHECKED_BITSTREAM_READER 393. s->size_in_bits_plus8 = bit_size + 8; libavcodec/get_bits.h:393:5: 391. s->size_in_bits = bit_size; 392. #if !UNCHECKED_BITSTREAM_READER 393. s->size_in_bits_plus8 = bit_size + 8; ^ 394. #endif 395. s->buffer_end = buffer + buffer_size; libavcodec/get_bits.h:395:5: 393. s->size_in_bits_plus8 = bit_size + 8; 394. #endif 395. s->buffer_end = buffer + buffer_size; ^ 396. s->index = 0; 397. libavcodec/get_bits.h:396:5: 394. #endif 395. s->buffer_end = buffer + buffer_size; 396. s->index = 0; ^ 397. 398. return ret; libavcodec/get_bits.h:398:5: 396. s->index = 0; 397. 398. return ret; ^ 399. } 400. libavcodec/get_bits.h:399:1: return from a call to init_get_bits 397. 398. return ret; 399. } ^ 400. 401. /** libavcodec/smacker.c:306:9: 304. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8); 305. 306. if(!get_bits1(&gb)) { ^ 307. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n"); 308. smk->mmap_tbl = av_malloc(sizeof(int) * 2); libavcodec/get_bits.h:272:1: start of procedure get_bits1() 270. } 271. 272. static inline unsigned int get_bits1(GetBitContext *s) ^ 273. { 274. unsigned int index = s->index; libavcodec/get_bits.h:274:5: 272. static inline unsigned int get_bits1(GetBitContext *s) 273. { 274. unsigned int index = s->index; ^ 275. uint8_t result = s->buffer[index >> 3]; 276. #ifdef BITSTREAM_READER_LE libavcodec/get_bits.h:275:5: 273. { 274. unsigned int index = s->index; 275. uint8_t result = s->buffer[index >> 3]; ^ 276. #ifdef BITSTREAM_READER_LE 277. result >>= index & 7;
https://github.com/libav/libav/blob/77ab341c0c6cdf2bd437bb48d429e797d1e60da2/libavcodec/smacker.c/#L306
d2a_code_trace_data_43813
static int fill_default_ref_list(H264Context *h){ MpegEncContext * const s = &h->s; int i; int smallest_poc_greater_than_current = -1; int structure_sel; Picture sorted_short_ref[32]; Picture field_entry_list[2][32]; Picture *frame_list[2]; if (FIELD_PICTURE) { structure_sel = PICT_FRAME; frame_list[0] = field_entry_list[0]; frame_list[1] = field_entry_list[1]; } else { structure_sel = 0; frame_list[0] = h->default_ref_list[0]; frame_list[1] = h->default_ref_list[1]; } if(h->slice_type==FF_B_TYPE){ int list; int len[2]; int short_len[2]; int out_i; int limit= INT_MIN; for(out_i=0; out_i<h->short_ref_count; out_i++){ int best_i=INT_MIN; int best_poc=INT_MAX; for(i=0; i<h->short_ref_count; i++){ const int poc= h->short_ref[i]->poc; if(poc > limit && poc < best_poc){ best_poc= poc; best_i= i; } } assert(best_i != INT_MIN); limit= best_poc; sorted_short_ref[out_i]= *h->short_ref[best_i]; tprintf(h->s.avctx, "sorted poc: %d->%d poc:%d fn:%d\n", best_i, out_i, sorted_short_ref[out_i].poc, sorted_short_ref[out_i].frame_num); if (-1 == smallest_poc_greater_than_current) { if (h->short_ref[best_i]->poc >= s->current_picture_ptr->poc) { smallest_poc_greater_than_current = out_i; } } } tprintf(h->s.avctx, "current poc: %d, smallest_poc_greater_than_current: %d\n", s->current_picture_ptr->poc, smallest_poc_greater_than_current); for(list=0; list<2; list++){ int index = 0; int j= -99; int step= list ? -1 : 1; for(i=0; i<h->short_ref_count && index < h->ref_count[list]; i++, j+=step) { int sel; while(j<0 || j>= h->short_ref_count){ if(j != -99 && step == (list ? -1 : 1)) return -1; step = -step; j= smallest_poc_greater_than_current + (step>>1); } sel = sorted_short_ref[j].reference | structure_sel; if(sel != PICT_FRAME) continue; frame_list[list][index ]= sorted_short_ref[j]; frame_list[list][index++].pic_id= sorted_short_ref[j].frame_num; } short_len[list] = index; for(i = 0; i < 16 && index < h->ref_count[ list ]; i++){ int sel; if(h->long_ref[i] == NULL) continue; sel = h->long_ref[i]->reference | structure_sel; if(sel != PICT_FRAME) continue; frame_list[ list ][index ]= *h->long_ref[i]; frame_list[ list ][index++].pic_id= i; } len[list] = index; } for(list=0; list<2; list++){ if (FIELD_PICTURE) len[list] = split_field_ref_list(h->default_ref_list[list], h->ref_count[list], frame_list[list], len[list], s->picture_structure, short_len[list]); if(list && len[0] > 1 && len[0] == len[1]) for(i=0; h->default_ref_list[0][i].data[0] == h->default_ref_list[1][i].data[0]; i++) if(i == len[0]){ FFSWAP(Picture, h->default_ref_list[1][0], h->default_ref_list[1][1]); break; } if(len[list] < h->ref_count[ list ]) memset(&h->default_ref_list[list][len[list]], 0, sizeof(Picture)*(h->ref_count[ list ] - len[list])); } }else{ int index=0; int short_len; for(i=0; i<h->short_ref_count; i++){ int sel; sel = h->short_ref[i]->reference | structure_sel; if(sel != PICT_FRAME) continue; frame_list[0][index ]= *h->short_ref[i]; frame_list[0][index++].pic_id= h->short_ref[i]->frame_num; } short_len = index; for(i = 0; i < 16; i++){ int sel; if(h->long_ref[i] == NULL) continue; sel = h->long_ref[i]->reference | structure_sel; if(sel != PICT_FRAME) continue; frame_list[0][index ]= *h->long_ref[i]; frame_list[0][index++].pic_id= i; } if (FIELD_PICTURE) index = split_field_ref_list(h->default_ref_list[0], h->ref_count[0], frame_list[0], index, s->picture_structure, short_len); if(index < h->ref_count[0]) memset(&h->default_ref_list[0][index], 0, sizeof(Picture)*(h->ref_count[0] - index)); } #ifdef TRACE for (i=0; i<h->ref_count[0]; i++) { tprintf(h->s.avctx, "List0: %s fn:%d 0x%p\n", (h->default_ref_list[0][i].long_ref ? "LT" : "ST"), h->default_ref_list[0][i].pic_id, h->default_ref_list[0][i].data[0]); } if(h->slice_type==FF_B_TYPE){ for (i=0; i<h->ref_count[1]; i++) { tprintf(h->s.avctx, "List1: %s fn:%d 0x%p\n", (h->default_ref_list[1][i].long_ref ? "LT" : "ST"), h->default_ref_list[1][i].pic_id, h->default_ref_list[1][i].data[0]); } } #endif return 0; } libavcodec/h264.c:2938: error: Uninitialized Value The value read from len[_] was never initialized. libavcodec/h264.c:2938:24: 2936. 2937. // swap the two first elements of L1 when L0 and L1 are identical 2938. if(list && len[0] > 1 && len[0] == len[1]) ^ 2939. for(i=0; h->default_ref_list[0][i].data[0] == h->default_ref_list[1][i].data[0]; i++) 2940. if(i == len[0]){
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L2938
d2a_code_trace_data_43814
static int epzs_motion_search4(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int src_index, int ref_index, int16_t (*last_mv)[2], int ref_mv_scale) { MotionEstContext * const c= &s->me; int best[2]={0, 0}; int d, dmin; int map_generation; const int penalty_factor= c->penalty_factor; const int size=1; const int h=8; const int ref_mv_stride= s->mb_stride; const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride; me_cmp_func cmpf, chroma_cmpf; LOAD_COMMON int flags= c->flags; LOAD_COMMON2 cmpf= s->dsp.me_cmp[size]; chroma_cmpf= s->dsp.me_cmp[size+1]; map_generation= update_map_generation(c); dmin = 1000000; if (s->first_slice_line) { CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) }else{ CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) } if(dmin>64*4){ CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) if(s->mb_y+1<s->end_mb_y) CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) } dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags); *mx_ptr= best[0]; *my_ptr= best[1]; return dmin; } libavcodec/motion_est_template.c:1167: error: Uninitialized Value The value read from ymin was never initialized. libavcodec/motion_est_template.c:1167:9: 1165. //FIXME try some early stop 1166. CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) 1167. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) ^ 1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift) 1169. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1167
d2a_code_trace_data_43815
void RAND_seed(const void *buf, int num) { const RAND_METHOD *meth = RAND_get_rand_method(); if (meth->seed != NULL) meth->seed(buf, num); } crypto/rand/rand_lib.c:750: error: NULL_DEREFERENCE pointer `meth` last assigned on line 748 could be null and is dereferenced at line 750, column 9. Showing all 6 steps of the trace crypto/rand/rand_lib.c:746:1: start of procedure RAND_seed() 744. #endif 745. 746. > void RAND_seed(const void *buf, int num) 747. { 748. const RAND_METHOD *meth = RAND_get_rand_method(); crypto/rand/rand_lib.c:748:5: 746. void RAND_seed(const void *buf, int num) 747. { 748. > const RAND_METHOD *meth = RAND_get_rand_method(); 749. 750. if (meth->seed != NULL) crypto/rand/rand_lib.c:686:1: start of procedure RAND_get_rand_method() 684. #endif 685. 686. > const RAND_METHOD *RAND_get_rand_method(void) 687. { 688. #ifdef FIPS_MODE crypto/rand/rand_lib.c:689:5: 687. { 688. #ifdef FIPS_MODE 689. > return NULL; 690. #else 691. const RAND_METHOD *tmp_meth = NULL; crypto/rand/rand_lib.c:718:1: return from a call to RAND_get_rand_method 716. return tmp_meth; 717. #endif 718. > } 719. 720. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE) crypto/rand/rand_lib.c:750:9: 748. const RAND_METHOD *meth = RAND_get_rand_method(); 749. 750. > if (meth->seed != NULL) 751. meth->seed(buf, num); 752. }
https://github.com/openssl/openssl/blob/2cafb1dff3ef13c470c4d2d7b1d8a1f7142d8813/crypto/rand/rand_lib.c/#L750
d2a_code_trace_data_43816
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/srp/srp_lib.c:74: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul`. Showing all 23 steps of the trace crypto/srp/srp_lib.c:72:10: Call 70. /* S = (A*v**u) ** b */ 71. 72. if (!BN_mod_exp(tmp, v, u, N, bn_ctx)) ^ 73. goto err; 74. if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx)) 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:141:19: Call 139. && (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) { 140. BN_ULONG A = a->d[0]; 141. ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL); ^ 142. } else 143. # endif crypto/bn/bn_exp.c:1129:1: Parameter `ctx->stack.depth` 1127. } 1128. 1129. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, 1130. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 1131. { crypto/srp/srp_lib.c:74:10: Call 72. if (!BN_mod_exp(tmp, v, u, N, bn_ctx)) 73. goto err; 74. if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx)) ^ 75. goto err; 76. crypto/bn/bn_mod.c:193:1: Parameter `ctx->stack.depth` 191. 192. /* slow but works */ 193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, 194. BN_CTX *ctx) 195. { crypto/bn/bn_mod.c:203:5: Call 201. bn_check_top(m); 202. 203. BN_CTX_start(ctx); ^ 204. if ((t = BN_CTX_get(ctx)) == NULL) 205. goto err; crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_mod.c:204:14: Call 202. 203. BN_CTX_start(ctx); 204. if ((t = BN_CTX_get(ctx)) == NULL) ^ 205. goto err; 206. if (a == b) { crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth` 200. } 201. 202. > BIGNUM *BN_CTX_get(BN_CTX *ctx) 203. { 204. BIGNUM *ret; crypto/bn/bn_mod.c:207:14: Call 205. goto err; 206. if (a == b) { 207. if (!BN_sqr(t, a, ctx)) ^ 208. goto err; 209. } else { crypto/bn/bn_sqr.c:17:1: Parameter `ctx->stack.depth` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int ret = bn_sqr_fixed_top(r, a, ctx); crypto/bn/bn_sqr.c:19:15: Call 17. int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int ret = bn_sqr_fixed_top(r, a, ctx); ^ 20. 21. bn_correct_top(r); crypto/bn/bn_sqr.c:42:5: Call 40. } 41. 42. BN_CTX_start(ctx); ^ 43. rr = (a != r) ? r : BN_CTX_get(ctx); 44. tmp = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes` 169. } 170. 171. > void BN_CTX_start(BN_CTX *ctx) 172. { 173. CTXDBG("ENTER BN_CTX_start()", ctx); crypto/bn/bn_sqr.c:104:5: Call 102. bn_check_top(rr); 103. bn_check_top(tmp); 104. BN_CTX_end(ctx); ^ 105. return ret; 106. } crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes` 183. } 184. 185. > void BN_CTX_end(BN_CTX *ctx) 186. { 187. CTXDBG("ENTER BN_CTX_end()", ctx); crypto/bn/bn_ctx.c:191:27: Call 189. ctx->err_stack--; 190. else { 191. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 192. /* Does this stack frame have anything to release? */ 193. if (fp < ctx->used) crypto/bn/bn_ctx.c:266:1: <Offset trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `st->depth` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: <Length trace> 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes` 264. } 265. 266. > static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul` 266. static unsigned int BN_STACK_pop(BN_STACK *st) 267. { 268. return st->indexes[--(st->depth)]; ^ 269. } 270.
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
d2a_code_trace_data_43817
int av_write_trailer(AVFormatContext *s) { int ret, i; for(;;){ AVPacket pkt; ret= av_interleave_packet(s, &pkt, NULL, 1); if(ret<0) goto fail; if(!ret) break; truncate_ts(s->streams[pkt.stream_index], &pkt); ret= s->oformat->write_packet(s, &pkt); av_free_packet(&pkt); if(ret<0) goto fail; if(url_ferror(s->pb)) goto fail; } if(s->oformat->write_trailer) ret = s->oformat->write_trailer(s); fail: if(ret == 0) ret=url_ferror(s->pb); for(i=0;i<s->nb_streams;i++) av_freep(&s->streams[i]->priv_data); av_freep(&s->priv_data); return ret; } libavformat/utils.c:2560: error: Uninitialized Value The value read from ret was never initialized. libavformat/utils.c:2560:5: 2558. av_freep(&s->streams[i]->priv_data); 2559. av_freep(&s->priv_data); 2560. return ret; ^ 2561. } 2562.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/utils.c/#L2560
d2a_code_trace_data_43818
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/ec/ecp_smpl.c:1439: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_priv_rand_range`. Showing all 26 steps of the trace crypto/ec/ecp_smpl.c:1439:14: Call 1437. /* make sure lambda is not zero */ 1438. do { 1439. if (!BN_priv_rand_range(lambda, group->field)) { ^ 1440. ECerr(EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES, ERR_R_BN_LIB); 1441. goto err; crypto/bn/bn_rand.c:210:12: Call 208. int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) 209. { 210. return bnrand_range(PRIVATE, r, range, NULL); ^ 211. } 212. crypto/bn/bn_rand.c:127:1: Parameter `r->top` 125. 126. /* random number r: 0 <= r < range */ 127. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range, 128. BN_CTX *ctx) 129. { crypto/ec/ecp_smpl.c:1439:14: Call 1437. /* make sure lambda is not zero */ 1438. do { 1439. if (!BN_priv_rand_range(lambda, group->field)) { ^ 1440. ECerr(EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES, ERR_R_BN_LIB); 1441. goto err; crypto/bn/bn_rand.c:208:1: Parameter `r->top` 206. } 207. 208. > int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) 209. { 210. return bnrand_range(PRIVATE, r, range, NULL); crypto/bn/bn_rand.c:210:12: Call 208. int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range) 209. { 210. return bnrand_range(PRIVATE, r, range, NULL); ^ 211. } 212. crypto/bn/bn_rand.c:127:1: Parameter `r->top` 125. 126. /* random number r: 0 <= r < range */ 127. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range, 128. BN_CTX *ctx) 129. { crypto/bn/bn_rand.c:143:9: Call 141. 142. if (n == 1) 143. BN_zero(r); ^ 144. else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) { 145. /* crypto/bn/bn_lib.c:361:1: Parameter `a->top` 359. } 360. 361. > int BN_set_word(BIGNUM *a, BN_ULONG w) 362. { 363. bn_check_top(a); crypto/bn/bn_lib.c:364:9: Call 362. { 363. bn_check_top(a); 364. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 365. return 0; 366. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `a->top` 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_lcl.h:668:12: Call 666. return a; 667. 668. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2); ^ 669. } 670. crypto/bn/bn_lib.c:245:1: Parameter `b->top` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `words` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:224:13: Call 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/mem.c:228:1: Parameter `num` 226. } 227. 228. > void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); crypto/mem.c:230:17: Call 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:201:9: Assignment 199. 200. if (num == 0) 201. return NULL; ^ 202. 203. FAILTEST(); crypto/mem.c:230:5: Assignment 228. void *CRYPTO_zalloc(size_t num, const char *file, int line) 229. { 230. void *ret = CRYPTO_malloc(num, file, line); ^ 231. 232. FAILTEST(); crypto/mem.c:235:5: Assignment 233. if (ret != NULL) 234. memset(ret, 0, num); 235. return ret; ^ 236. } 237. crypto/bn/bn_lib.c:224:9: Assignment 222. a = OPENSSL_secure_zalloc(words * sizeof(*a)); 223. else 224. a = OPENSSL_zalloc(words * sizeof(*a)); ^ 225. if (a == NULL) { 226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_priv_rand_range` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_43819
static int alac_encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, void *data) { AlacEncodeContext *s = avctx->priv_data; PutBitContext *pb = &s->pbctx; int i, out_bytes, verbatim_flag = 0; if (buf_size < 2 * s->max_coded_frame_size) { av_log(avctx, AV_LOG_ERROR, "buffer size is too small\n"); return -1; } verbatim: init_put_bits(pb, frame, buf_size); if (s->compression_level == 0 || verbatim_flag) { const int16_t *samples = data; write_frame_header(s, 1); for (i = 0; i < avctx->frame_size * avctx->channels; i++) { put_sbits(pb, 16, *samples++); } } else { init_sample_buffers(s, data); write_frame_header(s, 0); write_compressed_frame(s); } put_bits(pb, 3, 7); flush_put_bits(pb); out_bytes = put_bits_count(pb) >> 3; if (out_bytes > s->max_coded_frame_size) { if (verbatim_flag || s->compression_level == 0) { av_log(avctx, AV_LOG_ERROR, "error encoding frame\n"); return -1; } verbatim_flag = 1; goto verbatim; } return out_bytes; } libavcodec/alacenc.c:526: error: Null Dereference pointer `s->pbctx.buf_ptr` last assigned on line 521 could be null and is dereferenced by call to `write_frame_header()` at line 526, column 9. libavcodec/alacenc.c:508:1: start of procedure alac_encode_frame() 506. } 507. 508. static int alac_encode_frame(AVCodecContext *avctx, uint8_t *frame, ^ 509. int buf_size, void *data) 510. { libavcodec/alacenc.c:511:5: 509. int buf_size, void *data) 510. { 511. AlacEncodeContext *s = avctx->priv_data; ^ 512. PutBitContext *pb = &s->pbctx; 513. int i, out_bytes, verbatim_flag = 0; libavcodec/alacenc.c:512:5: 510. { 511. AlacEncodeContext *s = avctx->priv_data; 512. PutBitContext *pb = &s->pbctx; ^ 513. int i, out_bytes, verbatim_flag = 0; 514. libavcodec/alacenc.c:513:5: 511. AlacEncodeContext *s = avctx->priv_data; 512. PutBitContext *pb = &s->pbctx; 513. int i, out_bytes, verbatim_flag = 0; ^ 514. 515. if (buf_size < 2 * s->max_coded_frame_size) { libavcodec/alacenc.c:515:9: Taking false branch 513. int i, out_bytes, verbatim_flag = 0; 514. 515. if (buf_size < 2 * s->max_coded_frame_size) { ^ 516. av_log(avctx, AV_LOG_ERROR, "buffer size is too small\n"); 517. return -1; libavcodec/alacenc.c:548:9: 546. } 547. verbatim_flag = 1; 548. goto verbatim; ^ 549. } 550. libavcodec/alacenc.c:521:5: 519. 520. verbatim: 521. init_put_bits(pb, frame, buf_size); ^ 522. 523. if (s->compression_level == 0 || verbatim_flag) { libavcodec/put_bits.h:52:1: start of procedure init_put_bits() 50. * @param buffer_size the size in bytes of buffer 51. */ 52. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size) ^ 53. { 54. if(buffer_size < 0) { libavcodec/put_bits.h:54:8: Taking true branch 52. static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size) 53. { 54. if(buffer_size < 0) { ^ 55. buffer_size = 0; 56. buffer = NULL; libavcodec/put_bits.h:55:9: 53. { 54. if(buffer_size < 0) { 55. buffer_size = 0; ^ 56. buffer = NULL; 57. } libavcodec/put_bits.h:56:9: 54. if(buffer_size < 0) { 55. buffer_size = 0; 56. buffer = NULL; ^ 57. } 58. libavcodec/put_bits.h:59:5: 57. } 58. 59. s->size_in_bits= 8*buffer_size; ^ 60. s->buf = buffer; 61. s->buf_end = s->buf + buffer_size; libavcodec/put_bits.h:60:5: 58. 59. s->size_in_bits= 8*buffer_size; 60. s->buf = buffer; ^ 61. s->buf_end = s->buf + buffer_size; 62. s->buf_ptr = s->buf; libavcodec/put_bits.h:61:5: 59. s->size_in_bits= 8*buffer_size; 60. s->buf = buffer; 61. s->buf_end = s->buf + buffer_size; ^ 62. s->buf_ptr = s->buf; 63. s->bit_left=32; libavcodec/put_bits.h:62:5: 60. s->buf = buffer; 61. s->buf_end = s->buf + buffer_size; 62. s->buf_ptr = s->buf; ^ 63. s->bit_left=32; 64. s->bit_buf=0; libavcodec/put_bits.h:63:5: 61. s->buf_end = s->buf + buffer_size; 62. s->buf_ptr = s->buf; 63. s->bit_left=32; ^ 64. s->bit_buf=0; 65. } libavcodec/put_bits.h:64:5: 62. s->buf_ptr = s->buf; 63. s->bit_left=32; 64. s->bit_buf=0; ^ 65. } 66. libavcodec/put_bits.h:65:1: return from a call to init_put_bits 63. s->bit_left=32; 64. s->bit_buf=0; 65. } ^ 66. 67. /** libavcodec/alacenc.c:523:9: Taking true branch 521. init_put_bits(pb, frame, buf_size); 522. 523. if (s->compression_level == 0 || verbatim_flag) { ^ 524. // Verbatim mode 525. const int16_t *samples = data; libavcodec/alacenc.c:525:9: 523. if (s->compression_level == 0 || verbatim_flag) { 524. // Verbatim mode 525. const int16_t *samples = data; ^ 526. write_frame_header(s, 1); 527. for (i = 0; i < avctx->frame_size * avctx->channels; i++) { libavcodec/alacenc.c:526:9: 524. // Verbatim mode 525. const int16_t *samples = data; 526. write_frame_header(s, 1); ^ 527. for (i = 0; i < avctx->frame_size * avctx->channels; i++) { 528. put_sbits(pb, 16, *samples++); libavcodec/alacenc.c:120:1: start of procedure write_frame_header() 118. } 119. 120. static void write_frame_header(AlacEncodeContext *s, int is_verbatim) ^ 121. { 122. put_bits(&s->pbctx, 3, s->avctx->channels-1); // No. of channels -1 libavcodec/alacenc.c:122:5: 120. static void write_frame_header(AlacEncodeContext *s, int is_verbatim) 121. { 122. put_bits(&s->pbctx, 3, s->avctx->channels-1); // No. of channels -1 ^ 123. put_bits(&s->pbctx, 16, 0); // Seems to be zero 124. put_bits(&s->pbctx, 1, 1); // Sample count is in the header libavcodec/put_bits.h:128:1: start of procedure put_bits() 126. * Use put_bits32 to write 32 bits. 127. */ 128. static inline void put_bits(PutBitContext *s, int n, unsigned int value) ^ 129. { 130. unsigned int bit_buf; libavcodec/put_bits.h:134:5: 132. 133. // printf("put_bits=%d %x\n", n, value); 134. assert(n <= 31 && value < (1U << n)); ^ 135. 136. bit_buf = s->bit_buf; libavcodec/put_bits.h:136:5: 134. assert(n <= 31 && value < (1U << n)); 135. 136. bit_buf = s->bit_buf; ^ 137. bit_left = s->bit_left; 138. libavcodec/put_bits.h:137:5: 135. 136. bit_buf = s->bit_buf; 137. bit_left = s->bit_left; ^ 138. 139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf); libavcodec/put_bits.h:151:9: Taking false branch 149. bit_left-=n; 150. #else 151. if (n < bit_left) { ^ 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; libavcodec/put_bits.h:155:9: 153. bit_left-=n; 154. } else { 155. bit_buf<<=bit_left; ^ 156. bit_buf |= value >> (n - bit_left); 157. AV_WB32(s->buf_ptr, bit_buf); libavcodec/put_bits.h:156:9: 154. } else { 155. bit_buf<<=bit_left; 156. bit_buf |= value >> (n - bit_left); ^ 157. AV_WB32(s->buf_ptr, bit_buf); 158. //printf("bitbuf = %08x\n", bit_buf); libavcodec/put_bits.h:157:9: 155. bit_buf<<=bit_left; 156. bit_buf |= value >> (n - bit_left); 157. AV_WB32(s->buf_ptr, bit_buf); ^ 158. //printf("bitbuf = %08x\n", bit_buf); 159. s->buf_ptr+=4; libavutil/bswap.h:66:1: start of procedure av_bswap32() 64. 65. #ifndef av_bswap32 66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x) ^ 67. { 68. return AV_BSWAP32C(x); libavutil/bswap.h:68:5: 66. static av_always_inline av_const uint32_t av_bswap32(uint32_t x) 67. { 68. return AV_BSWAP32C(x); ^ 69. } 70. #endif libavutil/bswap.h:69:1: return from a call to av_bswap32 67. { 68. return AV_BSWAP32C(x); 69. } ^ 70. #endif 71. libavcodec/put_bits.h:159:9: 157. AV_WB32(s->buf_ptr, bit_buf); 158. //printf("bitbuf = %08x\n", bit_buf); 159. s->buf_ptr+=4; ^ 160. bit_left+=32 - n; 161. bit_buf = value; libavcodec/put_bits.h:160:9: 158. //printf("bitbuf = %08x\n", bit_buf); 159. s->buf_ptr+=4; 160. bit_left+=32 - n; ^ 161. bit_buf = value; 162. } libavcodec/put_bits.h:161:9: 159. s->buf_ptr+=4; 160. bit_left+=32 - n; 161. bit_buf = value; ^ 162. } 163. #endif libavcodec/put_bits.h:165:5: 163. #endif 164. 165. s->bit_buf = bit_buf; ^ 166. s->bit_left = bit_left; 167. } libavcodec/put_bits.h:166:5: 164. 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; ^ 167. } 168. libavcodec/put_bits.h:167:1: return from a call to put_bits 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; 167. } ^ 168. 169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value) libavcodec/alacenc.c:123:5: 121. { 122. put_bits(&s->pbctx, 3, s->avctx->channels-1); // No. of channels -1 123. put_bits(&s->pbctx, 16, 0); // Seems to be zero ^ 124. put_bits(&s->pbctx, 1, 1); // Sample count is in the header 125. put_bits(&s->pbctx, 2, 0); // FIXME: Wasted bytes field libavcodec/put_bits.h:128:1: start of procedure put_bits() 126. * Use put_bits32 to write 32 bits. 127. */ 128. static inline void put_bits(PutBitContext *s, int n, unsigned int value) ^ 129. { 130. unsigned int bit_buf; libavcodec/put_bits.h:134:5: 132. 133. // printf("put_bits=%d %x\n", n, value); 134. assert(n <= 31 && value < (1U << n)); ^ 135. 136. bit_buf = s->bit_buf; libavcodec/put_bits.h:136:5: 134. assert(n <= 31 && value < (1U << n)); 135. 136. bit_buf = s->bit_buf; ^ 137. bit_left = s->bit_left; 138. libavcodec/put_bits.h:137:5: 135. 136. bit_buf = s->bit_buf; 137. bit_left = s->bit_left; ^ 138. 139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf); libavcodec/put_bits.h:151:9: Taking true branch 149. bit_left-=n; 150. #else 151. if (n < bit_left) { ^ 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; libavcodec/put_bits.h:152:9: 150. #else 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; ^ 153. bit_left-=n; 154. } else { libavcodec/put_bits.h:153:9: 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; ^ 154. } else { 155. bit_buf<<=bit_left; libavcodec/put_bits.h:165:5: 163. #endif 164. 165. s->bit_buf = bit_buf; ^ 166. s->bit_left = bit_left; 167. } libavcodec/put_bits.h:166:5: 164. 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; ^ 167. } 168. libavcodec/put_bits.h:167:1: return from a call to put_bits 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; 167. } ^ 168. 169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value) libavcodec/alacenc.c:124:5: 122. put_bits(&s->pbctx, 3, s->avctx->channels-1); // No. of channels -1 123. put_bits(&s->pbctx, 16, 0); // Seems to be zero 124. put_bits(&s->pbctx, 1, 1); // Sample count is in the header ^ 125. put_bits(&s->pbctx, 2, 0); // FIXME: Wasted bytes field 126. put_bits(&s->pbctx, 1, is_verbatim); // Audio block is verbatim libavcodec/put_bits.h:128:1: start of procedure put_bits() 126. * Use put_bits32 to write 32 bits. 127. */ 128. static inline void put_bits(PutBitContext *s, int n, unsigned int value) ^ 129. { 130. unsigned int bit_buf; libavcodec/put_bits.h:134:5: 132. 133. // printf("put_bits=%d %x\n", n, value); 134. assert(n <= 31 && value < (1U << n)); ^ 135. 136. bit_buf = s->bit_buf; libavcodec/put_bits.h:136:5: 134. assert(n <= 31 && value < (1U << n)); 135. 136. bit_buf = s->bit_buf; ^ 137. bit_left = s->bit_left; 138. libavcodec/put_bits.h:137:5: 135. 136. bit_buf = s->bit_buf; 137. bit_left = s->bit_left; ^ 138. 139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf); libavcodec/put_bits.h:151:9: Taking true branch 149. bit_left-=n; 150. #else 151. if (n < bit_left) { ^ 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; libavcodec/put_bits.h:152:9: 150. #else 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; ^ 153. bit_left-=n; 154. } else { libavcodec/put_bits.h:153:9: 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; ^ 154. } else { 155. bit_buf<<=bit_left; libavcodec/put_bits.h:165:5: 163. #endif 164. 165. s->bit_buf = bit_buf; ^ 166. s->bit_left = bit_left; 167. } libavcodec/put_bits.h:166:5: 164. 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; ^ 167. } 168. libavcodec/put_bits.h:167:1: return from a call to put_bits 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; 167. } ^ 168. 169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value) libavcodec/alacenc.c:125:5: 123. put_bits(&s->pbctx, 16, 0); // Seems to be zero 124. put_bits(&s->pbctx, 1, 1); // Sample count is in the header 125. put_bits(&s->pbctx, 2, 0); // FIXME: Wasted bytes field ^ 126. put_bits(&s->pbctx, 1, is_verbatim); // Audio block is verbatim 127. put_bits32(&s->pbctx, s->avctx->frame_size); // No. of samples in the frame libavcodec/put_bits.h:128:1: start of procedure put_bits() 126. * Use put_bits32 to write 32 bits. 127. */ 128. static inline void put_bits(PutBitContext *s, int n, unsigned int value) ^ 129. { 130. unsigned int bit_buf; libavcodec/put_bits.h:134:5: 132. 133. // printf("put_bits=%d %x\n", n, value); 134. assert(n <= 31 && value < (1U << n)); ^ 135. 136. bit_buf = s->bit_buf; libavcodec/put_bits.h:136:5: 134. assert(n <= 31 && value < (1U << n)); 135. 136. bit_buf = s->bit_buf; ^ 137. bit_left = s->bit_left; 138. libavcodec/put_bits.h:137:5: 135. 136. bit_buf = s->bit_buf; 137. bit_left = s->bit_left; ^ 138. 139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf); libavcodec/put_bits.h:151:9: Taking true branch 149. bit_left-=n; 150. #else 151. if (n < bit_left) { ^ 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; libavcodec/put_bits.h:152:9: 150. #else 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; ^ 153. bit_left-=n; 154. } else { libavcodec/put_bits.h:153:9: 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; ^ 154. } else { 155. bit_buf<<=bit_left; libavcodec/put_bits.h:165:5: 163. #endif 164. 165. s->bit_buf = bit_buf; ^ 166. s->bit_left = bit_left; 167. } libavcodec/put_bits.h:166:5: 164. 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; ^ 167. } 168. libavcodec/put_bits.h:167:1: return from a call to put_bits 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; 167. } ^ 168. 169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value) libavcodec/alacenc.c:126:5: 124. put_bits(&s->pbctx, 1, 1); // Sample count is in the header 125. put_bits(&s->pbctx, 2, 0); // FIXME: Wasted bytes field 126. put_bits(&s->pbctx, 1, is_verbatim); // Audio block is verbatim ^ 127. put_bits32(&s->pbctx, s->avctx->frame_size); // No. of samples in the frame 128. } libavcodec/put_bits.h:128:1: start of procedure put_bits() 126. * Use put_bits32 to write 32 bits. 127. */ 128. static inline void put_bits(PutBitContext *s, int n, unsigned int value) ^ 129. { 130. unsigned int bit_buf; libavcodec/put_bits.h:134:5: 132. 133. // printf("put_bits=%d %x\n", n, value); 134. assert(n <= 31 && value < (1U << n)); ^ 135. 136. bit_buf = s->bit_buf; libavcodec/put_bits.h:136:5: 134. assert(n <= 31 && value < (1U << n)); 135. 136. bit_buf = s->bit_buf; ^ 137. bit_left = s->bit_left; 138. libavcodec/put_bits.h:137:5: 135. 136. bit_buf = s->bit_buf; 137. bit_left = s->bit_left; ^ 138. 139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf); libavcodec/put_bits.h:151:9: Taking true branch 149. bit_left-=n; 150. #else 151. if (n < bit_left) { ^ 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; libavcodec/put_bits.h:152:9: 150. #else 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; ^ 153. bit_left-=n; 154. } else { libavcodec/put_bits.h:153:9: 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; ^ 154. } else { 155. bit_buf<<=bit_left; libavcodec/put_bits.h:165:5: 163. #endif 164. 165. s->bit_buf = bit_buf; ^ 166. s->bit_left = bit_left; 167. } libavcodec/put_bits.h:166:5: 164. 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; ^ 167. } 168. libavcodec/put_bits.h:167:1: return from a call to put_bits 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; 167. } ^ 168. 169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value) libavcodec/alacenc.c:127:5: 125. put_bits(&s->pbctx, 2, 0); // FIXME: Wasted bytes field 126. put_bits(&s->pbctx, 1, is_verbatim); // Audio block is verbatim 127. put_bits32(&s->pbctx, s->avctx->frame_size); // No. of samples in the frame ^ 128. } 129. libavcodec/put_bits.h:179:1: start of procedure put_bits32() 177. * Write exactly 32 bits into a bitstream. 178. */ 179. static void av_unused put_bits32(PutBitContext *s, uint32_t value) ^ 180. { 181. int lo = value & 0xffff; libavcodec/put_bits.h:181:5: 179. static void av_unused put_bits32(PutBitContext *s, uint32_t value) 180. { 181. int lo = value & 0xffff; ^ 182. int hi = value >> 16; 183. #ifdef BITSTREAM_WRITER_LE libavcodec/put_bits.h:182:5: 180. { 181. int lo = value & 0xffff; 182. int hi = value >> 16; ^ 183. #ifdef BITSTREAM_WRITER_LE 184. put_bits(s, 16, lo); libavcodec/put_bits.h:184:5: 182. int hi = value >> 16; 183. #ifdef BITSTREAM_WRITER_LE 184. put_bits(s, 16, lo); ^ 185. put_bits(s, 16, hi); 186. #else libavcodec/put_bits.h:128:1: start of procedure put_bits() 126. * Use put_bits32 to write 32 bits. 127. */ 128. static inline void put_bits(PutBitContext *s, int n, unsigned int value) ^ 129. { 130. unsigned int bit_buf; libavcodec/put_bits.h:134:5: 132. 133. // printf("put_bits=%d %x\n", n, value); 134. assert(n <= 31 && value < (1U << n)); ^ 135. 136. bit_buf = s->bit_buf; libavcodec/put_bits.h:136:5: 134. assert(n <= 31 && value < (1U << n)); 135. 136. bit_buf = s->bit_buf; ^ 137. bit_left = s->bit_left; 138. libavcodec/put_bits.h:137:5: 135. 136. bit_buf = s->bit_buf; 137. bit_left = s->bit_left; ^ 138. 139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf); libavcodec/put_bits.h:151:9: Taking true branch 149. bit_left-=n; 150. #else 151. if (n < bit_left) { ^ 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; libavcodec/put_bits.h:152:9: 150. #else 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; ^ 153. bit_left-=n; 154. } else { libavcodec/put_bits.h:153:9: 151. if (n < bit_left) { 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; ^ 154. } else { 155. bit_buf<<=bit_left; libavcodec/put_bits.h:165:5: 163. #endif 164. 165. s->bit_buf = bit_buf; ^ 166. s->bit_left = bit_left; 167. } libavcodec/put_bits.h:166:5: 164. 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; ^ 167. } 168. libavcodec/put_bits.h:167:1: return from a call to put_bits 165. s->bit_buf = bit_buf; 166. s->bit_left = bit_left; 167. } ^ 168. 169. static inline void put_sbits(PutBitContext *pb, int n, int32_t value) libavcodec/put_bits.h:185:5: 183. #ifdef BITSTREAM_WRITER_LE 184. put_bits(s, 16, lo); 185. put_bits(s, 16, hi); ^ 186. #else 187. put_bits(s, 16, hi); libavcodec/put_bits.h:128:1: start of procedure put_bits() 126. * Use put_bits32 to write 32 bits. 127. */ 128. static inline void put_bits(PutBitContext *s, int n, unsigned int value) ^ 129. { 130. unsigned int bit_buf; libavcodec/put_bits.h:134:5: 132. 133. // printf("put_bits=%d %x\n", n, value); 134. assert(n <= 31 && value < (1U << n)); ^ 135. 136. bit_buf = s->bit_buf; libavcodec/put_bits.h:136:5: 134. assert(n <= 31 && value < (1U << n)); 135. 136. bit_buf = s->bit_buf; ^ 137. bit_left = s->bit_left; 138. libavcodec/put_bits.h:137:5: 135. 136. bit_buf = s->bit_buf; 137. bit_left = s->bit_left; ^ 138. 139. // printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf); libavcodec/put_bits.h:151:9: Taking false branch 149. bit_left-=n; 150. #else 151. if (n < bit_left) { ^ 152. bit_buf = (bit_buf<<n) | value; 153. bit_left-=n; libavcodec/put_bits.h:155:9: 153. bit_left-=n; 154. } else { 155. bit_buf<<=bit_left; ^ 156. bit_buf |= value >> (n - bit_left); 157. AV_WB32(s->buf_ptr, bit_buf); libavcodec/put_bits.h:156:9: 154. } else { 155. bit_buf<<=bit_left; 156. bit_buf |= value >> (n - bit_left); ^ 157. AV_WB32(s->buf_ptr, bit_buf); 158. //printf("bitbuf = %08x\n", bit_buf); libavcodec/put_bits.h:157:9: 155. bit_buf<<=bit_left; 156. bit_buf |= value >> (n - bit_left); 157. AV_WB32(s->buf_ptr, bit_buf); ^ 158. //printf("bitbuf = %08x\n", bit_buf); 159. s->buf_ptr+=4;
https://github.com/libav/libav/blob/fc9cf0b2a6a0bd3933fcef216860c594b767834e/libavcodec/alacenc.c/#L526
d2a_code_trace_data_43820
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:725: error: BUFFER_OVERRUN_L2 Offset: [-oo, 1048576] Size: 256 by call to `X509_NAME_oneline`. Showing all 8 steps of the trace apps/x509.c:145:1: Array declaration 143. }; 144. 145. > int x509_main(int argc, char **argv) 146. { 147. ASN1_INTEGER *sno = NULL; apps/x509.c:725:17: Call 723. int len; 724. 725. X509_NAME_oneline(X509_get_subject_name(x), buf, sizeof buf); ^ 726. BIO_printf(out, "/*\n" 727. " * Subject: %s\n", buf); crypto/x509/x509_obj.c:62:5: <Offset trace> 60. 61. len--; /* space for '\0' */ 62. l = 0; ^ 63. for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { 64. ne = sk_X509_NAME_ENTRY_value(a->entries, i); crypto/x509/x509_obj.c:62:5: Assignment 60. 61. len--; /* space for '\0' */ 62. l = 0; ^ 63. for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { 64. ne = sk_X509_NAME_ENTRY_value(a->entries, i); crypto/x509/x509_obj.c:121:9: Assignment 119. } 120. 121. lold = l; ^ 122. l += 1 + l1 + 1 + l2; 123. if (l > NAME_ONELINE_MAX) { 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:134:13: Array access: Offset: [-oo, 1048576] Size: 256 by call to `X509_NAME_oneline` 132. break; 133. } else 134. p = &(buf[lold]); ^ 135. *(p++) = '/'; 136. memcpy(p, s, (unsigned int)l1);
https://github.com/openssl/openssl/blob/cdb2a60347f988037d29adc7e4415e9c66c8a5a5/crypto/x509/x509_obj.c/#L134
d2a_code_trace_data_43821
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/extensions_srvr.c:1192: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_CTX_remove_session`. Showing all 11 steps of the trace ssl/statem/extensions_srvr.c:1039:1: Parameter `s->session_ctx->sessions->num_items` 1037. } 1038. 1039. > int tls_parse_ctos_psk(SSL *s, PACKET *pkt, unsigned int context, X509 *x, 1040. size_t chainidx) 1041. { ssl/statem/extensions_srvr.c:1192:25: Call 1190. /* Check for replay */ 1191. if (s->max_early_data > 0 1192. && !SSL_CTX_remove_session(s->session_ctx, sess)) { ^ 1193. SSL_SESSION_free(sess); 1194. sess = NULL; ssl/ssl_sess.c:757:1: Parameter `ctx->sessions->num_items` 755. } 756. 757. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 758. { 759. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:759:12: Call 757. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 758. { 759. return remove_session_lock(ctx, c, 1); ^ 760. } 761. ssl/ssl_sess.c:762:1: Parameter `ctx->sessions->num_items` 760. } 761. 762. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 763. { 764. SSL_SESSION *r; ssl/ssl_sess.c:772:17: Call 770. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) != NULL) { 771. ret = 1; 772. r = lh_SSL_SESSION_delete(ctx->sessions, r); ^ 773. SSL_SESSION_list_remove(ctx, r); 774. } ssl/ssl_locl.h:727:1: Parameter `lh->num_items` 725. } TLSEXT_INDEX; 726. 727. > DEFINE_LHASH_OF(SSL_SESSION); 728. /* Needed in ssl_cert.c */ 729. DEFINE_LHASH_OF(X509_NAME); ssl/ssl_locl.h:727:1: Call 725. } TLSEXT_INDEX; 726. 727. > DEFINE_LHASH_OF(SSL_SESSION); 728. /* Needed in ssl_cert.c */ 729. DEFINE_LHASH_OF(X509_NAME); crypto/lhash/lhash.c:126:1: <LHS trace> 124. } 125. 126. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 127. { 128. unsigned long hash; crypto/lhash/lhash.c:126:1: Parameter `lh->num_items` 124. } 125. 126. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) 127. { 128. unsigned long hash; crypto/lhash/lhash.c:146:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_CTX_remove_session` 144. } 145. 146. lh->num_items--; ^ 147. if ((lh->num_nodes > MIN_NODES) && 148. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
https://github.com/openssl/openssl/blob/41145c35bfee8f2b0822288fcb23a807d06d8e89/crypto/lhash/lhash.c/#L146
d2a_code_trace_data_43822
static int pkey_gost_mac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { struct gost_mac_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx); unsigned char *keydata; if (!data->key_set) { GOSTerr(GOST_F_PKEY_GOST_MAC_KEYGEN, GOST_R_MAC_KEY_NOT_SET); return 0; } keydata = OPENSSL_malloc(32); if (keydata == NULL) return 0; memcpy(keydata, data->key, 32); EVP_PKEY_assign(pkey, NID_id_Gost28147_89_MAC, keydata); return 1; } engines/ccgost/gost_pmeth.c:440: error: MEMORY_LEAK memory dynamically allocated by call to `CRYPTO_malloc()` at line 436, column 15 is not reachable after line 440, column 5. Showing all 28 steps of the trace engines/ccgost/gost_pmeth.c:428:1: start of procedure pkey_gost_mac_keygen() 426. } 427. 428. > static int pkey_gost_mac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) 429. { 430. struct gost_mac_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx); engines/ccgost/gost_pmeth.c:430:5: 428. static int pkey_gost_mac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) 429. { 430. > struct gost_mac_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx); 431. unsigned char *keydata; 432. if (!data->key_set) { crypto/evp/pmeth_lib.c:406:1: start of procedure EVP_PKEY_CTX_get_data() 404. } 405. 406. > void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx) 407. { 408. return ctx->data; crypto/evp/pmeth_lib.c:408:5: 406. void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx) 407. { 408. > return ctx->data; 409. } 410. crypto/evp/pmeth_lib.c:409:1: return from a call to EVP_PKEY_CTX_get_data 407. { 408. return ctx->data; 409. > } 410. 411. EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx) engines/ccgost/gost_pmeth.c:432:10: Taking false branch 430. struct gost_mac_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx); 431. unsigned char *keydata; 432. if (!data->key_set) { ^ 433. GOSTerr(GOST_F_PKEY_GOST_MAC_KEYGEN, GOST_R_MAC_KEY_NOT_SET); 434. return 0; engines/ccgost/gost_pmeth.c:436:5: 434. return 0; 435. } 436. > keydata = OPENSSL_malloc(32); 437. if (keydata == NULL) 438. return 0; 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) engines/ccgost/gost_pmeth.c:437:9: Taking false branch 435. } 436. keydata = OPENSSL_malloc(32); 437. if (keydata == NULL) ^ 438. return 0; 439. memcpy(keydata, data->key, 32); engines/ccgost/gost_pmeth.c:439:5: 437. if (keydata == NULL) 438. return 0; 439. > memcpy(keydata, data->key, 32); 440. EVP_PKEY_assign(pkey, NID_id_Gost28147_89_MAC, keydata); 441. return 1; engines/ccgost/gost_pmeth.c:440:5: 438. return 0; 439. memcpy(keydata, data->key, 32); 440. > EVP_PKEY_assign(pkey, NID_id_Gost28147_89_MAC, keydata); 441. return 1; 442. } crypto/evp/p_lib.c:270:1: start of procedure EVP_PKEY_assign() 268. } 269. 270. > int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) 271. { 272. if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) crypto/evp/p_lib.c:272:9: Taking false branch 270. int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) 271. { 272. if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) ^ 273. return 0; 274. pkey->pkey.ptr = key; crypto/evp/p_lib.c:272:26: 270. int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) 271. { 272. > if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) 273. return 0; 274. pkey->pkey.ptr = key; crypto/evp/p_lib.c:260:1: start of procedure EVP_PKEY_set_type() 258. } 259. 260. > int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) 261. { 262. return pkey_set_type(pkey, type, NULL, -1); crypto/evp/p_lib.c:262:5: Skipping pkey_set_type(): empty list of specs 260. int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) 261. { 262. return pkey_set_type(pkey, type, NULL, -1); ^ 263. } 264. crypto/evp/p_lib.c:263:1: return from a call to EVP_PKEY_set_type 261. { 262. return pkey_set_type(pkey, type, NULL, -1); 263. > } 264. 265. int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len) crypto/evp/p_lib.c:272:26: Taking true branch 270. int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) 271. { 272. if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) ^ 273. return 0; 274. pkey->pkey.ptr = key; crypto/evp/p_lib.c:273:9: 271. { 272. if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) 273. > return 0; 274. pkey->pkey.ptr = key; 275. return (key != NULL); crypto/evp/p_lib.c:276:1: return from a call to EVP_PKEY_assign 274. pkey->pkey.ptr = key; 275. return (key != NULL); 276. > } 277. 278. void *EVP_PKEY_get0(EVP_PKEY *pkey)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/engines/ccgost/gost_pmeth.c/#L440
d2a_code_trace_data_43823
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:1057: error: Uninitialized Value The value read from ymax was never initialized. libavcodec/motion_est_template.c:1057:9: 1055. } 1056. CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift) 1057. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1) ^ 1058. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1) 1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1057
d2a_code_trace_data_43824
static void contract(LHASH *lh) { LHASH_NODE **n,*n1,*np; np=lh->b[lh->p+lh->pmax-1]; lh->b[lh->p+lh->pmax-1]=NULL; if (lh->p == 0) { n=(LHASH_NODE **)OPENSSL_realloc(lh->b, (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax)); if (n == NULL) { lh->error++; return; } lh->num_contract_reallocs++; lh->num_alloc_nodes/=2; lh->pmax/=2; lh->p=lh->pmax-1; lh->b=n; } else lh->p--; lh->num_nodes--; lh->num_contracts++; n1=lh->b[(int)lh->p]; if (n1 == NULL) lh->b[(int)lh->p]=np; else { while (n1->next != NULL) n1=n1->next; n1->next=np; } } apps/s_client.c:792: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `SSL_free`. Showing all 16 steps of the trace apps/s_client.c:422:6: Call 420. 421. 422. con=SSL_new(ctx); ^ 423. #ifndef NO_KRB5 424. if (con && (con->kssl_ctx = kssl_ctx_new()) != NULL) ssl/ssl_lib.c:175:1: Parameter `ctx->sessions->p` 173. } 174. 175. > SSL *SSL_new(SSL_CTX *ctx) 176. { 177. SSL *s; apps/s_client.c:792:19: Call 790. end: 791. if(prexit) print_stuff(bio_c_out,con,1); 792. if (con != NULL) SSL_free(con); ^ 793. if (con2 != NULL) SSL_free(con2); 794. if (ctx != NULL) SSL_CTX_free(ctx); ssl/ssl_lib.c:325:1: Parameter `s->ctx->sessions->p` 323. } 324. 325. > void SSL_free(SSL *s) 326. { 327. int i; ssl/ssl_lib.c:371:3: Call 369. if (s->session != NULL) 370. { 371. ssl_clear_bad_session(s); ^ 372. SSL_SESSION_free(s->session); 373. } ssl/ssl_sess.c:614:1: Parameter `s->ctx->sessions->p` 612. } 613. 614. > int ssl_clear_bad_session(SSL *s) 615. { 616. if ( (s->session != NULL) && ssl/ssl_sess.c:620:3: Call 618. !(SSL_in_init(s) || SSL_in_before(s))) 619. { 620. SSL_CTX_remove_session(s->ctx,s->session); ^ 621. return(1); 622. } ssl/ssl_sess.c:413:1: Parameter `ctx->sessions->p` 411. } 412. 413. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 414. { 415. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:415:9: Call 413. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 414. { 415. return remove_session_lock(ctx, c, 1); ^ 416. } 417. ssl/ssl_sess.c:418:1: Parameter `ctx->sessions->p` 416. } 417. 418. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 419. { 420. SSL_SESSION *r; ssl/ssl_sess.c:426:20: Call 424. { 425. if(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); 426. r=(SSL_SESSION *)lh_delete(ctx->sessions,c); ^ 427. if (r != NULL) 428. { crypto/lhash/lhash.c:217:1: Parameter `lh->pmax` 215. } 216. 217. > void *lh_delete(LHASH *lh, void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:243:3: Call 241. if ((lh->num_nodes > MIN_NODES) && 242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes))) 243. contract(lh); ^ 244. 245. return(ret); crypto/lhash/lhash.c:352:1: <LHS trace> 350. } 351. 352. > static void contract(LHASH *lh) 353. { 354. LHASH_NODE **n,*n1,*np; crypto/lhash/lhash.c:352:1: Parameter `lh->p` 350. } 351. 352. > static void contract(LHASH *lh) 353. { 354. LHASH_NODE **n,*n1,*np; crypto/lhash/lhash.c:356:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `SSL_free` 354. LHASH_NODE **n,*n1,*np; 355. 356. np=lh->b[lh->p+lh->pmax-1]; ^ 357. lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */ 358. if (lh->p == 0)
https://github.com/openssl/openssl/blob/f9b3bff6f7e38960bb87a5623fbcbc45ee952c49/crypto/lhash/lhash.c/#L356
d2a_code_trace_data_43825
static int zmbv_decode_intra(ZmbvContext *c) { uint8_t *src = c->decomp_buf; if (c->fmt == ZMBV_FMT_8BPP) { memcpy(c->pal, src, 768); src += 768; } memcpy(c->cur, src, c->width * c->height * (c->bpp / 8)); return 0; } libavcodec/zmbv.c:386: error: Buffer Overrun L3 Offset added: 768 Size: [0, +oo]. libavcodec/zmbv.c:380:1: <Length trace> 378. * Decode intraframe 379. */ 380. static int zmbv_decode_intra(ZmbvContext *c) ^ 381. { 382. uint8_t *src = c->decomp_buf; libavcodec/zmbv.c:380:1: Parameter `c->pal[*]` 378. * Decode intraframe 379. */ 380. static int zmbv_decode_intra(ZmbvContext *c) ^ 381. { 382. uint8_t *src = c->decomp_buf; libavcodec/zmbv.c:386:9: Array access: Offset added: 768 Size: [0, +oo] 384. /* make the palette available on the way out */ 385. if (c->fmt == ZMBV_FMT_8BPP) { 386. memcpy(c->pal, src, 768); ^ 387. src += 768; 388. }
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/zmbv.c/#L386
d2a_code_trace_data_43826
static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) { tls_curve_info *cinfo; if (curve[0]) return 1; if ((curve[1] < 1) || ((size_t)curve[1] > sizeof(nid_list)/sizeof(nid_list[0]))) return 0; cinfo = &nid_list[curve[1]-1]; return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve); } ssl/s3_clnt.c:382: error: BUFFER_OVERRUN_L3 Offset: [-1, +oo] Size: 28 by call to `ssl3_get_key_exchange`. Showing all 11 steps of the trace ssl/s3_clnt.c:186:1: Parameter `*s->init_msg` 184. ssl3_get_client_method) 185. 186. > int ssl3_connect(SSL *s) 187. { 188. BUF_MEM *buf=NULL; ssl/s3_clnt.c:382:8: Call 380. case SSL3_ST_CR_KEY_EXCH_A: 381. case SSL3_ST_CR_KEY_EXCH_B: 382. ret=ssl3_get_key_exchange(s); ^ 383. if (ret <= 0) goto end; 384. s->state=SSL3_ST_CR_CERT_REQ_A; ssl/s3_clnt.c:1402:1: Parameter `*s->init_msg` 1400. } 1401. 1402. > int ssl3_get_key_exchange(SSL *s) 1403. { 1404. #ifndef OPENSSL_NO_RSA ssl/s3_clnt.c:1781:8: Call 1779. * sent an invalid curve. 1780. */ 1781. if (!tls1_check_curve(s, p, param_len)) ^ 1782. { 1783. al=SSL_AD_DECODE_ERROR; ssl/t1_lib.c:275:1: Array declaration 273. }; 274. 275. > static const unsigned char eccurves_default[] = 276. { 277. 0,14, /* sect571r1 (14) */ ssl/t1_lib.c:472:11: Call 470. { 471. if (p[1] == curves[0] && p[2] == curves[1]) 472. return tls_curve_allowed(s, p + 1, SSL_SECOP_CURVE_CHECK); ^ 473. } 474. return 0; ssl/t1_lib.c:429:1: <Offset trace> 427. 428. /* See if curve is allowed by security callback */ 429. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 430. { 431. tls_curve_info *cinfo; ssl/t1_lib.c:429:1: Parameter `*curve` 427. 428. /* See if curve is allowed by security callback */ 429. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op) 430. { 431. tls_curve_info *cinfo; ssl/t1_lib.c:235:1: <Length trace> 233. #define TLS_CURVE_PRIME 0x0 234. 235. > static tls_curve_info nid_list[] = 236. { 237. {NID_sect163k1, 80, TLS_CURVE_CHAR2},/* sect163k1 (1) */ ssl/t1_lib.c:235:1: Array declaration 233. #define TLS_CURVE_PRIME 0x0 234. 235. > static tls_curve_info nid_list[] = 236. { 237. {NID_sect163k1, 80, TLS_CURVE_CHAR2},/* sect163k1 (1) */ ssl/t1_lib.c:437:2: Array access: Offset: [-1, +oo] Size: 28 by call to `ssl3_get_key_exchange` 435. sizeof(nid_list)/sizeof(nid_list[0]))) 436. return 0; 437. cinfo = &nid_list[curve[1]-1]; ^ 438. return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve); 439. }
https://github.com/openssl/openssl/blob/dbb7654dc189992966ecd95ca66f7a3bb011ab9b/ssl/t1_lib.c/#L437
d2a_code_trace_data_43827
static int rev_body(char *hostname, int s, int stype, unsigned char *context) { char *buf = NULL; int i; int ret = 1; SSL *con; BIO *io, *ssl_bio, *sbio; buf = app_malloc(bufsize, "server rev buffer"); io = BIO_new(BIO_f_buffer()); ssl_bio = BIO_new(BIO_f_ssl()); if ((io == NULL) || (ssl_bio == NULL)) goto err; if (!BIO_set_write_buffer_size(io, bufsize)) goto err; if ((con = SSL_new(ctx)) == NULL) goto err; if (s_tlsextdebug) { SSL_set_tlsext_debug_callback(con, tlsext_cb); SSL_set_tlsext_debug_arg(con, bio_s_out); } if (context && !SSL_set_session_id_context(con, context, strlen((char *)context))) { ERR_print_errors(bio_err); goto err; } sbio = BIO_new_socket(s, BIO_NOCLOSE); SSL_set_bio(con, sbio, sbio); SSL_set_accept_state(con); BIO_set_ssl(ssl_bio, con, BIO_CLOSE); BIO_push(io, ssl_bio); #ifdef CHARSET_EBCDIC io = BIO_push(BIO_new(BIO_f_ebcdic_filter()), io); #endif if (s_debug) { SSL_set_debug(con, 1); BIO_set_callback(SSL_get_rbio(con), bio_dump_callback); BIO_set_callback_arg(SSL_get_rbio(con), (char *)bio_s_out); } if (s_msg) { #ifndef OPENSSL_NO_SSL_TRACE if (s_msg == 2) SSL_set_msg_callback(con, SSL_trace); else #endif SSL_set_msg_callback(con, msg_cb); SSL_set_msg_callback_arg(con, bio_s_msg ? bio_s_msg : bio_s_out); } for (;;) { i = BIO_do_handshake(io); if (i > 0) break; if (!BIO_should_retry(io)) { BIO_puts(bio_err, "CONNECTION FAILURE\n"); ERR_print_errors(bio_err); goto end; } #ifndef OPENSSL_NO_SRP if (BIO_should_io_special(io) && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP renego during accept\n"); srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); else BIO_printf(bio_s_out, "LOOKUP not successful\n"); continue; } #endif } BIO_printf(bio_err, "CONNECTION ESTABLISHED\n"); print_ssl_summary(con); for (;;) { i = BIO_gets(io, buf, bufsize - 1); if (i < 0) { if (!BIO_should_retry(io)) { if (!s_quiet) ERR_print_errors(bio_err); goto err; } else { BIO_printf(bio_s_out, "read R BLOCK\n"); #ifndef OPENSSL_NO_SRP if (BIO_should_io_special(io) && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP renego during read\n"); srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); else BIO_printf(bio_s_out, "LOOKUP not successful\n"); continue; } #endif #if defined(OPENSSL_SYS_NETWARE) delay(1000); #elif !defined(OPENSSL_SYS_MSDOS) sleep(1); #endif continue; } } else if (i == 0) { ret = 1; BIO_printf(bio_err, "CONNECTION CLOSED\n"); goto end; } else { char *p = buf + i - 1; while (i && (*p == '\n' || *p == '\r')) { p--; i--; } if (!s_ign_eof && (i == 5) && (strncmp(buf, "CLOSE", 5) == 0)) { ret = 1; BIO_printf(bio_err, "CONNECTION CLOSED\n"); goto end; } BUF_reverse((unsigned char *)buf, NULL, i); buf[i] = '\n'; BIO_write(io, buf, i + 1); for (;;) { i = BIO_flush(io); if (i > 0) break; if (!BIO_should_retry(io)) goto end; } } } end: SSL_set_shutdown(con, SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN); err: OPENSSL_free(buf); BIO_free_all(io); return (ret); } apps/s_server.c:2985: error: MEMORY_LEAK memory dynamically allocated to `ssl_bio` by call to `BIO_new()` at line 2984, column 15 is not reachable after line 2985, column 10. Showing all 62 steps of the trace apps/s_server.c:2974:1: start of procedure rev_body() 2972. } 2973. 2974. > static int rev_body(char *hostname, int s, int stype, unsigned char *context) 2975. { 2976. char *buf = NULL; apps/s_server.c:2976:5: 2974. static int rev_body(char *hostname, int s, int stype, unsigned char *context) 2975. { 2976. > char *buf = NULL; 2977. int i; 2978. int ret = 1; apps/s_server.c:2978:5: 2976. char *buf = NULL; 2977. int i; 2978. > int ret = 1; 2979. SSL *con; 2980. BIO *io, *ssl_bio, *sbio; apps/s_server.c:2982:5: 2980. BIO *io, *ssl_bio, *sbio; 2981. 2982. > buf = app_malloc(bufsize, "server rev buffer"); 2983. io = BIO_new(BIO_f_buffer()); 2984. ssl_bio = BIO_new(BIO_f_ssl()); apps/apps.c:976:1: start of procedure app_malloc() 974. } 975. 976. > void* app_malloc(int sz, const char *what) 977. { 978. void *vp = OPENSSL_malloc(sz); apps/apps.c:978:5: 976. void* app_malloc(int sz, const char *what) 977. { 978. > void *vp = OPENSSL_malloc(sz); 979. 980. if (vp == NULL) { crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) apps/apps.c:980:9: Taking false branch 978. void *vp = OPENSSL_malloc(sz); 979. 980. if (vp == NULL) { ^ 981. BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n", 982. opt_getprog(), sz, what); apps/apps.c:986:5: 984. exit(1); 985. } 986. > return vp; 987. } 988. apps/apps.c:987:1: return from a call to app_malloc 985. } 986. return vp; 987. > } 988. 989. apps/s_server.c:2983:5: 2981. 2982. buf = app_malloc(bufsize, "server rev buffer"); 2983. > io = BIO_new(BIO_f_buffer()); 2984. ssl_bio = BIO_new(BIO_f_ssl()); 2985. if ((io == NULL) || (ssl_bio == NULL)) crypto/bio/bf_buff.c:87:1: start of procedure BIO_f_buffer() 85. }; 86. 87. > BIO_METHOD *BIO_f_buffer(void) 88. { 89. return (&methods_buffer); crypto/bio/bf_buff.c:89:5: 87. BIO_METHOD *BIO_f_buffer(void) 88. { 89. > return (&methods_buffer); 90. } 91. crypto/bio/bf_buff.c:90:1: return from a call to BIO_f_buffer 88. { 89. return (&methods_buffer); 90. > } 91. 92. static int buffer_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); crypto/bio/bio_lib.c:68:5: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/bio/bio_lib.c:70:9: Taking false branch 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { ^ 71. BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); 72. return (NULL); crypto/bio/bio_lib.c:74:10: Taking true branch 72. return (NULL); 73. } 74. if (!BIO_set(ret, method)) { ^ 75. OPENSSL_free(ret); 76. ret = NULL; crypto/bio/bio_lib.c:75:9: 73. } 74. if (!BIO_set(ret, method)) { 75. > OPENSSL_free(ret); 76. ret = NULL; 77. } crypto/mem.c:234:1: start of procedure CRYPTO_free() 232. } 233. 234. > void CRYPTO_free(void *str) 235. { 236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG crypto/mem.c:245:5: 243. } 244. #else 245. > free(str); 246. #endif 247. } crypto/mem.c:247:1: return from a call to CRYPTO_free 245. free(str); 246. #endif 247. > } 248. 249. void CRYPTO_clear_free(void *str, size_t num) crypto/bio/bio_lib.c:76:9: 74. if (!BIO_set(ret, method)) { 75. OPENSSL_free(ret); 76. > ret = NULL; 77. } 78. return (ret); crypto/bio/bio_lib.c:78:5: 76. ret = NULL; 77. } 78. > return (ret); 79. } 80. crypto/bio/bio_lib.c:79:1: return from a call to BIO_new 77. } 78. return (ret); 79. > } 80. 81. int BIO_set(BIO *bio, BIO_METHOD *method) apps/s_server.c:2984:5: 2982. buf = app_malloc(bufsize, "server rev buffer"); 2983. io = BIO_new(BIO_f_buffer()); 2984. > ssl_bio = BIO_new(BIO_f_ssl()); 2985. if ((io == NULL) || (ssl_bio == NULL)) 2986. goto err; ssl/bio_ssl.c:97:1: start of procedure BIO_f_ssl() 95. }; 96. 97. > BIO_METHOD *BIO_f_ssl(void) 98. { 99. return (&methods_sslp); ssl/bio_ssl.c:99:5: 97. BIO_METHOD *BIO_f_ssl(void) 98. { 99. > return (&methods_sslp); 100. } 101. ssl/bio_ssl.c:100:1: return from a call to BIO_f_ssl 98. { 99. return (&methods_sslp); 100. > } 101. 102. static int ssl_new(BIO *bi) crypto/bio/bio_lib.c:66:1: start of procedure BIO_new() 64. #include <openssl/stack.h> 65. 66. > BIO *BIO_new(BIO_METHOD *method) 67. { 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); crypto/bio/bio_lib.c:68:5: 66. BIO *BIO_new(BIO_METHOD *method) 67. { 68. > BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { crypto/mem.c:120:1: start of procedure CRYPTO_malloc() 118. } 119. 120. > void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. void *ret = NULL; crypto/mem.c:122:5: 120. void *CRYPTO_malloc(size_t num, const char *file, int line) 121. { 122. > void *ret = NULL; 123. 124. if (num <= 0) crypto/mem.c:124:9: Taking false branch 122. void *ret = NULL; 123. 124. if (num <= 0) ^ 125. return NULL; 126. crypto/mem.c:127:5: 125. return NULL; 126. 127. > allow_customize = 0; 128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG 129. if (call_malloc_debug) { crypto/mem.c:137:5: 135. } 136. #else 137. > (void)file; 138. (void)line; 139. ret = malloc(num); crypto/mem.c:138:5: 136. #else 137. (void)file; 138. > (void)line; 139. ret = malloc(num); 140. #endif crypto/mem.c:139:5: 137. (void)file; 138. (void)line; 139. > ret = malloc(num); 140. #endif 141. crypto/mem.c:154:5: 152. #endif 153. 154. > return ret; 155. } 156. crypto/mem.c:155:1: return from a call to CRYPTO_malloc 153. 154. return ret; 155. > } 156. 157. void *CRYPTO_zalloc(size_t num, const char *file, int line) crypto/bio/bio_lib.c:70:9: Taking false branch 68. BIO *ret = OPENSSL_malloc(sizeof(*ret)); 69. 70. if (ret == NULL) { ^ 71. BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE); 72. return (NULL); crypto/bio/bio_lib.c:74:10: Taking false branch 72. return (NULL); 73. } 74. if (!BIO_set(ret, method)) { ^ 75. OPENSSL_free(ret); 76. ret = NULL; crypto/bio/bio_lib.c:78:5: 76. ret = NULL; 77. } 78. > return (ret); 79. } 80. crypto/bio/bio_lib.c:79:1: return from a call to BIO_new 77. } 78. return (ret); 79. > } 80. 81. int BIO_set(BIO *bio, BIO_METHOD *method) apps/s_server.c:2985:10: Taking true branch 2983. io = BIO_new(BIO_f_buffer()); 2984. ssl_bio = BIO_new(BIO_f_ssl()); 2985. if ((io == NULL) || (ssl_bio == NULL)) ^ 2986. goto err; 2987.
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/apps/s_server.c/#L2985
d2a_code_trace_data_43828
int pem_check_suffix(const char *pem_str, const char *suffix) { int pem_len = strlen(pem_str); int suffix_len = strlen(suffix); const char *p; if (suffix_len + 1 >= pem_len) return 0; p = pem_str + pem_len - suffix_len; if (strcmp(p, suffix)) return 0; p--; if (*p != ' ') return 0; return p - pem_str; } crypto/pem/pem_pkey.c:78: error: BUFFER_OVERRUN_L3 Offset: [-12, +oo] Size: [1, 241] by call to `pem_check_suffix`. Showing all 10 steps of the trace crypto/pem/pem_pkey.c:35:10: Call 33. EVP_PKEY *ret = NULL; 34. 35. if (!PEM_bytes_read_bio_secmem(&data, &len, &nm, PEM_STRING_EVP_PKEY, bp, ^ 36. cb, u)) 37. return NULL; crypto/pem/pem_lib.c:298:12: Call 296. const char *name, BIO *bp, pem_password_cb *cb, 297. void *u) { 298. return pem_bytes_read_bio_flags(pdata, plen, pnm, name, bp, cb, u, ^ 299. PEM_FLAG_SECURE | PEM_FLAG_EAY_COMPATIBLE); 300. } crypto/pem/pem_lib.c:260:14: Call 258. pem_free(header, flags); 259. pem_free(data, flags); 260. if (!PEM_read_bio_ex(bp, &nm, &header, &data, &len, flags)) { ^ 261. if (ERR_GET_REASON(ERR_peek_error()) == PEM_R_NO_START_LINE) 262. ERR_add_error_data(2, "Expecting: ", name); crypto/pem/pem_lib.c:958:5: Assignment 956. } 957. BIO_read(headerB, *header, headerlen); 958. (*header)[headerlen] = '\0'; ^ 959. BIO_read(dataB, *data, len); 960. *len_out = len; crypto/pem/pem_pkey.c:78:24: Call 76. } 77. PKCS8_PRIV_KEY_INFO_free(p8inf); 78. } else if ((slen = pem_check_suffix(nm, "PRIVATE KEY")) > 0) { ^ 79. const EVP_PKEY_ASN1_METHOD *ameth; 80. ameth = EVP_PKEY_asn1_find_str(NULL, nm, slen); crypto/pem/pem_lib.c:985:1: <Length trace> 983. */ 984. 985. > int pem_check_suffix(const char *pem_str, const char *suffix) 986. { 987. int pem_len = strlen(pem_str); crypto/pem/pem_lib.c:985:1: Parameter `*pem_str` 983. */ 984. 985. > int pem_check_suffix(const char *pem_str, const char *suffix) 986. { 987. int pem_len = strlen(pem_str); crypto/pem/pem_lib.c:992:5: Assignment 990. if (suffix_len + 1 >= pem_len) 991. return 0; 992. p = pem_str + pem_len - suffix_len; ^ 993. if (strcmp(p, suffix)) 994. return 0; crypto/pem/pem_lib.c:995:5: Assignment 993. if (strcmp(p, suffix)) 994. return 0; 995. p--; ^ 996. if (*p != ' ') 997. return 0; crypto/pem/pem_lib.c:996:9: Array access: Offset: [-12, +oo] Size: [1, 241] by call to `pem_check_suffix` 994. return 0; 995. p--; 996. if (*p != ' ') ^ 997. return 0; 998. return p - pem_str;
https://github.com/openssl/openssl/blob/fa3ed5b2c2b508a6444124fdf12ecbb4898007ed/crypto/pem/pem_lib.c/#L996
d2a_code_trace_data_43829
static unsigned int BN_STACK_pop(BN_STACK *st) { return st->indexes[--(st->depth)]; } crypto/ec/ecp_smpl.c:608: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned32 by call to `BN_mod_sqr`. Showing all 18 steps of the trace crypto/ec/ecp_smpl.c:595:8: Call 593. else 594. { 595. if (!BN_mod_inverse(Z_1, Z_, &group->field, ctx)) ^ 596. { 597. ECerr(EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES, ERR_R_BN_LIB); crypto/bn/bn_gcd.c:209:1: Parameter `ctx->stack.depth` 207. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); 208. 209. > BIGNUM *BN_mod_inverse(BIGNUM *in, 210. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) 211. { crypto/bn/bn_gcd.c:224:2: Call 222. bn_check_top(n); 223. 224. BN_CTX_start(ctx); ^ 225. A = BN_CTX_get(ctx); 226. B = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_gcd.c:498:2: Call 496. err: 497. if ((ret == NULL) && (in == NULL)) BN_free(R); 498. BN_CTX_end(ctx); ^ 499. bn_check_top(ret); 500. return(ret); crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/ec/ecp_smpl.c:608:9: Call 606. else 607. { 608. if (!BN_mod_sqr(Z_2, Z_1, &group->field, ctx)) goto err; ^ 609. } 610. crypto/bn/bn_mod.c:203:1: Parameter `ctx->stack.depth` 201. 202. 203. > int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) 204. { 205. if (!BN_sqr(r, a, ctx)) return 0; crypto/bn/bn_mod.c:205:7: Call 203. int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx) 204. { 205. if (!BN_sqr(r, a, ctx)) return 0; ^ 206. /* r->neg == 0, thus we don't need BN_nnmod */ 207. return BN_mod(r, r, m, ctx); crypto/bn/bn_sqr.c:65:1: Parameter `ctx->stack.depth` 63. /* r must not be a */ 64. /* I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 */ 65. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 66. { 67. int max,al; crypto/bn/bn_sqr.c:83:2: Call 81. } 82. 83. BN_CTX_start(ctx); ^ 84. rr=(a != r) ? r : BN_CTX_get(ctx); 85. tmp=BN_CTX_get(ctx); crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth` 253. } 254. 255. > void BN_CTX_start(BN_CTX *ctx) 256. { 257. CTXDBG_ENTRY("BN_CTX_start", ctx); crypto/bn/bn_sqr.c:153:2: Call 151. bn_check_top(rr); 152. bn_check_top(tmp); 153. BN_CTX_end(ctx); ^ 154. return(ret); 155. } crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth` 268. } 269. 270. > void BN_CTX_end(BN_CTX *ctx) 271. { 272. CTXDBG_ENTRY("BN_CTX_end", ctx); crypto/bn/bn_ctx.c:277:21: Call 275. else 276. { 277. unsigned int fp = BN_STACK_pop(&ctx->stack); ^ 278. /* Does this stack frame have anything to release? */ 279. if(fp < ctx->used) crypto/bn/bn_ctx.c:351:1: <LHS trace> 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:351:1: Parameter `st->depth` 349. } 350. 351. > static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_sqr` 351. static unsigned int BN_STACK_pop(BN_STACK *st) 352. { 353. return st->indexes[--(st->depth)]; ^ 354. } 355.
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/bn/bn_ctx.c/#L353
d2a_code_trace_data_43830
static int internal_verify(X509_STORE_CTX *ctx) { int ok = 0, n; X509 *xs, *xi; EVP_PKEY *pkey = NULL; int (*cb) (int xok, X509_STORE_CTX *xctx); cb = ctx->verify_cb; n = sk_X509_num(ctx->chain) - 1; ctx->error_depth = n; xi = sk_X509_value(ctx->chain, n); if (ctx->check_issued(ctx, xi, xi)) xs = xi; else { if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) { xs = xi; goto check_cert; } if (n <= 0) { ctx->error = X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE; ctx->current_cert = xi; ok = cb(0, ctx); goto end; } else { n--; ctx->error_depth = n; xs = sk_X509_value(ctx->chain, n); } } while (n >= 0) { ctx->error_depth = n; if (!xs->valid && (xs != xi || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE))) { if ((pkey = X509_get0_pubkey(xi)) == NULL) { ctx->error = X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY; ctx->current_cert = xi; ok = (*cb) (0, ctx); if (!ok) goto end; } else if (X509_verify(xs, pkey) <= 0) { ctx->error = X509_V_ERR_CERT_SIGNATURE_FAILURE; ctx->current_cert = xs; ok = (*cb) (0, ctx); if (!ok) goto end; } } xs->valid = 1; check_cert: ok = x509_check_cert_time(ctx, xs, 0); if (!ok) goto end; ctx->current_issuer = xi; ctx->current_cert = xs; ok = (*cb) (1, ctx); if (!ok) goto end; n--; if (n >= 0) { xi = xs; xs = sk_X509_value(ctx->chain, n); } } ok = 1; end: return ok; } crypto/x509/x509_vfy.c:1557: error: NULL_DEREFERENCE pointer `xs` last assigned on line 1541 could be null and is dereferenced at line 1557, column 14. Showing all 35 steps of the trace crypto/x509/x509_vfy.c:1513:1: start of procedure internal_verify() 1511. } 1512. 1513. > static int internal_verify(X509_STORE_CTX *ctx) 1514. { 1515. int ok = 0, n; crypto/x509/x509_vfy.c:1515:5: 1513. static int internal_verify(X509_STORE_CTX *ctx) 1514. { 1515. > int ok = 0, n; 1516. X509 *xs, *xi; 1517. EVP_PKEY *pkey = NULL; crypto/x509/x509_vfy.c:1517:5: 1515. int ok = 0, n; 1516. X509 *xs, *xi; 1517. > EVP_PKEY *pkey = NULL; 1518. int (*cb) (int xok, X509_STORE_CTX *xctx); 1519. crypto/x509/x509_vfy.c:1520:5: 1518. int (*cb) (int xok, X509_STORE_CTX *xctx); 1519. 1520. > cb = ctx->verify_cb; 1521. 1522. n = sk_X509_num(ctx->chain) - 1; crypto/x509/x509_vfy.c:1522:9: Condition is true 1520. cb = ctx->verify_cb; 1521. 1522. n = sk_X509_num(ctx->chain) - 1; ^ 1523. ctx->error_depth = n; 1524. xi = sk_X509_value(ctx->chain, n); crypto/x509/x509_vfy.c:1522:5: 1520. cb = ctx->verify_cb; 1521. 1522. > n = sk_X509_num(ctx->chain) - 1; 1523. ctx->error_depth = n; 1524. xi = sk_X509_value(ctx->chain, n); crypto/stack/stack.c:317:1: start of procedure sk_num() 315. } 316. 317. > int sk_num(const _STACK *st) 318. { 319. if (st == NULL) crypto/stack/stack.c:319:9: Taking false branch 317. int sk_num(const _STACK *st) 318. { 319. if (st == NULL) ^ 320. return -1; 321. return st->num; crypto/stack/stack.c:321:5: 319. if (st == NULL) 320. return -1; 321. > return st->num; 322. } 323. crypto/stack/stack.c:322:1: return from a call to sk_num 320. return -1; 321. return st->num; 322. > } 323. 324. void *sk_value(const _STACK *st, int i) crypto/x509/x509_vfy.c:1523:5: 1521. 1522. n = sk_X509_num(ctx->chain) - 1; 1523. > ctx->error_depth = n; 1524. xi = sk_X509_value(ctx->chain, n); 1525. crypto/x509/x509_vfy.c:1524:10: Condition is true 1522. n = sk_X509_num(ctx->chain) - 1; 1523. ctx->error_depth = n; 1524. xi = sk_X509_value(ctx->chain, n); ^ 1525. 1526. if (ctx->check_issued(ctx, xi, xi)) crypto/x509/x509_vfy.c:1524:5: 1522. n = sk_X509_num(ctx->chain) - 1; 1523. ctx->error_depth = n; 1524. > xi = sk_X509_value(ctx->chain, n); 1525. 1526. if (ctx->check_issued(ctx, xi, xi)) crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:17: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:28: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:328:5: 326. if (!st || (i < 0) || (i >= st->num)) 327. return NULL; 328. > return st->data[i]; 329. } 330. crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:1526:9: Taking false branch 1524. xi = sk_X509_value(ctx->chain, n); 1525. 1526. if (ctx->check_issued(ctx, xi, xi)) ^ 1527. xs = xi; 1528. else { crypto/x509/x509_vfy.c:1529:13: Taking false branch 1527. xs = xi; 1528. else { 1529. if (ctx->param->flags & X509_V_FLAG_PARTIAL_CHAIN) { ^ 1530. xs = xi; 1531. goto check_cert; crypto/x509/x509_vfy.c:1533:13: Taking false branch 1531. goto check_cert; 1532. } 1533. if (n <= 0) { ^ 1534. ctx->error = X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE; 1535. ctx->current_cert = xi; crypto/x509/x509_vfy.c:1539:13: 1537. goto end; 1538. } else { 1539. > n--; 1540. ctx->error_depth = n; 1541. xs = sk_X509_value(ctx->chain, n); crypto/x509/x509_vfy.c:1540:13: 1538. } else { 1539. n--; 1540. > ctx->error_depth = n; 1541. xs = sk_X509_value(ctx->chain, n); 1542. } crypto/x509/x509_vfy.c:1541:18: Condition is true 1539. n--; 1540. ctx->error_depth = n; 1541. xs = sk_X509_value(ctx->chain, n); ^ 1542. } 1543. } crypto/x509/x509_vfy.c:1541:13: 1539. n--; 1540. ctx->error_depth = n; 1541. > xs = sk_X509_value(ctx->chain, n); 1542. } 1543. } crypto/stack/stack.c:324:1: start of procedure sk_value() 322. } 323. 324. > void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) crypto/stack/stack.c:326:10: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:17: Taking false branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:326:28: Taking true branch 324. void *sk_value(const _STACK *st, int i) 325. { 326. if (!st || (i < 0) || (i >= st->num)) ^ 327. return NULL; 328. return st->data[i]; crypto/stack/stack.c:327:9: 325. { 326. if (!st || (i < 0) || (i >= st->num)) 327. > return NULL; 328. return st->data[i]; 329. } crypto/stack/stack.c:329:1: return from a call to sk_value 327. return NULL; 328. return st->data[i]; 329. > } 330. 331. void *sk_set(_STACK *st, int i, void *value) crypto/x509/x509_vfy.c:1549:12: Loop condition is true. Entering loop body 1547. * is allowed to reset errors (at its own peril). 1548. */ 1549. while (n >= 0) { ^ 1550. ctx->error_depth = n; 1551. crypto/x509/x509_vfy.c:1550:9: 1548. */ 1549. while (n >= 0) { 1550. > ctx->error_depth = n; 1551. 1552. /* crypto/x509/x509_vfy.c:1557:14: Taking false branch 1555. * time. 1556. */ 1557. if (!xs->valid ^ 1558. && (xs != xi 1559. || (ctx->param->flags & X509_V_FLAG_CHECK_SS_SIGNATURE))) {
https://github.com/openssl/openssl/blob/e29c73c93b88a4b7f492c7c8c7343223e7548612/crypto/x509/x509_vfy.c/#L1557
d2a_code_trace_data_43831
int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain) { ASN1_OCTET_STRING *os = NULL; EVP_MD_CTX *mctx = EVP_MD_CTX_new(); EVP_PKEY_CTX *pkctx = NULL; int r = -1; unsigned char mval[EVP_MAX_MD_SIZE]; unsigned int mlen; if (mctx == NULL) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, ERR_R_MALLOC_FAILURE); goto err; } if (CMS_signed_get_attr_count(si) >= 0) { os = CMS_signed_get0_data_by_OBJ(si, OBJ_nid2obj(NID_pkcs9_messageDigest), -3, V_ASN1_OCTET_STRING); if (!os) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE); goto err; } } if (!cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) goto err; if (EVP_DigestFinal_ex(mctx, mval, &mlen) <= 0) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_UNABLE_TO_FINALIZE_CONTEXT); goto err; } if (os) { if (mlen != (unsigned int)os->length) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH); goto err; } if (memcmp(mval, os->data, mlen)) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_VERIFICATION_FAILURE); r = 0; } else r = 1; } else { const EVP_MD *md = EVP_MD_CTX_md(mctx); pkctx = EVP_PKEY_CTX_new(si->pkey, NULL); if (pkctx == NULL) goto err; if (EVP_PKEY_verify_init(pkctx) <= 0) goto err; if (EVP_PKEY_CTX_set_signature_md(pkctx, md) <= 0) goto err; si->pctx = pkctx; if (!cms_sd_asn1_ctrl(si, 1)) goto err; r = EVP_PKEY_verify(pkctx, si->signature->data, si->signature->length, mval, mlen); if (r <= 0) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_VERIFICATION_FAILURE); r = 0; } } err: EVP_PKEY_CTX_free(pkctx); EVP_MD_CTX_free(mctx); return r; } crypto/cms/cms_sd.c:847: error: MEMORY_LEAK memory dynamically allocated by call to `EVP_MD_CTX_new()` at line 778, column 24 is not reachable after line 847, column 5. Showing all 104 steps of the trace crypto/cms/cms_sd.c:775:1: start of procedure CMS_SignerInfo_verify_content() 773. } 774. 775. > int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain) 776. { 777. ASN1_OCTET_STRING *os = NULL; crypto/cms/cms_sd.c:777:5: 775. int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain) 776. { 777. > ASN1_OCTET_STRING *os = NULL; 778. EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 779. EVP_PKEY_CTX *pkctx = NULL; crypto/cms/cms_sd.c:778:5: 776. { 777. ASN1_OCTET_STRING *os = NULL; 778. > EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 779. EVP_PKEY_CTX *pkctx = NULL; 780. int r = -1; 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_sd.c:779:5: 777. ASN1_OCTET_STRING *os = NULL; 778. EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 779. > EVP_PKEY_CTX *pkctx = NULL; 780. int r = -1; 781. unsigned char mval[EVP_MAX_MD_SIZE]; crypto/cms/cms_sd.c:780:5: 778. EVP_MD_CTX *mctx = EVP_MD_CTX_new(); 779. EVP_PKEY_CTX *pkctx = NULL; 780. > int r = -1; 781. unsigned char mval[EVP_MAX_MD_SIZE]; 782. unsigned int mlen; crypto/cms/cms_sd.c:784:9: Taking false branch 782. unsigned int mlen; 783. 784. if (mctx == NULL) { ^ 785. CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, ERR_R_MALLOC_FAILURE); 786. goto err; crypto/cms/cms_sd.c:789:9: 787. } 788. /* If we have any signed attributes look for messageDigest value */ 789. > if (CMS_signed_get_attr_count(si) >= 0) { 790. os = CMS_signed_get0_data_by_OBJ(si, 791. OBJ_nid2obj(NID_pkcs9_messageDigest), crypto/cms/cms_att.c:19:1: start of procedure CMS_signed_get_attr_count() 17. /* CMS SignedData Attribute utilities */ 18. 19. > int CMS_signed_get_attr_count(const CMS_SignerInfo *si) 20. { 21. return X509at_get_attr_count(si->signedAttrs); crypto/cms/cms_att.c:21:5: 19. int CMS_signed_get_attr_count(const CMS_SignerInfo *si) 20. { 21. > return X509at_get_attr_count(si->signedAttrs); 22. } 23. crypto/x509/x509_att.c:20:1: start of procedure X509at_get_attr_count() 18. #include "x509_lcl.h" 19. 20. > int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) 21. { 22. return sk_X509_ATTRIBUTE_num(x); crypto/x509/x509_att.c:22:5: 20. int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x) 21. { 22. > return sk_X509_ATTRIBUTE_num(x); 23. } 24. include/openssl/x509.h:90:1: start of procedure sk_X509_ATTRIBUTE_num() 88. typedef struct x509_attributes_st X509_ATTRIBUTE; 89. 90. > DEFINE_STACK_OF(X509_ATTRIBUTE) 91. 92. typedef struct X509_req_info_st X509_REQ_INFO; crypto/stack/stack.c:277:1: start of procedure OPENSSL_sk_num() 275. } 276. 277. > int OPENSSL_sk_num(const OPENSSL_STACK *st) 278. { 279. if (st == NULL) crypto/stack/stack.c:279:9: Taking true branch 277. int OPENSSL_sk_num(const OPENSSL_STACK *st) 278. { 279. if (st == NULL) ^ 280. return -1; 281. return st->num; crypto/stack/stack.c:280:9: 278. { 279. if (st == NULL) 280. > return -1; 281. return st->num; 282. } crypto/stack/stack.c:282:1: return from a call to OPENSSL_sk_num 280. return -1; 281. return st->num; 282. > } 283. 284. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i) include/openssl/x509.h:90:1: return from a call to sk_X509_ATTRIBUTE_num 88. typedef struct x509_attributes_st X509_ATTRIBUTE; 89. 90. > DEFINE_STACK_OF(X509_ATTRIBUTE) 91. 92. typedef struct X509_req_info_st X509_REQ_INFO; crypto/x509/x509_att.c:23:1: return from a call to X509at_get_attr_count 21. { 22. return sk_X509_ATTRIBUTE_num(x); 23. > } 24. 25. int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, crypto/cms/cms_att.c:22:1: return from a call to CMS_signed_get_attr_count 20. { 21. return X509at_get_attr_count(si->signedAttrs); 22. > } 23. 24. int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, int lastpos) crypto/cms/cms_sd.c:789:9: Taking false branch 787. } 788. /* If we have any signed attributes look for messageDigest value */ 789. if (CMS_signed_get_attr_count(si) >= 0) { ^ 790. os = CMS_signed_get0_data_by_OBJ(si, 791. OBJ_nid2obj(NID_pkcs9_messageDigest), crypto/cms/cms_sd.c:800:10: 798. } 799. 800. > if (!cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) 801. goto err; 802. 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_sd.c:800:10: Taking true branch 798. } 799. 800. if (!cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) ^ 801. goto err; 802. crypto/cms/cms_sd.c:845:2: 843. } 844. 845. > err: 846. EVP_PKEY_CTX_free(pkctx); 847. EVP_MD_CTX_free(mctx); crypto/cms/cms_sd.c:846:5: 844. 845. err: 846. > EVP_PKEY_CTX_free(pkctx); 847. EVP_MD_CTX_free(mctx); 848. return r; crypto/evp/pmeth_lib.c:318:1: start of procedure EVP_PKEY_CTX_free() 316. } 317. 318. > void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) 319. { 320. if (ctx == NULL) crypto/evp/pmeth_lib.c:320:9: Taking true branch 318. void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) 319. { 320. if (ctx == NULL) ^ 321. return; 322. if (ctx->pmeth && ctx->pmeth->cleanup) crypto/evp/pmeth_lib.c:321:9: 319. { 320. if (ctx == NULL) 321. > return; 322. if (ctx->pmeth && ctx->pmeth->cleanup) 323. ctx->pmeth->cleanup(ctx); crypto/evp/pmeth_lib.c:330:1: return from a call to EVP_PKEY_CTX_free 328. #endif 329. OPENSSL_free(ctx); 330. > } 331. 332. int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, crypto/cms/cms_sd.c:847:5: 845. err: 846. EVP_PKEY_CTX_free(pkctx); 847. > EVP_MD_CTX_free(mctx); 848. return r; 849. 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_sd.c/#L847
d2a_code_trace_data_43832
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/dsa/dsa_gen.c:157: error: BUFFER_OVERRUN_L3 Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex`. Showing all 49 steps of the trace crypto/dsa/dsa_gen.c:115:10: Call 113. goto err; 114. 115. if (!BN_lshift(test, BN_value_one(), bits - 1)) ^ 116. goto err; 117. crypto/bn/bn_shift.c:83:1: Parameter `r->top` 81. } 82. 83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n) 84. { 85. int i, nw, lb, rb; crypto/dsa/dsa_gen.c:157:17: Call 155. 156. /* step 4 */ 157. r = BN_is_prime_fasttest_ex(q, DSS_prime_checks, ctx, ^ 158. use_random_seed, cb); 159. if (r > 0) crypto/bn/bn_prime.c:151:1: Parameter `a->top` 149. } 150. 151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed, 152. int do_trial_division, BN_GENCB *cb) 153. { crypto/bn/bn_prime.c:161:9: Call 159. 160. /* Take care of the really small primes 2 & 3 */ 161. if (BN_is_word(a, 2) || BN_is_word(a, 3)) ^ 162. return 1; 163. crypto/bn/bn_lib.c:855:1: Parameter `a->top` 853. } 854. 855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); crypto/bn/bn_lib.c:857:12: Call 855. int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); ^ 858. } 859. crypto/bn/bn_lib.c:840:1: Parameter `a->top` 838. } 839. 840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 841. { 842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_prime.c:161:29: Call 159. 160. /* Take care of the really small primes 2 & 3 */ 161. if (BN_is_word(a, 2) || BN_is_word(a, 3)) ^ 162. return 1; 163. crypto/bn/bn_lib.c:855:1: Parameter `a->top` 853. } 854. 855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); crypto/bn/bn_lib.c:857:12: Call 855. int BN_is_word(const BIGNUM *a, const BN_ULONG w) 856. { 857. return BN_abs_is_word(a, w) && (!w || !a->neg); ^ 858. } 859. crypto/bn/bn_lib.c:840:1: Parameter `a->top` 838. } 839. 840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 841. { 842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_prime.c:165:10: Call 163. 164. /* Check odd and bigger than 1 */ 165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0) ^ 166. return 0; 167. crypto/bn/bn_lib.c:860:1: Parameter `a->top` 858. } 859. 860. > int BN_is_odd(const BIGNUM *a) 861. { 862. return (a->top > 0) && (a->d[0] & 1); crypto/bn/bn_prime.c:165:26: Call 163. 164. /* Check odd and bigger than 1 */ 165. if (!BN_is_odd(a) || BN_cmp(a, BN_value_one()) <= 0) ^ 166. return 0; 167. crypto/bn/bn_lib.c:542:1: Parameter `a->top` 540. } 541. 542. > int BN_cmp(const BIGNUM *a, const BIGNUM *b) 543. { 544. int i; crypto/bn/bn_prime.c:198:10: Call 196. 197. /* compute A1 := a - 1 */ 198. if (!BN_copy(A1, a) || !BN_sub_word(A1, 1)) ^ 199. goto err; 200. /* compute A3 := a - 3 */ crypto/bn/bn_lib.c:285:1: Parameter `b->top` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_prime.c:201:10: Call 199. goto err; 200. /* compute A3 := a - 3 */ 201. if (!BN_copy(A3, a) || !BN_sub_word(A3, 3)) ^ 202. goto err; 203. crypto/bn/bn_lib.c:285:1: Parameter `b->top` 283. } 284. 285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 286. { 287. bn_check_top(b); crypto/bn/bn_prime.c:215:10: Call 213. if (mont == NULL) 214. goto err; 215. if (!BN_MONT_CTX_set(mont, a, ctx)) ^ 216. goto err; 217. crypto/bn/bn_mont.c:238:9: Call 236. BIGNUM *Ri, *R; 237. 238. if (BN_is_zero(mod)) ^ 239. return 0; 240. crypto/bn/bn_lib.c:845:1: Parameter `a->top` 843. } 844. 845. > int BN_is_zero(const BIGNUM *a) 846. { 847. return a->top == 0; crypto/bn/bn_prime.c:223:13: Call 221. goto err; 222. 223. j = witness(check, a, A1, A1_odd, k, ctx, mont); ^ 224. if (j == -1) 225. goto err; crypto/bn/bn_prime.c:245:1: Parameter `a->top` 243. } 244. 245. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1, 246. const BIGNUM *a1_odd, int k, BN_CTX *ctx, 247. BN_MONT_CTX *mont) crypto/bn/bn_prime.c:249:10: Call 247. BN_MONT_CTX *mont) 248. { 249. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */ ^ 250. return -1; 251. if (BN_is_one(w)) crypto/bn/bn_exp.c:296:1: Parameter `m->top` 294. } 295. 296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, 297. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 298. { crypto/bn/bn_exp.c:310:16: Call 308. || BN_get_flags(a, BN_FLG_CONSTTIME) != 0 309. || BN_get_flags(m, BN_FLG_CONSTTIME) != 0) { 310. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont); ^ 311. } 312. crypto/bn/bn_exp.c:745:14: Assignment 743. /* 2^(top*BN_BITS2) - m */ 744. tmp.d[0] = (0 - m->d[0]) & BN_MASK2; 745. for (i = 1; i < top; i++) ^ 746. tmp.d[i] = (~m->d[i]) & BN_MASK2; 747. tmp.top = top; crypto/bn/bn_exp.c:1062:14: Call 1060. bits -= window0; 1061. wvalue = bn_get_bits(p, bits) & wmask; 1062. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue, ^ 1063. window)) 1064. goto err; crypto/bn/bn_exp.c:520:1: Parameter `top` 518. } 519. 520. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, 521. unsigned char *buf, int idx, 522. int window) crypto/bn/bn_exp.c:577:5: Assignment 575. } 576. 577. b->top = top; ^ 578. bn_correct_top(b); 579. return 1; crypto/bn/bn_exp.c:578:5: Call 576. 577. b->top = top; 578. bn_correct_top(b); ^ 579. return 1; 580. } crypto/bn/bn_lib.c:946:1: Parameter `a->top` 944. } 945. 946. > void bn_correct_top(BIGNUM *a) 947. { 948. BN_ULONG *ftl; crypto/bn/bn_exp.c:1075:22: Call 1073. /* Square the result window-size times */ 1074. for (i = 0; i < window; i++) 1075. if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx)) ^ 1076. goto err; 1077. crypto/bn/bn_mont.c:26:1: Parameter `a->top` 24. #endif 25. 26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, 27. BN_MONT_CTX *mont, BN_CTX *ctx) 28. { crypto/bn/bn_mont.c:53:14: Call 51. bn_check_top(tmp); 52. if (a == b) { 53. if (!BN_sqr(tmp, a, ctx)) ^ 54. goto err; 55. } else { crypto/bn/bn_sqr.c:17:1: Parameter `a->top` 15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 16. */ 17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) 18. { 19. int max, al; crypto/bn/bn_sqr.c:25:5: Assignment 23. bn_check_top(a); 24. 25. al = a->top; ^ 26. if (al <= 0) { 27. r->top = 0; crypto/bn/bn_sqr.c:74:17: Call 72. if (bn_wexpand(tmp, max) == NULL) 73. goto err; 74. bn_sqr_normal(rr->d, a->d, al, tmp->d); ^ 75. } 76. } crypto/bn/bn_sqr.c:105:1: <Offset trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `n` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:116:5: Assignment 114. rp[0] = rp[max - 1] = 0; 115. rp++; 116. j = n; ^ 117. 118. if (--j > 0) { crypto/bn/bn_sqr.c:118:9: Assignment 116. j = n; 117. 118. if (--j > 0) { ^ 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); crypto/bn/bn_sqr.c:105:1: <Length trace> 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:105:1: Parameter `*r` 103. 104. /* tmp must have 2*n words */ 105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) 106. { 107. int i, j, max; crypto/bn/bn_sqr.c:113:5: Assignment 111. max = n * 2; 112. ap = a; 113. rp = r; ^ 114. rp[0] = rp[max - 1] = 0; 115. rp++; crypto/bn/bn_sqr.c:115:5: Assignment 113. rp = r; 114. rp[0] = rp[max - 1] = 0; 115. rp++; ^ 116. j = n; 117. crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex` 118. if (--j > 0) { 119. ap++; 120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]); ^ 121. rp += 2; 122. }
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_sqr.c/#L120
d2a_code_trace_data_43833
static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) { return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b))); } ssl/record/ssl3_record.c:1548: error: INTEGER_OVERFLOW_L2 ([0, 17727] - [0, 17728]):unsigned32 by call to `dtls1_process_record`. Showing all 15 steps of the trace ssl/record/ssl3_record.c:1418:13: Assignment 1416. /* this packet contained a partial record, dump it */ 1417. if (RECORD_LAYER_get_packet_length(&s->rlayer) != DTLS1_RT_HEADER_LENGTH) { 1418. RECORD_LAYER_reset_packet_length(&s->rlayer); ^ 1419. goto again; 1420. } ssl/record/ssl3_record.c:1548:10: Call 1546. } 1547. 1548. if (!dtls1_process_record(s)) { ^ 1549. rr->length = 0; 1550. RECORD_LAYER_reset_packet_length(&s->rlayer); /* dump this record */ ssl/record/ssl3_record.c:1199:1: Parameter `s->rlayer.rrec.length` 1197. } 1198. 1199. > int dtls1_process_record(SSL *s) 1200. { 1201. int i, al; ssl/record/ssl3_record.c:1295:13: Call 1293. */ 1294. mac = mac_tmp; 1295. ssl3_cbc_copy_mac(mac_tmp, rr, mac_size); ^ 1296. rr->length -= mac_size; 1297. } else { ssl/record/ssl3_record.c:1122:1: Parameter `md_size` 1120. #define CBC_MAC_ROTATE_IN_PLACE 1121. 1122. > void ssl3_cbc_copy_mac(unsigned char *out, 1123. const SSL3_RECORD *rec, unsigned md_size) 1124. { ssl/record/ssl3_record.c:1171:35: Call 1169. for (i = scan_start, j = 0; i < rec->orig_len; i++) { 1170. unsigned char mac_started = constant_time_ge_8(i, mac_start); 1171. unsigned char mac_ended = constant_time_ge_8(i, mac_end); ^ 1172. unsigned char b = rec->data[i]; 1173. rotated_mac[j++] |= b & mac_started & ~mac_ended; crypto/constant_time_locl.h:153:1: Parameter `a` 151. } 152. 153. > static inline unsigned char constant_time_ge_8(unsigned int a, unsigned int b) 154. { 155. return (unsigned char)(constant_time_ge(a, b)); crypto/constant_time_locl.h:155:28: Call 153. static inline unsigned char constant_time_ge_8(unsigned int a, unsigned int b) 154. { 155. return (unsigned char)(constant_time_ge(a, b)); ^ 156. } 157. crypto/constant_time_locl.h:148:1: Parameter `a` 146. } 147. 148. > static inline unsigned int constant_time_ge(unsigned int a, unsigned int b) 149. { 150. return ~constant_time_lt(a, b); crypto/constant_time_locl.h:150:13: Call 148. static inline unsigned int constant_time_ge(unsigned int a, unsigned int b) 149. { 150. return ~constant_time_lt(a, b); ^ 151. } 152. crypto/constant_time_locl.h:138:1: <LHS trace> 136. } 137. 138. > static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 139. { 140. return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b))); crypto/constant_time_locl.h:138:1: Parameter `a` 136. } 137. 138. > static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 139. { 140. return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b))); crypto/constant_time_locl.h:138:1: <RHS trace> 136. } 137. 138. > static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 139. { 140. return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b))); crypto/constant_time_locl.h:138:1: Parameter `b` 136. } 137. 138. > static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 139. { 140. return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b))); crypto/constant_time_locl.h:140:12: Binary operation: ([0, 17727] - [0, 17728]):unsigned32 by call to `dtls1_process_record` 138. static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) 139. { 140. return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b))); ^ 141. } 142.
https://github.com/openssl/openssl/blob/747e16398d704a667cc99f8a0b1912c36b7de52d/crypto/constant_time_locl.h/#L140
d2a_code_trace_data_43834
static void PS_FlipBytes(unsigned char* buf, tsize_t count) { int i; unsigned char temp; if (count <= 0 || bitspersample <= 8) { return; } count--; for (i = 0; i < count; i += 2) { temp = buf[i]; buf[i] = buf[i + 1]; buf[i + 1] = temp; } } tools/tiff2ps.c:1624: error: Buffer Overrun L3 Offset: [1, +oo] Size: [0, +oo] by call to `PSDataColorContig`. tools/tiff2ps.c:1624:4: Call 1622. fprintf(fd, "%s", RGBcolorimage); 1623. PSColorContigPreamble(fd, w, h, 3); 1624. PSDataColorContig(fd, tif, w, h, 3); ^ 1625. } else { 1626. PSColorSeparatePreamble(fd, w, h, 3); tools/tiff2ps.c:1738:4: Assignment 1736. if (alpha) { 1737. int adjust; 1738. cc = 0; ^ 1739. for (; cc < tf_bytesperrow; cc += samplesperpixel) { 1740. DOBREAK(breaklen, nc, fd); tools/tiff2ps.c:1734:4: Call 1732. */ 1733. if (bitspersample == 16 && !HOST_BIGENDIAN) { 1734. PS_FlipBytes(cp, tf_bytesperrow); ^ 1735. } 1736. if (alpha) { tools/tiff2ps.c:1410:7: <Offset trace> 1408. count--; 1409. 1410. for (i = 0; i < count; i += 2) { ^ 1411. temp = buf[i]; 1412. buf[i] = buf[i + 1]; tools/tiff2ps.c:1410:7: Assignment 1408. count--; 1409. 1410. for (i = 0; i < count; i += 2) { ^ 1411. temp = buf[i]; 1412. buf[i] = buf[i + 1]; tools/tiff2ps.c:1398:1: <Length trace> 1396. 1397. /* Flip the byte order of buffers with 16 bit samples */ 1398. static void ^ 1399. PS_FlipBytes(unsigned char* buf, tsize_t count) 1400. { tools/tiff2ps.c:1398:1: Parameter `*buf` 1396. 1397. /* Flip the byte order of buffers with 16 bit samples */ 1398. static void ^ 1399. PS_FlipBytes(unsigned char* buf, tsize_t count) 1400. { tools/tiff2ps.c:1412:12: Array access: Offset: [1, +oo] Size: [0, +oo] by call to `PSDataColorContig` 1410. for (i = 0; i < count; i += 2) { 1411. temp = buf[i]; 1412. buf[i] = buf[i + 1]; ^ 1413. buf[i + 1] = temp; 1414. }
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/tools/tiff2ps.c/#L1412
d2a_code_trace_data_43835
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { if (!ossl_assert(pkt->subs != NULL && len != 0)) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/extensions_clnt.c:99: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 5]):unsigned64 by call to `WPACKET_memcpy`. Showing all 12 steps of the trace ssl/statem/extensions_clnt.c:96:17: Call 94. /* Sub-packet for SRP extension */ 95. || !WPACKET_start_sub_packet_u16(pkt) 96. || !WPACKET_start_sub_packet_u8(pkt) ^ 97. /* login must not be zero...internal error if so */ 98. || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH) ssl/packet.c:270:1: Parameter `pkt->buf->length` 268. } 269. 270. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes) 271. { 272. WPACKET_SUB *sub; ssl/statem/extensions_clnt.c:99:17: Call 97. /* login must not be zero...internal error if so */ 98. || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH) 99. || !WPACKET_memcpy(pkt, s->srp_ctx.login, ^ 100. strlen(s->srp_ctx.login)) 101. || !WPACKET_close(pkt) ssl/packet.c:359:1: Parameter `pkt->written` 357. } 358. 359. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len) 360. { 361. unsigned char *dest; ssl/packet.c:366:10: Call 364. return 1; 365. 366. if (!WPACKET_allocate_bytes(pkt, len, &dest)) ^ 367. return 0; 368. ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:48:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 5]):unsigned64 by call to `WPACKET_memcpy` 46. return 0; 47. 48. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 49. size_t newlen; 50. size_t reflen;
https://github.com/openssl/openssl/blob/9f5671c7e9f30dfa53b1a2b553f234c2761ceb66/ssl/packet.c/#L48
d2a_code_trace_data_43836
static av_cold int adx_encode_init(AVCodecContext *avctx) { if (avctx->channels > 2) return -1; avctx->frame_size = 32; avctx->coded_frame= avcodec_alloc_frame(); avctx->coded_frame->key_frame= 1; av_log(avctx, AV_LOG_DEBUG, "adx encode init\n"); return 0; } libavcodec/adxenc.c:123: error: Null Dereference pointer `avctx->coded_frame` last assigned on line 122 could be null and is dereferenced at line 123, column 5. libavcodec/adxenc.c:116:1: start of procedure adx_encode_init() 114. } 115. 116. static av_cold int adx_encode_init(AVCodecContext *avctx) ^ 117. { 118. if (avctx->channels > 2) libavcodec/adxenc.c:118:9: Taking false branch 116. static av_cold int adx_encode_init(AVCodecContext *avctx) 117. { 118. if (avctx->channels > 2) ^ 119. return -1; /* only stereo or mono =) */ 120. avctx->frame_size = 32; libavcodec/adxenc.c:120:5: 118. if (avctx->channels > 2) 119. return -1; /* only stereo or mono =) */ 120. avctx->frame_size = 32; ^ 121. 122. avctx->coded_frame= avcodec_alloc_frame(); libavcodec/adxenc.c:122:5: 120. avctx->frame_size = 32; 121. 122. avctx->coded_frame= avcodec_alloc_frame(); ^ 123. avctx->coded_frame->key_frame= 1; 124. libavcodec/utils.c:475:1: start of procedure avcodec_alloc_frame() 473. } 474. 475. AVFrame *avcodec_alloc_frame(void){ ^ 476. AVFrame *pic= av_malloc(sizeof(AVFrame)); 477. libavcodec/utils.c:476:5: 474. 475. AVFrame *avcodec_alloc_frame(void){ 476. AVFrame *pic= av_malloc(sizeof(AVFrame)); ^ 477. 478. if(pic==NULL) return NULL; libavutil/mem.c:64:1: start of procedure av_malloc() 62. linker will do it automatically. */ 63. 64. void *av_malloc(size_t size) ^ 65. { 66. void *ptr = NULL; libavutil/mem.c:66:5: 64. void *av_malloc(size_t size) 65. { 66. void *ptr = NULL; ^ 67. #if CONFIG_MEMALIGN_HACK 68. long diff; libavutil/mem.c:72:8: Taking false branch 70. 71. /* let's disallow possible ambiguous cases */ 72. if(size > (INT_MAX-32) ) ^ 73. return NULL; 74. libavutil/mem.c:83:9: Taking false branch 81. ((char*)ptr)[-1]= diff; 82. #elif HAVE_POSIX_MEMALIGN 83. if (posix_memalign(&ptr,32,size)) ^ 84. ptr = NULL; 85. #elif HAVE_MEMALIGN libavutil/mem.c:114:5: 112. ptr = malloc(size); 113. #endif 114. return ptr; ^ 115. } 116. libavutil/mem.c:115:1: return from a call to av_malloc 113. #endif 114. return ptr; 115. } ^ 116. 117. void *av_realloc(void *ptr, size_t size) libavcodec/utils.c:478:8: Taking true branch 476. AVFrame *pic= av_malloc(sizeof(AVFrame)); 477. 478. if(pic==NULL) return NULL; ^ 479. 480. avcodec_get_frame_defaults(pic); libavcodec/utils.c:478:19: 476. AVFrame *pic= av_malloc(sizeof(AVFrame)); 477. 478. if(pic==NULL) return NULL; ^ 479. 480. avcodec_get_frame_defaults(pic); libavcodec/utils.c:483:1: return from a call to avcodec_alloc_frame 481. 482. return pic; 483. } ^ 484. 485. #if FF_API_AVCODEC_OPEN libavcodec/adxenc.c:123:5: 121. 122. avctx->coded_frame= avcodec_alloc_frame(); 123. avctx->coded_frame->key_frame= 1; ^ 124. 125. // avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32;
https://github.com/libav/libav/blob/954d94dd5e13ba7a5e9e049d0f980bddced9644c/libavcodec/adxenc.c/#L123
d2a_code_trace_data_43837
static inline void pred_direct_motion(H264Context * const h, int *mb_type){ MpegEncContext * const s = &h->s; const int mb_xy = s->mb_x + s->mb_y*s->mb_stride; const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride; const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy]; const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy]; const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy]; const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy]; const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy]; const int is_b8x8 = IS_8X8(*mb_type); unsigned int sub_mb_type; int i8, i4; #define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM) if(IS_8X8(mb_type_col) && !h->sps.direct_8x8_inference_flag){ sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1; }else if(!is_b8x8 && (mb_type_col & MB_TYPE_16x16_OR_INTRA)){ sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; }else{ sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1; } if(!is_b8x8) *mb_type |= MB_TYPE_DIRECT2; if(MB_FIELD) *mb_type |= MB_TYPE_INTERLACED; tprintf(s->avctx, "mb_type = %08x, sub_mb_type = %08x, is_b8x8 = %d, mb_type_col = %08x\n", *mb_type, sub_mb_type, is_b8x8, mb_type_col); if(h->direct_spatial_mv_pred){ int ref[2]; int mv[2][2]; int list; for(list=0; list<2; list++){ int refa = h->ref_cache[list][scan8[0] - 1]; int refb = h->ref_cache[list][scan8[0] - 8]; int refc = h->ref_cache[list][scan8[0] - 8 + 4]; if(refc == -2) refc = h->ref_cache[list][scan8[0] - 8 - 1]; ref[list] = refa; if(ref[list] < 0 || (refb < ref[list] && refb >= 0)) ref[list] = refb; if(ref[list] < 0 || (refc < ref[list] && refc >= 0)) ref[list] = refc; if(ref[list] < 0) ref[list] = -1; } if(ref[0] < 0 && ref[1] < 0){ ref[0] = ref[1] = 0; mv[0][0] = mv[0][1] = mv[1][0] = mv[1][1] = 0; }else{ for(list=0; list<2; list++){ if(ref[list] >= 0) pred_motion(h, 0, 4, list, ref[list], &mv[list][0], &mv[list][1]); else mv[list][0] = mv[list][1] = 0; } } if(ref[1] < 0){ if(!is_b8x8) *mb_type &= ~MB_TYPE_L1; sub_mb_type &= ~MB_TYPE_L1; }else if(ref[0] < 0){ if(!is_b8x8) *mb_type &= ~MB_TYPE_L0; sub_mb_type &= ~MB_TYPE_L0; } if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){ int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride; int mb_types_col[2]; int b8_stride = h->b8_stride; int b4_stride = h->b_stride; *mb_type = (*mb_type & ~MB_TYPE_16x16) | MB_TYPE_8x8; if(IS_INTERLACED(*mb_type)){ mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy]; mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; if(s->mb_y&1){ l1ref0 -= 2*b8_stride; l1ref1 -= 2*b8_stride; l1mv0 -= 4*b4_stride; l1mv1 -= 4*b4_stride; } b8_stride *= 3; b4_stride *= 6; }else{ int cur_poc = s->current_picture_ptr->poc; int *col_poc = h->ref_list[1]->field_poc; int col_parity = FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc); int dy = 2*col_parity - (s->mb_y&1); mb_types_col[0] = mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy + col_parity*s->mb_stride]; l1ref0 += dy*b8_stride; l1ref1 += dy*b8_stride; l1mv0 += 2*dy*b4_stride; l1mv1 += 2*dy*b4_stride; b8_stride = 0; } for(i8=0; i8<4; i8++){ int x8 = i8&1; int y8 = i8>>1; int xy8 = x8+y8*b8_stride; int xy4 = 3*x8+y8*b4_stride; int a=0, b=0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_types_col[y8]) && ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1) || (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){ if(ref[0] > 0) a= pack16to32(mv[0][0],mv[0][1]); if(ref[1] > 0) b= pack16to32(mv[1][0],mv[1][1]); }else{ a= pack16to32(mv[0][0],mv[0][1]); b= pack16to32(mv[1][0],mv[1][1]); } fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4); } }else if(IS_16X16(*mb_type)){ int a=0, b=0; fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_type_col) && ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1) || (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1 && (h->x264_build>33 || !h->x264_build)))){ if(ref[0] > 0) a= pack16to32(mv[0][0],mv[0][1]); if(ref[1] > 0) b= pack16to32(mv[1][0],mv[1][1]); }else{ a= pack16to32(mv[0][0],mv[0][1]); b= pack16to32(mv[1][0],mv[1][1]); } fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4); fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4); }else{ for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4); fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0 || (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0 && (h->x264_build>33 || !h->x264_build)))){ const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1; if(IS_SUB_8X8(sub_mb_type)){ const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ if(ref[0] == 0) fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); if(ref[1] == 0) fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); } }else for(i4=0; i4<4; i4++){ const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride]; if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ if(ref[0] == 0) *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0; if(ref[1] == 0) *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0; } } } } } }else{ const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]}; const int *dist_scale_factor = h->dist_scale_factor; if(FRAME_MBAFF){ if(IS_INTERLACED(*mb_type)){ map_col_to_list0[0] = h->map_col_to_list0_field[0]; map_col_to_list0[1] = h->map_col_to_list0_field[1]; dist_scale_factor = h->dist_scale_factor_field; } if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){ const int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride; int mb_types_col[2]; int y_shift; *mb_type = MB_TYPE_8x8|MB_TYPE_L0L1 | (is_b8x8 ? 0 : MB_TYPE_DIRECT2) | (*mb_type & MB_TYPE_INTERLACED); sub_mb_type = MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_16x16; if(IS_INTERLACED(*mb_type)){ mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy]; mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; if(s->mb_y&1){ l1ref0 -= 2*h->b8_stride; l1ref1 -= 2*h->b8_stride; l1mv0 -= 4*h->b_stride; l1mv1 -= 4*h->b_stride; } y_shift = 0; if( (mb_types_col[0] & MB_TYPE_16x16_OR_INTRA) && (mb_types_col[1] & MB_TYPE_16x16_OR_INTRA) && !is_b8x8) *mb_type |= MB_TYPE_16x8; else *mb_type |= MB_TYPE_8x8; }else{ int dy = (s->mb_y&1) ? 1 : 2; mb_types_col[0] = mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride]; l1ref0 += dy*h->b8_stride; l1ref1 += dy*h->b8_stride; l1mv0 += 2*dy*h->b_stride; l1mv1 += 2*dy*h->b_stride; y_shift = 2; if((mb_types_col[0] & (MB_TYPE_16x16_OR_INTRA|MB_TYPE_16x8)) && !is_b8x8) *mb_type |= MB_TYPE_16x16; else *mb_type |= MB_TYPE_8x8; } for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; int ref0, scale; const int16_t (*l1mv)[2]= l1mv0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1); if(IS_INTRA(mb_types_col[y8])){ fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1); fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); continue; } ref0 = l1ref0[x8 + (y8*2>>y_shift)*h->b8_stride]; if(ref0 >= 0) ref0 = map_col_to_list0[0][ref0*2>>y_shift]; else{ ref0 = map_col_to_list0[1][l1ref1[x8 + (y8*2>>y_shift)*h->b8_stride]*2>>y_shift]; l1mv= l1mv1; } scale = dist_scale_factor[ref0]; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); { const int16_t *mv_col = l1mv[x8*3 + (y8*6>>y_shift)*h->b_stride]; int my_col = (mv_col[1]<<y_shift)/2; int mx = (scale * mv_col[0] + 128) >> 8; int my = (scale * my_col + 128) >> 8; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4); } } return; } } if(IS_16X16(*mb_type)){ int ref, mv0, mv1; fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1); if(IS_INTRA(mb_type_col)){ ref=mv0=mv1=0; }else{ const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0]] : map_col_to_list0[1][l1ref1[0]]; const int scale = dist_scale_factor[ref0]; const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0]; int mv_l0[2]; mv_l0[0] = (scale * mv_col[0] + 128) >> 8; mv_l0[1] = (scale * mv_col[1] + 128) >> 8; ref= ref0; mv0= pack16to32(mv_l0[0],mv_l0[1]); mv1= pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); } fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1); fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, mv0, 4); fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, mv1, 4); }else{ for(i8=0; i8<4; i8++){ const int x8 = i8&1; const int y8 = i8>>1; int ref0, scale; const int16_t (*l1mv)[2]= l1mv0; if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8])) continue; h->sub_mb_type[i8] = sub_mb_type; fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1); if(IS_INTRA(mb_type_col)){ fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1); fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); continue; } ref0 = l1ref0[x8 + y8*h->b8_stride]; if(ref0 >= 0) ref0 = map_col_to_list0[0][ref0]; else{ ref0 = map_col_to_list0[1][l1ref1[x8 + y8*h->b8_stride]]; l1mv= l1mv1; } scale = dist_scale_factor[ref0]; fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); if(IS_SUB_8X8(sub_mb_type)){ const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; int mx = (scale * mv_col[0] + 128) >> 8; int my = (scale * mv_col[1] + 128) >> 8; fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4); }else for(i4=0; i4<4; i4++){ const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride]; int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]]; mv_l0[0] = (scale * mv_col[0] + 128) >> 8; mv_l0[1] = (scale * mv_col[1] + 128) >> 8; *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); } } } } } libavcodec/h264.c:1080: error: Uninitialized Value The value read from ref[_] was never initialized. libavcodec/h264.c:1080:17: 1078. 1079. fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); 1080. fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); ^ 1081. if(!IS_INTRA(mb_types_col[y8]) 1082. && ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1080
d2a_code_trace_data_43838
static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit, void *ext_struc) { unsigned char *ext_der = NULL; int ext_len; ASN1_OCTET_STRING *ext_oct = NULL; X509_EXTENSION *ext; if (method->it) { ext_der = NULL; ext_len = ASN1_item_i2d(ext_struc, &ext_der, ASN1_ITEM_ptr(method->it)); if (ext_len < 0) goto merr; } else { unsigned char *p; ext_len = method->i2d(ext_struc, NULL); if ((ext_der = OPENSSL_malloc(ext_len)) == NULL) goto merr; p = ext_der; method->i2d(ext_struc, &p); } if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL) goto merr; ext_oct->data = ext_der; ext_der = NULL; ext_oct->length = ext_len; ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct); if (!ext) goto merr; ASN1_OCTET_STRING_free(ext_oct); return ext; merr: X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE); OPENSSL_free(ext_der); ASN1_OCTET_STRING_free(ext_oct); return NULL; } crypto/x509v3/v3_conf.c:210: error: MEMORY_LEAK memory dynamically allocated by call to `ASN1_OCTET_STRING_new()` at line 201, column 20 is not reachable after line 210, column 5. Showing all 85 steps of the trace crypto/x509v3/v3_conf.c:178:1: start of procedure do_ext_i2d() 176. } 177. 178. > static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method, 179. int ext_nid, int crit, void *ext_struc) 180. { crypto/x509v3/v3_conf.c:181:5: 179. int ext_nid, int crit, void *ext_struc) 180. { 181. > unsigned char *ext_der = NULL; 182. int ext_len; 183. ASN1_OCTET_STRING *ext_oct = NULL; crypto/x509v3/v3_conf.c:183:5: 181. unsigned char *ext_der = NULL; 182. int ext_len; 183. > ASN1_OCTET_STRING *ext_oct = NULL; 184. X509_EXTENSION *ext; 185. /* Convert internal representation to DER */ crypto/x509v3/v3_conf.c:186:9: Taking false branch 184. X509_EXTENSION *ext; 185. /* Convert internal representation to DER */ 186. if (method->it) { ^ 187. ext_der = NULL; 188. ext_len = crypto/x509v3/v3_conf.c:195:9: Skipping __function_pointer__(): unresolved function pointer 193. unsigned char *p; 194. 195. ext_len = method->i2d(ext_struc, NULL); ^ 196. if ((ext_der = OPENSSL_malloc(ext_len)) == NULL) 197. goto merr; crypto/x509v3/v3_conf.c:196:13: 194. 195. ext_len = method->i2d(ext_struc, NULL); 196. > if ((ext_der = OPENSSL_malloc(ext_len)) == NULL) 197. goto merr; 198. p = ext_der; 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/x509v3/v3_conf.c:196:13: Taking false branch 194. 195. ext_len = method->i2d(ext_struc, NULL); 196. if ((ext_der = OPENSSL_malloc(ext_len)) == NULL) ^ 197. goto merr; 198. p = ext_der; crypto/x509v3/v3_conf.c:198:9: 196. if ((ext_der = OPENSSL_malloc(ext_len)) == NULL) 197. goto merr; 198. > p = ext_der; 199. method->i2d(ext_struc, &p); 200. } crypto/x509v3/v3_conf.c:199:9: Skipping __function_pointer__(): unresolved function pointer 197. goto merr; 198. p = ext_der; 199. method->i2d(ext_struc, &p); ^ 200. } 201. if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL) crypto/x509v3/v3_conf.c:201:9: 199. method->i2d(ext_struc, &p); 200. } 201. > if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL) 202. goto merr; 203. ext_oct->data = ext_der; crypto/asn1/tasn_typ.c:77:1: start of procedure ASN1_OCTET_STRING_new() 75. } 76. 77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING) 78. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER) 79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED) crypto/asn1/asn1_lib.c:349:1: start of procedure ASN1_STRING_type_new() 347. } 348. 349. > ASN1_STRING *ASN1_STRING_type_new(int type) 350. { 351. ASN1_STRING *ret; crypto/asn1/asn1_lib.c:353:5: 351. ASN1_STRING *ret; 352. 353. > ret = OPENSSL_zalloc(sizeof(*ret)); 354. if (ret == NULL) { 355. ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE); 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/asn1/asn1_lib.c:354:9: Taking false branch 352. 353. ret = OPENSSL_zalloc(sizeof(*ret)); 354. if (ret == NULL) { ^ 355. ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE); 356. return (NULL); crypto/asn1/asn1_lib.c:358:5: 356. return (NULL); 357. } 358. > ret->type = type; 359. return (ret); 360. } crypto/asn1/asn1_lib.c:359:5: 357. } 358. ret->type = type; 359. > return (ret); 360. } 361. crypto/asn1/asn1_lib.c:360:1: return from a call to ASN1_STRING_type_new 358. ret->type = type; 359. return (ret); 360. > } 361. 362. void ASN1_STRING_free(ASN1_STRING *a) crypto/asn1/tasn_typ.c:77:1: return from a call to ASN1_OCTET_STRING_new 75. } 76. 77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING) 78. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER) 79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED) crypto/x509v3/v3_conf.c:201:9: Taking false branch 199. method->i2d(ext_struc, &p); 200. } 201. if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL) ^ 202. goto merr; 203. ext_oct->data = ext_der; crypto/x509v3/v3_conf.c:203:5: 201. if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL) 202. goto merr; 203. > ext_oct->data = ext_der; 204. ext_der = NULL; 205. ext_oct->length = ext_len; crypto/x509v3/v3_conf.c:204:5: 202. goto merr; 203. ext_oct->data = ext_der; 204. > ext_der = NULL; 205. ext_oct->length = ext_len; 206. crypto/x509v3/v3_conf.c:205:5: 203. ext_oct->data = ext_der; 204. ext_der = NULL; 205. > ext_oct->length = ext_len; 206. 207. ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct); crypto/x509v3/v3_conf.c:207:5: 205. ext_oct->length = ext_len; 206. 207. > ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct); 208. if (!ext) 209. goto merr; crypto/x509/x509_v3.c:184:1: start of procedure X509_EXTENSION_create_by_NID() 182. } 183. 184. > X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, 185. int crit, 186. ASN1_OCTET_STRING *data) crypto/x509/x509_v3.c:191:5: 189. X509_EXTENSION *ret; 190. 191. > obj = OBJ_nid2obj(nid); 192. if (obj == NULL) { 193. X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID); crypto/objects/obj_dat.c:293:1: start of procedure OBJ_nid2obj() 291. } 292. 293. > ASN1_OBJECT *OBJ_nid2obj(int n) 294. { 295. ADDED_OBJ ad, *adp; crypto/objects/obj_dat.c:298:10: Taking true branch 296. ASN1_OBJECT ob; 297. 298. if ((n >= 0) && (n < NUM_NID)) { ^ 299. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) { 300. OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID); crypto/objects/obj_dat.c:298:22: Taking false branch 296. ASN1_OBJECT ob; 297. 298. if ((n >= 0) && (n < NUM_NID)) { ^ 299. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) { 300. OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID); crypto/objects/obj_dat.c:304:16: Taking false branch 302. } 303. return ((ASN1_OBJECT *)&(nid_objs[n])); 304. } else if (added == NULL) ^ 305. return (NULL); 306. else { crypto/objects/obj_dat.c:307:9: 305. return (NULL); 306. else { 307. > ad.type = ADDED_NID; 308. ad.obj = &ob; 309. ob.nid = n; crypto/objects/obj_dat.c:308:9: 306. else { 307. ad.type = ADDED_NID; 308. > ad.obj = &ob; 309. ob.nid = n; 310. adp = lh_ADDED_OBJ_retrieve(added, &ad); crypto/objects/obj_dat.c:309:9: 307. ad.type = ADDED_NID; 308. ad.obj = &ob; 309. > ob.nid = n; 310. adp = lh_ADDED_OBJ_retrieve(added, &ad); 311. if (adp != NULL) crypto/objects/obj_dat.c:310:15: Condition is true 308. ad.obj = &ob; 309. ob.nid = n; 310. adp = lh_ADDED_OBJ_retrieve(added, &ad); ^ 311. if (adp != NULL) 312. return (adp->obj); crypto/objects/obj_dat.c:310:15: Condition is true 308. ad.obj = &ob; 309. ob.nid = n; 310. adp = lh_ADDED_OBJ_retrieve(added, &ad); ^ 311. if (adp != NULL) 312. return (adp->obj); crypto/objects/obj_dat.c:310:9: 308. ad.obj = &ob; 309. ob.nid = n; 310. > adp = lh_ADDED_OBJ_retrieve(added, &ad); 311. if (adp != NULL) 312. return (adp->obj); crypto/lhash/lhash.c:217:1: start of procedure lh_retrieve() 215. } 216. 217. > void *lh_retrieve(_LHASH *lh, const void *data) 218. { 219. unsigned long hash; crypto/lhash/lhash.c:223:5: 221. void *ret; 222. 223. > lh->error = 0; 224. rn = getrn(lh, data, &hash); 225. crypto/lhash/lhash.c:224:5: Skipping getrn(): empty list of specs 222. 223. lh->error = 0; 224. rn = getrn(lh, data, &hash); ^ 225. 226. if (*rn == NULL) { crypto/lhash/lhash.c:226:9: Taking false branch 224. rn = getrn(lh, data, &hash); 225. 226. if (*rn == NULL) { ^ 227. lh->num_retrieve_miss++; 228. return (NULL); crypto/lhash/lhash.c:230:9: 228. return (NULL); 229. } else { 230. > ret = (*rn)->data; 231. lh->num_retrieve++; 232. } crypto/lhash/lhash.c:231:9: 229. } else { 230. ret = (*rn)->data; 231. > lh->num_retrieve++; 232. } 233. return (ret); crypto/lhash/lhash.c:233:5: 231. lh->num_retrieve++; 232. } 233. > return (ret); 234. } 235. crypto/lhash/lhash.c:234:1: return from a call to lh_retrieve 232. } 233. return (ret); 234. > } 235. 236. static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, crypto/objects/obj_dat.c:311:13: Taking true branch 309. ob.nid = n; 310. adp = lh_ADDED_OBJ_retrieve(added, &ad); 311. if (adp != NULL) ^ 312. return (adp->obj); 313. else { crypto/objects/obj_dat.c:312:13: 310. adp = lh_ADDED_OBJ_retrieve(added, &ad); 311. if (adp != NULL) 312. > return (adp->obj); 313. else { 314. OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID); crypto/objects/obj_dat.c:318:1: return from a call to OBJ_nid2obj 316. } 317. } 318. > } 319. 320. const char *OBJ_nid2sn(int n) crypto/x509/x509_v3.c:192:9: Taking false branch 190. 191. obj = OBJ_nid2obj(nid); 192. if (obj == NULL) { ^ 193. X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID); 194. return (NULL); crypto/x509/x509_v3.c:196:5: Skipping X509_EXTENSION_create_by_OBJ(): empty list of specs 194. return (NULL); 195. } 196. ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data); ^ 197. if (ret == NULL) 198. ASN1_OBJECT_free(obj); crypto/x509/x509_v3.c:197:9: Taking false branch 195. } 196. ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data); 197. if (ret == NULL) ^ 198. ASN1_OBJECT_free(obj); 199. return (ret); crypto/x509/x509_v3.c:199:5: 197. if (ret == NULL) 198. ASN1_OBJECT_free(obj); 199. > return (ret); 200. } 201. crypto/x509/x509_v3.c:200:1: return from a call to X509_EXTENSION_create_by_NID 198. ASN1_OBJECT_free(obj); 199. return (ret); 200. > } 201. 202. X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, crypto/x509v3/v3_conf.c:208:10: Taking false branch 206. 207. ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct); 208. if (!ext) ^ 209. goto merr; 210. ASN1_OCTET_STRING_free(ext_oct); crypto/x509v3/v3_conf.c:210:5: 208. if (!ext) 209. goto merr; 210. > ASN1_OCTET_STRING_free(ext_oct); 211. 212. return ext; crypto/asn1/tasn_typ.c:77:1: start of procedure ASN1_OCTET_STRING_free() 75. } 76. 77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING) 78. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER) 79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED) crypto/asn1/asn1_lib.c:362:1: start of procedure ASN1_STRING_free() 360. } 361. 362. > void ASN1_STRING_free(ASN1_STRING *a) 363. { 364. if (a == NULL) crypto/asn1/asn1_lib.c:364:9: Taking false branch 362. void ASN1_STRING_free(ASN1_STRING *a) 363. { 364. if (a == NULL) ^ 365. return; 366. if (!(a->flags & ASN1_STRING_FLAG_NDEF)) crypto/asn1/asn1_lib.c:366:11: Taking false branch 364. if (a == NULL) 365. return; 366. if (!(a->flags & ASN1_STRING_FLAG_NDEF)) ^ 367. OPENSSL_free(a->data); 368. if (!(a->flags & ASN1_STRING_FLAG_EMBED)) crypto/asn1/asn1_lib.c:368:11: Taking false branch 366. if (!(a->flags & ASN1_STRING_FLAG_NDEF)) 367. OPENSSL_free(a->data); 368. if (!(a->flags & ASN1_STRING_FLAG_EMBED)) ^ 369. OPENSSL_free(a); 370. } crypto/asn1/asn1_lib.c:368:5: 366. if (!(a->flags & ASN1_STRING_FLAG_NDEF)) 367. OPENSSL_free(a->data); 368. > if (!(a->flags & ASN1_STRING_FLAG_EMBED)) 369. OPENSSL_free(a); 370. } crypto/asn1/asn1_lib.c:370:1: return from a call to ASN1_STRING_free 368. if (!(a->flags & ASN1_STRING_FLAG_EMBED)) 369. OPENSSL_free(a); 370. > } 371. 372. void ASN1_STRING_clear_free(ASN1_STRING *a) crypto/asn1/tasn_typ.c:77:1: return from a call to ASN1_OCTET_STRING_free 75. } 76. 77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING) 78. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER) 79. IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/x509v3/v3_conf.c/#L210
d2a_code_trace_data_43839
static void gcm_init_4bit(u128 Htable[16], u64 H[2]) { u128 V; #if defined(OPENSSL_SMALL_FOOTPRINT) int i; #endif Htable[0].hi = 0; Htable[0].lo = 0; V.hi = H[0]; V.lo = H[1]; #if defined(OPENSSL_SMALL_FOOTPRINT) for (Htable[8]=V, i=4; i>0; i>>=1) { REDUCE1BIT(V); Htable[i] = V; } for (i=2; i<16; i<<=1) { u128 *Hi = Htable+i; int j; for (V=*Hi, j=1; j<i; ++j) { Hi[j].hi = V.hi^Htable[j].hi; Hi[j].lo = V.lo^Htable[j].lo; } } #else Htable[8] = V; REDUCE1BIT(V); Htable[4] = V; REDUCE1BIT(V); Htable[2] = V; REDUCE1BIT(V); Htable[1] = V; Htable[3].hi = V.hi^Htable[2].hi, Htable[3].lo = V.lo^Htable[2].lo; V=Htable[4]; Htable[5].hi = V.hi^Htable[1].hi, Htable[5].lo = V.lo^Htable[1].lo; Htable[6].hi = V.hi^Htable[2].hi, Htable[6].lo = V.lo^Htable[2].lo; Htable[7].hi = V.hi^Htable[3].hi, Htable[7].lo = V.lo^Htable[3].lo; V=Htable[8]; Htable[9].hi = V.hi^Htable[1].hi, Htable[9].lo = V.lo^Htable[1].lo; Htable[10].hi = V.hi^Htable[2].hi, Htable[10].lo = V.lo^Htable[2].lo; Htable[11].hi = V.hi^Htable[3].hi, Htable[11].lo = V.lo^Htable[3].lo; Htable[12].hi = V.hi^Htable[4].hi, Htable[12].lo = V.lo^Htable[4].lo; Htable[13].hi = V.hi^Htable[5].hi, Htable[13].lo = V.lo^Htable[5].lo; Htable[14].hi = V.hi^Htable[6].hi, Htable[14].lo = V.lo^Htable[6].lo; Htable[15].hi = V.hi^Htable[7].hi, Htable[15].lo = V.lo^Htable[7].lo; #endif #if defined(GHASH_ASM) && (defined(__arm__) || defined(__arm)) { int j; const union { long one; char little; } is_endian = {1}; if (is_endian.little) for (j=0;j<16;++j) { V = Htable[j]; Htable[j].hi = V.lo; Htable[j].lo = V.hi; } else for (j=0;j<16;++j) { V = Htable[j]; Htable[j].hi = V.lo<<32|V.lo>>32; Htable[j].lo = V.hi<<32|V.hi>>32; } } #endif } crypto/modes/gcm128.c:819: error: INTEGER_OVERFLOW_L2 (0 - [0, 1]):unsigned64 by call to `gcm_init_4bit`. Showing all 5 steps of the trace crypto/modes/gcm128.c:819:3: Call 817. ctx->ghash = gcm_ghash_p8; 818. } else { 819. gcm_init_4bit(ctx->Htable,ctx->H.u); ^ 820. ctx->gmult = gcm_gmult_4bit; 821. ctx->ghash = gcm_ghash_4bit; crypto/modes/gcm128.c:257:1: <RHS trace> 255. #elif TABLE_BITS==4 256. 257. > static void gcm_init_4bit(u128 Htable[16], u64 H[2]) 258. { 259. u128 V; crypto/modes/gcm128.c:257:1: Parameter `*H` 255. #elif TABLE_BITS==4 256. 257. > static void gcm_init_4bit(u128 Htable[16], u64 H[2]) 258. { 259. u128 V; crypto/modes/gcm128.c:267:2: Assignment 265. Htable[0].lo = 0; 266. V.hi = H[0]; 267. V.lo = H[1]; ^ 268. 269. #if defined(OPENSSL_SMALL_FOOTPRINT) crypto/modes/gcm128.c:285:2: Binary operation: (0 - [0, 1]):unsigned64 by call to `gcm_init_4bit` 283. #else 284. Htable[8] = V; 285. REDUCE1BIT(V); ^ 286. Htable[4] = V; 287. REDUCE1BIT(V);
https://github.com/openssl/openssl/blob/c8d133e4b6f1ed1b7ad3c1a6d2c62f460e26c050/crypto/modes/gcm128.c/#L285
d2a_code_trace_data_43840
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *A, *a = NULL; const BN_ULONG *B; int i; bn_check_top(b); if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return (NULL); } if (BN_get_flags(b, BN_FLG_SECURE)) a = A = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = A = OPENSSL_zalloc(words * sizeof(*a)); if (A == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return (NULL); } #if 1 B = b->d; if (B != NULL) { for (i = b->top >> 2; i > 0; i--, A += 4, B += 4) { BN_ULONG a0, a1, a2, a3; a0 = B[0]; a1 = B[1]; a2 = B[2]; a3 = B[3]; A[0] = a0; A[1] = a1; A[2] = a2; A[3] = a3; } switch (b->top & 3) { case 3: A[2] = B[2]; case 2: A[1] = B[1]; case 1: A[0] = B[0]; case 0: ; } } #else memset(A, 0, sizeof(*A) * words); memcpy(A, b->d, sizeof(b->d[0]) * b->top); #endif return (a); } crypto/bn/bn_prime.c:256: error: BUFFER_OVERRUN_L3 Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_copy`. Showing all 16 steps of the trace crypto/bn/bn_prime.c:241:18: Call 239. if (a->neg) { 240. BIGNUM *t; 241. if ((t = BN_CTX_get(ctx)) == NULL) ^ 242. goto err; 243. if (BN_copy(t, a) == NULL) 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: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_prime.c:256:10: Call 254. 255. /* compute A1 := A - 1 */ 256. if (!BN_copy(A1, A)) ^ 257. goto err; 258. if (!BN_sub_word(A1, 1)) crypto/bn/bn_lib.c:362:1: Parameter `*a->d` 360. } 361. 362. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) 363. { 364. int i; crypto/bn/bn_lib.c:372:9: Call 370. if (a == b) 371. return (a); 372. if (bn_wexpand(a, b->top) == NULL) ^ 373. return (NULL); 374. 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_lib.c:1018:37: Call 1016. BIGNUM *bn_wexpand(BIGNUM *a, int words) 1017. { 1018. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 1019. } 1020. 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_copy` 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/d7c42d71ba407a4b3c26ed58263ae225976bbac3/crypto/bn/bn_lib.c/#L289
d2a_code_trace_data_43841
static void qmf_32_subbands(DCAContext * s, int chans, float samples_in[32][8], float *samples_out, float scale, float bias) { const float *prCoeff; int i, j, k; float praXin[33], *raXin = &praXin[1]; float *subband_fir_hist = s->subband_fir_hist[chans]; float *subband_fir_hist2 = s->subband_fir_noidea[chans]; int chindex = 0, subindex; praXin[0] = 0.0; if (!s->multirate_inter) prCoeff = fir_32bands_nonperfect; else prCoeff = fir_32bands_perfect; for (subindex = 0; subindex < 8; subindex++) { float t1, t2, sum[16], diff[16]; for (i = 0; i < s->subband_activity[chans]; i++) raXin[i] = samples_in[i][subindex]; for (; i < 32; i++) raXin[i] = 0.0; for (j = 0, k = 0; k < 16; k++) { t1 = 0.0; t2 = 0.0; for (i = 0; i < 16; i++, j++){ t1 += (raXin[2 * i] + raXin[2 * i + 1]) * cos_mod[j]; t2 += (raXin[2 * i] + raXin[2 * i - 1]) * cos_mod[j + 256]; } sum[k] = t1 + t2; diff[k] = t1 - t2; } j = 512; for (k = 0; k < 16; k++) subband_fir_hist[k] = cos_mod[j++] * sum[k]; for (k = 0; k < 16; k++) subband_fir_hist[32-k-1] = cos_mod[j++] * diff[k]; for (k = 31, i = 0; i < 32; i++, k--) for (j = 0; j < 512; j += 64){ subband_fir_hist2[i] += prCoeff[i+j] * ( subband_fir_hist[i+j] - subband_fir_hist[j+k]); subband_fir_hist2[i+32] += prCoeff[i+j+32]*(-subband_fir_hist[i+j] - subband_fir_hist[j+k]); } for (i = 0; i < 32; i++) samples_out[chindex++] = subband_fir_hist2[i] * scale + bias; memmove(&subband_fir_hist[32], &subband_fir_hist[0], (512 - 32) * sizeof(float)); memmove(&subband_fir_hist2[0], &subband_fir_hist2[32], 32 * sizeof(float)); memset(&subband_fir_hist2[32], 0, 32 * sizeof(float)); } } libavcodec/dca.c:702: error: Uninitialized Value The value read from diff[_] was never initialized. libavcodec/dca.c:702:13: 700. subband_fir_hist[k] = cos_mod[j++] * sum[k]; 701. for (k = 0; k < 16; k++) 702. subband_fir_hist[32-k-1] = cos_mod[j++] * diff[k]; ^ 703. 704. /* Multiply by filter coefficients */
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/dca.c/#L702
d2a_code_trace_data_43842
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: [145+min(0, `c->synth_buf_offset[*]`), 160+max(511, `c->synth_buf_offset[*]`)] (⇐ [17+min(0, `c->synth_buf_offset[*]`), 32+max(511, `c->synth_buf_offset[*]`)] + 128) Size: 2 by call to `ff_mpa_synth_filter`. libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]` 49. * Process decoded Musepack data and produce PCM 50. */ 51. static void mpc_synth(MPCContext *c, int16_t *out) ^ 52. { 53. int dither_state = 0; libavcodec/mpc.c:60:13: Call 58. samples_ptr = samples + ch; 59. for(i = 0; i < SAMPLES_PER_BAND; i++) { 60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]), ^ 61. mpa_window, &dither_state, 62. samples_ptr, 2, libavcodec/mpegaudiodec.c: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: [145+min(0, c->synth_buf_offset[*]), 160+max(511, c->synth_buf_offset[*])] (⇐ [17+min(0, c->synth_buf_offset[*]), 32+max(511, c->synth_buf_offset[*])] + 128) 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_43843
static void iterative_me(SnowContext *s){ int pass, mb_x, mb_y; const int b_width = s->b_width << s->block_max_depth; const int b_height= s->b_height << s->block_max_depth; const int b_stride= b_width; int color[3]; { RangeCoder r = s->c; uint8_t state[sizeof(s->block_state)]; memcpy(state, s->block_state, sizeof(s->block_state)); for(mb_y= 0; mb_y<s->b_height; mb_y++) for(mb_x= 0; mb_x<s->b_width; mb_x++) encode_q_branch(s, 0, mb_x, mb_y); s->c = r; memcpy(s->block_state, state, sizeof(s->block_state)); } for(pass=0; pass<25; pass++){ int change= 0; for(mb_y= 0; mb_y<b_height; mb_y++){ for(mb_x= 0; mb_x<b_width; mb_x++){ int dia_change, i, j, ref; int best_rd= INT_MAX, ref_rd; BlockNode backup, ref_b; const int index= mb_x + mb_y * b_stride; BlockNode *block= &s->block[index]; BlockNode *tb = mb_y ? &s->block[index-b_stride ] : NULL; BlockNode *lb = mb_x ? &s->block[index -1] : NULL; BlockNode *rb = mb_x+1<b_width ? &s->block[index +1] : NULL; BlockNode *bb = mb_y+1<b_height ? &s->block[index+b_stride ] : NULL; BlockNode *tlb= mb_x && mb_y ? &s->block[index-b_stride-1] : NULL; BlockNode *trb= mb_x+1<b_width && mb_y ? &s->block[index-b_stride+1] : NULL; BlockNode *blb= mb_x && mb_y+1<b_height ? &s->block[index+b_stride-1] : NULL; BlockNode *brb= mb_x+1<b_width && mb_y+1<b_height ? &s->block[index+b_stride+1] : NULL; const int b_w= (MB_SIZE >> s->block_max_depth); uint8_t obmc_edged[b_w*2][b_w*2]; if(pass && (block->type & BLOCK_OPT)) continue; block->type |= BLOCK_OPT; backup= *block; if(!s->me_cache_generation) memset(s->me_cache, 0, sizeof(s->me_cache)); s->me_cache_generation += 1<<22; { int x, y; memcpy(obmc_edged, obmc_tab[s->block_max_depth], b_w*b_w*4); if(mb_x==0) for(y=0; y<b_w*2; y++) memset(obmc_edged[y], obmc_edged[y][0] + obmc_edged[y][b_w-1], b_w); if(mb_x==b_stride-1) for(y=0; y<b_w*2; y++) memset(obmc_edged[y]+b_w, obmc_edged[y][b_w] + obmc_edged[y][b_w*2-1], b_w); if(mb_y==0){ for(x=0; x<b_w*2; x++) obmc_edged[0][x] += obmc_edged[b_w-1][x]; for(y=1; y<b_w; y++) memcpy(obmc_edged[y], obmc_edged[0], b_w*2); } if(mb_y==b_height-1){ for(x=0; x<b_w*2; x++) obmc_edged[b_w*2-1][x] += obmc_edged[b_w][x]; for(y=b_w; y<b_w*2-1; y++) memcpy(obmc_edged[y], obmc_edged[b_w*2-1], b_w*2); } } if(mb_x==0 || mb_y==0 || mb_x==b_width-1 || mb_y==b_height-1){ uint8_t *src= s-> input_picture.data[0]; uint8_t *dst= s->current_picture.data[0]; const int stride= s->current_picture.linesize[0]; const int block_w= MB_SIZE >> s->block_max_depth; const int sx= block_w*mb_x - block_w/2; const int sy= block_w*mb_y - block_w/2; const int w= s->plane[0].width; const int h= s->plane[0].height; int y; for(y=sy; y<0; y++) memcpy(dst + sx + y*stride, src + sx + y*stride, block_w*2); for(y=h; y<sy+block_w*2; y++) memcpy(dst + sx + y*stride, src + sx + y*stride, block_w*2); if(sx<0){ for(y=sy; y<sy+block_w*2; y++) memcpy(dst + sx + y*stride, src + sx + y*stride, -sx); } if(sx+block_w*2 > w){ for(y=sy; y<sy+block_w*2; y++) memcpy(dst + w + y*stride, src + w + y*stride, sx+block_w*2 - w); } } for(i=0; i<3; i++) color[i]= get_dc(s, mb_x, mb_y, i); if(pass > 0 && (block->type&BLOCK_INTRA)){ int color0[3]= {block->color[0], block->color[1], block->color[2]}; check_block(s, mb_x, mb_y, color0, 1, *obmc_edged, &best_rd); }else check_block_inter(s, mb_x, mb_y, block->mx, block->my, *obmc_edged, &best_rd); ref_b= *block; ref_rd= best_rd; for(ref=0; ref < s->ref_frames; ref++){ int16_t (*mvr)[2]= &s->ref_mvs[ref][index]; if(s->ref_scores[ref][index] > s->ref_scores[ref_b.ref][index]*3/2) continue; block->ref= ref; best_rd= INT_MAX; check_block_inter(s, mb_x, mb_y, mvr[0][0], mvr[0][1], *obmc_edged, &best_rd); check_block_inter(s, mb_x, mb_y, 0, 0, *obmc_edged, &best_rd); if(tb) check_block_inter(s, mb_x, mb_y, mvr[-b_stride][0], mvr[-b_stride][1], *obmc_edged, &best_rd); if(lb) check_block_inter(s, mb_x, mb_y, mvr[-1][0], mvr[-1][1], *obmc_edged, &best_rd); if(rb) check_block_inter(s, mb_x, mb_y, mvr[1][0], mvr[1][1], *obmc_edged, &best_rd); if(bb) check_block_inter(s, mb_x, mb_y, mvr[b_stride][0], mvr[b_stride][1], *obmc_edged, &best_rd); do{ dia_change=0; for(i=0; i<FFMAX(s->avctx->dia_size, 1); i++){ for(j=0; j<i; j++){ dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my+(4*j), *obmc_edged, &best_rd); dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my-(4*j), *obmc_edged, &best_rd); dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+4*(i-j), block->my-(4*j), *obmc_edged, &best_rd); dia_change |= check_block_inter(s, mb_x, mb_y, block->mx-4*(i-j), block->my+(4*j), *obmc_edged, &best_rd); } } }while(dia_change); do{ static const int square[8][2]= {{+1, 0},{-1, 0},{ 0,+1},{ 0,-1},{+1,+1},{-1,-1},{+1,-1},{-1,+1},}; dia_change=0; for(i=0; i<8; i++) dia_change |= check_block_inter(s, mb_x, mb_y, block->mx+square[i][0], block->my+square[i][1], *obmc_edged, &best_rd); }while(dia_change); mvr[0][0]= block->mx; mvr[0][1]= block->my; if(ref_rd > best_rd){ ref_rd= best_rd; ref_b= *block; } } best_rd= ref_rd; *block= ref_b; #if 1 check_block(s, mb_x, mb_y, color, 1, *obmc_edged, &best_rd); #endif if(!same_block(block, &backup)){ if(tb ) tb ->type &= ~BLOCK_OPT; if(lb ) lb ->type &= ~BLOCK_OPT; if(rb ) rb ->type &= ~BLOCK_OPT; if(bb ) bb ->type &= ~BLOCK_OPT; if(tlb) tlb->type &= ~BLOCK_OPT; if(trb) trb->type &= ~BLOCK_OPT; if(blb) blb->type &= ~BLOCK_OPT; if(brb) brb->type &= ~BLOCK_OPT; change ++; } } } av_log(NULL, AV_LOG_ERROR, "pass:%d changed:%d\n", pass, change); if(!change) break; } if(s->block_max_depth == 1){ int change= 0; for(mb_y= 0; mb_y<b_height; mb_y+=2){ for(mb_x= 0; mb_x<b_width; mb_x+=2){ int i; int best_rd, init_rd; const int index= mb_x + mb_y * b_stride; BlockNode *b[4]; b[0]= &s->block[index]; b[1]= b[0]+1; b[2]= b[0]+b_stride; b[3]= b[2]+1; if(same_block(b[0], b[1]) && same_block(b[0], b[2]) && same_block(b[0], b[3])) continue; if(!s->me_cache_generation) memset(s->me_cache, 0, sizeof(s->me_cache)); s->me_cache_generation += 1<<22; init_rd= best_rd= get_4block_rd(s, mb_x, mb_y, 0); check_4block_inter(s, mb_x, mb_y, (b[0]->mx + b[1]->mx + b[2]->mx + b[3]->mx + 2) >> 2, (b[0]->my + b[1]->my + b[2]->my + b[3]->my + 2) >> 2, 0, &best_rd); for(i=0; i<4; i++) if(!(b[i]->type&BLOCK_INTRA)) check_4block_inter(s, mb_x, mb_y, b[i]->mx, b[i]->my, b[i]->ref, &best_rd); if(init_rd != best_rd) change++; } } av_log(NULL, AV_LOG_ERROR, "pass:4mv changed:%d\n", change*4); } } libavcodec/snow.c:3071: error: Buffer Overrun L3 Offset added: 4096 Size: [0, +oo]. libavcodec/snow.c:3025:1: <Length trace> 3023. } 3024. 3025. static void iterative_me(SnowContext *s){ ^ 3026. int pass, mb_x, mb_y; 3027. const int b_width = s->b_width << s->block_max_depth; libavcodec/snow.c:3025:1: Parameter `s->me_cache[*]` 3023. } 3024. 3025. static void iterative_me(SnowContext *s){ ^ 3026. int pass, mb_x, mb_y; 3027. const int b_width = s->b_width << s->block_max_depth; libavcodec/snow.c:3071:21: Array access: Offset added: 4096 Size: [0, +oo] 3069. 3070. if(!s->me_cache_generation) 3071. memset(s->me_cache, 0, sizeof(s->me_cache)); ^ 3072. s->me_cache_generation += 1<<22; 3073.
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/snow.c/#L3071
d2a_code_trace_data_43844
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) { BN_ULONG *a = NULL; if (words > (INT_MAX / (4 * BN_BITS2))) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG); return NULL; } if (BN_get_flags(b, BN_FLG_STATIC_DATA)) { BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); return NULL; } if (BN_get_flags(b, BN_FLG_SECURE)) a = OPENSSL_secure_zalloc(words * sizeof(*a)); else a = OPENSSL_zalloc(words * sizeof(*a)); if (a == NULL) { BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); return NULL; } assert(b->top <= words); if (b->top > 0) memcpy(a, b->d, sizeof(*a) * b->top); return a; } crypto/bn/bn_prime.c:531: error: BUFFER_OVERRUN_L3 Offset added: [8, +oo] Size: [0, +oo] by call to `BN_div`. Showing all 27 steps of the trace crypto/bn/bn_prime.c:518:10: Call 516. bits--; 517. BN_CTX_start(ctx); 518. t1 = BN_CTX_get(ctx); ^ 519. q = BN_CTX_get(ctx); 520. qadd = BN_CTX_get(ctx); crypto/bn/bn_ctx.c:240:5: Call 238. } 239. /* OK, make sure the returned bignum is "zero" */ 240. BN_zero(ret); ^ 241. /* clear BN_FLG_CONSTTIME if leaked from previous frames */ 242. ret->flags &= (~BN_FLG_CONSTTIME); crypto/bn/bn_lib.c:361:1: Parameter `*a->d` 359. } 360. 361. > int BN_set_word(BIGNUM *a, BN_ULONG w) 362. { 363. bn_check_top(a); crypto/bn/bn_lib.c:364:9: Call 362. { 363. bn_check_top(a); 364. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL) ^ 365. return 0; 366. a->neg = 0; crypto/bn/bn_lcl.h:660:1: Parameter `*a->d` 658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx); 659. 660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits) 661. { 662. if (bits > (INT_MAX - BN_BITS2 + 1)) crypto/bn/bn_prime.c:527:10: Call 525. goto err; 526. 527. if (!BN_rand(q, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) ^ 528. goto err; 529. crypto/bn/bn_rand.c:106:1: Parameter `*rnd->d` 104. return bnrand(NORMAL, rnd, bits, top, bottom, ctx); 105. } 106. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL); crypto/bn/bn_rand.c:108:12: Call 106. int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) 107. { 108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL); ^ 109. } 110. crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d` 21. } BNRAND_FLAG; 22. 23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom, 24. BN_CTX *ctx) 25. { crypto/bn/bn_rand.c:89:10: Call 87. if (bottom) /* set bottom bit if requested */ 88. buf[bytes - 1] |= 1; 89. if (!BN_bin2bn(buf, bytes, rnd)) ^ 90. goto err; 91. ret = 1; crypto/bn/bn_lib.c:374:1: Parameter `*ret->d` 372. } 373. 374. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret) 375. { 376. unsigned int i, m; crypto/bn/bn_lib.c:396:9: Call 394. i = ((n - 1) / BN_BYTES) + 1; 395. m = ((n - 1) % (BN_BYTES)); 396. if (bn_wexpand(ret, (int)i) == NULL) { ^ 397. BN_free(bn); 398. return NULL; crypto/bn/bn_lib.c:962:1: Parameter `*a->d` 960. } 961. 962. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_prime.c:531:10: Call 529. 530. /* we need ((rnd-rem) % add) == 0 */ 531. if (!BN_mod(t1, q, qadd, ctx)) ^ 532. goto err; 533. if (!BN_sub(q, q, t1)) crypto/bn/bn_div.c:209:1: Parameter `*dv->d` 207. * If 'dv' or 'rm' is NULL, the respective value is not returned. 208. */ 209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, 210. BN_CTX *ctx) 211. { crypto/bn/bn_div.c:229:11: Call 227. } 228. 229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); ^ 230. 231. if (ret) { crypto/bn/bn_div.c:264:1: Parameter `*dv->d` 262. * divisor's length is considered public; 263. */ 264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, 265. const BIGNUM *divisor, BN_CTX *ctx) 266. { crypto/bn/bn_div.c:327:10: Call 325. 326. /* Setup quotient */ 327. if (!bn_wexpand(res, loop)) ^ 328. goto err; 329. res->neg = (num->neg ^ divisor->neg); crypto/bn/bn_lib.c:962:1: Parameter `*a->d` 960. } 961. 962. > BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); crypto/bn/bn_lib.c:964:37: Call 962. BIGNUM *bn_wexpand(BIGNUM *a, int words) 963. { 964. return (words <= a->dmax) ? a : bn_expand2(a, words); ^ 965. } 966. crypto/bn/bn_lib.c:245:1: Parameter `*b->d` 243. */ 244. 245. > BIGNUM *bn_expand2(BIGNUM *b, int words) 246. { 247. if (words > b->dmax) { crypto/bn/bn_lib.c:248:23: Call 246. { 247. if (words > b->dmax) { 248. BN_ULONG *a = bn_expand_internal(b, words); ^ 249. if (!a) 250. return NULL; crypto/bn/bn_lib.c:209:1: <Offset trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `b->top` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: <Length trace> 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:209:1: Parameter `*b->d` 207. /* This is used by bn_expand2() */ 208. /* The caller MUST check that words > b->dmax before calling this */ 209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) 210. { 211. BN_ULONG *a = NULL; crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, +oo] by call to `BN_div` 230. assert(b->top <= words); 231. if (b->top > 0) 232. memcpy(a, b->d, sizeof(*a) * b->top); ^ 233. 234. return a;
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L232
d2a_code_trace_data_43845
u_char * ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) { u_char *p, zero; int d; double f; size_t len, slen; int64_t i64; uint64_t ui64, frac; ngx_msec_t ms; ngx_uint_t width, sign, hex, max_width, frac_width, scale, n; ngx_str_t *v; ngx_variable_value_t *vv; while (*fmt && buf < last) { if (*fmt == '%') { i64 = 0; ui64 = 0; zero = (u_char) ((*++fmt == '0') ? '0' : ' '); width = 0; sign = 1; hex = 0; max_width = 0; frac_width = 0; slen = (size_t) -1; while (*fmt >= '0' && *fmt <= '9') { width = width * 10 + *fmt++ - '0'; } for ( ;; ) { switch (*fmt) { case 'u': sign = 0; fmt++; continue; case 'm': max_width = 1; fmt++; continue; case 'X': hex = 2; sign = 0; fmt++; continue; case 'x': hex = 1; sign = 0; fmt++; continue; case '.': fmt++; while (*fmt >= '0' && *fmt <= '9') { frac_width = frac_width * 10 + *fmt++ - '0'; } break; case '*': slen = va_arg(args, size_t); fmt++; continue; default: break; } break; } switch (*fmt) { case 'V': v = va_arg(args, ngx_str_t *); len = ngx_min(((size_t) (last - buf)), v->len); buf = ngx_cpymem(buf, v->data, len); fmt++; continue; case 'v': vv = va_arg(args, ngx_variable_value_t *); len = ngx_min(((size_t) (last - buf)), vv->len); buf = ngx_cpymem(buf, vv->data, len); fmt++; continue; case 's': p = va_arg(args, u_char *); if (slen == (size_t) -1) { while (*p && buf < last) { *buf++ = *p++; } } else { len = ngx_min(((size_t) (last - buf)), slen); buf = ngx_cpymem(buf, p, len); } fmt++; continue; case 'O': i64 = (int64_t) va_arg(args, off_t); sign = 1; break; case 'P': i64 = (int64_t) va_arg(args, ngx_pid_t); sign = 1; break; case 'T': i64 = (int64_t) va_arg(args, time_t); sign = 1; break; case 'M': ms = (ngx_msec_t) va_arg(args, ngx_msec_t); if ((ngx_msec_int_t) ms == -1) { sign = 1; i64 = -1; } else { sign = 0; ui64 = (uint64_t) ms; } break; case 'z': if (sign) { i64 = (int64_t) va_arg(args, ssize_t); } else { ui64 = (uint64_t) va_arg(args, size_t); } break; case 'i': if (sign) { i64 = (int64_t) va_arg(args, ngx_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_uint_t); } if (max_width) { width = NGX_INT_T_LEN; } break; case 'd': if (sign) { i64 = (int64_t) va_arg(args, int); } else { ui64 = (uint64_t) va_arg(args, u_int); } break; case 'l': if (sign) { i64 = (int64_t) va_arg(args, long); } else { ui64 = (uint64_t) va_arg(args, u_long); } break; case 'D': if (sign) { i64 = (int64_t) va_arg(args, int32_t); } else { ui64 = (uint64_t) va_arg(args, uint32_t); } break; case 'L': if (sign) { i64 = va_arg(args, int64_t); } else { ui64 = va_arg(args, uint64_t); } break; case 'A': if (sign) { i64 = (int64_t) va_arg(args, ngx_atomic_int_t); } else { ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t); } if (max_width) { width = NGX_ATOMIC_T_LEN; } break; case 'f': f = va_arg(args, double); if (f < 0) { *buf++ = '-'; f = -f; } ui64 = (int64_t) f; frac = 0; if (frac_width) { scale = 1; for (n = frac_width; n; n--) { scale *= 10; } frac = (uint64_t) ((f - (double) ui64) * scale + 0.5); if (frac == scale) { ui64++; frac = 0; } } buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width); if (frac_width) { if (buf < last) { *buf++ = '.'; } buf = ngx_sprintf_num(buf, last, frac, '0', 0, frac_width); } fmt++; continue; #if !(NGX_WIN32) case 'r': i64 = (int64_t) va_arg(args, rlim_t); sign = 1; break; #endif case 'p': ui64 = (uintptr_t) va_arg(args, void *); hex = 2; sign = 0; zero = '0'; width = NGX_PTR_SIZE * 2; break; case 'c': d = va_arg(args, int); *buf++ = (u_char) (d & 0xff); fmt++; continue; case 'Z': *buf++ = '\0'; fmt++; continue; case 'N': #if (NGX_WIN32) *buf++ = CR; #endif *buf++ = LF; fmt++; continue; case '%': *buf++ = '%'; fmt++; continue; default: *buf++ = *fmt++; continue; } if (sign) { if (i64 < 0) { *buf++ = '-'; ui64 = (uint64_t) -i64; } else { ui64 = (uint64_t) i64; } } buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width); fmt++; } else { *buf++ = *fmt++; } } return buf; } src/http/modules/ngx_http_fastcgi_module.c:2038: error: Buffer Overrun L3 Offset: [-10, +oo] Size: 2048 by call to `ngx_log_error_core`. src/http/modules/ngx_http_fastcgi_module.c:2025:21: Assignment 2023. f->pos += f->length; 2024. f->length = 0; 2025. f->state = ngx_http_fastcgi_st_padding; ^ 2026. 2027. } else { src/http/modules/ngx_http_fastcgi_module.c:2038:17: Call 2036. } 2037. 2038. ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ^ 2039. "FastCGI sent in stderr: \"%*s\"", 2040. m + 1 - msg, msg); src/core/ngx_log.c:78:1: Global `err_levels.len` 76. #if (NGX_HAVE_VARIADIC_MACROS) 77. 78. void ^ 79. ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, 80. const char *fmt, ...) src/core/ngx_log.c:167:5: Assignment 165. } 166. 167. msg -= (7 + err_levels[level].len + 3); ^ 168. 169. (void) ngx_sprintf(msg, "nginx: [%V] ", &err_levels[level]); src/core/ngx_log.c:169:12: Call 167. msg -= (7 + err_levels[level].len + 3); 168. 169. (void) ngx_sprintf(msg, "nginx: [%V] ", &err_levels[level]); ^ 170. 171. (void) ngx_write_console(ngx_stderr, msg, p - msg); src/core/ngx_string.c:102:1: Parameter `*buf` 100. 101. 102. u_char * ngx_cdecl ^ 103. ngx_sprintf(u_char *buf, const char *fmt, ...) 104. { src/core/ngx_string.c:109:9: Call 107. 108. va_start(args, fmt); 109. p = ngx_vslprintf(buf, (void *) -1, fmt, args); ^ 110. va_end(args); 111. src/core/ngx_string.c:144:1: <Length trace> 142. 143. 144. u_char * ^ 145. ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) 146. { src/core/ngx_string.c:144:1: Parameter `*buf` 142. 143. 144. u_char * ^ 145. ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) 146. { src/core/ngx_string.c:363:21: Array access: Offset: [-10, +oo] Size: 2048 by call to `ngx_log_error_core` 361. 362. if (f < 0) { 363. *buf++ = '-'; ^ 364. f = -f; 365. }
https://github.com/nginx/nginx/blob/f86169ae7bbb30d0955be03a0adad1d1cd73a046/src/core/ngx_string.c/#L363
d2a_code_trace_data_43846
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:3758: error: INTEGER_OVERFLOW_L2 ([0, +oo] - [`pkt->written`, `pkt->written` + 16]):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:3758:17: Call 3756. if (s->version >= TLS1_VERSION 3757. && !(alg_a & SSL_aECDSA) 3758. && !WPACKET_put_bytes_u8(pkt, TLS_CT_ECDSA_SIGN)) ^ 3759. return 0; 3760. #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 + 16]):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_43847
static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) { int i; LHASH_NODE *a,*n; if (lh == NULL) return; for (i=lh->num_nodes-1; i>=0; i--) { a=lh->b[i]; while (a != NULL) { n=a->next; if(use_arg) func_arg(a->data,arg); else func(a->data); a=n; } } } ssl/ssl_lib.c:2473: error: INTEGER_OVERFLOW_L2 ([0, 1+max(0, `s->initial_ctx->sessions->num_nodes`)] - 1):unsigned32 by call to `SSL_CTX_flush_sessions`. Showing all 9 steps of the trace ssl/ssl_lib.c:2446:1: Parameter `s->initial_ctx->sessions->num_nodes` 2444. #endif 2445. 2446. > void ssl_update_cache(SSL *s,int mode) 2447. { 2448. int i; ssl/ssl_lib.c:2473:4: Call 2471. :s->session_ctx->stats.sess_accept_good) & 0xff) == 0xff) 2472. { 2473. SSL_CTX_flush_sessions(s->session_ctx,(unsigned long)time(NULL)); ^ 2474. } 2475. } ssl/ssl_sess.c:970:1: Parameter `s->sessions->num_nodes` 968. static IMPLEMENT_LHASH_DOALL_ARG_FN(timeout, SSL_SESSION, TIMEOUT_PARAM) 969. 970. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t) 971. { 972. unsigned long i; ssl/ssl_sess.c:982:2: Call 980. i=CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load; 981. CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=0; 982. lh_SSL_SESSION_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), ^ 983. TIMEOUT_PARAM, &tp); 984. CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=i; crypto/lhash/lhash.c:305:1: Parameter `lh->num_nodes` 303. } 304. 305. > void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 306. { 307. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); crypto/lhash/lhash.c:307:2: Call 305. void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg) 306. { 307. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg); ^ 308. } 309. crypto/lhash/lhash.c:270:1: <LHS trace> 268. } 269. 270. > static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:270:1: Parameter `lh->num_nodes` 268. } 269. 270. > static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg) 272. { crypto/lhash/lhash.c:281:7: Binary operation: ([0, 1+max(0, s->initial_ctx->sessions->num_nodes)] - 1):unsigned32 by call to `SSL_CTX_flush_sessions` 279. /* reverse the order so we search from 'top to bottom' 280. * We were having memory leaks otherwise */ 281. for (i=lh->num_nodes-1; i>=0; i--) ^ 282. { 283. a=lh->b[i];
https://github.com/openssl/openssl/blob/7a71af86ce75751f3cb2e9e9e3f2e0715b39b101/crypto/lhash/lhash.c/#L281
d2a_code_trace_data_43848
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:1063: error: Uninitialized Value The value read from xmax was never initialized. libavcodec/motion_est_template.c:1063:9: 1061. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, 1062. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) 1063. CHECK_MV(P_LEFT[0] >>shift, P_LEFT[1] >>shift) ^ 1064. CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift) 1065. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1063
d2a_code_trace_data_43849
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) { if (!ossl_assert(pkt->subs != NULL && len != 0)) return 0; if (pkt->maxsize - pkt->written < len) return 0; if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { size_t newlen; size_t reflen; reflen = (len > pkt->buf->length) ? len : pkt->buf->length; if (reflen > SIZE_MAX / 2) { newlen = SIZE_MAX; } else { newlen = reflen * 2; if (newlen < DEFAULT_BUF_SIZE) newlen = DEFAULT_BUF_SIZE; } if (BUF_MEM_grow(pkt->buf, newlen) == 0) return 0; } if (allocbytes != NULL) *allocbytes = WPACKET_get_curr(pkt); return 1; } ssl/statem/extensions_srvr.c:949: 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/statem/extensions_srvr.c:948:10: Call 946. } 947. 948. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_session_ticket) ^ 949. || !WPACKET_put_bytes_u16(pkt, 0)) { 950. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_SESSION_TICKET, ERR_R_INTERNAL_ERROR); ssl/packet.c:306:1: Parameter `pkt->buf->length` 304. } 305. 306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 307. { 308. unsigned char *data; ssl/statem/extensions_srvr.c:949:17: Call 947. 948. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_session_ticket) 949. || !WPACKET_put_bytes_u16(pkt, 0)) { ^ 950. SSLerr(SSL_F_TLS_CONSTRUCT_STOC_SESSION_TICKET, ERR_R_INTERNAL_ERROR); 951. return EXT_RETURN_FAIL; ssl/packet.c:306:1: Parameter `pkt->written` 304. } 305. 306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size) 307. { 308. unsigned char *data; ssl/packet.c:312:17: Call 310. /* Internal API, so should not fail */ 311. if (!ossl_assert(size <= sizeof(unsigned int)) 312. || !WPACKET_allocate_bytes(pkt, size, &data) ^ 313. || !put_value(data, val, size)) 314. return 0; ssl/packet.c:15:1: Parameter `pkt->written` 13. #define DEFAULT_BUF_SIZE 256 14. 15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ssl/packet.c:17:10: Call 15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 16. { 17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes)) ^ 18. return 0; 19. ssl/packet.c:39:1: <LHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `pkt->buf->length` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: <RHS trace> 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:39:1: Parameter `len` 37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data) 38. 39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes) 40. { 41. /* Internal API, so should not fail */ ssl/packet.c:48:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 4]):unsigned64 by call to `WPACKET_put_bytes__` 46. return 0; 47. 48. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) { ^ 49. size_t newlen; 50. size_t reflen;
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/ssl/packet.c/#L48
d2a_code_trace_data_43850
static int test_modexp_mont5(void) { BIGNUM *a = NULL, *p = NULL, *m = NULL, *d = NULL, *e = NULL; BIGNUM *b = NULL, *n = NULL, *c = NULL; BN_MONT_CTX *mont = NULL; int st = 0; if (!TEST_ptr(a = BN_new()) || !TEST_ptr(p = BN_new()) || !TEST_ptr(m = BN_new()) || !TEST_ptr(d = BN_new()) || !TEST_ptr(e = BN_new()) || !TEST_ptr(b = BN_new()) || !TEST_ptr(n = BN_new()) || !TEST_ptr(c = BN_new()) || !TEST_ptr(mont = BN_MONT_CTX_new())) goto err; BN_bntest_rand(m, 1024, 0, 1); BN_bntest_rand(a, 1024, 0, 0); BN_zero(p); if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) goto err; if (!TEST_BN_eq_one(d)) goto err; BN_hex2bn(&a, "7878787878787878787878787878787878787878787878787878787878787878" "7878787878787878787878787878787878787878787878787878787878787878" "7878787878787878787878787878787878787878787878787878787878787878" "7878787878787878787878787878787878787878787878787878787878787878"); BN_hex2bn(&b, "095D72C08C097BA488C5E439C655A192EAFB6380073D8C2664668EDDB4060744" "E16E57FB4EDB9AE10A0CEFCDC28A894F689A128379DB279D48A2E20849D68593" "9B7803BCF46CEBF5C533FB0DD35B080593DE5472E3FE5DB951B8BFF9B4CB8F03" "9CC638A5EE8CDD703719F8000E6A9F63BEED5F2FCD52FF293EA05A251BB4AB81"); BN_hex2bn(&n, "D78AF684E71DB0C39CFF4E64FB9DB567132CB9C50CC98009FEB820B26F2DED9B" "91B9B5E2B83AE0AE4EB4E0523CA726BFBE969B89FD754F674CE99118C3F2D1C5" "D81FDC7C54E02B60262B241D53C040E99E45826ECA37A804668E690E1AFC1CA4" "2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF"); BN_MONT_CTX_set(mont, n, ctx); BN_mod_mul_montgomery(c, a, b, mont, ctx); BN_mod_mul_montgomery(d, b, a, mont, ctx); if (!TEST_BN_eq(c, d)) goto err; parse_bigBN(&n, bn1strings); parse_bigBN(&a, bn2strings); BN_free(b); b = BN_dup(a); BN_MONT_CTX_set(mont, n, ctx); BN_mod_mul_montgomery(c, a, a, mont, ctx); BN_mod_mul_montgomery(d, a, b, mont, ctx); if (!TEST_BN_eq(c, d)) goto err; { static const char *ahex[] = { "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FFEADBCFC4DAE7FFF908E92820306B", "9544D954000000006C0000000000000000000000000000000000000000000000", "00000000000000000000FF030202FFFFF8FFEBDBCFC4DAE7FFF908E92820306B", "9544D954000000006C000000FF0302030000000000FFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01FC00FF02FFFFFFFF", "00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FCFD", "FCFFFFFFFFFF000000000000000000FF0302030000000000FFFFFFFFFFFFFFFF", "FF00FCFDFDFF030202FF00000000FFFFFFFFFFFFFFFFFF00FCFDFCFFFFFFFFFF", NULL }; static const char *nhex[] = { "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8F8F8F8000000", "00000010000000006C0000000000000000000000000000000000000000000000", "00000000000000000000000000000000000000FFFFFFFFFFFFF8F8F8F8000000", "00000010000000006C000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", NULL }; parse_bigBN(&a, ahex); parse_bigBN(&n, nhex); } BN_free(b); b = BN_dup(a); BN_MONT_CTX_set(mont, n, ctx); BN_mod_mul_montgomery(c, a, a, mont, ctx); BN_mod_mul_montgomery(d, a, b, mont, ctx); if (!TEST_BN_eq(c, d)) goto err; BN_hex2bn(&a, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020DF"); BN_hex2bn(&b, "2020202020202020202020202020202020202020202020202020202020202020" "2020202020202020202020202020202020202020202020202020202020202020" "20202020202020FF202020202020202020202020202020202020202020202020" "2020202020202020202020202020202020202020202020202020202020202020"); BN_hex2bn(&n, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020FF"); BN_MONT_CTX_set(mont, n, ctx); BN_mod_exp_mont_consttime(c, a, b, n, ctx, mont); BN_mod_exp_mont(d, a, b, n, ctx, mont); if (!TEST_BN_eq(c, d)) goto err; BN_bntest_rand(p, 1024, 0, 0); BN_zero(a); if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) || !TEST_BN_eq_zero(d)) goto err; BN_one(a); BN_MONT_CTX_set(mont, m, ctx); if (!TEST_true(BN_from_montgomery(e, a, mont, ctx)) || !TEST_true(BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL)) || !TEST_true(BN_mod_exp_simple(a, e, p, m, ctx)) || !TEST_BN_eq(a, d)) goto err; BN_bntest_rand(e, 1024, 0, 0); if (!TEST_true(BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL)) || !TEST_true(BN_mod_exp_simple(a, e, p, m, ctx)) || !TEST_BN_eq(a, d)) goto err; st = 1; err: BN_MONT_CTX_free(mont); BN_free(a); BN_free(p); BN_free(m); BN_free(d); BN_free(e); BN_free(b); BN_free(n); BN_free(c); return st; } test/bntest.c:468: error: MEMORY_LEAK memory dynamically allocated by call to `BN_MONT_CTX_new()` at line 327, column 17 is not reachable after line 468, column 5. Showing all 135 steps of the trace test/bntest.c:312:1: start of procedure test_modexp_mont5() 310. * x86_64 cause a different code branch to be taken. 311. */ 312. > static int test_modexp_mont5(void) 313. { 314. BIGNUM *a = NULL, *p = NULL, *m = NULL, *d = NULL, *e = NULL; test/bntest.c:314:5: 312. static int test_modexp_mont5(void) 313. { 314. > BIGNUM *a = NULL, *p = NULL, *m = NULL, *d = NULL, *e = NULL; 315. BIGNUM *b = NULL, *n = NULL, *c = NULL; 316. BN_MONT_CTX *mont = NULL; test/bntest.c:315:5: 313. { 314. BIGNUM *a = NULL, *p = NULL, *m = NULL, *d = NULL, *e = NULL; 315. > BIGNUM *b = NULL, *n = NULL, *c = NULL; 316. BN_MONT_CTX *mont = NULL; 317. int st = 0; test/bntest.c:316:5: 314. BIGNUM *a = NULL, *p = NULL, *m = NULL, *d = NULL, *e = NULL; 315. BIGNUM *b = NULL, *n = NULL, *c = NULL; 316. > BN_MONT_CTX *mont = NULL; 317. int st = 0; 318. test/bntest.c:317:5: 315. BIGNUM *b = NULL, *n = NULL, *c = NULL; 316. BN_MONT_CTX *mont = NULL; 317. > int st = 0; 318. 319. if (!TEST_ptr(a = BN_new()) test/bntest.c:319:10: Skipping BN_new(): empty list of specs 317. int st = 0; 318. 319. if (!TEST_ptr(a = BN_new()) ^ 320. || !TEST_ptr(p = BN_new()) 321. || !TEST_ptr(m = BN_new()) test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:319:10: Taking false branch 317. int st = 0; 318. 319. if (!TEST_ptr(a = BN_new()) ^ 320. || !TEST_ptr(p = BN_new()) 321. || !TEST_ptr(m = BN_new()) test/bntest.c:320:17: Skipping BN_new(): empty list of specs 318. 319. if (!TEST_ptr(a = BN_new()) 320. || !TEST_ptr(p = BN_new()) ^ 321. || !TEST_ptr(m = BN_new()) 322. || !TEST_ptr(d = BN_new()) test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:320:17: Taking false branch 318. 319. if (!TEST_ptr(a = BN_new()) 320. || !TEST_ptr(p = BN_new()) ^ 321. || !TEST_ptr(m = BN_new()) 322. || !TEST_ptr(d = BN_new()) test/bntest.c:321:17: Skipping BN_new(): empty list of specs 319. if (!TEST_ptr(a = BN_new()) 320. || !TEST_ptr(p = BN_new()) 321. || !TEST_ptr(m = BN_new()) ^ 322. || !TEST_ptr(d = BN_new()) 323. || !TEST_ptr(e = BN_new()) test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:321:17: Taking false branch 319. if (!TEST_ptr(a = BN_new()) 320. || !TEST_ptr(p = BN_new()) 321. || !TEST_ptr(m = BN_new()) ^ 322. || !TEST_ptr(d = BN_new()) 323. || !TEST_ptr(e = BN_new()) test/bntest.c:322:17: Skipping BN_new(): empty list of specs 320. || !TEST_ptr(p = BN_new()) 321. || !TEST_ptr(m = BN_new()) 322. || !TEST_ptr(d = BN_new()) ^ 323. || !TEST_ptr(e = BN_new()) 324. || !TEST_ptr(b = BN_new()) test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:322:17: Taking false branch 320. || !TEST_ptr(p = BN_new()) 321. || !TEST_ptr(m = BN_new()) 322. || !TEST_ptr(d = BN_new()) ^ 323. || !TEST_ptr(e = BN_new()) 324. || !TEST_ptr(b = BN_new()) test/bntest.c:323:17: Skipping BN_new(): empty list of specs 321. || !TEST_ptr(m = BN_new()) 322. || !TEST_ptr(d = BN_new()) 323. || !TEST_ptr(e = BN_new()) ^ 324. || !TEST_ptr(b = BN_new()) 325. || !TEST_ptr(n = BN_new()) test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:323:17: Taking false branch 321. || !TEST_ptr(m = BN_new()) 322. || !TEST_ptr(d = BN_new()) 323. || !TEST_ptr(e = BN_new()) ^ 324. || !TEST_ptr(b = BN_new()) 325. || !TEST_ptr(n = BN_new()) test/bntest.c:324:17: Skipping BN_new(): empty list of specs 322. || !TEST_ptr(d = BN_new()) 323. || !TEST_ptr(e = BN_new()) 324. || !TEST_ptr(b = BN_new()) ^ 325. || !TEST_ptr(n = BN_new()) 326. || !TEST_ptr(c = BN_new()) test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:324:17: Taking false branch 322. || !TEST_ptr(d = BN_new()) 323. || !TEST_ptr(e = BN_new()) 324. || !TEST_ptr(b = BN_new()) ^ 325. || !TEST_ptr(n = BN_new()) 326. || !TEST_ptr(c = BN_new()) test/bntest.c:325:17: Skipping BN_new(): empty list of specs 323. || !TEST_ptr(e = BN_new()) 324. || !TEST_ptr(b = BN_new()) 325. || !TEST_ptr(n = BN_new()) ^ 326. || !TEST_ptr(c = BN_new()) 327. || !TEST_ptr(mont = BN_MONT_CTX_new())) test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:325:17: Taking false branch 323. || !TEST_ptr(e = BN_new()) 324. || !TEST_ptr(b = BN_new()) 325. || !TEST_ptr(n = BN_new()) ^ 326. || !TEST_ptr(c = BN_new()) 327. || !TEST_ptr(mont = BN_MONT_CTX_new())) test/bntest.c:326:17: Skipping BN_new(): empty list of specs 324. || !TEST_ptr(b = BN_new()) 325. || !TEST_ptr(n = BN_new()) 326. || !TEST_ptr(c = BN_new()) ^ 327. || !TEST_ptr(mont = BN_MONT_CTX_new())) 328. goto err; test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:326:17: Taking false branch 324. || !TEST_ptr(b = BN_new()) 325. || !TEST_ptr(n = BN_new()) 326. || !TEST_ptr(c = BN_new()) ^ 327. || !TEST_ptr(mont = BN_MONT_CTX_new())) 328. goto err; test/bntest.c:327:17: 325. || !TEST_ptr(n = BN_new()) 326. || !TEST_ptr(c = BN_new()) 327. > || !TEST_ptr(mont = BN_MONT_CTX_new())) 328. goto err; 329. crypto/bn/bn_mont.c:196:1: start of procedure BN_MONT_CTX_new() 194. } 195. 196. > BN_MONT_CTX *BN_MONT_CTX_new(void) 197. { 198. BN_MONT_CTX *ret; crypto/bn/bn_mont.c:200:9: 198. BN_MONT_CTX *ret; 199. 200. > if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) 201. return NULL; 202. 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/bn/bn_mont.c:200:9: Taking false branch 198. BN_MONT_CTX *ret; 199. 200. if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) ^ 201. return NULL; 202. crypto/bn/bn_mont.c:203:5: 201. return NULL; 202. 203. > BN_MONT_CTX_init(ret); 204. ret->flags = BN_FLG_MALLOCED; 205. return ret; crypto/bn/bn_mont.c:208:1: start of procedure BN_MONT_CTX_init() 206. } 207. 208. > void BN_MONT_CTX_init(BN_MONT_CTX *ctx) 209. { 210. ctx->ri = 0; crypto/bn/bn_mont.c:210:5: 208. void BN_MONT_CTX_init(BN_MONT_CTX *ctx) 209. { 210. > ctx->ri = 0; 211. bn_init(&(ctx->RR)); 212. bn_init(&(ctx->N)); crypto/bn/bn_mont.c:211:5: Skipping bn_init(): empty list of specs 209. { 210. ctx->ri = 0; 211. bn_init(&(ctx->RR)); ^ 212. bn_init(&(ctx->N)); 213. bn_init(&(ctx->Ni)); crypto/bn/bn_mont.c:212:5: Skipping bn_init(): empty list of specs 210. ctx->ri = 0; 211. bn_init(&(ctx->RR)); 212. bn_init(&(ctx->N)); ^ 213. bn_init(&(ctx->Ni)); 214. ctx->n0[0] = ctx->n0[1] = 0; crypto/bn/bn_mont.c:213:5: Skipping bn_init(): empty list of specs 211. bn_init(&(ctx->RR)); 212. bn_init(&(ctx->N)); 213. bn_init(&(ctx->Ni)); ^ 214. ctx->n0[0] = ctx->n0[1] = 0; 215. ctx->flags = 0; crypto/bn/bn_mont.c:214:5: 212. bn_init(&(ctx->N)); 213. bn_init(&(ctx->Ni)); 214. > ctx->n0[0] = ctx->n0[1] = 0; 215. ctx->flags = 0; 216. } crypto/bn/bn_mont.c:215:5: 213. bn_init(&(ctx->Ni)); 214. ctx->n0[0] = ctx->n0[1] = 0; 215. > ctx->flags = 0; 216. } 217. crypto/bn/bn_mont.c:216:1: return from a call to BN_MONT_CTX_init 214. ctx->n0[0] = ctx->n0[1] = 0; 215. ctx->flags = 0; 216. > } 217. 218. void BN_MONT_CTX_free(BN_MONT_CTX *mont) crypto/bn/bn_mont.c:204:5: 202. 203. BN_MONT_CTX_init(ret); 204. > ret->flags = BN_FLG_MALLOCED; 205. return ret; 206. } crypto/bn/bn_mont.c:205:5: 203. BN_MONT_CTX_init(ret); 204. ret->flags = BN_FLG_MALLOCED; 205. > return ret; 206. } 207. crypto/bn/bn_mont.c:206:1: return from a call to BN_MONT_CTX_new 204. ret->flags = BN_FLG_MALLOCED; 205. return ret; 206. > } 207. 208. void BN_MONT_CTX_init(BN_MONT_CTX *ctx) test/testutil/tests.c:228:1: start of procedure test_ptr() 226. } 227. 228. > int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) test/testutil/tests.c:230:9: Taking true branch 228. int test_ptr(const char *file, int line, const char *s, const void *p) 229. { 230. if (p != NULL) ^ 231. return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); test/testutil/tests.c:231:9: 229. { 230. if (p != NULL) 231. > return 1; 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; test/testutil/tests.c:234:1: return from a call to test_ptr 232. test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p); 233. return 0; 234. > } 235. 236. int test_true(const char *file, int line, const char *s, int b) test/bntest.c:327:17: Taking false branch 325. || !TEST_ptr(n = BN_new()) 326. || !TEST_ptr(c = BN_new()) 327. || !TEST_ptr(mont = BN_MONT_CTX_new())) ^ 328. goto err; 329. test/bntest.c:330:5: 328. goto err; 329. 330. > BN_bntest_rand(m, 1024, 0, 1); /* must be odd for montgomery */ 331. /* Zero exponent */ 332. BN_bntest_rand(a, 1024, 0, 0); crypto/bn/bn_rand.c:102:1: start of procedure BN_bntest_rand() 100. } 101. 102. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) 103. { 104. return bnrand(TESTING, rnd, bits, top, bottom); crypto/bn/bn_rand.c:104:5: Skipping bnrand(): empty list of specs 102. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) 103. { 104. return bnrand(TESTING, rnd, bits, top, bottom); ^ 105. } 106. crypto/bn/bn_rand.c:105:1: return from a call to BN_bntest_rand 103. { 104. return bnrand(TESTING, rnd, bits, top, bottom); 105. > } 106. 107. int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom) test/bntest.c:332:5: 330. BN_bntest_rand(m, 1024, 0, 1); /* must be odd for montgomery */ 331. /* Zero exponent */ 332. > BN_bntest_rand(a, 1024, 0, 0); 333. BN_zero(p); 334. if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) crypto/bn/bn_rand.c:102:1: start of procedure BN_bntest_rand() 100. } 101. 102. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) 103. { 104. return bnrand(TESTING, rnd, bits, top, bottom); crypto/bn/bn_rand.c:104:5: Skipping bnrand(): empty list of specs 102. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom) 103. { 104. return bnrand(TESTING, rnd, bits, top, bottom); ^ 105. } 106. crypto/bn/bn_rand.c:105:1: return from a call to BN_bntest_rand 103. { 104. return bnrand(TESTING, rnd, bits, top, bottom); 105. > } 106. 107. int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom) test/bntest.c:333:5: Skipping BN_set_word(): empty list of specs 331. /* Zero exponent */ 332. BN_bntest_rand(a, 1024, 0, 0); 333. BN_zero(p); ^ 334. if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) 335. goto err; test/bntest.c:334:10: Condition is true 332. BN_bntest_rand(a, 1024, 0, 0); 333. BN_zero(p); 334. if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) ^ 335. goto err; 336. if (!TEST_BN_eq_one(d)) test/testutil/tests.c:236:1: start of procedure test_true() 234. } 235. 236. > int test_true(const char *file, int line, const char *s, int b) 237. { 238. if (b) test/testutil/tests.c:238:9: Taking true branch 236. int test_true(const char *file, int line, const char *s, int b) 237. { 238. if (b) ^ 239. return 1; 240. test_fail_message(NULL, file, line, "bool", s, "true", "==", "false"); test/testutil/tests.c:239:9: 237. { 238. if (b) 239. > return 1; 240. test_fail_message(NULL, file, line, "bool", s, "true", "==", "false"); 241. return 0; test/testutil/tests.c:242:1: return from a call to test_true 240. test_fail_message(NULL, file, line, "bool", s, "true", "==", "false"); 241. return 0; 242. > } 243. 244. int test_false(const char *file, int line, const char *s, int b) test/bntest.c:334:10: Taking false branch 332. BN_bntest_rand(a, 1024, 0, 0); 333. BN_zero(p); 334. if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) ^ 335. goto err; 336. if (!TEST_BN_eq_one(d)) test/bntest.c:336:10: 334. if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) 335. goto err; 336. > if (!TEST_BN_eq_one(d)) 337. goto err; 338. test/testutil/tests.c:364:1: start of procedure test_BN_eq_one() 362. DEFINE_BN_COMPARISONS(le, <=, BN_is_negative(a) || BN_is_zero(a)) 363. 364. > int test_BN_eq_one(const char *file, int line, const char *s, const BIGNUM *a) 365. { 366. if (a != NULL && BN_is_one(a)) test/testutil/tests.c:366:9: Taking true branch 364. int test_BN_eq_one(const char *file, int line, const char *s, const BIGNUM *a) 365. { 366. if (a != NULL && BN_is_one(a)) ^ 367. return 1; 368. test_fail_bignum_mono_message(NULL, file, line, "BIGNUM", s, "1", "==", a); test/testutil/tests.c:366:22: 364. int test_BN_eq_one(const char *file, int line, const char *s, const BIGNUM *a) 365. { 366. > if (a != NULL && BN_is_one(a)) 367. return 1; 368. test_fail_bignum_mono_message(NULL, file, line, "BIGNUM", s, "1", "==", a); crypto/bn/bn_lib.c:819:1: start of procedure BN_is_one() 817. } 818. 819. > int BN_is_one(const BIGNUM *a) 820. { 821. return BN_abs_is_word(a, 1) && !a->neg; crypto/bn/bn_lib.c:821:12: 819. int BN_is_one(const BIGNUM *a) 820. { 821. > return BN_abs_is_word(a, 1) && !a->neg; 822. } 823. crypto/bn/bn_lib.c:809:1: start of procedure BN_abs_is_word() 807. } 808. 809. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 810. { 811. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); crypto/bn/bn_lib.c:811:14: Condition is true 809. int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 810. { 811. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); ^ 812. } 813. crypto/bn/bn_lib.c:811:31: Condition is true 809. int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 810. { 811. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); ^ 812. } 813. crypto/bn/bn_lib.c:811:12: 809. int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 810. { 811. > return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); 812. } 813. crypto/bn/bn_lib.c:811:5: 809. int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w) 810. { 811. > return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); 812. } 813. crypto/bn/bn_lib.c:812:1: return from a call to BN_abs_is_word 810. { 811. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0)); 812. > } 813. 814. int BN_is_zero(const BIGNUM *a) crypto/bn/bn_lib.c:821:12: Condition is true 819. int BN_is_one(const BIGNUM *a) 820. { 821. return BN_abs_is_word(a, 1) && !a->neg; ^ 822. } 823. crypto/bn/bn_lib.c:821:37: Condition is false 819. int BN_is_one(const BIGNUM *a) 820. { 821. return BN_abs_is_word(a, 1) && !a->neg; ^ 822. } 823. crypto/bn/bn_lib.c:821:12: 819. int BN_is_one(const BIGNUM *a) 820. { 821. > return BN_abs_is_word(a, 1) && !a->neg; 822. } 823. crypto/bn/bn_lib.c:821:5: 819. int BN_is_one(const BIGNUM *a) 820. { 821. > return BN_abs_is_word(a, 1) && !a->neg; 822. } 823. crypto/bn/bn_lib.c:822:1: return from a call to BN_is_one 820. { 821. return BN_abs_is_word(a, 1) && !a->neg; 822. > } 823. 824. int BN_is_word(const BIGNUM *a, const BN_ULONG w) test/testutil/tests.c:366:22: Taking false branch 364. int test_BN_eq_one(const char *file, int line, const char *s, const BIGNUM *a) 365. { 366. if (a != NULL && BN_is_one(a)) ^ 367. return 1; 368. test_fail_bignum_mono_message(NULL, file, line, "BIGNUM", s, "1", "==", a); test/testutil/tests.c:368:5: 366. if (a != NULL && BN_is_one(a)) 367. return 1; 368. > test_fail_bignum_mono_message(NULL, file, line, "BIGNUM", s, "1", "==", a); 369. return 0; 370. } test/testutil/format_output.c:373:1: start of procedure test_fail_bignum_mono_message() 371. } 372. 373. > void test_fail_bignum_mono_message(const char *prefix, const char *file, 374. int line, const char *type, 375. const char *left, const char *right, test/testutil/format_output.c:378:5: Skipping test_fail_bignum_common(): empty list of specs 376. const char *op, const BIGNUM *bn) 377. { 378. test_fail_bignum_common(prefix, file, line, type, left, right, op, bn, bn); ^ 379. test_printf_stderr("\n"); 380. } test/testutil/format_output.c:379:5: Skipping test_printf_stderr(): empty list of specs 377. { 378. test_fail_bignum_common(prefix, file, line, type, left, right, op, bn, bn); 379. test_printf_stderr("\n"); ^ 380. } 381. test/testutil/format_output.c:380:1: return from a call to test_fail_bignum_mono_message 378. test_fail_bignum_common(prefix, file, line, type, left, right, op, bn, bn); 379. test_printf_stderr("\n"); 380. > } 381. 382. void test_output_bignum(const char *name, const BIGNUM *bn) test/testutil/tests.c:369:5: 367. return 1; 368. test_fail_bignum_mono_message(NULL, file, line, "BIGNUM", s, "1", "==", a); 369. > return 0; 370. } 371. test/testutil/tests.c:370:1: return from a call to test_BN_eq_one 368. test_fail_bignum_mono_message(NULL, file, line, "BIGNUM", s, "1", "==", a); 369. return 0; 370. > } 371. 372. int test_BN_odd(const char *file, int line, const char *s, const BIGNUM *a) test/bntest.c:336:10: Taking true branch 334. if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))) 335. goto err; 336. if (!TEST_BN_eq_one(d)) ^ 337. goto err; 338. test/bntest.c:467:1: 465. st = 1; 466. 467. > err: 468. BN_MONT_CTX_free(mont); 469. BN_free(a); test/bntest.c:468:5: 466. 467. err: 468. > BN_MONT_CTX_free(mont); 469. BN_free(a); 470. BN_free(p); crypto/bn/bn_mont.c:218:1: start of procedure BN_MONT_CTX_free() 216. } 217. 218. > void BN_MONT_CTX_free(BN_MONT_CTX *mont) 219. { 220. BN_clear_free(&(mont->RR)); crypto/bn/bn_mont.c:220:5: Skipping BN_clear_free(): empty list of specs 218. void BN_MONT_CTX_free(BN_MONT_CTX *mont) 219. { 220. BN_clear_free(&(mont->RR)); ^ 221. BN_clear_free(&(mont->N)); 222. BN_clear_free(&(mont->Ni)); crypto/bn/bn_mont.c:221:5: Skipping BN_clear_free(): empty list of specs 219. { 220. BN_clear_free(&(mont->RR)); 221. BN_clear_free(&(mont->N)); ^ 222. BN_clear_free(&(mont->Ni)); 223. if (mont->flags & BN_FLG_MALLOCED) crypto/bn/bn_mont.c:222:5: Skipping BN_clear_free(): empty list of specs 220. BN_clear_free(&(mont->RR)); 221. BN_clear_free(&(mont->N)); 222. BN_clear_free(&(mont->Ni)); ^ 223. if (mont->flags & BN_FLG_MALLOCED) 224. OPENSSL_free(mont); crypto/bn/bn_mont.c:223:9: Taking false branch 221. BN_clear_free(&(mont->N)); 222. BN_clear_free(&(mont->Ni)); 223. if (mont->flags & BN_FLG_MALLOCED) ^ 224. OPENSSL_free(mont); 225. } crypto/bn/bn_mont.c:223:5: 221. BN_clear_free(&(mont->N)); 222. BN_clear_free(&(mont->Ni)); 223. > if (mont->flags & BN_FLG_MALLOCED) 224. OPENSSL_free(mont); 225. } crypto/bn/bn_mont.c:225:1: return from a call to BN_MONT_CTX_free 223. if (mont->flags & BN_FLG_MALLOCED) 224. OPENSSL_free(mont); 225. > } 226. 227. int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
https://github.com/openssl/openssl/blob/f770d75b1cac264d6280ec7326277daff6965cbb/test/bntest.c/#L468
d2a_code_trace_data_43851
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data) { unsigned long hash; OPENSSL_LH_NODE *nn, **rn; void *ret; lh->error = 0; rn = getrn(lh, data, &hash); if (*rn == NULL) { lh->num_no_delete++; return (NULL); } else { nn = *rn; *rn = nn->next; ret = nn->data; OPENSSL_free(nn); lh->num_delete++; } lh->num_items--; if ((lh->num_nodes > MIN_NODES) && (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes))) contract(lh); return (ret); } apps/s_time.c:264: error: INTEGER_OVERFLOW_L2 ([0, +oo] - 1):unsigned64 by call to `SSL_free`. Showing all 17 steps of the trace apps/s_time.c:231:21: Call 229. break; 230. 231. if ((scon = doConnection(NULL, host, ctx)) == NULL) ^ 232. goto end; 233. apps/s_time.c:385:21: Call 383. 384. if (scon == NULL) 385. serverCon = SSL_new(ctx); ^ 386. else { 387. serverCon = scon; ssl/ssl_lib.c:518:1: Parameter `ctx->sessions->num_items` 516. } 517. 518. > SSL *SSL_new(SSL_CTX *ctx) 519. { 520. SSL *s; apps/s_time.c:264:9: Call 262. fflush(stdout); 263. 264. SSL_free(scon); ^ 265. scon = NULL; 266. } 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:986:1: Parameter `s->initial_ctx->sessions->num_items` 984. } 985. 986. > int ssl_clear_bad_session(SSL *s) 987. { 988. if ((s->session != NULL) && ssl/ssl_sess.c:991:9: Call 989. !(s->shutdown & SSL_SENT_SHUTDOWN) && 990. !(SSL_in_init(s) || SSL_in_before(s))) { 991. SSL_CTX_remove_session(s->session_ctx, s->session); ^ 992. return (1); 993. } else ssl/ssl_sess.c:693:1: Parameter `ctx->sessions->num_items` 691. } 692. 693. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 694. { 695. return remove_session_lock(ctx, c, 1); ssl/ssl_sess.c:695:12: Call 693. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) 694. { 695. return remove_session_lock(ctx, c, 1); ^ 696. } 697. ssl/ssl_sess.c:698:1: Parameter `ctx->sessions->num_items` 696. } 697. 698. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck) 699. { 700. SSL_SESSION *r; ssl/ssl_sess.c:708:17: Call 706. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) { 707. ret = 1; 708. r = lh_SSL_SESSION_delete(ctx->sessions, c); ^ 709. SSL_SESSION_list_remove(ctx, c); 710. } 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, +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/2dca984babedf93c560aba54da3f4c9222ee0d12/crypto/lhash/lhash.c/#L123
d2a_code_trace_data_43852
static ngx_int_t ngx_http_header_filter(ngx_http_request_t *r) { u_char *p; size_t len; ngx_str_t host, *status_line; ngx_buf_t *b; ngx_uint_t status, i, port; ngx_chain_t out; ngx_list_part_t *part; ngx_table_elt_t *header; ngx_http_core_loc_conf_t *clcf; ngx_http_core_srv_conf_t *cscf; struct sockaddr_in *sin; #if (NGX_HAVE_INET6) struct sockaddr_in6 *sin6; #endif u_char addr[NGX_SOCKADDR_STRLEN]; r->header_sent = 1; if (r != r->main) { return NGX_OK; } if (r->http_version < NGX_HTTP_VERSION_10) { return NGX_OK; } if (r->method == NGX_HTTP_HEAD) { r->header_only = 1; } if (r->headers_out.last_modified_time != -1) { if (r->headers_out.status != NGX_HTTP_OK && r->headers_out.status != NGX_HTTP_PARTIAL_CONTENT && r->headers_out.status != NGX_HTTP_NOT_MODIFIED) { r->headers_out.last_modified_time = -1; r->headers_out.last_modified = NULL; } } len = sizeof("HTTP/1.x ") - 1 + sizeof(CRLF) - 1 + sizeof(CRLF) - 1; if (r->headers_out.status_line.len) { len += r->headers_out.status_line.len; status_line = &r->headers_out.status_line; #if (NGX_SUPPRESS_WARN) status = 0; #endif } else { status = r->headers_out.status; if (status >= NGX_HTTP_OK && status < NGX_HTTP_LAST_LEVEL_200) { if (status == NGX_HTTP_NO_CONTENT) { r->header_only = 1; r->headers_out.content_type.len = 0; r->headers_out.content_type.data = NULL; r->headers_out.last_modified_time = -1; r->headers_out.last_modified = NULL; r->headers_out.content_length = NULL; r->headers_out.content_length_n = -1; } status -= NGX_HTTP_OK; status_line = &ngx_http_status_lines[status]; len += ngx_http_status_lines[status].len; } else if (status >= NGX_HTTP_MOVED_PERMANENTLY && status < NGX_HTTP_LAST_LEVEL_300) { if (status == NGX_HTTP_NOT_MODIFIED) { r->header_only = 1; } status = status - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200; status_line = &ngx_http_status_lines[status]; len += ngx_http_status_lines[status].len; } else if (status >= NGX_HTTP_BAD_REQUEST && status < NGX_HTTP_LAST_LEVEL_400) { status = status - NGX_HTTP_BAD_REQUEST + NGX_HTTP_LEVEL_200 + NGX_HTTP_LEVEL_300; status_line = &ngx_http_status_lines[status]; len += ngx_http_status_lines[status].len; } else if (status >= NGX_HTTP_INTERNAL_SERVER_ERROR && status < NGX_HTTP_LAST_LEVEL_500) { status = status - NGX_HTTP_INTERNAL_SERVER_ERROR + NGX_HTTP_LEVEL_200 + NGX_HTTP_LEVEL_300 + NGX_HTTP_LEVEL_400; status_line = &ngx_http_status_lines[status]; len += ngx_http_status_lines[status].len; } else { len += NGX_INT_T_LEN; status_line = NULL; } } clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); if (r->headers_out.server == NULL) { len += clcf->server_tokens ? sizeof(ngx_http_server_full_string) - 1: sizeof(ngx_http_server_string) - 1; } if (r->headers_out.date == NULL) { len += sizeof("Date: Mon, 28 Sep 1970 06:00:00 GMT" CRLF) - 1; } if (r->headers_out.content_type.len) { len += sizeof("Content-Type: ") - 1 + r->headers_out.content_type.len + 2; if (r->headers_out.content_type_len == r->headers_out.content_type.len && r->headers_out.charset.len) { len += sizeof("; charset=") - 1 + r->headers_out.charset.len; } } if (r->headers_out.content_length == NULL && r->headers_out.content_length_n >= 0) { len += sizeof("Content-Length: ") - 1 + NGX_OFF_T_LEN + 2; } if (r->headers_out.last_modified == NULL && r->headers_out.last_modified_time != -1) { len += sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT" CRLF) - 1; } if (r->headers_out.location && r->headers_out.location->value.len && r->headers_out.location->value.data[0] == '/') { r->headers_out.location->hash = 0; if (clcf->server_name_in_redirect) { cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); host = cscf->server_name; } else if (r->headers_in.server.len) { host = r->headers_in.server; } else { host.len = NGX_SOCKADDR_STRLEN; host.data = addr; if (ngx_http_server_addr(r, &host) != NGX_OK) { return NGX_ERROR; } } switch (r->connection->local_sockaddr->sa_family) { #if (NGX_HAVE_INET6) case AF_INET6: sin6 = (struct sockaddr_in6 *) r->connection->local_sockaddr; port = ntohs(sin6->sin6_port); break; #endif default: sin = (struct sockaddr_in *) r->connection->local_sockaddr; port = ntohs(sin->sin_port); break; } len += sizeof("Location: https://") - 1 + host.len + r->headers_out.location->value.len + 2; if (clcf->port_in_redirect) { #if (NGX_HTTP_SSL) if (r->connection->ssl) port = (port == 443) ? 0 : port; else #endif port = (port == 80) ? 0 : port; } if (port) { len += sizeof(":65535") - 1; } } else { host.len = 0; host.data = NULL; port = 0; } if (r->chunked) { len += sizeof("Transfer-Encoding: chunked" CRLF) - 1; } if (r->keepalive) { len += sizeof("Connection: keep-alive" CRLF) - 1; if (clcf->keepalive_header) { len += sizeof("Keep-Alive: timeout=") - 1 + NGX_TIME_T_LEN + 2; } } else { len += sizeof("Connection: closed" CRLF) - 1; } #if (NGX_HTTP_GZIP) if (r->gzip && clcf->gzip_vary) { len += sizeof("Vary: Accept-Encoding" CRLF) - 1; } #endif part = &r->headers_out.headers.part; header = part->elts; for (i = 0; ; i++) { if (i >= part->nelts) { if (part->next == NULL) { break; } part = part->next; header = part->elts; i = 0; } if (header[i].hash == 0) { continue; } len += header[i].key.len + sizeof(": ") - 1 + header[i].value.len + sizeof(CRLF) - 1; } b = ngx_create_temp_buf(r->pool, len); if (b == NULL) { return NGX_ERROR; } b->last = ngx_cpymem(b->last, "HTTP/1.1 ", sizeof("HTTP/1.x ") - 1); if (status_line) { b->last = ngx_copy(b->last, status_line->data, status_line->len); } else { b->last = ngx_sprintf(b->last, "%ui", status); } *b->last++ = CR; *b->last++ = LF; if (r->headers_out.server == NULL) { if (clcf->server_tokens) { p = (u_char *) ngx_http_server_full_string; len = sizeof(ngx_http_server_full_string) - 1; } else { p = (u_char *) ngx_http_server_string; len = sizeof(ngx_http_server_string) - 1; } b->last = ngx_cpymem(b->last, p, len); } if (r->headers_out.date == NULL) { b->last = ngx_cpymem(b->last, "Date: ", sizeof("Date: ") - 1); b->last = ngx_cpymem(b->last, ngx_cached_http_time.data, ngx_cached_http_time.len); *b->last++ = CR; *b->last++ = LF; } if (r->headers_out.content_type.len) { b->last = ngx_cpymem(b->last, "Content-Type: ", sizeof("Content-Type: ") - 1); p = b->last; b->last = ngx_copy(b->last, r->headers_out.content_type.data, r->headers_out.content_type.len); if (r->headers_out.content_type_len == r->headers_out.content_type.len && r->headers_out.charset.len) { b->last = ngx_cpymem(b->last, "; charset=", sizeof("; charset=") - 1); b->last = ngx_copy(b->last, r->headers_out.charset.data, r->headers_out.charset.len); r->headers_out.content_type.len = b->last - p; r->headers_out.content_type.data = p; } *b->last++ = CR; *b->last++ = LF; } if (r->headers_out.content_length == NULL && r->headers_out.content_length_n >= 0) { b->last = ngx_sprintf(b->last, "Content-Length: %O" CRLF, r->headers_out.content_length_n); } if (r->headers_out.last_modified == NULL && r->headers_out.last_modified_time != -1) { b->last = ngx_cpymem(b->last, "Last-Modified: ", sizeof("Last-Modified: ") - 1); b->last = ngx_http_time(b->last, r->headers_out.last_modified_time); *b->last++ = CR; *b->last++ = LF; } if (host.data) { p = b->last + sizeof("Location: ") - 1; b->last = ngx_cpymem(b->last, "Location: http", sizeof("Location: http") - 1); #if (NGX_HTTP_SSL) if (r->connection->ssl) { *b->last++ ='s'; } #endif *b->last++ = ':'; *b->last++ = '/'; *b->last++ = '/'; b->last = ngx_copy(b->last, host.data, host.len); if (port) { b->last = ngx_sprintf(b->last, ":%ui", port); } b->last = ngx_copy(b->last, r->headers_out.location->value.data, r->headers_out.location->value.len); r->headers_out.location->value.len = b->last - p; r->headers_out.location->value.data = p; r->headers_out.location->key.len = sizeof("Location: ") - 1; r->headers_out.location->key.data = (u_char *) "Location: "; *b->last++ = CR; *b->last++ = LF; } if (r->chunked) { b->last = ngx_cpymem(b->last, "Transfer-Encoding: chunked" CRLF, sizeof("Transfer-Encoding: chunked" CRLF) - 1); } if (r->keepalive) { b->last = ngx_cpymem(b->last, "Connection: keep-alive" CRLF, sizeof("Connection: keep-alive" CRLF) - 1); if (clcf->keepalive_header) { b->last = ngx_sprintf(b->last, "Keep-Alive: timeout=%T" CRLF, clcf->keepalive_header); } } else { b->last = ngx_cpymem(b->last, "Connection: close" CRLF, sizeof("Connection: close" CRLF) - 1); } #if (NGX_HTTP_GZIP) if (r->gzip && clcf->gzip_vary) { b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF, sizeof("Vary: Accept-Encoding" CRLF) - 1); } #endif part = &r->headers_out.headers.part; header = part->elts; for (i = 0; ; i++) { if (i >= part->nelts) { if (part->next == NULL) { break; } part = part->next; header = part->elts; i = 0; } if (header[i].hash == 0) { continue; } b->last = ngx_copy(b->last, header[i].key.data, header[i].key.len); *b->last++ = ':'; *b->last++ = ' '; b->last = ngx_copy(b->last, header[i].value.data, header[i].value.len); *b->last++ = CR; *b->last++ = LF; } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "%*s", (size_t) (b->last - b->pos), b->pos); *b->last++ = CR; *b->last++ = LF; r->header_size = b->last - b->pos; if (r->header_only) { b->last_buf = 1; } out.buf = b; out.next = NULL; return ngx_http_write_filter(r, &out); } src/http/ngx_http_header_filter_module.c:474: error: Buffer Overrun S2 Offset added: [max(1, `r->headers_out.charset.len`), `r->headers_out.charset.len` + 65540] (⇐ [0, 65540] + [max(1, `r->headers_out.charset.len`), `r->headers_out.charset.len`]) Size: [0, +oo]. src/http/ngx_http_header_filter_module.c:157:1: <Offset trace> 155. 156. 157. static ngx_int_t ^ 158. ngx_http_header_filter(ngx_http_request_t *r) 159. { src/http/ngx_http_header_filter_module.c:157:1: Parameter `r->headers_out.charset.len` 155. 156. 157. static ngx_int_t ^ 158. ngx_http_header_filter(ngx_http_request_t *r) 159. { src/http/ngx_http_header_filter_module.c:430:5: <Length trace> 428. 429. /* "HTTP/1.x " */ 430. b->last = ngx_cpymem(b->last, "HTTP/1.1 ", sizeof("HTTP/1.x ") - 1); ^ 431. 432. /* status line */ src/http/ngx_http_header_filter_module.c:430:5: Assignment 428. 429. /* "HTTP/1.x " */ 430. b->last = ngx_cpymem(b->last, "HTTP/1.1 ", sizeof("HTTP/1.x ") - 1); ^ 431. 432. /* status line */ src/http/ngx_http_header_filter_module.c:474:23: Array access: Offset added: [max(1, r->headers_out.charset.len), r->headers_out.charset.len + 65540] (⇐ [0, 65540] + [max(1, r->headers_out.charset.len), r->headers_out.charset.len]) Size: [0, +oo] 472. b->last = ngx_cpymem(b->last, "; charset=", 473. sizeof("; charset=") - 1); 474. b->last = ngx_copy(b->last, r->headers_out.charset.data, ^ 475. r->headers_out.charset.len); 476.
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/http/ngx_http_header_filter_module.c/#L474
d2a_code_trace_data_43853
static inline uint64_t get_val(BitstreamContext *bc, unsigned n) { #ifdef BITSTREAM_READER_LE uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1); bc->bits >>= n; #else uint64_t ret = bc->bits >> (64 - n); bc->bits <<= n; #endif bc->bits_left -= n; return ret; } libavcodec/takdec.c:550: error: Integer Overflow L2 ([-1, +oo] - 1):unsigned32 by call to `decode_subframe`. libavcodec/takdec.c:526:25: Call 524. s->sample_shift[chan]); 525. s->lpc_mode[chan] = bitstream_read(bc, 2); 526. nb_subframes = bitstream_read(bc, 3) + 1; ^ 527. 528. i = 0; libavcodec/bitstream.h:183:1: Parameter `bc->bits_left` 181. 182. /* Return n bits from the buffer. n has to be in the 0-32 range. */ 183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n) ^ 184. { 185. if (!n) libavcodec/takdec.c:550:20: Call 548. prev = 0; 549. for (i = 0; i < nb_subframes; i++) { 550. if ((ret = decode_subframe(s, decoded, subframe_len[i], prev)) < 0) ^ 551. return ret; 552. decoded += subframe_len[i]; libavcodec/takdec.c:422:1: Parameter `s->bc.bits_left` 420. } 421. 422. static int decode_subframe(TAKDecContext *s, int32_t *decoded, ^ 423. int subframe_size, int prev_subframe_size) 424. { libavcodec/takdec.c:432:10: Call 430. memset(filter, 0, MAX_PREDICTORS * sizeof(*filter)); 431. 432. if (!bitstream_read_bit(bc)) ^ 433. return decode_residues(s, decoded, subframe_size); 434. libavcodec/bitstream.h:145:1: Parameter `bc->bits_left` 143. 144. /* Return one bit from the buffer. */ 145. static inline unsigned bitstream_read_bit(BitstreamContext *bc) ^ 146. { 147. if (!bc->bits_left) libavcodec/bitstream.h:150:12: Call 148. refill_64(bc); 149. 150. return get_val(bc, 1); ^ 151. } 152. libavcodec/bitstream.h:130:1: Parameter `n` 128. } 129. 130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n) ^ 131. { 132. #ifdef BITSTREAM_READER_LE libavcodec/bitstream.h:139:5: Assignment 137. bc->bits <<= n; 138. #endif 139. bc->bits_left -= n; ^ 140. 141. return ret; libavcodec/takdec.c:433:16: Call 431. 432. if (!bitstream_read_bit(bc)) 433. return decode_residues(s, decoded, subframe_size); ^ 434. 435. filter_order = predictor_sizes[bitstream_read(bc, 4)]; libavcodec/takdec.c:286:1: Parameter `s->bc.bits_left` 284. } 285. 286. static int decode_residues(TAKDecContext *s, int32_t *decoded, int length) ^ 287. { 288. BitstreamContext *bc = &s->bc; libavcodec/takdec.c:294:9: Call 292. return AVERROR_INVALIDDATA; 293. 294. if (bitstream_read_bit(bc)) { ^ 295. int wlength, rval; 296. int coding_mode[128]; 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: ([-1, +oo] - 1):unsigned32 by call to `decode_subframe` 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