id
stringlengths 25
25
| content
stringlengths 649
72.1k
| max_stars_repo_path
stringlengths 91
133
|
|---|---|---|
d2a_code_trace_data_41554
|
static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
int src_index, int ref_index, int const penalty_factor,
int size, int h, int flags)
{
MotionEstContext * const c= &s->me;
me_cmp_func cmpf, chroma_cmpf;
int dia_size;
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
for(dia_size=1; dia_size<=c->dia_size; dia_size++){
int dir, start, end;
const int x= best[0];
const int y= best[1];
start= FFMAX(0, y + dia_size - ymax);
end = FFMIN(dia_size, xmax - x + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dir , y + dia_size - dir);
}
start= FFMAX(0, x + dia_size - xmax);
end = FFMIN(dia_size, y - ymin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dia_size - dir, y - dir );
}
start= FFMAX(0, -y + dia_size + ymin );
end = FFMIN(dia_size, x - xmin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dir , y - dia_size + dir);
}
start= FFMAX(0, -x + dia_size + xmin );
end = FFMIN(dia_size, ymax - y + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dia_size + dir, y + dir );
}
if(x!=best[0] || y!=best[1])
dia_size=0;
#if 0
{
int dx, dy, i;
static int stats[8*8];
dx= FFABS(x-best[0]);
dy= FFABS(y-best[1]);
stats[dy*8 + dx] ++;
if(256*256*256*64 % (stats[0]+1)==0){
for(i=0; i<64; i++){
if((i&7)==0) printf("\n");
printf("%6d ", stats[i]);
}
printf("\n");
}
}
#endif
}
return dmin;
}
libavcodec/motion_est_template.c:939: error: Uninitialized Value
The value read from ymin was never initialized.
libavcodec/motion_est_template.c:939:13:
937.
938. //check(x - dir,y - dia_size + dir,0, a2)
939. CHECK_MV(x - dir , y - dia_size + dir);
^
940. }
941.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L939
|
d2a_code_trace_data_41555
|
int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
{
char *tmp = NULL;
char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
int reason_code = -1;
int i, ret = 0;
ASN1_OBJECT *hold = NULL;
ASN1_GENERALIZEDTIME *comp_time = NULL;
tmp = BUF_strdup(str);
p = strchr(tmp, ',');
rtime_str = tmp;
if (p)
{
*p = '\0';
p++;
reason_str = p;
p = strchr(p, ',');
if (p)
{
*p = '\0';
arg_str = p + 1;
}
}
if (prevtm)
{
*prevtm = ASN1_UTCTIME_new();
if (!ASN1_UTCTIME_set_string(*prevtm, rtime_str))
{
BIO_printf(bio_err, "invalid revocation date %s\n", rtime_str);
goto err;
}
}
if (reason_str)
{
for (i = 0; i < NUM_REASONS; i++)
{
if(!strcasecmp(reason_str, crl_reasons[i]))
{
reason_code = i;
break;
}
}
if (reason_code == OCSP_REVOKED_STATUS_NOSTATUS)
{
BIO_printf(bio_err, "invalid reason code %s\n", reason_str);
goto err;
}
if (reason_code == 7)
reason_code = OCSP_REVOKED_STATUS_REMOVEFROMCRL;
else if (reason_code == 8)
{
if (!arg_str)
{
BIO_printf(bio_err, "missing hold instruction\n");
goto err;
}
reason_code = OCSP_REVOKED_STATUS_CERTIFICATEHOLD;
hold = OBJ_txt2obj(arg_str, 0);
if (!hold)
{
BIO_printf(bio_err, "invalid object identifier %s\n", arg_str);
goto err;
}
if (phold) *phold = hold;
}
else if ((reason_code == 9) || (reason_code == 10))
{
if (!arg_str)
{
BIO_printf(bio_err, "missing compromised time\n");
goto err;
}
comp_time = ASN1_GENERALIZEDTIME_new();
if (!ASN1_GENERALIZEDTIME_set_string(comp_time, arg_str))
{
BIO_printf(bio_err, "invalid compromised time %s\n", arg_str);
goto err;
}
if (reason_code == 9)
reason_code = OCSP_REVOKED_STATUS_KEYCOMPROMISE;
else
reason_code = OCSP_REVOKED_STATUS_CACOMPROMISE;
}
}
if (preason) *preason = reason_code;
if (pinvtm) *pinvtm = comp_time;
else ASN1_GENERALIZEDTIME_free(comp_time);
ret = 1;
err:
if (tmp) OPENSSL_free(tmp);
if (!phold) ASN1_OBJECT_free(hold);
if (!pinvtm) ASN1_GENERALIZEDTIME_free(comp_time);
return ret;
}
apps/ca.c:3193: error: NULL_DEREFERENCE
pointer `tmp` last assigned on line 3191 could be null and is dereferenced by call to `strchr()` at line 3193, column 6.
Showing all 44 steps of the trace
apps/ca.c:3183:1: start of procedure unpack_revinfo()
3181. }
3182.
3183. > int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
3184. {
3185. char *tmp = NULL;
apps/ca.c:3185:2:
3183. int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold, ASN1_GENERALIZEDTIME **pinvtm, char *str)
3184. {
3185. > char *tmp = NULL;
3186. char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3187. int reason_code = -1;
apps/ca.c:3186:2:
3184. {
3185. char *tmp = NULL;
3186. > char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3187. int reason_code = -1;
3188. int i, ret = 0;
apps/ca.c:3187:2:
3185. char *tmp = NULL;
3186. char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3187. > int reason_code = -1;
3188. int i, ret = 0;
3189. ASN1_OBJECT *hold = NULL;
apps/ca.c:3188:2:
3186. char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
3187. int reason_code = -1;
3188. > int i, ret = 0;
3189. ASN1_OBJECT *hold = NULL;
3190. ASN1_GENERALIZEDTIME *comp_time = NULL;
apps/ca.c:3189:2:
3187. int reason_code = -1;
3188. int i, ret = 0;
3189. > ASN1_OBJECT *hold = NULL;
3190. ASN1_GENERALIZEDTIME *comp_time = NULL;
3191. tmp = BUF_strdup(str);
apps/ca.c:3190:2:
3188. int i, ret = 0;
3189. ASN1_OBJECT *hold = NULL;
3190. > ASN1_GENERALIZEDTIME *comp_time = NULL;
3191. tmp = BUF_strdup(str);
3192.
apps/ca.c:3191:2:
3189. ASN1_OBJECT *hold = NULL;
3190. ASN1_GENERALIZEDTIME *comp_time = NULL;
3191. > tmp = BUF_strdup(str);
3192.
3193. p = strchr(tmp, ',');
crypto/buffer/buffer.c:128:1: start of procedure BUF_strdup()
126. }
127.
128. > char *BUF_strdup(const char *str)
129. {
130. char *ret;
crypto/buffer/buffer.c:133:6: Taking false branch
131. int n;
132.
133. if (str == NULL) return(NULL);
^
134.
135. n=strlen(str);
crypto/buffer/buffer.c:135:2:
133. if (str == NULL) return(NULL);
134.
135. > n=strlen(str);
136. ret=OPENSSL_malloc(n+1);
137. if (ret == NULL)
crypto/buffer/buffer.c:136:2:
134.
135. n=strlen(str);
136. > ret=OPENSSL_malloc(n+1);
137. if (ret == NULL)
138. {
crypto/mem.c:282:1: start of procedure CRYPTO_malloc()
280. }
281.
282. > void *CRYPTO_malloc(int num, const char *file, int line)
283. {
284. void *ret = NULL;
crypto/mem.c:284:2:
282. void *CRYPTO_malloc(int num, const char *file, int line)
283. {
284. > void *ret = NULL;
285.
286. allow_customize = 0;
crypto/mem.c:286:2:
284. void *ret = NULL;
285.
286. > allow_customize = 0;
287. if (malloc_debug_func != NULL)
288. {
crypto/mem.c:287:6: Taking false branch
285.
286. allow_customize = 0;
287. if (malloc_debug_func != NULL)
^
288. {
289. allow_customize_debug = 0;
crypto/mem.c:292:2: Skipping __function_pointer__(): unresolved function pointer
290. malloc_debug_func(NULL, num, file, line, 0);
291. }
292. ret = malloc_ex_func(num,file,line);
^
293. #ifdef LEVITTE_DEBUG_MEM
294. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
crypto/mem.c:296:6: Taking false branch
294. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
295. #endif
296. if (malloc_debug_func != NULL)
^
297. malloc_debug_func(ret, num, file, line, 1);
298.
crypto/mem.c:299:2:
297. malloc_debug_func(ret, num, file, line, 1);
298.
299. > return ret;
300. }
301.
crypto/mem.c:300:2: return from a call to CRYPTO_malloc
298.
299. return ret;
300. }
^
301.
302. void *CRYPTO_realloc(void *str, int num, const char *file, int line)
crypto/buffer/buffer.c:137:6: Taking true branch
135. n=strlen(str);
136. ret=OPENSSL_malloc(n+1);
137. if (ret == NULL)
^
138. {
139. BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
crypto/buffer/buffer.c:139:3:
137. if (ret == NULL)
138. {
139. > BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
140. return(NULL);
141. }
crypto/err/err.c:615:1: start of procedure ERR_put_error()
613. /********************************************************/
614.
615. > void ERR_put_error(int lib, int func, int reason, const char *file,
616. int line)
617. {
crypto/err/err.c:639:2: Skipping ERR_get_state(): empty list of specs
637. }
638. #endif
639. es=ERR_get_state();
^
640.
641. es->top=(es->top+1)%ERR_NUM_ERRORS;
crypto/err/err.c:641:2:
639. es=ERR_get_state();
640.
641. > es->top=(es->top+1)%ERR_NUM_ERRORS;
642. if (es->top == es->bottom)
643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
crypto/err/err.c:642:6: Taking false branch
640.
641. es->top=(es->top+1)%ERR_NUM_ERRORS;
642. if (es->top == es->bottom)
^
643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
crypto/err/err.c:644:2:
642. if (es->top == es->bottom)
643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
644. > es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
645. es->err_file[es->top]=file;
646. es->err_line[es->top]=line;
crypto/err/err.c:645:2:
643. es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
645. > es->err_file[es->top]=file;
646. es->err_line[es->top]=line;
647. err_clear_data(es,es->top);
crypto/err/err.c:646:2:
644. es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
645. es->err_file[es->top]=file;
646. > es->err_line[es->top]=line;
647. err_clear_data(es,es->top);
648. }
crypto/err/err.c:647:2: Taking true branch
645. es->err_file[es->top]=file;
646. es->err_line[es->top]=line;
647. err_clear_data(es,es->top);
^
648. }
649.
crypto/err/err.c:647:2: Taking true branch
645. es->err_file[es->top]=file;
646. es->err_line[es->top]=line;
647. err_clear_data(es,es->top);
^
648. }
649.
crypto/mem.c:318:1: start of procedure CRYPTO_free()
316. }
317.
318. > void CRYPTO_free(void *str)
319. {
320. if (free_debug_func != NULL)
crypto/mem.c:320:6: Taking true branch
318. void CRYPTO_free(void *str)
319. {
320. if (free_debug_func != NULL)
^
321. free_debug_func(str, 0);
322. #ifdef LEVITTE_DEBUG_MEM
crypto/mem.c:321:3: Skipping __function_pointer__(): unresolved function pointer
319. {
320. if (free_debug_func != NULL)
321. free_debug_func(str, 0);
^
322. #ifdef LEVITTE_DEBUG_MEM
323. fprintf(stderr, "LEVITTE_DEBUG_MEM: < 0x%p\n", str);
crypto/mem.c:325:2: Skipping __function_pointer__(): unresolved function pointer
323. fprintf(stderr, "LEVITTE_DEBUG_MEM: < 0x%p\n", str);
324. #endif
325. free_func(str);
^
326. if (free_debug_func != NULL)
327. free_debug_func(NULL, 1);
crypto/mem.c:326:6: Taking true branch
324. #endif
325. free_func(str);
326. if (free_debug_func != NULL)
^
327. free_debug_func(NULL, 1);
328. }
crypto/mem.c:327:3: Skipping __function_pointer__(): unresolved function pointer
325. free_func(str);
326. if (free_debug_func != NULL)
327. free_debug_func(NULL, 1);
^
328. }
329.
crypto/mem.c:326:2:
324. #endif
325. free_func(str);
326. > if (free_debug_func != NULL)
327. free_debug_func(NULL, 1);
328. }
crypto/mem.c:328:2: return from a call to CRYPTO_free
326. if (free_debug_func != NULL)
327. free_debug_func(NULL, 1);
328. }
^
329.
330. void *CRYPTO_remalloc(void *a, int num, const char *file, int line)
crypto/err/err.c:647:2:
645. es->err_file[es->top]=file;
646. es->err_line[es->top]=line;
647. > err_clear_data(es,es->top);
648. }
649.
crypto/err/err.c:648:2: return from a call to ERR_put_error
646. es->err_line[es->top]=line;
647. err_clear_data(es,es->top);
648. }
^
649.
650. void ERR_clear_error(void)
crypto/buffer/buffer.c:140:3:
138. {
139. BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
140. > return(NULL);
141. }
142. memcpy(ret,str,n+1);
crypto/buffer/buffer.c:144:2: return from a call to BUF_strdup
142. memcpy(ret,str,n+1);
143. return(ret);
144. }
^
145.
apps/ca.c:3193:2:
3191. tmp = BUF_strdup(str);
3192.
3193. > p = strchr(tmp, ',');
3194.
3195. rtime_str = tmp;
|
https://github.com/openssl/openssl/blob/64ad04eb2d464069dc6e3684b928d64b3560db8a/apps/ca.c/#L3193
|
d2a_code_trace_data_41556
|
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 = ¶ms;
AVOutputFormat *file_oformat;
if (!strcmp(filename, "-"))
filename = "pipe:";
oc = avformat_alloc_context();
if (!oc) {
print_error(filename, AVERROR(ENOMEM));
ffmpeg_exit(1);
}
if (last_asked_format) {
file_oformat = av_guess_format(last_asked_format, NULL, NULL);
if (!file_oformat) {
fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
ffmpeg_exit(1);
}
last_asked_format = NULL;
} else {
file_oformat = av_guess_format(NULL, filename, NULL);
if (!file_oformat) {
fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
filename);
ffmpeg_exit(1);
}
}
oc->oformat = file_oformat;
av_strlcpy(oc->filename, filename, sizeof(oc->filename));
if (!strcmp(file_oformat->name, "ffm") &&
av_strstart(filename, "http:", NULL)) {
int err = read_ffserver_streams(oc, filename);
if (err < 0) {
print_error(filename, err);
ffmpeg_exit(1);
}
} else {
use_video = file_oformat->video_codec != CODEC_ID_NONE || video_stream_copy || video_codec_name;
use_audio = file_oformat->audio_codec != CODEC_ID_NONE || audio_stream_copy || audio_codec_name;
use_subtitle = file_oformat->subtitle_codec != CODEC_ID_NONE || subtitle_stream_copy || subtitle_codec_name;
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);
}
if (use_audio) {
new_audio_stream(oc);
}
if (use_subtitle) {
new_subtitle_stream(oc);
}
oc->timestamp = recording_timestamp;
for(; metadata_count>0; metadata_count--){
av_metadata_set2(&oc->metadata, metadata[metadata_count-1].key,
metadata[metadata_count-1].value, 0);
}
av_metadata_conv(oc, oc->oformat->metadata_conv, NULL);
}
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);
memset(streamid_map, 0, sizeof(streamid_map));
}
ffmpeg.c:3695: error: Null Dereference
pointer `file_oformat` last assigned on line 3684 could be null and is dereferenced at line 3695, column 17.
ffmpeg.c:3659:1: start of procedure opt_output_file()
3657. }
3658.
3659. static void opt_output_file(const char *filename)
^
3660. {
3661. AVFormatContext *oc;
ffmpeg.c:3664:5:
3662. int err, use_video, use_audio, use_subtitle;
3663. int input_has_video, input_has_audio, input_has_subtitle;
3664. AVFormatParameters params, *ap = ¶ms;
^
3665. AVOutputFormat *file_oformat;
3666.
ffmpeg.c:3667:10: Taking false branch
3665. AVOutputFormat *file_oformat;
3666.
3667. if (!strcmp(filename, "-"))
^
3668. filename = "pipe:";
3669.
ffmpeg.c:3670:5:
3668. filename = "pipe:";
3669.
3670. oc = avformat_alloc_context();
^
3671. if (!oc) {
3672. print_error(filename, AVERROR(ENOMEM));
libavformat/options.c:81:1: start of procedure avformat_alloc_context()
79. }
80.
81. AVFormatContext *avformat_alloc_context(void)
^
82. {
83. AVFormatContext *ic;
libavformat/options.c:84:5:
82. {
83. AVFormatContext *ic;
84. ic = av_malloc(sizeof(AVFormatContext));
^
85. if (!ic) return ic;
86. 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:85:10: Taking false branch
83. AVFormatContext *ic;
84. ic = av_malloc(sizeof(AVFormatContext));
85. if (!ic) return ic;
^
86. avformat_get_context_defaults(ic);
87. ic->av_class = &av_format_context_class;
libavformat/options.c:86:5: Skipping avformat_get_context_defaults(): empty list of specs
84. ic = av_malloc(sizeof(AVFormatContext));
85. if (!ic) return ic;
86. avformat_get_context_defaults(ic);
^
87. ic->av_class = &av_format_context_class;
88. return ic;
libavformat/options.c:87:5:
85. if (!ic) return ic;
86. avformat_get_context_defaults(ic);
87. ic->av_class = &av_format_context_class;
^
88. return ic;
89. }
libavformat/options.c:88:5:
86. avformat_get_context_defaults(ic);
87. ic->av_class = &av_format_context_class;
88. return ic;
^
89. }
90.
libavformat/options.c:89:1: return from a call to avformat_alloc_context
87. ic->av_class = &av_format_context_class;
88. return ic;
89. }
^
90.
91. #if LIBAVFORMAT_VERSION_MAJOR < 53
ffmpeg.c:3671:10: Taking false branch
3669.
3670. oc = avformat_alloc_context();
3671. if (!oc) {
^
3672. print_error(filename, AVERROR(ENOMEM));
3673. ffmpeg_exit(1);
ffmpeg.c:3676:9: Taking false branch
3674. }
3675.
3676. if (last_asked_format) {
^
3677. file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3678. if (!file_oformat) {
ffmpeg.c:3684:9: Skipping av_guess_format(): empty list of specs
3682. last_asked_format = NULL;
3683. } else {
3684. file_oformat = av_guess_format(NULL, filename, NULL);
^
3685. if (!file_oformat) {
3686. fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
ffmpeg.c:3685:14: Taking true branch
3683. } else {
3684. file_oformat = av_guess_format(NULL, filename, NULL);
3685. if (!file_oformat) {
^
3686. fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
3687. filename);
ffmpeg.c:3686:13:
3684. file_oformat = av_guess_format(NULL, filename, NULL);
3685. if (!file_oformat) {
3686. fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
^
3687. filename);
3688. ffmpeg_exit(1);
ffmpeg.c:3688:13: Skipping ffmpeg_exit(): empty list of specs
3686. fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
3687. filename);
3688. ffmpeg_exit(1);
^
3689. }
3690. }
ffmpeg.c:3692:5:
3690. }
3691.
3692. oc->oformat = file_oformat;
^
3693. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3694.
ffmpeg.c:3693:5:
3691.
3692. oc->oformat = file_oformat;
3693. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
^
3694.
3695. if (!strcmp(file_oformat->name, "ffm") &&
libavutil/avstring.c:64:1: start of procedure av_strlcpy()
62. }
63.
64. size_t av_strlcpy(char *dst, const char *src, size_t size)
^
65. {
66. size_t len = 0;
libavutil/avstring.c:66:5:
64. size_t av_strlcpy(char *dst, const char *src, size_t size)
65. {
66. size_t len = 0;
^
67. while (++len < size && *src)
68. *dst++ = *src++;
libavutil/avstring.c:67:12: Loop condition is true. Entering loop body
65. {
66. size_t len = 0;
67. while (++len < size && *src)
^
68. *dst++ = *src++;
69. if (len <= size)
libavutil/avstring.c:67:28: Loop condition is false. Leaving loop
65. {
66. size_t len = 0;
67. while (++len < size && *src)
^
68. *dst++ = *src++;
69. if (len <= size)
libavutil/avstring.c:69:9: Taking true branch
67. while (++len < size && *src)
68. *dst++ = *src++;
69. if (len <= size)
^
70. *dst = 0;
71. return len + strlen(src) - 1;
libavutil/avstring.c:70:9:
68. *dst++ = *src++;
69. if (len <= size)
70. *dst = 0;
^
71. return len + strlen(src) - 1;
72. }
libavutil/avstring.c:71:5:
69. if (len <= size)
70. *dst = 0;
71. return len + strlen(src) - 1;
^
72. }
73.
libavutil/avstring.c:72:1: return from a call to av_strlcpy
70. *dst = 0;
71. return len + strlen(src) - 1;
72. }
^
73.
74. size_t av_strlcat(char *dst, const char *src, size_t size)
ffmpeg.c:3695:10:
3693. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3694.
3695. if (!strcmp(file_oformat->name, "ffm") &&
^
3696. av_strstart(filename, "http:", NULL)) {
3697. /* special case for files sent to ffserver: we get the stream
|
https://github.com/libav/libav/blob/ad0d70c964f852a18e9ab8124f0e7aa8876cac6e/ffmpeg.c/#L3695
|
d2a_code_trace_data_41557
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/sm2/sm2_sign.c:118: 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:87:5: Call
85.
86.
87. BN_CTX_start(ctx);
^
88. k = BN_CTX_get(ctx);
89. rk = 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:118:21: Call
116. || !EC_POINT_get_affine_coordinates_GFp(group, kG, x1, NULL,
117. ctx)
118. || !BN_mod_add(r, e, x1, order, ctx)) {
^
119. SM2err(SM2_F_SM2_SIG_GEN, ERR_R_INTERNAL_ERROR);
120. goto done;
crypto/bn/bn_mod.c:28:1: Parameter `ctx->stack.depth`
26. }
27.
28. > int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
29. BN_CTX *ctx)
30. {
crypto/bn/bn_mod.c:33:12: Call
31. if (!BN_add(r, a, b))
32. return 0;
33. return BN_nnmod(r, r, m, ctx);
^
34. }
35.
crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c: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:274:1: <Offset trace>
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: Parameter `st->depth`
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: <Length trace>
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: Parameter `*st->indexes`
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:276:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_add`
274. static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
^
277. }
278.
|
https://github.com/openssl/openssl/blob/630fe1da888490b7dfef3fe0928b813ddff5d51a/crypto/bn/bn_ctx.c/#L276
|
d2a_code_trace_data_41558
|
void BN_CTX_end(BN_CTX *ctx)
{
if (ctx == NULL) return;
assert(ctx->depth > 0);
if (ctx->depth == 0)
BN_CTX_start(ctx);
ctx->too_many = 0;
ctx->depth--;
if (ctx->depth < BN_CTX_NUM_POS)
ctx->tos = ctx->pos[ctx->depth];
}
crypto/dsa/dsa_key.c:100: error: BUFFER_OVERRUN_L3
Offset: [-3, +oo] Size: 12 by call to `BN_mod_exp`.
Showing all 19 steps of the trace
crypto/dsa/dsa_key.c:75:11: Call
73. BIGNUM *pub_key=NULL,*priv_key=NULL;
74.
75. if ((ctx=BN_CTX_new()) == NULL) goto err;
^
76.
77. if (dsa->priv_key == NULL)
crypto/bn/bn_ctx.c:79:2: Call
77. }
78.
79. BN_CTX_init(ret);
^
80. ret->flags=BN_FLG_MALLOCED;
81. return(ret);
crypto/bn/bn_ctx.c:89:2: Assignment
87. ctx->tos = 0;
88. ctx->flags = 0;
89. ctx->depth = 0;
^
90. ctx->too_many = 0;
91. for (i = 0; i < BN_CTX_NUM; i++)
crypto/dsa/dsa_key.c:100:7: Call
98. pub_key=dsa->pub_key;
99.
100. if (!BN_mod_exp(pub_key,dsa->g,priv_key,dsa->p,ctx)) goto err;
^
101.
102. dsa->priv_key=priv_key;
crypto/bn/bn_exp.c:333:1: Parameter `ctx->depth`
331. #endif /* def ATALLA */
332.
333. > int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
334. BN_CTX *ctx)
335. {
crypto/bn/bn_exp.c:361:9: Call
359. #endif
360. #ifdef RECP_MUL_MOD
361. { ret=BN_mod_exp_recp(r,a,p,m,ctx); }
^
362. #else
363. { ret=BN_mod_exp_simple(r,a,p,m,ctx); }
crypto/bn/bn_exp.c:374:1: Parameter `ctx->depth`
372.
373. /* #ifdef RECP_MUL_MOD */
374. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
375. const BIGNUM *m, BN_CTX *ctx)
376. {
crypto/bn/bn_exp.c:391:2: Call
389. }
390.
391. BN_CTX_start(ctx);
^
392. if ((aa = BN_CTX_get(ctx)) == NULL) goto err;
393.
crypto/bn/bn_ctx.c:108:1: Parameter `ctx->depth`
106. }
107.
108. > void BN_CTX_start(BN_CTX *ctx)
109. {
110. if (ctx->depth < BN_CTX_NUM_POS)
crypto/bn/bn_ctx.c:112:2: Assignment
110. if (ctx->depth < BN_CTX_NUM_POS)
111. ctx->pos[ctx->depth] = ctx->tos;
112. ctx->depth++;
^
113. }
114.
crypto/bn/bn_exp.c:392:12: Call
390.
391. BN_CTX_start(ctx);
392. if ((aa = BN_CTX_get(ctx)) == NULL) goto err;
^
393.
394. BN_RECP_CTX_init(&recp);
crypto/bn/bn_ctx.c:115:1: Parameter `ctx->depth`
113. }
114.
115. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
116. {
117. if (ctx->depth > BN_CTX_NUM_POS || ctx->tos >= BN_CTX_NUM)
crypto/bn/bn_exp.c:482:2: Call
480. ret=1;
481. err:
482. BN_CTX_end(ctx);
^
483. for (i=0; i<ts; i++)
484. BN_clear_free(&(val[i]));
crypto/bn/bn_ctx.c:130:1: <Offset trace>
128. }
129.
130. > void BN_CTX_end(BN_CTX *ctx)
131. {
132. if (ctx == NULL) return;
crypto/bn/bn_ctx.c:130:1: Parameter `ctx->depth`
128. }
129.
130. > void BN_CTX_end(BN_CTX *ctx)
131. {
132. if (ctx == NULL) return;
crypto/bn/bn_ctx.c:141:2: Assignment
139.
140. ctx->too_many = 0;
141. ctx->depth--;
^
142. if (ctx->depth < BN_CTX_NUM_POS)
143. ctx->tos = ctx->pos[ctx->depth];
crypto/bn/bn_ctx.c:130:1: <Length trace>
128. }
129.
130. > void BN_CTX_end(BN_CTX *ctx)
131. {
132. if (ctx == NULL) return;
crypto/bn/bn_ctx.c:130:1: Parameter `ctx->pos[*]`
128. }
129.
130. > void BN_CTX_end(BN_CTX *ctx)
131. {
132. if (ctx == NULL) return;
crypto/bn/bn_ctx.c:143:14: Array access: Offset: [-3, +oo] Size: 12 by call to `BN_mod_exp`
141. ctx->depth--;
142. if (ctx->depth < BN_CTX_NUM_POS)
143. ctx->tos = ctx->pos[ctx->depth];
^
144. }
|
https://github.com/openssl/openssl/blob/ae1bb4e572e02ce73d54c05ce18e872c36da2d35/crypto/bn/bn_ctx.c/#L143
|
d2a_code_trace_data_41559
|
EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx)
{
EVP_PKEY_CTX *rctx;
if (!pctx->pmeth || !pctx->pmeth->copy)
return NULL;
#ifndef OPENSSL_NO_ENGINE
if (pctx->engine && !ENGINE_init(pctx->engine)) {
EVPerr(EVP_F_EVP_PKEY_CTX_DUP, ERR_R_ENGINE_LIB);
return 0;
}
#endif
rctx = OPENSSL_malloc(sizeof(*rctx));
if (rctx == NULL)
return NULL;
rctx->pmeth = pctx->pmeth;
#ifndef OPENSSL_NO_ENGINE
rctx->engine = pctx->engine;
#endif
if (pctx->pkey)
EVP_PKEY_up_ref(pctx->pkey);
rctx->pkey = pctx->pkey;
if (pctx->peerkey)
EVP_PKEY_up_ref(pctx->peerkey);
rctx->peerkey = pctx->peerkey;
rctx->data = NULL;
rctx->app_data = NULL;
rctx->operation = pctx->operation;
if (pctx->pmeth->copy(rctx, pctx) > 0)
return rctx;
EVP_PKEY_CTX_free(rctx);
return NULL;
}
crypto/evp/pmeth_lib.c:309: error: MEMORY_LEAK
memory dynamically allocated by call to `CRYPTO_malloc()` at line 283, column 12 is not reachable after line 309, column 5.
Showing all 43 steps of the trace
crypto/evp/pmeth_lib.c:271:1: start of procedure EVP_PKEY_CTX_dup()
269. }
270.
271. > EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx)
272. {
273. EVP_PKEY_CTX *rctx;
crypto/evp/pmeth_lib.c:274:10: Taking false branch
272. {
273. EVP_PKEY_CTX *rctx;
274. if (!pctx->pmeth || !pctx->pmeth->copy)
^
275. return NULL;
276. #ifndef OPENSSL_NO_ENGINE
crypto/evp/pmeth_lib.c:274:26: Taking false branch
272. {
273. EVP_PKEY_CTX *rctx;
274. if (!pctx->pmeth || !pctx->pmeth->copy)
^
275. return NULL;
276. #ifndef OPENSSL_NO_ENGINE
crypto/evp/pmeth_lib.c:278:9: Taking false branch
276. #ifndef OPENSSL_NO_ENGINE
277. /* Make sure it's safe to copy a pkey context using an ENGINE */
278. if (pctx->engine && !ENGINE_init(pctx->engine)) {
^
279. EVPerr(EVP_F_EVP_PKEY_CTX_DUP, ERR_R_ENGINE_LIB);
280. return 0;
crypto/evp/pmeth_lib.c:283:5:
281. }
282. #endif
283. > rctx = OPENSSL_malloc(sizeof(*rctx));
284. if (rctx == NULL)
285. return NULL;
crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
117. }
118.
119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
120. {
121. void *ret = NULL;
crypto/mem.c:121:5:
119. void *CRYPTO_malloc(size_t num, const char *file, int line)
120. {
121. > void *ret = NULL;
122.
123. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:123:9: Taking false branch
121. void *ret = NULL;
122.
123. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
124. return malloc_impl(num, file, line);
125.
crypto/mem.c:126:9: Taking false branch
124. return malloc_impl(num, file, line);
125.
126. if (num <= 0)
^
127. return NULL;
128.
crypto/mem.c:129:5:
127. return NULL;
128.
129. > allow_customize = 0;
130. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
131. if (call_malloc_debug) {
crypto/mem.c:139:5:
137. }
138. #else
139. > osslargused(file); osslargused(line);
140. ret = malloc(num);
141. #endif
crypto/mem.c:139:24:
137. }
138. #else
139. > osslargused(file); osslargused(line);
140. ret = malloc(num);
141. #endif
crypto/mem.c:140:5:
138. #else
139. osslargused(file); osslargused(line);
140. > ret = malloc(num);
141. #endif
142.
crypto/mem.c:143:5:
141. #endif
142.
143. > return ret;
144. }
145.
crypto/mem.c:144:1: return from a call to CRYPTO_malloc
142.
143. return ret;
144. > }
145.
146. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/evp/pmeth_lib.c:284:9: Taking false branch
282. #endif
283. rctx = OPENSSL_malloc(sizeof(*rctx));
284. if (rctx == NULL)
^
285. return NULL;
286.
crypto/evp/pmeth_lib.c:287:5:
285. return NULL;
286.
287. > rctx->pmeth = pctx->pmeth;
288. #ifndef OPENSSL_NO_ENGINE
289. rctx->engine = pctx->engine;
crypto/evp/pmeth_lib.c:289:5:
287. rctx->pmeth = pctx->pmeth;
288. #ifndef OPENSSL_NO_ENGINE
289. > rctx->engine = pctx->engine;
290. #endif
291.
crypto/evp/pmeth_lib.c:292:9: Taking true branch
290. #endif
291.
292. if (pctx->pkey)
^
293. EVP_PKEY_up_ref(pctx->pkey);
294.
crypto/evp/pmeth_lib.c:293:9:
291.
292. if (pctx->pkey)
293. > EVP_PKEY_up_ref(pctx->pkey);
294.
295. rctx->pkey = pctx->pkey;
crypto/evp/p_lib.c:208:1: start of procedure EVP_PKEY_up_ref()
206. }
207.
208. > void EVP_PKEY_up_ref(EVP_PKEY *pkey)
209. {
210. int i;
crypto/evp/p_lib.c:211:5:
209. {
210. int i;
211. > CRYPTO_atomic_add(&pkey->references, 1, &i, pkey->lock);
212. }
213.
crypto/threads_pthread.c:151:1: start of procedure CRYPTO_atomic_add()
149. }
150.
151. > int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
152. {
153. #ifdef __ATOMIC_RELAXED
crypto/threads_pthread.c:154:5:
152. {
153. #ifdef __ATOMIC_RELAXED
154. > *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
155. #else
156. if (!CRYPTO_THREAD_write_lock(lock))
crypto/threads_pthread.c:166:5:
164. #endif
165.
166. > return 1;
167. }
168.
crypto/threads_pthread.c:167:1: return from a call to CRYPTO_atomic_add
165.
166. return 1;
167. > }
168.
169. #endif
crypto/evp/p_lib.c:212:1: return from a call to EVP_PKEY_up_ref
210. int i;
211. CRYPTO_atomic_add(&pkey->references, 1, &i, pkey->lock);
212. > }
213.
214. /*
crypto/evp/pmeth_lib.c:295:5:
293. EVP_PKEY_up_ref(pctx->pkey);
294.
295. > rctx->pkey = pctx->pkey;
296.
297. if (pctx->peerkey)
crypto/evp/pmeth_lib.c:297:9: Taking true branch
295. rctx->pkey = pctx->pkey;
296.
297. if (pctx->peerkey)
^
298. EVP_PKEY_up_ref(pctx->peerkey);
299.
crypto/evp/pmeth_lib.c:298:9:
296.
297. if (pctx->peerkey)
298. > EVP_PKEY_up_ref(pctx->peerkey);
299.
300. rctx->peerkey = pctx->peerkey;
crypto/evp/p_lib.c:208:1: start of procedure EVP_PKEY_up_ref()
206. }
207.
208. > void EVP_PKEY_up_ref(EVP_PKEY *pkey)
209. {
210. int i;
crypto/evp/p_lib.c:211:5:
209. {
210. int i;
211. > CRYPTO_atomic_add(&pkey->references, 1, &i, pkey->lock);
212. }
213.
crypto/threads_pthread.c:151:1: start of procedure CRYPTO_atomic_add()
149. }
150.
151. > int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
152. {
153. #ifdef __ATOMIC_RELAXED
crypto/threads_pthread.c:154:5:
152. {
153. #ifdef __ATOMIC_RELAXED
154. > *ret = __atomic_add_fetch(val, amount, __ATOMIC_RELAXED);
155. #else
156. if (!CRYPTO_THREAD_write_lock(lock))
crypto/threads_pthread.c:166:5:
164. #endif
165.
166. > return 1;
167. }
168.
crypto/threads_pthread.c:167:1: return from a call to CRYPTO_atomic_add
165.
166. return 1;
167. > }
168.
169. #endif
crypto/evp/p_lib.c:212:1: return from a call to EVP_PKEY_up_ref
210. int i;
211. CRYPTO_atomic_add(&pkey->references, 1, &i, pkey->lock);
212. > }
213.
214. /*
crypto/evp/pmeth_lib.c:300:5:
298. EVP_PKEY_up_ref(pctx->peerkey);
299.
300. > rctx->peerkey = pctx->peerkey;
301.
302. rctx->data = NULL;
crypto/evp/pmeth_lib.c:302:5:
300. rctx->peerkey = pctx->peerkey;
301.
302. > rctx->data = NULL;
303. rctx->app_data = NULL;
304. rctx->operation = pctx->operation;
crypto/evp/pmeth_lib.c:303:5:
301.
302. rctx->data = NULL;
303. > rctx->app_data = NULL;
304. rctx->operation = pctx->operation;
305.
crypto/evp/pmeth_lib.c:304:5:
302. rctx->data = NULL;
303. rctx->app_data = NULL;
304. > rctx->operation = pctx->operation;
305.
306. if (pctx->pmeth->copy(rctx, pctx) > 0)
crypto/evp/pmeth_lib.c:306:9: Taking false branch
304. rctx->operation = pctx->operation;
305.
306. if (pctx->pmeth->copy(rctx, pctx) > 0)
^
307. return rctx;
308.
crypto/evp/pmeth_lib.c:309:5: Skipping EVP_PKEY_CTX_free(): empty list of specs
307. return rctx;
308.
309. EVP_PKEY_CTX_free(rctx);
^
310. return NULL;
311.
|
https://github.com/openssl/openssl/blob/91056e72693b4ee8cb5339d9091871ffc3b6f776/crypto/evp/pmeth_lib.c/#L309
|
d2a_code_trace_data_41560
|
static void pred8x8l_vertical_left_c(uint8_t *src, int has_topleft, int has_topright, int stride)
{
PREDICT_8x8_LOAD_TOP;
PREDICT_8x8_LOAD_TOPRIGHT;
SRC(0,0)= (t0 + t1 + 1) >> 1;
SRC(0,1)= (t0 + 2*t1 + t2 + 2) >> 2;
SRC(0,2)=SRC(1,0)= (t1 + t2 + 1) >> 1;
SRC(0,3)=SRC(1,1)= (t1 + 2*t2 + t3 + 2) >> 2;
SRC(0,4)=SRC(1,2)=SRC(2,0)= (t2 + t3 + 1) >> 1;
SRC(0,5)=SRC(1,3)=SRC(2,1)= (t2 + 2*t3 + t4 + 2) >> 2;
SRC(0,6)=SRC(1,4)=SRC(2,2)=SRC(3,0)= (t3 + t4 + 1) >> 1;
SRC(0,7)=SRC(1,5)=SRC(2,3)=SRC(3,1)= (t3 + 2*t4 + t5 + 2) >> 2;
SRC(1,6)=SRC(2,4)=SRC(3,2)=SRC(4,0)= (t4 + t5 + 1) >> 1;
SRC(1,7)=SRC(2,5)=SRC(3,3)=SRC(4,1)= (t4 + 2*t5 + t6 + 2) >> 2;
SRC(2,6)=SRC(3,4)=SRC(4,2)=SRC(5,0)= (t5 + t6 + 1) >> 1;
SRC(2,7)=SRC(3,5)=SRC(4,3)=SRC(5,1)= (t5 + 2*t6 + t7 + 2) >> 2;
SRC(3,6)=SRC(4,4)=SRC(5,2)=SRC(6,0)= (t6 + t7 + 1) >> 1;
SRC(3,7)=SRC(4,5)=SRC(5,3)=SRC(6,1)= (t6 + 2*t7 + t8 + 2) >> 2;
SRC(4,6)=SRC(5,4)=SRC(6,2)=SRC(7,0)= (t7 + t8 + 1) >> 1;
SRC(4,7)=SRC(5,5)=SRC(6,3)=SRC(7,1)= (t7 + 2*t8 + t9 + 2) >> 2;
SRC(5,6)=SRC(6,4)=SRC(7,2)= (t8 + t9 + 1) >> 1;
SRC(5,7)=SRC(6,5)=SRC(7,3)= (t8 + 2*t9 + t10 + 2) >> 2;
SRC(6,6)=SRC(7,4)= (t9 + t10 + 1) >> 1;
SRC(6,7)=SRC(7,5)= (t9 + 2*t10 + t11 + 2) >> 2;
SRC(7,6)= (t10 + t11 + 1) >> 1;
SRC(7,7)= (t10 + 2*t11 + t12 + 2) >> 2;
}
libavcodec/h264pred.c:949: error: Uninitialized Value
The value read from t7 was never initialized.
libavcodec/h264pred.c:949:32:
947. SRC(3,7)=SRC(4,5)=SRC(5,3)=SRC(6,1)= (t6 + 2*t7 + t8 + 2) >> 2;
948. SRC(4,6)=SRC(5,4)=SRC(6,2)=SRC(7,0)= (t7 + t8 + 1) >> 1;
949. SRC(4,7)=SRC(5,5)=SRC(6,3)=SRC(7,1)= (t7 + 2*t8 + t9 + 2) >> 2;
^
950. SRC(5,6)=SRC(6,4)=SRC(7,2)= (t8 + t9 + 1) >> 1;
951. SRC(5,7)=SRC(6,5)=SRC(7,3)= (t8 + 2*t9 + t10 + 2) >> 2;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264pred.c/#L949
|
d2a_code_trace_data_41561
|
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:2298: error: NULL_DEREFERENCE
pointer `null` is dereferenced by call to `ssl_security_cert()` at line 2298, column 10.
Showing all 11 steps of the trace
ssl/t1_lib.c:2289:1: start of procedure ssl_security_cert_chain()
2287. */
2288.
2289. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
2290. {
2291. int rv, start_idx, i;
ssl/t1_lib.c:2292:9: Taking true branch
2290. {
2291. int rv, start_idx, i;
2292. if (x == NULL) {
^
2293. x = sk_X509_value(sk, 0);
2294. start_idx = 1;
ssl/t1_lib.c:2293:9:
2291. int rv, start_idx, i;
2292. if (x == NULL) {
2293. > x = sk_X509_value(sk, 0);
2294. start_idx = 1;
2295. } 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:2294:9:
2292. if (x == NULL) {
2293. x = sk_X509_value(sk, 0);
2294. > start_idx = 1;
2295. } else
2296. start_idx = 0;
ssl/t1_lib.c:2298:5:
2296. start_idx = 0;
2297.
2298. > rv = ssl_security_cert(s, NULL, x, vfy, 1);
2299. if (rv != 1)
2300. return rv;
|
https://github.com/openssl/openssl/blob/e3bc1305ec97d4ad4ab05fa59a288e92df2b2025/ssl/t1_lib.c/#L2298
|
d2a_code_trace_data_41562
|
void RAND_add(const void *buf, int num, double randomness)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth->add != NULL)
meth->add(buf, num, randomness);
}
crypto/rand/rand_lib.c:616: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 614 could be null and is dereferenced at line 616, column 9.
Showing all 14 steps of the trace
crypto/rand/rand_lib.c:612:1: start of procedure RAND_add()
610. }
611.
612. > void RAND_add(const void *buf, int num, double randomness)
613. {
614. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:614:5:
612. void RAND_add(const void *buf, int num, double randomness)
613. {
614. > const RAND_METHOD *meth = RAND_get_rand_method();
615.
616. if (meth->add != NULL)
crypto/rand/rand_lib.c:548:1: start of procedure RAND_get_rand_method()
546. }
547.
548. > const RAND_METHOD *RAND_get_rand_method(void)
549. {
550. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:550:5:
548. const RAND_METHOD *RAND_get_rand_method(void)
549. {
550. > const RAND_METHOD *tmp_meth = NULL;
551.
552. if (!RUN_ONCE(&rand_init, do_rand_init))
crypto/rand/rand_lib.c:552:10:
550. const RAND_METHOD *tmp_meth = NULL;
551.
552. > if (!RUN_ONCE(&rand_init, do_rand_init))
553. return NULL;
554.
crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once()
103. }
104.
105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
106. {
107. if (pthread_once(once, init) != 0)
crypto/threads_pthread.c:107:9: Taking true branch
105. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
106. {
107. if (pthread_once(once, init) != 0)
^
108. return 0;
109.
crypto/threads_pthread.c:108:9:
106. {
107. if (pthread_once(once, init) != 0)
108. > return 0;
109.
110. return 1;
crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once
109.
110. return 1;
111. > }
112.
113. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
crypto/rand/rand_lib.c:552:10: Condition is false
550. const RAND_METHOD *tmp_meth = NULL;
551.
552. if (!RUN_ONCE(&rand_init, do_rand_init))
^
553. return NULL;
554.
crypto/rand/rand_lib.c:552:10: Taking true branch
550. const RAND_METHOD *tmp_meth = NULL;
551.
552. if (!RUN_ONCE(&rand_init, do_rand_init))
^
553. return NULL;
554.
crypto/rand/rand_lib.c:553:9:
551.
552. if (!RUN_ONCE(&rand_init, do_rand_init))
553. > return NULL;
554.
555. CRYPTO_THREAD_write_lock(rand_meth_lock);
crypto/rand/rand_lib.c:576:1: return from a call to RAND_get_rand_method
574. CRYPTO_THREAD_unlock(rand_meth_lock);
575. return tmp_meth;
576. > }
577.
578. #ifndef OPENSSL_NO_ENGINE
crypto/rand/rand_lib.c:616:9:
614. const RAND_METHOD *meth = RAND_get_rand_method();
615.
616. > if (meth->add != NULL)
617. meth->add(buf, num, randomness);
618. }
|
https://github.com/openssl/openssl/blob/e0b625f9db00509af9004b7907d44b78f332754a/crypto/rand/rand_lib.c/#L616
|
d2a_code_trace_data_41563
|
static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile,
TIFFDirEntry* dirent,
uint64** parray,
int *pbErr)
{
TIFFDirectory *td = &tif->tif_dir;
if( pbErr )
*pbErr = 0;
if( tif->tif_flags&TIFF_DEFERSTRILELOAD )
{
if( !(tif->tif_flags&TIFF_LAZYSTRILELOAD) ||
dirent->tdir_count <= 4 )
{
if( !_TIFFFillStriles(tif) )
{
if( pbErr )
*pbErr = 1;
return 0;
}
}
else
{
if( !_TIFFFetchStrileValue(tif, strile, dirent, parray) )
{
if( pbErr )
*pbErr = 1;
return 0;
}
}
}
if( *parray == NULL || strile >= td->td_nstrips )
{
if( pbErr )
*pbErr = 1;
return 0;
}
return (*parray)[strile];
}
libtiff/tif_ojpeg.c:1995: error: Buffer Overrun S2
Offset: [`sp->in_buffer_next_strile`, +oo] Size: [0, +oo] by call to `TIFFGetStrileOffset`.
libtiff/tif_ojpeg.c:1943:1: Parameter `sp->in_buffer_next_strile`
1941. }
1942.
1943. static int
^
1944. OJPEGReadBufferFill(OJPEGState* sp)
1945. {
libtiff/tif_ojpeg.c:1995:29: Call
1993. else
1994. {
1995. sp->in_buffer_file_pos=TIFFGetStrileOffset(sp->tif, sp->in_buffer_next_strile);
^
1996. if (sp->in_buffer_file_pos!=0)
1997. {
libtiff/tif_dirread.c:6233:1: Parameter `strile`
6231.
6232. /* Return the value of the TileOffsets/StripOffsets array for the specified tile/strile */
6233. uint64 TIFFGetStrileOffset(TIFF *tif, uint32 strile)
^
6234. {
6235. return TIFFGetStrileOffsetWithErr(tif, strile, NULL);
libtiff/tif_dirread.c:6235:12: Call
6233. uint64 TIFFGetStrileOffset(TIFF *tif, uint32 strile)
6234. {
6235. return TIFFGetStrileOffsetWithErr(tif, strile, NULL);
^
6236. }
6237.
libtiff/tif_dirread.c:6239:1: Parameter `strile`
6237.
6238. /* Return the value of the TileOffsets/StripOffsets array for the specified tile/strile */
6239. uint64 TIFFGetStrileOffsetWithErr(TIFF *tif, uint32 strile, int *pbErr)
^
6240. {
6241. TIFFDirectory *td = &tif->tif_dir;
libtiff/tif_dirread.c:6242:12: Call
6240. {
6241. TIFFDirectory *td = &tif->tif_dir;
6242. return _TIFFGetStrileOffsetOrByteCountValue(tif, strile,
^
6243. &(td->td_stripoffset_entry),
6244. &(td->td_stripoffset_p), pbErr);
libtiff/tif_dirread.c:6191:1: <Offset trace>
6189. }
6190.
6191. static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile,
^
6192. TIFFDirEntry* dirent,
6193. uint64** parray,
libtiff/tif_dirread.c:6191:1: Parameter `strile`
6189. }
6190.
6191. static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile,
^
6192. TIFFDirEntry* dirent,
6193. uint64** parray,
libtiff/tif_dirread.c:6191:1: <Length trace>
6189. }
6190.
6191. static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile,
^
6192. TIFFDirEntry* dirent,
6193. uint64** parray,
libtiff/tif_dirread.c:6191:1: Parameter `**parray`
6189. }
6190.
6191. static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile,
^
6192. TIFFDirEntry* dirent,
6193. uint64** parray,
libtiff/tif_dirread.c:6229:12: Array access: Offset: [sp->in_buffer_next_strile, +oo] Size: [0, +oo] by call to `TIFFGetStrileOffset`
6227. return 0;
6228. }
6229. return (*parray)[strile];
^
6230. }
6231.
|
https://gitlab.com/libtiff/libtiff/blob/06337fdcfd19f2e5dbe99209540dbe34315f29eb/libtiff/tif_dirread.c/#L6229
|
d2a_code_trace_data_41564
|
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
if (pkt->buf->length > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = (pkt->buf->length == 0) ? DEFAULT_BUF_SIZE
: pkt->buf->length * 2;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
*allocbytes = (unsigned char *)pkt->buf->data + pkt->curr;
pkt->written += len;
pkt->curr += len;
return 1;
}
ssl/t1_lib.c:1059: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + 12]):unsigned64 by call to `WPACKET_start_sub_packet_len__`.
Showing all 10 steps of the trace
ssl/t1_lib.c:1057:21: Call
1055. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_server_name)
1056. /* Sub-packet for server_name extension */
1057. || !WPACKET_start_sub_packet_u16(pkt)
^
1058. /* Sub-packet for servername list (always 1 hostname)*/
1059. || !WPACKET_start_sub_packet_u16(pkt)
ssl/packet.c:201:1: Parameter `pkt->buf->length`
199. }
200.
201. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
202. {
203. WPACKET_SUB *sub;
ssl/t1_lib.c:1059:21: Call
1057. || !WPACKET_start_sub_packet_u16(pkt)
1058. /* Sub-packet for servername list (always 1 hostname)*/
1059. || !WPACKET_start_sub_packet_u16(pkt)
^
1060. || !WPACKET_put_bytes_u8(pkt, TLSEXT_NAMETYPE_host_name)
1061. || !WPACKET_sub_memcpy_u16(pkt, s->tlsext_hostname,
ssl/packet.c:201:1: Parameter `pkt->written`
199. }
200.
201. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
202. {
203. WPACKET_SUB *sub;
ssl/packet.c:225:10: Call
223. }
224.
225. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
^
226. return 0;
227. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */
ssl/packet.c:15:1: <LHS trace>
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: Parameter `pkt->buf->length`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: <RHS trace>
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: Parameter `len`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:25:9: Binary operation: ([0, +oo] - [0, s->s3->previous_client_finished_len + pkt->written + 12]):unsigned64 by call to `WPACKET_start_sub_packet_len__`
23. return 0;
24.
25. if (pkt->buf->length - pkt->written < len) {
^
26. size_t newlen;
27.
|
https://github.com/openssl/openssl/blob/84d5549e692e63a16fa1b11603e4098fc31746e9/ssl/packet.c/#L25
|
d2a_code_trace_data_41565
|
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:841: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 839 could be null and is dereferenced at line 841, column 9.
Showing all 14 steps of the trace
crypto/rand/rand_lib.c:837:1: start of procedure RAND_pseudo_bytes()
835.
836. #if OPENSSL_API_COMPAT < 0x10100000L
837. > int RAND_pseudo_bytes(unsigned char *buf, int num)
838. {
839. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:839:5:
837. int RAND_pseudo_bytes(unsigned char *buf, int num)
838. {
839. > const RAND_METHOD *meth = RAND_get_rand_method();
840.
841. if (meth->pseudorand != NULL)
crypto/rand/rand_lib.c:732:1: start of procedure RAND_get_rand_method()
730. }
731.
732. > const RAND_METHOD *RAND_get_rand_method(void)
733. {
734. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:734:5:
732. const RAND_METHOD *RAND_get_rand_method(void)
733. {
734. > const RAND_METHOD *tmp_meth = NULL;
735.
736. if (!RUN_ONCE(&rand_init, do_rand_init))
crypto/rand/rand_lib.c:736:10:
734. const RAND_METHOD *tmp_meth = NULL;
735.
736. > if (!RUN_ONCE(&rand_init, do_rand_init))
737. return NULL;
738.
crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once()
109. }
110.
111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
112. {
113. if (pthread_once(once, init) != 0)
crypto/threads_pthread.c:113:9: Taking true branch
111. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
112. {
113. if (pthread_once(once, init) != 0)
^
114. return 0;
115.
crypto/threads_pthread.c:114:9:
112. {
113. if (pthread_once(once, init) != 0)
114. > return 0;
115.
116. return 1;
crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once
115.
116. return 1;
117. > }
118.
119. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
crypto/rand/rand_lib.c:736:10: Condition is false
734. const RAND_METHOD *tmp_meth = NULL;
735.
736. if (!RUN_ONCE(&rand_init, do_rand_init))
^
737. return NULL;
738.
crypto/rand/rand_lib.c:736:10: Taking true branch
734. const RAND_METHOD *tmp_meth = NULL;
735.
736. if (!RUN_ONCE(&rand_init, do_rand_init))
^
737. return NULL;
738.
crypto/rand/rand_lib.c:737:9:
735.
736. if (!RUN_ONCE(&rand_init, do_rand_init))
737. > return NULL;
738.
739. CRYPTO_THREAD_write_lock(rand_meth_lock);
crypto/rand/rand_lib.c:760:1: return from a call to RAND_get_rand_method
758. CRYPTO_THREAD_unlock(rand_meth_lock);
759. return tmp_meth;
760. > }
761.
762. #ifndef OPENSSL_NO_ENGINE
crypto/rand/rand_lib.c:841:9:
839. const RAND_METHOD *meth = RAND_get_rand_method();
840.
841. > if (meth->pseudorand != NULL)
842. return meth->pseudorand(buf, num);
843. return -1;
|
https://github.com/openssl/openssl/blob/95658c32436017aeeef3d8598957071baf6769a9/crypto/rand/rand_lib.c/#L841
|
d2a_code_trace_data_41566
|
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 = ¶ms;
AVOutputFormat *file_oformat;
if (!strcmp(filename, "-"))
filename = "pipe:";
oc = avformat_alloc_context();
if (!oc) {
print_error(filename, AVERROR(ENOMEM));
av_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);
av_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);
av_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);
av_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);
}
if (use_audio) {
new_audio_stream(oc);
}
if (use_subtitle) {
new_subtitle_stream(oc);
}
oc->timestamp = rec_timestamp;
for(; metadata_count>0; metadata_count--){
av_metadata_set2(&oc->metadata, metadata[metadata_count-1].key,
metadata[metadata_count-1].value, 0);
}
av_metadata_conv(oc, oc->oformat->metadata_conv, NULL);
}
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);
av_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");
av_exit(1);
}
}
else {
fprintf(stderr,"File '%s' already exists. Exiting.\n", filename);
av_exit(1);
}
}
}
if ((err = url_fopen(&oc->pb, filename, URL_WRONLY)) < 0) {
print_error(filename, err);
av_exit(1);
}
}
memset(ap, 0, sizeof(*ap));
if (av_set_parameters(oc, ap) < 0) {
fprintf(stderr, "%s: Invalid encoding parameters\n",
oc->filename);
av_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);
}
ffmpeg.c:3661: error: Null Dereference
pointer `oc` last assigned on line 3639 could be null and is dereferenced at line 3661, column 5.
ffmpeg.c:3628:1: start of procedure opt_output_file()
3626. }
3627.
3628. static void opt_output_file(const char *filename)
^
3629. {
3630. AVFormatContext *oc;
ffmpeg.c:3633:5:
3631. int err, use_video, use_audio, use_subtitle;
3632. int input_has_video, input_has_audio, input_has_subtitle;
3633. AVFormatParameters params, *ap = ¶ms;
^
3634. AVOutputFormat *file_oformat;
3635.
ffmpeg.c:3636:10: Taking false branch
3634. AVOutputFormat *file_oformat;
3635.
3636. if (!strcmp(filename, "-"))
^
3637. filename = "pipe:";
3638.
ffmpeg.c:3639:5:
3637. filename = "pipe:";
3638.
3639. oc = avformat_alloc_context();
^
3640. if (!oc) {
3641. print_error(filename, AVERROR(ENOMEM));
libavformat/options.c:81:1: start of procedure avformat_alloc_context()
79. }
80.
81. AVFormatContext *avformat_alloc_context(void)
^
82. {
83. AVFormatContext *ic;
libavformat/options.c:84:5:
82. {
83. AVFormatContext *ic;
84. ic = av_malloc(sizeof(AVFormatContext));
^
85. if (!ic) return ic;
86. 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:85:10: Taking true branch
83. AVFormatContext *ic;
84. ic = av_malloc(sizeof(AVFormatContext));
85. if (!ic) return ic;
^
86. avformat_get_context_defaults(ic);
87. ic->av_class = &av_format_context_class;
libavformat/options.c:85:14:
83. AVFormatContext *ic;
84. ic = av_malloc(sizeof(AVFormatContext));
85. if (!ic) return ic;
^
86. avformat_get_context_defaults(ic);
87. ic->av_class = &av_format_context_class;
libavformat/options.c:89:1: return from a call to avformat_alloc_context
87. ic->av_class = &av_format_context_class;
88. return ic;
89. }
^
90.
91. #if LIBAVFORMAT_VERSION_MAJOR < 53
ffmpeg.c:3640:10: Taking true branch
3638.
3639. oc = avformat_alloc_context();
3640. if (!oc) {
^
3641. print_error(filename, AVERROR(ENOMEM));
3642. av_exit(1);
ffmpeg.c:3641:9:
3639. oc = avformat_alloc_context();
3640. if (!oc) {
3641. print_error(filename, AVERROR(ENOMEM));
^
3642. av_exit(1);
3643. }
cmdutils.c:292:1: start of procedure print_error()
290. }
291.
292. void print_error(const char *filename, int err)
^
293. {
294. char errbuf[128];
cmdutils.c:295:5:
293. {
294. char errbuf[128];
295. const char *errbuf_ptr = errbuf;
^
296.
297. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
cmdutils.c:297:9:
295. const char *errbuf_ptr = errbuf;
296.
297. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
^
298. errbuf_ptr = strerror(AVUNERROR(err));
299. 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:297:9: Taking false branch
295. const char *errbuf_ptr = errbuf;
296.
297. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
^
298. errbuf_ptr = strerror(AVUNERROR(err));
299. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
cmdutils.c:299:5:
297. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
298. errbuf_ptr = strerror(AVUNERROR(err));
299. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
^
300. }
301.
cmdutils.c:300:1: return from a call to print_error
298. errbuf_ptr = strerror(AVUNERROR(err));
299. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
300. }
^
301.
302. #define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent) \
ffmpeg.c:3642:9: Skipping av_exit(): empty list of specs
3640. if (!oc) {
3641. print_error(filename, AVERROR(ENOMEM));
3642. av_exit(1);
^
3643. }
3644.
ffmpeg.c:3645:9: Taking true branch
3643. }
3644.
3645. if (last_asked_format) {
^
3646. file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3647. if (!file_oformat) {
ffmpeg.c:3646:9: Skipping av_guess_format(): empty list of specs
3644.
3645. if (last_asked_format) {
3646. file_oformat = av_guess_format(last_asked_format, NULL, NULL);
^
3647. if (!file_oformat) {
3648. fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
ffmpeg.c:3647:14: Taking false branch
3645. if (last_asked_format) {
3646. file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3647. if (!file_oformat) {
^
3648. fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3649. av_exit(1);
ffmpeg.c:3651:9:
3649. av_exit(1);
3650. }
3651. last_asked_format = NULL;
^
3652. } else {
3653. file_oformat = av_guess_format(NULL, filename, NULL);
ffmpeg.c:3661:5:
3659. }
3660.
3661. oc->oformat = file_oformat;
^
3662. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3663.
|
https://github.com/libav/libav/blob/27241cbffe180fc92f9f519c6ea7957fc4b3b0c9/ffmpeg.c/#L3661
|
d2a_code_trace_data_41567
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
bn_check_top(b);
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/bn/bn_prime.c:198: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_copy`.
Showing all 16 steps of the trace
crypto/bn/bn_prime.c:190:10: Call
188. BN_CTX_start(ctx);
189.
190. A1 = BN_CTX_get(ctx);
^
191. A3 = BN_CTX_get(ctx);
192. A1_odd = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:229:5: Call
227. }
228. /* OK, make sure the returned bignum is "zero" */
229. BN_zero(ret);
^
230. ctx->used++;
231. CTXDBG_RET(ctx, ret);
crypto/bn/bn_lib.c:367:15: Assignment
365. a->neg = 0;
366. a->d[0] = w;
367. a->top = (w ? 1 : 0);
^
368. bn_check_top(a);
369. return 1;
crypto/bn/bn_lib.c:367:5: Assignment
365. a->neg = 0;
366. a->d[0] = w;
367. a->top = (w ? 1 : 0);
^
368. bn_check_top(a);
369. return 1;
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 `*a->d`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_lib.c:291:9: Call
289. if (a == b)
290. return a;
291. if (bn_wexpand(a, b->top) == NULL)
^
292. return NULL;
293.
crypto/bn/bn_lib.c:941:1: Parameter `*a->d`
939. }
940.
941. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
942. {
943. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:943:37: Call
941. BIGNUM *bn_wexpand(BIGNUM *a, int words)
942. {
943. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
944. }
945.
crypto/bn/bn_lib.c:246:1: Parameter `*b->d`
244. */
245.
246. > BIGNUM *bn_expand2(BIGNUM *b, int words)
247. {
248. bn_check_top(b);
crypto/bn/bn_lib.c:251:23: Call
249.
250. if (words > b->dmax) {
251. BN_ULONG *a = bn_expand_internal(b, words);
^
252. if (!a)
253. return NULL;
crypto/bn/bn_lib.c:208:1: <Offset trace>
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: Parameter `b->top`
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: <Length trace>
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:208:1: Parameter `*b->d`
206. /* This is used by bn_expand2() */
207. /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209. {
210. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:233:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_copy`
231. assert(b->top <= words);
232. if (b->top > 0)
233. memcpy(a, b->d, sizeof(*a) * b->top);
^
234.
235. return a;
|
https://github.com/openssl/openssl/blob/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_lib.c/#L233
|
d2a_code_trace_data_41568
|
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:1112: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_free`.
Showing all 16 steps of the trace
test/sslapitest.c:1079:17: Call
1077.
1078. if (!TEST_ptr(ctx = SSL_CTX_new(TLS_method()))
1079. || !TEST_ptr(ssl = SSL_new(ctx))
^
1080. || !TEST_ptr(sslbio = BIO_new(BIO_f_ssl()))
1081. || !TEST_ptr(membio1 = BIO_new(BIO_s_mem())))
ssl/ssl_lib.c:522:1: Parameter `ctx->sessions->num_items`
520. }
521.
522. > SSL *SSL_new(SSL_CTX *ctx)
523. {
524. SSL *s;
test/sslapitest.c:1112:5: Call
1110. BIO_free(membio1);
1111. BIO_free(sslbio);
1112. SSL_free(ssl);
^
1113. SSL_CTX_free(ctx);
1114.
ssl/ssl_lib.c:968:1: Parameter `s->session_ctx->sessions->num_items`
966. }
967.
968. > void SSL_free(SSL *s)
969. {
970. int i;
ssl/ssl_lib.c:999:9: Call
997. /* Make the next call work :-) */
998. if (s->session != NULL) {
999. ssl_clear_bad_session(s);
^
1000. SSL_SESSION_free(s->session);
1001. }
ssl/ssl_sess.c:1049:1: Parameter `s->session_ctx->sessions->num_items`
1047. }
1048.
1049. > int ssl_clear_bad_session(SSL *s)
1050. {
1051. if ((s->session != NULL) &&
ssl/ssl_sess.c:1054:9: Call
1052. !(s->shutdown & SSL_SENT_SHUTDOWN) &&
1053. !(SSL_in_init(s) || SSL_in_before(s))) {
1054. SSL_CTX_remove_session(s->session_ctx, s->session);
^
1055. return (1);
1056. } else
ssl/ssl_sess.c:725:1: Parameter `ctx->sessions->num_items`
723. }
724.
725. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
726. {
727. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:727:12: Call
725. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
726. {
727. return remove_session_lock(ctx, c, 1);
^
728. }
729.
ssl/ssl_sess.c:730:1: Parameter `ctx->sessions->num_items`
728. }
729.
730. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
731. {
732. SSL_SESSION *r;
ssl/ssl_sess.c:740:17: Call
738. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
739. ret = 1;
740. r = lh_SSL_SESSION_delete(ctx->sessions, c);
^
741. SSL_SESSION_list_remove(ctx, c);
742. }
ssl/ssl_locl.h:721:1: Parameter `lh->num_items`
719. } TLSEXT_INDEX;
720.
721. > DEFINE_LHASH_OF(SSL_SESSION);
722. /* Needed in ssl_cert.c */
723. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:721:1: Call
719. } TLSEXT_INDEX;
720.
721. > DEFINE_LHASH_OF(SSL_SESSION);
722. /* Needed in ssl_cert.c */
723. DEFINE_LHASH_OF(X509_NAME);
crypto/lhash/lhash.c:103:1: <LHS trace>
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:103:1: Parameter `lh->num_items`
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:123:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_free`
121. }
122.
123. lh->num_items--;
^
124. if ((lh->num_nodes > MIN_NODES) &&
125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
|
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/crypto/lhash/lhash.c/#L123
|
d2a_code_trace_data_41569
|
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:526: error: Integer Overflow L2
([1, +oo] - 3):unsigned32 by call to `bitstream_read`.
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 `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] - 3):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_41570
|
static int sbr_x_gen(SpectralBandReplication *sbr, float X[2][38][64],
const float Y0[38][64][2], const float Y1[38][64][2],
const float X_low[32][40][2], int ch)
{
int k, i;
const int i_f = 32;
const int i_Temp = FFMAX(2*sbr->data[ch].t_env_num_env_old - i_f, 0);
memset(X, 0, 2*sizeof(*X));
for (k = 0; k < sbr->kx[0]; k++) {
for (i = 0; i < i_Temp; i++) {
X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
}
}
for (; k < sbr->kx[0] + sbr->m[0]; k++) {
for (i = 0; i < i_Temp; i++) {
X[0][i][k] = Y0[i + i_f][k][0];
X[1][i][k] = Y0[i + i_f][k][1];
}
}
for (k = 0; k < sbr->kx[1]; k++) {
for (i = i_Temp; i < 38; i++) {
X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
}
}
for (; k < sbr->kx[1] + sbr->m[1]; k++) {
for (i = i_Temp; i < i_f; i++) {
X[0][i][k] = Y1[i][k][0];
X[1][i][k] = Y1[i][k][1];
}
}
return 0;
}
libavcodec/aacsbr.c:1663: error: Buffer Overrun L2
Offset: [1, 2] (⇐ [0, 1] + 1) Size: 2 by call to `sbr_x_gen`.
libavcodec/aacsbr.c:1629:1: Parameter `sbr->X[*]`
1627. }
1628.
1629. void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
^
1630. float* L, float* R)
1631. {
libavcodec/aacsbr.c:1663:9: Call
1661.
1662. /* synthesis */
1663. sbr_x_gen(sbr, sbr->X[ch],
^
1664. sbr->data[ch].Y[1-sbr->data[ch].Ypos],
1665. sbr->data[ch].Y[ sbr->data[ch].Ypos],
libavcodec/aacsbr.c:1351:1: <Length trace>
1349.
1350. /// Generate the subband filtered lowband
1351. static int sbr_x_gen(SpectralBandReplication *sbr, float X[2][38][64],
^
1352. const float Y0[38][64][2], const float Y1[38][64][2],
1353. const float X_low[32][40][2], int ch)
libavcodec/aacsbr.c:1351:1: Parameter `*X`
1349.
1350. /// Generate the subband filtered lowband
1351. static int sbr_x_gen(SpectralBandReplication *sbr, float X[2][38][64],
^
1352. const float Y0[38][64][2], const float Y1[38][64][2],
1353. const float X_low[32][40][2], int ch)
libavcodec/aacsbr.c:1362:13: Array access: Offset: [1, 2] (⇐ [0, 1] + 1) Size: 2 by call to `sbr_x_gen`
1360. for (i = 0; i < i_Temp; i++) {
1361. X[0][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][0];
1362. X[1][i][k] = X_low[k][i + ENVELOPE_ADJUSTMENT_OFFSET][1];
^
1363. }
1364. }
|
https://github.com/libav/libav/blob/cc412b71047ebf77c7e810c90b044f018a1c0c2d/libavcodec/aacsbr.c/#L1362
|
d2a_code_trace_data_41571
|
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
{
bn_check_top(b);
if (a == b)
return a;
if (bn_wexpand(a, b->top) == NULL)
return NULL;
if (b->top > 0)
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
a->top = b->top;
a->neg = b->neg;
bn_check_top(a);
return a;
}
crypto/ec/ecdsa_ossl.c:140: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `ec_group_do_inverse_ord`.
Showing all 36 steps of the trace
crypto/ec/ecdsa_ossl.c:34:1: Parameter `eckey->group->order->top`
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:82:18: Call
80.
81. /* Preallocate space */
82. order_bits = BN_num_bits(order);
^
83. if (!BN_set_bit(k, order_bits)
84. || !BN_set_bit(r, order_bits)
crypto/bn/bn_lib.c:139:9: Call
137. bn_check_top(a);
138.
139. if (BN_is_zero(a))
^
140. return 0;
141. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
crypto/bn/bn_lib.c:845:1: Parameter `a->top`
843. }
844.
845. > int BN_is_zero(const BIGNUM *a)
846. {
847. return a->top == 0;
crypto/ec/ecdsa_ossl.c:100:22: Call
98. }
99. } else {
100. if (!BN_priv_rand_range(k, order)) {
^
101. ECerr(EC_F_ECDSA_SIGN_SETUP,
102. EC_R_RANDOM_NUMBER_GENERATION_FAILED);
crypto/bn/bn_rand.c:182:1: Parameter `range->top`
180. }
181.
182. > int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
183. {
184. return bnrand_range(PRIVATE, r, range);
crypto/bn/bn_rand.c:184:12: Call
182. int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
183. {
184. return bnrand_range(PRIVATE, r, range);
^
185. }
186.
crypto/bn/bn_rand.c:113:1: Parameter `range->top`
111.
112. /* random number r: 0 <= r < range */
113. > static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range)
114. {
115. int n;
crypto/ec/ecdsa_ossl.c:132:14: Call
130. }
131. #endif
132. if (!BN_nnmod(r, X, order, ctx)) {
^
133. ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_BN_LIB);
134. goto err;
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:137:1: Parameter `divisor->top`
135. * If 'dv' or 'rm' is NULL, the respective value is not returned.
136. */
137. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
138. BN_CTX *ctx)
139. {
crypto/ec/ecdsa_ossl.c:140:10: Call
138.
139. /* compute the inverse of k */
140. if (!ec_group_do_inverse_ord(group, k, k, ctx)) {
^
141. ECerr(EC_F_ECDSA_SIGN_SETUP, ERR_R_BN_LIB);
142. goto err;
crypto/ec/ec_lib.c:1074:1: Parameter `group->order->top`
1072. * other functionality.
1073. */
1074. > int ec_group_do_inverse_ord(const EC_GROUP *group, BIGNUM *res,
1075. const BIGNUM *x, BN_CTX *ctx)
1076. {
crypto/ec/ec_lib.c:1080:16: Call
1078. return group->meth->field_inverse_mod_ord(group, res, x, ctx);
1079. else
1080. return ec_field_inverse_mod_ord(group, res, x, ctx);
^
1081. }
1082.
crypto/ec/ec_lib.c:1020:1: Parameter `group->order->top`
1018. }
1019.
1020. > static int ec_field_inverse_mod_ord(const EC_GROUP *group, BIGNUM *r,
1021. const BIGNUM *x, BN_CTX *ctx)
1022. {
crypto/ec/ec_lib.c:1043:10: Call
1041. if (!BN_set_word(e, 2))
1042. goto err;
1043. if (!BN_sub(e, group->order, e))
^
1044. goto err;
1045. /*-
crypto/bn/bn_add.c:45:1: Parameter `a->top`
43.
44. /* signed sub of b from a. */
45. > int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
46. {
47. int ret, r_neg, cmp_res;
crypto/ec/ec_lib.c:1049:10: Call
1047. * No need for scatter-gather or BN_FLG_CONSTTIME.
1048. */
1049. if (!BN_mod_exp_mont(r, x, e, group->order, ctx, group->mont_data))
^
1050. goto err;
1051.
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:596:1: Parameter `m->top`
594. * http://www.daemonology.net/hyperthreading-considered-harmful/)
595. */
596. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
597. const BIGNUM *m, BN_CTX *ctx,
598. BN_MONT_CTX *in_mont)
crypto/bn/bn_exp.c:617:10: Call
615. bn_check_top(m);
616.
617. if (!BN_is_odd(m)) {
^
618. BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
619. return 0;
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_exp.c:651:14: Call
649. if ((mont = BN_MONT_CTX_new()) == NULL)
650. goto err;
651. if (!BN_MONT_CTX_set(mont, m, ctx))
^
652. goto err;
653. }
crypto/bn/bn_mont.c:233:1: Parameter `mod->top`
231. }
232.
233. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
234. {
235. int ret = 0;
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_mont.c:245:10: Call
243. goto err;
244. R = &(mont->RR); /* grab RR as a temp */
245. if (!BN_copy(&(mont->N), mod))
^
246. goto err; /* Set N */
247. if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
crypto/bn/bn_lib.c:285:1: <Offset trace>
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_lib.c:285:1: Parameter `b->top`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_lib.c:285:1: <Length trace>
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_lib.c:285:1: Parameter `*a->d`
283. }
284.
285. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
286. {
287. bn_check_top(b);
crypto/bn/bn_lib.c:291:9: Call
289. if (a == b)
290. return a;
291. if (bn_wexpand(a, b->top) == NULL)
^
292. return NULL;
293.
crypto/bn/bn_lib.c:941:1: Parameter `*a->d`
939. }
940.
941. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
942. {
943. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:295:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `ec_group_do_inverse_ord`
293.
294. if (b->top > 0)
295. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
^
296.
297. a->top = b->top;
|
https://github.com/openssl/openssl/blob/b8c32081e02b7008a90d878eccce46da256dfe86/crypto/bn/bn_lib.c/#L295
|
d2a_code_trace_data_41572
|
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
enum AVSampleFormat sample_fmt, int align)
{
int line_size;
int sample_size = av_get_bytes_per_sample(sample_fmt);
int planar = av_sample_fmt_is_planar(sample_fmt);
if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
return AVERROR(EINVAL);
if (!align) {
if (nb_samples > INT_MAX - 31)
return AVERROR(EINVAL);
align = 1;
nb_samples = FFALIGN(nb_samples, 32);
}
if (nb_channels > INT_MAX / align ||
(int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)
return AVERROR(EINVAL);
line_size = planar ? FFALIGN(nb_samples * sample_size, align) :
FFALIGN(nb_samples * sample_size * nb_channels, align);
if (linesize)
*linesize = line_size;
return planar ? line_size * nb_channels : line_size;
}
libavcodec/anm.c:178: error: Integer Overflow L2
([1, 2147483616] + 32):signed32 by call to `av_frame_ref`.
libavcodec/anm.c:111:1: Parameter `avctx->priv_data->palette`
109. }
110.
111. static int decode_frame(AVCodecContext *avctx,
^
112. void *data, int *got_frame,
113. AVPacket *avpkt)
libavcodec/anm.c:178:16: Call
176.
177. *got_frame = 1;
178. if ((ret = av_frame_ref(data, s->frame)) < 0)
^
179. return ret;
180.
libavutil/frame.c:174:1: Parameter `src->nb_samples`
172. }
173.
174. int av_frame_ref(AVFrame *dst, const AVFrame *src)
^
175. {
176. int i, ret = 0;
libavutil/frame.c:182:5: Assignment
180. dst->height = src->height;
181. dst->channel_layout = src->channel_layout;
182. dst->nb_samples = src->nb_samples;
^
183.
184. ret = av_frame_copy_props(dst, src);
libavutil/frame.c:190:15: Call
188. /* duplicate the frame data if it's not refcounted */
189. if (!src->buf[0]) {
190. ret = av_frame_get_buffer(dst, 32);
^
191. if (ret < 0)
192. return ret;
libavutil/frame.c:161:1: Parameter `frame->nb_samples`
159. }
160.
161. int av_frame_get_buffer(AVFrame *frame, int align)
^
162. {
163. if (frame->format < 0)
libavutil/frame.c:169:16: Call
167. return get_video_buffer(frame, align);
168. else if (frame->nb_samples > 0 && frame->channel_layout)
169. return get_audio_buffer(frame, align);
^
170.
171. return AVERROR(EINVAL);
libavutil/frame.c:112:1: Parameter `frame->nb_samples`
110. }
111.
112. static int get_audio_buffer(AVFrame *frame, int align)
^
113. {
114. int channels = av_get_channel_layout_nb_channels(frame->channel_layout);
libavutil/frame.c:120:15: Call
118.
119. if (!frame->linesize[0]) {
120. ret = av_samples_get_buffer_size(&frame->linesize[0], channels,
^
121. frame->nb_samples, frame->format,
122. align);
libavutil/samplefmt.c:108:1: <LHS trace>
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:108:1: Parameter `nb_samples`
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `av_frame_ref`
122. return AVERROR(EINVAL);
123. align = 1;
124. nb_samples = FFALIGN(nb_samples, 32);
^
125. }
126.
|
https://github.com/libav/libav/blob/0e830094ad0dc251613a0aa3234d9c5c397e02e6/libavutil/samplefmt.c/#L124
|
d2a_code_trace_data_41573
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/rsa/rsa_sp800_56b_check.c:377: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `rsa_check_crt_components`.
Showing all 32 steps of the trace
crypto/rsa/rsa_sp800_56b_check.c:360:5: Call
358. return 0;
359.
360. BN_CTX_start(ctx);
^
361. r = BN_CTX_get(ctx);
362. if (r == NULL || !BN_mul(r, rsa->p, rsa->q, ctx))
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/rsa/rsa_sp800_56b_check.c:377:14: Call
375. && rsa_check_private_exponent(rsa, nbits, ctx)
376. /* 6.4.1.2.3 (Step 7): Check the CRT components */
377. && rsa_check_crt_components(rsa, ctx);
^
378. if (ret != 1)
379. RSAerr(RSA_F_RSA_SP800_56B_CHECK_KEYPAIR, RSA_R_INVALID_KEYPAIR);
crypto/rsa/rsa_sp800_56b_check.c:24:1: Parameter `ctx->stack.depth`
22. * 6.4.1.3.3: rsakpv2-crt Step 7
23. */
24. > int rsa_check_crt_components(const RSA *rsa, BN_CTX *ctx)
25. {
26. int ret = 0;
crypto/rsa/rsa_sp800_56b_check.c:36:5: Call
34. }
35.
36. BN_CTX_start(ctx);
^
37. r = BN_CTX_get(ctx);
38. p1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/rsa/rsa_sp800_56b_check.c:37:9: Call
35.
36. BN_CTX_start(ctx);
37. r = BN_CTX_get(ctx);
^
38. p1 = BN_CTX_get(ctx);
39. q1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:38:10: Call
36. BN_CTX_start(ctx);
37. r = BN_CTX_get(ctx);
38. p1 = BN_CTX_get(ctx);
^
39. q1 = BN_CTX_get(ctx);
40. ret = (q1 != NULL)
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:39:10: Call
37. r = BN_CTX_get(ctx);
38. p1 = BN_CTX_get(ctx);
39. q1 = BN_CTX_get(ctx);
^
40. ret = (q1 != NULL)
41. /* p1 = p -1 */
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_sp800_56b_check.c:57:14: Call
55. && (BN_cmp(rsa->iqmp, rsa->p) < 0)
56. /* (d) 1 = (dP . e) mod (p - 1)*/
57. && BN_mod_mul(r, rsa->dmp1, rsa->e, p1, ctx)
^
58. && BN_is_one(r)
59. /* (e) 1 = (dQ . e) mod (q - 1) */
crypto/bn/bn_mod.c:193:1: Parameter `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:27:1: Parameter `ctx->stack.depth`
25. }
26.
27. > int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
28. {
29. int max, al;
crypto/bn/bn_sqr.c: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.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_sqr.c:44:11: Call
42. BN_CTX_start(ctx);
43. rr = (a != r) ? r : BN_CTX_get(ctx);
44. tmp = BN_CTX_get(ctx);
^
45. if (rr == NULL || tmp == NULL)
46. 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_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.depth`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/bn/bn_ctx.c:191:27: Call
189. ctx->err_stack--;
190. else {
191. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
192. /* Does this stack frame have anything to release? */
193. if (fp < ctx->used)
crypto/bn/bn_ctx.c:266:1: <LHS trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:268:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `rsa_check_crt_components`
266. static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
^
269. }
270.
|
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L268
|
d2a_code_trace_data_41574
|
int speed_main(int argc, char **argv)
{
ENGINE *e = NULL;
loopargs_t *loopargs = NULL;
const char *prog;
const char *engine_id = NULL;
const EVP_CIPHER *evp_cipher = NULL;
double d = 0.0;
OPTION_CHOICE o;
int async_init = 0, multiblock = 0, pr_header = 0;
int doit[ALGOR_NUM] = { 0 };
int ret = 1, misalign = 0, lengths_single = 0, aead = 0;
long count = 0;
unsigned int size_num = OSSL_NELEM(lengths_list);
unsigned int i, k, loop, loopargs_len = 0, async_jobs = 0;
int keylen;
int buflen;
#ifndef NO_FORK
int multi = 0;
#endif
#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) \
|| !defined(OPENSSL_NO_EC)
long rsa_count = 1;
#endif
openssl_speed_sec_t seconds = { SECONDS, RSA_SECONDS, DSA_SECONDS,
ECDSA_SECONDS, ECDH_SECONDS };
#ifndef OPENSSL_NO_RC5
RC5_32_KEY rc5_ks;
#endif
#ifndef OPENSSL_NO_RC2
RC2_KEY rc2_ks;
#endif
#ifndef OPENSSL_NO_IDEA
IDEA_KEY_SCHEDULE idea_ks;
#endif
#ifndef OPENSSL_NO_SEED
SEED_KEY_SCHEDULE seed_ks;
#endif
#ifndef OPENSSL_NO_BF
BF_KEY bf_ks;
#endif
#ifndef OPENSSL_NO_CAST
CAST_KEY cast_ks;
#endif
static const unsigned char key16[16] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12
};
static const unsigned char key24[24] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34
};
static const unsigned char key32[32] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34,
0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56
};
#ifndef OPENSSL_NO_CAMELLIA
static const unsigned char ckey24[24] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34
};
static const unsigned char ckey32[32] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34,
0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56
};
CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3;
#endif
#ifndef OPENSSL_NO_DES
static DES_cblock key = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0
};
static DES_cblock key2 = {
0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12
};
static DES_cblock key3 = {
0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34
};
#endif
#ifndef OPENSSL_NO_RSA
static const unsigned int rsa_bits[RSA_NUM] = {
512, 1024, 2048, 3072, 4096, 7680, 15360
};
static const unsigned char *rsa_data[RSA_NUM] = {
test512, test1024, test2048, test3072, test4096, test7680, test15360
};
static const int rsa_data_length[RSA_NUM] = {
sizeof(test512), sizeof(test1024),
sizeof(test2048), sizeof(test3072),
sizeof(test4096), sizeof(test7680),
sizeof(test15360)
};
int rsa_doit[RSA_NUM] = { 0 };
int primes = RSA_DEFAULT_PRIME_NUM;
#endif
#ifndef OPENSSL_NO_DSA
static const unsigned int dsa_bits[DSA_NUM] = { 512, 1024, 2048 };
int dsa_doit[DSA_NUM] = { 0 };
#endif
#ifndef OPENSSL_NO_EC
static const struct {
const char *name;
unsigned int nid;
unsigned int bits;
} test_curves[] = {
{"secp160r1", NID_secp160r1, 160},
{"nistp192", NID_X9_62_prime192v1, 192},
{"nistp224", NID_secp224r1, 224},
{"nistp256", NID_X9_62_prime256v1, 256},
{"nistp384", NID_secp384r1, 384},
{"nistp521", NID_secp521r1, 521},
{"nistk163", NID_sect163k1, 163},
{"nistk233", NID_sect233k1, 233},
{"nistk283", NID_sect283k1, 283},
{"nistk409", NID_sect409k1, 409},
{"nistk571", NID_sect571k1, 571},
{"nistb163", NID_sect163r2, 163},
{"nistb233", NID_sect233r1, 233},
{"nistb283", NID_sect283r1, 283},
{"nistb409", NID_sect409r1, 409},
{"nistb571", NID_sect571r1, 571},
{"brainpoolP256r1", NID_brainpoolP256r1, 256},
{"brainpoolP256t1", NID_brainpoolP256t1, 256},
{"brainpoolP384r1", NID_brainpoolP384r1, 384},
{"brainpoolP384t1", NID_brainpoolP384t1, 384},
{"brainpoolP512r1", NID_brainpoolP512r1, 512},
{"brainpoolP512t1", NID_brainpoolP512t1, 512},
{"X25519", NID_X25519, 253},
{"X448", NID_X448, 448}
};
int ecdsa_doit[ECDSA_NUM] = { 0 };
int ecdh_doit[EC_NUM] = { 0 };
OPENSSL_assert(OSSL_NELEM(test_curves) >= EC_NUM);
#endif
prog = opt_init(argc, argv, speed_options);
while ((o = opt_next()) != OPT_EOF) {
switch (o) {
case OPT_EOF:
case OPT_ERR:
opterr:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
goto end;
case OPT_HELP:
opt_help(speed_options);
ret = 0;
goto end;
case OPT_ELAPSED:
usertime = 0;
break;
case OPT_EVP:
evp_md = NULL;
evp_cipher = EVP_get_cipherbyname(opt_arg());
if (evp_cipher == NULL)
evp_md = EVP_get_digestbyname(opt_arg());
if (evp_cipher == NULL && evp_md == NULL) {
BIO_printf(bio_err,
"%s: %s is an unknown cipher or digest\n",
prog, opt_arg());
goto end;
}
doit[D_EVP] = 1;
break;
case OPT_DECRYPT:
decrypt = 1;
break;
case OPT_ENGINE:
engine_id = opt_arg();
break;
case OPT_MULTI:
#ifndef NO_FORK
multi = atoi(opt_arg());
#endif
break;
case OPT_ASYNCJOBS:
#ifndef OPENSSL_NO_ASYNC
async_jobs = atoi(opt_arg());
if (!ASYNC_is_capable()) {
BIO_printf(bio_err,
"%s: async_jobs specified but async not supported\n",
prog);
goto opterr;
}
if (async_jobs > 99999) {
BIO_printf(bio_err, "%s: too many async_jobs\n", prog);
goto opterr;
}
#endif
break;
case OPT_MISALIGN:
if (!opt_int(opt_arg(), &misalign))
goto end;
if (misalign > MISALIGN) {
BIO_printf(bio_err,
"%s: Maximum offset is %d\n", prog, MISALIGN);
goto opterr;
}
break;
case OPT_MR:
mr = 1;
break;
case OPT_MB:
multiblock = 1;
#ifdef OPENSSL_NO_MULTIBLOCK
BIO_printf(bio_err,
"%s: -mb specified but multi-block support is disabled\n",
prog);
goto end;
#endif
break;
case OPT_R_CASES:
if (!opt_rand(o))
goto end;
break;
case OPT_PRIMES:
if (!opt_int(opt_arg(), &primes))
goto end;
break;
case OPT_SECONDS:
seconds.sym = seconds.rsa = seconds.dsa = seconds.ecdsa
= seconds.ecdh = atoi(opt_arg());
break;
case OPT_BYTES:
lengths_single = atoi(opt_arg());
lengths = &lengths_single;
size_num = 1;
break;
case OPT_AEAD:
aead = 1;
break;
}
}
argc = opt_num_rest();
argv = opt_rest();
for (; *argv; argv++) {
if (found(*argv, doit_choices, &i)) {
doit[i] = 1;
continue;
}
#ifndef OPENSSL_NO_DES
if (strcmp(*argv, "des") == 0) {
doit[D_CBC_DES] = doit[D_EDE3_DES] = 1;
continue;
}
#endif
if (strcmp(*argv, "sha") == 0) {
doit[D_SHA1] = doit[D_SHA256] = doit[D_SHA512] = 1;
continue;
}
#ifndef OPENSSL_NO_RSA
if (strcmp(*argv, "openssl") == 0)
continue;
if (strcmp(*argv, "rsa") == 0) {
for (loop = 0; loop < OSSL_NELEM(rsa_doit); loop++)
rsa_doit[loop] = 1;
continue;
}
if (found(*argv, rsa_choices, &i)) {
rsa_doit[i] = 1;
continue;
}
#endif
#ifndef OPENSSL_NO_DSA
if (strcmp(*argv, "dsa") == 0) {
dsa_doit[R_DSA_512] = dsa_doit[R_DSA_1024] =
dsa_doit[R_DSA_2048] = 1;
continue;
}
if (found(*argv, dsa_choices, &i)) {
dsa_doit[i] = 2;
continue;
}
#endif
if (strcmp(*argv, "aes") == 0) {
doit[D_CBC_128_AES] = doit[D_CBC_192_AES] = doit[D_CBC_256_AES] = 1;
continue;
}
#ifndef OPENSSL_NO_CAMELLIA
if (strcmp(*argv, "camellia") == 0) {
doit[D_CBC_128_CML] = doit[D_CBC_192_CML] = doit[D_CBC_256_CML] = 1;
continue;
}
#endif
#ifndef OPENSSL_NO_EC
if (strcmp(*argv, "ecdsa") == 0) {
for (loop = 0; loop < OSSL_NELEM(ecdsa_doit); loop++)
ecdsa_doit[loop] = 1;
continue;
}
if (found(*argv, ecdsa_choices, &i)) {
ecdsa_doit[i] = 2;
continue;
}
if (strcmp(*argv, "ecdh") == 0) {
for (loop = 0; loop < OSSL_NELEM(ecdh_doit); loop++)
ecdh_doit[loop] = 1;
continue;
}
if (found(*argv, ecdh_choices, &i)) {
ecdh_doit[i] = 2;
continue;
}
#endif
BIO_printf(bio_err, "%s: Unknown algorithm %s\n", prog, *argv);
goto end;
}
if (aead) {
if (evp_cipher == NULL) {
BIO_printf(bio_err, "-aead can be used only with an AEAD cipher\n");
goto end;
} else if (!(EVP_CIPHER_flags(evp_cipher) &
EVP_CIPH_FLAG_AEAD_CIPHER)) {
BIO_printf(bio_err, "%s is not an AEAD cipher\n",
OBJ_nid2ln(EVP_CIPHER_nid(evp_cipher)));
goto end;
}
}
if (multiblock) {
if (evp_cipher == NULL) {
BIO_printf(bio_err,"-mb can be used only with a multi-block"
" capable cipher\n");
goto end;
} else if (!(EVP_CIPHER_flags(evp_cipher) &
EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)) {
BIO_printf(bio_err, "%s is not a multi-block capable\n",
OBJ_nid2ln(EVP_CIPHER_nid(evp_cipher)));
goto end;
} else if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with -mb");
goto end;
}
}
if (async_jobs > 0) {
async_init = ASYNC_init_thread(async_jobs, async_jobs);
if (!async_init) {
BIO_printf(bio_err, "Error creating the ASYNC job pool\n");
goto end;
}
}
loopargs_len = (async_jobs == 0 ? 1 : async_jobs);
loopargs =
app_malloc(loopargs_len * sizeof(loopargs_t), "array of loopargs");
memset(loopargs, 0, loopargs_len * sizeof(loopargs_t));
for (i = 0; i < loopargs_len; i++) {
if (async_jobs > 0) {
loopargs[i].wait_ctx = ASYNC_WAIT_CTX_new();
if (loopargs[i].wait_ctx == NULL) {
BIO_printf(bio_err, "Error creating the ASYNC_WAIT_CTX\n");
goto end;
}
}
buflen = lengths[size_num - 1];
if (buflen < 36)
buflen = 36;
buflen += MAX_MISALIGNMENT + 1;
loopargs[i].buf_malloc = app_malloc(buflen, "input buffer");
loopargs[i].buf2_malloc = app_malloc(buflen, "input buffer");
memset(loopargs[i].buf_malloc, 0, buflen);
memset(loopargs[i].buf2_malloc, 0, buflen);
loopargs[i].buf = loopargs[i].buf_malloc + misalign;
loopargs[i].buf2 = loopargs[i].buf2_malloc + misalign;
#ifndef OPENSSL_NO_EC
loopargs[i].secret_a = app_malloc(MAX_ECDH_SIZE, "ECDH secret a");
loopargs[i].secret_b = app_malloc(MAX_ECDH_SIZE, "ECDH secret b");
#endif
}
#ifndef NO_FORK
if (multi && do_multi(multi, size_num))
goto show_res;
#endif
e = setup_engine(engine_id, 0);
if ((argc == 0) && !doit[D_EVP]) {
for (i = 0; i < ALGOR_NUM; i++)
if (i != D_EVP)
doit[i] = 1;
#ifndef OPENSSL_NO_RSA
for (i = 0; i < RSA_NUM; i++)
rsa_doit[i] = 1;
#endif
#ifndef OPENSSL_NO_DSA
for (i = 0; i < DSA_NUM; i++)
dsa_doit[i] = 1;
#endif
#ifndef OPENSSL_NO_EC
for (loop = 0; loop < OSSL_NELEM(ecdsa_doit); loop++)
ecdsa_doit[loop] = 1;
for (loop = 0; loop < OSSL_NELEM(ecdh_doit); loop++)
ecdh_doit[loop] = 1;
#endif
}
for (i = 0; i < ALGOR_NUM; i++)
if (doit[i])
pr_header++;
if (usertime == 0 && !mr)
BIO_printf(bio_err,
"You have chosen to measure elapsed time "
"instead of user CPU time.\n");
#ifndef OPENSSL_NO_RSA
for (i = 0; i < loopargs_len; i++) {
if (primes > RSA_DEFAULT_PRIME_NUM) {
break;
}
for (k = 0; k < RSA_NUM; k++) {
const unsigned char *p;
p = rsa_data[k];
loopargs[i].rsa_key[k] =
d2i_RSAPrivateKey(NULL, &p, rsa_data_length[k]);
if (loopargs[i].rsa_key[k] == NULL) {
BIO_printf(bio_err,
"internal error loading RSA key number %d\n", k);
goto end;
}
}
}
#endif
#ifndef OPENSSL_NO_DSA
for (i = 0; i < loopargs_len; i++) {
loopargs[i].dsa_key[0] = get_dsa(512);
loopargs[i].dsa_key[1] = get_dsa(1024);
loopargs[i].dsa_key[2] = get_dsa(2048);
}
#endif
#ifndef OPENSSL_NO_DES
DES_set_key_unchecked(&key, &sch);
DES_set_key_unchecked(&key2, &sch2);
DES_set_key_unchecked(&key3, &sch3);
#endif
AES_set_encrypt_key(key16, 128, &aes_ks1);
AES_set_encrypt_key(key24, 192, &aes_ks2);
AES_set_encrypt_key(key32, 256, &aes_ks3);
#ifndef OPENSSL_NO_CAMELLIA
Camellia_set_key(key16, 128, &camellia_ks1);
Camellia_set_key(ckey24, 192, &camellia_ks2);
Camellia_set_key(ckey32, 256, &camellia_ks3);
#endif
#ifndef OPENSSL_NO_IDEA
IDEA_set_encrypt_key(key16, &idea_ks);
#endif
#ifndef OPENSSL_NO_SEED
SEED_set_key(key16, &seed_ks);
#endif
#ifndef OPENSSL_NO_RC4
RC4_set_key(&rc4_ks, 16, key16);
#endif
#ifndef OPENSSL_NO_RC2
RC2_set_key(&rc2_ks, 16, key16, 128);
#endif
#ifndef OPENSSL_NO_RC5
RC5_32_set_key(&rc5_ks, 16, key16, 12);
#endif
#ifndef OPENSSL_NO_BF
BF_set_key(&bf_ks, 16, key16);
#endif
#ifndef OPENSSL_NO_CAST
CAST_set_key(&cast_ks, 16, key16);
#endif
#ifndef SIGALRM
# ifndef OPENSSL_NO_DES
BIO_printf(bio_err, "First we calculate the approximate speed ...\n");
count = 10;
do {
long it;
count *= 2;
Time_F(START);
for (it = count; it; it--)
DES_ecb_encrypt((DES_cblock *)loopargs[0].buf,
(DES_cblock *)loopargs[0].buf, &sch, DES_ENCRYPT);
d = Time_F(STOP);
} while (d < 3);
save_count = count;
c[D_MD2][0] = count / 10;
c[D_MDC2][0] = count / 10;
c[D_MD4][0] = count;
c[D_MD5][0] = count;
c[D_HMAC][0] = count;
c[D_SHA1][0] = count;
c[D_RMD160][0] = count;
c[D_RC4][0] = count * 5;
c[D_CBC_DES][0] = count;
c[D_EDE3_DES][0] = count / 3;
c[D_CBC_IDEA][0] = count;
c[D_CBC_SEED][0] = count;
c[D_CBC_RC2][0] = count;
c[D_CBC_RC5][0] = count;
c[D_CBC_BF][0] = count;
c[D_CBC_CAST][0] = count;
c[D_CBC_128_AES][0] = count;
c[D_CBC_192_AES][0] = count;
c[D_CBC_256_AES][0] = count;
c[D_CBC_128_CML][0] = count;
c[D_CBC_192_CML][0] = count;
c[D_CBC_256_CML][0] = count;
c[D_SHA256][0] = count;
c[D_SHA512][0] = count;
c[D_WHIRLPOOL][0] = count;
c[D_IGE_128_AES][0] = count;
c[D_IGE_192_AES][0] = count;
c[D_IGE_256_AES][0] = count;
c[D_GHASH][0] = count;
c[D_RAND][0] = count;
for (i = 1; i < size_num; i++) {
long l0, l1;
l0 = (long)lengths[0];
l1 = (long)lengths[i];
c[D_MD2][i] = c[D_MD2][0] * 4 * l0 / l1;
c[D_MDC2][i] = c[D_MDC2][0] * 4 * l0 / l1;
c[D_MD4][i] = c[D_MD4][0] * 4 * l0 / l1;
c[D_MD5][i] = c[D_MD5][0] * 4 * l0 / l1;
c[D_HMAC][i] = c[D_HMAC][0] * 4 * l0 / l1;
c[D_SHA1][i] = c[D_SHA1][0] * 4 * l0 / l1;
c[D_RMD160][i] = c[D_RMD160][0] * 4 * l0 / l1;
c[D_SHA256][i] = c[D_SHA256][0] * 4 * l0 / l1;
c[D_SHA512][i] = c[D_SHA512][0] * 4 * l0 / l1;
c[D_WHIRLPOOL][i] = c[D_WHIRLPOOL][0] * 4 * l0 / l1;
c[D_GHASH][i] = c[D_GHASH][0] * 4 * l0 / l1;
c[D_RAND][i] = c[D_RAND][0] * 4 * l0 / l1;
l0 = (long)lengths[i - 1];
c[D_RC4][i] = c[D_RC4][i - 1] * l0 / l1;
c[D_CBC_DES][i] = c[D_CBC_DES][i - 1] * l0 / l1;
c[D_EDE3_DES][i] = c[D_EDE3_DES][i - 1] * l0 / l1;
c[D_CBC_IDEA][i] = c[D_CBC_IDEA][i - 1] * l0 / l1;
c[D_CBC_SEED][i] = c[D_CBC_SEED][i - 1] * l0 / l1;
c[D_CBC_RC2][i] = c[D_CBC_RC2][i - 1] * l0 / l1;
c[D_CBC_RC5][i] = c[D_CBC_RC5][i - 1] * l0 / l1;
c[D_CBC_BF][i] = c[D_CBC_BF][i - 1] * l0 / l1;
c[D_CBC_CAST][i] = c[D_CBC_CAST][i - 1] * l0 / l1;
c[D_CBC_128_AES][i] = c[D_CBC_128_AES][i - 1] * l0 / l1;
c[D_CBC_192_AES][i] = c[D_CBC_192_AES][i - 1] * l0 / l1;
c[D_CBC_256_AES][i] = c[D_CBC_256_AES][i - 1] * l0 / l1;
c[D_CBC_128_CML][i] = c[D_CBC_128_CML][i - 1] * l0 / l1;
c[D_CBC_192_CML][i] = c[D_CBC_192_CML][i - 1] * l0 / l1;
c[D_CBC_256_CML][i] = c[D_CBC_256_CML][i - 1] * l0 / l1;
c[D_IGE_128_AES][i] = c[D_IGE_128_AES][i - 1] * l0 / l1;
c[D_IGE_192_AES][i] = c[D_IGE_192_AES][i - 1] * l0 / l1;
c[D_IGE_256_AES][i] = c[D_IGE_256_AES][i - 1] * l0 / l1;
}
# ifndef OPENSSL_NO_RSA
rsa_c[R_RSA_512][0] = count / 2000;
rsa_c[R_RSA_512][1] = count / 400;
for (i = 1; i < RSA_NUM; i++) {
rsa_c[i][0] = rsa_c[i - 1][0] / 8;
rsa_c[i][1] = rsa_c[i - 1][1] / 4;
if (rsa_doit[i] <= 1 && rsa_c[i][0] == 0)
rsa_doit[i] = 0;
else {
if (rsa_c[i][0] == 0) {
rsa_c[i][0] = 1;
rsa_c[i][1] = 20;
}
}
}
# endif
# ifndef OPENSSL_NO_DSA
dsa_c[R_DSA_512][0] = count / 1000;
dsa_c[R_DSA_512][1] = count / 1000 / 2;
for (i = 1; i < DSA_NUM; i++) {
dsa_c[i][0] = dsa_c[i - 1][0] / 4;
dsa_c[i][1] = dsa_c[i - 1][1] / 4;
if (dsa_doit[i] <= 1 && dsa_c[i][0] == 0)
dsa_doit[i] = 0;
else {
if (dsa_c[i][0] == 0) {
dsa_c[i][0] = 1;
dsa_c[i][1] = 1;
}
}
}
# endif
# ifndef OPENSSL_NO_EC
ecdsa_c[R_EC_P160][0] = count / 1000;
ecdsa_c[R_EC_P160][1] = count / 1000 / 2;
for (i = R_EC_P192; i <= R_EC_P521; i++) {
ecdsa_c[i][0] = ecdsa_c[i - 1][0] / 2;
ecdsa_c[i][1] = ecdsa_c[i - 1][1] / 2;
if (ecdsa_doit[i] <= 1 && ecdsa_c[i][0] == 0)
ecdsa_doit[i] = 0;
else {
if (ecdsa_c[i][0] == 0) {
ecdsa_c[i][0] = 1;
ecdsa_c[i][1] = 1;
}
}
}
ecdsa_c[R_EC_K163][0] = count / 1000;
ecdsa_c[R_EC_K163][1] = count / 1000 / 2;
for (i = R_EC_K233; i <= R_EC_K571; i++) {
ecdsa_c[i][0] = ecdsa_c[i - 1][0] / 2;
ecdsa_c[i][1] = ecdsa_c[i - 1][1] / 2;
if (ecdsa_doit[i] <= 1 && ecdsa_c[i][0] == 0)
ecdsa_doit[i] = 0;
else {
if (ecdsa_c[i][0] == 0) {
ecdsa_c[i][0] = 1;
ecdsa_c[i][1] = 1;
}
}
}
ecdsa_c[R_EC_B163][0] = count / 1000;
ecdsa_c[R_EC_B163][1] = count / 1000 / 2;
for (i = R_EC_B233; i <= R_EC_B571; i++) {
ecdsa_c[i][0] = ecdsa_c[i - 1][0] / 2;
ecdsa_c[i][1] = ecdsa_c[i - 1][1] / 2;
if (ecdsa_doit[i] <= 1 && ecdsa_c[i][0] == 0)
ecdsa_doit[i] = 0;
else {
if (ecdsa_c[i][0] == 0) {
ecdsa_c[i][0] = 1;
ecdsa_c[i][1] = 1;
}
}
}
ecdh_c[R_EC_P160][0] = count / 1000;
for (i = R_EC_P192; i <= R_EC_P521; i++) {
ecdh_c[i][0] = ecdh_c[i - 1][0] / 2;
if (ecdh_doit[i] <= 1 && ecdh_c[i][0] == 0)
ecdh_doit[i] = 0;
else {
if (ecdh_c[i][0] == 0) {
ecdh_c[i][0] = 1;
}
}
}
ecdh_c[R_EC_K163][0] = count / 1000;
for (i = R_EC_K233; i <= R_EC_K571; i++) {
ecdh_c[i][0] = ecdh_c[i - 1][0] / 2;
if (ecdh_doit[i] <= 1 && ecdh_c[i][0] == 0)
ecdh_doit[i] = 0;
else {
if (ecdh_c[i][0] == 0) {
ecdh_c[i][0] = 1;
}
}
}
ecdh_c[R_EC_B163][0] = count / 1000;
for (i = R_EC_B233; i <= R_EC_B571; i++) {
ecdh_c[i][0] = ecdh_c[i - 1][0] / 2;
if (ecdh_doit[i] <= 1 && ecdh_c[i][0] == 0)
ecdh_doit[i] = 0;
else {
if (ecdh_c[i][0] == 0) {
ecdh_c[i][0] = 1;
}
}
}
ecdh_c[R_EC_BRP256R1][0] = count / 1000;
for (i = R_EC_BRP384R1; i <= R_EC_BRP512R1; i += 2) {
ecdh_c[i][0] = ecdh_c[i - 2][0] / 2;
if (ecdh_doit[i] <= 1 && ecdh_c[i][0] == 0)
ecdh_doit[i] = 0;
else {
if (ecdh_c[i][0] == 0) {
ecdh_c[i][0] = 1;
}
}
}
ecdh_c[R_EC_BRP256T1][0] = count / 1000;
for (i = R_EC_BRP384T1; i <= R_EC_BRP512T1; i += 2) {
ecdh_c[i][0] = ecdh_c[i - 2][0] / 2;
if (ecdh_doit[i] <= 1 && ecdh_c[i][0] == 0)
ecdh_doit[i] = 0;
else {
if (ecdh_c[i][0] == 0) {
ecdh_c[i][0] = 1;
}
}
}
ecdh_c[R_EC_X25519][0] = count / 1800;
ecdh_c[R_EC_X448][0] = count / 7200;
# endif
# else
# error "You cannot disable DES on systems without SIGALRM."
# endif
#elif SIGALRM > 0
signal(SIGALRM, alarmed);
#endif
#ifndef OPENSSL_NO_MD2
if (doit[D_MD2]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_MD2], c[D_MD2][testnum], lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, EVP_Digest_MD2_loop, loopargs);
d = Time_F(STOP);
print_result(D_MD2, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_MDC2
if (doit[D_MDC2]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_MDC2], c[D_MDC2][testnum], lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, EVP_Digest_MDC2_loop, loopargs);
d = Time_F(STOP);
print_result(D_MDC2, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_MD4
if (doit[D_MD4]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_MD4], c[D_MD4][testnum], lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, EVP_Digest_MD4_loop, loopargs);
d = Time_F(STOP);
print_result(D_MD4, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_MD5
if (doit[D_MD5]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_MD5], c[D_MD5][testnum], lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, MD5_loop, loopargs);
d = Time_F(STOP);
print_result(D_MD5, testnum, count, d);
}
}
if (doit[D_HMAC]) {
static const char hmac_key[] = "This is a key...";
int len = strlen(hmac_key);
for (i = 0; i < loopargs_len; i++) {
loopargs[i].hctx = HMAC_CTX_new();
if (loopargs[i].hctx == NULL) {
BIO_printf(bio_err, "HMAC malloc failure, exiting...");
exit(1);
}
HMAC_Init_ex(loopargs[i].hctx, hmac_key, len, EVP_md5(), NULL);
}
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_HMAC], c[D_HMAC][testnum], lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, HMAC_loop, loopargs);
d = Time_F(STOP);
print_result(D_HMAC, testnum, count, d);
}
for (i = 0; i < loopargs_len; i++) {
HMAC_CTX_free(loopargs[i].hctx);
}
}
#endif
if (doit[D_SHA1]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_SHA1], c[D_SHA1][testnum], lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, SHA1_loop, loopargs);
d = Time_F(STOP);
print_result(D_SHA1, testnum, count, d);
}
}
if (doit[D_SHA256]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_SHA256], c[D_SHA256][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, SHA256_loop, loopargs);
d = Time_F(STOP);
print_result(D_SHA256, testnum, count, d);
}
}
if (doit[D_SHA512]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_SHA512], c[D_SHA512][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, SHA512_loop, loopargs);
d = Time_F(STOP);
print_result(D_SHA512, testnum, count, d);
}
}
#ifndef OPENSSL_NO_WHIRLPOOL
if (doit[D_WHIRLPOOL]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_WHIRLPOOL], c[D_WHIRLPOOL][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, WHIRLPOOL_loop, loopargs);
d = Time_F(STOP);
print_result(D_WHIRLPOOL, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_RMD160
if (doit[D_RMD160]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_RMD160], c[D_RMD160][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, EVP_Digest_RMD160_loop, loopargs);
d = Time_F(STOP);
print_result(D_RMD160, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_RC4
if (doit[D_RC4]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_RC4], c[D_RC4][testnum], lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, RC4_loop, loopargs);
d = Time_F(STOP);
print_result(D_RC4, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_DES
if (doit[D_CBC_DES]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_CBC_DES], c[D_CBC_DES][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, DES_ncbc_encrypt_loop, loopargs);
d = Time_F(STOP);
print_result(D_CBC_DES, testnum, count, d);
}
}
if (doit[D_EDE3_DES]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_EDE3_DES], c[D_EDE3_DES][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count =
run_benchmark(async_jobs, DES_ede3_cbc_encrypt_loop, loopargs);
d = Time_F(STOP);
print_result(D_EDE3_DES, testnum, count, d);
}
}
#endif
if (doit[D_CBC_128_AES]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_CBC_128_AES], c[D_CBC_128_AES][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count =
run_benchmark(async_jobs, AES_cbc_128_encrypt_loop, loopargs);
d = Time_F(STOP);
print_result(D_CBC_128_AES, testnum, count, d);
}
}
if (doit[D_CBC_192_AES]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_CBC_192_AES], c[D_CBC_192_AES][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count =
run_benchmark(async_jobs, AES_cbc_192_encrypt_loop, loopargs);
d = Time_F(STOP);
print_result(D_CBC_192_AES, testnum, count, d);
}
}
if (doit[D_CBC_256_AES]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_CBC_256_AES], c[D_CBC_256_AES][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count =
run_benchmark(async_jobs, AES_cbc_256_encrypt_loop, loopargs);
d = Time_F(STOP);
print_result(D_CBC_256_AES, testnum, count, d);
}
}
if (doit[D_IGE_128_AES]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_IGE_128_AES], c[D_IGE_128_AES][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count =
run_benchmark(async_jobs, AES_ige_128_encrypt_loop, loopargs);
d = Time_F(STOP);
print_result(D_IGE_128_AES, testnum, count, d);
}
}
if (doit[D_IGE_192_AES]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_IGE_192_AES], c[D_IGE_192_AES][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count =
run_benchmark(async_jobs, AES_ige_192_encrypt_loop, loopargs);
d = Time_F(STOP);
print_result(D_IGE_192_AES, testnum, count, d);
}
}
if (doit[D_IGE_256_AES]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_IGE_256_AES], c[D_IGE_256_AES][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count =
run_benchmark(async_jobs, AES_ige_256_encrypt_loop, loopargs);
d = Time_F(STOP);
print_result(D_IGE_256_AES, testnum, count, d);
}
}
if (doit[D_GHASH]) {
for (i = 0; i < loopargs_len; i++) {
loopargs[i].gcm_ctx =
CRYPTO_gcm128_new(&aes_ks1, (block128_f) AES_encrypt);
CRYPTO_gcm128_setiv(loopargs[i].gcm_ctx,
(unsigned char *)"0123456789ab", 12);
}
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_GHASH], c[D_GHASH][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, CRYPTO_gcm128_aad_loop, loopargs);
d = Time_F(STOP);
print_result(D_GHASH, testnum, count, d);
}
for (i = 0; i < loopargs_len; i++)
CRYPTO_gcm128_release(loopargs[i].gcm_ctx);
}
#ifndef OPENSSL_NO_CAMELLIA
if (doit[D_CBC_128_CML]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_128_CML]);
doit[D_CBC_128_CML] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_128_CML], c[D_CBC_128_CML][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_128_CML][testnum]); count++)
Camellia_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &camellia_ks1,
iv, CAMELLIA_ENCRYPT);
d = Time_F(STOP);
print_result(D_CBC_128_CML, testnum, count, d);
}
}
if (doit[D_CBC_192_CML]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_192_CML]);
doit[D_CBC_192_CML] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_192_CML], c[D_CBC_192_CML][testnum],
lengths[testnum], seconds.sym);
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported, exiting...");
exit(1);
}
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_192_CML][testnum]); count++)
Camellia_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &camellia_ks2,
iv, CAMELLIA_ENCRYPT);
d = Time_F(STOP);
print_result(D_CBC_192_CML, testnum, count, d);
}
}
if (doit[D_CBC_256_CML]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_256_CML]);
doit[D_CBC_256_CML] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_256_CML], c[D_CBC_256_CML][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_256_CML][testnum]); count++)
Camellia_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &camellia_ks3,
iv, CAMELLIA_ENCRYPT);
d = Time_F(STOP);
print_result(D_CBC_256_CML, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_IDEA
if (doit[D_CBC_IDEA]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_IDEA]);
doit[D_CBC_IDEA] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_IDEA], c[D_CBC_IDEA][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_IDEA][testnum]); count++)
IDEA_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &idea_ks,
iv, IDEA_ENCRYPT);
d = Time_F(STOP);
print_result(D_CBC_IDEA, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_SEED
if (doit[D_CBC_SEED]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_SEED]);
doit[D_CBC_SEED] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_SEED], c[D_CBC_SEED][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_SEED][testnum]); count++)
SEED_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &seed_ks, iv, 1);
d = Time_F(STOP);
print_result(D_CBC_SEED, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_RC2
if (doit[D_CBC_RC2]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_RC2]);
doit[D_CBC_RC2] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_RC2], c[D_CBC_RC2][testnum],
lengths[testnum], seconds.sym);
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported, exiting...");
exit(1);
}
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_RC2][testnum]); count++)
RC2_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &rc2_ks,
iv, RC2_ENCRYPT);
d = Time_F(STOP);
print_result(D_CBC_RC2, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_RC5
if (doit[D_CBC_RC5]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_RC5]);
doit[D_CBC_RC5] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_RC5], c[D_CBC_RC5][testnum],
lengths[testnum], seconds.sym);
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported, exiting...");
exit(1);
}
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_RC5][testnum]); count++)
RC5_32_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &rc5_ks,
iv, RC5_ENCRYPT);
d = Time_F(STOP);
print_result(D_CBC_RC5, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_BF
if (doit[D_CBC_BF]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_BF]);
doit[D_CBC_BF] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_BF], c[D_CBC_BF][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_BF][testnum]); count++)
BF_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &bf_ks,
iv, BF_ENCRYPT);
d = Time_F(STOP);
print_result(D_CBC_BF, testnum, count, d);
}
}
#endif
#ifndef OPENSSL_NO_CAST
if (doit[D_CBC_CAST]) {
if (async_jobs > 0) {
BIO_printf(bio_err, "Async mode is not supported with %s\n",
names[D_CBC_CAST]);
doit[D_CBC_CAST] = 0;
}
for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
print_message(names[D_CBC_CAST], c[D_CBC_CAST][testnum],
lengths[testnum], seconds.sym);
Time_F(START);
for (count = 0, run = 1; COND(c[D_CBC_CAST][testnum]); count++)
CAST_cbc_encrypt(loopargs[0].buf, loopargs[0].buf,
(size_t)lengths[testnum], &cast_ks,
iv, CAST_ENCRYPT);
d = Time_F(STOP);
print_result(D_CBC_CAST, testnum, count, d);
}
}
#endif
if (doit[D_RAND]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_RAND], c[D_RAND][testnum], lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, RAND_bytes_loop, loopargs);
d = Time_F(STOP);
print_result(D_RAND, testnum, count, d);
}
}
if (doit[D_EVP]) {
if (evp_cipher != NULL) {
int (*loopfunc)(void *args) = EVP_Update_loop;
if (multiblock && (EVP_CIPHER_flags(evp_cipher) &
EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK)) {
multiblock_speed(evp_cipher, lengths_single, &seconds);
ret = 0;
goto end;
}
names[D_EVP] = OBJ_nid2ln(EVP_CIPHER_nid(evp_cipher));
if (EVP_CIPHER_mode(evp_cipher) == EVP_CIPH_CCM_MODE) {
loopfunc = EVP_Update_loop_ccm;
} else if (aead && (EVP_CIPHER_flags(evp_cipher) &
EVP_CIPH_FLAG_AEAD_CIPHER)) {
loopfunc = EVP_Update_loop_aead;
if (lengths == lengths_list) {
lengths = aead_lengths_list;
size_num = OSSL_NELEM(aead_lengths_list);
}
}
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_EVP], save_count, lengths[testnum],
seconds.sym);
for (k = 0; k < loopargs_len; k++) {
loopargs[k].ctx = EVP_CIPHER_CTX_new();
EVP_CipherInit_ex(loopargs[k].ctx, evp_cipher, NULL, NULL,
iv, decrypt ? 0 : 1);
EVP_CIPHER_CTX_set_padding(loopargs[k].ctx, 0);
keylen = EVP_CIPHER_CTX_key_length(loopargs[k].ctx);
loopargs[k].key = app_malloc(keylen, "evp_cipher key");
EVP_CIPHER_CTX_rand_key(loopargs[k].ctx, loopargs[k].key);
EVP_CipherInit_ex(loopargs[k].ctx, NULL, NULL,
loopargs[k].key, NULL, -1);
OPENSSL_clear_free(loopargs[k].key, keylen);
}
Time_F(START);
count = run_benchmark(async_jobs, loopfunc, loopargs);
d = Time_F(STOP);
for (k = 0; k < loopargs_len; k++) {
EVP_CIPHER_CTX_free(loopargs[k].ctx);
}
print_result(D_EVP, testnum, count, d);
}
} else if (evp_md != NULL) {
names[D_EVP] = OBJ_nid2ln(EVP_MD_type(evp_md));
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_EVP], save_count, lengths[testnum],
seconds.sym);
Time_F(START);
count = run_benchmark(async_jobs, EVP_Digest_loop, loopargs);
d = Time_F(STOP);
print_result(D_EVP, testnum, count, d);
}
}
}
for (i = 0; i < loopargs_len; i++)
RAND_bytes(loopargs[i].buf, 36);
#ifndef OPENSSL_NO_RSA
for (testnum = 0; testnum < RSA_NUM; testnum++) {
int st = 0;
if (!rsa_doit[testnum])
continue;
for (i = 0; i < loopargs_len; i++) {
if (primes > 2) {
BIGNUM *bn = BN_new();
if (bn == NULL)
goto end;
if (!BN_set_word(bn, RSA_F4)) {
BN_free(bn);
goto end;
}
BIO_printf(bio_err, "Generate multi-prime RSA key for %s\n",
rsa_choices[testnum].name);
loopargs[i].rsa_key[testnum] = RSA_new();
if (loopargs[i].rsa_key[testnum] == NULL) {
BN_free(bn);
goto end;
}
if (!RSA_generate_multi_prime_key(loopargs[i].rsa_key[testnum],
rsa_bits[testnum],
primes, bn, NULL)) {
BN_free(bn);
goto end;
}
BN_free(bn);
}
st = RSA_sign(NID_md5_sha1, loopargs[i].buf, 36, loopargs[i].buf2,
&loopargs[i].siglen, loopargs[i].rsa_key[testnum]);
if (st == 0)
break;
}
if (st == 0) {
BIO_printf(bio_err,
"RSA sign failure. No RSA sign will be done.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
} else {
pkey_print_message("private", "rsa",
rsa_c[testnum][0], rsa_bits[testnum],
seconds.rsa);
Time_F(START);
count = run_benchmark(async_jobs, RSA_sign_loop, loopargs);
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R1:%ld:%d:%.2f\n"
: "%ld %u bits private RSA's in %.2fs\n",
count, rsa_bits[testnum], d);
rsa_results[testnum][0] = (double)count / d;
rsa_count = count;
}
for (i = 0; i < loopargs_len; i++) {
st = RSA_verify(NID_md5_sha1, loopargs[i].buf, 36, loopargs[i].buf2,
loopargs[i].siglen, loopargs[i].rsa_key[testnum]);
if (st <= 0)
break;
}
if (st <= 0) {
BIO_printf(bio_err,
"RSA verify failure. No RSA verify will be done.\n");
ERR_print_errors(bio_err);
rsa_doit[testnum] = 0;
} else {
pkey_print_message("public", "rsa",
rsa_c[testnum][1], rsa_bits[testnum],
seconds.rsa);
Time_F(START);
count = run_benchmark(async_jobs, RSA_verify_loop, loopargs);
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R2:%ld:%d:%.2f\n"
: "%ld %u bits public RSA's in %.2fs\n",
count, rsa_bits[testnum], d);
rsa_results[testnum][1] = (double)count / d;
}
if (rsa_count <= 1) {
for (testnum++; testnum < RSA_NUM; testnum++)
rsa_doit[testnum] = 0;
}
}
#endif
for (i = 0; i < loopargs_len; i++)
RAND_bytes(loopargs[i].buf, 36);
#ifndef OPENSSL_NO_DSA
for (testnum = 0; testnum < DSA_NUM; testnum++) {
int st = 0;
if (!dsa_doit[testnum])
continue;
for (i = 0; i < loopargs_len; i++) {
st = DSA_sign(0, loopargs[i].buf, 20, loopargs[i].buf2,
&loopargs[i].siglen, loopargs[i].dsa_key[testnum]);
if (st == 0)
break;
}
if (st == 0) {
BIO_printf(bio_err,
"DSA sign failure. No DSA sign will be done.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
} else {
pkey_print_message("sign", "dsa",
dsa_c[testnum][0], dsa_bits[testnum],
seconds.dsa);
Time_F(START);
count = run_benchmark(async_jobs, DSA_sign_loop, loopargs);
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R3:%ld:%u:%.2f\n"
: "%ld %u bits DSA signs in %.2fs\n",
count, dsa_bits[testnum], d);
dsa_results[testnum][0] = (double)count / d;
rsa_count = count;
}
for (i = 0; i < loopargs_len; i++) {
st = DSA_verify(0, loopargs[i].buf, 20, loopargs[i].buf2,
loopargs[i].siglen, loopargs[i].dsa_key[testnum]);
if (st <= 0)
break;
}
if (st <= 0) {
BIO_printf(bio_err,
"DSA verify failure. No DSA verify will be done.\n");
ERR_print_errors(bio_err);
dsa_doit[testnum] = 0;
} else {
pkey_print_message("verify", "dsa",
dsa_c[testnum][1], dsa_bits[testnum],
seconds.dsa);
Time_F(START);
count = run_benchmark(async_jobs, DSA_verify_loop, loopargs);
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R4:%ld:%u:%.2f\n"
: "%ld %u bits DSA verify in %.2fs\n",
count, dsa_bits[testnum], d);
dsa_results[testnum][1] = (double)count / d;
}
if (rsa_count <= 1) {
for (testnum++; testnum < DSA_NUM; testnum++)
dsa_doit[testnum] = 0;
}
}
#endif
#ifndef OPENSSL_NO_EC
for (testnum = 0; testnum < ECDSA_NUM; testnum++) {
int st = 1;
if (!ecdsa_doit[testnum])
continue;
for (i = 0; i < loopargs_len; i++) {
loopargs[i].ecdsa[testnum] =
EC_KEY_new_by_curve_name(test_curves[testnum].nid);
if (loopargs[i].ecdsa[testnum] == NULL) {
st = 0;
break;
}
}
if (st == 0) {
BIO_printf(bio_err, "ECDSA failure.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
} else {
for (i = 0; i < loopargs_len; i++) {
EC_KEY_precompute_mult(loopargs[i].ecdsa[testnum], NULL);
EC_KEY_generate_key(loopargs[i].ecdsa[testnum]);
st = ECDSA_sign(0, loopargs[i].buf, 20, loopargs[i].buf2,
&loopargs[i].siglen,
loopargs[i].ecdsa[testnum]);
if (st == 0)
break;
}
if (st == 0) {
BIO_printf(bio_err,
"ECDSA sign failure. No ECDSA sign will be done.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
} else {
pkey_print_message("sign", "ecdsa",
ecdsa_c[testnum][0],
test_curves[testnum].bits, seconds.ecdsa);
Time_F(START);
count = run_benchmark(async_jobs, ECDSA_sign_loop, loopargs);
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R5:%ld:%u:%.2f\n" :
"%ld %u bits ECDSA signs in %.2fs \n",
count, test_curves[testnum].bits, d);
ecdsa_results[testnum][0] = (double)count / d;
rsa_count = count;
}
for (i = 0; i < loopargs_len; i++) {
st = ECDSA_verify(0, loopargs[i].buf, 20, loopargs[i].buf2,
loopargs[i].siglen,
loopargs[i].ecdsa[testnum]);
if (st != 1)
break;
}
if (st != 1) {
BIO_printf(bio_err,
"ECDSA verify failure. No ECDSA verify will be done.\n");
ERR_print_errors(bio_err);
ecdsa_doit[testnum] = 0;
} else {
pkey_print_message("verify", "ecdsa",
ecdsa_c[testnum][1],
test_curves[testnum].bits, seconds.ecdsa);
Time_F(START);
count = run_benchmark(async_jobs, ECDSA_verify_loop, loopargs);
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R6:%ld:%u:%.2f\n"
: "%ld %u bits ECDSA verify in %.2fs\n",
count, test_curves[testnum].bits, d);
ecdsa_results[testnum][1] = (double)count / d;
}
if (rsa_count <= 1) {
for (testnum++; testnum < EC_NUM; testnum++)
ecdsa_doit[testnum] = 0;
}
}
}
for (testnum = 0; testnum < EC_NUM; testnum++) {
int ecdh_checks = 1;
if (!ecdh_doit[testnum])
continue;
for (i = 0; i < loopargs_len; i++) {
EVP_PKEY_CTX *kctx = NULL;
EVP_PKEY_CTX *test_ctx = NULL;
EVP_PKEY_CTX *ctx = NULL;
EVP_PKEY *key_A = NULL;
EVP_PKEY *key_B = NULL;
size_t outlen;
size_t test_outlen;
if (ERR_peek_error()) {
BIO_printf(bio_err,
"WARNING: the error queue contains previous unhandled errors.\n");
ERR_print_errors(bio_err);
}
kctx = EVP_PKEY_CTX_new_id(test_curves[testnum].nid, NULL);
if (!kctx) {
EVP_PKEY_CTX *pctx = NULL;
EVP_PKEY *params = NULL;
unsigned long error = ERR_peek_error();
if (error == ERR_peek_last_error() &&
ERR_GET_LIB(error) == ERR_LIB_EVP &&
ERR_GET_FUNC(error) == EVP_F_INT_CTX_NEW &&
ERR_GET_REASON(error) == EVP_R_UNSUPPORTED_ALGORITHM)
ERR_get_error();
if (ERR_peek_error()) {
BIO_printf(bio_err,
"Unhandled error in the error queue during ECDH init.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
break;
}
if (
!(pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) ||
!EVP_PKEY_paramgen_init(pctx) ||
!EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx,
test_curves
[testnum].nid) ||
!EVP_PKEY_paramgen(pctx, ¶ms)) {
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH EC params init failure.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
break;
}
kctx = EVP_PKEY_CTX_new(params, NULL);
EVP_PKEY_free(params);
params = NULL;
EVP_PKEY_CTX_free(pctx);
pctx = NULL;
}
if (kctx == NULL ||
!EVP_PKEY_keygen_init(kctx) ) {
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH keygen failure.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
break;
}
if (!EVP_PKEY_keygen(kctx, &key_A) ||
!EVP_PKEY_keygen(kctx, &key_B) ||
!(ctx = EVP_PKEY_CTX_new(key_A, NULL)) ||
!EVP_PKEY_derive_init(ctx) ||
!EVP_PKEY_derive_set_peer(ctx, key_B) ||
!EVP_PKEY_derive(ctx, NULL, &outlen) ||
outlen == 0 ||
outlen > MAX_ECDH_SIZE ) {
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH key generation failure.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
break;
}
if (!(test_ctx = EVP_PKEY_CTX_new(key_B, NULL)) ||
!EVP_PKEY_derive_init(test_ctx) ||
!EVP_PKEY_derive_set_peer(test_ctx, key_A) ||
!EVP_PKEY_derive(test_ctx, NULL, &test_outlen) ||
!EVP_PKEY_derive(ctx, loopargs[i].secret_a, &outlen) ||
!EVP_PKEY_derive(test_ctx, loopargs[i].secret_b, &test_outlen) ||
test_outlen != outlen ) {
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH computation failure.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
break;
}
if (CRYPTO_memcmp(loopargs[i].secret_a,
loopargs[i].secret_b, outlen)) {
ecdh_checks = 0;
BIO_printf(bio_err, "ECDH computations don't match.\n");
ERR_print_errors(bio_err);
rsa_count = 1;
break;
}
loopargs[i].ecdh_ctx[testnum] = ctx;
loopargs[i].outlen[testnum] = outlen;
EVP_PKEY_free(key_A);
EVP_PKEY_free(key_B);
EVP_PKEY_CTX_free(kctx);
kctx = NULL;
EVP_PKEY_CTX_free(test_ctx);
test_ctx = NULL;
}
if (ecdh_checks != 0) {
pkey_print_message("", "ecdh",
ecdh_c[testnum][0],
test_curves[testnum].bits, seconds.ecdh);
Time_F(START);
count =
run_benchmark(async_jobs, ECDH_EVP_derive_key_loop, loopargs);
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R7:%ld:%d:%.2f\n" :
"%ld %u-bits ECDH ops in %.2fs\n", count,
test_curves[testnum].bits, d);
ecdh_results[testnum][0] = (double)count / d;
rsa_count = count;
}
if (rsa_count <= 1) {
for (testnum++; testnum < OSSL_NELEM(ecdh_doit); testnum++)
ecdh_doit[testnum] = 0;
}
}
#endif
#ifndef NO_FORK
show_res:
#endif
if (!mr) {
printf("%s\n", OpenSSL_version(OPENSSL_VERSION));
printf("%s\n", OpenSSL_version(OPENSSL_BUILT_ON));
printf("options:");
printf("%s ", BN_options());
#ifndef OPENSSL_NO_MD2
printf("%s ", MD2_options());
#endif
#ifndef OPENSSL_NO_RC4
printf("%s ", RC4_options());
#endif
#ifndef OPENSSL_NO_DES
printf("%s ", DES_options());
#endif
printf("%s ", AES_options());
#ifndef OPENSSL_NO_IDEA
printf("%s ", IDEA_options());
#endif
#ifndef OPENSSL_NO_BF
printf("%s ", BF_options());
#endif
printf("\n%s\n", OpenSSL_version(OPENSSL_CFLAGS));
}
if (pr_header) {
if (mr)
printf("+H");
else {
printf
("The 'numbers' are in 1000s of bytes per second processed.\n");
printf("type ");
}
for (testnum = 0; testnum < size_num; testnum++)
printf(mr ? ":%d" : "%7d bytes", lengths[testnum]);
printf("\n");
}
for (k = 0; k < ALGOR_NUM; k++) {
if (!doit[k])
continue;
if (mr)
printf("+F:%u:%s", k, names[k]);
else
printf("%-13s", names[k]);
for (testnum = 0; testnum < size_num; testnum++) {
if (results[k][testnum] > 10000 && !mr)
printf(" %11.2fk", results[k][testnum] / 1e3);
else
printf(mr ? ":%.2f" : " %11.2f ", results[k][testnum]);
}
printf("\n");
}
#ifndef OPENSSL_NO_RSA
testnum = 1;
for (k = 0; k < RSA_NUM; k++) {
if (!rsa_doit[k])
continue;
if (testnum && !mr) {
printf("%18ssign verify sign/s verify/s\n", " ");
testnum = 0;
}
if (mr)
printf("+F2:%u:%u:%f:%f\n",
k, rsa_bits[k], rsa_results[k][0], rsa_results[k][1]);
else
printf("rsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
rsa_bits[k], 1.0 / rsa_results[k][0], 1.0 / rsa_results[k][1],
rsa_results[k][0], rsa_results[k][1]);
}
#endif
#ifndef OPENSSL_NO_DSA
testnum = 1;
for (k = 0; k < DSA_NUM; k++) {
if (!dsa_doit[k])
continue;
if (testnum && !mr) {
printf("%18ssign verify sign/s verify/s\n", " ");
testnum = 0;
}
if (mr)
printf("+F3:%u:%u:%f:%f\n",
k, dsa_bits[k], dsa_results[k][0], dsa_results[k][1]);
else
printf("dsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\n",
dsa_bits[k], 1.0 / dsa_results[k][0], 1.0 / dsa_results[k][1],
dsa_results[k][0], dsa_results[k][1]);
}
#endif
#ifndef OPENSSL_NO_EC
testnum = 1;
for (k = 0; k < OSSL_NELEM(ecdsa_doit); k++) {
if (!ecdsa_doit[k])
continue;
if (testnum && !mr) {
printf("%30ssign verify sign/s verify/s\n", " ");
testnum = 0;
}
if (mr)
printf("+F4:%u:%u:%f:%f\n",
k, test_curves[k].bits,
ecdsa_results[k][0], ecdsa_results[k][1]);
else
printf("%4u bits ecdsa (%s) %8.4fs %8.4fs %8.1f %8.1f\n",
test_curves[k].bits, test_curves[k].name,
1.0 / ecdsa_results[k][0], 1.0 / ecdsa_results[k][1],
ecdsa_results[k][0], ecdsa_results[k][1]);
}
testnum = 1;
for (k = 0; k < EC_NUM; k++) {
if (!ecdh_doit[k])
continue;
if (testnum && !mr) {
printf("%30sop op/s\n", " ");
testnum = 0;
}
if (mr)
printf("+F5:%u:%u:%f:%f\n",
k, test_curves[k].bits,
ecdh_results[k][0], 1.0 / ecdh_results[k][0]);
else
printf("%4u bits ecdh (%s) %8.4fs %8.1f\n",
test_curves[k].bits, test_curves[k].name,
1.0 / ecdh_results[k][0], ecdh_results[k][0]);
}
#endif
ret = 0;
end:
ERR_print_errors(bio_err);
for (i = 0; i < loopargs_len; i++) {
OPENSSL_free(loopargs[i].buf_malloc);
OPENSSL_free(loopargs[i].buf2_malloc);
#ifndef OPENSSL_NO_RSA
for (k = 0; k < RSA_NUM; k++)
RSA_free(loopargs[i].rsa_key[k]);
#endif
#ifndef OPENSSL_NO_DSA
for (k = 0; k < DSA_NUM; k++)
DSA_free(loopargs[i].dsa_key[k]);
#endif
#ifndef OPENSSL_NO_EC
for (k = 0; k < ECDSA_NUM; k++)
EC_KEY_free(loopargs[i].ecdsa[k]);
for (k = 0; k < EC_NUM; k++)
EVP_PKEY_CTX_free(loopargs[i].ecdh_ctx[k]);
OPENSSL_free(loopargs[i].secret_a);
OPENSSL_free(loopargs[i].secret_b);
#endif
}
if (async_jobs > 0) {
for (i = 0; i < loopargs_len; i++)
ASYNC_WAIT_CTX_free(loopargs[i].wait_ctx);
}
if (async_init) {
ASYNC_cleanup_thread();
}
OPENSSL_free(loopargs);
release_engine(e);
return ret;
}
apps/speed.c:1693: error: INTEGER_OVERFLOW_L2
([0, 6] - 1):unsigned32.
Showing all 3 steps of the trace
apps/speed.c:1326:5: <LHS trace>
1324. int ret = 1, misalign = 0, lengths_single = 0, aead = 0;
1325. long count = 0;
1326. unsigned int size_num = OSSL_NELEM(lengths_list);
^
1327. unsigned int i, k, loop, loopargs_len = 0, async_jobs = 0;
1328. int keylen;
apps/speed.c:1326:5: Assignment
1324. int ret = 1, misalign = 0, lengths_single = 0, aead = 0;
1325. long count = 0;
1326. unsigned int size_num = OSSL_NELEM(lengths_list);
^
1327. unsigned int i, k, loop, loopargs_len = 0, async_jobs = 0;
1328. int keylen;
apps/speed.c:1693:18: Binary operation: ([0, 6] - 1):unsigned32
1691. }
1692.
1693. buflen = lengths[size_num - 1];
^
1694. if (buflen < 36) /* size of random vector in RSA bencmark */
1695. buflen = 36;
|
https://github.com/openssl/openssl/blob/c869c3ada944bc42a6c00e0433c9d523c4426cde/apps/speed.c/#L1693
|
d2a_code_trace_data_41575
|
int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
int md_nid, EVP_PBE_KEYGEN *keygen)
{
EVP_PBE_CTL *pbe_tmp;
if (pbe_algs == NULL) {
pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp);
if (pbe_algs == NULL)
goto err;
}
if ((pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp))) == NULL)
goto err;
pbe_tmp->pbe_type = pbe_type;
pbe_tmp->pbe_nid = pbe_nid;
pbe_tmp->cipher_nid = cipher_nid;
pbe_tmp->md_nid = md_nid;
pbe_tmp->keygen = keygen;
sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp);
return 1;
err:
EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE, ERR_R_MALLOC_FAILURE);
return 0;
}
crypto/evp/evp_pbe.c:226: error: MEMORY_LEAK
memory dynamically allocated by call to `CRYPTO_malloc()` at line 217, column 20 is not reachable after line 226, column 5.
Showing all 40 steps of the trace
crypto/evp/evp_pbe.c:206:1: start of procedure EVP_PBE_alg_add_type()
204. /* Add a PBE algorithm */
205.
206. > int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,
207. int md_nid, EVP_PBE_KEYGEN *keygen)
208. {
crypto/evp/evp_pbe.c:211:9: Taking false branch
209. EVP_PBE_CTL *pbe_tmp;
210.
211. if (pbe_algs == NULL) {
^
212. pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp);
213. if (pbe_algs == NULL)
crypto/evp/evp_pbe.c:217:9:
215. }
216.
217. > if ((pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp))) == NULL)
218. goto err;
219.
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/evp/evp_pbe.c:217:9: Taking false branch
215. }
216.
217. if ((pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp))) == NULL)
^
218. goto err;
219.
crypto/evp/evp_pbe.c:220:5:
218. goto err;
219.
220. > pbe_tmp->pbe_type = pbe_type;
221. pbe_tmp->pbe_nid = pbe_nid;
222. pbe_tmp->cipher_nid = cipher_nid;
crypto/evp/evp_pbe.c:221:5:
219.
220. pbe_tmp->pbe_type = pbe_type;
221. > pbe_tmp->pbe_nid = pbe_nid;
222. pbe_tmp->cipher_nid = cipher_nid;
223. pbe_tmp->md_nid = md_nid;
crypto/evp/evp_pbe.c:222:5:
220. pbe_tmp->pbe_type = pbe_type;
221. pbe_tmp->pbe_nid = pbe_nid;
222. > pbe_tmp->cipher_nid = cipher_nid;
223. pbe_tmp->md_nid = md_nid;
224. pbe_tmp->keygen = keygen;
crypto/evp/evp_pbe.c:223:5:
221. pbe_tmp->pbe_nid = pbe_nid;
222. pbe_tmp->cipher_nid = cipher_nid;
223. > pbe_tmp->md_nid = md_nid;
224. pbe_tmp->keygen = keygen;
225.
crypto/evp/evp_pbe.c:224:5:
222. pbe_tmp->cipher_nid = cipher_nid;
223. pbe_tmp->md_nid = md_nid;
224. > pbe_tmp->keygen = keygen;
225.
226. sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp);
crypto/evp/evp_pbe.c:226:5:
224. pbe_tmp->keygen = keygen;
225.
226. > sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp);
227. return 1;
228.
crypto/evp/evp_locl.h:300:1: start of procedure sk_EVP_PBE_CTL_push()
298.
299. typedef struct evp_pbe_st EVP_PBE_CTL;
300. > DEFINE_STACK_OF(EVP_PBE_CTL)
crypto/stack/stack.c:259:1: start of procedure sk_push()
257. }
258.
259. > int sk_push(_STACK *st, void *data)
260. {
261. return (sk_insert(st, data, st->num));
crypto/stack/stack.c:261:5:
259. int sk_push(_STACK *st, void *data)
260. {
261. > return (sk_insert(st, data, st->num));
262. }
263.
crypto/stack/stack.c:167:1: start of procedure sk_insert()
165. }
166.
167. > int sk_insert(_STACK *st, void *data, int loc)
168. {
169. char **s;
crypto/stack/stack.c:171:9: Taking false branch
169. char **s;
170.
171. if (st == NULL)
^
172. return 0;
173. if (st->num_alloc <= st->num + 1) {
crypto/stack/stack.c:173:9: Taking true branch
171. if (st == NULL)
172. return 0;
173. if (st->num_alloc <= st->num + 1) {
^
174. s = OPENSSL_realloc((char *)st->data,
175. (unsigned int)sizeof(char *) * st->num_alloc * 2);
crypto/stack/stack.c:174:9:
172. return 0;
173. if (st->num_alloc <= st->num + 1) {
174. > s = OPENSSL_realloc((char *)st->data,
175. (unsigned int)sizeof(char *) * st->num_alloc * 2);
176. if (s == NULL)
crypto/mem.c:166:1: start of procedure 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:168:9: Taking true branch
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
167. {
168. if (str == NULL)
^
169. return CRYPTO_malloc(num, file, line);
170.
crypto/mem.c:169:9:
167. {
168. if (str == NULL)
169. > return CRYPTO_malloc(num, file, line);
170.
171. if (num == 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 true branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:125:9:
123.
124. if (num <= 0)
125. > return NULL;
126.
127. allow_customize = 0;
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:191:1: return from a call to CRYPTO_realloc
189. return realloc(str, num);
190.
191. > }
192.
193. void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,
crypto/stack/stack.c:176:13: Taking true branch
174. s = OPENSSL_realloc((char *)st->data,
175. (unsigned int)sizeof(char *) * st->num_alloc * 2);
176. if (s == NULL)
^
177. return (0);
178. st->data = s;
crypto/stack/stack.c:177:13:
175. (unsigned int)sizeof(char *) * st->num_alloc * 2);
176. if (s == NULL)
177. > return (0);
178. st->data = s;
179. st->num_alloc *= 2;
crypto/stack/stack.c:191:1: return from a call to sk_insert
189. st->sorted = 0;
190. return (st->num);
191. > }
192.
193. void *sk_delete_ptr(_STACK *st, void *p)
crypto/stack/stack.c:262:1: return from a call to sk_push
260. {
261. return (sk_insert(st, data, st->num));
262. > }
263.
264. int sk_unshift(_STACK *st, void *data)
crypto/evp/evp_locl.h:300:1: return from a call to sk_EVP_PBE_CTL_push
298.
299. typedef struct evp_pbe_st EVP_PBE_CTL;
300. > DEFINE_STACK_OF(EVP_PBE_CTL)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/evp/evp_pbe.c/#L226
|
d2a_code_trace_data_41576
|
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
{
int i, nw, lb, rb;
BN_ULONG *t, *f;
BN_ULONG l;
bn_check_top(r);
bn_check_top(a);
if (n < 0) {
BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
return 0;
}
r->neg = a->neg;
nw = n / BN_BITS2;
if (bn_wexpand(r, a->top + nw + 1) == NULL)
return (0);
lb = n % BN_BITS2;
rb = BN_BITS2 - lb;
f = a->d;
t = r->d;
t[a->top + nw] = 0;
if (lb == 0)
for (i = a->top - 1; i >= 0; i--)
t[nw + i] = f[i];
else
for (i = a->top - 1; i >= 0; i--) {
l = f[i];
t[nw + i + 1] |= (l >> rb) & BN_MASK2;
t[nw + i] = (l << lb) & BN_MASK2;
}
memset(t, 0, sizeof(*t) * nw);
r->top = a->top + nw + 1;
bn_correct_top(r);
bn_check_top(r);
return (1);
}
crypto/rsa/rsa_gen.c:83: error: BUFFER_OVERRUN_L3
Offset: [1, +oo] Size: [0, 8388607] by call to `BN_generate_prime_ex`.
Showing all 20 steps of the trace
crypto/rsa/rsa_gen.c:78:9: Call
76. goto err;
77.
78. if (BN_copy(rsa->e, e_value) == NULL)
^
79. goto err;
80.
crypto/bn/bn_lib.c:362:1: Parameter `a->top`
360. }
361.
362. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
363. {
364. int i;
crypto/rsa/rsa_gen.c:83:14: Call
81. /* generate p and q */
82. for (;;) {
83. if (!BN_generate_prime_ex(rsa->p, bitsp, 0, NULL, NULL, cb))
^
84. goto err;
85. if (!BN_sub(r2, rsa->p, BN_value_one()))
crypto/bn/bn_prime.c:101:1: Parameter `add->top`
99. }
100.
101. > int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe,
102. const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb)
103. {
crypto/bn/bn_prime.c:142:18: Call
140. goto err;
141. } else {
142. if (!bn_probable_prime_dh(ret, bits, add, rem, ctx))
^
143. goto err;
144. }
crypto/bn/bn_prime.c:494:1: Parameter `add->top`
492. }
493.
494. > int bn_probable_prime_dh(BIGNUM *rnd, int bits,
495. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
496. {
crypto/bn/bn_prime.c:509:10: Call
507. /* we need ((rnd-rem) % add) == 0 */
508.
509. if (!BN_mod(t1, rnd, add, ctx))
^
510. goto err;
511. if (!BN_sub(rnd, rnd, t1))
crypto/bn/bn_div.c:205:31: Call
203.
204. /* First we normalise the numbers */
205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
^
206. if (!(BN_lshift(sdiv, divisor, norm_shift)))
207. goto err;
crypto/bn/bn_lib.c:167:9: Assignment
165.
166. if (BN_is_zero(a))
167. return 0;
^
168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
169. }
crypto/bn/bn_div.c:205:5: Assignment
203.
204. /* First we normalise the numbers */
205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
^
206. if (!(BN_lshift(sdiv, divisor, norm_shift)))
207. goto err;
crypto/bn/bn_div.c:206:11: Call
204. /* First we normalise the numbers */
205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
206. if (!(BN_lshift(sdiv, divisor, norm_shift)))
^
207. goto err;
208. sdiv->neg = 0;
crypto/bn/bn_shift.c: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 `BN_generate_prime_ex`
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/d7c42d71ba407a4b3c26ed58263ae225976bbac3/crypto/bn/bn_shift.c/#L110
|
d2a_code_trace_data_41577
|
static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, i, type, size, pts, flags, is_audio, next, pos;
AVStream *st = NULL;
for(;;){
pos = url_ftell(s->pb);
url_fskip(s->pb, 4);
type = get_byte(s->pb);
size = get_be24(s->pb);
pts = get_be24(s->pb);
pts |= get_byte(s->pb) << 24;
if (url_feof(s->pb))
return AVERROR(EIO);
url_fskip(s->pb, 3);
flags = 0;
if(size == 0)
continue;
next= size + url_ftell(s->pb);
if (type == FLV_TAG_TYPE_AUDIO) {
is_audio=1;
flags = get_byte(s->pb);
} else if (type == FLV_TAG_TYPE_VIDEO) {
is_audio=0;
flags = get_byte(s->pb);
} else {
if (type == FLV_TAG_TYPE_META && size > 13+1+4)
flv_read_metabody(s, next);
else
av_log(s, AV_LOG_ERROR, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags);
url_fseek(s->pb, next, SEEK_SET);
continue;
}
for(i=0;i<s->nb_streams;i++) {
st = s->streams[i];
if (st->id == is_audio)
break;
}
if(i == s->nb_streams){
av_log(NULL, AV_LOG_ERROR, "invalid stream\n");
st= create_stream(s, is_audio);
}
if( (st->discard >= AVDISCARD_NONKEY && !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY || is_audio))
||(st->discard >= AVDISCARD_BIDIR && ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_DISP_INTER && !is_audio))
|| st->discard >= AVDISCARD_ALL
){
url_fseek(s->pb, next, SEEK_SET);
continue;
}
if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
av_add_index_entry(st, pos, pts, size, 0, AVINDEX_KEYFRAME);
break;
}
if(!url_is_streamed(s->pb) && s->duration==AV_NOPTS_VALUE){
int size;
const int pos= url_ftell(s->pb);
const int fsize= url_fsize(s->pb);
url_fseek(s->pb, fsize-4, SEEK_SET);
size= get_be32(s->pb);
url_fseek(s->pb, fsize-3-size, SEEK_SET);
if(size == get_be24(s->pb) + 11){
s->duration= get_be24(s->pb) * (int64_t)AV_TIME_BASE / 1000;
}
url_fseek(s->pb, pos, SEEK_SET);
}
if(is_audio){
if(!st->codec->sample_rate || !st->codec->bits_per_sample || (!st->codec->codec_id && !st->codec->codec_tag)) {
st->codec->channels = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1;
if((flags & FLV_AUDIO_CODECID_MASK) == FLV_CODECID_NELLYMOSER_8HZ_MONO)
st->codec->sample_rate= 8000;
else
st->codec->sample_rate = (44100 << ((flags & FLV_AUDIO_SAMPLERATE_MASK) >> FLV_AUDIO_SAMPLERATE_OFFSET) >> 3);
st->codec->bits_per_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8;
flv_set_audio_codec(s, st, flags & FLV_AUDIO_CODECID_MASK);
}
}else{
size -= flv_set_video_codec(s, st, flags & FLV_VIDEO_CODECID_MASK);
}
ret= av_get_packet(s->pb, pkt, size - 1);
if (ret <= 0) {
return AVERROR(EIO);
}
pkt->size = ret;
pkt->pts = pts;
pkt->stream_index = st->index;
if (is_audio || ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY))
pkt->flags |= PKT_FLAG_KEY;
return ret;
}
libavformat/flvdec.c:354: error: Uninitialized Value
The value read from flags was never initialized.
libavformat/flvdec.c:354:35:
352. if(is_audio){
353. if(!st->codec->sample_rate || !st->codec->bits_per_sample || (!st->codec->codec_id && !st->codec->codec_tag)) {
354. st->codec->channels = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1;
^
355. if((flags & FLV_AUDIO_CODECID_MASK) == FLV_CODECID_NELLYMOSER_8HZ_MONO)
356. st->codec->sample_rate= 8000;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/flvdec.c/#L354
|
d2a_code_trace_data_41578
|
static void compute_lpc_coefs(const double *autoc, int max_order,
double lpc[][MAX_LPC_ORDER], double *ref)
{
int i, j, i2;
double r, err, tmp;
double lpc_tmp[MAX_LPC_ORDER];
for(i=0; i<max_order; i++) lpc_tmp[i] = 0;
err = autoc[0];
for(i=0; i<max_order; i++) {
r = -autoc[i+1];
for(j=0; j<i; j++) {
r -= lpc_tmp[j] * autoc[i-j];
}
r /= err;
ref[i] = fabs(r);
err *= 1.0 - (r * r);
i2 = (i >> 1);
lpc_tmp[i] = r;
for(j=0; j<i2; j++) {
tmp = lpc_tmp[j];
lpc_tmp[j] += r * lpc_tmp[i-1-j];
lpc_tmp[i-1-j] += r * tmp;
}
if(i & 1) {
lpc_tmp[j] += lpc_tmp[j] * r;
}
for(j=0; j<=i; j++) {
lpc[i][j] = -lpc_tmp[j];
}
}
}
libavcodec/flacenc.c:655: error: Uninitialized Value
The value read from lpc_tmp[_] was never initialized.
libavcodec/flacenc.c:655:11:
653. r = -autoc[i+1];
654. for(j=0; j<i; j++) {
655. r -= lpc_tmp[j] * autoc[i-j];
^
656. }
657. r /= err;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/flacenc.c/#L655
|
d2a_code_trace_data_41579
|
static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
int src_index, int ref_index, int const penalty_factor,
int size, int h, int flags)
{
MotionEstContext * const c= &s->me;
me_cmp_func cmpf, chroma_cmpf;
int dia_size;
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
for(dia_size=1; dia_size<=c->dia_size; dia_size++){
int dir, start, end;
const int x= best[0];
const int y= best[1];
start= FFMAX(0, y + dia_size - ymax);
end = FFMIN(dia_size, xmax - x + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dir , y + dia_size - dir);
}
start= FFMAX(0, x + dia_size - xmax);
end = FFMIN(dia_size, y - ymin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dia_size - dir, y - dir );
}
start= FFMAX(0, -y + dia_size + ymin );
end = FFMIN(dia_size, x - xmin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dir , y - dia_size + dir);
}
start= FFMAX(0, -x + dia_size + xmin );
end = FFMIN(dia_size, ymax - y + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dia_size + dir, y + dir );
}
if(x!=best[0] || y!=best[1])
dia_size=0;
#if 0
{
int dx, dy, i;
static int stats[8*8];
dx= FFABS(x-best[0]);
dy= FFABS(y-best[1]);
stats[dy*8 + dx] ++;
if(256*256*256*64 % (stats[0]+1)==0){
for(i=0; i<64; i++){
if((i&7)==0) printf("\n");
printf("%6d ", stats[i]);
}
printf("\n");
}
}
#endif
}
return dmin;
}
libavcodec/motion_est_template.c:925: error: Uninitialized Value
The value read from ymin was never initialized.
libavcodec/motion_est_template.c:925:16:
923.
924. start= FFMAX(0, x + dia_size - xmax);
925. end = FFMIN(dia_size, y - ymin + 1);
^
926. for(dir= start; dir<end; dir++){
927. int d;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L925
|
d2a_code_trace_data_41580
|
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:617: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`.
libavcodec/takdec.c:615:24: Call
613. return AVERROR_INVALIDDATA;
614.
615. dshift = bits_esc4(bc);
^
616. filter_order = 8 << bitstream_read_bit(bc);
617. dval1 = bitstream_read_bit(bc);
libavcodec/takdec.c:370:16: Call
368. {
369. if (bitstream_read_bit(bc))
370. return bitstream_read(bc, 4) + 1;
^
371. else
372. return 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:616:29: Call
614.
615. dshift = bits_esc4(bc);
616. filter_order = 8 << bitstream_read_bit(bc);
^
617. dval1 = bitstream_read_bit(bc);
618. dval2 = bitstream_read_bit(bc);
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:617:24: Call
615. dshift = bits_esc4(bc);
616. filter_order = 8 << bitstream_read_bit(bc);
617. dval1 = bitstream_read_bit(bc);
^
618. dval2 = bitstream_read_bit(bc);
619.
libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
143.
144. /* Return one bit from the buffer. */
145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
^
146. {
147. if (!bc->bits_left)
libavcodec/bitstream.h:150:12: Call
148. refill_64(bc);
149.
150. return get_val(bc, 1);
^
151. }
152.
libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `n`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `bitstream_read_bit`
137. bc->bits <<= n;
138. #endif
139. bc->bits_left -= n;
^
140.
141. return ret;
|
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
|
d2a_code_trace_data_41581
|
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:1914: error: INTEGER_OVERFLOW_L2
([0, 17728] - [256, 17984]):unsigned64 by call to `dtls1_process_record`.
Showing all 10 steps of the trace
ssl/record/ssl3_record.c:1745:1: Parameter `s->session->ext.max_fragment_len_mode`
1743. */
1744. /* used only by dtls1_read_bytes */
1745. > int dtls1_get_record(SSL *s)
1746. {
1747. int ssl_major, ssl_minor;
ssl/record/ssl3_record.c:1914:10: Call
1912. }
1913.
1914. if (!dtls1_process_record(s, bitmap)) {
^
1915. rr->length = 0;
1916. RECORD_LAYER_reset_packet_length(&s->rlayer); /* dump this record */
ssl/record/ssl3_record.c:1519:1: Parameter `s->rlayer.rrec.length`
1517. }
1518.
1519. > int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap)
1520. {
1521. int i, al;
ssl/record/ssl3_record.c:1559:5: Assignment
1557. /* decrypt in place in 'rr->input' */
1558. rr->data = rr->input;
1559. rr->orig_len = rr->length;
^
1560.
1561. if (SSL_READ_ETM(s) && s->read_hash) {
ssl/record/ssl3_record.c:1652:18: Call
1650. */
1651. mac = mac_tmp;
1652. if (!ssl3_cbc_copy_mac(mac_tmp, rr, mac_size)) {
^
1653. al = SSL_AD_INTERNAL_ERROR;
1654. SSLerr(SSL_F_DTLS1_PROCESS_RECORD, ERR_R_INTERNAL_ERROR);
ssl/record/ssl3_record.c:1444:1: <LHS trace>
1442. #define CBC_MAC_ROTATE_IN_PLACE
1443.
1444. > int ssl3_cbc_copy_mac(unsigned char *out,
1445. const SSL3_RECORD *rec, size_t md_size)
1446. {
ssl/record/ssl3_record.c:1444:1: Parameter `md_size`
1442. #define CBC_MAC_ROTATE_IN_PLACE
1443.
1444. > int ssl3_cbc_copy_mac(unsigned char *out,
1445. const SSL3_RECORD *rec, size_t md_size)
1446. {
ssl/record/ssl3_record.c:1444:1: <RHS trace>
1442. #define CBC_MAC_ROTATE_IN_PLACE
1443.
1444. > int ssl3_cbc_copy_mac(unsigned char *out,
1445. const SSL3_RECORD *rec, size_t md_size)
1446. {
ssl/record/ssl3_record.c:1444:1: Parameter `md_size`
1442. #define CBC_MAC_ROTATE_IN_PLACE
1443.
1444. > int ssl3_cbc_copy_mac(unsigned char *out,
1445. const SSL3_RECORD *rec, size_t md_size)
1446. {
ssl/record/ssl3_record.c:1478:9: Binary operation: ([0, 17728] - [256, 17984]):unsigned64 by call to `dtls1_process_record`
1476. /* This information is public so it's safe to branch based on it. */
1477. if (rec->orig_len > md_size + 255 + 1)
1478. scan_start = rec->orig_len - (md_size + 255 + 1);
^
1479.
1480. in_mac = 0;
|
https://github.com/openssl/openssl/blob/9f5671c7e9f30dfa53b1a2b553f234c2761ceb66/ssl/record/ssl3_record.c/#L1478
|
d2a_code_trace_data_41582
|
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)
{
uint32_t alg_mkey, alg_auth, alg_enc, alg_mac, algo_strength;
int min_tls;
const char *l, *buf;
int j, multi, found, rule, retval, ok, buflen;
uint32_t 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;
min_tls = 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((unsigned char)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) == 0
&& (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_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]->algo_strength & SSL_DEFAULT_MASK) {
if (algo_strength & SSL_DEFAULT_MASK) {
algo_strength &=
(ca_list[j]->algo_strength & SSL_DEFAULT_MASK) |
~SSL_DEFAULT_MASK;
if (!(algo_strength & SSL_DEFAULT_MASK)) {
found = 0;
break;
}
} else {
algo_strength |=
ca_list[j]->algo_strength & SSL_DEFAULT_MASK;
}
}
if (ca_list[j]->valid) {
cipher_id = ca_list[j]->id;
} else {
if (ca_list[j]->min_tls) {
if (min_tls != 0 && min_tls != ca_list[j]->min_tls) {
found = 0;
break;
} else {
min_tls = ca_list[j]->min_tls;
}
}
}
if (!multi)
break;
}
if (rule == CIPHER_SPECIAL) {
ok = 0;
if ((buflen == 8) && strncmp(buf, "STRENGTH", 8) == 0) {
ok = ssl_cipher_strength_sort(head_p, tail_p);
} else if (buflen == 10 && strncmp(buf, "SECLEVEL=", 9) == 0) {
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,
min_tls, algo_strength, rule, -1, head_p,
tail_p);
} else {
while ((*l != '\0') && !ITEM_SEP(*l))
l++;
}
if (*l == '\0')
break;
}
return retval;
}
test/sslapitest.c:284: error: BUFFER_OVERRUN_L1
Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: 4 by call to `SSL_CTX_set_cipher_list`.
Showing all 13 steps of the trace
test/sslapitest.c:284:10: Call
282.
283. /* We also want to ensure that we use RSA-based key exchange. */
284. if (!TEST_true(SSL_CTX_set_cipher_list(cctx, "RSA")))
^
285. goto end;
286.
ssl/ssl_lib.c:2511:1: Parameter `*str`
2509.
2510. /** specify the ciphers to be used by default by the SSL_CTX */
2511. > int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
2512. {
2513. STACK_OF(SSL_CIPHER) *sk;
ssl/ssl_lib.c:2515:10: Call
2513. STACK_OF(SSL_CIPHER) *sk;
2514.
2515. sk = ssl_create_cipher_list(ctx->method, ctx->tls13_ciphersuites,
^
2516. &ctx->cipher_list, &ctx->cipher_list_by_id, str,
2517. ctx->cert);
ssl/ssl_ciph.c:1403:1: Parameter `*rule_str`
1401. }
1402.
1403. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1404. STACK_OF(SSL_CIPHER) *tls13_ciphersuites,
1405. STACK_OF(SSL_CIPHER) **cipher_list,
ssl/ssl_ciph.c:1423:10: Call
1421. return NULL;
1422. #ifndef OPENSSL_NO_EC
1423. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
^
1424. return NULL;
1425. #endif
ssl/ssl_ciph.c:1223:1: Parameter `**prule_str`
1221.
1222. #ifndef OPENSSL_NO_EC
1223. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c,
1224. const char **prule_str)
1225. {
ssl/ssl_ciph.c:1572:5: Assignment
1570. */
1571. ok = 1;
1572. rule_p = rule_str;
^
1573. if (strncmp(rule_str, "DEFAULT", 7) == 0) {
1574. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
ssl/ssl_ciph.c:1582:14: Call
1580.
1581. if (ok && (strlen(rule_p) > 0))
1582. ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c);
^
1583.
1584. OPENSSL_free(ca_list); /* Not needed anymore */
ssl/ssl_ciph.c:958:1: <Length trace>
956. }
957.
958. > static int ssl_cipher_process_rulestr(const char *rule_str,
959. CIPHER_ORDER **head_p,
960. CIPHER_ORDER **tail_p,
ssl/ssl_ciph.c:958:1: Parameter `*rule_str`
956. }
957.
958. > static int ssl_cipher_process_rulestr(const char *rule_str,
959. CIPHER_ORDER **head_p,
960. CIPHER_ORDER **tail_p,
ssl/ssl_ciph.c:971:5: Assignment
969.
970. retval = 1;
971. l = rule_str;
^
972. for ( ; ; ) {
973. ch = *l;
ssl/ssl_ciph.c:1007:13: Assignment
1005. for (;;) {
1006. ch = *l;
1007. buf = l;
^
1008. buflen = 0;
1009. #ifndef CHARSET_EBCDIC
ssl/ssl_ciph.c:1185:29: Array access: Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: 4 by call to `SSL_CTX_set_cipher_list`
1183. ok = ssl_cipher_strength_sort(head_p, tail_p);
1184. } else if (buflen == 10 && strncmp(buf, "SECLEVEL=", 9) == 0) {
1185. int level = buf[9] - '0';
^
1186. if (level < 0 || level > 5) {
1187. SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
|
https://github.com/openssl/openssl/blob/4845aeba4c49e1bd65259a5014d7e3ab38657d42/ssl/ssl_ciph.c/#L1185
|
d2a_code_trace_data_41583
|
static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
{
RTSPState *rt = s->priv_data;
AVStream *st = NULL;
if (rtsp_st->stream_index >= 0)
st = s->streams[rtsp_st->stream_index];
if (!st)
s->ctx_flags |= AVFMTCTX_NOHEADER;
if (s->oformat && CONFIG_RTSP_MUXER) {
rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,
rtsp_st->rtp_handle,
RTSP_TCP_MAX_PACKET_SIZE);
rtsp_st->rtp_handle = NULL;
} else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
rtsp_st->dynamic_protocol_context,
rtsp_st->dynamic_handler);
else if (CONFIG_RTPDEC)
rtsp_st->transport_priv = rtp_parse_open(s, st, rtsp_st->rtp_handle,
rtsp_st->sdp_payload_type,
(rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP || !s->max_delay)
? 0 : RTP_REORDER_QUEUE_DEFAULT_SIZE);
if (!rtsp_st->transport_priv) {
return AVERROR(ENOMEM);
} else if (rt->transport != RTSP_TRANSPORT_RDT && CONFIG_RTPDEC) {
if (rtsp_st->dynamic_handler) {
rtp_parse_set_dynamic_protocol(rtsp_st->transport_priv,
rtsp_st->dynamic_protocol_context,
rtsp_st->dynamic_handler);
}
}
return 0;
}
libavformat/rtsp.c:565: error: Null Dereference
pointer `st` last assigned on line 550 could be null and is dereferenced at line 565, column 56.
libavformat/rtsp.c:547:1: start of procedure rtsp_open_transport_ctx()
545. }
546.
547. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
^
548. {
549. RTSPState *rt = s->priv_data;
libavformat/rtsp.c:549:5:
547. static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
548. {
549. RTSPState *rt = s->priv_data;
^
550. AVStream *st = NULL;
551.
libavformat/rtsp.c:550:5:
548. {
549. RTSPState *rt = s->priv_data;
550. AVStream *st = NULL;
^
551.
552. /* open the RTP context */
libavformat/rtsp.c:553:9: Taking false branch
551.
552. /* open the RTP context */
553. if (rtsp_st->stream_index >= 0)
^
554. st = s->streams[rtsp_st->stream_index];
555. if (!st)
libavformat/rtsp.c:555:10: Taking true branch
553. if (rtsp_st->stream_index >= 0)
554. st = s->streams[rtsp_st->stream_index];
555. if (!st)
^
556. s->ctx_flags |= AVFMTCTX_NOHEADER;
557.
libavformat/rtsp.c:556:9:
554. st = s->streams[rtsp_st->stream_index];
555. if (!st)
556. s->ctx_flags |= AVFMTCTX_NOHEADER;
^
557.
558. if (s->oformat && CONFIG_RTSP_MUXER) {
libavformat/rtsp.c:558:9: Taking false branch
556. s->ctx_flags |= AVFMTCTX_NOHEADER;
557.
558. if (s->oformat && CONFIG_RTSP_MUXER) {
^
559. rtsp_st->transport_priv = ff_rtp_chain_mux_open(s, st,
560. rtsp_st->rtp_handle,
libavformat/rtsp.c:564:16: Taking true branch
562. /* Ownership of rtp_handle is passed to the rtp mux context */
563. rtsp_st->rtp_handle = NULL;
564. } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
^
565. rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
566. rtsp_st->dynamic_protocol_context,
libavformat/rtsp.c:564:55: Taking true branch
562. /* Ownership of rtp_handle is passed to the rtp mux context */
563. rtsp_st->rtp_handle = NULL;
564. } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
^
565. rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
566. rtsp_st->dynamic_protocol_context,
libavformat/rtsp.c:565:9:
563. rtsp_st->rtp_handle = NULL;
564. } else if (rt->transport == RTSP_TRANSPORT_RDT && CONFIG_RTPDEC)
565. rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index,
^
566. rtsp_st->dynamic_protocol_context,
567. rtsp_st->dynamic_handler);
|
https://github.com/libav/libav/blob/87e4d9b252bc6fa3b982f7050013069c9dc3e05b/libavformat/rtsp.c/#L565
|
d2a_code_trace_data_41584
|
void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
unsigned int M,unsigned int L,void *key,block128_f block)
{
memset(ctx->nonce.c,0,sizeof(ctx->nonce.c));
ctx->nonce.c[0] = ((u8)(L-1)&7) | (u8)(((M-2)/2)&7)<<3;
ctx->blocks = 0;
ctx->block = block;
ctx->key = key;
}
crypto/modes/ccm128.c:66: error: BUFFER_OVERRUN_L3
Offset added: 16 Size: [0, +oo].
Showing all 3 steps of the trace
crypto/modes/ccm128.c:63:1: <Length trace>
61. /* First you setup M and L parameters and pass the key schedule.
62. * This is called once per session setup... */
63. > void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
64. unsigned int M,unsigned int L,void *key,block128_f block)
65. {
crypto/modes/ccm128.c:63:1: Parameter `ctx->nonce.c[*]`
61. /* First you setup M and L parameters and pass the key schedule.
62. * This is called once per session setup... */
63. > void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
64. unsigned int M,unsigned int L,void *key,block128_f block)
65. {
crypto/modes/ccm128.c:66:2: Array access: Offset added: 16 Size: [0, +oo]
64. unsigned int M,unsigned int L,void *key,block128_f block)
65. {
66. memset(ctx->nonce.c,0,sizeof(ctx->nonce.c));
^
67. ctx->nonce.c[0] = ((u8)(L-1)&7) | (u8)(((M-2)/2)&7)<<3;
68. ctx->blocks = 0;
|
https://github.com/openssl/openssl/blob/d16765919d78a576425272adc0c3fb0b493b1198/crypto/modes/ccm128.c/#L66
|
d2a_code_trace_data_41585
|
static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
const int size, const int h, int ref_index, int src_index,
me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
MotionEstContext * const c= &s->me;
const int stride= c->stride;
const int uvstride= c->uvstride;
const int qpel= flags&FLAG_QPEL;
const int chroma= flags&FLAG_CHROMA;
const int dxy= subx + (suby<<(1+qpel));
const int hx= subx + (x<<(1+qpel));
const int hy= suby + (y<<(1+qpel));
uint8_t * const * const ref= c->ref[ref_index];
uint8_t * const * const src= c->src[src_index];
int d;
if(flags&FLAG_DIRECT){
assert(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1));
if(x >= c->xmin && hx <= c->xmax<<(qpel+1) && y >= c->ymin && hy <= c->ymax<<(qpel+1)){
const int time_pp= s->pp_time;
const int time_pb= s->pb_time;
const int mask= 2*qpel+1;
if(s->mv_type==MV_TYPE_8X8){
int i;
for(i=0; i<4; i++){
int fx = c->direct_basis_mv[i][0] + hx;
int fy = c->direct_basis_mv[i][1] + hy;
int bx = hx ? fx - c->co_located_mv[i][0] : c->co_located_mv[i][0]*(time_pb - time_pp)/time_pp + ((i &1)<<(qpel+4));
int by = hy ? fy - c->co_located_mv[i][1] : c->co_located_mv[i][1]*(time_pb - time_pp)/time_pp + ((i>>1)<<(qpel+4));
int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
uint8_t *dst= c->temp + 8*(i&1) + 8*stride*(i>>1);
if(qpel){
c->qpel_put[1][fxy](dst, ref[0] + (fx>>2) + (fy>>2)*stride, stride);
c->qpel_avg[1][bxy](dst, ref[8] + (bx>>2) + (by>>2)*stride, stride);
}else{
c->hpel_put[1][fxy](dst, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 8);
c->hpel_avg[1][bxy](dst, ref[8] + (bx>>1) + (by>>1)*stride, stride, 8);
}
}
}else{
int fx = c->direct_basis_mv[0][0] + hx;
int fy = c->direct_basis_mv[0][1] + hy;
int bx = hx ? fx - c->co_located_mv[0][0] : (c->co_located_mv[0][0]*(time_pb - time_pp)/time_pp);
int by = hy ? fy - c->co_located_mv[0][1] : (c->co_located_mv[0][1]*(time_pb - time_pp)/time_pp);
int fxy= (fx&mask) + ((fy&mask)<<(qpel+1));
int bxy= (bx&mask) + ((by&mask)<<(qpel+1));
if(qpel){
c->qpel_put[1][fxy](c->temp , ref[0] + (fx>>2) + (fy>>2)*stride , stride);
c->qpel_put[1][fxy](c->temp + 8 , ref[0] + (fx>>2) + (fy>>2)*stride + 8 , stride);
c->qpel_put[1][fxy](c->temp + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8*stride, stride);
c->qpel_put[1][fxy](c->temp + 8 + 8*stride, ref[0] + (fx>>2) + (fy>>2)*stride + 8 + 8*stride, stride);
c->qpel_avg[1][bxy](c->temp , ref[8] + (bx>>2) + (by>>2)*stride , stride);
c->qpel_avg[1][bxy](c->temp + 8 , ref[8] + (bx>>2) + (by>>2)*stride + 8 , stride);
c->qpel_avg[1][bxy](c->temp + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8*stride, stride);
c->qpel_avg[1][bxy](c->temp + 8 + 8*stride, ref[8] + (bx>>2) + (by>>2)*stride + 8 + 8*stride, stride);
}else{
assert((fx>>1) + 16*s->mb_x >= -16);
assert((fy>>1) + 16*s->mb_y >= -16);
assert((fx>>1) + 16*s->mb_x <= s->width);
assert((fy>>1) + 16*s->mb_y <= s->height);
assert((bx>>1) + 16*s->mb_x >= -16);
assert((by>>1) + 16*s->mb_y >= -16);
assert((bx>>1) + 16*s->mb_x <= s->width);
assert((by>>1) + 16*s->mb_y <= s->height);
c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
}
}
d = cmp_func(s, c->temp, src[0], stride, 16);
}else
d= 256*256*256*32;
}else{
int uvdxy;
if(dxy){
if(qpel){
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride);
if(chroma){
int cx= hx/2;
int cy= hy/2;
cx= (cx>>1)|(cx&1);
cy= (cy>>1)|(cy&1);
uvdxy= (cx&1) + 2*(cy&1);
}
}else{
c->hpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride, h);
if(chroma)
uvdxy= dxy | (x&1) | (2*(y&1));
}
d = cmp_func(s, c->temp, src[0], stride, h);
}else{
d = cmp_func(s, src[0], ref[0] + x + y*stride, stride, h);
if(chroma)
uvdxy= (x&1) + 2*(y&1);
}
if(chroma){
uint8_t * const uvtemp= c->temp + 16*stride;
c->hpel_put[size+1][uvdxy](uvtemp , ref[1] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
c->hpel_put[size+1][uvdxy](uvtemp+8, ref[2] + (x>>1) + (y>>1)*uvstride, uvstride, h>>1);
d += chroma_cmp_func(s, uvtemp , src[1], uvstride, h>>1);
d += chroma_cmp_func(s, uvtemp+8, src[2], uvstride, h>>1);
}
}
#if 0
if(full_pel){
const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);
score_map[index]= d;
}
d += (c->mv_penalty[hx - c->pred_x] + c->mv_penalty[hy - c->pred_y])*c->penalty_factor;
#endif
return d;
}
libavcodec/motion_est.c:1906: error: Buffer Overrun L1
Offset: [10, 11] (⇐ [2, 3] + 8) Size: 4 by call to `interlaced_search`.
libavcodec/motion_est.c:1906:17: Call
1904. c->skip=0;
1905. c->current_mv_penalty= c->mv_penalty[s->b_code] + MAX_MV;
1906. interlaced_search(s, 2,
^
1907. s->b_field_mv_table[1], s->b_field_select_table[1],
1908. s->b_back_mv_table[xy][0], s->b_back_mv_table[xy][1], 1);
libavcodec/motion_est.c:893:1: Parameter `ref_index`
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:953:20: Call
951. P_MV1[1]= my / 2;
952.
953. dmin = epzs_motion_search2(s, &mx_i, &my_i, P, block, field_select+ref_index, mv_table, (1<<16)>>1);
^
954.
955. dmin= c->sub_motion_search(s, &mx_i, &my_i, dmin, block, field_select+ref_index, size, h);
libavcodec/motion_est_template.c:1191:1: Parameter `ref_index`
1189.
1190. //try to merge with above FIXME (needs PSNR test)
1191. static int epzs_motion_search2(MpegEncContext * s,
^
1192. int *mx_ptr, int *my_ptr, int P[10][2],
1193. int src_index, int ref_index, int16_t (*last_mv)[2],
libavcodec/motion_est_template.c:1241:11: Call
1239. }
1240.
1241. dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
^
1242.
1243. *mx_ptr= best[0];
libavcodec/motion_est_template.c:973:1: Parameter `ref_index`
971. }
972.
973. static av_always_inline int diamond_search(MpegEncContext * s, int *best, int dmin,
^
974. int src_index, int ref_index, int const penalty_factor,
975. int size, int h, int flags){
libavcodec/motion_est_template.c:980:18: Call
978. return funny_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
979. else if(c->dia_size<-1)
980. return sab_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
^
981. else if(c->dia_size<2)
982. return small_diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
libavcodec/motion_est_template.c:809:1: Parameter `ref_index`
807.
808. #define MAX_SAB_SIZE ME_MAP_SIZE
809. static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
^
810. int src_index, int ref_index, int const penalty_factor,
811. int size, int h, int flags)
libavcodec/motion_est_template.c:872:9: Call
870. continue;
871.
872. SAB_CHECK_MV(x-1, y)
^
873. SAB_CHECK_MV(x+1, y)
874. SAB_CHECK_MV(x , y-1)
libavcodec/motion_est.c:108:1: <Length trace>
106. against a proposed motion-compensated prediction of that block
107. */
108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
^
109. const int size, const int h, int ref_index, int src_index,
110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
libavcodec/motion_est.c:108:1: Parameter `ref_index`
106. against a proposed motion-compensated prediction of that block
107. */
108. static av_always_inline int cmp(MpegEncContext *s, const int x, const int y, const int subx, const int suby,
^
109. const int size, const int h, int ref_index, int src_index,
110. me_cmp_func cmp_func, me_cmp_func chroma_cmp_func, const int flags){
libavcodec/motion_est.c:119:5: Assignment
117. const int hx= subx + (x<<(1+qpel));
118. const int hy= suby + (y<<(1+qpel));
119. uint8_t * const * const ref= c->ref[ref_index];
^
120. uint8_t * const * const src= c->src[src_index];
121. int d;
libavcodec/motion_est.c:176:50: Array access: Offset: [10, 11] (⇐ [2, 3] + 8) Size: 4 by call to `interlaced_search`
174.
175. c->hpel_put[0][fxy](c->temp, ref[0] + (fx>>1) + (fy>>1)*stride, stride, 16);
176. c->hpel_avg[0][bxy](c->temp, ref[8] + (bx>>1) + (by>>1)*stride, stride, 16);
^
177. }
178. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est.c/#L176
|
d2a_code_trace_data_41586
|
int dtls1_connect(SSL *s)
{
BUF_MEM *buf=NULL;
unsigned long Time=(unsigned long)time(NULL);
long num1;
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int ret= -1;
int new_state,state,skip=0;;
RAND_add(&Time,sizeof(Time),0);
ERR_clear_error();
clear_sys_error();
if (s->info_callback != NULL)
cb=s->info_callback;
else if (s->ctx->info_callback != NULL)
cb=s->ctx->info_callback;
s->in_handshake++;
if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s);
for (;;)
{
state=s->state;
switch(s->state)
{
case SSL_ST_RENEGOTIATE:
s->new_session=1;
s->state=SSL_ST_CONNECT;
s->ctx->stats.sess_connect_renegotiate++;
case SSL_ST_BEFORE:
case SSL_ST_CONNECT:
case SSL_ST_BEFORE|SSL_ST_CONNECT:
case SSL_ST_OK|SSL_ST_CONNECT:
s->server=0;
if (cb != NULL) cb(s,SSL_CB_HANDSHAKE_START,1);
if ((s->version & 0xff00 ) != (DTLS1_VERSION & 0xff00) &&
(s->version & 0xff00 ) != (DTLS1_BAD_VER & 0xff00))
{
SSLerr(SSL_F_DTLS1_CONNECT, ERR_R_INTERNAL_ERROR);
ret = -1;
goto end;
}
s->type=SSL_ST_CONNECT;
if (s->init_buf == NULL)
{
if ((buf=BUF_MEM_new()) == NULL)
{
ret= -1;
goto end;
}
if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH))
{
ret= -1;
goto end;
}
s->init_buf=buf;
buf=NULL;
}
if (!ssl3_setup_buffers(s)) { ret= -1; goto end; }
if (!ssl_init_wbio_buffer(s,0)) { ret= -1; goto end; }
s->state=SSL3_ST_CW_CLNT_HELLO_A;
s->ctx->stats.sess_connect++;
s->init_num=0;
memset(s->s3->client_random,0,sizeof(s->s3->client_random));
s->d1->send_cookie = 0;
s->hit = 0;
break;
case SSL3_ST_CW_CLNT_HELLO_A:
case SSL3_ST_CW_CLNT_HELLO_B:
s->shutdown=0;
ssl3_init_finished_mac(s);
dtls1_start_timer(s);
ret=dtls1_client_hello(s);
if (ret <= 0) goto end;
if ( s->d1->send_cookie)
{
s->state=SSL3_ST_CW_FLUSH;
s->s3->tmp.next_state=SSL3_ST_CR_SRVR_HELLO_A;
}
else
s->state=SSL3_ST_CR_SRVR_HELLO_A;
s->init_num=0;
if (s->bbio != s->wbio)
s->wbio=BIO_push(s->bbio,s->wbio);
break;
case SSL3_ST_CR_SRVR_HELLO_A:
case SSL3_ST_CR_SRVR_HELLO_B:
ret=ssl3_get_server_hello(s);
if (ret <= 0) goto end;
else
{
dtls1_stop_timer(s);
if (s->hit)
s->state=SSL3_ST_CR_FINISHED_A;
else
s->state=DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A;
}
s->init_num=0;
break;
case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A:
case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B:
ret = dtls1_get_hello_verify(s);
if ( ret <= 0)
goto end;
dtls1_stop_timer(s);
if ( s->d1->send_cookie)
s->state=SSL3_ST_CW_CLNT_HELLO_A;
else
s->state = SSL3_ST_CR_CERT_A;
s->init_num = 0;
break;
case SSL3_ST_CR_CERT_A:
case SSL3_ST_CR_CERT_B:
if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL) &&
!(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK))
{
ret=ssl3_get_server_certificate(s);
if (ret <= 0) goto end;
}
else
skip=1;
s->state=SSL3_ST_CR_KEY_EXCH_A;
s->init_num=0;
break;
case SSL3_ST_CR_KEY_EXCH_A:
case SSL3_ST_CR_KEY_EXCH_B:
ret=ssl3_get_key_exchange(s);
if (ret <= 0) goto end;
s->state=SSL3_ST_CR_CERT_REQ_A;
s->init_num=0;
if (!ssl3_check_cert_and_algorithm(s))
{
ret= -1;
goto end;
}
break;
case SSL3_ST_CR_CERT_REQ_A:
case SSL3_ST_CR_CERT_REQ_B:
ret=ssl3_get_certificate_request(s);
if (ret <= 0) goto end;
s->state=SSL3_ST_CR_SRVR_DONE_A;
s->init_num=0;
break;
case SSL3_ST_CR_SRVR_DONE_A:
case SSL3_ST_CR_SRVR_DONE_B:
ret=ssl3_get_server_done(s);
if (ret <= 0) goto end;
if (s->s3->tmp.cert_req)
s->state=SSL3_ST_CW_CERT_A;
else
s->state=SSL3_ST_CW_KEY_EXCH_A;
s->init_num=0;
break;
case SSL3_ST_CW_CERT_A:
case SSL3_ST_CW_CERT_B:
case SSL3_ST_CW_CERT_C:
case SSL3_ST_CW_CERT_D:
dtls1_start_timer(s);
ret=dtls1_send_client_certificate(s);
if (ret <= 0) goto end;
s->state=SSL3_ST_CW_KEY_EXCH_A;
s->init_num=0;
break;
case SSL3_ST_CW_KEY_EXCH_A:
case SSL3_ST_CW_KEY_EXCH_B:
dtls1_start_timer(s);
ret=dtls1_send_client_key_exchange(s);
if (ret <= 0) goto end;
if (s->s3->tmp.cert_req == 1)
{
s->state=SSL3_ST_CW_CERT_VRFY_A;
}
else
{
s->state=SSL3_ST_CW_CHANGE_A;
s->s3->change_cipher_spec=0;
}
s->init_num=0;
break;
case SSL3_ST_CW_CERT_VRFY_A:
case SSL3_ST_CW_CERT_VRFY_B:
dtls1_start_timer(s);
ret=dtls1_send_client_verify(s);
if (ret <= 0) goto end;
s->state=SSL3_ST_CW_CHANGE_A;
s->init_num=0;
s->s3->change_cipher_spec=0;
break;
case SSL3_ST_CW_CHANGE_A:
case SSL3_ST_CW_CHANGE_B:
dtls1_start_timer(s);
ret=dtls1_send_change_cipher_spec(s,
SSL3_ST_CW_CHANGE_A,SSL3_ST_CW_CHANGE_B);
if (ret <= 0) goto end;
s->state=SSL3_ST_CW_FINISHED_A;
s->init_num=0;
s->session->cipher=s->s3->tmp.new_cipher;
#ifdef OPENSSL_NO_COMP
s->session->compress_meth=0;
#else
if (s->s3->tmp.new_compression == NULL)
s->session->compress_meth=0;
else
s->session->compress_meth=
s->s3->tmp.new_compression->id;
#endif
if (!s->method->ssl3_enc->setup_key_block(s))
{
ret= -1;
goto end;
}
if (!s->method->ssl3_enc->change_cipher_state(s,
SSL3_CHANGE_CIPHER_CLIENT_WRITE))
{
ret= -1;
goto end;
}
dtls1_reset_seq_numbers(s, SSL3_CC_WRITE);
break;
case SSL3_ST_CW_FINISHED_A:
case SSL3_ST_CW_FINISHED_B:
dtls1_start_timer(s);
ret=dtls1_send_finished(s,
SSL3_ST_CW_FINISHED_A,SSL3_ST_CW_FINISHED_B,
s->method->ssl3_enc->client_finished_label,
s->method->ssl3_enc->client_finished_label_len);
if (ret <= 0) goto end;
s->state=SSL3_ST_CW_FLUSH;
s->s3->flags&= ~SSL3_FLAGS_POP_BUFFER;
if (s->hit)
{
s->s3->tmp.next_state=SSL_ST_OK;
if (s->s3->flags & SSL3_FLAGS_DELAY_CLIENT_FINISHED)
{
s->state=SSL_ST_OK;
s->s3->flags|=SSL3_FLAGS_POP_BUFFER;
s->s3->delay_buf_pop_ret=0;
}
}
else
{
s->s3->tmp.next_state=SSL3_ST_CR_FINISHED_A;
}
s->init_num=0;
break;
case SSL3_ST_CR_FINISHED_A:
case SSL3_ST_CR_FINISHED_B:
s->d1->change_cipher_spec_ok = 1;
ret=ssl3_get_finished(s,SSL3_ST_CR_FINISHED_A,
SSL3_ST_CR_FINISHED_B);
if (ret <= 0) goto end;
dtls1_stop_timer(s);
if (s->hit)
s->state=SSL3_ST_CW_CHANGE_A;
else
s->state=SSL_ST_OK;
s->init_num=0;
break;
case SSL3_ST_CW_FLUSH:
num1=BIO_ctrl(s->wbio,BIO_CTRL_INFO,0,NULL);
if (num1 > 0)
{
s->rwstate=SSL_WRITING;
num1=BIO_flush(s->wbio);
if (num1 <= 0) { ret= -1; goto end; }
s->rwstate=SSL_NOTHING;
}
s->state=s->s3->tmp.next_state;
break;
case SSL_ST_OK:
ssl3_cleanup_key_block(s);
#if 0
if (s->init_buf != NULL)
{
BUF_MEM_free(s->init_buf);
s->init_buf=NULL;
}
#endif
if (!(s->s3->flags & SSL3_FLAGS_POP_BUFFER))
ssl_free_wbio_buffer(s);
s->init_num=0;
s->new_session=0;
ssl_update_cache(s,SSL_SESS_CACHE_CLIENT);
if (s->hit) s->ctx->stats.sess_hit++;
ret=1;
s->handshake_func=dtls1_connect;
s->ctx->stats.sess_connect_good++;
if (cb != NULL) cb(s,SSL_CB_HANDSHAKE_DONE,1);
s->d1->handshake_read_seq = 0;
s->d1->next_handshake_write_seq = 0;
goto end;
default:
SSLerr(SSL_F_DTLS1_CONNECT,SSL_R_UNKNOWN_STATE);
ret= -1;
goto end;
}
if (!s->s3->tmp.reuse_message && !skip)
{
if (s->debug)
{
if ((ret=BIO_flush(s->wbio)) <= 0)
goto end;
}
if ((cb != NULL) && (s->state != state))
{
new_state=s->state;
s->state=state;
cb(s,SSL_CB_CONNECT_LOOP,1);
s->state=new_state;
}
}
skip=0;
}
end:
s->in_handshake--;
if (buf != NULL)
BUF_MEM_free(buf);
if (cb != NULL)
cb(s,SSL_CB_CONNECT_EXIT,ret);
return(ret);
}
ssl/d1_clnt.c:225: error: BUFFER_OVERRUN_L3
Offset added: 32 Size: [0, +oo].
Showing all 3 steps of the trace
ssl/d1_clnt.c:147:1: <Length trace>
145. dtls1_get_client_method)
146.
147. > int dtls1_connect(SSL *s)
148. {
149. BUF_MEM *buf=NULL;
ssl/d1_clnt.c:147:1: Parameter `s->s3->client_random[*]`
145. dtls1_get_client_method)
146.
147. > int dtls1_connect(SSL *s)
148. {
149. BUF_MEM *buf=NULL;
ssl/d1_clnt.c:225:4: Array access: Offset added: 32 Size: [0, +oo]
223. s->init_num=0;
224. /* mark client_random uninitialized */
225. memset(s->s3->client_random,0,sizeof(s->s3->client_random));
^
226. s->d1->send_cookie = 0;
227. s->hit = 0;
|
https://github.com/openssl/openssl/blob/e075341d66cf35527b37e449a39de9b68cee6bcb/ssl/d1_clnt.c/#L225
|
d2a_code_trace_data_41587
|
static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt)
{
#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) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, 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) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, 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) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA,
ERR_R_MALLOC_FAILURE);
return 0;
}
pms[0] = s->client_version >> 8;
pms[1] = s->client_version & 0xff;
if (RAND_bytes(pms + 2, (int)(pmslen - 2)) <= 0) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (s->version > SSL3_VERSION && !WPACKET_start_sub_packet_u16(pkt)) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, 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) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, 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) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA,
SSL_R_BAD_RSA_ENCRYPT);
goto err;
}
EVP_PKEY_CTX_free(pctx);
pctx = NULL;
if (s->version > SSL3_VERSION && !WPACKET_close(pkt)) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA,
ERR_R_INTERNAL_ERROR);
goto err;
}
if (!ssl_log_rsa_client_key_exchange(s, encdata, enclen, pms, pmslen)) {
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
SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA,
ERR_R_INTERNAL_ERROR);
return 0;
#endif
}
ssl/statem/statem_clnt.c:2918: error: NULL_DEREFERENCE
pointer `pkey` last assigned on line 2917 could be null and is dereferenced by call to `EVP_PKEY_get0_RSA()` at line 2918, column 9.
Showing all 30 steps of the trace
ssl/statem/statem_clnt.c:2898:1: start of procedure tls_construct_cke_rsa()
2896. }
2897.
2898. > static int tls_construct_cke_rsa(SSL *s, WPACKET *pkt)
2899. {
2900. #ifndef OPENSSL_NO_RSA
ssl/statem/statem_clnt.c:2901:5:
2899. {
2900. #ifndef OPENSSL_NO_RSA
2901. > unsigned char *encdata = NULL;
2902. EVP_PKEY *pkey = NULL;
2903. EVP_PKEY_CTX *pctx = NULL;
ssl/statem/statem_clnt.c:2902:5:
2900. #ifndef OPENSSL_NO_RSA
2901. unsigned char *encdata = NULL;
2902. > EVP_PKEY *pkey = NULL;
2903. EVP_PKEY_CTX *pctx = NULL;
2904. size_t enclen;
ssl/statem/statem_clnt.c:2903:5:
2901. unsigned char *encdata = NULL;
2902. EVP_PKEY *pkey = NULL;
2903. > EVP_PKEY_CTX *pctx = NULL;
2904. size_t enclen;
2905. unsigned char *pms = NULL;
ssl/statem/statem_clnt.c:2905:5:
2903. EVP_PKEY_CTX *pctx = NULL;
2904. size_t enclen;
2905. > unsigned char *pms = NULL;
2906. size_t pmslen = 0;
2907.
ssl/statem/statem_clnt.c:2906:5:
2904. size_t enclen;
2905. unsigned char *pms = NULL;
2906. > size_t pmslen = 0;
2907.
2908. if (s->session->peer == NULL) {
ssl/statem/statem_clnt.c:2908:9: Taking false branch
2906. size_t pmslen = 0;
2907.
2908. if (s->session->peer == NULL) {
^
2909. /*
2910. * We should always have a server certificate with SSL_kRSA.
ssl/statem/statem_clnt.c:2917:5:
2915. }
2916.
2917. > pkey = X509_get0_pubkey(s->session->peer);
2918. if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2919. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA,
crypto/x509/x509_cmp.c:264:1: start of procedure X509_get0_pubkey()
262. }
263.
264. > EVP_PKEY *X509_get0_pubkey(const X509 *x)
265. {
266. if (x == NULL)
crypto/x509/x509_cmp.c:266:9: Taking false branch
264. EVP_PKEY *X509_get0_pubkey(const X509 *x)
265. {
266. if (x == NULL)
^
267. return NULL;
268. return X509_PUBKEY_get0(x->cert_info.key);
crypto/x509/x509_cmp.c:268:5:
266. if (x == NULL)
267. return NULL;
268. > return X509_PUBKEY_get0(x->cert_info.key);
269. }
270.
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:269:1: return from a call to X509_get0_pubkey
267. return NULL;
268. return X509_PUBKEY_get0(x->cert_info.key);
269. > }
270.
271. EVP_PKEY *X509_get_pubkey(X509 *x)
ssl/statem/statem_clnt.c:2918:9:
2916.
2917. pkey = X509_get0_pubkey(s->session->peer);
2918. > if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2919. SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_CKE_RSA,
2920. ERR_R_INTERNAL_ERROR);
crypto/evp/p_lib.c:407:1: start of procedure EVP_PKEY_get0_RSA()
405. }
406.
407. > RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
408. {
409. if (pkey->type != EVP_PKEY_RSA) {
crypto/evp/p_lib.c:409:9:
407. RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
408. {
409. > if (pkey->type != EVP_PKEY_RSA) {
410. EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY);
411. return NULL;
|
https://github.com/openssl/openssl/blob/c22365b399f62af4a81e9202500cd2cbd9c23a9d/ssl/statem/statem_clnt.c/#L2918
|
d2a_code_trace_data_41588
|
void
TIFFReverseBits(uint8* cp, tmsize_t n)
{
for (; n > 8; n -= 8) {
cp[0] = TIFFBitRevTable[cp[0]];
cp[1] = TIFFBitRevTable[cp[1]];
cp[2] = TIFFBitRevTable[cp[2]];
cp[3] = TIFFBitRevTable[cp[3]];
cp[4] = TIFFBitRevTable[cp[4]];
cp[5] = TIFFBitRevTable[cp[5]];
cp[6] = TIFFBitRevTable[cp[6]];
cp[7] = TIFFBitRevTable[cp[7]];
cp += 8;
}
while (n-- > 0)
*cp = TIFFBitRevTable[*cp], cp++;
}
contrib/addtiffo/tif_overview.c:883: error: Buffer Overrun L3
Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFDestroyOvrCache`.
contrib/addtiffo/tif_overview.c:685:1: Parameter `hTIFF->tif_rawdata`
683. /************************************************************************/
684.
685. void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList,
^
686. int bUseSubIFDs, const char *pszResampleMethod,
687. int (*pfnProgress)( double, void * ),
contrib/addtiffo/tif_overview.c:883:9: Call
881. for( i = 0; i < nOverviews; i++ )
882. {
883. TIFFDestroyOvrCache( papoRawBIs[i] );
^
884. }
885.
contrib/addtiffo/tif_ovrcache.c:325:1: Parameter `*psCache->hTIFF->tif_rawdata`
323. /************************************************************************/
324.
325. void TIFFDestroyOvrCache( TIFFOvrCache * psCache )
^
326.
327. {
contrib/addtiffo/tif_ovrcache.c:329:9: Call
327. {
328. while( psCache->nBlockOffset < psCache->nBlocksPerColumn )
329. TIFFWriteOvrRow( psCache );
^
330.
331. _TIFFfree( psCache->pabyRow1Blocks );
contrib/addtiffo/tif_ovrcache.c:134:1: Parameter `*psCache->hTIFF->tif_rawdata`
132. /************************************************************************/
133.
134. static void TIFFWriteOvrRow( TIFFOvrCache * psCache )
^
135.
136. {
contrib/addtiffo/tif_ovrcache.c:254:5: Call
252. /* Restore access to original directory. */
253. /* -------------------------------------------------------------------- */
254. TIFFFlush( psCache->hTIFF );
^
255. /* TODO: add checks on error status return of TIFFFlush */
256. TIFFSetSubDirectory( psCache->hTIFF, nBaseDirOffset );
libtiff/tif_flush.c:32:1: Parameter `*tif->tif_rawdata`
30. #include "tiffiop.h"
31.
32. int
^
33. TIFFFlush(TIFF* tif)
34. {
libtiff/tif_flush.c:83:13: Call
81.
82. if ((tif->tif_flags & (TIFF_DIRTYDIRECT|TIFF_DIRTYSTRIP))
83. && !TIFFWriteDirectory(tif))
^
84. return (0);
85.
libtiff/tif_dirwrite.c:163:1: Parameter `*tif->tif_rawdata`
161. * storage that's been changed.
162. */
163. int
^
164. TIFFWriteDirectory(TIFF* tif)
165. {
libtiff/tif_dirwrite.c:166:9: Call
164. TIFFWriteDirectory(TIFF* tif)
165. {
166. return TIFFWriteDirectorySec(tif,TRUE,TRUE,NULL);
^
167. }
168.
libtiff/tif_dirwrite.c:345:1: Parameter `*tif->tif_rawdata`
343. }
344.
345. static int
^
346. TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
347. {
libtiff/tif_dirwrite.c:384:12: Call
382. && (tif->tif_flags & TIFF_BEENWRITING) != 0 )
383. {
384. if( !TIFFFlushData1(tif) )
^
385. {
386. TIFFErrorExt(tif->tif_clientdata, module,
libtiff/tif_write.c:709:1: Parameter `*tif->tif_rawdata`
707. * for infinite recursion.
708. */
709. int
^
710. TIFFFlushData1(TIFF* tif)
711. {
libtiff/tif_write.c:715:4: Call
713. if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
714. (tif->tif_flags & TIFF_NOBITREV) == 0)
715. TIFFReverseBits((uint8*)tif->tif_rawdata,
^
716. tif->tif_rawcc);
717. if (!TIFFAppendToStrip(tif,
libtiff/tif_swab.c:285:1: <Length trace>
283. }
284.
285. void
^
286. TIFFReverseBits(uint8* cp, tmsize_t n)
287. {
libtiff/tif_swab.c:285:1: Parameter `*cp`
283. }
284.
285. void
^
286. TIFFReverseBits(uint8* cp, tmsize_t n)
287. {
libtiff/tif_swab.c:296:3: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFDestroyOvrCache`
294. cp[5] = TIFFBitRevTable[cp[5]];
295. cp[6] = TIFFBitRevTable[cp[6]];
296. cp[7] = TIFFBitRevTable[cp[7]];
^
297. cp += 8;
298. }
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L296
|
d2a_code_trace_data_41589
|
static int encode_test_init(EVP_TEST *t, const char *encoding)
{
ENCODE_DATA *edata = OPENSSL_zalloc(sizeof(*edata));
if (strcmp(encoding, "canonical") == 0) {
edata->encoding = BASE64_CANONICAL_ENCODING;
} else if (strcmp(encoding, "valid") == 0) {
edata->encoding = BASE64_VALID_ENCODING;
} else if (strcmp(encoding, "invalid") == 0) {
edata->encoding = BASE64_INVALID_ENCODING;
t->expected_err = OPENSSL_strdup("DECODE_ERROR");
if (t->expected_err == NULL)
return 0;
} else {
TEST_info("Bad encoding: %s. Should be one of "
"{canonical, valid, invalid}", encoding);
return 0;
}
t->data = edata;
return 1;
}
test/evp_test.c:1772: error: MEMORY_LEAK
memory dynamically allocated by call to `CRYPTO_zalloc()` at line 1760, column 26 is not reachable after line 1772, column 9.
Showing all 22 steps of the trace
test/evp_test.c:1758:1: start of procedure encode_test_init()
1756. } ENCODE_DATA;
1757.
1758. > static int encode_test_init(EVP_TEST *t, const char *encoding)
1759. {
1760. ENCODE_DATA *edata = OPENSSL_zalloc(sizeof(*edata));
test/evp_test.c:1760:5:
1758. static int encode_test_init(EVP_TEST *t, const char *encoding)
1759. {
1760. > ENCODE_DATA *edata = OPENSSL_zalloc(sizeof(*edata));
1761.
1762. if (strcmp(encoding, "canonical") == 0) {
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)
test/evp_test.c:1762:9: Taking false branch
1760. ENCODE_DATA *edata = OPENSSL_zalloc(sizeof(*edata));
1761.
1762. if (strcmp(encoding, "canonical") == 0) {
^
1763. edata->encoding = BASE64_CANONICAL_ENCODING;
1764. } else if (strcmp(encoding, "valid") == 0) {
test/evp_test.c:1764:16: Taking false branch
1762. if (strcmp(encoding, "canonical") == 0) {
1763. edata->encoding = BASE64_CANONICAL_ENCODING;
1764. } else if (strcmp(encoding, "valid") == 0) {
^
1765. edata->encoding = BASE64_VALID_ENCODING;
1766. } else if (strcmp(encoding, "invalid") == 0) {
test/evp_test.c:1766:16: Taking false branch
1764. } else if (strcmp(encoding, "valid") == 0) {
1765. edata->encoding = BASE64_VALID_ENCODING;
1766. } else if (strcmp(encoding, "invalid") == 0) {
^
1767. edata->encoding = BASE64_INVALID_ENCODING;
1768. t->expected_err = OPENSSL_strdup("DECODE_ERROR");
test/evp_test.c:1772:9:
1770. return 0;
1771. } else {
1772. > TEST_info("Bad encoding: %s. Should be one of "
1773. "{canonical, valid, invalid}", encoding);
1774. return 0;
|
https://github.com/openssl/openssl/blob/69b4c01fd26e6eb72b156ed3014522c3295a7669/test/evp_test.c/#L1772
|
d2a_code_trace_data_41590
|
static int hls_transform_tree(HEVCContext *s, int x0, int y0,
int xBase, int yBase, int cb_xBase, int cb_yBase,
int log2_cb_size, int log2_trafo_size,
int trafo_depth, int blk_idx)
{
HEVCLocalContext *lc = &s->HEVClc;
uint8_t split_transform_flag;
int ret;
if (trafo_depth > 0 && log2_trafo_size == 2) {
SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth - 1], xBase, yBase);
SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0) =
SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth - 1], xBase, yBase);
} else {
SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0) = 0;
}
if (lc->cu.intra_split_flag) {
if (trafo_depth == 1)
lc->tu.cur_intra_pred_mode = lc->pu.intra_pred_mode[blk_idx];
} else {
lc->tu.cur_intra_pred_mode = lc->pu.intra_pred_mode[0];
}
lc->tt.cbf_luma = 1;
lc->tt.inter_split_flag = s->sps->max_transform_hierarchy_depth_inter == 0 &&
lc->cu.pred_mode == MODE_INTER &&
lc->cu.part_mode != PART_2Nx2N &&
trafo_depth == 0;
if (log2_trafo_size <= s->sps->log2_max_trafo_size &&
log2_trafo_size > s->sps->log2_min_tb_size &&
trafo_depth < lc->cu.max_trafo_depth &&
!(lc->cu.intra_split_flag && trafo_depth == 0)) {
split_transform_flag = ff_hevc_split_transform_flag_decode(s, log2_trafo_size);
} else {
split_transform_flag = log2_trafo_size > s->sps->log2_max_trafo_size ||
(lc->cu.intra_split_flag && trafo_depth == 0) ||
lc->tt.inter_split_flag;
}
if (log2_trafo_size > 2) {
if (trafo_depth == 0 ||
SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth - 1], xBase, yBase)) {
SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
}
if (trafo_depth == 0 ||
SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth - 1], xBase, yBase)) {
SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0) =
ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
}
}
if (split_transform_flag) {
int x1 = x0 + ((1 << log2_trafo_size) >> 1);
int y1 = y0 + ((1 << log2_trafo_size) >> 1);
ret = hls_transform_tree(s, x0, y0, x0, y0, cb_xBase, cb_yBase,
log2_cb_size, log2_trafo_size - 1,
trafo_depth + 1, 0);
if (ret < 0)
return ret;
ret = hls_transform_tree(s, x1, y0, x0, y0, cb_xBase, cb_yBase,
log2_cb_size, log2_trafo_size - 1,
trafo_depth + 1, 1);
if (ret < 0)
return ret;
ret = hls_transform_tree(s, x0, y1, x0, y0, cb_xBase, cb_yBase,
log2_cb_size, log2_trafo_size - 1,
trafo_depth + 1, 2);
if (ret < 0)
return ret;
ret = hls_transform_tree(s, x1, y1, x0, y0, cb_xBase, cb_yBase,
log2_cb_size, log2_trafo_size - 1,
trafo_depth + 1, 3);
if (ret < 0)
return ret;
} else {
int min_tu_size = 1 << s->sps->log2_min_tb_size;
int log2_min_tu_size = s->sps->log2_min_tb_size;
int min_tu_width = s->sps->min_tb_width;
if (lc->cu.pred_mode == MODE_INTRA || trafo_depth != 0 ||
SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) ||
SAMPLE_CBF(lc->tt.cbf_cr[trafo_depth], x0, y0)) {
lc->tt.cbf_luma = ff_hevc_cbf_luma_decode(s, trafo_depth);
}
ret = hls_transform_unit(s, x0, y0, xBase, yBase, cb_xBase, cb_yBase,
log2_cb_size, log2_trafo_size, trafo_depth,
blk_idx);
if (ret < 0)
return ret;
if (lc->tt.cbf_luma) {
int i, j;
for (i = 0; i < (1 << log2_trafo_size); i += min_tu_size)
for (j = 0; j < (1 << log2_trafo_size); j += min_tu_size) {
int x_tu = (x0 + j) >> log2_min_tu_size;
int y_tu = (y0 + i) >> log2_min_tu_size;
s->cbf_luma[y_tu * min_tu_width + x_tu] = 1;
}
}
if (!s->sh.disable_deblocking_filter_flag) {
ff_hevc_deblocking_boundary_strengths(s, x0, y0, log2_trafo_size,
lc->slice_or_tiles_up_boundary,
lc->slice_or_tiles_left_boundary);
if (s->pps->transquant_bypass_enable_flag &&
lc->cu.cu_transquant_bypass_flag)
set_deblocking_bypass(s, x0, y0, log2_trafo_size);
}
}
return 0;
}
libavcodec/hevc.c:2195: error: Buffer Overrun L1
Offset: -1 Size: 5 by call to `hls_transform_tree`.
libavcodec/hevc.c:2195:23: Call
2193. s->sps->max_transform_hierarchy_depth_intra + lc->cu.intra_split_flag :
2194. s->sps->max_transform_hierarchy_depth_inter;
2195. ret = hls_transform_tree(s, x0, y0, x0, y0, x0, y0,
^
2196. log2_cb_size,
2197. log2_cb_size, 0, 0);
libavcodec/hevc.c:1330:1: <Offset trace>
1328. }
1329.
1330. static int hls_transform_tree(HEVCContext *s, int x0, int y0,
^
1331. int xBase, int yBase, int cb_xBase, int cb_yBase,
1332. int log2_cb_size, int log2_trafo_size,
libavcodec/hevc.c:1330:1: Parameter `trafo_depth`
1328. }
1329.
1330. static int hls_transform_tree(HEVCContext *s, int x0, int y0,
^
1331. int xBase, int yBase, int cb_xBase, int cb_yBase,
1332. int log2_cb_size, int log2_trafo_size,
libavcodec/hevc.c:1330:1: <Length trace>
1328. }
1329.
1330. static int hls_transform_tree(HEVCContext *s, int x0, int y0,
^
1331. int xBase, int yBase, int cb_xBase, int cb_yBase,
1332. int log2_cb_size, int log2_trafo_size,
libavcodec/hevc.c:1330:1: Parameter `s->HEVClc.tt.cbf_cb[*]`
1328. }
1329.
1330. static int hls_transform_tree(HEVCContext *s, int x0, int y0,
^
1331. int xBase, int yBase, int cb_xBase, int cb_yBase,
1332. int log2_cb_size, int log2_trafo_size,
libavcodec/hevc.c:1376:13: Array access: Offset: -1 Size: 5 by call to `hls_transform_tree`
1374. if (log2_trafo_size > 2) {
1375. if (trafo_depth == 0 ||
1376. SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth - 1], xBase, yBase)) {
^
1377. SAMPLE_CBF(lc->tt.cbf_cb[trafo_depth], x0, y0) =
1378. ff_hevc_cbf_cb_cr_decode(s, trafo_depth);
|
https://github.com/libav/libav/blob/e22ebd04bcab7f86548794556c28ecca46d9c2ac/libavcodec/hevc.c/#L1376
|
d2a_code_trace_data_41591
|
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx,
BN_MONT_CTX *in_mont)
{
int i, bits, ret = 0, window, wvalue;
int top;
BN_MONT_CTX *mont = NULL;
int numPowers;
unsigned char *powerbufFree = NULL;
int powerbufLen = 0;
unsigned char *powerbuf = NULL;
BIGNUM tmp, am;
#if defined(SPARC_T4_MONT)
unsigned int t4 = 0;
#endif
bn_check_top(a);
bn_check_top(p);
bn_check_top(m);
if (!BN_is_odd(m)) {
BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
return (0);
}
top = m->top;
bits = BN_num_bits(p);
if (bits == 0) {
if (BN_is_one(m)) {
ret = 1;
BN_zero(rr);
} else {
ret = BN_one(rr);
}
return ret;
}
BN_CTX_start(ctx);
if (in_mont != NULL)
mont = in_mont;
else {
if ((mont = BN_MONT_CTX_new()) == NULL)
goto err;
if (!BN_MONT_CTX_set(mont, m, ctx))
goto err;
}
#ifdef RSAZ_ENABLED
if ((16 == a->top) && (16 == p->top) && (BN_num_bits(m) == 1024)
&& rsaz_avx2_eligible()) {
if (NULL == bn_wexpand(rr, 16))
goto err;
RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d,
mont->n0[0]);
rr->top = 16;
rr->neg = 0;
bn_correct_top(rr);
ret = 1;
goto err;
} else if ((8 == a->top) && (8 == p->top) && (BN_num_bits(m) == 512)) {
if (NULL == bn_wexpand(rr, 8))
goto err;
RSAZ_512_mod_exp(rr->d, a->d, p->d, m->d, mont->n0[0], mont->RR.d);
rr->top = 8;
rr->neg = 0;
bn_correct_top(rr);
ret = 1;
goto err;
}
#endif
window = BN_window_bits_for_ctime_exponent_size(bits);
#if defined(SPARC_T4_MONT)
if (window >= 5 && (top & 15) == 0 && top <= 64 &&
(OPENSSL_sparcv9cap_P[1] & (CFR_MONTMUL | CFR_MONTSQR)) ==
(CFR_MONTMUL | CFR_MONTSQR) && (t4 = OPENSSL_sparcv9cap_P[0]))
window = 5;
else
#endif
#if defined(OPENSSL_BN_ASM_MONT5)
if (window >= 5) {
window = 5;
if ((top & 7) == 0)
powerbufLen += 2 * top * sizeof(m->d[0]);
}
#endif
(void)0;
numPowers = 1 << window;
powerbufLen += sizeof(m->d[0]) * (top * numPowers +
((2 * top) >
numPowers ? (2 * top) : numPowers));
#ifdef alloca
if (powerbufLen < 3072)
powerbufFree =
alloca(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH);
else
#endif
if ((powerbufFree =
OPENSSL_malloc(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH))
== NULL)
goto err;
powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);
memset(powerbuf, 0, powerbufLen);
#ifdef alloca
if (powerbufLen < 3072)
powerbufFree = NULL;
#endif
tmp.d = (BN_ULONG *)(powerbuf + sizeof(m->d[0]) * top * numPowers);
am.d = tmp.d + top;
tmp.top = am.top = 0;
tmp.dmax = am.dmax = top;
tmp.neg = am.neg = 0;
tmp.flags = am.flags = BN_FLG_STATIC_DATA;
#if 1
if (m->d[top - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
for (i = 1; i < top; i++)
tmp.d[i] = (~m->d[i]) & BN_MASK2;
tmp.top = top;
} else
#endif
if (!BN_to_montgomery(&tmp, BN_value_one(), mont, ctx))
goto err;
if (a->neg || BN_ucmp(a, m) >= 0) {
if (!BN_mod(&am, a, m, ctx))
goto err;
if (!BN_to_montgomery(&am, &am, mont, ctx))
goto err;
} else if (!BN_to_montgomery(&am, a, mont, ctx))
goto err;
#if defined(SPARC_T4_MONT)
if (t4) {
typedef int (*bn_pwr5_mont_f) (BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
int bn_pwr5_mont_t4_8(BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
int bn_pwr5_mont_t4_16(BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
int bn_pwr5_mont_t4_24(BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
int bn_pwr5_mont_t4_32(BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
static const bn_pwr5_mont_f pwr5_funcs[4] = {
bn_pwr5_mont_t4_8, bn_pwr5_mont_t4_16,
bn_pwr5_mont_t4_24, bn_pwr5_mont_t4_32
};
bn_pwr5_mont_f pwr5_worker = pwr5_funcs[top / 16 - 1];
typedef int (*bn_mul_mont_f) (BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0);
int bn_mul_mont_t4_8(BN_ULONG *rp, const BN_ULONG *ap, const void *bp,
const BN_ULONG *np, const BN_ULONG *n0);
int bn_mul_mont_t4_16(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0);
int bn_mul_mont_t4_24(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0);
int bn_mul_mont_t4_32(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0);
static const bn_mul_mont_f mul_funcs[4] = {
bn_mul_mont_t4_8, bn_mul_mont_t4_16,
bn_mul_mont_t4_24, bn_mul_mont_t4_32
};
bn_mul_mont_f mul_worker = mul_funcs[top / 16 - 1];
void bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0, int num);
void bn_mul_mont_t4(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0, int num);
void bn_mul_mont_gather5_t4(BN_ULONG *rp, const BN_ULONG *ap,
const void *table, const BN_ULONG *np,
const BN_ULONG *n0, int num, int power);
void bn_flip_n_scatter5_t4(const BN_ULONG *inp, size_t num,
void *table, size_t power);
void bn_gather5_t4(BN_ULONG *out, size_t num,
void *table, size_t power);
void bn_flip_t4(BN_ULONG *dst, BN_ULONG *src, size_t num);
BN_ULONG *np = mont->N.d, *n0 = mont->n0;
int stride = 5 * (6 - (top / 16 - 1));
for (i = am.top; i < top; i++)
am.d[i] = 0;
for (i = tmp.top; i < top; i++)
tmp.d[i] = 0;
bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 0);
bn_flip_n_scatter5_t4(am.d, top, powerbuf, 1);
if (!(*mul_worker) (tmp.d, am.d, am.d, np, n0) &&
!(*mul_worker) (tmp.d, am.d, am.d, np, n0))
bn_mul_mont_vis3(tmp.d, am.d, am.d, np, n0, top);
bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 2);
for (i = 3; i < 32; i++) {
if (!(*mul_worker) (tmp.d, tmp.d, am.d, np, n0) &&
!(*mul_worker) (tmp.d, tmp.d, am.d, np, n0))
bn_mul_mont_vis3(tmp.d, tmp.d, am.d, np, n0, top);
bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, i);
}
np = alloca(top * sizeof(BN_ULONG));
top /= 2;
bn_flip_t4(np, mont->N.d, top);
bits--;
for (wvalue = 0, i = bits % 5; i >= 0; i--, bits--)
wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);
bn_gather5_t4(tmp.d, top, powerbuf, wvalue);
while (bits >= 0) {
if (bits < stride)
stride = bits + 1;
bits -= stride;
wvalue = bn_get_bits(p, bits + 1);
if ((*pwr5_worker) (tmp.d, np, n0, powerbuf, wvalue, stride))
continue;
if ((*pwr5_worker) (tmp.d, np, n0, powerbuf, wvalue, stride))
continue;
bits += stride - 5;
wvalue >>= stride - 5;
wvalue &= 31;
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_gather5_t4(tmp.d, tmp.d, powerbuf, np, n0, top,
wvalue);
}
bn_flip_t4(tmp.d, tmp.d, top);
top *= 2;
tmp.top = top;
bn_correct_top(&tmp);
OPENSSL_cleanse(np, top * sizeof(BN_ULONG));
} else
#endif
#if defined(OPENSSL_BN_ASM_MONT5)
if (window == 5 && top > 1) {
void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap,
const void *table, const BN_ULONG *np,
const BN_ULONG *n0, int num, int power);
void bn_scatter5(const BN_ULONG *inp, size_t num,
void *table, size_t power);
void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power);
void bn_power5(BN_ULONG *rp, const BN_ULONG *ap,
const void *table, const BN_ULONG *np,
const BN_ULONG *n0, int num, int power);
int bn_get_bits5(const BN_ULONG *ap, int off);
int bn_from_montgomery(BN_ULONG *rp, const BN_ULONG *ap,
const BN_ULONG *not_used, const BN_ULONG *np,
const BN_ULONG *n0, int num);
BN_ULONG *np = mont->N.d, *n0 = mont->n0, *np2;
for (i = am.top; i < top; i++)
am.d[i] = 0;
for (i = tmp.top; i < top; i++)
tmp.d[i] = 0;
if (top & 7)
np2 = np;
else
for (np2 = am.d + top, i = 0; i < top; i++)
np2[2 * i] = np[i];
bn_scatter5(tmp.d, top, powerbuf, 0);
bn_scatter5(am.d, am.top, powerbuf, 1);
bn_mul_mont(tmp.d, am.d, am.d, np, n0, top);
bn_scatter5(tmp.d, top, powerbuf, 2);
# if 0
for (i = 3; i < 32; i++) {
bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np2, n0, top, i - 1);
bn_scatter5(tmp.d, top, powerbuf, i);
}
# else
for (i = 4; i < 32; i *= 2) {
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_scatter5(tmp.d, top, powerbuf, i);
}
for (i = 3; i < 8; i += 2) {
int j;
bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np2, n0, top, i - 1);
bn_scatter5(tmp.d, top, powerbuf, i);
for (j = 2 * i; j < 32; j *= 2) {
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_scatter5(tmp.d, top, powerbuf, j);
}
}
for (; i < 16; i += 2) {
bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np2, n0, top, i - 1);
bn_scatter5(tmp.d, top, powerbuf, i);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_scatter5(tmp.d, top, powerbuf, 2 * i);
}
for (; i < 32; i += 2) {
bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np2, n0, top, i - 1);
bn_scatter5(tmp.d, top, powerbuf, i);
}
# endif
bits--;
for (wvalue = 0, i = bits % 5; i >= 0; i--, bits--)
wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);
bn_gather5(tmp.d, top, powerbuf, wvalue);
if (top & 7)
while (bits >= 0) {
for (wvalue = 0, i = 0; i < 5; i++, bits--)
wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_gather5(tmp.d, tmp.d, powerbuf, np, n0, top,
wvalue);
} else {
while (bits >= 0) {
wvalue = bn_get_bits5(p->d, bits - 4);
bits -= 5;
bn_power5(tmp.d, tmp.d, powerbuf, np2, n0, top, wvalue);
}
}
ret = bn_from_montgomery(tmp.d, tmp.d, NULL, np2, n0, top);
tmp.top = top;
bn_correct_top(&tmp);
if (ret) {
if (!BN_copy(rr, &tmp))
ret = 0;
goto err;
}
} else
#endif
{
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, numPowers))
goto err;
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, numPowers))
goto err;
if (window > 1) {
if (!BN_mod_mul_montgomery(&tmp, &am, &am, mont, ctx))
goto err;
if (!MOD_EXP_CTIME_COPY_TO_PREBUF
(&tmp, top, powerbuf, 2, numPowers))
goto err;
for (i = 3; i < numPowers; i++) {
if (!BN_mod_mul_montgomery(&tmp, &am, &tmp, mont, ctx))
goto err;
if (!MOD_EXP_CTIME_COPY_TO_PREBUF
(&tmp, top, powerbuf, i, numPowers))
goto err;
}
}
bits--;
for (wvalue = 0, i = bits % window; i >= 0; i--, bits--)
wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);
if (!MOD_EXP_CTIME_COPY_FROM_PREBUF
(&tmp, top, powerbuf, wvalue, numPowers))
goto err;
while (bits >= 0) {
wvalue = 0;
for (i = 0; i < window; i++, bits--) {
if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx))
goto err;
wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);
}
if (!MOD_EXP_CTIME_COPY_FROM_PREBUF
(&am, top, powerbuf, wvalue, numPowers))
goto err;
if (!BN_mod_mul_montgomery(&tmp, &tmp, &am, mont, ctx))
goto err;
}
}
#if defined(SPARC_T4_MONT)
if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
am.d[0] = 1;
for (i = 1; i < top; i++)
am.d[i] = 0;
if (!BN_mod_mul_montgomery(rr, &tmp, &am, mont, ctx))
goto err;
} else
#endif
if (!BN_from_montgomery(rr, &tmp, mont, ctx))
goto err;
ret = 1;
err:
if (in_mont == NULL)
BN_MONT_CTX_free(mont);
if (powerbuf != NULL) {
OPENSSL_cleanse(powerbuf, powerbufLen);
OPENSSL_free(powerbufFree);
}
BN_CTX_end(ctx);
return (ret);
}
crypto/bn/bn_exp.c:706: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_CTX_start()` at line 695, column 5 is not reachable after line 706, column 14.
Showing all 89 steps of the trace
crypto/bn/bn_exp.c:655:1: start of procedure BN_mod_exp_mont_consttime()
653. * http://www.daemonology.net/hyperthreading-considered-harmful/)
654. */
655. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
656. const BIGNUM *m, BN_CTX *ctx,
657. BN_MONT_CTX *in_mont)
crypto/bn/bn_exp.c:659:5:
657. BN_MONT_CTX *in_mont)
658. {
659. > int i, bits, ret = 0, window, wvalue;
660. int top;
661. BN_MONT_CTX *mont = NULL;
crypto/bn/bn_exp.c:661:5:
659. int i, bits, ret = 0, window, wvalue;
660. int top;
661. > BN_MONT_CTX *mont = NULL;
662.
663. int numPowers;
crypto/bn/bn_exp.c:664:5:
662.
663. int numPowers;
664. > unsigned char *powerbufFree = NULL;
665. int powerbufLen = 0;
666. unsigned char *powerbuf = NULL;
crypto/bn/bn_exp.c:665:5:
663. int numPowers;
664. unsigned char *powerbufFree = NULL;
665. > int powerbufLen = 0;
666. unsigned char *powerbuf = NULL;
667. BIGNUM tmp, am;
crypto/bn/bn_exp.c:666:5:
664. unsigned char *powerbufFree = NULL;
665. int powerbufLen = 0;
666. > unsigned char *powerbuf = NULL;
667. BIGNUM tmp, am;
668. #if defined(SPARC_T4_MONT)
crypto/bn/bn_exp.c:676:10:
674. bn_check_top(m);
675.
676. > if (!BN_is_odd(m)) {
677. BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
678. return (0);
crypto/bn/bn_lib.c:914:1: start of procedure BN_is_odd()
912. }
913.
914. > int BN_is_odd(const BIGNUM *a)
915. {
916. return (a->top > 0) && (a->d[0] & 1);
crypto/bn/bn_lib.c:916:13: Condition is true
914. int BN_is_odd(const BIGNUM *a)
915. {
916. return (a->top > 0) && (a->d[0] & 1);
^
917. }
918.
crypto/bn/bn_lib.c:916:29: Condition is true
914. int BN_is_odd(const BIGNUM *a)
915. {
916. return (a->top > 0) && (a->d[0] & 1);
^
917. }
918.
crypto/bn/bn_lib.c:916:12:
914. int BN_is_odd(const BIGNUM *a)
915. {
916. > return (a->top > 0) && (a->d[0] & 1);
917. }
918.
crypto/bn/bn_lib.c:916:5:
914. int BN_is_odd(const BIGNUM *a)
915. {
916. > return (a->top > 0) && (a->d[0] & 1);
917. }
918.
crypto/bn/bn_lib.c:917:1: return from a call to BN_is_odd
915. {
916. return (a->top > 0) && (a->d[0] & 1);
917. > }
918.
919. int BN_is_negative(const BIGNUM *a)
crypto/bn/bn_exp.c:676:10: Taking false branch
674. bn_check_top(m);
675.
676. if (!BN_is_odd(m)) {
^
677. BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
678. return (0);
crypto/bn/bn_exp.c:681:5:
679. }
680.
681. > top = m->top;
682.
683. bits = BN_num_bits(p);
crypto/bn/bn_exp.c:683:5:
681. top = m->top;
682.
683. > bits = BN_num_bits(p);
684. if (bits == 0) {
685. /* x**0 mod 1 is still zero. */
crypto/bn/bn_lib.c:215:1: start of procedure BN_num_bits()
213. }
214.
215. > int BN_num_bits(const BIGNUM *a)
216. {
217. int i = a->top - 1;
crypto/bn/bn_lib.c:217:5:
215. int BN_num_bits(const BIGNUM *a)
216. {
217. > int i = a->top - 1;
218. bn_check_top(a);
219.
crypto/bn/bn_lib.c:220:9:
218. bn_check_top(a);
219.
220. > if (BN_is_zero(a))
221. return 0;
222. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
crypto/bn/bn_lib.c:899:1: start of procedure BN_is_zero()
897. }
898.
899. > int BN_is_zero(const BIGNUM *a)
900. {
901. return a->top == 0;
crypto/bn/bn_lib.c:901:12: Condition is false
899. int BN_is_zero(const BIGNUM *a)
900. {
901. return a->top == 0;
^
902. }
903.
crypto/bn/bn_lib.c:901:5:
899. int BN_is_zero(const BIGNUM *a)
900. {
901. > return a->top == 0;
902. }
903.
crypto/bn/bn_lib.c:902:1: return from a call to BN_is_zero
900. {
901. return a->top == 0;
902. > }
903.
904. int BN_is_one(const BIGNUM *a)
crypto/bn/bn_lib.c:220:9: Taking false branch
218. bn_check_top(a);
219.
220. if (BN_is_zero(a))
^
221. return 0;
222. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
crypto/bn/bn_lib.c:222:5: Skipping BN_num_bits_word(): empty list of specs
220. if (BN_is_zero(a))
221. return 0;
222. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
^
223. }
224.
crypto/bn/bn_lib.c:223:1: return from a call to BN_num_bits
221. return 0;
222. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
223. > }
224.
225. static void bn_free_d(BIGNUM *a)
crypto/bn/bn_exp.c:684:9: Taking false branch
682.
683. bits = BN_num_bits(p);
684. if (bits == 0) {
^
685. /* x**0 mod 1 is still zero. */
686. if (BN_is_one(m)) {
crypto/bn/bn_exp.c:695:5:
693. }
694.
695. > BN_CTX_start(ctx);
696.
697. /*
crypto/bn/bn_ctx.c:236:1: start of procedure BN_CTX_start()
234. }
235.
236. > void BN_CTX_start(BN_CTX *ctx)
237. {
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_ctx.c:240:9: Taking false branch
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
239. /* If we're already overflowing ... */
240. if (ctx->err_stack || ctx->too_many)
^
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
crypto/bn/bn_ctx.c:240:27: Taking false branch
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
239. /* If we're already overflowing ... */
240. if (ctx->err_stack || ctx->too_many)
^
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
crypto/bn/bn_ctx.c:243:15:
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
243. > else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
244. BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
245. ctx->err_stack++;
crypto/bn/bn_ctx.c:307:1: start of procedure BN_STACK_push()
305.
306.
307. > static int BN_STACK_push(BN_STACK *st, unsigned int idx)
308. {
309. if (st->depth == st->size) {
crypto/bn/bn_ctx.c:309:9: Taking true branch
307. static int BN_STACK_push(BN_STACK *st, unsigned int idx)
308. {
309. if (st->depth == st->size) {
^
310. /* Need to expand */
311. unsigned int newsize =
crypto/bn/bn_ctx.c:312:13: Condition is true
310. /* Need to expand */
311. unsigned int newsize =
312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
^
313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize);
314. if (newitems == NULL)
crypto/bn/bn_ctx.c:311:9:
309. if (st->depth == st->size) {
310. /* Need to expand */
311. > unsigned int newsize =
312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize);
crypto/bn/bn_ctx.c:313:9:
311. unsigned int newsize =
312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
313. > unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize);
314. if (newitems == NULL)
315. 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)
crypto/bn/bn_ctx.c:314:13: Taking false branch
312. st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
313. unsigned int *newitems = OPENSSL_malloc(sizeof(*newitems) * newsize);
314. if (newitems == NULL)
^
315. return 0;
316. if (st->depth)
crypto/bn/bn_ctx.c:316:13: Taking true branch
314. if (newitems == NULL)
315. return 0;
316. if (st->depth)
^
317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
318. OPENSSL_free(st->indexes);
crypto/bn/bn_ctx.c:317:13:
315. return 0;
316. if (st->depth)
317. > memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
318. OPENSSL_free(st->indexes);
319. st->indexes = newitems;
crypto/bn/bn_ctx.c:318:9:
316. if (st->depth)
317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
318. > OPENSSL_free(st->indexes);
319. st->indexes = newitems;
320. st->size = newsize;
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/bn/bn_ctx.c:319:9:
317. memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
318. OPENSSL_free(st->indexes);
319. > st->indexes = newitems;
320. st->size = newsize;
321. }
crypto/bn/bn_ctx.c:320:9:
318. OPENSSL_free(st->indexes);
319. st->indexes = newitems;
320. > st->size = newsize;
321. }
322. st->indexes[(st->depth)++] = idx;
crypto/bn/bn_ctx.c:322:5:
320. st->size = newsize;
321. }
322. > st->indexes[(st->depth)++] = idx;
323. return 1;
324. }
crypto/bn/bn_ctx.c:323:5:
321. }
322. st->indexes[(st->depth)++] = idx;
323. > return 1;
324. }
325.
crypto/bn/bn_ctx.c:324:1: return from a call to BN_STACK_push
322. st->indexes[(st->depth)++] = idx;
323. return 1;
324. > }
325.
326. static unsigned int BN_STACK_pop(BN_STACK *st)
crypto/bn/bn_ctx.c:243:15: Taking false branch
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
243. else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
^
244. BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
245. ctx->err_stack++;
crypto/bn/bn_ctx.c:240:5:
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
239. /* If we're already overflowing ... */
240. > if (ctx->err_stack || ctx->too_many)
241. ctx->err_stack++;
242. /* (Try to) get a new frame pointer */
crypto/bn/bn_ctx.c:248:1: return from a call to BN_CTX_start
246. }
247. CTXDBG_EXIT(ctx);
248. > }
249.
250. void BN_CTX_end(BN_CTX *ctx)
crypto/bn/bn_exp.c:701:9: Taking false branch
699. * this is not done, things will break in the montgomery part.
700. */
701. if (in_mont != NULL)
^
702. mont = in_mont;
703. else {
crypto/bn/bn_exp.c:704:13:
702. mont = in_mont;
703. else {
704. > if ((mont = BN_MONT_CTX_new()) == NULL)
705. goto err;
706. if (!BN_MONT_CTX_set(mont, m, ctx))
crypto/bn/bn_mont.c:315:1: start of procedure BN_MONT_CTX_new()
313. }
314.
315. > BN_MONT_CTX *BN_MONT_CTX_new(void)
316. {
317. BN_MONT_CTX *ret;
crypto/bn/bn_mont.c:319:9:
317. BN_MONT_CTX *ret;
318.
319. > if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
320. return (NULL);
321.
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/bn/bn_mont.c:319:9: Taking false branch
317. BN_MONT_CTX *ret;
318.
319. if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
^
320. return (NULL);
321.
crypto/bn/bn_mont.c:322:5:
320. return (NULL);
321.
322. > BN_MONT_CTX_init(ret);
323. ret->flags = BN_FLG_MALLOCED;
324. return (ret);
crypto/bn/bn_mont.c:327:1: start of procedure BN_MONT_CTX_init()
325. }
326.
327. > void BN_MONT_CTX_init(BN_MONT_CTX *ctx)
328. {
329. ctx->ri = 0;
crypto/bn/bn_mont.c:329:5:
327. void BN_MONT_CTX_init(BN_MONT_CTX *ctx)
328. {
329. > ctx->ri = 0;
330. bn_init(&(ctx->RR));
331. bn_init(&(ctx->N));
crypto/bn/bn_mont.c:330:5: Skipping bn_init(): empty list of specs
328. {
329. ctx->ri = 0;
330. bn_init(&(ctx->RR));
^
331. bn_init(&(ctx->N));
332. bn_init(&(ctx->Ni));
crypto/bn/bn_mont.c:331:5: Skipping bn_init(): empty list of specs
329. ctx->ri = 0;
330. bn_init(&(ctx->RR));
331. bn_init(&(ctx->N));
^
332. bn_init(&(ctx->Ni));
333. ctx->n0[0] = ctx->n0[1] = 0;
crypto/bn/bn_mont.c:332:5: Skipping bn_init(): empty list of specs
330. bn_init(&(ctx->RR));
331. bn_init(&(ctx->N));
332. bn_init(&(ctx->Ni));
^
333. ctx->n0[0] = ctx->n0[1] = 0;
334. ctx->flags = 0;
crypto/bn/bn_mont.c:333:5:
331. bn_init(&(ctx->N));
332. bn_init(&(ctx->Ni));
333. > ctx->n0[0] = ctx->n0[1] = 0;
334. ctx->flags = 0;
335. }
crypto/bn/bn_mont.c:334:5:
332. bn_init(&(ctx->Ni));
333. ctx->n0[0] = ctx->n0[1] = 0;
334. > ctx->flags = 0;
335. }
336.
crypto/bn/bn_mont.c:335:1: return from a call to BN_MONT_CTX_init
333. ctx->n0[0] = ctx->n0[1] = 0;
334. ctx->flags = 0;
335. > }
336.
337. void BN_MONT_CTX_free(BN_MONT_CTX *mont)
crypto/bn/bn_mont.c:323:5:
321.
322. BN_MONT_CTX_init(ret);
323. > ret->flags = BN_FLG_MALLOCED;
324. return (ret);
325. }
crypto/bn/bn_mont.c:324:5:
322. BN_MONT_CTX_init(ret);
323. ret->flags = BN_FLG_MALLOCED;
324. > return (ret);
325. }
326.
crypto/bn/bn_mont.c:325:1: return from a call to BN_MONT_CTX_new
323. ret->flags = BN_FLG_MALLOCED;
324. return (ret);
325. > }
326.
327. void BN_MONT_CTX_init(BN_MONT_CTX *ctx)
crypto/bn/bn_exp.c:704:13: Taking false branch
702. mont = in_mont;
703. else {
704. if ((mont = BN_MONT_CTX_new()) == NULL)
^
705. goto err;
706. if (!BN_MONT_CTX_set(mont, m, ctx))
crypto/bn/bn_exp.c:706:14: Skipping BN_MONT_CTX_set(): empty list of specs
704. if ((mont = BN_MONT_CTX_new()) == NULL)
705. goto err;
706. if (!BN_MONT_CTX_set(mont, m, ctx))
^
707. goto err;
708. }
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/bn/bn_exp.c/#L706
|
d2a_code_trace_data_41592
|
static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
int width, int height)
{
uint8_t *src_m1, *src_0, *src_p1, *src_p2;
int y;
uint8_t *buf;
buf = av_malloc(width);
src_m1 = src1;
memcpy(buf,src_m1,width);
src_0=&src_m1[src_wrap];
src_p1=&src_0[src_wrap];
src_p2=&src_p1[src_wrap];
for(y=0;y<(height-2);y+=2) {
deinterlace_line_inplace(buf,src_m1,src_0,src_p1,src_p2,width);
src_m1 = src_p1;
src_0 = src_p2;
src_p1 += 2*src_wrap;
src_p2 += 2*src_wrap;
}
deinterlace_line_inplace(buf,src_m1,src_0,src_0,src_0,width);
av_free(buf);
}
libavcodec/imgconvert.c:445: error: Null Dereference
pointer `buf` last assigned on line 442 could be null and is dereferenced by call to `memcpy()` at line 445, column 5.
libavcodec/imgconvert.c:436:1: start of procedure deinterlace_bottom_field_inplace()
434. }
435.
436. static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
^
437. int width, int height)
438. {
libavcodec/imgconvert.c:442:5:
440. int y;
441. uint8_t *buf;
442. buf = av_malloc(width);
^
443.
444. src_m1 = src1;
libavutil/mem.c:61:1: start of procedure av_malloc()
59. * linker will do it automatically. */
60.
61. void *av_malloc(size_t size)
^
62. {
63. void *ptr = NULL;
libavutil/mem.c:63:5:
61. void *av_malloc(size_t size)
62. {
63. void *ptr = NULL;
^
64. #if CONFIG_MEMALIGN_HACK
65. long diff;
libavutil/mem.c:69:9: Taking true branch
67.
68. /* let's disallow possible ambiguous cases */
69. if (size > (INT_MAX - 32) || !size)
^
70. return NULL;
71.
libavutil/mem.c:70:9:
68. /* let's disallow possible ambiguous cases */
69. if (size > (INT_MAX - 32) || !size)
70. return NULL;
^
71.
72. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:114:1: return from a call to av_malloc
112. #endif
113. return ptr;
114. }
^
115.
116. void *av_realloc(void *ptr, size_t size)
libavcodec/imgconvert.c:444:5:
442. buf = av_malloc(width);
443.
444. src_m1 = src1;
^
445. memcpy(buf,src_m1,width);
446. src_0=&src_m1[src_wrap];
libavcodec/imgconvert.c:445:5:
443.
444. src_m1 = src1;
445. memcpy(buf,src_m1,width);
^
446. src_0=&src_m1[src_wrap];
447. src_p1=&src_0[src_wrap];
|
https://github.com/libav/libav/blob/2eaa3663fda750dac66d41fe8541a8744d5563a4/libavcodec/imgconvert.c/#L445
|
d2a_code_trace_data_41593
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ec2_oct.c:220: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`.
Showing all 9 steps of the trace
crypto/ec/ec2_oct.c:113:1: Parameter `ctx->stack.depth`
111. * an error will be returned.
112. */
113. > size_t ec_GF2m_simple_point2oct(const EC_GROUP *group, const EC_POINT *point,
114. point_conversion_form_t form,
115. unsigned char *buf, size_t len, BN_CTX *ctx)
crypto/ec/ec2_oct.c:220:9: Call
218.
219. if (used_ctx)
220. BN_CTX_end(ctx);
^
221. BN_CTX_free(new_ctx);
222. return ret;
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_CTX_end`
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_41594
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
bn_check_top(b);
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return (NULL);
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return (NULL);
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/bn/bn_prime.c:217: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_MONT_CTX_set`.
Showing all 21 steps of the trace
crypto/bn/bn_prime.c:217:10: Call
215. if (mont == NULL)
216. goto err;
217. if (!BN_MONT_CTX_set(mont, a, ctx))
^
218. goto err;
219.
crypto/bn/bn_mont.c:247:1: Parameter `mont->N.top`
245. }
246.
247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
248. {
249. int ret = 0;
crypto/bn/bn_mont.c:259:10: Call
257. goto err;
258. R = &(mont->RR); /* grab RR as a temp */
259. if (!BN_copy(&(mont->N), mod))
^
260. goto err; /* Set N */
261. mont->N.neg = 0;
crypto/bn/bn_lib.c:323:1: Parameter `a->top`
321. }
322.
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324. {
325. bn_check_top(b);
crypto/bn/bn_lib.c:329:9: Call
327. if (a == b)
328. return a;
329. if (bn_wexpand(a, b->top) == NULL)
^
330. return NULL;
331.
crypto/bn/bn_lib.c:948:1: Parameter `a->top`
946. }
947.
948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:950:37: Call
948. BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
951. }
952.
crypto/bn/bn_lib.c:284:1: Parameter `b->top`
282. */
283.
284. > BIGNUM *bn_expand2(BIGNUM *b, int words)
285. {
286. bn_check_top(b);
crypto/bn/bn_lib.c:289:23: Call
287.
288. if (words > b->dmax) {
289. BN_ULONG *a = bn_expand_internal(b, words);
^
290. if (!a)
291. return NULL;
crypto/bn/bn_lib.c:246:1: <Offset trace>
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: Parameter `b->top`
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: <Length trace>
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: Parameter `words`
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:263:13: Call
261. a = OPENSSL_secure_zalloc(words * sizeof(*a));
262. else
263. a = OPENSSL_zalloc(words * sizeof(*a));
^
264. if (a == NULL) {
265. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/mem.c:186:1: Parameter `num`
184. }
185.
186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:188:17: Call
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
^
189.
190. FAILTEST();
crypto/mem.c:166:9: Assignment
164.
165. if (num == 0)
166. return NULL;
^
167.
168. FAILTEST();
crypto/mem.c:188:5: Assignment
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
^
189.
190. FAILTEST();
crypto/mem.c:193:5: Assignment
191. if (ret != NULL)
192. memset(ret, 0, num);
193. return ret;
^
194. }
195.
crypto/bn/bn_lib.c:263:9: Assignment
261. a = OPENSSL_secure_zalloc(words * sizeof(*a));
262. else
263. a = OPENSSL_zalloc(words * sizeof(*a));
^
264. if (a == NULL) {
265. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:271:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_MONT_CTX_set`
269. assert(b->top <= words);
270. if (b->top > 0)
271. memcpy(a, b->d, sizeof(*a) * b->top);
^
272.
273. return a;
|
https://github.com/openssl/openssl/blob/757264207ad8650a89ea903d48ad89f61d56ea9c/crypto/bn/bn_lib.c/#L271
|
d2a_code_trace_data_41595
|
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:264: 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:266:3: Array declaration
264. sk=ssl_create_cipher_list(ctx->method,&(ctx->cipher_list),
265. &(ctx->cipher_list_by_id),
266. meth->version == SSL2_VERSION ? "SSLv2" : SSL_DEFAULT_CIPHER_LIST, ctx->cert);
^
267. if ((sk == NULL) || (sk_SSL_CIPHER_num(sk) <= 0))
268. {
ssl/ssl_lib.c:264:5: Call
262. ctx->method=meth;
263.
264. sk=ssl_create_cipher_list(ctx->method,&(ctx->cipher_list),
^
265. &(ctx->cipher_list_by_id),
266. meth->version == SSL2_VERSION ? "SSLv2" : SSL_DEFAULT_CIPHER_LIST, ctx->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_41596
|
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_mont.c:233: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_set_word`.
Showing all 16 steps of the trace
crypto/ec/ecp_mont.c:229:14: Call
227.
228. BN_CTX_start(ctx);
229. if ((e = BN_CTX_get(ctx)) == NULL)
^
230. goto err;
231.
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_mont.c:233:10: Call
231.
232. /* Inverse in constant time with Fermats Little Theorem */
233. if (!BN_set_word(e, 2))
^
234. goto err;
235. if (!BN_sub(e, group->field, e))
crypto/bn/bn_lib.c:359:1: Parameter `*a->d`
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->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: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_set_word`
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/8f58ede09572dcc6a7e6c01280dd348240199568/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_41597
|
int BN_set_bit(BIGNUM *a, int n)
{
int i, j, k;
if (n < 0)
return 0;
i = n / BN_BITS2;
j = n % BN_BITS2;
if (a->top <= i) {
if (bn_wexpand(a, i + 1) == NULL)
return (0);
for (k = a->top; k < i + 1; k++)
a->d[k] = 0;
a->top = i + 1;
}
a->d[i] |= (((BN_ULONG)1) << j);
bn_check_top(a);
return (1);
}
test/bntest.c:166: error: BUFFER_OVERRUN_L3
Offset: [0, 49] Size: [0, 8388607] by call to `BN_set_bit`.
Showing all 7 steps of the trace
test/bntest.c:55:1: Assignment
53. } MPITEST;
54.
55. > static const int NUM0 = 100; /* number of tests */
56. static const int NUM1 = 50; /* additional tests for some functions */
57. static BN_CTX *ctx;
test/bntest.c:166:18: Call
164. BN_bntest_rand(a, 512, 0, 0);
165. BN_copy(b, a);
166. if (!TEST_int_ne(BN_set_bit(a, i), 0))
^
167. goto err;
168. BN_add_word(b, i);
crypto/bn/bn_lib.c:624:1: <Offset trace>
622. }
623.
624. > int BN_set_bit(BIGNUM *a, int n)
625. {
626. int i, j, k;
crypto/bn/bn_lib.c:624:1: Parameter `a->top`
622. }
623.
624. > int BN_set_bit(BIGNUM *a, int n)
625. {
626. int i, j, k;
crypto/bn/bn_lib.c:624:1: <Length trace>
622. }
623.
624. > int BN_set_bit(BIGNUM *a, int n)
625. {
626. int i, j, k;
crypto/bn/bn_lib.c:624:1: Parameter `*a->d`
622. }
623.
624. > int BN_set_bit(BIGNUM *a, int n)
625. {
626. int i, j, k;
crypto/bn/bn_lib.c:641:5: Array access: Offset: [0, 49] Size: [0, 8388607] by call to `BN_set_bit`
639. }
640.
641. a->d[i] |= (((BN_ULONG)1) << j);
^
642. bn_check_top(a);
643. return (1);
|
https://github.com/openssl/openssl/blob/ae269dd8b72dbed1f2c5f92dbe0fbf5b7b905e7b/crypto/bn/bn_lib.c/#L641
|
d2a_code_trace_data_41598
|
static int get_cert_by_subject(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
X509_NAME *name, X509_OBJECT *ret)
{
BY_DIR *ctx;
union {
X509 st_x509;
X509_CRL crl;
} data;
int ok = 0;
int i, j, k;
unsigned long h;
BUF_MEM *b = NULL;
X509_OBJECT stmp, *tmp;
const char *postfix = "";
if (name == NULL)
return 0;
stmp.type = type;
if (type == X509_LU_X509) {
data.st_x509.cert_info.subject = name;
stmp.data.x509 = &data.st_x509;
postfix = "";
} else if (type == X509_LU_CRL) {
data.crl.crl.issuer = name;
stmp.data.crl = &data.crl;
postfix = "r";
} else {
X509err(X509_F_GET_CERT_BY_SUBJECT, X509_R_WRONG_LOOKUP_TYPE);
goto finish;
}
if ((b = BUF_MEM_new()) == NULL) {
X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_BUF_LIB);
goto finish;
}
ctx = (BY_DIR *)xl->method_data;
h = X509_NAME_hash(name);
for (i = 0; i < sk_BY_DIR_ENTRY_num(ctx->dirs); i++) {
BY_DIR_ENTRY *ent;
int idx;
BY_DIR_HASH htmp, *hent;
ent = sk_BY_DIR_ENTRY_value(ctx->dirs, i);
j = strlen(ent->dir) + 1 + 8 + 6 + 1 + 1;
if (!BUF_MEM_grow(b, j)) {
X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);
goto finish;
}
if (type == X509_LU_CRL && ent->hashes) {
htmp.hash = h;
CRYPTO_THREAD_read_lock(ctx->lock);
idx = sk_BY_DIR_HASH_find(ent->hashes, &htmp);
if (idx >= 0) {
hent = sk_BY_DIR_HASH_value(ent->hashes, idx);
k = hent->suffix;
} else {
hent = NULL;
k = 0;
}
CRYPTO_THREAD_unlock(ctx->lock);
} else {
k = 0;
hent = NULL;
}
for (;;) {
char c = '/';
#ifdef OPENSSL_SYS_VMS
c = ent->dir[strlen(ent->dir) - 1];
if (c != ':' && c != '>' && c != ']') {
c = ':';
} else {
c = '\0';
}
#endif
if (c == '\0') {
BIO_snprintf(b->data, b->max,
"%s%08lx.%s%d", ent->dir, h, postfix, k);
} else {
BIO_snprintf(b->data, b->max,
"%s%c%08lx.%s%d", ent->dir, c, h, postfix, k);
}
#ifndef OPENSSL_NO_POSIX_IO
# ifdef _WIN32
# define stat _stat
# endif
{
struct stat st;
if (stat(b->data, &st) < 0)
break;
}
#endif
if (type == X509_LU_X509) {
if ((X509_load_cert_file(xl, b->data, ent->dir_type)) == 0)
break;
} else if (type == X509_LU_CRL) {
if ((X509_load_crl_file(xl, b->data, ent->dir_type)) == 0)
break;
}
k++;
}
CRYPTO_THREAD_write_lock(ctx->lock);
j = sk_X509_OBJECT_find(xl->store_ctx->objs, &stmp);
if (j != -1)
tmp = sk_X509_OBJECT_value(xl->store_ctx->objs, j);
else
tmp = NULL;
CRYPTO_THREAD_unlock(ctx->lock);
if (type == X509_LU_CRL) {
CRYPTO_THREAD_write_lock(ctx->lock);
if (!hent) {
htmp.hash = h;
idx = sk_BY_DIR_HASH_find(ent->hashes, &htmp);
if (idx >= 0)
hent = sk_BY_DIR_HASH_value(ent->hashes, idx);
}
if (!hent) {
hent = OPENSSL_malloc(sizeof(*hent));
if (hent == NULL) {
CRYPTO_THREAD_unlock(ctx->lock);
X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE);
ok = 0;
goto finish;
}
hent->hash = h;
hent->suffix = k;
if (!sk_BY_DIR_HASH_push(ent->hashes, hent)) {
CRYPTO_THREAD_unlock(ctx->lock);
OPENSSL_free(hent);
ok = 0;
goto finish;
}
} else if (hent->suffix < k) {
hent->suffix = k;
}
CRYPTO_THREAD_unlock(ctx->lock);
}
if (tmp != NULL) {
ok = 1;
ret->type = tmp->type;
memcpy(&ret->data, &tmp->data, sizeof(ret->data));
ERR_clear_error();
goto finish;
}
}
finish:
BUF_MEM_free(b);
return ok;
}
crypto/x509/by_dir.c:388: error: NULL_DEREFERENCE
pointer `b` last assigned on line 214 could be null and is dereferenced by call to `BUF_MEM_free()` at line 388, column 5.
Showing all 13 steps of the trace
crypto/x509/by_dir.c:203:1: start of procedure get_cert_by_subject()
201. }
202.
203. > static int get_cert_by_subject(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
204. X509_NAME *name, X509_OBJECT *ret)
205. {
crypto/x509/by_dir.c:211:5:
209. X509_CRL crl;
210. } data;
211. > int ok = 0;
212. int i, j, k;
213. unsigned long h;
crypto/x509/by_dir.c:214:5:
212. int i, j, k;
213. unsigned long h;
214. > BUF_MEM *b = NULL;
215. X509_OBJECT stmp, *tmp;
216. const char *postfix = "";
crypto/x509/by_dir.c:216:5:
214. BUF_MEM *b = NULL;
215. X509_OBJECT stmp, *tmp;
216. > const char *postfix = "";
217.
218. if (name == NULL)
crypto/x509/by_dir.c:218:9: Taking false branch
216. const char *postfix = "";
217.
218. if (name == NULL)
^
219. return 0;
220.
crypto/x509/by_dir.c:221:5:
219. return 0;
220.
221. > stmp.type = type;
222. if (type == X509_LU_X509) {
223. data.st_x509.cert_info.subject = name;
crypto/x509/by_dir.c:222:9: Taking false branch
220.
221. stmp.type = type;
222. if (type == X509_LU_X509) {
^
223. data.st_x509.cert_info.subject = name;
224. stmp.data.x509 = &data.st_x509;
crypto/x509/by_dir.c:226:16: Taking false branch
224. stmp.data.x509 = &data.st_x509;
225. postfix = "";
226. } else if (type == X509_LU_CRL) {
^
227. data.crl.crl.issuer = name;
228. stmp.data.crl = &data.crl;
crypto/x509/by_dir.c:231:9: Skipping ERR_put_error(): empty list of specs
229. postfix = "r";
230. } else {
231. X509err(X509_F_GET_CERT_BY_SUBJECT, X509_R_WRONG_LOOKUP_TYPE);
^
232. goto finish;
233. }
crypto/x509/by_dir.c:387:2:
385. }
386. }
387. > finish:
388. BUF_MEM_free(b);
389. return ok;
crypto/x509/by_dir.c:388:5:
386. }
387. finish:
388. > BUF_MEM_free(b);
389. return ok;
390. }
crypto/buffer/buffer.c:43:1: start of procedure BUF_MEM_free()
41. }
42.
43. > void BUF_MEM_free(BUF_MEM *a)
44. {
45. if (a->data != NULL) {
crypto/buffer/buffer.c:45:9:
43. void BUF_MEM_free(BUF_MEM *a)
44. {
45. > if (a->data != NULL) {
46. if (a->flags & BUF_MEM_FLAG_SECURE)
47. OPENSSL_secure_clear_free(a->data, a->max);
|
https://github.com/openssl/openssl/blob/98c03302fb7b855647aa14022f61f5fb272e514a/crypto/x509/by_dir.c/#L388
|
d2a_code_trace_data_41599
|
static void unpack_input(const unsigned char *input, unsigned int *output)
{
unsigned int outbuffer[28];
unsigned short inbuffer[10];
unsigned int x;
unsigned int *ptr;
for (x=0;x<20;x+=2)
inbuffer[x/2]=(input[x]<<8)+input[x+1];
ptr=outbuffer;
*(ptr++)=27;
*(ptr++)=(inbuffer[0]>>10)&0x3f;
*(ptr++)=(inbuffer[0]>>5)&0x1f;
*(ptr++)=inbuffer[0]&0x1f;
*(ptr++)=(inbuffer[1]>>12)&0xf;
*(ptr++)=(inbuffer[1]>>8)&0xf;
*(ptr++)=(inbuffer[1]>>5)&7;
*(ptr++)=(inbuffer[1]>>2)&7;
*(ptr++)=((inbuffer[1]<<1)&6)|((inbuffer[2]>>15)&1);
*(ptr++)=(inbuffer[2]>>12)&7;
*(ptr++)=(inbuffer[2]>>10)&3;
*(ptr++)=(inbuffer[2]>>5)&0x1f;
*(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3);
*(ptr++)=(inbuffer[3]>>6)&0xff;
*(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
*(ptr++)=(inbuffer[4]>>8)&0x7f;
*(ptr++)=(inbuffer[4]>>1)&0x7f;
*(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f);
*(ptr++)=(inbuffer[5]>>2)&0x7f;
*(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f);
*(ptr++)=(inbuffer[6]>>4)&0x7f;
*(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf);
*(ptr++)=(inbuffer[7]>>5)&0x7f;
*(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3);
*(ptr++)=(inbuffer[8]>>7)&0x7f;
*(ptr++)=((inbuffer[8]<<1)&0xfe)|((inbuffer[9]>>15)&1);
*(ptr++)=(inbuffer[9]>>8)&0x7f;
*(ptr++)=(inbuffer[9]>>1)&0x7f;
*(output++)=outbuffer[11];
for (x=1;x<11;*(output++)=outbuffer[x++]);
ptr=outbuffer+12;
for (x=0;x<16;x+=4)
{
*(output++)=ptr[x];
*(output++)=ptr[x+2];
*(output++)=ptr[x+3];
*(output++)=ptr[x+1];
}
}
libavcodec/ra144.c:297: error: Uninitialized Value
The value read from outbuffer[_] was never initialized.
libavcodec/ra144.c:297:17:
295.
296. *(output++)=outbuffer[11];
297. for (x=1;x<11;*(output++)=outbuffer[x++]);
^
298. ptr=outbuffer+12;
299. for (x=0;x<16;x+=4)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L297
|
d2a_code_trace_data_41600
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ecp_smpl.c:568: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_sqr`.
Showing all 18 steps of the trace
crypto/ec/ecp_smpl.c:496:1: Parameter `ctx->stack.depth`
494. }
495.
496. > int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group,
497. const EC_POINT *point,
498. BIGNUM *x, BIGNUM *y,
crypto/ec/ecp_smpl.c:518:5: Call
516. }
517.
518. BN_CTX_start(ctx);
^
519. Z = BN_CTX_get(ctx);
520. Z_1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/ec/ecp_smpl.c:568:18: Call
566. goto err;
567. } else {
568. if (!BN_mod_sqr(Z_2, Z_1, group->field, ctx))
^
569. goto err;
570. }
crypto/bn/bn_mod.c:222:1: Parameter `ctx->stack.depth`
220. }
221.
222. > int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
223. {
224. if (!BN_sqr(r, a, ctx))
crypto/bn/bn_mod.c:224:10: Call
222. int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
223. {
224. if (!BN_sqr(r, a, ctx))
^
225. return 0;
226. /* r->neg == 0, thus we don't need BN_nnmod */
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_sqr`
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_41601
|
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
{
int i, nw, lb, rb;
BN_ULONG *t, *f;
BN_ULONG l;
bn_check_top(r);
bn_check_top(a);
if (n < 0) {
BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
return 0;
}
r->neg = a->neg;
nw = n / BN_BITS2;
if (bn_wexpand(r, a->top + nw + 1) == NULL)
return (0);
lb = n % BN_BITS2;
rb = BN_BITS2 - lb;
f = a->d;
t = r->d;
t[a->top + nw] = 0;
if (lb == 0)
for (i = a->top - 1; i >= 0; i--)
t[nw + i] = f[i];
else
for (i = a->top - 1; i >= 0; i--) {
l = f[i];
t[nw + i + 1] |= (l >> rb) & BN_MASK2;
t[nw + i] = (l << lb) & BN_MASK2;
}
memset(t, 0, sizeof(*t) * nw);
r->top = a->top + nw + 1;
bn_correct_top(r);
bn_check_top(r);
return (1);
}
crypto/ec/ecdsa_ossl.c:273: error: BUFFER_OVERRUN_L3
Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mod_mul`.
Showing all 20 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 `eckey->group->order->top`
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:273:14: Call
271. }
272.
273. if (!BN_mod_mul(tmp, priv_key, ret->r, order, ctx)) {
^
274. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
275. goto err;
crypto/bn/bn_mod.c:73:1: Parameter `m->top`
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:93:10: Call
91. goto err;
92. }
93. if (!BN_nnmod(r, t, m, ctx))
^
94. goto err;
95. bn_check_top(r);
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:205:31: Call
203.
204. /* First we normalise the numbers */
205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
^
206. if (!(BN_lshift(sdiv, divisor, norm_shift)))
207. goto err;
crypto/bn/bn_lib.c:167:9: Assignment
165.
166. if (BN_is_zero(a))
167. return 0;
^
168. return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));
169. }
crypto/bn/bn_div.c:205:5: Assignment
203.
204. /* First we normalise the numbers */
205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
^
206. if (!(BN_lshift(sdiv, divisor, norm_shift)))
207. goto err;
crypto/bn/bn_div.c:206:11: Call
204. /* First we normalise the numbers */
205. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
206. if (!(BN_lshift(sdiv, divisor, norm_shift)))
^
207. goto err;
208. sdiv->neg = 0;
crypto/bn/bn_shift.c: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 `BN_mod_mul`
108. for (i = a->top - 1; i >= 0; i--) {
109. l = f[i];
110. t[nw + i + 1] |= (l >> rb) & BN_MASK2;
^
111. t[nw + i] = (l << lb) & BN_MASK2;
112. }
|
https://github.com/openssl/openssl/blob/69588edbaa424beb71c6a9b1be416588232cb78c/crypto/bn/bn_shift.c/#L110
|
d2a_code_trace_data_41602
|
static int tls_construct_cke_rsa(SSL *s, unsigned char **p, int *len, int *al)
{
#ifndef OPENSSL_NO_RSA
unsigned char *q;
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, pmslen - 2) <= 0) {
goto err;
}
q = *p;
if (s->version > SSL3_VERSION)
*p += 2;
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 (EVP_PKEY_encrypt(pctx, *p, &enclen, pms, pmslen) <= 0) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT);
goto err;
}
*len = enclen;
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) {
s2n(*len, q);
*len += 2;
}
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:2212: error: MEMORY_LEAK
memory dynamically allocated by call to `CRYPTO_malloc()` at line 2164, column 11 is not reachable after line 2212, column 5.
Showing all 58 steps of the trace
ssl/statem/statem_clnt.c:2139:1: start of procedure tls_construct_cke_rsa()
2137. }
2138.
2139. > static int tls_construct_cke_rsa(SSL *s, unsigned char **p, int *len, int *al)
2140. {
2141. #ifndef OPENSSL_NO_RSA
ssl/statem/statem_clnt.c:2143:5:
2141. #ifndef OPENSSL_NO_RSA
2142. unsigned char *q;
2143. > EVP_PKEY *pkey = NULL;
2144. EVP_PKEY_CTX *pctx = NULL;
2145. size_t enclen;
ssl/statem/statem_clnt.c:2144:5:
2142. unsigned char *q;
2143. EVP_PKEY *pkey = NULL;
2144. > EVP_PKEY_CTX *pctx = NULL;
2145. size_t enclen;
2146. unsigned char *pms = NULL;
ssl/statem/statem_clnt.c:2146:5:
2144. EVP_PKEY_CTX *pctx = NULL;
2145. size_t enclen;
2146. > unsigned char *pms = NULL;
2147. size_t pmslen = 0;
2148.
ssl/statem/statem_clnt.c:2147:5:
2145. size_t enclen;
2146. unsigned char *pms = NULL;
2147. > size_t pmslen = 0;
2148.
2149. if (s->session->peer == NULL) {
ssl/statem/statem_clnt.c:2149:9: Taking false branch
2147. size_t pmslen = 0;
2148.
2149. if (s->session->peer == NULL) {
^
2150. /*
2151. * We should always have a server certificate with SSL_kRSA.
ssl/statem/statem_clnt.c:2157:5:
2155. }
2156.
2157. > pkey = X509_get0_pubkey(s->session->peer);
2158. if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2159. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
crypto/x509/x509_cmp.c:260:1: start of procedure X509_get0_pubkey()
258. }
259.
260. > EVP_PKEY *X509_get0_pubkey(X509 *x)
261. {
262. if (x == NULL)
crypto/x509/x509_cmp.c:262:9: Taking false branch
260. EVP_PKEY *X509_get0_pubkey(X509 *x)
261. {
262. if (x == NULL)
^
263. return NULL;
264. return X509_PUBKEY_get0(x->cert_info.key);
crypto/x509/x509_cmp.c:264:5: Skipping X509_PUBKEY_get0(): empty list of specs
262. if (x == NULL)
263. return NULL;
264. return X509_PUBKEY_get0(x->cert_info.key);
^
265. }
266.
crypto/x509/x509_cmp.c:265:1: return from a call to X509_get0_pubkey
263. return NULL;
264. return X509_PUBKEY_get0(x->cert_info.key);
265. > }
266.
267. EVP_PKEY *X509_get_pubkey(X509 *x)
ssl/statem/statem_clnt.c:2158:9:
2156.
2157. pkey = X509_get0_pubkey(s->session->peer);
2158. > if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2159. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
2160. 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: Taking false branch
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;
crypto/evp/p_lib.c:267:5:
265. return NULL;
266. }
267. > return pkey->pkey.rsa;
268. }
269.
crypto/evp/p_lib.c:268:1: return from a call to EVP_PKEY_get0_RSA
266. }
267. return pkey->pkey.rsa;
268. > }
269.
270. RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey)
ssl/statem/statem_clnt.c:2158:9: Taking false branch
2156.
2157. pkey = X509_get0_pubkey(s->session->peer);
2158. if (EVP_PKEY_get0_RSA(pkey) == NULL) {
^
2159. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
2160. return 0;
ssl/statem/statem_clnt.c:2163:5:
2161. }
2162.
2163. > pmslen = SSL_MAX_MASTER_KEY_LENGTH;
2164. pms = OPENSSL_malloc(pmslen);
2165. if (pms == NULL) {
ssl/statem/statem_clnt.c:2164:5:
2162.
2163. pmslen = SSL_MAX_MASTER_KEY_LENGTH;
2164. > pms = OPENSSL_malloc(pmslen);
2165. if (pms == NULL) {
2166. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE);
crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
69. }
70.
71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
72. {
73. void *ret = NULL;
crypto/mem.c:73:5:
71. void *CRYPTO_malloc(size_t num, const char *file, int line)
72. {
73. > void *ret = NULL;
74.
75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:75:9: Taking false branch
73. void *ret = NULL;
74.
75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
76. return malloc_impl(num, file, line);
77.
crypto/mem.c:78:9: Taking false branch
76. return malloc_impl(num, file, line);
77.
78. if (num <= 0)
^
79. return NULL;
80.
crypto/mem.c:81:5:
79. return NULL;
80.
81. > allow_customize = 0;
82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
83. if (call_malloc_debug) {
crypto/mem.c:91:5:
89. }
90. #else
91. > osslargused(file); osslargused(line);
92. ret = malloc(num);
93. #endif
crypto/mem.c:91:24:
89. }
90. #else
91. > osslargused(file); osslargused(line);
92. ret = malloc(num);
93. #endif
crypto/mem.c:92:5:
90. #else
91. osslargused(file); osslargused(line);
92. > ret = malloc(num);
93. #endif
94.
crypto/mem.c:95:5:
93. #endif
94.
95. > return ret;
96. }
97.
crypto/mem.c:96:1: return from a call to CRYPTO_malloc
94.
95. return ret;
96. > }
97.
98. void *CRYPTO_zalloc(size_t num, const char *file, int line)
ssl/statem/statem_clnt.c:2165:9: Taking false branch
2163. pmslen = SSL_MAX_MASTER_KEY_LENGTH;
2164. pms = OPENSSL_malloc(pmslen);
2165. if (pms == NULL) {
^
2166. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE);
2167. *al = SSL_AD_INTERNAL_ERROR;
ssl/statem/statem_clnt.c:2171:5:
2169. }
2170.
2171. > pms[0] = s->client_version >> 8;
2172. pms[1] = s->client_version & 0xff;
2173. if (RAND_bytes(pms + 2, pmslen - 2) <= 0) {
ssl/statem/statem_clnt.c:2172:5:
2170.
2171. pms[0] = s->client_version >> 8;
2172. > pms[1] = s->client_version & 0xff;
2173. if (RAND_bytes(pms + 2, pmslen - 2) <= 0) {
2174. goto err;
ssl/statem/statem_clnt.c:2173:9:
2171. pms[0] = s->client_version >> 8;
2172. pms[1] = s->client_version & 0xff;
2173. > if (RAND_bytes(pms + 2, pmslen - 2) <= 0) {
2174. goto err;
2175. }
crypto/rand/rand_lib.c:102:1: start of procedure RAND_bytes()
100. }
101.
102. > int RAND_bytes(unsigned char *buf, int num)
103. {
104. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:104:5:
102. int RAND_bytes(unsigned char *buf, int num)
103. {
104. > const RAND_METHOD *meth = RAND_get_rand_method();
105. if (meth && meth->bytes)
106. return meth->bytes(buf, num);
crypto/rand/rand_lib.c:39:1: start of procedure RAND_get_rand_method()
37. }
38.
39. > const RAND_METHOD *RAND_get_rand_method(void)
40. {
41. if (!default_RAND_meth) {
crypto/rand/rand_lib.c:41:10: Taking false branch
39. const RAND_METHOD *RAND_get_rand_method(void)
40. {
41. if (!default_RAND_meth) {
^
42. #ifndef OPENSSL_NO_ENGINE
43. ENGINE *e = ENGINE_get_default_RAND();
crypto/rand/rand_lib.c:57:5:
55. default_RAND_meth = RAND_OpenSSL();
56. }
57. > return default_RAND_meth;
58. }
59.
crypto/rand/rand_lib.c:58:1: return from a call to RAND_get_rand_method
56. }
57. return default_RAND_meth;
58. > }
59.
60. #ifndef OPENSSL_NO_ENGINE
crypto/rand/rand_lib.c:105:9: Taking true branch
103. {
104. const RAND_METHOD *meth = RAND_get_rand_method();
105. if (meth && meth->bytes)
^
106. return meth->bytes(buf, num);
107. return (-1);
crypto/rand/rand_lib.c:105:17: Taking false branch
103. {
104. const RAND_METHOD *meth = RAND_get_rand_method();
105. if (meth && meth->bytes)
^
106. return meth->bytes(buf, num);
107. return (-1);
crypto/rand/rand_lib.c:107:5:
105. if (meth && meth->bytes)
106. return meth->bytes(buf, num);
107. > return (-1);
108. }
109.
crypto/rand/rand_lib.c:108:1: return from a call to RAND_bytes
106. return meth->bytes(buf, num);
107. return (-1);
108. > }
109.
110. #if OPENSSL_API_COMPAT < 0x10100000L
ssl/statem/statem_clnt.c:2173:9: Taking true branch
2171. pms[0] = s->client_version >> 8;
2172. pms[1] = s->client_version & 0xff;
2173. if (RAND_bytes(pms + 2, pmslen - 2) <= 0) {
^
2174. goto err;
2175. }
ssl/statem/statem_clnt.c:2211:2:
2209.
2210. return 1;
2211. > err:
2212. OPENSSL_clear_free(pms, pmslen);
2213. EVP_PKEY_CTX_free(pctx);
ssl/statem/statem_clnt.c:2212:5:
2210. return 1;
2211. err:
2212. > OPENSSL_clear_free(pms, pmslen);
2213. EVP_PKEY_CTX_free(pctx);
2214.
crypto/mem.c:183:1: start of procedure CRYPTO_clear_free()
181. }
182.
183. > void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
184. {
185. if (str == NULL)
crypto/mem.c:185:9: Taking false branch
183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
184. {
185. if (str == NULL)
^
186. return;
187. if (num)
crypto/mem.c:187:9: Taking true branch
185. if (str == NULL)
186. return;
187. if (num)
^
188. OPENSSL_cleanse(str, num);
189. CRYPTO_free(str, file, line);
crypto/mem.c:188:9: Skipping OPENSSL_cleanse(): method has no implementation
186. return;
187. if (num)
188. OPENSSL_cleanse(str, num);
^
189. CRYPTO_free(str, file, line);
190. }
crypto/mem.c:189:5:
187. if (num)
188. OPENSSL_cleanse(str, num);
189. > CRYPTO_free(str, file, line);
190. }
crypto/mem.c:163:1: start of procedure CRYPTO_free()
161. }
162.
163. > void CRYPTO_free(void *str, const char *file, int line)
164. {
165. if (free_impl != NULL && free_impl != &CRYPTO_free) {
crypto/mem.c:165:9: Taking true branch
163. void CRYPTO_free(void *str, const char *file, int line)
164. {
165. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
166. free_impl(str, file, line);
167. return;
crypto/mem.c:165:30: Taking true branch
163. void CRYPTO_free(void *str, const char *file, int line)
164. {
165. if (free_impl != NULL && free_impl != &CRYPTO_free) {
^
166. free_impl(str, file, line);
167. return;
crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer
164. {
165. if (free_impl != NULL && free_impl != &CRYPTO_free) {
166. free_impl(str, file, line);
^
167. return;
168. }
crypto/mem.c:167:9:
165. if (free_impl != NULL && free_impl != &CRYPTO_free) {
166. free_impl(str, file, line);
167. > return;
168. }
169.
crypto/mem.c:181:1: return from a call to CRYPTO_free
179. free(str);
180. #endif
181. > }
182.
183. void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
crypto/mem.c:190:1: return from a call to CRYPTO_clear_free
188. OPENSSL_cleanse(str, num);
189. CRYPTO_free(str, file, line);
190. > }
|
https://github.com/openssl/openssl/blob/70c22888c1648fe8652e77107f3c74bf2212de36/ssl/statem/statem_clnt.c/#L2212
|
d2a_code_trace_data_41603
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ec_lib.c:950: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `ec_wNAF_mul`.
Showing all 26 steps of the trace
crypto/ec/ec_lib.c:918:1: Parameter `ctx->stack.depth`
916. */
917.
918. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
919. size_t num, const EC_POINT *points[],
920. const BIGNUM *scalars[], BN_CTX *ctx)
crypto/ec/ec_lib.c:950:15: Call
948. else
949. /* use default */
950. ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
^
951.
952. BN_CTX_free(new_ctx);
crypto/ec/ec_mult.c:410:1: Parameter `ctx->stack.depth`
408. * in the addition if scalar != NULL
409. */
410. > int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
411. size_t num, const EC_POINT *points[], const BIGNUM *scalars[],
412. BN_CTX *ctx)
crypto/ec/ec_mult.c:453:20: Call
451. * always call the ladder version.
452. */
453. return ec_scalar_mul_ladder(group, r, scalar, NULL, ctx);
^
454. }
455. if ((scalar == NULL) && (num == 1)) {
crypto/ec/ec_mult.c:139:1: Parameter `ctx->stack.depth`
137. * Returns 1 on success, 0 otherwise.
138. */
139. > int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
140. const BIGNUM *scalar, const EC_POINT *point,
141. BN_CTX *ctx)
crypto/ec/ec_mult.c:164:5: Call
162. }
163.
164. BN_CTX_start(ctx);
^
165.
166. if (((p = EC_POINT_new(group)) == NULL)
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/ec/ec_mult.c:188:19: Call
186. EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME);
187.
188. cardinality = BN_CTX_get(ctx);
^
189. lambda = BN_CTX_get(ctx);
190. k = 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/ec/ec_mult.c:189:14: Call
187.
188. cardinality = BN_CTX_get(ctx);
189. lambda = BN_CTX_get(ctx);
^
190. k = BN_CTX_get(ctx);
191. if (k == 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/ec/ec_mult.c:190:9: Call
188. cardinality = BN_CTX_get(ctx);
189. lambda = BN_CTX_get(ctx);
190. k = BN_CTX_get(ctx);
^
191. if (k == NULL) {
192. ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_MALLOC_FAILURE);
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/ec/ec_mult.c:196:10: Call
194. }
195.
196. if (!BN_mul(cardinality, group->order, group->cofactor, ctx)) {
^
197. ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB);
198. goto err;
crypto/bn/bn_mul.c:497:1: Parameter `ctx->stack.depth`
495. #endif /* BN_RECURSION */
496.
497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
498. {
499. int ret = bn_mul_fixed_top(r, a, b, ctx);
crypto/bn/bn_mul.c:499:15: Call
497. int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
498. {
499. int ret = bn_mul_fixed_top(r, a, b, ctx);
^
500.
501. bn_correct_top(r);
crypto/bn/bn_mul.c:533:5: Call
531. top = al + bl;
532.
533. BN_CTX_start(ctx);
^
534. if ((r == a) || (r == b)) {
535. if ((rr = BN_CTX_get(ctx)) == NULL)
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_mul.c:618:5: Call
616. err:
617. bn_check_top(r);
618. BN_CTX_end(ctx);
^
619. return ret;
620. }
crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.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 `ec_wNAF_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_41604
|
int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
{
SSL_COMP *comp;
if (cm == NULL || cm->type == NID_undef)
return 1;
if (id < 193 || id > 255)
{
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
return 0;
}
MemCheck_off();
comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
comp->id=id;
comp->method=cm;
load_builtin_compressions();
if (ssl_comp_methods
&& sk_SSL_COMP_find(ssl_comp_methods,comp) >= 0)
{
OPENSSL_free(comp);
MemCheck_on();
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_DUPLICATE_COMPRESSION_ID);
return(1);
}
else if ((ssl_comp_methods == NULL)
|| !sk_SSL_COMP_push(ssl_comp_methods,comp))
{
OPENSSL_free(comp);
MemCheck_on();
SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,ERR_R_MALLOC_FAILURE);
return(1);
}
else
{
MemCheck_on();
return(0);
}
}
ssl/ssl_ciph.c:1810: error: NULL_DEREFERENCE
pointer `comp` last assigned on line 1809 could be null and is dereferenced at line 1810, column 2.
Showing all 44 steps of the trace
ssl/ssl_ciph.c:1789:1: start of procedure SSL_COMP_add_compression_method()
1787. }
1788.
1789. > int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
1790. {
1791. SSL_COMP *comp;
ssl/ssl_ciph.c:1793:13: Taking false branch
1791. SSL_COMP *comp;
1792.
1793. if (cm == NULL || cm->type == NID_undef)
^
1794. return 1;
1795.
ssl/ssl_ciph.c:1793:27: Taking false branch
1791. SSL_COMP *comp;
1792.
1793. if (cm == NULL || cm->type == NID_undef)
^
1794. return 1;
1795.
ssl/ssl_ciph.c:1802:6: Taking false branch
1800. 64 to 192: external party methods assigned by IANA
1801. 193 to 255: reserved for private use */
1802. if (id < 193 || id > 255)
^
1803. {
1804. SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
ssl/ssl_ciph.c:1802:18: Taking false branch
1800. 64 to 192: external party methods assigned by IANA
1801. 193 to 255: reserved for private use */
1802. if (id < 193 || id > 255)
^
1803. {
1804. SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE);
ssl/ssl_ciph.c:1808:2:
1806. }
1807.
1808. > MemCheck_off();
1809. comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1810. comp->id=id;
crypto/mem_dbg.c:216:1: start of procedure CRYPTO_mem_ctrl()
214. }
215.
216. > int CRYPTO_mem_ctrl(int mode)
217. {
218. int ret=mh_mode;
crypto/mem_dbg.c:218:2:
216. int CRYPTO_mem_ctrl(int mode)
217. {
218. > int ret=mh_mode;
219.
220. CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
crypto/mem_dbg.c:220:2:
218. int ret=mh_mode;
219.
220. > CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
221. switch (mode)
222. {
crypto/lock.c:426:1: start of procedure CRYPTO_lock()
424. }
425.
426. > void CRYPTO_lock(int mode, int type, const char *file, int line)
427. {
428. #ifdef LOCK_DEBUG
crypto/lock.c:453:6: Taking false branch
451. }
452. #endif
453. if (type < 0)
^
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:468:7: Taking true branch
466. }
467. else
468. if (locking_callback != NULL)
^
469. locking_callback(mode,type,file,line);
470. }
crypto/lock.c:469:4: Skipping __function_pointer__(): unresolved function pointer
467. else
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
^
470. }
471.
crypto/lock.c:453:2:
451. }
452. #endif
453. > if (type < 0)
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:470:2: return from a call to CRYPTO_lock
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
470. }
^
471.
472. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/mem_dbg.c:221:2:
219.
220. CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);
221. > switch (mode)
222. {
223. /* for applications (not to be called while multiple threads
crypto/mem_dbg.c:225:2: Switch condition is false. Skipping switch case
223. /* for applications (not to be called while multiple threads
224. * use the library): */
225. case CRYPTO_MEM_CHECK_ON: /* aka MemCheck_start() */
^
226. mh_mode = CRYPTO_MEM_CHECK_ON|CRYPTO_MEM_CHECK_ENABLE;
227. num_disable = 0;
crypto/mem_dbg.c:229:2: Switch condition is false. Skipping switch case
227. num_disable = 0;
228. break;
229. case CRYPTO_MEM_CHECK_OFF: /* aka MemCheck_stop() */
^
230. mh_mode = 0;
231. num_disable = 0; /* should be true *before* MemCheck_stop is used,
crypto/mem_dbg.c:236:2: Switch condition is true. Entering switch case
234.
235. /* switch off temporarily (for library-internal use): */
236. case CRYPTO_MEM_CHECK_DISABLE: /* aka MemCheck_off() */
^
237. if (mh_mode & CRYPTO_MEM_CHECK_ON)
238. {
crypto/mem_dbg.c:237:7: Taking false branch
235. /* switch off temporarily (for library-internal use): */
236. case CRYPTO_MEM_CHECK_DISABLE: /* aka MemCheck_off() */
237. if (mh_mode & CRYPTO_MEM_CHECK_ON)
^
238. {
239. CRYPTO_THREADID cur;
crypto/mem_dbg.c:282:2:
280. break;
281. }
282. > CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. return(ret);
284. }
crypto/lock.c:426:1: start of procedure CRYPTO_lock()
424. }
425.
426. > void CRYPTO_lock(int mode, int type, const char *file, int line)
427. {
428. #ifdef LOCK_DEBUG
crypto/lock.c:453:6: Taking false branch
451. }
452. #endif
453. if (type < 0)
^
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:468:7: Taking true branch
466. }
467. else
468. if (locking_callback != NULL)
^
469. locking_callback(mode,type,file,line);
470. }
crypto/lock.c:469:4: Skipping __function_pointer__(): unresolved function pointer
467. else
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
^
470. }
471.
crypto/lock.c:453:2:
451. }
452. #endif
453. > if (type < 0)
454. {
455. if (dynlock_lock_callback != NULL)
crypto/lock.c:470:2: return from a call to CRYPTO_lock
468. if (locking_callback != NULL)
469. locking_callback(mode,type,file,line);
470. }
^
471.
472. int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
crypto/mem_dbg.c:283:2:
281. }
282. CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. > return(ret);
284. }
285.
crypto/mem_dbg.c:284:2: return from a call to CRYPTO_mem_ctrl
282. CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);
283. return(ret);
284. }
^
285.
286. int CRYPTO_is_mem_check_on(void)
ssl/ssl_ciph.c:1809:2:
1807.
1808. MemCheck_off();
1809. > comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1810. comp->id=id;
1811. comp->method=cm;
crypto/mem.c:297:1: start of procedure CRYPTO_malloc()
295. }
296.
297. > void *CRYPTO_malloc(int num, const char *file, int line)
298. {
299. void *ret = NULL;
crypto/mem.c:299:2:
297. void *CRYPTO_malloc(int num, const char *file, int line)
298. {
299. > void *ret = NULL;
300.
301. if (num <= 0) return NULL;
crypto/mem.c:301:6: Taking false branch
299. void *ret = NULL;
300.
301. if (num <= 0) return NULL;
^
302.
303. allow_customize = 0;
crypto/mem.c:303:2:
301. if (num <= 0) return NULL;
302.
303. > allow_customize = 0;
304. if (malloc_debug_func != NULL)
305. {
crypto/mem.c:304:6: Taking true branch
302.
303. allow_customize = 0;
304. if (malloc_debug_func != NULL)
^
305. {
306. allow_customize_debug = 0;
crypto/mem.c:306:3:
304. if (malloc_debug_func != NULL)
305. {
306. > allow_customize_debug = 0;
307. malloc_debug_func(NULL, num, file, line, 0);
308. }
crypto/mem.c:307:3: Skipping __function_pointer__(): unresolved function pointer
305. {
306. allow_customize_debug = 0;
307. malloc_debug_func(NULL, num, file, line, 0);
^
308. }
309. ret = malloc_ex_func(num,file,line);
crypto/mem.c:309:2: Skipping __function_pointer__(): unresolved function pointer
307. malloc_debug_func(NULL, num, file, line, 0);
308. }
309. ret = malloc_ex_func(num,file,line);
^
310. #ifdef LEVITTE_DEBUG_MEM
311. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
crypto/mem.c:313:6: Taking true branch
311. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
312. #endif
313. if (malloc_debug_func != NULL)
^
314. malloc_debug_func(ret, num, file, line, 1);
315.
crypto/mem.c:314:3: Skipping __function_pointer__(): unresolved function pointer
312. #endif
313. if (malloc_debug_func != NULL)
314. malloc_debug_func(ret, num, file, line, 1);
^
315.
316. #ifndef OPENSSL_CPUID_OBJ
crypto/mem.c:320:12: Taking false branch
318. * sanitisation function can't be optimised out. NB: We only do
319. * this for >2Kb so the overhead doesn't bother us. */
320. if(ret && (num > 2048))
^
321. { extern unsigned char cleanse_ctr;
322. ((unsigned char *)ret)[0] = cleanse_ctr;
crypto/mem.c:326:2:
324. #endif
325.
326. > return ret;
327. }
328. char *CRYPTO_strdup(const char *str, const char *file, int line)
crypto/mem.c:327:2: return from a call to CRYPTO_malloc
325.
326. return ret;
327. }
^
328. char *CRYPTO_strdup(const char *str, const char *file, int line)
329. {
ssl/ssl_ciph.c:1810:2:
1808. MemCheck_off();
1809. comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
1810. > comp->id=id;
1811. comp->method=cm;
1812. load_builtin_compressions();
|
https://github.com/openssl/openssl/blob/49e9b97885d0bdc50fa68aed0a0e8fd4162f3894/ssl/ssl_ciph.c/#L1810
|
d2a_code_trace_data_41605
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/bn/bn_gf2m.c:911: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqr_arr`.
Showing all 13 steps of the trace
crypto/bn/bn_gf2m.c:856:1: Parameter `ctx->stack.depth`
854. * Uses algorithms A.4.7 and A.4.6 from IEEE P1363.
855. */
856. > int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[], BN_CTX *ctx)
857. {
858. int ret = 0, count = 0, j;
crypto/bn/bn_gf2m.c:870:2: Call
868. }
869.
870. BN_CTX_start(ctx);
^
871. a = BN_CTX_get(ctx);
872. z = 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_gf2m.c:911:10: Call
909. for (j = 1; j <= p[0] - 1; j++)
910. {
911. if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx)) goto err;
^
912. if (!BN_GF2m_mod_sqr_arr(w2, w, p, ctx)) goto err;
913. if (!BN_GF2m_mod_mul_arr(tmp, w2, a, p, ctx)) goto err;
crypto/bn/bn_gf2m.c:457:1: Parameter `ctx->stack.depth`
455.
456. /* Square a, reduce the result mod p, and store it in a. r could be a. */
457. > int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], BN_CTX *ctx)
458. {
459. int i, ret = 0;
crypto/bn/bn_gf2m.c:463:2: Call
461.
462. bn_check_top(a);
463. BN_CTX_start(ctx);
^
464. if ((s = BN_CTX_get(ctx)) == NULL) return 0;
465. if (!bn_wexpand(s, 2 * a->top)) goto err;
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_gf2m.c:479:2: Call
477. ret = 1;
478. err:
479. BN_CTX_end(ctx);
^
480. return ret;
481. }
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_GF2m_mod_sqr_arr`
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/8211a33c7f37e58063d1294d8df294c7d9a1c1bf/crypto/bn/bn_ctx.c/#L353
|
d2a_code_trace_data_41606
|
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/mpc8.c:292: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `mpc8_get_mod_golomb`.
libavcodec/mpc8.c:263:5: Call
261. }
262. bitstream_init(bc, buf, buf_size * 8);
263. bitstream_skip(bc, c->last_bits_used & 7);
^
264.
265. if(keyframe)
libavcodec/bitstream.h:241:1: Parameter `n`
239.
240. /* Skip n bits in the buffer. */
241. static inline void bitstream_skip(BitstreamContext *bc, unsigned n)
^
242. {
243. if (n <= bc->bits_left)
libavcodec/bitstream.h:244:9: Call
242. {
243. if (n <= bc->bits_left)
244. skip_remaining(bc, n);
^
245. else {
246. n -= bc->bits_left;
libavcodec/bitstream.h:230:1: Parameter `n`
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:237:5: Assignment
235. bc->bits <<= n;
236. #endif
237. bc->bits_left -= n;
^
238. }
239.
libavcodec/mpc8.c:266:19: Call
264.
265. if(keyframe)
266. maxband = mpc8_get_mod_golomb(bc, c->maxbands + 1);
^
267. else{
268. maxband = c->last_max_band + bitstream_read_vlc(bc, band_vlc.table, MPC8_BANDS_BITS, 2);
libavcodec/mpc8.c:76:1: Parameter `bc->bits_left`
74. }
75.
76. static inline int mpc8_get_mod_golomb(BitstreamContext *bc, int m)
^
77. {
78. if(mpc8_cnk_len[0][m] < 1) return 0;
libavcodec/mpc8.c:292:17: Call
290. if(bands[i].res[0] || bands[i].res[1])
291. cnt++;
292. t = mpc8_get_mod_golomb(bc, cnt);
^
293. mask = mpc8_get_mask(bc, cnt, t);
294. for(i = maxband - 1; i >= 0; i--)
libavcodec/mpc8.c:76:1: Parameter `bc->bits_left`
74. }
75.
76. static inline int mpc8_get_mod_golomb(BitstreamContext *bc, int m)
^
77. {
78. if(mpc8_cnk_len[0][m] < 1) return 0;
libavcodec/mpc8.c:79:12: Call
77. {
78. if(mpc8_cnk_len[0][m] < 1) return 0;
79. return mpc8_dec_base(bc, 1, m + 1);
^
80. }
81.
libavcodec/mpc8.c:46:1: Parameter `bc->bits_left`
44. static const int quant_offsets[6] = { MPC8_Q5_OFFSET, MPC8_Q6_OFFSET, MPC8_Q7_OFFSET, MPC8_Q8_OFFSET };
45.
46. static inline int mpc8_dec_base(BitstreamContext *bc, int k, int n)
^
47. {
48. int len = mpc8_cnk_len[k-1][n-1] - 1;
libavcodec/mpc8.c:52:31: Call
50.
51. if (code >= mpc8_cnk_lost[k-1][n-1])
52. code = ((code << 1) | bitstream_read_bit(bc)) - mpc8_cnk_lost[k - 1][n - 1];
^
53.
54. return code;
libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
143.
144. /* Return one bit from the buffer. */
145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
^
146. {
147. if (!bc->bits_left)
libavcodec/bitstream.h:150:12: Call
148. refill_64(bc);
149.
150. return get_val(bc, 1);
^
151. }
152.
libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `n`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:139:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `mpc8_get_mod_golomb`
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_41607
|
static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale){
int v;
int i=0;
uint8_t state[CONTEXT_SIZE];
memset(state, 128, sizeof(state));
for(v=0; i<128 ; v++){
int len= get_symbol(c, state, 0) + 1;
if(len + i > 128) return -1;
while(len--){
quant_table[i] = scale*v;
i++;
}
}
for(i=1; i<128; i++){
quant_table[256-i]= -quant_table[i];
}
quant_table[128]= -quant_table[127];
return 2*v - 1;
}
libavcodec/ffv1.c:907: error: Buffer Overrun L2
Offset: [1, 131] (⇐ [0, 4] + [1, 127]) Size: 5 by call to `read_quant_table`.
libavcodec/ffv1.c:865:1: Parameter `f->quant_table[*]`
863. }
864.
865. static int read_header(FFV1Context *f){
^
866. uint8_t state[CONTEXT_SIZE];
867. int i, context_count;
libavcodec/ffv1.c:907:25: Call
905. context_count=1;
906. for(i=0; i<5; i++){
907. context_count*= read_quant_table(c, f->quant_table[i], context_count);
^
908. if(context_count < 0 || context_count > 32768){
909. av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
libavcodec/ffv1.c:857:9: <Offset trace>
855. }
856.
857. for(i=1; i<128; i++){
^
858. quant_table[256-i]= -quant_table[i];
859. }
libavcodec/ffv1.c:857:9: Assignment
855. }
856.
857. for(i=1; i<128; i++){
^
858. quant_table[256-i]= -quant_table[i];
859. }
libavcodec/ffv1.c:837:1: <Length trace>
835. }
836.
837. static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale){
^
838. int v;
839. int i=0;
libavcodec/ffv1.c:837:1: Parameter `*quant_table`
835. }
836.
837. static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale){
^
838. int v;
839. int i=0;
libavcodec/ffv1.c:858:30: Array access: Offset: [1, 131] (⇐ [0, 4] + [1, 127]) Size: 5 by call to `read_quant_table`
856.
857. for(i=1; i<128; i++){
858. quant_table[256-i]= -quant_table[i];
^
859. }
860. quant_table[128]= -quant_table[127];
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ffv1.c/#L858
|
d2a_code_trace_data_41608
|
static void contract(LHASH *lh)
{
LHASH_NODE **n,*n1,*np;
np=lh->b[lh->p+lh->pmax-1];
lh->b[lh->p+lh->pmax-1]=NULL;
if (lh->p == 0)
{
n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
(unsigned int)(sizeof(LHASH_NODE *)*lh->pmax));
if (n == NULL)
{
lh->error++;
return;
}
lh->num_contract_reallocs++;
lh->num_alloc_nodes/=2;
lh->pmax/=2;
lh->p=lh->pmax-1;
lh->b=n;
}
else
lh->p--;
lh->num_nodes--;
lh->num_contracts++;
n1=lh->b[(int)lh->p];
if (n1 == NULL)
lh->b[(int)lh->p]=np;
else
{
while (n1->next != NULL)
n1=n1->next;
n1->next=np;
}
}
ssl/d1_pkt.c:632: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `dtls1_process_record`.
Showing all 16 steps of the trace
ssl/d1_pkt.c:509:9: Call
507. /* The epoch may have changed. If so, process all the
508. * pending records. This is a non-blocking operation. */
509. if ( ! dtls1_process_buffered_records(s))
^
510. return 0;
511.
ssl/d1_pkt.c:254:1: Parameter `s->ctx->sessions->p`
252. &((s)->d1->processed_rcds))
253.
254. > static int
255. dtls1_process_buffered_records(SSL *s)
256. {
ssl/d1_pkt.c:632:9: Call
630. }
631.
632. if ( ! dtls1_process_record(s))
^
633. return(0);
634.
ssl/d1_pkt.c:334:1: Parameter `s->ctx->sessions->p`
332. #endif
333.
334. > static int
335. dtls1_process_record(SSL *s)
336. {
ssl/d1_pkt.c:478:2: Call
476. SSLerr(SSL_F_DTLS1_PROCESS_RECORD,SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC);
477. f_err:
478. ssl3_send_alert(s,SSL3_AL_FATAL,al);
^
479. err:
480. return(0);
ssl/s3_pkt.c:1258:1: Parameter `s->ctx->sessions->p`
1256. }
1257.
1258. > void ssl3_send_alert(SSL *s, int level, int desc)
1259. {
1260. /* Map tls/ssl alert value to correct one */
ssl/s3_pkt.c:1267:3: Call
1265. /* If a fatal one, remove from cache */
1266. if ((level == 2) && (s->session != NULL))
1267. SSL_CTX_remove_session(s->ctx,s->session);
^
1268.
1269. s->s3->alert_dispatch=1;
ssl/ssl_sess.c:486:1: Parameter `ctx->sessions->p`
484. }
485.
486. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
487. {
488. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:488:9: Call
486. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
487. {
488. return remove_session_lock(ctx, c, 1);
^
489. }
490.
ssl/ssl_sess.c:491:1: Parameter `ctx->sessions->pmax`
489. }
490.
491. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
492. {
493. SSL_SESSION *r;
ssl/ssl_sess.c:502:21: Call
500. {
501. ret=1;
502. r=(SSL_SESSION *)lh_delete(ctx->sessions,c);
^
503. SSL_SESSION_list_remove(ctx,c);
504. }
crypto/lhash/lhash.c:217:1: Parameter `lh->pmax`
215. }
216.
217. > void *lh_delete(LHASH *lh, const void *data)
218. {
219. unsigned long hash;
crypto/lhash/lhash.c:243:3: Call
241. if ((lh->num_nodes > MIN_NODES) &&
242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
243. contract(lh);
^
244.
245. return(ret);
crypto/lhash/lhash.c:361:1: <LHS trace>
359. }
360.
361. > static void contract(LHASH *lh)
362. {
363. LHASH_NODE **n,*n1,*np;
crypto/lhash/lhash.c:361:1: Parameter `lh->p`
359. }
360.
361. > static void contract(LHASH *lh)
362. {
363. LHASH_NODE **n,*n1,*np;
crypto/lhash/lhash.c:365:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `dtls1_process_record`
363. LHASH_NODE **n,*n1,*np;
364.
365. np=lh->b[lh->p+lh->pmax-1];
^
366. lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */
367. if (lh->p == 0)
|
https://github.com/openssl/openssl/blob/a761b89d2feac31acb9acf01b4a5c6694c9064db/crypto/lhash/lhash.c/#L365
|
d2a_code_trace_data_41609
|
static void unpack_input(const unsigned char *input, unsigned int *output)
{
unsigned int outbuffer[28];
unsigned short inbuffer[10];
unsigned int x;
unsigned int *ptr;
for (x=0;x<20;x+=2)
inbuffer[x/2]=(input[x]<<8)+input[x+1];
ptr=outbuffer;
*(ptr++)=27;
*(ptr++)=(inbuffer[0]>>10)&0x3f;
*(ptr++)=(inbuffer[0]>>5)&0x1f;
*(ptr++)=inbuffer[0]&0x1f;
*(ptr++)=(inbuffer[1]>>12)&0xf;
*(ptr++)=(inbuffer[1]>>8)&0xf;
*(ptr++)=(inbuffer[1]>>5)&7;
*(ptr++)=(inbuffer[1]>>2)&7;
*(ptr++)=((inbuffer[1]<<1)&6)|((inbuffer[2]>>15)&1);
*(ptr++)=(inbuffer[2]>>12)&7;
*(ptr++)=(inbuffer[2]>>10)&3;
*(ptr++)=(inbuffer[2]>>5)&0x1f;
*(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3);
*(ptr++)=(inbuffer[3]>>6)&0xff;
*(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
*(ptr++)=(inbuffer[4]>>8)&0x7f;
*(ptr++)=(inbuffer[4]>>1)&0x7f;
*(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f);
*(ptr++)=(inbuffer[5]>>2)&0x7f;
*(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f);
*(ptr++)=(inbuffer[6]>>4)&0x7f;
*(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf);
*(ptr++)=(inbuffer[7]>>5)&0x7f;
*(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3);
*(ptr++)=(inbuffer[8]>>7)&0x7f;
*(ptr++)=((inbuffer[8]<<1)&0xfe)|((inbuffer[9]>>15)&1);
*(ptr++)=(inbuffer[9]>>8)&0x7f;
*(ptr++)=(inbuffer[9]>>1)&0x7f;
*(output++)=outbuffer[11];
for (x=1;x<11;*(output++)=outbuffer[x++]);
ptr=outbuffer+12;
for (x=0;x<16;x+=4)
{
*(output++)=ptr[x];
*(output++)=ptr[x+2];
*(output++)=ptr[x+3];
*(output++)=ptr[x+1];
}
}
libavcodec/ra144.c:281: error: Uninitialized Value
The value read from inbuffer[_] was never initialized.
libavcodec/ra144.c:281:3:
279. *(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3);
280. *(ptr++)=(inbuffer[3]>>6)&0xff;
281. *(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
^
282. *(ptr++)=(inbuffer[4]>>8)&0x7f;
283. *(ptr++)=(inbuffer[4]>>1)&0x7f;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L281
|
d2a_code_trace_data_41610
|
void
ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p)
{
size_t size;
uintptr_t slab, m, *bitmap;
ngx_uint_t n, type, slot, shift, map;
ngx_slab_page_t *slots, *page;
ngx_log_debug1(NGX_LOG_DEBUG_ALLOC, ngx_cycle->log, 0, "slab free: %p", p);
if ((u_char *) p < pool->start || (u_char *) p > pool->end) {
ngx_slab_error(pool, NGX_LOG_ALERT, "ngx_slab_free(): outside of pool");
goto fail;
}
n = ((u_char *) p - pool->start) >> ngx_pagesize_shift;
page = &pool->pages[n];
slab = page->slab;
type = page->prev & NGX_SLAB_PAGE_MASK;
switch (type) {
case NGX_SLAB_SMALL:
shift = slab & NGX_SLAB_SHIFT_MASK;
size = 1 << shift;
if ((uintptr_t) p & (size - 1)) {
goto wrong_chunk;
}
n = ((uintptr_t) p & (ngx_pagesize - 1)) >> shift;
m = (uintptr_t) 1 << (n & (sizeof(uintptr_t) * 8 - 1));
n /= (sizeof(uintptr_t) * 8);
bitmap = (uintptr_t *) ((uintptr_t) p & ~(ngx_pagesize - 1));
if (bitmap[n] & m) {
if (page->next == NULL) {
slots = (ngx_slab_page_t *)
((u_char *) pool + sizeof(ngx_slab_pool_t));
slot = shift - pool->min_shift;
page->next = slots[slot].next;
slots[slot].next = page;
page->prev = (uintptr_t) &slots[slot] | NGX_SLAB_SMALL;
page->next->prev = (uintptr_t) page | NGX_SLAB_SMALL;
}
bitmap[n] &= ~m;
n = (1 << (ngx_pagesize_shift - shift)) / 8 / (1 << shift);
if (n == 0) {
n = 1;
}
if (bitmap[0] & ~(((uintptr_t) 1 << n) - 1)) {
goto done;
}
map = (1 << (ngx_pagesize_shift - shift)) / (sizeof(uintptr_t) * 8);
for (n = 1; n < map; n++) {
if (bitmap[n]) {
goto done;
}
}
ngx_slab_free_pages(pool, page, 1);
goto done;
}
goto chunk_already_free;
case NGX_SLAB_EXACT:
m = (uintptr_t) 1 <<
(((uintptr_t) p & (ngx_pagesize - 1)) >> ngx_slab_exact_shift);
size = ngx_slab_exact_size;
if ((uintptr_t) p & (size - 1)) {
goto wrong_chunk;
}
if (slab & m) {
if (slab == NGX_SLAB_BUSY) {
slots = (ngx_slab_page_t *)
((u_char *) pool + sizeof(ngx_slab_pool_t));
slot = ngx_slab_exact_shift - pool->min_shift;
page->next = slots[slot].next;
slots[slot].next = page;
page->prev = (uintptr_t) &slots[slot] | NGX_SLAB_EXACT;
page->next->prev = (uintptr_t) page | NGX_SLAB_EXACT;
}
page->slab &= ~m;
if (page->slab) {
goto done;
}
ngx_slab_free_pages(pool, page, 1);
goto done;
}
goto chunk_already_free;
case NGX_SLAB_BIG:
shift = slab & NGX_SLAB_SHIFT_MASK;
size = 1 << shift;
if ((uintptr_t) p & (size - 1)) {
goto wrong_chunk;
}
m = (uintptr_t) 1 << ((((uintptr_t) p & (ngx_pagesize - 1)) >> shift)
+ NGX_SLAB_MAP_SHIFT);
if (slab & m) {
if (page->next == NULL) {
slots = (ngx_slab_page_t *)
((u_char *) pool + sizeof(ngx_slab_pool_t));
slot = shift - pool->min_shift;
page->next = slots[slot].next;
slots[slot].next = page;
page->prev = (uintptr_t) &slots[slot] | NGX_SLAB_BIG;
page->next->prev = (uintptr_t) page | NGX_SLAB_BIG;
}
page->slab &= ~m;
if (page->slab & NGX_SLAB_MAP_MASK) {
goto done;
}
ngx_slab_free_pages(pool, page, 1);
goto done;
}
goto chunk_already_free;
case NGX_SLAB_PAGE:
if ((uintptr_t) p & (ngx_pagesize - 1)) {
goto wrong_chunk;
}
if (slab == NGX_SLAB_PAGE_FREE) {
ngx_slab_error(pool, NGX_LOG_ALERT,
"ngx_slab_free(): page is already free");
goto fail;
}
if (slab == NGX_SLAB_PAGE_BUSY) {
ngx_slab_error(pool, NGX_LOG_ALERT,
"ngx_slab_free(): pointer to wrong page");
goto fail;
}
n = ((u_char *) p - pool->start) >> ngx_pagesize_shift;
size = slab & ~NGX_SLAB_PAGE_START;
ngx_slab_free_pages(pool, &pool->pages[n], size);
ngx_slab_junk(p, size << ngx_pagesize_shift);
return;
}
return;
done:
ngx_slab_junk(p, size);
return;
wrong_chunk:
ngx_slab_error(pool, NGX_LOG_ALERT,
"ngx_slab_free(): pointer to wrong chunk");
goto fail;
chunk_already_free:
ngx_slab_error(pool, NGX_LOG_ALERT,
"ngx_slab_free(): chunk is already free");
fail:
return;
}
src/http/ngx_http_file_cache.c:955: error: Integer Overflow L2
([0, +oo] - [0, 15]):unsigned64 by call to `ngx_slab_free_locked`.
src/http/ngx_http_file_cache.c:955:13: Call
953. ngx_queue_remove(q);
954. ngx_rbtree_delete(cache->rbtree, &fcn->node);
955. ngx_slab_free_locked(cache->shpool, fcn);
^
956.
957. continue;
src/core/ngx_slab.c:412:1: Parameter `pool->pages->slab`
410.
411.
412. void
^
413. ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p)
414. {
src/http/ngx_http_file_cache.c:955:13: Call
953. ngx_queue_remove(q);
954. ngx_rbtree_delete(cache->rbtree, &fcn->node);
955. ngx_slab_free_locked(cache->shpool, fcn);
^
956.
957. continue;
src/core/ngx_slab.c:412:1: <LHS trace>
410.
411.
412. void
^
413. ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p)
414. {
src/core/ngx_slab.c:412:1: Global `ngx_pagesize_shift`
410.
411.
412. void
^
413. ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p)
414. {
src/core/ngx_slab.c:412:1: <RHS trace>
410.
411.
412. void
^
413. ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p)
414. {
src/core/ngx_slab.c:412:1: Parameter `pool->pages->slab`
410.
411.
412. void
^
413. ngx_slab_free_locked(ngx_slab_pool_t *pool, void *p)
414. {
src/core/ngx_slab.c:429:5: Assignment
427. n = ((u_char *) p - pool->start) >> ngx_pagesize_shift;
428. page = &pool->pages[n];
429. slab = page->slab;
^
430. type = page->prev & NGX_SLAB_PAGE_MASK;
431.
src/core/ngx_slab.c:436:9: Assignment
434. case NGX_SLAB_SMALL:
435.
436. shift = slab & NGX_SLAB_SHIFT_MASK;
^
437. size = 1 << shift;
438.
src/core/ngx_slab.c:464:13: Binary operation: ([0, +oo] - [0, 15]):unsigned64 by call to `ngx_slab_free_locked`
462. bitmap[n] &= ~m;
463.
464. n = (1 << (ngx_pagesize_shift - shift)) / 8 / (1 << shift);
^
465.
466. if (n == 0) {
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_slab.c/#L464
|
d2a_code_trace_data_41611
|
static void await_references(H264Context *h){
MpegEncContext * const s = &h->s;
const int mb_xy= h->mb_xy;
const int mb_type= s->current_picture.mb_type[mb_xy];
int refs[2][48];
int nrefs[2] = {0};
int ref, list;
memset(refs, -1, sizeof(refs));
if(IS_16X16(mb_type)){
get_lowest_part_y(h, refs, 0, 16, 0,
IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
}else if(IS_16X8(mb_type)){
get_lowest_part_y(h, refs, 0, 8, 0,
IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
get_lowest_part_y(h, refs, 8, 8, 8,
IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
}else if(IS_8X16(mb_type)){
get_lowest_part_y(h, refs, 0, 16, 0,
IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
get_lowest_part_y(h, refs, 4, 16, 0,
IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
}else{
int i;
assert(IS_8X8(mb_type));
for(i=0; i<4; i++){
const int sub_mb_type= h->sub_mb_type[i];
const int n= 4*i;
int y_offset= (i&2)<<2;
if(IS_SUB_8X8(sub_mb_type)){
get_lowest_part_y(h, refs, n , 8, y_offset,
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
}else if(IS_SUB_8X4(sub_mb_type)){
get_lowest_part_y(h, refs, n , 4, y_offset,
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
get_lowest_part_y(h, refs, n+2, 4, y_offset+4,
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
}else if(IS_SUB_4X8(sub_mb_type)){
get_lowest_part_y(h, refs, n , 8, y_offset,
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
get_lowest_part_y(h, refs, n+1, 8, y_offset,
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
}else{
int j;
assert(IS_SUB_4X4(sub_mb_type));
for(j=0; j<4; j++){
int sub_y_offset= y_offset + 2*(j&2);
get_lowest_part_y(h, refs, n+j, 4, sub_y_offset,
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
}
}
}
}
for(list=h->list_count-1; list>=0; list--){
for(ref=0; ref<48 && nrefs[list]; ref++){
int row = refs[list][ref];
if(row >= 0){
Picture *ref_pic = &h->ref_list[list][ref];
int ref_field = ref_pic->reference - 1;
int ref_field_picture = ref_pic->field_picture;
int pic_height = 16*s->mb_height >> ref_field_picture;
row <<= MB_MBAFF;
nrefs[list]--;
if(!FIELD_PICTURE && ref_field_picture){
ff_thread_await_progress((AVFrame*)ref_pic, FFMIN((row >> 1) - !(row&1), pic_height-1), 1);
ff_thread_await_progress((AVFrame*)ref_pic, FFMIN((row >> 1) , pic_height-1), 0);
}else if(FIELD_PICTURE && !ref_field_picture){
ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row*2 + ref_field , pic_height-1), 0);
}else if(FIELD_PICTURE){
ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row, pic_height-1), ref_field);
}else{
ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row, pic_height-1), 0);
}
}
}
}
}
libavcodec/h264.c:3452: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `decode_slice_header`.
libavcodec/h264.c:3337:1: Parameter `h->s.list_count`
3335.
3336.
3337. static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
^
3338. MpegEncContext * const s = &h->s;
3339. AVCodecContext * const avctx= s->avctx;
libavcodec/h264.c:3452:23: Call
3450. hx->s.data_partitioning = 0;
3451.
3452. if((err = decode_slice_header(hx, h)))
^
3453. break;
3454.
libavcodec/h264.c:2240:1: Parameter `h->s.list_count`
2238. * @return 0 if okay, <0 if an error occurred, 1 if decoding must not be multithreaded
2239. */
2240. static int decode_slice_header(H264Context *h, H264Context *h0){
^
2241. MpegEncContext * const s = &h->s;
2242. MpegEncContext * const s0 = &h0->s;
libavcodec/h264.c:2264:13: Call
2262. if(first_mb_in_slice == 0){ //FIXME better field boundary detection
2263. if(h0->current_slice && FIELD_PICTURE){
2264. field_end(h, 1);
^
2265. }
2266.
libavcodec/h264.c:2126:1: Parameter `h->s.list_count`
2124. }
2125.
2126. static void field_end(H264Context *h, int in_setup){
^
2127. MpegEncContext * const s = &h->s;
2128. AVCodecContext * const avctx= s->avctx;
libavcodec/h264.c:2170:9: Call
2168. */
2169. if (!FIELD_PICTURE)
2170. ff_er_frame_end(s);
^
2171.
2172. MPV_frame_end(s);
libavcodec/error_resilience.c:776:1: Parameter `s->list_count`
774. }
775.
776. void ff_er_frame_end(MpegEncContext *s){
^
777. int i, mb_x, mb_y, error, error_type, dc_error, mv_error, ac_error;
778. int distance;
libavcodec/error_resilience.c:995:13: Call
993. s->mb_x= mb_x;
994. s->mb_y= mb_y;
995. decode_mb(s, 0/*FIXME h264 partitioned slices need this set*/);
^
996. }
997. }
libavcodec/error_resilience.c:43:1: Parameter `s->list_count`
41. #undef mb_intra
42.
43. static void decode_mb(MpegEncContext *s, int ref){
^
44. s->dest[0] = s->current_picture.data[0] + (s->mb_y * 16* s->linesize ) + s->mb_x * 16;
45. s->dest[1] = s->current_picture.data[1] + (s->mb_y * (16>>s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16>>s->chroma_x_shift);
libavcodec/error_resilience.c:59:9: Call
57. fill_rectangle(h->mv_cache[0][ scan8[0] ], 4, 4, 8, pack16to32(s->mv[0][0][0],s->mv[0][0][1]), 4);
58. assert(!FRAME_MBAFF);
59. ff_h264_hl_decode_mb(h);
^
60. }else{
61. assert(ref==0);
libavcodec/h264.c:1847:1: Parameter `h->list_count`
1845. }
1846.
1847. void ff_h264_hl_decode_mb(H264Context *h){
^
1848. MpegEncContext * const s = &h->s;
1849. const int mb_xy= h->mb_xy;
libavcodec/h264.c:1854:9: Call
1852.
1853. if (is_complex) {
1854. hl_decode_mb_complex(h);
^
1855. } else if (h->pixel_shift) {
1856. hl_decode_mb_simple_16(h);
libavcodec/h264.c:1843:1: Parameter `h->list_count`
1841. * Process a macroblock; this handles edge cases, such as interlacing.
1842. */
1843. static void av_noinline hl_decode_mb_complex(H264Context *h){
^
1844. hl_decode_mb_internal(h, 0, h->pixel_shift);
1845. }
libavcodec/h264.c:1844:5: Call
1842. */
1843. static void av_noinline hl_decode_mb_complex(H264Context *h){
1844. hl_decode_mb_internal(h, 0, h->pixel_shift);
^
1845. }
1846.
libavcodec/h264.c:1541:1: Parameter `h->list_count`
1539. }
1540.
1541. static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, int pixel_shift){
^
1542. MpegEncContext * const s = &h->s;
1543. const int mb_x= s->mb_x;
libavcodec/h264.c:1735:17: Call
1733. }else if(is_h264){
1734. if (pixel_shift) {
1735. hl_motion_16(h, dest_y, dest_cb, dest_cr,
^
1736. s->me.qpel_put, s->dsp.put_h264_chroma_pixels_tab,
1737. s->me.qpel_avg, s->dsp.avg_h264_chroma_pixels_tab,
libavcodec/h264.c:762:1: Parameter `h->list_count`
760. }
761. hl_motion_fn(0, 8);
762. hl_motion_fn(1, 16);
^
763.
764. static void free_tables(H264Context *h, int free_rbsp){
libavcodec/h264.c:762:1: Call
760. }
761. hl_motion_fn(0, 8);
762. hl_motion_fn(1, 16);
^
763.
764. static void free_tables(H264Context *h, int free_rbsp){
libavcodec/h264.c:646:1: Parameter `h->list_count`
644. }
645.
646. static av_always_inline void hl_motion(H264Context *h, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
^
647. qpel_mc_func (*qpix_put)[16], h264_chroma_mc_func (*chroma_put),
648. qpel_mc_func (*qpix_avg)[16], h264_chroma_mc_func (*chroma_avg),
libavcodec/h264.c:658:9: Call
656.
657. if(HAVE_PTHREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME))
658. await_references(h);
^
659. prefetch_motion(h, 0, pixel_shift);
660.
libavcodec/h264.c:299:1: <LHS trace>
297. * @param h the H264 context
298. */
299. static void await_references(H264Context *h){
^
300. MpegEncContext * const s = &h->s;
301. const int mb_xy= h->mb_xy;
libavcodec/h264.c:299:1: Parameter `h->list_count`
297. * @param h the H264 context
298. */
299. static void await_references(H264Context *h){
^
300. MpegEncContext * const s = &h->s;
301. const int mb_xy= h->mb_xy;
libavcodec/h264.c:357:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `decode_slice_header`
355. }
356.
357. for(list=h->list_count-1; list>=0; list--){
^
358. for(ref=0; ref<48 && nrefs[list]; ref++){
359. int row = refs[list][ref];
|
https://github.com/libav/libav/blob/6a9c85944427e3c4355bce67d7f677ec69527bff/libavcodec/h264.c/#L357
|
d2a_code_trace_data_41612
|
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:904: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 902 could be null and is dereferenced at line 904, column 9.
Showing all 6 steps of the trace
crypto/rand/rand_lib.c:900:1: start of procedure RAND_pseudo_bytes()
898.
899. #if !OPENSSL_API_1_1_0 && !defined(FIPS_MODE)
900. > int RAND_pseudo_bytes(unsigned char *buf, int num)
901. {
902. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:902:5:
900. int RAND_pseudo_bytes(unsigned char *buf, int num)
901. {
902. > const RAND_METHOD *meth = RAND_get_rand_method();
903.
904. if (meth->pseudorand != NULL)
crypto/rand/rand_lib.c:770:1: start of procedure RAND_get_rand_method()
768. #endif
769.
770. > const RAND_METHOD *RAND_get_rand_method(void)
771. {
772. #ifdef FIPS_MODE
crypto/rand/rand_lib.c:773:5:
771. {
772. #ifdef FIPS_MODE
773. > return NULL;
774. #else
775. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:802:1: return from a call to RAND_get_rand_method
800. return tmp_meth;
801. #endif
802. > }
803.
804. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
crypto/rand/rand_lib.c:904:9:
902. const RAND_METHOD *meth = RAND_get_rand_method();
903.
904. > if (meth->pseudorand != NULL)
905. return meth->pseudorand(buf, num);
906. return -1;
|
https://github.com/openssl/openssl/blob/6b3d0423528b049d04b299a8588a32d5c1224717/crypto/rand/rand_lib.c/#L904
|
d2a_code_trace_data_41613
|
SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
float lumaSharpen, float chromaSharpen,
float chromaHShift, float chromaVShift,
int verbose)
{
SwsFilter *filter= av_malloc(sizeof(SwsFilter));
if (lumaGBlur!=0.0){
filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
}else{
filter->lumH= sws_getIdentityVec();
filter->lumV= sws_getIdentityVec();
}
if (chromaGBlur!=0.0){
filter->chrH= sws_getGaussianVec(chromaGBlur, 3.0);
filter->chrV= sws_getGaussianVec(chromaGBlur, 3.0);
}else{
filter->chrH= sws_getIdentityVec();
filter->chrV= sws_getIdentityVec();
}
if (chromaSharpen!=0.0){
SwsVector *id= sws_getIdentityVec();
sws_scaleVec(filter->chrH, -chromaSharpen);
sws_scaleVec(filter->chrV, -chromaSharpen);
sws_addVec(filter->chrH, id);
sws_addVec(filter->chrV, id);
sws_freeVec(id);
}
if (lumaSharpen!=0.0){
SwsVector *id= sws_getIdentityVec();
sws_scaleVec(filter->lumH, -lumaSharpen);
sws_scaleVec(filter->lumV, -lumaSharpen);
sws_addVec(filter->lumH, id);
sws_addVec(filter->lumV, id);
sws_freeVec(id);
}
if (chromaHShift != 0.0)
sws_shiftVec(filter->chrH, (int)(chromaHShift+0.5));
if (chromaVShift != 0.0)
sws_shiftVec(filter->chrV, (int)(chromaVShift+0.5));
sws_normalizeVec(filter->chrH, 1.0);
sws_normalizeVec(filter->chrV, 1.0);
sws_normalizeVec(filter->lumH, 1.0);
sws_normalizeVec(filter->lumV, 1.0);
if (verbose) sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG);
if (verbose) sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG);
return filter;
}
libswscale/swscale.c:2841: error: Null Dereference
pointer `filter` last assigned on line 2835 could be null and is dereferenced at line 2841, column 9.
libswscale/swscale.c:2830:1: start of procedure sws_getDefaultFilter()
2828. #endif
2829.
2830. SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
^
2831. float lumaSharpen, float chromaSharpen,
2832. float chromaHShift, float chromaVShift,
libswscale/swscale.c:2835:5:
2833. int verbose)
2834. {
2835. SwsFilter *filter= av_malloc(sizeof(SwsFilter));
^
2836.
2837. if (lumaGBlur!=0.0){
libavutil/mem.c:47:1: start of procedure av_malloc()
45. linker will do it automatically. */
46.
47. void *av_malloc(unsigned int size)
^
48. {
49. void *ptr = NULL;
libavutil/mem.c:49:5:
47. void *av_malloc(unsigned int size)
48. {
49. void *ptr = NULL;
^
50. #if CONFIG_MEMALIGN_HACK
51. long diff;
libavutil/mem.c:55:8: Taking false branch
53.
54. /* let's disallow possible ambiguous cases */
55. if(size > (INT_MAX-16) )
^
56. return NULL;
57.
libavutil/mem.c:66:9: Taking true branch
64. ((char*)ptr)[-1]= diff;
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
^
67. ptr = NULL;
68. #elif HAVE_MEMALIGN
libavutil/mem.c:67:9:
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
67. ptr = NULL;
^
68. #elif HAVE_MEMALIGN
69. ptr = memalign(16,size);
libavutil/mem.c:99:5:
97. ptr = malloc(size);
98. #endif
99. return ptr;
^
100. }
101.
libavutil/mem.c:100:1: return from a call to av_malloc
98. #endif
99. return ptr;
100. }
^
101.
102. void *av_realloc(void *ptr, unsigned int size)
libswscale/swscale.c:2837:9: Taking false branch
2835. SwsFilter *filter= av_malloc(sizeof(SwsFilter));
2836.
2837. if (lumaGBlur!=0.0){
^
2838. filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
2839. filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
libswscale/swscale.c:2841:9:
2839. filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
2840. }else{
2841. filter->lumH= sws_getIdentityVec();
^
2842. filter->lumV= sws_getIdentityVec();
2843. }
libswscale/swscale.c:2924:1: start of procedure sws_getIdentityVec()
2922.
2923.
2924. SwsVector *sws_getIdentityVec(void){
^
2925. return sws_getConstVec(1.0, 1);
2926. }
libswscale/swscale.c:2925:5: Skipping sws_getConstVec(): empty list of specs
2923.
2924. SwsVector *sws_getIdentityVec(void){
2925. return sws_getConstVec(1.0, 1);
^
2926. }
2927.
libswscale/swscale.c:2926:1: return from a call to sws_getIdentityVec
2924. SwsVector *sws_getIdentityVec(void){
2925. return sws_getConstVec(1.0, 1);
2926. }
^
2927.
2928. double sws_dcVec(SwsVector *a){
|
https://github.com/libav/libav/blob/184bc53db4fded8857af09cee2adc7197940deb7/libswscale/swscale.c/#L2841
|
d2a_code_trace_data_41614
|
static void info_cb(const SSL *s, int where, int ret)
{
if (where & SSL_CB_ALERT) {
HANDSHAKE_EX_DATA *ex_data =
(HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
if (where & SSL_CB_WRITE) {
ex_data->alert_sent = ret;
if (strcmp(SSL_alert_type_string(ret), "F") == 0
|| strcmp(SSL_alert_desc_string(ret), "CN") == 0)
ex_data->num_fatal_alerts_sent++;
} else {
ex_data->alert_received = ret;
}
}
}
test/handshake_helper.c:95: error: NULL_DEREFERENCE
pointer `ex_data` last assigned on line 87 could be null and is dereferenced at line 95, column 13.
Showing all 12 steps of the trace
test/handshake_helper.c:84:1: start of procedure info_cb()
82. static int ex_data_idx;
83.
84. > static void info_cb(const SSL *s, int where, int ret)
85. {
86. if (where & SSL_CB_ALERT) {
test/handshake_helper.c:86:9: Taking true branch
84. static void info_cb(const SSL *s, int where, int ret)
85. {
86. if (where & SSL_CB_ALERT) {
^
87. HANDSHAKE_EX_DATA *ex_data =
88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
test/handshake_helper.c:87:9:
85. {
86. if (where & SSL_CB_ALERT) {
87. > HANDSHAKE_EX_DATA *ex_data =
88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
89. if (where & SSL_CB_WRITE) {
ssl/ssl_lib.c:4014:1: start of procedure SSL_get_ex_data()
4012. }
4013.
4014. > void *SSL_get_ex_data(const SSL *s, int idx)
4015. {
4016. return CRYPTO_get_ex_data(&s->ex_data, idx);
ssl/ssl_lib.c:4016:5:
4014. void *SSL_get_ex_data(const SSL *s, int idx)
4015. {
4016. > return CRYPTO_get_ex_data(&s->ex_data, idx);
4017. }
4018.
crypto/ex_data.c:393:1: start of procedure CRYPTO_get_ex_data()
391. * particular index in the class used by this variable
392. */
393. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
crypto/ex_data.c:395:9: Taking true branch
393. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
^
396. return NULL;
397. return sk_void_value(ad->sk, idx);
crypto/ex_data.c:396:9:
394. {
395. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
396. > return NULL;
397. return sk_void_value(ad->sk, idx);
398. }
crypto/ex_data.c:398:1: return from a call to CRYPTO_get_ex_data
396. return NULL;
397. return sk_void_value(ad->sk, idx);
398. > }
ssl/ssl_lib.c:4017:1: return from a call to SSL_get_ex_data
4015. {
4016. return CRYPTO_get_ex_data(&s->ex_data, idx);
4017. > }
4018.
4019. int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, void *arg)
test/handshake_helper.c:89:13: Taking false branch
87. HANDSHAKE_EX_DATA *ex_data =
88. (HANDSHAKE_EX_DATA*)(SSL_get_ex_data(s, ex_data_idx));
89. if (where & SSL_CB_WRITE) {
^
90. ex_data->alert_sent = ret;
91. if (strcmp(SSL_alert_type_string(ret), "F") == 0
test/handshake_helper.c:95:13:
93. ex_data->num_fatal_alerts_sent++;
94. } else {
95. > ex_data->alert_received = ret;
96. }
97. }
|
https://github.com/openssl/openssl/blob/e43e6b1951de931ca500c6964496e76651332f5e/test/handshake_helper.c/#L95
|
d2a_code_trace_data_41615
|
void *lh_delete(_LHASH *lh, const void *data)
{
unsigned long hash;
LHASH_NODE *nn,**rn;
void *ret;
lh->error=0;
rn=getrn(lh,data,&hash);
if (*rn == NULL)
{
lh->num_no_delete++;
return(NULL);
}
else
{
nn= *rn;
*rn=nn->next;
ret=nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
contract(lh);
return(ret);
}
ssl/s3_srvr.c:357: error: INTEGER_OVERFLOW_L2
([0, max(0, `s->ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_get_client_hello`.
Showing all 15 steps of the trace
ssl/s3_srvr.c:214:1: Parameter `s->ctx->sessions->num_items`
212. ssl3_get_server_method)
213.
214. > int ssl3_accept(SSL *s)
215. {
216. BUF_MEM *buf;
ssl/s3_srvr.c:357:9: Call
355. if (s->rwstate != SSL_X509_LOOKUP)
356. {
357. ret=ssl3_get_client_hello(s);
^
358. if (ret <= 0) goto end;
359. }
ssl/s3_srvr.c:917:1: Parameter `s->ctx->sessions->num_items`
915. }
916.
917. > int ssl3_get_client_hello(SSL *s)
918. {
919. int i,j,ok,al,ret= -1;
ssl/s3_srvr.c:1094:18: Call
1092. goto f_err;
1093. }
1094. if ((i > 0) && (ssl_bytes_to_cipher_list(s,p,i,&(ciphers))
^
1095. == NULL))
1096. {
ssl/ssl_lib.c:1425:1: Parameter `s->ctx->sessions->num_items`
1423. }
1424.
1425. > STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
1426. STACK_OF(SSL_CIPHER) **skp)
1427. {
ssl/ssl_lib.c:1459:5: Call
1457. {
1458. SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING);
1459. ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_HANDSHAKE_FAILURE);
^
1460. goto err;
1461. }
ssl/s3_pkt.c:1452:1: Parameter `s->ctx->sessions->num_items`
1450. }
1451.
1452. > int ssl3_send_alert(SSL *s, int level, int desc)
1453. {
1454. /* Map tls/ssl alert value to correct one */
ssl/s3_pkt.c:1461:3: Call
1459. /* If a fatal one, remove from cache */
1460. if ((level == 2) && (s->session != NULL))
1461. SSL_CTX_remove_session(s->ctx,s->session);
^
1462.
1463. s->s3->alert_dispatch=1;
ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items`
694. }
695.
696. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
697. {
698. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:698:9: Call
696. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
697. {
698. return remove_session_lock(ctx, c, 1);
^
699. }
700.
ssl/ssl_sess.c:701:1: Parameter `ctx->sessions->num_items`
699. }
700.
701. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
702. {
703. SSL_SESSION *r;
ssl/ssl_sess.c:712:6: Call
710. {
711. ret=1;
712. r=lh_SSL_SESSION_delete(ctx->sessions,c);
^
713. SSL_SESSION_list_remove(ctx,c);
714. }
crypto/lhash/lhash.c:217:1: <LHS trace>
215. }
216.
217. > void *lh_delete(_LHASH *lh, const void *data)
218. {
219. unsigned long hash;
crypto/lhash/lhash.c:217:1: Parameter `lh->num_items`
215. }
216.
217. > void *lh_delete(_LHASH *lh, const void *data)
218. {
219. unsigned long hash;
crypto/lhash/lhash.c:240:2: Binary operation: ([0, max(0, s->ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_get_client_hello`
238. }
239.
240. lh->num_items--;
^
241. if ((lh->num_nodes > MIN_NODES) &&
242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
|
https://github.com/openssl/openssl/blob/27dfffd5b75ee1db114e32f6dc73e266513889c5/crypto/lhash/lhash.c/#L240
|
d2a_code_trace_data_41616
|
static void unpack_input(const unsigned char *input, unsigned int *output)
{
unsigned int outbuffer[28];
unsigned short inbuffer[10];
unsigned int x;
unsigned int *ptr;
for (x=0;x<20;x+=2)
inbuffer[x/2]=(input[x]<<8)+input[x+1];
ptr=outbuffer;
*(ptr++)=27;
*(ptr++)=(inbuffer[0]>>10)&0x3f;
*(ptr++)=(inbuffer[0]>>5)&0x1f;
*(ptr++)=inbuffer[0]&0x1f;
*(ptr++)=(inbuffer[1]>>12)&0xf;
*(ptr++)=(inbuffer[1]>>8)&0xf;
*(ptr++)=(inbuffer[1]>>5)&7;
*(ptr++)=(inbuffer[1]>>2)&7;
*(ptr++)=((inbuffer[1]<<1)&6)|((inbuffer[2]>>15)&1);
*(ptr++)=(inbuffer[2]>>12)&7;
*(ptr++)=(inbuffer[2]>>10)&3;
*(ptr++)=(inbuffer[2]>>5)&0x1f;
*(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3);
*(ptr++)=(inbuffer[3]>>6)&0xff;
*(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
*(ptr++)=(inbuffer[4]>>8)&0x7f;
*(ptr++)=(inbuffer[4]>>1)&0x7f;
*(ptr++)=((inbuffer[4]<<7)&0x80)|((inbuffer[5]>>9)&0x7f);
*(ptr++)=(inbuffer[5]>>2)&0x7f;
*(ptr++)=((inbuffer[5]<<5)&0x60)|((inbuffer[6]>>11)&0x1f);
*(ptr++)=(inbuffer[6]>>4)&0x7f;
*(ptr++)=((inbuffer[6]<<4)&0xf0)|((inbuffer[7]>>12)&0xf);
*(ptr++)=(inbuffer[7]>>5)&0x7f;
*(ptr++)=((inbuffer[7]<<2)&0x7c)|((inbuffer[8]>>14)&3);
*(ptr++)=(inbuffer[8]>>7)&0x7f;
*(ptr++)=((inbuffer[8]<<1)&0xfe)|((inbuffer[9]>>15)&1);
*(ptr++)=(inbuffer[9]>>8)&0x7f;
*(ptr++)=(inbuffer[9]>>1)&0x7f;
*(output++)=outbuffer[11];
for (x=1;x<11;*(output++)=outbuffer[x++]);
ptr=outbuffer+12;
for (x=0;x<16;x+=4)
{
*(output++)=ptr[x];
*(output++)=ptr[x+2];
*(output++)=ptr[x+3];
*(output++)=ptr[x+1];
}
}
libavcodec/ra144.c:279: error: Uninitialized Value
The value read from inbuffer[_] was never initialized.
libavcodec/ra144.c:279:3:
277. *(ptr++)=(inbuffer[2]>>10)&3;
278. *(ptr++)=(inbuffer[2]>>5)&0x1f;
279. *(ptr++)=((inbuffer[2]<<2)&0x7c)|((inbuffer[3]>>14)&3);
^
280. *(ptr++)=(inbuffer[3]>>6)&0xff;
281. *(ptr++)=((inbuffer[3]<<1)&0x7e)|((inbuffer[4]>>15)&1);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L279
|
d2a_code_trace_data_41617
|
static int ct_base64_decode(const char *in, unsigned char **out)
{
size_t inlen = strlen(in);
int outlen, i;
unsigned char *outbuf = NULL;
if (inlen == 0) {
*out = NULL;
return 0;
}
outlen = (inlen / 4) * 3;
outbuf = OPENSSL_malloc(outlen);
if (outbuf == NULL) {
CTerr(CT_F_CT_BASE64_DECODE, ERR_R_MALLOC_FAILURE);
goto err;
}
outlen = EVP_DecodeBlock(outbuf, (unsigned char *)in, inlen);
if (outlen < 0) {
CTerr(CT_F_CT_BASE64_DECODE, CT_R_BASE64_DECODE_ERROR);
goto err;
}
i = 0;
while (in[--inlen] == '=') {
--outlen;
if (++i > 2)
goto err;
}
*out = outbuf;
return outlen;
err:
OPENSSL_free(outbuf);
return -1;
}
test/ct_test.c:456: error: BUFFER_OVERRUN_L1
Offset: [-oo, -1] Size: 1 by call to `SCT_new_from_base64`.
Showing all 10 steps of the trace
test/ct_test.c:444:1: Array declaration
442. }
443.
444. > static int test_encode_tls_sct(void)
445. {
446. const char log_id[] = "3xwuwRUAlFJHqWFoMl3cXHlZ6PfG04j8AC4LvT9012Q=";
test/ct_test.c:456:10: Call
454.
455. fixture.sct_list = sk_SCT_new_null();
456. if (!TEST_ptr(sct = SCT_new_from_base64(SCT_VERSION_V1, log_id,
^
457. CT_LOG_ENTRY_TYPE_X509, timestamp,
458. extensions, signature)))
crypto/ct/ct_b64.c:63:1: Parameter `*extensions_base64`
61. }
62.
63. > SCT *SCT_new_from_base64(unsigned char version, const char *logid_base64,
64. ct_log_entry_type_t entry_type, uint64_t timestamp,
65. const char *extensions_base64,
crypto/ct/ct_b64.c:96:14: Call
94. dec = NULL;
95.
96. declen = ct_base64_decode(extensions_base64, &dec);
^
97. if (declen < 0) {
98. CTerr(CT_F_SCT_NEW_FROM_BASE64, X509_R_BASE64_DECODE_ERROR);
crypto/ct/ct_b64.c:24:1: <Offset trace>
22. * the caller. Do not provide a pre-allocated string in |out|.
23. */
24. > static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
crypto/ct/ct_b64.c:24:1: Parameter `in->strlen`
22. * the caller. Do not provide a pre-allocated string in |out|.
23. */
24. > static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
crypto/ct/ct_b64.c:26:5: Assignment
24. static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
^
27. int outlen, i;
28. unsigned char *outbuf = NULL;
crypto/ct/ct_b64.c:24:1: <Length trace>
22. * the caller. Do not provide a pre-allocated string in |out|.
23. */
24. > static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
crypto/ct/ct_b64.c:24:1: Parameter `*in`
22. * the caller. Do not provide a pre-allocated string in |out|.
23. */
24. > static int ct_base64_decode(const char *in, unsigned char **out)
25. {
26. size_t inlen = strlen(in);
crypto/ct/ct_b64.c:50:12: Array access: Offset: [-oo, -1] Size: 1 by call to `SCT_new_from_base64`
48. /* Subtract padding bytes from |outlen|. Any more than 2 is malformed. */
49. i = 0;
50. while (in[--inlen] == '=') {
^
51. --outlen;
52. if (++i > 2)
|
https://github.com/openssl/openssl/blob/62b0a0dea612e3683c6bd4bef359fceda00238e8/crypto/ct/ct_b64.c/#L50
|
d2a_code_trace_data_41618
|
static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type,
X509_NAME *name, int *pnmatch)
{
X509_OBJECT stmp;
X509 x509_s;
X509_CRL crl_s;
int idx;
stmp.type = type;
switch (type) {
case X509_LU_X509:
stmp.data.x509 = &x509_s;
x509_s.cert_info.subject = name;
break;
case X509_LU_CRL:
stmp.data.crl = &crl_s;
crl_s.crl.issuer = name;
break;
default:
return -1;
}
idx = sk_X509_OBJECT_find(h, &stmp);
if (idx >= 0 && pnmatch) {
int tidx;
const X509_OBJECT *tobj, *pstmp;
*pnmatch = 1;
pstmp = &stmp;
for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
tobj = sk_X509_OBJECT_value(h, tidx);
if (x509_object_cmp(&tobj, &pstmp))
break;
(*pnmatch)++;
}
}
return idx;
}
crypto/x509/x509_lu.c:463: error: NULL_DEREFERENCE
pointer `&tobj` last assigned on line 462 could be null and is dereferenced by call to `x509_object_cmp()` at line 463, column 17.
Showing all 47 steps of the trace
crypto/x509/x509_lu.c:432:1: start of procedure x509_object_idx_cnt()
430. }
431.
432. > static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type,
433. X509_NAME *name, int *pnmatch)
434. {
crypto/x509/x509_lu.c:440:5:
438. int idx;
439.
440. > stmp.type = type;
441. switch (type) {
442. case X509_LU_X509:
crypto/x509/x509_lu.c:441:5:
439.
440. stmp.type = type;
441. > switch (type) {
442. case X509_LU_X509:
443. stmp.data.x509 = &x509_s;
crypto/x509/x509_lu.c:442:5: Switch condition is true. Entering switch case
440. stmp.type = type;
441. switch (type) {
442. case X509_LU_X509:
^
443. stmp.data.x509 = &x509_s;
444. x509_s.cert_info.subject = name;
crypto/x509/x509_lu.c:443:9:
441. switch (type) {
442. case X509_LU_X509:
443. > stmp.data.x509 = &x509_s;
444. x509_s.cert_info.subject = name;
445. break;
crypto/x509/x509_lu.c:444:9:
442. case X509_LU_X509:
443. stmp.data.x509 = &x509_s;
444. > x509_s.cert_info.subject = name;
445. break;
446. case X509_LU_CRL:
crypto/x509/x509_lu.c:455:5:
453. }
454.
455. > idx = sk_X509_OBJECT_find(h, &stmp);
456. if (idx >= 0 && pnmatch) {
457. int tidx;
include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_find()
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:197:1: start of procedure OPENSSL_sk_find()
195. }
196.
197. > int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
198. {
199. return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
crypto/stack/stack.c:199:5:
197. int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
198. {
199. > return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
200. }
201.
crypto/stack/stack.c:172:1: start of procedure internal_find()
170. }
171.
172. > static int internal_find(OPENSSL_STACK *st, const void *data,
173. int ret_val_options)
174. {
crypto/stack/stack.c:178:9: Taking false branch
176. int i;
177.
178. if (st == NULL)
^
179. return -1;
180.
crypto/stack/stack.c:181:9: Taking true branch
179. return -1;
180.
181. if (st->comp == NULL) {
^
182. for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
crypto/stack/stack.c:182:14:
180.
181. if (st->comp == NULL) {
182. > for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
184. return (i);
crypto/stack/stack.c:182:21: Loop condition is true. Entering loop body
180.
181. if (st->comp == NULL) {
182. for (i = 0; i < st->num; i++)
^
183. if (st->data[i] == data)
184. return (i);
crypto/stack/stack.c:183:17: Taking false branch
181. if (st->comp == NULL) {
182. for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
^
184. return (i);
185. return (-1);
crypto/stack/stack.c:182:34:
180.
181. if (st->comp == NULL) {
182. > for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
184. return (i);
crypto/stack/stack.c:182:21: Loop condition is true. Entering loop body
180.
181. if (st->comp == NULL) {
182. for (i = 0; i < st->num; i++)
^
183. if (st->data[i] == data)
184. return (i);
crypto/stack/stack.c:183:17: Taking true branch
181. if (st->comp == NULL) {
182. for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
^
184. return (i);
185. return (-1);
crypto/stack/stack.c:184:17:
182. for (i = 0; i < st->num; i++)
183. if (st->data[i] == data)
184. > return (i);
185. return (-1);
186. }
crypto/stack/stack.c:195:1: return from a call to internal_find
193. return (-1);
194. return (int)((char **)r - st->data);
195. > }
196.
197. int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data)
crypto/stack/stack.c:200:1: return from a call to OPENSSL_sk_find
198. {
199. return internal_find(st, data, OBJ_BSEARCH_FIRST_VALUE_ON_MATCH);
200. > }
201.
202. int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data)
include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_find
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:456:9: Taking true branch
454.
455. idx = sk_X509_OBJECT_find(h, &stmp);
456. if (idx >= 0 && pnmatch) {
^
457. int tidx;
458. const X509_OBJECT *tobj, *pstmp;
crypto/x509/x509_lu.c:456:21: Taking true branch
454.
455. idx = sk_X509_OBJECT_find(h, &stmp);
456. if (idx >= 0 && pnmatch) {
^
457. int tidx;
458. const X509_OBJECT *tobj, *pstmp;
crypto/x509/x509_lu.c:459:9:
457. int tidx;
458. const X509_OBJECT *tobj, *pstmp;
459. > *pnmatch = 1;
460. pstmp = &stmp;
461. for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
crypto/x509/x509_lu.c:460:9:
458. const X509_OBJECT *tobj, *pstmp;
459. *pnmatch = 1;
460. > pstmp = &stmp;
461. for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462. tobj = sk_X509_OBJECT_value(h, tidx);
crypto/x509/x509_lu.c:461:14:
459. *pnmatch = 1;
460. pstmp = &stmp;
461. > for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462. tobj = sk_X509_OBJECT_value(h, tidx);
463. if (x509_object_cmp(&tobj, &pstmp))
crypto/x509/x509_lu.c:461:30:
459. *pnmatch = 1;
460. pstmp = &stmp;
461. > for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462. tobj = sk_X509_OBJECT_value(h, tidx);
463. if (x509_object_cmp(&tobj, &pstmp))
include/openssl/x509_vfy.h:54:1: start of procedure sk_X509_OBJECT_num()
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:265:1: start of procedure OPENSSL_sk_num()
263. }
264.
265. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
266. {
267. if (st == NULL)
crypto/stack/stack.c:267:9: Taking false branch
265. int OPENSSL_sk_num(const OPENSSL_STACK *st)
266. {
267. if (st == NULL)
^
268. return -1;
269. return st->num;
crypto/stack/stack.c:269:5:
267. if (st == NULL)
268. return -1;
269. > return st->num;
270. }
271.
crypto/stack/stack.c:270:1: return from a call to OPENSSL_sk_num
268. return -1;
269. return st->num;
270. > }
271.
272. void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)
include/openssl/x509_vfy.h:54:1: return from a call to sk_X509_OBJECT_num
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:461:30: Loop condition is true. Entering loop body
459. *pnmatch = 1;
460. pstmp = &stmp;
461. for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
^
462. tobj = sk_X509_OBJECT_value(h, tidx);
463. if (x509_object_cmp(&tobj, &pstmp))
crypto/x509/x509_lu.c:462:13:
460. pstmp = &stmp;
461. for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462. > tobj = sk_X509_OBJECT_value(h, tidx);
463. if (x509_object_cmp(&tobj, &pstmp))
464. break;
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 false 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:274:23: 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:463:17:
461. for (tidx = idx + 1; tidx < sk_X509_OBJECT_num(h); tidx++) {
462. tobj = sk_X509_OBJECT_value(h, tidx);
463. > if (x509_object_cmp(&tobj, &pstmp))
464. break;
465. (*pnmatch)++;
crypto/x509/x509_lu.c:109:1: start of procedure x509_object_cmp()
107. }
108.
109. > static int x509_object_cmp(const X509_OBJECT *const *a,
110. const X509_OBJECT *const *b)
111. {
crypto/x509/x509_lu.c:114:5:
112. int ret;
113.
114. > ret = ((*a)->type - (*b)->type);
115. if (ret)
116. return ret;
|
https://github.com/openssl/openssl/blob/b2de11c58b57e7f0d58c6f8a1d4177705650647e/crypto/x509/x509_lu.c/#L463
|
d2a_code_trace_data_41619
|
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:1044: error: Uninitialized Value
The value read from xmin was never initialized.
libavcodec/motion_est_template.c:1044:9:
1042. if (s->first_slice_line) {
1043. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
1044. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
^
1045. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
1046. }else{
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1044
|
d2a_code_trace_data_41620
|
ngx_int_t
ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
{
u_char *elts;
size_t len;
u_short *test;
ngx_uint_t i, n, key, size, start, bucket_size;
ngx_hash_elt_t *elt, **buckets;
if (hinit->max_size == 0) {
ngx_log_error(NGX_LOG_EMERG, hinit->pool->log, 0,
"could not build %s, you should "
"increase %s_max_size: %i",
hinit->name, hinit->name, hinit->max_size);
return NGX_ERROR;
}
for (n = 0; n < nelts; n++) {
if (hinit->bucket_size < NGX_HASH_ELT_SIZE(&names[n]) + sizeof(void *))
{
ngx_log_error(NGX_LOG_EMERG, hinit->pool->log, 0,
"could not build %s, you should "
"increase %s_bucket_size: %i",
hinit->name, hinit->name, hinit->bucket_size);
return NGX_ERROR;
}
}
test = ngx_alloc(hinit->max_size * sizeof(u_short), hinit->pool->log);
if (test == NULL) {
return NGX_ERROR;
}
bucket_size = hinit->bucket_size - sizeof(void *);
start = nelts / (bucket_size / (2 * sizeof(void *)));
start = start ? start : 1;
if (hinit->max_size > 10000 && nelts && hinit->max_size / nelts < 100) {
start = hinit->max_size - 1000;
}
for (size = start; size <= hinit->max_size; size++) {
ngx_memzero(test, size * sizeof(u_short));
for (n = 0; n < nelts; n++) {
if (names[n].key.data == NULL) {
continue;
}
key = names[n].key_hash % size;
test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
#if 0
ngx_log_error(NGX_LOG_ALERT, hinit->pool->log, 0,
"%ui: %ui %ui \"%V\"",
size, key, test[key], &names[n].key);
#endif
if (test[key] > (u_short) bucket_size) {
goto next;
}
}
goto found;
next:
continue;
}
size = hinit->max_size;
ngx_log_error(NGX_LOG_WARN, hinit->pool->log, 0,
"could not build optimal %s, you should increase "
"either %s_max_size: %i or %s_bucket_size: %i; "
"ignoring %s_bucket_size",
hinit->name, hinit->name, hinit->max_size,
hinit->name, hinit->bucket_size, hinit->name);
found:
for (i = 0; i < size; i++) {
test[i] = sizeof(void *);
}
for (n = 0; n < nelts; n++) {
if (names[n].key.data == NULL) {
continue;
}
key = names[n].key_hash % size;
test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
}
len = 0;
for (i = 0; i < size; i++) {
if (test[i] == sizeof(void *)) {
continue;
}
test[i] = (u_short) (ngx_align(test[i], ngx_cacheline_size));
len += test[i];
}
if (hinit->hash == NULL) {
hinit->hash = ngx_pcalloc(hinit->pool, sizeof(ngx_hash_wildcard_t)
+ size * sizeof(ngx_hash_elt_t *));
if (hinit->hash == NULL) {
ngx_free(test);
return NGX_ERROR;
}
buckets = (ngx_hash_elt_t **)
((u_char *) hinit->hash + sizeof(ngx_hash_wildcard_t));
} else {
buckets = ngx_pcalloc(hinit->pool, size * sizeof(ngx_hash_elt_t *));
if (buckets == NULL) {
ngx_free(test);
return NGX_ERROR;
}
}
elts = ngx_palloc(hinit->pool, len + ngx_cacheline_size);
if (elts == NULL) {
ngx_free(test);
return NGX_ERROR;
}
elts = ngx_align_ptr(elts, ngx_cacheline_size);
for (i = 0; i < size; i++) {
if (test[i] == sizeof(void *)) {
continue;
}
buckets[i] = (ngx_hash_elt_t *) elts;
elts += test[i];
}
for (i = 0; i < size; i++) {
test[i] = 0;
}
for (n = 0; n < nelts; n++) {
if (names[n].key.data == NULL) {
continue;
}
key = names[n].key_hash % size;
elt = (ngx_hash_elt_t *) ((u_char *) buckets[key] + test[key]);
elt->value = names[n].value;
elt->len = (u_short) names[n].key.len;
ngx_strlow(elt->name, names[n].key.data, names[n].key.len);
test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
}
for (i = 0; i < size; i++) {
if (buckets[i] == NULL) {
continue;
}
elt = (ngx_hash_elt_t *) ((u_char *) buckets[i] + test[i]);
elt->value = NULL;
}
ngx_free(test);
hinit->hash->buckets = buckets;
hinit->hash->size = size;
#if 0
for (i = 0; i < size; i++) {
ngx_str_t val;
ngx_uint_t key;
elt = buckets[i];
if (elt == NULL) {
ngx_log_error(NGX_LOG_ALERT, hinit->pool->log, 0,
"%ui: NULL", i);
continue;
}
while (elt->value) {
val.len = elt->len;
val.data = &elt->name[0];
key = hinit->key(val.data, val.len);
ngx_log_error(NGX_LOG_ALERT, hinit->pool->log, 0,
"%ui: %p \"%V\" %ui", i, elt, &val, key);
elt = (ngx_hash_elt_t *) ngx_align_ptr(&elt->name[0] + elt->len,
sizeof(void *));
}
}
#endif
return NGX_OK;
}
src/http/ngx_http_variables.c:2624: error: Buffer Overrun L3
Offset: [0, 25] (⇐ [0, 24] + [0, 1]) Size: [0, 40] by call to `ngx_hash_init`.
src/http/ngx_http_variables.c:2544:13: Assignment
2542. {
2543. v[i].get_handler = ngx_http_variable_unknown_header_in;
2544. v[i].data = (uintptr_t) &v[i].name;
^
2545.
2546. continue;
src/http/ngx_http_variables.c:2618:5: Assignment
2616. hash.hash = &cmcf->variables_hash;
2617. hash.key = ngx_hash_key;
2618. hash.max_size = cmcf->variables_hash_max_size;
^
2619. hash.bucket_size = cmcf->variables_hash_bucket_size;
2620. hash.name = "variables_hash";
src/http/ngx_http_variables.c:2624:9: Call
2622. hash.temp_pool = NULL;
2623.
2624. if (ngx_hash_init(&hash, cmcf->variables_keys->keys.elts,
^
2625. cmcf->variables_keys->keys.nelts)
2626. != NGX_OK)
src/core/ngx_hash.c:251:1: <Offset trace>
249. (sizeof(void *) + ngx_align((name)->key.len + 2, sizeof(void *)))
250.
251. ngx_int_t
^
252. ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
253. {
src/core/ngx_hash.c:251:1: Parameter `hinit->max_size`
249. (sizeof(void *) + ngx_align((name)->key.len + 2, sizeof(void *)))
250.
251. ngx_int_t
^
252. ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
253. {
src/core/ngx_hash.c:251:1: <Length trace>
249. (sizeof(void *) + ngx_align((name)->key.len + 2, sizeof(void *)))
250.
251. ngx_int_t
^
252. ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
253. {
src/core/ngx_hash.c:251:1: Parameter `hinit->max_size`
249. (sizeof(void *) + ngx_align((name)->key.len + 2, sizeof(void *)))
250.
251. ngx_int_t
^
252. ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
253. {
src/core/ngx_hash.c:371:19: Call
369.
370. } else {
371. buckets = ngx_pcalloc(hinit->pool, size * sizeof(ngx_hash_elt_t *));
^
372. if (buckets == NULL) {
373. ngx_free(test);
src/core/ngx_palloc.c:299:1: Parameter `size`
297.
298.
299. void *
^
300. ngx_pcalloc(ngx_pool_t *pool, size_t size)
301. {
src/core/ngx_palloc.c:304:9: Call
302. void *p;
303.
304. p = ngx_palloc(pool, size);
^
305. if (p) {
306. ngx_memzero(p, size);
src/core/ngx_palloc.c:130:13: Assignment
128.
129. do {
130. m = ngx_align_ptr(p->d.last, NGX_ALIGNMENT);
^
131.
132. if ((size_t) (p->d.end - m) >= size) {
src/core/ngx_palloc.c:135:17: Assignment
133. p->d.last = m + size;
134.
135. return m;
^
136. }
137.
src/core/ngx_palloc.c:304:5: Assignment
302. void *p;
303.
304. p = ngx_palloc(pool, size);
^
305. if (p) {
306. ngx_memzero(p, size);
src/core/ngx_palloc.c:309:5: Assignment
307. }
308.
309. return p;
^
310. }
311.
src/core/ngx_hash.c:371:9: Assignment
369.
370. } else {
371. buckets = ngx_pcalloc(hinit->pool, size * sizeof(ngx_hash_elt_t *));
^
372. if (buckets == NULL) {
373. ngx_free(test);
src/core/ngx_hash.c:391:9: Array access: Offset: [0, 25] (⇐ [0, 24] + [0, 1]) Size: [0, 40] by call to `ngx_hash_init`
389. }
390.
391. buckets[i] = (ngx_hash_elt_t *) elts;
^
392. elts += test[i];
393.
|
https://github.com/nginx/nginx/blob/79a03b3ff6d950e60a06c6d979bd7a909709e82d/src/core/ngx_hash.c/#L391
|
d2a_code_trace_data_41621
|
static int wpacket_intern_close(WPACKET *pkt)
{
WPACKET_SUB *sub = pkt->subs;
size_t packlen = pkt->written - sub->pwritten;
if (packlen == 0
&& (sub->flags & WPACKET_FLAGS_NON_ZERO_LENGTH) != 0)
return 0;
if (packlen == 0
&& sub->flags & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) {
if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
pkt->written -= sub->lenbytes;
pkt->curr -= sub->lenbytes;
}
sub->packet_len = 0;
sub->lenbytes = 0;
}
if (sub->lenbytes > 0
&& !put_value((unsigned char *)&pkt->buf->data[sub->packet_len],
packlen, sub->lenbytes))
return 0;
pkt->subs = sub->parent;
OPENSSL_free(sub);
return 1;
}
ssl/statem/statem_srvr.c:1966: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, 2]):unsigned64 by call to `WPACKET_close`.
Showing all 11 steps of the trace
ssl/statem/statem_srvr.c:1954:10: Call
1952.
1953. /* get the list of acceptable cert types */
1954. if (!WPACKET_start_sub_packet_u8(&pkt)
^
1955. || !ssl3_get_req_cert_type(s, &pkt)
1956. || !WPACKET_close(&pkt)) {
ssl/packet.c:224:1: Parameter `lenbytes`
222. }
223.
224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
225. {
226. WPACKET_SUB *sub;
ssl/packet.c:241:5: Assignment
239. pkt->subs = sub;
240. sub->pwritten = pkt->written + lenbytes;
241. sub->lenbytes = lenbytes;
^
242.
243. if (lenbytes == 0) {
ssl/statem/statem_srvr.c:1966:21: Call
1964. if (!WPACKET_start_sub_packet_u16(&pkt)
1965. || !tls12_copy_sigalgs(s, &pkt, psigs, nl)
1966. || !WPACKET_close(&pkt)) {
^
1967. SSLerr(SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST,
1968. ERR_R_INTERNAL_ERROR);
ssl/packet.c:192:1: Parameter `pkt->curr`
190. }
191.
192. > int WPACKET_close(WPACKET *pkt)
193. {
194. /*
ssl/packet.c:201:12: Call
199. return 0;
200.
201. return wpacket_intern_close(pkt);
^
202. }
203.
ssl/packet.c:158:1: <LHS trace>
156. * close a sub-packet and write out its length if necessary.
157. */
158. > static int wpacket_intern_close(WPACKET *pkt)
159. {
160. WPACKET_SUB *sub = pkt->subs;
ssl/packet.c:158:1: Parameter `pkt->curr`
156. * close a sub-packet and write out its length if necessary.
157. */
158. > static int wpacket_intern_close(WPACKET *pkt)
159. {
160. WPACKET_SUB *sub = pkt->subs;
ssl/packet.c:158:1: <RHS trace>
156. * close a sub-packet and write out its length if necessary.
157. */
158. > static int wpacket_intern_close(WPACKET *pkt)
159. {
160. WPACKET_SUB *sub = pkt->subs;
ssl/packet.c:158:1: Parameter `pkt->subs->lenbytes`
156. * close a sub-packet and write out its length if necessary.
157. */
158. > static int wpacket_intern_close(WPACKET *pkt)
159. {
160. WPACKET_SUB *sub = pkt->subs;
ssl/packet.c:170:13: Binary operation: ([0, +oo] - [0, 2]):unsigned64 by call to `WPACKET_close`
168. && sub->flags & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) {
169. /* Deallocate any bytes allocated for the length of the WPACKET */
170. if ((pkt->curr - sub->lenbytes) == sub->packet_len) {
^
171. pkt->written -= sub->lenbytes;
172. pkt->curr -= sub->lenbytes;
|
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L170
|
d2a_code_trace_data_41622
|
static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
{
const char *codec_string = encoder ? "encoder" : "decoder";
AVCodec *codec;
if(!name)
return CODEC_ID_NONE;
codec = encoder ?
avcodec_find_encoder_by_name(name) :
avcodec_find_decoder_by_name(name);
if(!codec) {
fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
ffmpeg_exit(1);
}
if(codec->type != type) {
fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
ffmpeg_exit(1);
}
if(codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
strict > FF_COMPLIANCE_EXPERIMENTAL) {
fprintf(stderr, "%s '%s' is experimental and might produce bad "
"results.\nAdd '-strict experimental' if you want to use it.\n",
codec_string, codec->name);
codec = encoder ?
avcodec_find_encoder(codec->id) :
avcodec_find_decoder(codec->id);
if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
fprintf(stderr, "Or use the non experimental %s '%s'.\n",
codec_string, codec->name);
ffmpeg_exit(1);
}
return codec->id;
}
ffmpeg.c:3084: error: Null Dereference
pointer `codec` last assigned on line 3077 could be null and is dereferenced at line 3084, column 8.
ffmpeg.c:3070:1: start of procedure find_codec_or_die()
3068. }
3069.
3070. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
^
3071. {
3072. const char *codec_string = encoder ? "encoder" : "decoder";
ffmpeg.c:3072:32: Condition is true
3070. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3071. {
3072. const char *codec_string = encoder ? "encoder" : "decoder";
^
3073. AVCodec *codec;
3074.
ffmpeg.c:3072:5:
3070. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3071. {
3072. const char *codec_string = encoder ? "encoder" : "decoder";
^
3073. AVCodec *codec;
3074.
ffmpeg.c:3075:9: Taking false branch
3073. AVCodec *codec;
3074.
3075. if(!name)
^
3076. return CODEC_ID_NONE;
3077. codec = encoder ?
ffmpeg.c:3077:13: Condition is true
3075. if(!name)
3076. return CODEC_ID_NONE;
3077. codec = encoder ?
^
3078. avcodec_find_encoder_by_name(name) :
3079. avcodec_find_decoder_by_name(name);
ffmpeg.c:3077:5:
3075. if(!name)
3076. return CODEC_ID_NONE;
3077. codec = encoder ?
^
3078. avcodec_find_encoder_by_name(name) :
3079. avcodec_find_decoder_by_name(name);
ffmpeg.c:3080:9: Taking true branch
3078. avcodec_find_encoder_by_name(name) :
3079. avcodec_find_decoder_by_name(name);
3080. if(!codec) {
^
3081. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3082. ffmpeg_exit(1);
ffmpeg.c:3081:9:
3079. avcodec_find_decoder_by_name(name);
3080. if(!codec) {
3081. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
^
3082. ffmpeg_exit(1);
3083. }
ffmpeg.c:3082:9: Skipping ffmpeg_exit(): empty list of specs
3080. if(!codec) {
3081. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3082. ffmpeg_exit(1);
^
3083. }
3084. if(codec->type != type) {
ffmpeg.c:3084:8:
3082. ffmpeg_exit(1);
3083. }
3084. if(codec->type != type) {
^
3085. fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3086. ffmpeg_exit(1);
|
https://github.com/libav/libav/blob/5da116a3fde9013846bd7b385cdde5ce2951869c/ffmpeg.c/#L3084
|
d2a_code_trace_data_41623
|
static int dane_tlsa_add(
SSL_DANE *dane,
uint8_t usage,
uint8_t selector,
uint8_t mtype,
unsigned char *data,
size_t dlen)
{
danetls_record *t;
const EVP_MD *md = NULL;
int ilen = (int)dlen;
int i;
int num;
if (dane->trecs == NULL) {
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_NOT_ENABLED);
return -1;
}
if (ilen < 0 || dlen != (size_t)ilen) {
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
return 0;
}
if (usage > DANETLS_USAGE_LAST) {
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE);
return 0;
}
if (selector > DANETLS_SELECTOR_LAST) {
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_SELECTOR);
return 0;
}
if (mtype != DANETLS_MATCHING_FULL) {
md = tlsa_md_get(dane, mtype);
if (md == NULL) {
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);
return 0;
}
}
if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
return 0;
}
if (!data) {
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_NULL_DATA);
return 0;
}
if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
return -1;
}
t->usage = usage;
t->selector = selector;
t->mtype = mtype;
t->data = OPENSSL_malloc(ilen);
if (t->data == NULL) {
tlsa_free(t);
SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
return -1;
}
memcpy(t->data, data, ilen);
t->dlen = ilen;
if (mtype == DANETLS_MATCHING_FULL) {
const unsigned char *p = data;
X509 *cert = NULL;
EVP_PKEY *pkey = NULL;
switch (selector) {
case DANETLS_SELECTOR_CERT:
if (!d2i_X509(&cert, &p, dlen) || p < data ||
dlen != (size_t)(p - data)) {
tlsa_free(t);
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_CERTIFICATE);
return 0;
}
if (X509_get0_pubkey(cert) == NULL) {
tlsa_free(t);
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_CERTIFICATE);
return 0;
}
if ((DANETLS_USAGE_BIT(usage) & DANETLS_TA_MASK) == 0) {
X509_free(cert);
break;
}
if ((dane->certs == NULL &&
(dane->certs = sk_X509_new_null()) == NULL) ||
!sk_X509_push(dane->certs, cert)) {
SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
X509_free(cert);
tlsa_free(t);
return -1;
}
break;
case DANETLS_SELECTOR_SPKI:
if (!d2i_PUBKEY(&pkey, &p, dlen) || p < data ||
dlen != (size_t)(p - data)) {
tlsa_free(t);
SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY);
return 0;
}
if (usage == DANETLS_USAGE_DANE_TA)
t->spki = pkey;
else
EVP_PKEY_free(pkey);
break;
}
}
num = sk_danetls_record_num(dane->trecs);
for (i = 0; i < num; ++i) {
danetls_record *rec = sk_danetls_record_value(dane->trecs, i);
if (rec->usage > usage)
continue;
if (rec->usage < usage)
break;
if (rec->selector > selector)
continue;
if (rec->selector < selector)
break;
if (dane->dctx->mdord[rec->mtype] > dane->dctx->mdord[mtype])
continue;
break;
}
if (!sk_danetls_record_insert(dane->trecs, t, i)) {
tlsa_free(t);
SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
return -1;
}
dane->umask |= DANETLS_USAGE_BIT(usage);
return 1;
}
ssl/ssl_lib.c:325: error: MEMORY_LEAK
memory dynamically allocated by call to `CRYPTO_zalloc()` at line 315, column 14 is not reachable after line 325, column 9.
Showing all 53 steps of the trace
ssl/ssl_lib.c:264:1: start of procedure dane_tlsa_add()
262. }
263.
264. > static int dane_tlsa_add(
265. SSL_DANE *dane,
266. uint8_t usage,
ssl/ssl_lib.c:273:5:
271. {
272. danetls_record *t;
273. > const EVP_MD *md = NULL;
274. int ilen = (int)dlen;
275. int i;
ssl/ssl_lib.c:274:5:
272. danetls_record *t;
273. const EVP_MD *md = NULL;
274. > int ilen = (int)dlen;
275. int i;
276. int num;
ssl/ssl_lib.c:278:9: Taking false branch
276. int num;
277.
278. if (dane->trecs == NULL) {
^
279. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_NOT_ENABLED);
280. return -1;
ssl/ssl_lib.c:283:9: Taking false branch
281. }
282.
283. if (ilen < 0 || dlen != (size_t)ilen) {
^
284. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
285. return 0;
ssl/ssl_lib.c:283:21: Taking false branch
281. }
282.
283. if (ilen < 0 || dlen != (size_t)ilen) {
^
284. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DATA_LENGTH);
285. return 0;
ssl/ssl_lib.c:288:9: Taking false branch
286. }
287.
288. if (usage > DANETLS_USAGE_LAST) {
^
289. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE);
290. return 0;
ssl/ssl_lib.c:293:9: Taking false branch
291. }
292.
293. if (selector > DANETLS_SELECTOR_LAST) {
^
294. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_SELECTOR);
295. return 0;
ssl/ssl_lib.c:298:9: Taking true branch
296. }
297.
298. if (mtype != DANETLS_MATCHING_FULL) {
^
299. md = tlsa_md_get(dane, mtype);
300. if (md == NULL) {
ssl/ssl_lib.c:299:9:
297.
298. if (mtype != DANETLS_MATCHING_FULL) {
299. > md = tlsa_md_get(dane, mtype);
300. if (md == NULL) {
301. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);
ssl/ssl_lib.c:257:1: start of procedure tlsa_md_get()
255. }
256.
257. > static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
258. {
259. if (mtype > dane->dctx->mdmax)
ssl/ssl_lib.c:259:9: Taking false branch
257. static const EVP_MD *tlsa_md_get(SSL_DANE *dane, uint8_t mtype)
258. {
259. if (mtype > dane->dctx->mdmax)
^
260. return NULL;
261. return dane->dctx->mdevp[mtype];
ssl/ssl_lib.c:261:5:
259. if (mtype > dane->dctx->mdmax)
260. return NULL;
261. > return dane->dctx->mdevp[mtype];
262. }
263.
ssl/ssl_lib.c:262:1: return from a call to tlsa_md_get
260. return NULL;
261. return dane->dctx->mdevp[mtype];
262. > }
263.
264. static int dane_tlsa_add(
ssl/ssl_lib.c:300:13: Taking false branch
298. if (mtype != DANETLS_MATCHING_FULL) {
299. md = tlsa_md_get(dane, mtype);
300. if (md == NULL) {
^
301. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE);
302. return 0;
ssl/ssl_lib.c:306:9: Taking true branch
304. }
305.
306. if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
^
307. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
308. return 0;
ssl/ssl_lib.c:306:23:
304. }
305.
306. > if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
307. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
308. return 0;
crypto/evp/evp_lib.c:301:1: start of procedure EVP_MD_size()
299. }
300.
301. > int EVP_MD_size(const EVP_MD *md)
302. {
303. if (!md) {
crypto/evp/evp_lib.c:303:10: Taking false branch
301. int EVP_MD_size(const EVP_MD *md)
302. {
303. if (!md) {
^
304. EVPerr(EVP_F_EVP_MD_SIZE, EVP_R_MESSAGE_DIGEST_IS_NULL);
305. return -1;
crypto/evp/evp_lib.c:307:5:
305. return -1;
306. }
307. > return md->md_size;
308. }
309.
crypto/evp/evp_lib.c:308:1: return from a call to EVP_MD_size
306. }
307. return md->md_size;
308. > }
309.
310. unsigned long EVP_MD_flags(const EVP_MD *md)
ssl/ssl_lib.c:306:23: Taking false branch
304. }
305.
306. if (md != NULL && dlen != (size_t)EVP_MD_size(md)) {
^
307. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
308. return 0;
ssl/ssl_lib.c:310:10: Taking false branch
308. return 0;
309. }
310. if (!data) {
^
311. SSLerr(SSL_F_DANE_TLSA_ADD, SSL_R_DANE_TLSA_NULL_DATA);
312. return 0;
ssl/ssl_lib.c:315:9:
313. }
314.
315. > if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
316. SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
317. return -1;
crypto/mem.c:98:1: start of procedure CRYPTO_zalloc()
96. }
97.
98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
99. {
100. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:100:5:
98. void *CRYPTO_zalloc(size_t num, const char *file, int line)
99. {
100. > void *ret = CRYPTO_malloc(num, file, line);
101.
102. if (ret != NULL)
crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
69. }
70.
71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
72. {
73. void *ret = NULL;
crypto/mem.c:73:5:
71. void *CRYPTO_malloc(size_t num, const char *file, int line)
72. {
73. > void *ret = NULL;
74.
75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:75:9: Taking false branch
73. void *ret = NULL;
74.
75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
76. return malloc_impl(num, file, line);
77.
crypto/mem.c:78:9: Taking false branch
76. return malloc_impl(num, file, line);
77.
78. if (num <= 0)
^
79. return NULL;
80.
crypto/mem.c:81:5:
79. return NULL;
80.
81. > allow_customize = 0;
82. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
83. if (call_malloc_debug) {
crypto/mem.c:91:5:
89. }
90. #else
91. > osslargused(file); osslargused(line);
92. ret = malloc(num);
93. #endif
crypto/mem.c:91:24:
89. }
90. #else
91. > osslargused(file); osslargused(line);
92. ret = malloc(num);
93. #endif
crypto/mem.c:92:5:
90. #else
91. osslargused(file); osslargused(line);
92. > ret = malloc(num);
93. #endif
94.
crypto/mem.c:95:5:
93. #endif
94.
95. > return ret;
96. }
97.
crypto/mem.c:96:1: return from a call to CRYPTO_malloc
94.
95. return ret;
96. > }
97.
98. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:102:9: Taking true branch
100. void *ret = CRYPTO_malloc(num, file, line);
101.
102. if (ret != NULL)
^
103. memset(ret, 0, num);
104. return ret;
crypto/mem.c:103:9:
101.
102. if (ret != NULL)
103. > memset(ret, 0, num);
104. return ret;
105. }
crypto/mem.c:104:5:
102. if (ret != NULL)
103. memset(ret, 0, num);
104. > return ret;
105. }
106.
crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
103. memset(ret, 0, num);
104. return ret;
105. > }
106.
107. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
ssl/ssl_lib.c:315:9: Taking false branch
313. }
314.
315. if ((t = OPENSSL_zalloc(sizeof(*t))) == NULL) {
^
316. SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
317. return -1;
ssl/ssl_lib.c:320:5:
318. }
319.
320. > t->usage = usage;
321. t->selector = selector;
322. t->mtype = mtype;
ssl/ssl_lib.c:321:5:
319.
320. t->usage = usage;
321. > t->selector = selector;
322. t->mtype = mtype;
323. t->data = OPENSSL_malloc(ilen);
ssl/ssl_lib.c:322:5:
320. t->usage = usage;
321. t->selector = selector;
322. > t->mtype = mtype;
323. t->data = OPENSSL_malloc(ilen);
324. if (t->data == NULL) {
ssl/ssl_lib.c:323:5:
321. t->selector = selector;
322. t->mtype = mtype;
323. > t->data = OPENSSL_malloc(ilen);
324. if (t->data == NULL) {
325. tlsa_free(t);
crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
69. }
70.
71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
72. {
73. void *ret = NULL;
crypto/mem.c:73:5:
71. void *CRYPTO_malloc(size_t num, const char *file, int line)
72. {
73. > void *ret = NULL;
74.
75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:75:9: Taking true branch
73. void *ret = NULL;
74.
75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
76. return malloc_impl(num, file, line);
77.
crypto/mem.c:75:32: Taking true branch
73. void *ret = NULL;
74.
75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
76. return malloc_impl(num, file, line);
77.
crypto/mem.c:76:9: Skipping __function_pointer__(): unresolved function pointer
74.
75. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
76. return malloc_impl(num, file, line);
^
77.
78. if (num <= 0)
crypto/mem.c:96:1: return from a call to CRYPTO_malloc
94.
95. return ret;
96. > }
97.
98. void *CRYPTO_zalloc(size_t num, const char *file, int line)
ssl/ssl_lib.c:324:9: Taking true branch
322. t->mtype = mtype;
323. t->data = OPENSSL_malloc(ilen);
324. if (t->data == NULL) {
^
325. tlsa_free(t);
326. SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
ssl/ssl_lib.c:325:9: Skipping tlsa_free(): empty list of specs
323. t->data = OPENSSL_malloc(ilen);
324. if (t->data == NULL) {
325. tlsa_free(t);
^
326. SSLerr(SSL_F_DANE_TLSA_ADD, ERR_R_MALLOC_FAILURE);
327. return -1;
|
https://github.com/openssl/openssl/blob/3307000d9852acac98ebc1b82cacc9b14240d798/ssl/ssl_lib.c/#L325
|
d2a_code_trace_data_41624
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/bntest.c:546: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_sqr`.
Showing all 17 steps of the trace
test/bntest.c:546:13: Call
544. BN_bntest_rand(a, 1024, 0, 0);
545. for (j = 0; j < 2; j++) {
546. BN_GF2m_mod_sqr(c, a, b[j], ctx);
^
547. BN_copy(d, a);
548. BN_GF2m_mod_mul(d, a, d, b[j], ctx);
crypto/bn/bn_gf2m.c:532:1: Parameter `ctx->stack.depth`
530. * use the BN_GF2m_mod_sqr_arr function.
531. */
532. > int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
533. {
534. int ret = 0;
test/bntest.c:548:13: Call
546. BN_GF2m_mod_sqr(c, a, b[j], ctx);
547. BN_copy(d, a);
548. BN_GF2m_mod_mul(d, a, d, b[j], ctx);
^
549. BN_GF2m_add(d, c, d);
550. /* Test that a*a = a^2. */
crypto/bn/bn_gf2m.c:473:1: Parameter `ctx->stack.depth`
471. * BN_GF2m_mod_mul_arr function.
472. */
473. > int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
474. const BIGNUM *p, BN_CTX *ctx)
475. {
test/bntest.c:546:13: Call
544. BN_bntest_rand(a, 1024, 0, 0);
545. for (j = 0; j < 2; j++) {
546. BN_GF2m_mod_sqr(c, a, b[j], ctx);
^
547. BN_copy(d, a);
548. BN_GF2m_mod_mul(d, a, d, b[j], ctx);
crypto/bn/bn_gf2m.c:532:1: Parameter `ctx->stack.depth`
530. * use the BN_GF2m_mod_sqr_arr function.
531. */
532. > int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
533. {
534. int ret = 0;
crypto/bn/bn_gf2m.c:547:11: Call
545. goto err;
546. }
547. ret = BN_GF2m_mod_sqr_arr(r, a, arr, ctx);
^
548. bn_check_top(r);
549. err:
crypto/bn/bn_gf2m.c:504:5: Call
502.
503. bn_check_top(a);
504. BN_CTX_start(ctx);
^
505. if ((s = BN_CTX_get(ctx)) == NULL)
506. goto err;
crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gf2m.c:522:5: Call
520. ret = 1;
521. err:
522. BN_CTX_end(ctx);
^
523. return ret;
524. }
crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes`
193. }
194.
195. > void BN_CTX_end(BN_CTX *ctx)
196. {
197. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:201:27: Call
199. ctx->err_stack--;
200. else {
201. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
202. /* Does this stack frame have anything to release? */
203. if (fp < ctx->used)
crypto/bn/bn_ctx.c:271:1: <Offset trace>
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: Parameter `st->depth`
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: <Length trace>
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes`
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_sqr`
271. static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
^
274. }
275.
|
https://github.com/openssl/openssl/blob/0282aeb690d63fab73a07191b63300a2fe30d212/crypto/bn/bn_ctx.c/#L273
|
d2a_code_trace_data_41625
|
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)
{
uint32_t alg_mkey, alg_auth, alg_enc, alg_mac, algo_strength;
int min_tls;
const char *l, *buf;
int j, multi, found, rule, retval, ok, buflen;
uint32_t 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;
min_tls = 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((unsigned char)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) == 0
&& (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_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]->algo_strength & SSL_DEFAULT_MASK) {
if (algo_strength & SSL_DEFAULT_MASK) {
algo_strength &=
(ca_list[j]->algo_strength & SSL_DEFAULT_MASK) |
~SSL_DEFAULT_MASK;
if (!(algo_strength & SSL_DEFAULT_MASK)) {
found = 0;
break;
}
} else {
algo_strength |=
ca_list[j]->algo_strength & SSL_DEFAULT_MASK;
}
}
if (ca_list[j]->valid) {
cipher_id = ca_list[j]->id;
} else {
if (ca_list[j]->min_tls) {
if (min_tls != 0 && min_tls != ca_list[j]->min_tls) {
found = 0;
break;
} else {
min_tls = ca_list[j]->min_tls;
}
}
}
if (!multi)
break;
}
if (rule == CIPHER_SPECIAL) {
ok = 0;
if ((buflen == 8) && strncmp(buf, "STRENGTH", 8) == 0) {
ok = ssl_cipher_strength_sort(head_p, tail_p);
} else if (buflen == 10 && strncmp(buf, "SECLEVEL=", 9) == 0) {
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,
min_tls, algo_strength, rule, -1, head_p,
tail_p);
} else {
while ((*l != '\0') && !ITEM_SEP(*l))
l++;
}
if (*l == '\0')
break;
}
return retval;
}
test/cipherlist_test.c:211: error: BUFFER_OVERRUN_L1
Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: 8 by call to `SSL_CTX_set_cipher_list`.
Showing all 13 steps of the trace
test/cipherlist_test.c:211:10: Call
209. if (fixture == NULL)
210. return 0;
211. if (!TEST_true(SSL_CTX_set_cipher_list(fixture->server, "DEFAULT"))
^
212. || !TEST_true(SSL_CTX_set_cipher_list(fixture->client, "DEFAULT")))
213. tear_down(fixture);
ssl/ssl_lib.c:2511:1: Parameter `*str`
2509.
2510. /** specify the ciphers to be used by default by the SSL_CTX */
2511. > int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str)
2512. {
2513. STACK_OF(SSL_CIPHER) *sk;
ssl/ssl_lib.c:2515:10: Call
2513. STACK_OF(SSL_CIPHER) *sk;
2514.
2515. sk = ssl_create_cipher_list(ctx->method, ctx->tls13_ciphersuites,
^
2516. &ctx->cipher_list, &ctx->cipher_list_by_id, str,
2517. ctx->cert);
ssl/ssl_ciph.c:1403:1: Parameter `*rule_str`
1401. }
1402.
1403. > STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
1404. STACK_OF(SSL_CIPHER) *tls13_ciphersuites,
1405. STACK_OF(SSL_CIPHER) **cipher_list,
ssl/ssl_ciph.c:1423:10: Call
1421. return NULL;
1422. #ifndef OPENSSL_NO_EC
1423. if (!check_suiteb_cipher_list(ssl_method, c, &rule_str))
^
1424. return NULL;
1425. #endif
ssl/ssl_ciph.c:1223:1: Parameter `**prule_str`
1221.
1222. #ifndef OPENSSL_NO_EC
1223. > static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c,
1224. const char **prule_str)
1225. {
ssl/ssl_ciph.c:1572:5: Assignment
1570. */
1571. ok = 1;
1572. rule_p = rule_str;
^
1573. if (strncmp(rule_str, "DEFAULT", 7) == 0) {
1574. ok = ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST,
ssl/ssl_ciph.c:1582:14: Call
1580.
1581. if (ok && (strlen(rule_p) > 0))
1582. ok = ssl_cipher_process_rulestr(rule_p, &head, &tail, ca_list, c);
^
1583.
1584. OPENSSL_free(ca_list); /* Not needed anymore */
ssl/ssl_ciph.c:958:1: <Length trace>
956. }
957.
958. > static int ssl_cipher_process_rulestr(const char *rule_str,
959. CIPHER_ORDER **head_p,
960. CIPHER_ORDER **tail_p,
ssl/ssl_ciph.c:958:1: Parameter `*rule_str`
956. }
957.
958. > static int ssl_cipher_process_rulestr(const char *rule_str,
959. CIPHER_ORDER **head_p,
960. CIPHER_ORDER **tail_p,
ssl/ssl_ciph.c:971:5: Assignment
969.
970. retval = 1;
971. l = rule_str;
^
972. for ( ; ; ) {
973. ch = *l;
ssl/ssl_ciph.c:1007:13: Assignment
1005. for (;;) {
1006. ch = *l;
1007. buf = l;
^
1008. buflen = 0;
1009. #ifndef CHARSET_EBCDIC
ssl/ssl_ciph.c:1185:29: Array access: Offset: [9, +oo] (⇐ [0, +oo] + 9) Size: 8 by call to `SSL_CTX_set_cipher_list`
1183. ok = ssl_cipher_strength_sort(head_p, tail_p);
1184. } else if (buflen == 10 && strncmp(buf, "SECLEVEL=", 9) == 0) {
1185. int level = buf[9] - '0';
^
1186. if (level < 0 || level > 5) {
1187. SSLerr(SSL_F_SSL_CIPHER_PROCESS_RULESTR,
|
https://github.com/openssl/openssl/blob/4845aeba4c49e1bd65259a5014d7e3ab38657d42/ssl/ssl_ciph.c/#L1185
|
d2a_code_trace_data_41626
|
static int split_field_copy(Picture *dest, Picture *src, int parity, int id_add)
{
int match = !!(src->reference & parity);
if (match) {
COPY_PICTURE(dest, src);
if (parity != PICT_FRAME) {
pic_as_field(dest, parity);
dest->pic_id *= 2;
dest->pic_id += id_add;
}
}
return match;
}
libavcodec/h264_refs.c:137: error: Buffer Overrun L2
Offset: [0, 64] Size: 2 by call to `build_def_list`.
libavcodec/h264_refs.c:116:1: Parameter `h->default_ref_list[*]`
114. }
115.
116. int ff_h264_fill_default_ref_list(H264Context *h)
^
117. {
118. int i, len;
libavcodec/h264_refs.c:137:20: Call
135. len = build_def_list(h->default_ref_list[list], FF_ARRAY_ELEMS(h->default_ref_list[0]),
136. sorted, len, 0, h->picture_structure);
137. len += build_def_list(h->default_ref_list[list] + len,
^
138. FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,
139. h->long_ref, 16, 1, h->picture_structure);
libavcodec/h264_refs.c:70:1: Parameter `def_len`
68. }
69.
70. static int build_def_list(Picture *def, int def_len,
^
71. Picture **in, int len, int is_long, int sel)
72. {
libavcodec/h264_refs.c:83:13: Call
81. if (i[0] < len && index < def_len) {
82. in[i[0]]->pic_id = is_long ? i[0] : in[i[0]]->frame_num;
83. split_field_copy(&def[index++], in[i[0]++], sel, 1);
^
84. }
85. if (i[1] < len && index < def_len) {
libavcodec/h264_refs.c:54:1: <Length trace>
52. }
53.
54. static int split_field_copy(Picture *dest, Picture *src, int parity, int id_add)
^
55. {
56. int match = !!(src->reference & parity);
libavcodec/h264_refs.c:54:1: Parameter `*dest`
52. }
53.
54. static int split_field_copy(Picture *dest, Picture *src, int parity, int id_add)
^
55. {
56. int match = !!(src->reference & parity);
libavcodec/h264_refs.c:59:9: Array access: Offset: [0, 64] Size: 2 by call to `build_def_list`
57.
58. if (match) {
59. COPY_PICTURE(dest, src);
^
60. if (parity != PICT_FRAME) {
61. pic_as_field(dest, parity);
|
https://github.com/libav/libav/blob/0673ede985a6560e7efb86dab1c58fb7f95ce587/libavcodec/h264_refs.c/#L59
|
d2a_code_trace_data_41627
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/bntest.c:1368: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_div`.
Showing all 13 steps of the trace
test/bntest.c:1368:10: Call
1366. goto err;
1367.
1368. if (!TEST_true(BN_div(ret, ret2, a, b, ctx))
^
1369. || !equalBN("A / B", quotient, ret)
1370. || !equalBN("A % B", remainder, ret2)
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_div`
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_41628
|
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;
ret= s->oformat->write_packet(s, &pkt);
av_free_packet(&pkt);
if(ret<0)
goto fail;
}
if(s->oformat->write_trailer)
ret = s->oformat->write_trailer(s);
fail:
for(i=0;i<s->nb_streams;i++) {
av_freep(&s->streams[i]->priv_data);
av_freep(&s->streams[i]->index_entries);
}
if (s->iformat && s->iformat->priv_class)
av_opt_free(s->priv_data);
av_freep(&s->priv_data);
return ret;
}
libavformat/utils.c:3103: error: Uninitialized Value
The value read from ret was never initialized.
libavformat/utils.c:3103:5:
3101. av_opt_free(s->priv_data);
3102. av_freep(&s->priv_data);
3103. return ret;
^
3104. }
3105.
|
https://github.com/libav/libav/blob/171ae1eb0da284dec03c996ac68920823a71644d/libavformat/utils.c/#L3103
|
d2a_code_trace_data_41629
|
static int update_dimensions(VP8Context *s, int width, int height)
{
int i;
if (avcodec_check_dimensions(s->avctx, width, height))
return AVERROR_INVALIDDATA;
vp8_decode_flush(s->avctx);
avcodec_set_dimensions(s->avctx, width, height);
s->mb_width = (s->avctx->coded_width +15) / 16;
s->mb_height = (s->avctx->coded_height+15) / 16;
s->mb_stride = s->mb_width+1;
s->b4_stride = 4*s->mb_stride;
s->macroblocks_base = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));
s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1));
s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
s->macroblocks = s->macroblocks_base + 1 + s->mb_stride;
s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
memset(s->intra4x4_pred_mode_base, DC_PRED, s->b4_stride);
for (i = 0; i < 4*s->mb_height; i++)
s->intra4x4_pred_mode[i*s->b4_stride-1] = DC_PRED;
return 0;
}
libavcodec/vp8.c:231: error: Null Dereference
pointer `s->intra4x4_pred_mode_base` last assigned on line 225 could be null and is dereferenced by call to `memset()` at line 231, column 5.
libavcodec/vp8.c:205:1: start of procedure update_dimensions()
203. }
204.
205. static int update_dimensions(VP8Context *s, int width, int height)
^
206. {
207. int i;
libavcodec/vp8.c:209:9:
207. int i;
208.
209. if (avcodec_check_dimensions(s->avctx, width, height))
^
210. return AVERROR_INVALIDDATA;
211.
libavcodec/utils.c:222:1: start of procedure avcodec_check_dimensions()
220. }
221.
222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
^
223. if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
224. return 0;
libavcodec/utils.c:223:8: Taking true branch
221.
222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
223. if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
^
224. return 0;
225.
libavcodec/utils.c:223:20: Taking true branch
221.
222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
223. if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
^
224. return 0;
225.
libavcodec/utils.c:223:32: Taking true branch
221.
222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
223. if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
^
224. return 0;
225.
libavcodec/utils.c:224:9:
222. int avcodec_check_dimensions(void *av_log_ctx, unsigned int w, unsigned int h){
223. if((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8)
224. return 0;
^
225.
226. av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
libavcodec/utils.c:228:1: return from a call to avcodec_check_dimensions
226. av_log(av_log_ctx, AV_LOG_ERROR, "picture size invalid (%ux%u)\n", w, h);
227. return AVERROR(EINVAL);
228. }
^
229.
230. int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
libavcodec/vp8.c:209:9: Taking false branch
207. int i;
208.
209. if (avcodec_check_dimensions(s->avctx, width, height))
^
210. return AVERROR_INVALIDDATA;
211.
libavcodec/vp8.c:212:5: Skipping vp8_decode_flush(): empty list of specs
210. return AVERROR_INVALIDDATA;
211.
212. vp8_decode_flush(s->avctx);
^
213.
214. avcodec_set_dimensions(s->avctx, width, height);
libavcodec/vp8.c:214:5:
212. vp8_decode_flush(s->avctx);
213.
214. avcodec_set_dimensions(s->avctx, width, height);
^
215.
216. s->mb_width = (s->avctx->coded_width +15) / 16;
libavcodec/utils.c:109:1: start of procedure avcodec_set_dimensions()
107. }
108.
109. void avcodec_set_dimensions(AVCodecContext *s, int width, int height){
^
110. s->coded_width = width;
111. s->coded_height= height;
libavcodec/utils.c:110:5:
108.
109. void avcodec_set_dimensions(AVCodecContext *s, int width, int height){
110. s->coded_width = width;
^
111. s->coded_height= height;
112. s->width = -((-width )>>s->lowres);
libavcodec/utils.c:111:5:
109. void avcodec_set_dimensions(AVCodecContext *s, int width, int height){
110. s->coded_width = width;
111. s->coded_height= height;
^
112. s->width = -((-width )>>s->lowres);
113. s->height= -((-height)>>s->lowres);
libavcodec/utils.c:112:5:
110. s->coded_width = width;
111. s->coded_height= height;
112. s->width = -((-width )>>s->lowres);
^
113. s->height= -((-height)>>s->lowres);
114. }
libavcodec/utils.c:113:5:
111. s->coded_height= height;
112. s->width = -((-width )>>s->lowres);
113. s->height= -((-height)>>s->lowres);
^
114. }
115.
libavcodec/utils.c:114:1: return from a call to avcodec_set_dimensions
112. s->width = -((-width )>>s->lowres);
113. s->height= -((-height)>>s->lowres);
114. }
^
115.
116. typedef struct InternalBuffer{
libavcodec/vp8.c:216:5:
214. avcodec_set_dimensions(s->avctx, width, height);
215.
216. s->mb_width = (s->avctx->coded_width +15) / 16;
^
217. s->mb_height = (s->avctx->coded_height+15) / 16;
218.
libavcodec/vp8.c:217:5:
215.
216. s->mb_width = (s->avctx->coded_width +15) / 16;
217. s->mb_height = (s->avctx->coded_height+15) / 16;
^
218.
219. // we allocate a border around the top/left of intra4x4 modes
libavcodec/vp8.c:221:5:
219. // we allocate a border around the top/left of intra4x4 modes
220. // this is 4 blocks for intra4x4 to keep 4-byte alignment for fill_rectangle
221. s->mb_stride = s->mb_width+1;
^
222. s->b4_stride = 4*s->mb_stride;
223.
libavcodec/vp8.c:222:5:
220. // this is 4 blocks for intra4x4 to keep 4-byte alignment for fill_rectangle
221. s->mb_stride = s->mb_width+1;
222. s->b4_stride = 4*s->mb_stride;
^
223.
224. s->macroblocks_base = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));
libavcodec/vp8.c:224:5:
222. s->b4_stride = 4*s->mb_stride;
223.
224. s->macroblocks_base = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));
^
225. s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1));
226. s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
libavutil/mem.c:157:1: start of procedure av_mallocz()
155. }
156.
157. void *av_mallocz(unsigned int size)
^
158. {
159. void *ptr = av_malloc(size);
libavutil/mem.c:159:5:
157. void *av_mallocz(unsigned int size)
158. {
159. void *ptr = av_malloc(size);
^
160. if (ptr)
161. 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(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 true branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-16) )
^
73. return NULL;
74.
libavutil/mem.c:73:9:
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-16) )
73. return NULL;
^
74.
75. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:117:1: return from a call to av_malloc
115. #endif
116. return ptr;
117. }
^
118.
119. void *av_realloc(void *ptr, unsigned int size)
libavutil/mem.c:160:9: Taking false branch
158. {
159. void *ptr = av_malloc(size);
160. if (ptr)
^
161. memset(ptr, 0, size);
162. return ptr;
libavutil/mem.c:162:5:
160. if (ptr)
161. memset(ptr, 0, size);
162. return ptr;
^
163. }
164.
libavutil/mem.c:163:1: return from a call to av_mallocz
161. memset(ptr, 0, size);
162. return ptr;
163. }
^
164.
165. char *av_strdup(const char *s)
libavcodec/vp8.c:225:5:
223.
224. s->macroblocks_base = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));
225. s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1));
^
226. s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
227.
libavutil/mem.c:157:1: start of procedure av_mallocz()
155. }
156.
157. void *av_mallocz(unsigned int size)
^
158. {
159. void *ptr = av_malloc(size);
libavutil/mem.c:159:5:
157. void *av_mallocz(unsigned int size)
158. {
159. void *ptr = av_malloc(size);
^
160. if (ptr)
161. 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(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 true branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-16) )
^
73. return NULL;
74.
libavutil/mem.c:73:9:
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-16) )
73. return NULL;
^
74.
75. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:117:1: return from a call to av_malloc
115. #endif
116. return ptr;
117. }
^
118.
119. void *av_realloc(void *ptr, unsigned int size)
libavutil/mem.c:160:9: Taking false branch
158. {
159. void *ptr = av_malloc(size);
160. if (ptr)
^
161. memset(ptr, 0, size);
162. return ptr;
libavutil/mem.c:162:5:
160. if (ptr)
161. memset(ptr, 0, size);
162. return ptr;
^
163. }
164.
libavutil/mem.c:163:1: return from a call to av_mallocz
161. memset(ptr, 0, size);
162. return ptr;
163. }
^
164.
165. char *av_strdup(const char *s)
libavcodec/vp8.c:226:5:
224. s->macroblocks_base = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks));
225. s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1));
226. s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
^
227.
228. s->macroblocks = s->macroblocks_base + 1 + s->mb_stride;
libavutil/mem.c:157:1: start of procedure av_mallocz()
155. }
156.
157. void *av_mallocz(unsigned int size)
^
158. {
159. void *ptr = av_malloc(size);
libavutil/mem.c:159:5:
157. void *av_mallocz(unsigned int size)
158. {
159. void *ptr = av_malloc(size);
^
160. if (ptr)
161. 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(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 true branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-16) )
^
73. return NULL;
74.
libavutil/mem.c:73:9:
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-16) )
73. return NULL;
^
74.
75. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:117:1: return from a call to av_malloc
115. #endif
116. return ptr;
117. }
^
118.
119. void *av_realloc(void *ptr, unsigned int size)
libavutil/mem.c:160:9: Taking false branch
158. {
159. void *ptr = av_malloc(size);
160. if (ptr)
^
161. memset(ptr, 0, size);
162. return ptr;
libavutil/mem.c:162:5:
160. if (ptr)
161. memset(ptr, 0, size);
162. return ptr;
^
163. }
164.
libavutil/mem.c:163:1: return from a call to av_mallocz
161. memset(ptr, 0, size);
162. return ptr;
163. }
^
164.
165. char *av_strdup(const char *s)
libavcodec/vp8.c:228:5:
226. s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz));
227.
228. s->macroblocks = s->macroblocks_base + 1 + s->mb_stride;
^
229. s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
230.
libavcodec/vp8.c:229:5:
227.
228. s->macroblocks = s->macroblocks_base + 1 + s->mb_stride;
229. s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
^
230.
231. memset(s->intra4x4_pred_mode_base, DC_PRED, s->b4_stride);
libavcodec/vp8.c:231:5:
229. s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;
230.
231. memset(s->intra4x4_pred_mode_base, DC_PRED, s->b4_stride);
^
232. for (i = 0; i < 4*s->mb_height; i++)
233. s->intra4x4_pred_mode[i*s->b4_stride-1] = DC_PRED;
|
https://github.com/libav/libav/blob/ac014798ff719c69a895aff0189a794ed9046554/libavcodec/vp8.c/#L231
|
d2a_code_trace_data_41630
|
int RAND_poll(void)
{
int ret = 0;
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth == RAND_OpenSSL()) {
RAND_DRBG *drbg = RAND_DRBG_get0_master();
if (drbg == NULL)
return 0;
rand_drbg_lock(drbg);
ret = rand_drbg_restart(drbg, NULL, 0, 0);
rand_drbg_unlock(drbg);
return ret;
} else {
RAND_POOL *pool = NULL;
pool = rand_pool_new(RAND_DRBG_STRENGTH,
(RAND_DRBG_STRENGTH + 7) / 8,
RAND_POOL_MAX_LENGTH);
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:343: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 315 could be null and is dereferenced at line 343, column 13.
Showing all 24 steps of the trace
crypto/rand/rand_lib.c:311:1: start of procedure RAND_poll()
309. * configurable via the --with-rand-seed configure option.
310. */
311. > int RAND_poll(void)
312. {
313. int ret = 0;
crypto/rand/rand_lib.c:313:5:
311. int RAND_poll(void)
312. {
313. > int ret = 0;
314.
315. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:315:5:
313. int ret = 0;
314.
315. > const RAND_METHOD *meth = RAND_get_rand_method();
316.
317. if (meth == RAND_OpenSSL()) {
crypto/rand/rand_lib.c:671:1: start of procedure RAND_get_rand_method()
669. #endif
670.
671. > const RAND_METHOD *RAND_get_rand_method(void)
672. {
673. #ifdef FIPS_MODE
crypto/rand/rand_lib.c:676:5:
674. return NULL;
675. #else
676. > const RAND_METHOD *tmp_meth = NULL;
677.
678. if (!RUN_ONCE(&rand_init, do_rand_init))
crypto/rand/rand_lib.c:678:10:
676. const RAND_METHOD *tmp_meth = NULL;
677.
678. > if (!RUN_ONCE(&rand_init, do_rand_init))
679. return NULL;
680.
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:678:10: Condition is false
676. const RAND_METHOD *tmp_meth = NULL;
677.
678. if (!RUN_ONCE(&rand_init, do_rand_init))
^
679. return NULL;
680.
crypto/rand/rand_lib.c:678:10: Taking true branch
676. const RAND_METHOD *tmp_meth = NULL;
677.
678. if (!RUN_ONCE(&rand_init, do_rand_init))
^
679. return NULL;
680.
crypto/rand/rand_lib.c:679:9:
677.
678. if (!RUN_ONCE(&rand_init, do_rand_init))
679. > return NULL;
680.
681. CRYPTO_THREAD_write_lock(rand_meth_lock);
crypto/rand/rand_lib.c:703:1: return from a call to RAND_get_rand_method
701. return tmp_meth;
702. #endif
703. > }
704.
705. #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)
crypto/rand/rand_lib.c:317:9:
315. const RAND_METHOD *meth = RAND_get_rand_method();
316.
317. > if (meth == RAND_OpenSSL()) {
318. /* fill random pool and seed the master DRBG */
319. RAND_DRBG *drbg = RAND_DRBG_get0_master();
crypto/rand/drbg_lib.c:1384:1: start of procedure RAND_OpenSSL()
1382. };
1383.
1384. > RAND_METHOD *RAND_OpenSSL(void)
1385. {
1386. #ifndef FIPS_MODE
crypto/rand/drbg_lib.c:1387:5:
1385. {
1386. #ifndef FIPS_MODE
1387. > return &rand_meth;
1388. #else
1389. return NULL;
crypto/rand/drbg_lib.c:1391:1: return from a call to RAND_OpenSSL
1389. return NULL;
1390. #endif
1391. > }
crypto/rand/rand_lib.c:317:9: Taking false branch
315. const RAND_METHOD *meth = RAND_get_rand_method();
316.
317. if (meth == RAND_OpenSSL()) {
^
318. /* fill random pool and seed the master DRBG */
319. RAND_DRBG *drbg = RAND_DRBG_get0_master();
crypto/rand/rand_lib.c:331:9:
329.
330. } else {
331. > RAND_POOL *pool = NULL;
332.
333. /* fill random pool and seed the current legacy RNG */
crypto/rand/rand_lib.c:334:9: Skipping rand_pool_new(): empty list of specs
332.
333. /* fill random pool and seed the current legacy RNG */
334. pool = rand_pool_new(RAND_DRBG_STRENGTH,
^
335. (RAND_DRBG_STRENGTH + 7) / 8,
336. RAND_POOL_MAX_LENGTH);
crypto/rand/rand_lib.c:337:13: Taking false branch
335. (RAND_DRBG_STRENGTH + 7) / 8,
336. RAND_POOL_MAX_LENGTH);
337. if (pool == NULL)
^
338. return 0;
339.
crypto/rand/rand_lib.c:340:13: Taking false branch
338. return 0;
339.
340. if (rand_pool_acquire_entropy(pool) == 0)
^
341. goto err;
342.
crypto/rand/rand_lib.c:343:13:
341. goto err;
342.
343. > if (meth->add == NULL
344. || meth->add(rand_pool_buffer(pool),
345. rand_pool_length(pool),
|
https://github.com/openssl/openssl/blob/37ca204b96b036f949b8bc8389c1f8e806e1cbec/crypto/rand/rand_lib.c/#L343
|
d2a_code_trace_data_41631
|
static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
pkt->curr += len;
pkt->remaining -= len;
}
test/servername_test.c:43: error: INTEGER_OVERFLOW_L2
([0, 9223372036854775807] - 4):unsigned64 by call to `PACKET_forward`.
Showing all 13 steps of the trace
test/servername_test.c:34:19: Assignment
32. long len;
33. unsigned char *data;
34. PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0}, pkt4 = {0}, pkt5 = {0};
^
35. unsigned int servname_type = 0, type = 0;
36. int ret = 0;
test/servername_test.c:39:10: Call
37.
38. len = BIO_get_mem_data(bio, (char **)&data);
39. if (!TEST_true(PACKET_buf_init(&pkt, data, len))
^
40. /* Skip the record header */
41. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
ssl/packet_locl.h:72:8: Parameter `pkt->remaining`
70. * is being used.
71. */
72. __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
^
73. const unsigned char *buf,
74. size_t len)
test/servername_test.c:41:17: Call
39. if (!TEST_true(PACKET_buf_init(&pkt, data, len))
40. /* Skip the record header */
41. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
^
42. /* Skip the handshake message header */
43. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH))
ssl/packet_locl.h:467:8: Parameter `len`
465.
466. /* Move the current reading position forward |len| bytes */
467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
468. {
469. if (PACKET_remaining(pkt) < len)
test/servername_test.c:43:17: Call
41. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
42. /* Skip the handshake message header */
43. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH))
^
44. /* Skip client version and random */
45. || !TEST_true(PACKET_forward(&pkt, CLIENT_VERSION_LEN
ssl/packet_locl.h:467:8: Parameter `len`
465.
466. /* Move the current reading position forward |len| bytes */
467. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
468. {
469. if (PACKET_remaining(pkt) < len)
ssl/packet_locl.h:472:5: Call
470. return 0;
471.
472. packet_forward(pkt, len);
^
473.
474. return 1;
ssl/packet_locl.h:33:1: <LHS trace>
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: Parameter `pkt->remaining`
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: <RHS trace>
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:33:1: Parameter `len`
31.
32. /* Internal unchecked shorthand; don't use outside this file. */
33. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
34. {
35. pkt->curr += len;
ssl/packet_locl.h:36:5: Binary operation: ([0, 9223372036854775807] - 4):unsigned64 by call to `PACKET_forward`
34. {
35. pkt->curr += len;
36. pkt->remaining -= len;
^
37. }
38.
|
https://github.com/openssl/openssl/blob/190b9a03b72a8029c27e4bd0ab000129e240a413/ssl/packet_locl.h/#L36
|
d2a_code_trace_data_41632
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/rsa/rsa_mp.c:87: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mul`.
Showing all 17 steps of the trace
crypto/rsa/rsa_mp.c:87:14: Call
85. goto err;
86. }
87. if (!BN_mul(pinfo->pp, p1, p2, ctx))
^
88. goto err;
89. /* save previous one */
crypto/bn/bn_mul.c:497:1: Parameter `ctx->stack.depth`
495. #endif /* BN_RECURSION */
496.
497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
498. {
499. int ret = bn_mul_fixed_top(r, a, b, ctx);
crypto/bn/bn_mul.c:499:15: Call
497. int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
498. {
499. int ret = bn_mul_fixed_top(r, a, b, ctx);
^
500.
501. bn_correct_top(r);
crypto/bn/bn_mul.c:507:1: Parameter `ctx->stack.depth`
505. }
506.
507. > int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
508. {
509. int ret = 0;
crypto/rsa/rsa_mp.c:87:14: Call
85. goto err;
86. }
87. if (!BN_mul(pinfo->pp, p1, p2, ctx))
^
88. goto err;
89. /* save previous one */
crypto/bn/bn_mul.c:497:1: Parameter `ctx->stack.depth`
495. #endif /* BN_RECURSION */
496.
497. > int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
498. {
499. int ret = bn_mul_fixed_top(r, a, b, ctx);
crypto/bn/bn_mul.c:499:15: Call
497. int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
498. {
499. int ret = bn_mul_fixed_top(r, a, b, ctx);
^
500.
501. bn_correct_top(r);
crypto/bn/bn_mul.c:533:5: Call
531. top = al + bl;
532.
533. BN_CTX_start(ctx);
^
534. if ((r == a) || (r == b)) {
535. if ((rr = BN_CTX_get(ctx)) == NULL)
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_mul.c:618:5: Call
616. err:
617. bn_check_top(r);
618. BN_CTX_end(ctx);
^
619. return ret;
620. }
crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.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_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_41633
|
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/ct/ct_prn.c:46: error: BUFFER_OVERRUN_L3
Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print`.
Showing all 11 steps of the trace
crypto/ct/ct_prn.c:36:5: Call
34. if (gen == NULL)
35. return;
36. ASN1_GENERALIZEDTIME_adj(gen, (time_t)0,
^
37. (int)(timestamp / 86400000),
38. (timestamp % 86400000) / 1000);
crypto/asn1/a_gentm.c:167:1: Parameter `*s->data`
165. }
166.
167. > ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
168. time_t t, int offset_day,
169. long offset_sec)
crypto/ct/ct_prn.c:45:9: Call
43. BIO_snprintf(genstr, sizeof(genstr), "%.14s.%03dZ",
44. ASN1_STRING_get0_data(gen), (unsigned int)(timestamp % 1000));
45. if (ASN1_GENERALIZEDTIME_set_string(gen, genstr))
^
46. ASN1_GENERALIZEDTIME_print(out, gen);
47. ASN1_GENERALIZEDTIME_free(gen);
crypto/asn1/a_gentm.c:142:1: Parameter `*s->data`
140. }
141.
142. > int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str)
143. {
144. ASN1_GENERALIZEDTIME t;
crypto/ct/ct_prn.c:46:9: Call
44. ASN1_STRING_get0_data(gen), (unsigned int)(timestamp % 1000));
45. if (ASN1_GENERALIZEDTIME_set_string(gen, genstr))
46. ASN1_GENERALIZEDTIME_print(out, gen);
^
47. ASN1_GENERALIZEDTIME_free(gen);
48. }
crypto/asn1/a_gentm.c:224:1: <Offset trace>
222. };
223.
224. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
225. {
226. char *v;
crypto/asn1/a_gentm.c:224:1: Parameter `*tm->data`
222. };
223.
224. > int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
225. {
226. char *v;
crypto/asn1/a_gentm.c:245:5: Assignment
243. y = (v[0] - '0') * 1000 + (v[1] - '0') * 100
244. + (v[2] - '0') * 10 + (v[3] - '0');
245. M = (v[4] - '0') * 10 + (v[5] - '0');
^
246. if ((M > 12) || (M < 1))
247. goto err;
crypto/asn1/a_gentm.c:219:1: <Length trace>
217. }
218.
219. > const char *_asn1_mon[12] = {
220. "Jan", "Feb", "Mar", "Apr", "May", "Jun",
221. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
crypto/asn1/a_gentm.c:219:1: Array declaration
217. }
218.
219. > const char *_asn1_mon[12] = {
220. "Jan", "Feb", "Mar", "Apr", "May", "Jun",
221. "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
crypto/asn1/a_gentm.c:266:20: Array access: Offset: [-529, +oo] Size: 12 by call to `ASN1_GENERALIZEDTIME_print`
264.
265. if (BIO_printf(bp, "%s %2d %02d:%02d:%02d%.*s %d%s",
266. _asn1_mon[M - 1], d, h, m, s, f_len, f, y,
^
267. (gmt) ? " GMT" : "") <= 0)
268. return (0);
|
https://github.com/openssl/openssl/blob/2238119751bb95efc1dfafabf0e70e86f71fc6f6/crypto/asn1/a_gentm.c/#L266
|
d2a_code_trace_data_41634
|
static void tls1_lookup_sigalg(int *phash_nid, int *psign_nid,
int *psignhash_nid, const unsigned char *data)
{
int sign_nid, hash_nid;
if (!phash_nid && !psign_nid && !psignhash_nid)
return;
if (phash_nid || psignhash_nid)
{
hash_nid = tls12_find_nid(data[0], tls12_md,
sizeof(tls12_md)/sizeof(tls12_lookup));
if (phash_nid)
*phash_nid = hash_nid;
}
if (psign_nid || psignhash_nid)
{
sign_nid = tls12_find_nid(data[1], tls12_sig,
sizeof(tls12_sig)/sizeof(tls12_lookup));
if (psign_nid)
*psign_nid = sign_nid;
}
if (psignhash_nid)
{
if (sign_nid && hash_nid)
OBJ_find_sigid_by_algs(psignhash_nid,
hash_nid, sign_nid);
else
*psignhash_nid = NID_undef;
}
}
ssl/t1_lib.c:2922: error: UNINITIALIZED_VALUE
The value read from sign_nid was never initialized.
Showing all 1 steps of the trace
ssl/t1_lib.c:2922:4:
2920. {
2921. if (sign_nid && hash_nid)
2922. > OBJ_find_sigid_by_algs(psignhash_nid,
2923. hash_nid, sign_nid);
2924. else
|
https://github.com/openssl/openssl/blob/be681e123c3582f7bef18ed41b5ffa4793e8c4f7/ssl/t1_lib.c/#L2922
|
d2a_code_trace_data_41635
|
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/ectest.c:1029: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_hex2bn`.
Showing all 21 steps of the trace
test/ectest.c:1029:13: Call
1027. || !TEST_ptr(a = BN_new())
1028. || !TEST_ptr(b = BN_new())
1029. || !TEST_true(BN_hex2bn(&p, "13"))
^
1030. || !TEST_true(BN_hex2bn(&a, "3"))
1031. || !TEST_true(BN_hex2bn(&b, "1")))
crypto/bn/bn_print.c:126:1: Parameter `(*bn)->top`
124. }
125.
126. > int BN_hex2bn(BIGNUM **bn, const char *a)
127. {
128. BIGNUM *ret = NULL;
crypto/bn/bn_print.c:157:9: Call
155. } else {
156. ret = *bn;
157. BN_zero(ret);
^
158. }
159.
crypto/bn/bn_lib.c:395:1: Parameter `a->top`
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->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:284:1: Parameter `b->top`
282. */
283.
284. > BIGNUM *bn_expand2(BIGNUM *b, int words)
285. {
286. bn_check_top(b);
crypto/bn/bn_lib.c:289:23: Call
287.
288. if (words > b->dmax) {
289. BN_ULONG *a = bn_expand_internal(b, words);
^
290. if (!a)
291. return NULL;
crypto/bn/bn_lib.c:246:1: <Offset trace>
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: Parameter `b->top`
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: <Length trace>
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: Parameter `words`
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:263:13: Call
261. a = OPENSSL_secure_zalloc(words * sizeof(*a));
262. else
263. a = OPENSSL_zalloc(words * sizeof(*a));
^
264. if (a == NULL) {
265. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/mem.c:186:1: Parameter `num`
184. }
185.
186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:188:17: Call
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
^
189.
190. FAILTEST();
crypto/mem.c:166:9: Assignment
164.
165. if (num == 0)
166. return NULL;
^
167.
168. FAILTEST();
crypto/mem.c:188:5: Assignment
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
^
189.
190. FAILTEST();
crypto/mem.c:193:5: Assignment
191. if (ret != NULL)
192. memset(ret, 0, num);
193. return ret;
^
194. }
195.
crypto/bn/bn_lib.c:263:9: Assignment
261. a = OPENSSL_secure_zalloc(words * sizeof(*a));
262. else
263. a = OPENSSL_zalloc(words * sizeof(*a));
^
264. if (a == NULL) {
265. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:271:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_hex2bn`
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/7671342e550ed2de676b23c79d0e7f45a381c76e/crypto/bn/bn_lib.c/#L271
|
d2a_code_trace_data_41636
|
int ff_h264_fill_default_ref_list(H264Context *h)
{
int i, len;
if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
Picture *sorted[32];
int cur_poc, list;
int lens[2];
if (FIELD_PICTURE(h))
cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];
else
cur_poc = h->cur_pic_ptr->poc;
for (list = 0; list < 2; list++) {
len = add_sorted(sorted, h->short_ref, h->short_ref_count, cur_poc, 1 ^ list);
len += add_sorted(sorted + len, h->short_ref, h->short_ref_count, cur_poc, 0 ^ list);
assert(len <= 32);
len = build_def_list(h->default_ref_list[list], FF_ARRAY_ELEMS(h->default_ref_list[0]),
sorted, len, 0, h->picture_structure);
len += build_def_list(h->default_ref_list[list] + len,
FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,
h->long_ref, 16, 1, h->picture_structure);
if (len < h->ref_count[list])
memset(&h->default_ref_list[list][len], 0, sizeof(Picture) * (h->ref_count[list] - len));
lens[list] = len;
}
if (lens[0] == lens[1] && lens[1] > 1) {
for (i = 0; i < lens[0] &&
h->default_ref_list[0][i].f.buf[0]->buffer ==
h->default_ref_list[1][i].f.buf[0]->buffer; i++);
if (i == lens[0]) {
Picture tmp;
COPY_PICTURE(&tmp, &h->default_ref_list[1][0]);
COPY_PICTURE(&h->default_ref_list[1][0], &h->default_ref_list[1][1]);
COPY_PICTURE(&h->default_ref_list[1][1], &tmp);
}
}
} else {
len = build_def_list(h->default_ref_list[0], FF_ARRAY_ELEMS(h->default_ref_list[0]),
h->short_ref, h->short_ref_count, 0, h->picture_structure);
len += build_def_list(h->default_ref_list[0] + len,
FF_ARRAY_ELEMS(h->default_ref_list[0]) - len,
h-> long_ref, 16, 1, h->picture_structure);
if (len < h->ref_count[0])
memset(&h->default_ref_list[0][len], 0, sizeof(Picture) * (h->ref_count[0] - len));
}
#ifdef TRACE
for (i = 0; i < h->ref_count[0]; i++) {
tprintf(h->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].f.data[0]);
}
if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
for (i = 0; i < h->ref_count[1]; i++) {
tprintf(h->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].f.data[0]);
}
}
#endif
return 0;
}
libavcodec/h264.c:3705: error: Integer Overflow L2
([0, +oo] - [0, 64]):unsigned32 by call to `ff_h264_fill_default_ref_list`.
libavcodec/h264.c:3289:1: Parameter `h->ref_count[*]`
3287. * @return 0 if okay, <0 if an error occurred, 1 if decoding must not be multithreaded
3288. */
3289. static int decode_slice_header(H264Context *h, H264Context *h0)
^
3290. {
3291. unsigned int first_mb_in_slice;
libavcodec/h264.c:3705:9: Call
3703.
3704. if (!default_ref_list_done)
3705. ff_h264_fill_default_ref_list(h);
^
3706.
3707. if (h->slice_type_nos != AV_PICTURE_TYPE_I) {
libavcodec/h264_refs.c:116:1: <LHS trace>
114. }
115.
116. int ff_h264_fill_default_ref_list(H264Context *h)
^
117. {
118. int i, len;
libavcodec/h264_refs.c:116:1: Parameter `h->ref_count[*]`
114. }
115.
116. int ff_h264_fill_default_ref_list(H264Context *h)
^
117. {
118. int i, len;
libavcodec/h264_refs.c:116:1: <RHS trace>
114. }
115.
116. int ff_h264_fill_default_ref_list(H264Context *h)
^
117. {
118. int i, len;
libavcodec/h264_refs.c:116:1: Parameter `h->ref_count[*]`
114. }
115.
116. int ff_h264_fill_default_ref_list(H264Context *h)
^
117. {
118. int i, len;
libavcodec/h264_refs.c:142:17: Binary operation: ([0, +oo] - [0, 64]):unsigned32 by call to `ff_h264_fill_default_ref_list`
140.
141. if (len < h->ref_count[list])
142. memset(&h->default_ref_list[list][len], 0, sizeof(Picture) * (h->ref_count[list] - len));
^
143. lens[list] = len;
144. }
|
https://github.com/libav/libav/blob/0673ede985a6560e7efb86dab1c58fb7f95ce587/libavcodec/h264_refs.c/#L142
|
d2a_code_trace_data_41637
|
void avformat_free_context(AVFormatContext *s)
{
int i;
AVStream *st;
av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data)
av_opt_free(s->priv_data);
for(i=0;i<s->nb_streams;i++) {
st = s->streams[i];
if (st->parser) {
av_parser_close(st->parser);
av_free_packet(&st->cur_pkt);
}
av_dict_free(&st->metadata);
av_free(st->index_entries);
av_free(st->codec->extradata);
av_free(st->codec->subtitle_header);
av_free(st->codec);
av_free(st->priv_data);
av_free(st->info);
av_free(st);
}
for(i=s->nb_programs-1; i>=0; i--) {
av_dict_free(&s->programs[i]->metadata);
av_freep(&s->programs[i]->stream_index);
av_freep(&s->programs[i]);
}
av_freep(&s->programs);
av_freep(&s->priv_data);
while(s->nb_chapters--) {
av_dict_free(&s->chapters[s->nb_chapters]->metadata);
av_free(s->chapters[s->nb_chapters]);
}
av_freep(&s->chapters);
av_dict_free(&s->metadata);
av_freep(&s->streams);
av_free(s);
}
avconv.c:3499: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `av_close_input_file`.
avconv.c:3496:13: Unknown value from: choose_pixel_fmt
3494. choose_sample_fmt(st, codec);
3495. else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && !ost->stream_copy)
3496. choose_pixel_fmt(st, codec);
^
3497. }
3498.
avconv.c:3499:5: Call
3497. }
3498.
3499. av_close_input_file(ic);
^
3500. return 0;
3501. }
libavformat/utils.c:2687:1: Parameter `s->nb_programs`
2685. }
2686.
2687. void av_close_input_file(AVFormatContext *s)
^
2688. {
2689. AVIOContext *pb = (s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ?
libavformat/utils.c:2691:5: Call
2689. AVIOContext *pb = (s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ?
2690. NULL : s->pb;
2691. av_close_input_stream(s);
^
2692. if (pb)
2693. avio_close(pb);
libavformat/utils.c:2637:1: Parameter `s->nb_programs`
2635. }
2636.
2637. void av_close_input_stream(AVFormatContext *s)
^
2638. {
2639. flush_packet_queue(s);
libavformat/utils.c:2642:5: Call
2640. if (s->iformat->read_close)
2641. s->iformat->read_close(s);
2642. avformat_free_context(s);
^
2643. }
2644.
libavformat/utils.c:2645:1: <LHS trace>
2643. }
2644.
2645. void avformat_free_context(AVFormatContext *s)
^
2646. {
2647. int i;
libavformat/utils.c:2645:1: Parameter `s->nb_programs`
2643. }
2644.
2645. void avformat_free_context(AVFormatContext *s)
^
2646. {
2647. int i;
libavformat/utils.c:2670:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `av_close_input_file`
2668. av_free(st);
2669. }
2670. for(i=s->nb_programs-1; i>=0; i--) {
^
2671. av_dict_free(&s->programs[i]->metadata);
2672. av_freep(&s->programs[i]->stream_index);
|
https://github.com/libav/libav/blob/86d3730360bf085f5ba35951350b3c8e8e804350/libavformat/utils.c/#L2670
|
d2a_code_trace_data_41638
|
static int kek_unwrap_key(unsigned char *out, size_t *outlen,
const unsigned char *in, size_t inlen,
EVP_CIPHER_CTX *ctx)
{
size_t blocklen = EVP_CIPHER_CTX_block_size(ctx);
unsigned char *tmp;
int outl, rv = 0;
if (inlen < 2 * blocklen) {
return 0;
}
if (inlen % blocklen) {
return 0;
}
tmp = OPENSSL_malloc(inlen);
if (tmp == NULL)
return 0;
if (!EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl,
in + inlen - 2 * blocklen, blocklen * 2)
|| !EVP_DecryptUpdate(ctx, tmp, &outl,
tmp + inlen - blocklen, blocklen)
|| !EVP_DecryptUpdate(ctx, tmp, &outl, in, inlen - blocklen)
|| !EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL)
|| !EVP_DecryptUpdate(ctx, tmp, &outl, tmp, inlen))
goto err;
if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) {
goto err;
}
if (inlen < (size_t)(tmp[0] - 4)) {
goto err;
}
*outlen = (size_t)tmp[0];
memcpy(out, tmp + 4, *outlen);
rv = 1;
err:
OPENSSL_clear_free(tmp, inlen);
return rv;
}
crypto/cms/cms_env.c:910: error: BUFFER_OVERRUN_L3
Offset: 6 Size: [1, +oo] by call to `CMS_RecipientInfo_encrypt`.
Showing all 13 steps of the trace
crypto/cms/cms_env.c:910:13: Call
908. for (i = 0; i < sk_CMS_RecipientInfo_num(rinfos); i++) {
909. ri = sk_CMS_RecipientInfo_value(rinfos, i);
910. if (CMS_RecipientInfo_encrypt(cms, ri) <= 0) {
^
911. CMSerr(CMS_F_CMS_ENVELOPEDDATA_INIT_BIO,
912. CMS_R_ERROR_SETTING_RECIPIENTINFO);
crypto/cms/cms_env.c:801:1: Parameter `ri->d.pwri->encryptedKey->length`
799. }
800.
801. > int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri)
802. {
803. switch (ri->type) {
crypto/cms/cms_env.c:910:13: Call
908. for (i = 0; i < sk_CMS_RecipientInfo_num(rinfos); i++) {
909. ri = sk_CMS_RecipientInfo_value(rinfos, i);
910. if (CMS_RecipientInfo_encrypt(cms, ri) <= 0) {
^
911. CMSerr(CMS_F_CMS_ENVELOPEDDATA_INIT_BIO,
912. CMS_R_ERROR_SETTING_RECIPIENTINFO);
crypto/cms/cms_env.c:801:1: Parameter `ri->d.pwri->encryptedKey->length`
799. }
800.
801. > int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri)
802. {
803. switch (ri->type) {
crypto/cms/cms_env.c:814:16: Call
812.
813. case CMS_RECIPINFO_PASS:
814. return cms_RecipientInfo_pwri_crypt(cms, ri, 1);
^
815.
816. default:
crypto/cms/cms_pwri.c:320:1: Parameter `ri->d.pwri->encryptedKey->length`
318. /* Encrypt/Decrypt content key in PWRI recipient info */
319.
320. > int cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri,
321. int en_de)
322. {
crypto/cms/cms_pwri.c:409:14: Call
407. goto err;
408. }
409. if (!kek_unwrap_key(key, &keylen,
^
410. pwri->encryptedKey->data,
411. pwri->encryptedKey->length, kekctx)) {
crypto/cms/cms_pwri.c:221:1: <Length trace>
219. */
220.
221. > static int kek_unwrap_key(unsigned char *out, size_t *outlen,
222. const unsigned char *in, size_t inlen,
223. EVP_CIPHER_CTX *ctx)
crypto/cms/cms_pwri.c:221:1: Parameter `inlen`
219. */
220.
221. > static int kek_unwrap_key(unsigned char *out, size_t *outlen,
222. const unsigned char *in, size_t inlen,
223. EVP_CIPHER_CTX *ctx)
crypto/cms/cms_pwri.c:236:11: Call
234. return 0;
235. }
236. tmp = OPENSSL_malloc(inlen);
^
237. if (tmp == NULL)
238. return 0;
crypto/mem.c:125:9: Assignment
123.
124. if (num <= 0)
125. return NULL;
^
126.
127. allow_customize = 0;
crypto/cms/cms_pwri.c:236:5: Assignment
234. return 0;
235. }
236. tmp = OPENSSL_malloc(inlen);
^
237. if (tmp == NULL)
238. return 0;
crypto/cms/cms_pwri.c:258:60: Array access: Offset: 6 Size: [1, +oo] by call to `CMS_RecipientInfo_encrypt`
256. goto err;
257. /* Check check bytes */
258. if (((tmp[1] ^ tmp[4]) & (tmp[2] ^ tmp[5]) & (tmp[3] ^ tmp[6])) != 0xff) {
^
259. /* Check byte failure */
260. goto err;
|
https://github.com/openssl/openssl/blob/846ec07d904f9cc81d486db0db14fb84f61ff6e5/crypto/cms/cms_pwri.c/#L258
|
d2a_code_trace_data_41639
|
static int flv_write_header(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
FLVContext *flv = s->priv_data;
int i, width, height, samplerate, samplesize, channels, audiocodecid, videocodecid;
double framerate = 0.0;
int metadata_size_pos, data_size;
flv->hasAudio = 0;
flv->hasVideo = 0;
for(i=0; i<s->nb_streams; i++){
AVCodecContext *enc = s->streams[i]->codec;
if (enc->codec_type == CODEC_TYPE_VIDEO) {
width = enc->width;
height = enc->height;
if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) {
framerate = av_q2d(s->streams[i]->r_frame_rate);
} else {
framerate = 1/av_q2d(s->streams[i]->codec->time_base);
}
flv->hasVideo=1;
videocodecid = enc->codec_tag;
if(videocodecid == 0) {
av_log(enc, AV_LOG_ERROR, "video codec not compatible with flv\n");
return -1;
}
} else {
flv->hasAudio=1;
samplerate = enc->sample_rate;
channels = enc->channels;
audiocodecid = enc->codec_tag;
samplesize = (enc->codec_id == CODEC_ID_PCM_S8) ? 8 : 16;
if(get_audio_flags(enc)<0)
return -1;
}
av_set_pts_info(s->streams[i], 24, 1, 1000);
}
put_tag(pb,"FLV");
put_byte(pb,1);
put_byte(pb, FLV_HEADER_FLAG_HASAUDIO * flv->hasAudio
+ FLV_HEADER_FLAG_HASVIDEO * flv->hasVideo);
put_be32(pb,9);
put_be32(pb,0);
for(i=0; i<s->nb_streams; i++){
if(s->streams[i]->codec->codec_tag == 5){
put_byte(pb,8);
put_be24(pb,0);
put_be24(pb,0);
put_be32(pb,0);
put_be32(pb,11);
flv->reserved=5;
}
}
put_byte(pb, 18);
metadata_size_pos= url_ftell(pb);
put_be24(pb, 0);
put_be24(pb, 0);
put_be32(pb, 0);
put_byte(pb, AMF_DATA_TYPE_STRING);
put_amf_string(pb, "onMetaData");
put_byte(pb, AMF_DATA_TYPE_MIXEDARRAY);
put_be32(pb, 5*flv->hasVideo + 4*flv->hasAudio + 2);
put_amf_string(pb, "duration");
flv->duration_offset= url_ftell(pb);
put_amf_double(pb, 0);
if(flv->hasVideo){
put_amf_string(pb, "width");
put_amf_double(pb, width);
put_amf_string(pb, "height");
put_amf_double(pb, height);
put_amf_string(pb, "videodatarate");
put_amf_double(pb, s->bit_rate / 1024.0);
put_amf_string(pb, "framerate");
put_amf_double(pb, framerate);
put_amf_string(pb, "videocodecid");
put_amf_double(pb, videocodecid);
}
if(flv->hasAudio){
put_amf_string(pb, "audiosamplerate");
put_amf_double(pb, samplerate);
put_amf_string(pb, "audiosamplesize");
put_amf_double(pb, samplesize);
put_amf_string(pb, "stereo");
put_amf_bool(pb, (channels == 2));
put_amf_string(pb, "audiocodecid");
put_amf_double(pb, audiocodecid);
}
put_amf_string(pb, "filesize");
flv->filesize_offset= url_ftell(pb);
put_amf_double(pb, 0);
put_amf_string(pb, "");
put_byte(pb, AMF_END_OF_OBJECT);
data_size= url_ftell(pb) - metadata_size_pos - 10;
url_fseek(pb, metadata_size_pos, SEEK_SET);
put_be24(pb, data_size);
url_fseek(pb, data_size + 10 - 3, SEEK_CUR);
put_be32(pb, data_size + 11);
return 0;
}
libavformat/flvenc.c:229: error: Uninitialized Value
The value read from samplesize was never initialized.
libavformat/flvenc.c:229:9:
227.
228. put_amf_string(pb, "audiosamplesize");
229. put_amf_double(pb, samplesize);
^
230.
231. put_amf_string(pb, "stereo");
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/flvenc.c/#L229
|
d2a_code_trace_data_41640
|
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: [225+min(0, `c->synth_buf_offset[*]`), 240+max(511, `c->synth_buf_offset[*]`)] (⇐ [33+min(0, `c->synth_buf_offset[*]`), 48+max(511, `c->synth_buf_offset[*]`)] + 192) 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:910:9: Assignment
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);
912.
libavcodec/mpegaudiodec.c:911:9: Array access: Offset: [225+min(0, c->synth_buf_offset[*]), 240+max(511, c->synth_buf_offset[*])] (⇐ [33+min(0, c->synth_buf_offset[*]), 48+max(511, c->synth_buf_offset[*])] + 192) Size: 2 by call to `ff_mpa_synth_filter`
909. SUM8P2(sum, +=, sum2, -=, w, w2, p);
910. p = synth_buf + 48 - j;
911. SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
^
912.
913. *samples = round_sample(&sum);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L911
|
d2a_code_trace_data_41641
|
DECLAREContigPutFunc(putRGBAAcontig8bittile)
{
int samplesperpixel = img->samplesperpixel;
(void) x; (void) y;
fromskew *= samplesperpixel;
while (h-- > 0) {
UNROLL8(w, NOP,
*cp++ = PACK4(pp[0], pp[1], pp[2], pp[3]);
pp += samplesperpixel);
cp += toskew;
pp += fromskew;
}
}
libtiff/tif_getimage.c:1261: error: Integer Overflow L2
([0, `h`] - 1):unsigned32.
libtiff/tif_getimage.c:1255:1: <LHS trace>
1253. * (known to have Map == NULL)
1254. */
1255. DECLAREContigPutFunc(putRGBAAcontig8bittile)
^
1256. {
1257. int samplesperpixel = img->samplesperpixel;
libtiff/tif_getimage.c:1255:1: Parameter `h`
1253. * (known to have Map == NULL)
1254. */
1255. DECLAREContigPutFunc(putRGBAAcontig8bittile)
^
1256. {
1257. int samplesperpixel = img->samplesperpixel;
libtiff/tif_getimage.c:1261:12: Binary operation: ([0, h] - 1):unsigned32
1259. (void) x; (void) y;
1260. fromskew *= samplesperpixel;
1261. while (h-- > 0) {
^
1262. UNROLL8(w, NOP,
1263. *cp++ = PACK4(pp[0], pp[1], pp[2], pp[3]);
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_getimage.c/#L1261
|
d2a_code_trace_data_41642
|
static int opt_streamid(const char *opt, const char *arg)
{
int idx;
char *p;
char idx_str[16];
av_strlcpy(idx_str, arg, sizeof(idx_str));
p = strchr(idx_str, ':');
if (!p) {
fprintf(stderr,
"Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
arg, opt);
ffmpeg_exit(1);
}
*p++ = '\0';
idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
return 0;
}
ffmpeg.c:3698: error: Null Dereference
pointer `p` last assigned on line 3698 could be null and is dereferenced at line 3698, column 5.
ffmpeg.c:3684:1: start of procedure opt_streamid()
3682.
3683. /* arg format is "output-stream-index:streamid-value". */
3684. static int opt_streamid(const char *opt, const char *arg)
^
3685. {
3686. int idx;
ffmpeg.c:3690:5:
3688. char idx_str[16];
3689.
3690. av_strlcpy(idx_str, arg, sizeof(idx_str));
^
3691. p = strchr(idx_str, ':');
3692. if (!p) {
libavutil/avstring.c:64:1: start of procedure av_strlcpy()
62. }
63.
64. size_t av_strlcpy(char *dst, const char *src, size_t size)
^
65. {
66. size_t len = 0;
libavutil/avstring.c:66:5:
64. size_t av_strlcpy(char *dst, const char *src, size_t size)
65. {
66. size_t len = 0;
^
67. while (++len < size && *src)
68. *dst++ = *src++;
libavutil/avstring.c:67:12: Loop condition is true. Entering loop body
65. {
66. size_t len = 0;
67. while (++len < size && *src)
^
68. *dst++ = *src++;
69. if (len <= size)
libavutil/avstring.c:67:28: Loop condition is false. Leaving loop
65. {
66. size_t len = 0;
67. while (++len < size && *src)
^
68. *dst++ = *src++;
69. if (len <= size)
libavutil/avstring.c:69:9: Taking true branch
67. while (++len < size && *src)
68. *dst++ = *src++;
69. if (len <= size)
^
70. *dst = 0;
71. return len + strlen(src) - 1;
libavutil/avstring.c:70:9:
68. *dst++ = *src++;
69. if (len <= size)
70. *dst = 0;
^
71. return len + strlen(src) - 1;
72. }
libavutil/avstring.c:71:5:
69. if (len <= size)
70. *dst = 0;
71. return len + strlen(src) - 1;
^
72. }
73.
libavutil/avstring.c:72:1: return from a call to av_strlcpy
70. *dst = 0;
71. return len + strlen(src) - 1;
72. }
^
73.
74. size_t av_strlcat(char *dst, const char *src, size_t size)
ffmpeg.c:3691:5:
3689.
3690. av_strlcpy(idx_str, arg, sizeof(idx_str));
3691. p = strchr(idx_str, ':');
^
3692. if (!p) {
3693. fprintf(stderr,
ffmpeg.c:3692:10: Taking true branch
3690. av_strlcpy(idx_str, arg, sizeof(idx_str));
3691. p = strchr(idx_str, ':');
3692. if (!p) {
^
3693. fprintf(stderr,
3694. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
ffmpeg.c:3693:9:
3691. p = strchr(idx_str, ':');
3692. if (!p) {
3693. fprintf(stderr,
^
3694. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3695. arg, opt);
ffmpeg.c:3696:9: Skipping ffmpeg_exit(): empty list of specs
3694. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3695. arg, opt);
3696. ffmpeg_exit(1);
^
3697. }
3698. *p++ = '\0';
ffmpeg.c:3698:5:
3696. ffmpeg_exit(1);
3697. }
3698. *p++ = '\0';
^
3699. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3700. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
|
https://github.com/libav/libav/blob/d0005d347d0831c904630fe70408c9fd4eec18e8/ffmpeg.c/#L3698
|
d2a_code_trace_data_41643
|
static int sdp_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
RTSPState *rt = s->priv_data;
RTSPStream *rtsp_st;
int size, i, err;
char *content;
char url[1024];
content = av_malloc(SDP_MAX_SIZE);
size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1);
if (size <= 0) {
av_free(content);
return AVERROR_INVALIDDATA;
}
content[size] ='\0';
sdp_parse(s, content);
av_free(content);
for(i=0;i<rt->nb_rtsp_streams;i++) {
rtsp_st = rt->rtsp_streams[i];
snprintf(url, sizeof(url), "rtp://%s:%d?localport=%d&ttl=%d",
inet_ntoa(rtsp_st->sdp_ip),
rtsp_st->sdp_port,
rtsp_st->sdp_port,
rtsp_st->sdp_ttl);
if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) {
err = AVERROR_INVALIDDATA;
goto fail;
}
if ((err = rtsp_open_transport_ctx(s, rtsp_st)))
goto fail;
}
return 0;
fail:
rtsp_close_streams(rt);
return err;
}
libavformat/rtsp.c:1612: error: Null Dereference
pointer `content` last assigned on line 1606 could be null and is dereferenced at line 1612, column 5.
libavformat/rtsp.c:1595:1: start of procedure sdp_read_header()
1593. #define SDP_MAX_SIZE 8192
1594.
1595. static int sdp_read_header(AVFormatContext *s,
^
1596. AVFormatParameters *ap)
1597. {
libavformat/rtsp.c:1598:5:
1596. AVFormatParameters *ap)
1597. {
1598. RTSPState *rt = s->priv_data;
^
1599. RTSPStream *rtsp_st;
1600. int size, i, err;
libavformat/rtsp.c:1606:5:
1604. /* read the whole sdp file */
1605. /* XXX: better loading */
1606. content = av_malloc(SDP_MAX_SIZE);
^
1607. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1);
1608. if (size <= 0) {
libavutil/mem.c:47:1: start of procedure av_malloc()
45. linker will do it automatically. */
46.
47. void *av_malloc(unsigned int size)
^
48. {
49. void *ptr = NULL;
libavutil/mem.c:49:5:
47. void *av_malloc(unsigned int size)
48. {
49. void *ptr = NULL;
^
50. #if CONFIG_MEMALIGN_HACK
51. long diff;
libavutil/mem.c:55:8: Taking false branch
53.
54. /* let's disallow possible ambiguous cases */
55. if(size > (INT_MAX-16) )
^
56. return NULL;
57.
libavutil/mem.c:66:9: Taking true branch
64. ((char*)ptr)[-1]= diff;
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
^
67. ptr = NULL;
68. #elif HAVE_MEMALIGN
libavutil/mem.c:67:9:
65. #elif HAVE_POSIX_MEMALIGN
66. if (posix_memalign(&ptr,16,size))
67. ptr = NULL;
^
68. #elif HAVE_MEMALIGN
69. ptr = memalign(16,size);
libavutil/mem.c:99:5:
97. ptr = malloc(size);
98. #endif
99. return ptr;
^
100. }
101.
libavutil/mem.c:100:1: return from a call to av_malloc
98. #endif
99. return ptr;
100. }
^
101.
102. void *av_realloc(void *ptr, unsigned int size)
libavformat/rtsp.c:1607:5: Skipping get_buffer(): empty list of specs
1605. /* XXX: better loading */
1606. content = av_malloc(SDP_MAX_SIZE);
1607. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1);
^
1608. if (size <= 0) {
1609. av_free(content);
libavformat/rtsp.c:1608:9: Taking false branch
1606. content = av_malloc(SDP_MAX_SIZE);
1607. size = get_buffer(s->pb, content, SDP_MAX_SIZE - 1);
1608. if (size <= 0) {
^
1609. av_free(content);
1610. return AVERROR_INVALIDDATA;
libavformat/rtsp.c:1612:5:
1610. return AVERROR_INVALIDDATA;
1611. }
1612. content[size] ='\0';
^
1613.
1614. sdp_parse(s, content);
|
https://github.com/libav/libav/blob/184bc53db4fded8857af09cee2adc7197940deb7/libavformat/rtsp.c/#L1612
|
d2a_code_trace_data_41644
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/bn/bn_gf2m.c:1042: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_sqr_arr`.
Showing all 26 steps of the trace
crypto/bn/bn_gf2m.c:983:1: Parameter `ctx->stack.depth`
981. * 0. Uses algorithms A.4.7 and A.4.6 from IEEE P1363.
982. */
983. > int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a_, const int p[],
984. BN_CTX *ctx)
985. {
crypto/bn/bn_gf2m.c:997:5: Call
995. }
996.
997. BN_CTX_start(ctx);
^
998. a = BN_CTX_get(ctx);
999. z = 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_gf2m.c:998:9: Call
996.
997. BN_CTX_start(ctx);
998. a = BN_CTX_get(ctx);
^
999. z = BN_CTX_get(ctx);
1000. w = 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_gf2m.c:999:9: Call
997. BN_CTX_start(ctx);
998. a = BN_CTX_get(ctx);
999. z = BN_CTX_get(ctx);
^
1000. w = BN_CTX_get(ctx);
1001. if (w == 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_gf2m.c:1000:9: Call
998. a = BN_CTX_get(ctx);
999. z = BN_CTX_get(ctx);
1000. w = BN_CTX_get(ctx);
^
1001. if (w == NULL)
1002. 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_gf2m.c:1028:15: Call
1026. } else { /* m is even */
1027.
1028. rho = BN_CTX_get(ctx);
^
1029. w2 = BN_CTX_get(ctx);
1030. tmp = 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_gf2m.c:1029:14: Call
1027.
1028. rho = BN_CTX_get(ctx);
1029. w2 = BN_CTX_get(ctx);
^
1030. tmp = BN_CTX_get(ctx);
1031. if (tmp == 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_gf2m.c:1030:15: Call
1028. rho = BN_CTX_get(ctx);
1029. w2 = BN_CTX_get(ctx);
1030. tmp = BN_CTX_get(ctx);
^
1031. if (tmp == NULL)
1032. 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_gf2m.c:1042:22: Call
1040. goto err;
1041. for (j = 1; j <= p[0] - 1; j++) {
1042. if (!BN_GF2m_mod_sqr_arr(z, z, p, ctx))
^
1043. goto err;
1044. if (!BN_GF2m_mod_sqr_arr(w2, w, p, ctx))
crypto/bn/bn_gf2m.c:496:5: Call
494.
495. bn_check_top(a);
496. BN_CTX_start(ctx);
^
497. if ((s = BN_CTX_get(ctx)) == NULL)
498. goto err;
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_gf2m.c:514:5: Call
512. ret = 1;
513. err:
514. BN_CTX_end(ctx);
^
515. return ret;
516. }
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_GF2m_mod_sqr_arr`
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_41645
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/ec_internal_test.c:174: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `group_field_tests`.
Showing all 11 steps of the trace
test/ec_internal_test.c:174:13: Call
172. if (!TEST_ptr(group = EC_GROUP_new_by_curve_name(nid))
173. || !TEST_ptr(ctx = BN_CTX_new())
174. || !group_field_tests(group, ctx))
^
175. goto err;
176.
test/ec_internal_test.c:28:5: Call
26. return 1;
27.
28. BN_CTX_start(ctx);
^
29. a = BN_CTX_get(ctx);
30. b = 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);
test/ec_internal_test.c:65:5: Call
63. ret = 1;
64. err:
65. BN_CTX_end(ctx);
^
66. return ret;
67. }
crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes`
193. }
194.
195. > void BN_CTX_end(BN_CTX *ctx)
196. {
197. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:201:27: Call
199. ctx->err_stack--;
200. else {
201. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
202. /* Does this stack frame have anything to release? */
203. if (fp < ctx->used)
crypto/bn/bn_ctx.c:274:1: <Offset trace>
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: Parameter `st->depth`
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: <Length trace>
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:274:1: Parameter `*st->indexes`
272. }
273.
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:276:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `group_field_tests`
274. static unsigned int BN_STACK_pop(BN_STACK *st)
275. {
276. return st->indexes[--(st->depth)];
^
277. }
278.
|
https://github.com/openssl/openssl/blob/8f58ede09572dcc6a7e6c01280dd348240199568/crypto/bn/bn_ctx.c/#L276
|
d2a_code_trace_data_41646
|
static ossl_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:1372: error: INTEGER_OVERFLOW_L2
([0, +oo] - [1, 64]):unsigned32 by call to `ssl3_cbc_copy_mac`.
Showing all 10 steps of the trace
ssl/record/ssl3_record.c:1276:1: Parameter `s->rlayer.rrec.length`
1274. }
1275.
1276. > int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap)
1277. {
1278. int i, al;
ssl/record/ssl3_record.c:1315:5: Assignment
1313. /* decrypt in place in 'rr->input' */
1314. rr->data = rr->input;
1315. rr->orig_len = rr->length;
^
1316.
1317. enc_err = s->method->ssl3_enc->enc(s, rr, 1, 0);
ssl/record/ssl3_record.c:1372:13: Call
1370. */
1371. mac = mac_tmp;
1372. ssl3_cbc_copy_mac(mac_tmp, rr, mac_size);
^
1373. rr->length -= mac_size;
1374. } else {
ssl/record/ssl3_record.c:1199:1: Parameter `md_size`
1197. #define CBC_MAC_ROTATE_IN_PLACE
1198.
1199. > void ssl3_cbc_copy_mac(unsigned char *out,
1200. const SSL3_RECORD *rec, unsigned md_size)
1201. {
ssl/record/ssl3_record.c:1261:26: Call
1259. ((volatile unsigned char *)rotated_mac)[rotate_offset ^ 32];
1260. out[j++] = rotated_mac[rotate_offset++];
1261. rotate_offset &= constant_time_lt(rotate_offset, md_size);
^
1262. }
1263. #else
include/internal/constant_time_locl.h:105:1: <LHS trace>
103. }
104.
105. > static ossl_inline unsigned int constant_time_lt(unsigned int a,
106. unsigned int b)
107. {
include/internal/constant_time_locl.h:105:1: Parameter `a`
103. }
104.
105. > static ossl_inline unsigned int constant_time_lt(unsigned int a,
106. unsigned int b)
107. {
include/internal/constant_time_locl.h:105:1: <RHS trace>
103. }
104.
105. > static ossl_inline unsigned int constant_time_lt(unsigned int a,
106. unsigned int b)
107. {
include/internal/constant_time_locl.h:105:1: Parameter `b`
103. }
104.
105. > static ossl_inline unsigned int constant_time_lt(unsigned int a,
106. unsigned int b)
107. {
include/internal/constant_time_locl.h:108:12: Binary operation: ([0, +oo] - [1, 64]):unsigned32 by call to `ssl3_cbc_copy_mac`
106. unsigned int b)
107. {
108. return constant_time_msb(a ^ ((a ^ b) | ((a - b) ^ b)));
^
109. }
110.
|
https://github.com/openssl/openssl/blob/1fb9fdc3027b27d8eb6a1e6a846435b070980770/include/internal/constant_time_locl.h/#L108
|
d2a_code_trace_data_41647
|
int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
const unsigned char *salt, int saltlen, int iter,
const EVP_MD *digest, int keylen, unsigned char *out)
{
const char *empty = "";
unsigned char digtmp[EVP_MAX_MD_SIZE], *p, itmp[4];
int cplen, j, k, tkeylen, mdlen;
unsigned long i = 1;
HMAC_CTX *hctx_tpl = NULL, *hctx = NULL;
mdlen = EVP_MD_size(digest);
if (mdlen < 0)
return 0;
hctx_tpl = HMAC_CTX_new();
if (hctx_tpl == NULL)
return 0;
p = out;
tkeylen = keylen;
if (pass == NULL) {
pass = empty;
passlen = 0;
} else if (passlen == -1) {
passlen = strlen(pass);
}
if (!HMAC_Init_ex(hctx_tpl, pass, passlen, digest, NULL)) {
HMAC_CTX_free(hctx_tpl);
return 0;
}
hctx = HMAC_CTX_new();
if (hctx == NULL) {
HMAC_CTX_free(hctx_tpl);
return 0;
}
while (tkeylen) {
if (tkeylen > mdlen)
cplen = mdlen;
else
cplen = tkeylen;
itmp[0] = (unsigned char)((i >> 24) & 0xff);
itmp[1] = (unsigned char)((i >> 16) & 0xff);
itmp[2] = (unsigned char)((i >> 8) & 0xff);
itmp[3] = (unsigned char)(i & 0xff);
if (!HMAC_CTX_copy(hctx, hctx_tpl)) {
HMAC_CTX_free(hctx);
HMAC_CTX_free(hctx_tpl);
return 0;
}
if (!HMAC_Update(hctx, salt, saltlen)
|| !HMAC_Update(hctx, itmp, 4)
|| !HMAC_Final(hctx, digtmp, NULL)) {
HMAC_CTX_free(hctx);
HMAC_CTX_free(hctx_tpl);
return 0;
}
memcpy(p, digtmp, cplen);
for (j = 1; j < iter; j++) {
if (!HMAC_CTX_copy(hctx, hctx_tpl)) {
HMAC_CTX_free(hctx);
HMAC_CTX_free(hctx_tpl);
return 0;
}
if (!HMAC_Update(hctx, digtmp, mdlen)
|| !HMAC_Final(hctx, digtmp, NULL)) {
HMAC_CTX_free(hctx);
HMAC_CTX_free(hctx_tpl);
return 0;
}
for (k = 0; k < cplen; k++)
p[k] ^= digtmp[k];
}
tkeylen -= cplen;
i++;
p += cplen;
}
HMAC_CTX_free(hctx);
HMAC_CTX_free(hctx_tpl);
# ifdef OPENSSL_DEBUG_PKCS5V2
fprintf(stderr, "Password:\n");
h__dump(pass, passlen);
fprintf(stderr, "Salt:\n");
h__dump(salt, saltlen);
fprintf(stderr, "Iteration count %d\n", iter);
fprintf(stderr, "Key:\n");
h__dump(out, keylen);
# endif
return 1;
}
crypto/pkcs12/p12_mutl.c:116: error: INTEGER_OVERFLOW_L2
([1, 9223372036854775806] + 1):signed32 by call to `pkcs12_gen_gost_mac_key`.
Showing all 7 steps of the trace
crypto/pkcs12/p12_mutl.c:98:9: Assignment
96. saltlen = p12->mac->salt->length;
97. if (!p12->mac->iter)
98. iter = 1;
^
99. else
100. iter = ASN1_INTEGER_get(p12->mac->iter);
crypto/pkcs12/p12_mutl.c:116:14: Call
114. && !getenv("LEGACY_GOST_PKCS12")) {
115. md_size = TK26_MAC_KEY_LEN;
116. if (!pkcs12_gen_gost_mac_key(pass, passlen, salt, saltlen, iter,
^
117. md_size, key, md_type)) {
118. PKCS12err(PKCS12_F_PKCS12_GEN_MAC, PKCS12_R_KEY_GEN_ERROR);
crypto/pkcs12/p12_mutl.c:49:1: Parameter `iter`
47. # define TK26_MAC_KEY_LEN 32
48.
49. > static int pkcs12_gen_gost_mac_key(const char *pass, int passlen,
50. const unsigned char *salt, int saltlen,
51. int iter, int keylen, unsigned char *key,
crypto/pkcs12/p12_mutl.c:60:10: Call
58. }
59.
60. if (!PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter,
^
61. digest, sizeof(out), out)) {
62. return 0;
crypto/evp/p5_crpt2.c:32:1: <LHS trace>
30. */
31.
32. > int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
33. const unsigned char *salt, int saltlen, int iter,
34. const EVP_MD *digest, int keylen, unsigned char *out)
crypto/evp/p5_crpt2.c:32:1: Parameter `iter`
30. */
31.
32. > int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
33. const unsigned char *salt, int saltlen, int iter,
34. const EVP_MD *digest, int keylen, unsigned char *out)
crypto/evp/p5_crpt2.c:92:31: Binary operation: ([1, 9223372036854775806] + 1):signed32 by call to `pkcs12_gen_gost_mac_key`
90. }
91. memcpy(p, digtmp, cplen);
92. for (j = 1; j < iter; j++) {
^
93. if (!HMAC_CTX_copy(hctx, hctx_tpl)) {
94. HMAC_CTX_free(hctx);
|
https://github.com/openssl/openssl/blob/1bc563caa144a568fc505f210568f5ac5b66315e/crypto/evp/p5_crpt2.c/#L92
|
d2a_code_trace_data_41648
|
void ssl3_cbc_copy_mac(unsigned char *out,
const SSL3_RECORD *rec, unsigned 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
unsigned mac_end = rec->length;
unsigned mac_start = mac_end - md_size;
unsigned scan_start = 0;
unsigned i, j;
unsigned div_spoiler;
unsigned rotate_offset;
OPENSSL_assert(rec->orig_len >= md_size);
OPENSSL_assert(md_size <= EVP_MAX_MD_SIZE);
#if defined(CBC_MAC_ROTATE_IN_PLACE)
rotated_mac = rotated_mac_buf + ((0 - (size_t)rotated_mac_buf) & 63);
#endif
if (rec->orig_len > md_size + 255 + 1)
scan_start = rec->orig_len - (md_size + 255 + 1);
div_spoiler = md_size >> 1;
div_spoiler <<= (sizeof(div_spoiler) - 1) * 8;
rotate_offset = (div_spoiler + mac_start - scan_start) % md_size;
memset(rotated_mac, 0, md_size);
for (i = scan_start, j = 0; i < rec->orig_len; i++) {
unsigned char mac_started = constant_time_ge_8(i, mac_start);
unsigned char mac_ended = constant_time_ge_8(i, mac_end);
unsigned char b = rec->data[i];
rotated_mac[j++] |= b & mac_started & ~mac_ended;
j &= constant_time_lt(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(rotate_offset, md_size);
}
#else
memset(out, 0, md_size);
rotate_offset = md_size - rotate_offset;
rotate_offset &= constant_time_lt(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(j, rotate_offset);
rotate_offset++;
rotate_offset &= constant_time_lt(rotate_offset, md_size);
}
#endif
}
ssl/record/ssl3_record.c:424: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, 64]):unsigned32 by call to `ssl3_cbc_copy_mac`.
Showing all 9 steps of the trace
ssl/record/ssl3_record.c:126:1: Parameter `s->rlayer.rrec.length`
124. */
125. /* used only by ssl3_read_bytes */
126. > int ssl3_get_record(SSL *s)
127. {
128. int ssl_major, ssl_minor, al;
ssl/record/ssl3_record.c:323:9: Assignment
321. /* decrypt in place in 'rr->input' */
322. rr[num_recs].data = rr[num_recs].input;
323. rr[num_recs].orig_len = rr[num_recs].length;
^
324.
325. /* Mark this record as not read by upper layers yet */
ssl/record/ssl3_record.c:424:17: Call
422. */
423. mac = mac_tmp;
424. ssl3_cbc_copy_mac(mac_tmp, &rr[j], mac_size);
^
425. rr[j].length -= mac_size;
426. } else {
ssl/record/ssl3_record.c:1187:1: <LHS trace>
1185. #define CBC_MAC_ROTATE_IN_PLACE
1186.
1187. > void ssl3_cbc_copy_mac(unsigned char *out,
1188. const SSL3_RECORD *rec, unsigned md_size)
1189. {
ssl/record/ssl3_record.c:1187:1: Parameter `rec->length`
1185. #define CBC_MAC_ROTATE_IN_PLACE
1186.
1187. > void ssl3_cbc_copy_mac(unsigned char *out,
1188. const SSL3_RECORD *rec, unsigned md_size)
1189. {
ssl/record/ssl3_record.c:1200:5: Assignment
1198. * mac_end is the index of |rec->data| just after the end of the MAC.
1199. */
1200. unsigned mac_end = rec->length;
^
1201. unsigned mac_start = mac_end - md_size;
1202. /*
ssl/record/ssl3_record.c:1187:1: <RHS trace>
1185. #define CBC_MAC_ROTATE_IN_PLACE
1186.
1187. > void ssl3_cbc_copy_mac(unsigned char *out,
1188. const SSL3_RECORD *rec, unsigned md_size)
1189. {
ssl/record/ssl3_record.c:1187:1: Parameter `md_size`
1185. #define CBC_MAC_ROTATE_IN_PLACE
1186.
1187. > void ssl3_cbc_copy_mac(unsigned char *out,
1188. const SSL3_RECORD *rec, unsigned md_size)
1189. {
ssl/record/ssl3_record.c:1201:5: Binary operation: ([0, +oo] - [0, 64]):unsigned32 by call to `ssl3_cbc_copy_mac`
1199. */
1200. unsigned mac_end = rec->length;
1201. unsigned mac_start = mac_end - md_size;
^
1202. /*
1203. * scan_start contains the number of bytes that we can ignore because the
|
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/ssl/record/ssl3_record.c/#L1201
|
d2a_code_trace_data_41649
|
static ossl_inline void packet_forward(PACKET *pkt, size_t len)
{
pkt->curr += len;
pkt->remaining -= len;
}
test/sslapitest.c:4614: error: INTEGER_OVERFLOW_L2
([0, +oo] - 34):unsigned64 by call to `PACKET_forward`.
Showing all 14 steps of the trace
test/sslapitest.c:4608:10: Call
4606. memset(&pkt3, 0, sizeof(pkt3));
4607.
4608. if (!TEST_true( PACKET_buf_init( &pkt, data, len ) )
^
4609. /* Skip the record header */
4610. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
ssl/packet_locl.h:68:8: Parameter `pkt->remaining`
66. * is being used.
67. */
68. __owur static ossl_inline int PACKET_buf_init(PACKET *pkt,
^
69. const unsigned char *buf,
70. size_t len)
test/sslapitest.c:4610:17: Call
4608. if (!TEST_true( PACKET_buf_init( &pkt, data, len ) )
4609. /* Skip the record header */
4610. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
^
4611. /* Skip the handshake message header */
4612. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH))
ssl/packet_locl.h:463:8: Parameter `len`
461.
462. /* Move the current reading position forward |len| bytes */
463. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
464. {
465. if (PACKET_remaining(pkt) < len)
test/sslapitest.c:4612:17: Call
4610. || !PACKET_forward(&pkt, SSL3_RT_HEADER_LENGTH)
4611. /* Skip the handshake message header */
4612. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH))
^
4613. /* Skip client version and random */
4614. || !TEST_true(PACKET_forward(&pkt, CLIENT_VERSION_LEN
ssl/packet_locl.h:463:8: Parameter `len`
461.
462. /* Move the current reading position forward |len| bytes */
463. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
464. {
465. if (PACKET_remaining(pkt) < len)
test/sslapitest.c:4614:17: Call
4612. || !TEST_true(PACKET_forward(&pkt, SSL3_HM_HEADER_LENGTH))
4613. /* Skip client version and random */
4614. || !TEST_true(PACKET_forward(&pkt, CLIENT_VERSION_LEN
^
4615. + SSL3_RANDOM_SIZE))
4616. /* Skip session id */
ssl/packet_locl.h:463:8: Parameter `len`
461.
462. /* Move the current reading position forward |len| bytes */
463. __owur static ossl_inline int PACKET_forward(PACKET *pkt, size_t len)
^
464. {
465. if (PACKET_remaining(pkt) < len)
ssl/packet_locl.h:468:5: Call
466. return 0;
467.
468. packet_forward(pkt, len);
^
469.
470. return 1;
ssl/packet_locl.h:29:1: <LHS trace>
27.
28. /* Internal unchecked shorthand; don't use outside this file. */
29. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30. {
31. pkt->curr += len;
ssl/packet_locl.h:29:1: Parameter `pkt->remaining`
27.
28. /* Internal unchecked shorthand; don't use outside this file. */
29. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30. {
31. pkt->curr += len;
ssl/packet_locl.h:29:1: <RHS trace>
27.
28. /* Internal unchecked shorthand; don't use outside this file. */
29. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30. {
31. pkt->curr += len;
ssl/packet_locl.h:29:1: Parameter `len`
27.
28. /* Internal unchecked shorthand; don't use outside this file. */
29. > static ossl_inline void packet_forward(PACKET *pkt, size_t len)
30. {
31. pkt->curr += len;
ssl/packet_locl.h:32:5: Binary operation: ([0, +oo] - 34):unsigned64 by call to `PACKET_forward`
30. {
31. pkt->curr += len;
32. pkt->remaining -= len;
^
33. }
34.
|
https://github.com/openssl/openssl/blob/2e6b615f795e8ca8ae830a00079c4ea064eaae42/ssl/packet_locl.h/#L32
|
d2a_code_trace_data_41650
|
static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
{
AVStream *st;
AVOutputStream *ost;
AVCodec *codec=NULL;
AVCodecContext *subtitle_enc;
enum CodecID codec_id;
st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
ffmpeg_exit(1);
}
ost = new_output_stream(oc, file_idx);
subtitle_enc = st->codec;
output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
if(!subtitle_stream_copy){
if (subtitle_codec_name) {
codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1,
avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->strict_std_compliance);
codec= output_codecs[nb_output_codecs-1] = avcodec_find_encoder_by_name(subtitle_codec_name);
} else {
codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_SUBTITLE);
codec = avcodec_find_encoder(codec_id);
}
}
avcodec_get_context_defaults3(st->codec, codec);
ost->bitstream_filters = subtitle_bitstream_filters;
subtitle_bitstream_filters= NULL;
subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
if(subtitle_codec_tag)
subtitle_enc->codec_tag= subtitle_codec_tag;
if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
subtitle_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
if (subtitle_stream_copy) {
st->stream_copy = 1;
} else {
subtitle_enc->codec_id = codec_id;
set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM, codec);
}
if (subtitle_language) {
av_metadata_set2(&st->metadata, "language", subtitle_language, 0);
av_freep(&subtitle_language);
}
subtitle_disable = 0;
av_freep(&subtitle_codec_name);
subtitle_stream_copy = 0;
}
ffmpeg.c:3580: error: Null Dereference
pointer `st` last assigned on line 3574 could be null and is dereferenced at line 3580, column 20.
ffmpeg.c:3566:1: start of procedure new_subtitle_stream()
3564. }
3565.
3566. static void new_subtitle_stream(AVFormatContext *oc, int file_idx)
^
3567. {
3568. AVStream *st;
ffmpeg.c:3570:5:
3568. AVStream *st;
3569. AVOutputStream *ost;
3570. AVCodec *codec=NULL;
^
3571. AVCodecContext *subtitle_enc;
3572. enum CodecID codec_id;
ffmpeg.c:3574:28: Condition is true
3572. enum CodecID codec_id;
3573.
3574. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
^
3575. if (!st) {
3576. fprintf(stderr, "Could not alloc stream\n");
ffmpeg.c:3574:5:
3572. enum CodecID codec_id;
3573.
3574. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
^
3575. if (!st) {
3576. fprintf(stderr, "Could not alloc stream\n");
libavformat/utils.c:2539:1: start of procedure av_new_stream()
2537. }
2538.
2539. AVStream *av_new_stream(AVFormatContext *s, int id)
^
2540. {
2541. AVStream *st;
libavformat/utils.c:2545:9: Taking true branch
2543.
2544. #if FF_API_MAX_STREAMS
2545. if (s->nb_streams >= MAX_STREAMS){
^
2546. av_log(s, AV_LOG_ERROR, "Too many streams\n");
2547. return NULL;
libavformat/utils.c:2546:9: Skipping av_log(): empty list of specs
2544. #if FF_API_MAX_STREAMS
2545. if (s->nb_streams >= MAX_STREAMS){
2546. av_log(s, AV_LOG_ERROR, "Too many streams\n");
^
2547. return NULL;
2548. }
libavformat/utils.c:2547:9:
2545. if (s->nb_streams >= MAX_STREAMS){
2546. av_log(s, AV_LOG_ERROR, "Too many streams\n");
2547. return NULL;
^
2548. }
2549. #else
libavformat/utils.c:2596:1: return from a call to av_new_stream
2594. s->streams[s->nb_streams++] = st;
2595. return st;
2596. }
^
2597.
2598. AVProgram *av_new_program(AVFormatContext *ac, int id)
ffmpeg.c:3575:10: Taking true branch
3573.
3574. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3575. if (!st) {
^
3576. fprintf(stderr, "Could not alloc stream\n");
3577. ffmpeg_exit(1);
ffmpeg.c:3576:9:
3574. st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
3575. if (!st) {
3576. fprintf(stderr, "Could not alloc stream\n");
^
3577. ffmpeg_exit(1);
3578. }
ffmpeg.c:3577:9: Skipping ffmpeg_exit(): empty list of specs
3575. if (!st) {
3576. fprintf(stderr, "Could not alloc stream\n");
3577. ffmpeg_exit(1);
^
3578. }
3579. ost = new_output_stream(oc, file_idx);
ffmpeg.c:3579:5: Skipping new_output_stream(): empty list of specs
3577. ffmpeg_exit(1);
3578. }
3579. ost = new_output_stream(oc, file_idx);
^
3580. subtitle_enc = st->codec;
3581. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
ffmpeg.c:3580:5:
3578. }
3579. ost = new_output_stream(oc, file_idx);
3580. subtitle_enc = st->codec;
^
3581. output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
3582. if(!subtitle_stream_copy){
|
https://github.com/libav/libav/blob/129983408d0d064db656742a3d3d4c038420f48c/ffmpeg.c/#L3580
|
d2a_code_trace_data_41651
|
DH *ssl_get_auto_dh(SSL *s)
{
int dh_secbits = 80;
if (s->cert->dh_tmp_auto == 2)
return DH_get_1024_160();
if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
if (s->s3->tmp.new_cipher->strength_bits == 256)
dh_secbits = 128;
else
dh_secbits = 80;
} else {
CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
}
if (dh_secbits >= 128) {
DH *dhp = DH_new();
BIGNUM *p, *g;
if (dhp == NULL)
return NULL;
g = BN_new();
if (g != NULL)
BN_set_word(g, 2);
if (dh_secbits >= 192)
p = BN_get_rfc3526_prime_8192(NULL);
else
p = BN_get_rfc3526_prime_3072(NULL);
if (p == NULL || g == NULL || !DH_set0_pqg(dhp, p, NULL, g)) {
DH_free(dhp);
BN_free(p);
BN_free(g);
return NULL;
}
return dhp;
}
if (dh_secbits >= 112)
return DH_get_2048_224();
return DH_get_1024_160();
}
ssl/t1_lib.c:3965: error: NULL_DEREFERENCE
pointer `cpk` last assigned on line 3964 could be null and is dereferenced at line 3965, column 45.
Showing all 30 steps of the trace
ssl/t1_lib.c:3953:1: start of procedure ssl_get_auto_dh()
3951.
3952. #ifndef OPENSSL_NO_DH
3953. > DH *ssl_get_auto_dh(SSL *s)
3954. {
3955. int dh_secbits = 80;
ssl/t1_lib.c:3955:5:
3953. DH *ssl_get_auto_dh(SSL *s)
3954. {
3955. > int dh_secbits = 80;
3956. if (s->cert->dh_tmp_auto == 2)
3957. return DH_get_1024_160();
ssl/t1_lib.c:3956:9: Taking false branch
3954. {
3955. int dh_secbits = 80;
3956. if (s->cert->dh_tmp_auto == 2)
^
3957. return DH_get_1024_160();
3958. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
ssl/t1_lib.c:3958:9: Taking false branch
3956. if (s->cert->dh_tmp_auto == 2)
3957. return DH_get_1024_160();
3958. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
^
3959. if (s->s3->tmp.new_cipher->strength_bits == 256)
3960. dh_secbits = 128;
ssl/t1_lib.c:3964:9:
3962. dh_secbits = 80;
3963. } else {
3964. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
3965. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
3966. }
ssl/ssl_lib.c:2743:1: start of procedure ssl_get_server_send_pkey()
2741. }
2742.
2743. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
2744. {
2745. CERT *c;
ssl/ssl_lib.c:2748:5:
2746. int i;
2747.
2748. > c = s->cert;
2749. if (!s->s3 || !s->s3->tmp.new_cipher)
2750. return NULL;
ssl/ssl_lib.c:2749:10: Taking false branch
2747.
2748. c = s->cert;
2749. if (!s->s3 || !s->s3->tmp.new_cipher)
^
2750. return NULL;
2751. ssl_set_masks(s);
ssl/ssl_lib.c:2749:20: Taking false branch
2747.
2748. c = s->cert;
2749. if (!s->s3 || !s->s3->tmp.new_cipher)
^
2750. return NULL;
2751. ssl_set_masks(s);
ssl/ssl_lib.c:2751:5: Skipping ssl_set_masks(): empty list of specs
2749. if (!s->s3 || !s->s3->tmp.new_cipher)
2750. return NULL;
2751. ssl_set_masks(s);
^
2752.
2753. i = ssl_get_server_cert_index(s);
ssl/ssl_lib.c:2753:5:
2751. ssl_set_masks(s);
2752.
2753. > i = ssl_get_server_cert_index(s);
2754.
2755. /* This may or may not be an error. */
ssl/ssl_lib.c:2722:1: start of procedure ssl_get_server_cert_index()
2720. #endif
2721.
2722. > static int ssl_get_server_cert_index(const SSL *s)
2723. {
2724. int idx;
ssl/ssl_lib.c:2725:5:
2723. {
2724. int idx;
2725. > idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2726. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
2727. idx = SSL_PKEY_RSA_SIGN;
ssl/ssl_ciph.c:1880:1: start of procedure ssl_cipher_get_cert_index()
1878.
1879. /* For a cipher return the index corresponding to the certificate type */
1880. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c)
1881. {
1882. uint32_t alg_a;
ssl/ssl_ciph.c:1884:5:
1882. uint32_t alg_a;
1883.
1884. > alg_a = c->algorithm_auth;
1885.
1886. if (alg_a & SSL_aECDSA)
ssl/ssl_ciph.c:1886:9: Taking false branch
1884. alg_a = c->algorithm_auth;
1885.
1886. if (alg_a & SSL_aECDSA)
^
1887. return SSL_PKEY_ECC;
1888. else if (alg_a & SSL_aDSS)
ssl/ssl_ciph.c:1888:14: Taking false branch
1886. if (alg_a & SSL_aECDSA)
1887. return SSL_PKEY_ECC;
1888. else if (alg_a & SSL_aDSS)
^
1889. return SSL_PKEY_DSA_SIGN;
1890. else if (alg_a & SSL_aRSA)
ssl/ssl_ciph.c:1890:14: Taking true branch
1888. else if (alg_a & SSL_aDSS)
1889. return SSL_PKEY_DSA_SIGN;
1890. else if (alg_a & SSL_aRSA)
^
1891. return SSL_PKEY_RSA_ENC;
1892. else if (alg_a & SSL_aGOST12)
ssl/ssl_ciph.c:1891:9:
1889. return SSL_PKEY_DSA_SIGN;
1890. else if (alg_a & SSL_aRSA)
1891. > return SSL_PKEY_RSA_ENC;
1892. else if (alg_a & SSL_aGOST12)
1893. return SSL_PKEY_GOST_EC;
ssl/ssl_ciph.c:1898:1: return from a call to ssl_cipher_get_cert_index
1896.
1897. return -1;
1898. > }
1899.
1900. const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr)
ssl/ssl_lib.c:2726:9: Taking true branch
2724. int idx;
2725. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2726. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
^
2727. idx = SSL_PKEY_RSA_SIGN;
2728. if (idx == SSL_PKEY_GOST_EC) {
ssl/ssl_lib.c:2726:37: Taking false branch
2724. int idx;
2725. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2726. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
^
2727. idx = SSL_PKEY_RSA_SIGN;
2728. if (idx == SSL_PKEY_GOST_EC) {
ssl/ssl_lib.c:2728:9: Taking false branch
2726. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
2727. idx = SSL_PKEY_RSA_SIGN;
2728. if (idx == SSL_PKEY_GOST_EC) {
^
2729. if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509)
2730. idx = SSL_PKEY_GOST12_512;
ssl/ssl_lib.c:2738:9: Taking false branch
2736. idx = -1;
2737. }
2738. if (idx == -1)
^
2739. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2740. return idx;
ssl/ssl_lib.c:2740:5:
2738. if (idx == -1)
2739. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2740. > return idx;
2741. }
2742.
ssl/ssl_lib.c:2741:1: return from a call to ssl_get_server_cert_index
2739. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2740. return idx;
2741. > }
2742.
2743. CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
ssl/ssl_lib.c:2756:9: Taking true branch
2754.
2755. /* This may or may not be an error. */
2756. if (i < 0)
^
2757. return NULL;
2758.
ssl/ssl_lib.c:2757:9:
2755. /* This may or may not be an error. */
2756. if (i < 0)
2757. > return NULL;
2758.
2759. /* May be NULL. */
ssl/ssl_lib.c:2761:1: return from a call to ssl_get_server_send_pkey
2759. /* May be NULL. */
2760. return &c->pkeys[i];
2761. > }
2762.
2763. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher,
ssl/t1_lib.c:3965:9:
3963. } else {
3964. CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
3965. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
3966. }
3967.
|
https://github.com/openssl/openssl/blob/70c22888c1648fe8652e77107f3c74bf2212de36/ssl/t1_lib.c/#L3965
|
d2a_code_trace_data_41652
|
static size_t kat_nonce(RAND_DRBG *drbg, unsigned char **pout,
int entropy, size_t min_len, size_t max_len)
{
TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index);
t->noncecnt++;
*pout = (unsigned char *)t->nonce;
return t->noncelen;
}
test/drbgtest.c:150: error: NULL_DEREFERENCE
pointer `t` last assigned on line 148 could be null and is dereferenced at line 150, column 5.
Showing all 10 steps of the trace
test/drbgtest.c:145:1: start of procedure kat_nonce()
143. }
144.
145. > static size_t kat_nonce(RAND_DRBG *drbg, unsigned char **pout,
146. int entropy, size_t min_len, size_t max_len)
147. {
test/drbgtest.c:148:5:
146. int entropy, size_t min_len, size_t max_len)
147. {
148. > TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index);
149.
150. t->noncecnt++;
crypto/rand/drbg_lib.c:911:1: start of procedure RAND_DRBG_get_ex_data()
909. }
910.
911. > void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx)
912. {
913. return CRYPTO_get_ex_data(&drbg->ex_data, idx);
crypto/rand/drbg_lib.c:913:5:
911. void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx)
912. {
913. > return CRYPTO_get_ex_data(&drbg->ex_data, idx);
914. }
915.
crypto/ex_data.c:394:1: start of procedure CRYPTO_get_ex_data()
392. * particular index in the class used by this variable
393. */
394. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
395. {
396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
crypto/ex_data.c:396:9: Taking true branch
394. void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
395. {
396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
^
397. return NULL;
398. return sk_void_value(ad->sk, idx);
crypto/ex_data.c:397:9:
395. {
396. if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
397. > return NULL;
398. return sk_void_value(ad->sk, idx);
399. }
crypto/ex_data.c:399:1: return from a call to CRYPTO_get_ex_data
397. return NULL;
398. return sk_void_value(ad->sk, idx);
399. > }
crypto/rand/drbg_lib.c:914:1: return from a call to RAND_DRBG_get_ex_data
912. {
913. return CRYPTO_get_ex_data(&drbg->ex_data, idx);
914. > }
915.
916.
test/drbgtest.c:150:5:
148. TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index);
149.
150. > t->noncecnt++;
151. *pout = (unsigned char *)t->nonce;
152. return t->noncelen;
|
https://github.com/openssl/openssl/blob/b44882a0bd0717e0aab84f5dc3ef81ab673155e9/test/drbgtest.c/#L150
|
d2a_code_trace_data_41653
|
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 = ¶ms;
AVOutputFormat *file_oformat;
if (!strcmp(filename, "-"))
filename = "pipe:";
oc = avformat_alloc_context();
if (!oc) {
print_error(filename, AVERROR(ENOMEM));
ffmpeg_exit(1);
}
if (last_asked_format) {
file_oformat = av_guess_format(last_asked_format, NULL, NULL);
if (!file_oformat) {
fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
ffmpeg_exit(1);
}
last_asked_format = NULL;
} else {
file_oformat = av_guess_format(NULL, filename, NULL);
if (!file_oformat) {
fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
filename);
ffmpeg_exit(1);
}
}
oc->oformat = file_oformat;
av_strlcpy(oc->filename, filename, sizeof(oc->filename));
if (!strcmp(file_oformat->name, "ffm") &&
av_strstart(filename, "http:", NULL)) {
int err = read_ffserver_streams(oc, filename);
if (err < 0) {
print_error(filename, err);
ffmpeg_exit(1);
}
} else {
use_video = file_oformat->video_codec != CODEC_ID_NONE || video_stream_copy || video_codec_name;
use_audio = file_oformat->audio_codec != CODEC_ID_NONE || audio_stream_copy || audio_codec_name;
use_subtitle = file_oformat->subtitle_codec != CODEC_ID_NONE || subtitle_stream_copy || subtitle_codec_name;
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;
av_metadata_copy(&oc->metadata, metadata, 0);
av_metadata_free(&metadata);
}
output_files[nb_output_files++] = oc;
if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
if (!av_filename_number_test(oc->filename)) {
print_error(oc->filename, AVERROR_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);
av_freep(&forced_key_frames);
}
ffmpeg.c:3714: error: Null Dereference
pointer `oc` last assigned on line 3692 could be null and is dereferenced at line 3714, column 5.
ffmpeg.c:3681:1: start of procedure opt_output_file()
3679. }
3680.
3681. static void opt_output_file(const char *filename)
^
3682. {
3683. AVFormatContext *oc;
ffmpeg.c:3686:5:
3684. int err, use_video, use_audio, use_subtitle;
3685. int input_has_video, input_has_audio, input_has_subtitle;
3686. AVFormatParameters params, *ap = ¶ms;
^
3687. AVOutputFormat *file_oformat;
3688.
ffmpeg.c:3689:10: Taking false branch
3687. AVOutputFormat *file_oformat;
3688.
3689. if (!strcmp(filename, "-"))
^
3690. filename = "pipe:";
3691.
ffmpeg.c:3692:5:
3690. filename = "pipe:";
3691.
3692. oc = avformat_alloc_context();
^
3693. if (!oc) {
3694. print_error(filename, AVERROR(ENOMEM));
libavformat/options.c:82:1: start of procedure avformat_alloc_context()
80. }
81.
82. AVFormatContext *avformat_alloc_context(void)
^
83. {
84. AVFormatContext *ic;
libavformat/options.c:85:5:
83. {
84. AVFormatContext *ic;
85. ic = av_malloc(sizeof(AVFormatContext));
^
86. if (!ic) return ic;
87. avformat_get_context_defaults(ic);
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(FF_INTERNAL_MEM_TYPE size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-16) )
^
73. return NULL;
74.
libavutil/mem.c:83:9: Taking false branch
81. ((char*)ptr)[-1]= diff;
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,16,size))
^
84. ptr = NULL;
85. #elif HAVE_MEMALIGN
libavutil/mem.c:116:5:
114. ptr = malloc(size);
115. #endif
116. return ptr;
^
117. }
118.
libavutil/mem.c:117:1: return from a call to av_malloc
115. #endif
116. return ptr;
117. }
^
118.
119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
libavformat/options.c:86:10: Taking 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:3693:10: Taking true branch
3691.
3692. oc = avformat_alloc_context();
3693. if (!oc) {
^
3694. print_error(filename, AVERROR(ENOMEM));
3695. ffmpeg_exit(1);
ffmpeg.c:3694:9:
3692. oc = avformat_alloc_context();
3693. if (!oc) {
3694. print_error(filename, AVERROR(ENOMEM));
^
3695. ffmpeg_exit(1);
3696. }
cmdutils.c:370:1: start of procedure print_error()
368. }
369.
370. void print_error(const char *filename, int err)
^
371. {
372. char errbuf[128];
cmdutils.c:373:5:
371. {
372. char errbuf[128];
373. const char *errbuf_ptr = errbuf;
^
374.
375. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
cmdutils.c:375:9: Taking true branch
373. const char *errbuf_ptr = errbuf;
374.
375. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
^
376. errbuf_ptr = strerror(AVUNERROR(err));
377. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
cmdutils.c:376:9: Skipping strerror(): method has no implementation
374.
375. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
376. errbuf_ptr = strerror(AVUNERROR(err));
^
377. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
378. }
cmdutils.c:377:5:
375. if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
376. errbuf_ptr = strerror(AVUNERROR(err));
377. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
^
378. }
379.
cmdutils.c:378:1: return from a call to print_error
376. errbuf_ptr = strerror(AVUNERROR(err));
377. fprintf(stderr, "%s: %s\n", filename, errbuf_ptr);
378. }
^
379.
380. static int warned_cfg = 0;
ffmpeg.c:3695:9: Skipping ffmpeg_exit(): empty list of specs
3693. if (!oc) {
3694. print_error(filename, AVERROR(ENOMEM));
3695. ffmpeg_exit(1);
^
3696. }
3697.
ffmpeg.c:3698:9: Taking true branch
3696. }
3697.
3698. if (last_asked_format) {
^
3699. file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3700. if (!file_oformat) {
ffmpeg.c:3699:9: Skipping av_guess_format(): empty list of specs
3697.
3698. if (last_asked_format) {
3699. file_oformat = av_guess_format(last_asked_format, NULL, NULL);
^
3700. if (!file_oformat) {
3701. fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
ffmpeg.c:3700:14: Taking false branch
3698. if (last_asked_format) {
3699. file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3700. if (!file_oformat) {
^
3701. fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3702. ffmpeg_exit(1);
ffmpeg.c:3704:9:
3702. ffmpeg_exit(1);
3703. }
3704. last_asked_format = NULL;
^
3705. } else {
3706. file_oformat = av_guess_format(NULL, filename, NULL);
ffmpeg.c:3714:5:
3712. }
3713.
3714. oc->oformat = file_oformat;
^
3715. av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3716.
|
https://github.com/libav/libav/blob/f4c79d1e0b2e797012304db57903e4091b0c2d7c/ffmpeg.c/#L3714
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.