id
stringlengths 25
25
| content
stringlengths 649
72.1k
| max_stars_repo_path
stringlengths 91
133
|
|---|---|---|
d2a_code_trace_data_43654
|
void av_close_input_stream(AVFormatContext *s)
{
int i;
AVStream *st;
if (s->cur_st && s->cur_st->parser)
av_free_packet(&s->cur_pkt);
if (s->iformat->read_close)
s->iformat->read_close(s);
for(i=0;i<s->nb_streams;i++) {
st = s->streams[i];
if (st->parser) {
av_parser_close(st->parser);
}
av_free(st->index_entries);
av_free(st->codec->extradata);
av_free(st->codec);
av_free(st->filename);
av_free(st);
}
for(i=s->nb_programs-1; i>=0; i--) {
av_freep(&s->programs[i]->provider_name);
av_freep(&s->programs[i]->name);
av_freep(&s->programs[i]->stream_index);
av_freep(&s->programs[i]);
}
flush_packet_queue(s);
av_freep(&s->priv_data);
av_free(s);
}
vhook/watermark.c:116: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `get_watermark_picture`.
vhook/watermark.c:116:9: Call
114.
115. if (ci) {
116. get_watermark_picture(ci, 1);
^
117. sws_freeContext(ci->toRGB_convert_ctx);
118. sws_freeContext(ci->watermark_convert_ctx);
vhook/watermark.c:454:1: Parameter `ci->pFormatCtx->nb_programs`
452. * 0 = ok, -1 = error
453. ****************************************************************************/
454. int get_watermark_picture(ContextInfo *ci, int cleanup)
^
455. {
456. if (1 == ci->is_done && 0 == cleanup) return 0;
vhook/watermark.c:645:13: Call
643. // Close the video file
644. if (0 != ci->pFormatCtx) {
645. av_close_input_file(ci->pFormatCtx);
^
646. ci->pFormatCtx = 0;
647. }
libavformat/utils.c:2152:1: Parameter `s->nb_programs`
2150. }
2151.
2152. void av_close_input_file(AVFormatContext *s)
^
2153. {
2154. ByteIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb;
libavformat/utils.c:2155:5: Call
2153. {
2154. ByteIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb;
2155. av_close_input_stream(s);
^
2156. if (pb)
2157. url_fclose(pb);
libavformat/utils.c:2118:1: <LHS trace>
2116. }
2117.
2118. void av_close_input_stream(AVFormatContext *s)
^
2119. {
2120. int i;
libavformat/utils.c:2118:1: Parameter `s->nb_programs`
2116. }
2117.
2118. void av_close_input_stream(AVFormatContext *s)
^
2119. {
2120. int i;
libavformat/utils.c:2141:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `get_watermark_picture`
2139. av_free(st);
2140. }
2141. for(i=s->nb_programs-1; i>=0; i--) {
^
2142. av_freep(&s->programs[i]->provider_name);
2143. av_freep(&s->programs[i]->name);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/utils.c/#L2141
|
d2a_code_trace_data_43655
|
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
{
PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
(diff > (0 - (PTRDIFF_T)len)));
return overlapped;
}
crypto/rand/drbg_ctr.c:333: error: INTEGER_OVERFLOW_L2
(0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`.
Showing all 10 steps of the trace
crypto/rand/drbg_ctr.c:309:8: Parameter `drbg->data.ctr.cipher->block_size`
307. }
308.
309. __owur static int drbg_ctr_generate(RAND_DRBG *drbg,
^
310. unsigned char *out, size_t outlen,
311. const unsigned char *adin, size_t adinlen)
crypto/rand/drbg_ctr.c:333:18: Call
331. if (outlen < 16) {
332. /* Use K as temp space as it will be updated */
333. if (!EVP_CipherUpdate(ctr->ctx, ctr->K, &outl, ctr->V,
^
334. AES_BLOCK_SIZE)
335. || outl != AES_BLOCK_SIZE)
crypto/evp/evp_enc.c:209:1: Parameter `ctx->cipher->block_size`
207. }
208.
209. > int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
210. const unsigned char *in, int inl)
211. {
crypto/evp/evp_enc.c:215:16: Call
213. return EVP_EncryptUpdate(ctx, out, outl, in, inl);
214. else
215. return EVP_DecryptUpdate(ctx, out, outl, in, inl);
^
216. }
217.
crypto/evp/evp_enc.c:423:1: Parameter `ctx->cipher->block_size`
421. }
422.
423. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
424. const unsigned char *in, int inl)
425. {
crypto/evp/evp_enc.c:429:5: Assignment
427. unsigned int b;
428.
429. b = ctx->cipher->block_size;
^
430.
431. if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))
crypto/evp/evp_enc.c:462:16: Call
460. /* see comment about PTRDIFF_T comparison above */
461. if (((PTRDIFF_T)out == (PTRDIFF_T)in)
462. || is_partially_overlapping(out, in, b)) {
^
463. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING);
464. return 0;
crypto/evp/evp_enc.c:283:1: <RHS trace>
281. #endif
282.
283. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
284. {
285. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:283:1: Parameter `len`
281. #endif
282.
283. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
284. {
285. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:292:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`
290. */
291. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
292. (diff > (0 - (PTRDIFF_T)len)));
^
293.
294. return overlapped;
|
https://github.com/openssl/openssl/blob/e613b1eff40f21cd99240f9884cd3396b0ab50f1/crypto/evp/evp_enc.c/#L292
|
d2a_code_trace_data_43656
|
static int vc1_decode_p_mb(VC1Context *v)
{
MpegEncContext *s = &v->s;
GetBitContext *gb = &s->gb;
int i, j;
int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
int cbp;
int mqdiff, mquant;
int ttmb = v->ttfrm;
int status;
static const int size_table[6] = { 0, 2, 3, 4, 5, 8 },
offset_table[6] = { 0, 1, 3, 7, 15, 31 };
int mb_has_coeffs = 1;
int dmv_x, dmv_y;
int index, index1;
int val, sign;
int first_block = 1;
int dst_idx, off;
int skipped, fourmv;
mquant = v->pq;
if (v->mv_type_is_raw)
fourmv = get_bits1(gb);
else
fourmv = v->mv_type_mb_plane[mb_pos];
if (v->skip_is_raw)
skipped = get_bits1(gb);
else
skipped = v->s.mbskip_table[mb_pos];
s->dsp.clear_blocks(s->block[0]);
if (!fourmv)
{
if (!skipped)
{
GET_MVDATA(dmv_x, dmv_y);
if (s->mb_intra) {
s->current_picture.motion_val[1][s->block_index[0]][0] = 0;
s->current_picture.motion_val[1][s->block_index[0]][1] = 0;
}
s->current_picture.mb_type[mb_pos] = s->mb_intra ? MB_TYPE_INTRA : MB_TYPE_16x16;
vc1_pred_mv(s, 0, dmv_x, dmv_y, 1, v->range_x, v->range_y, v->mb_type[0]);
if (s->mb_intra && !mb_has_coeffs)
{
GET_MQUANT();
s->ac_pred = get_bits1(gb);
cbp = 0;
}
else if (mb_has_coeffs)
{
if (s->mb_intra) s->ac_pred = get_bits1(gb);
cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
GET_MQUANT();
}
else
{
mquant = v->pq;
cbp = 0;
}
s->current_picture.qscale_table[mb_pos] = mquant;
if (!v->ttmbf && !s->mb_intra && mb_has_coeffs)
ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table,
VC1_TTMB_VLC_BITS, 2);
if(!s->mb_intra) vc1_mc_1mv(v, 0);
dst_idx = 0;
for (i=0; i<6; i++)
{
s->dc_val[0][s->block_index[i]] = 0;
dst_idx += i >> 2;
val = ((cbp >> (5 - i)) & 1);
off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
v->mb_type[0][s->block_index[i]] = s->mb_intra;
if(s->mb_intra) {
v->a_avail = v->c_avail = 0;
if(i == 2 || i == 3 || !s->first_slice_line)
v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
if(i == 1 || i == 3 || s->mb_x)
v->c_avail = v->mb_type[0][s->block_index[i] - 1];
vc1_decode_intra_block(v, s->block[i], i, val, mquant, (i&4)?v->codingset2:v->codingset);
if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue;
s->dsp.vc1_inv_trans_8x8(s->block[i]);
if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1;
s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
if(v->pq >= 9 && v->overlap) {
if(v->c_avail)
s->dsp.vc1_h_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
if(v->a_avail)
s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
}
} else if(val) {
vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize, (i&4) && (s->flags & CODEC_FLAG_GRAY));
if(!v->ttmbf && ttmb < 8) ttmb = -1;
first_block = 0;
}
}
}
else
{
s->mb_intra = 0;
for(i = 0; i < 6; i++) {
v->mb_type[0][s->block_index[i]] = 0;
s->dc_val[0][s->block_index[i]] = 0;
}
s->current_picture.mb_type[mb_pos] = MB_TYPE_SKIP;
s->current_picture.qscale_table[mb_pos] = 0;
vc1_pred_mv(s, 0, 0, 0, 1, v->range_x, v->range_y, v->mb_type[0]);
vc1_mc_1mv(v, 0);
return 0;
}
}
else
{
if (!skipped )
{
int intra_count = 0, coded_inter = 0;
int is_intra[6], is_coded[6];
cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
for (i=0; i<6; i++)
{
val = ((cbp >> (5 - i)) & 1);
s->dc_val[0][s->block_index[i]] = 0;
s->mb_intra = 0;
if(i < 4) {
dmv_x = dmv_y = 0;
s->mb_intra = 0;
mb_has_coeffs = 0;
if(val) {
GET_MVDATA(dmv_x, dmv_y);
}
vc1_pred_mv(s, i, dmv_x, dmv_y, 0, v->range_x, v->range_y, v->mb_type[0]);
if(!s->mb_intra) vc1_mc_4mv_luma(v, i);
intra_count += s->mb_intra;
is_intra[i] = s->mb_intra;
is_coded[i] = mb_has_coeffs;
}
if(i&4){
is_intra[i] = (intra_count >= 3);
is_coded[i] = val;
}
if(i == 4) vc1_mc_4mv_chroma(v);
v->mb_type[0][s->block_index[i]] = is_intra[i];
if(!coded_inter) coded_inter = !is_intra[i] & is_coded[i];
}
if(!intra_count && !coded_inter) return 0;
dst_idx = 0;
GET_MQUANT();
s->current_picture.qscale_table[mb_pos] = mquant;
{
int intrapred = 0;
for(i=0; i<6; i++)
if(is_intra[i]) {
if(((!s->first_slice_line || (i==2 || i==3)) && v->mb_type[0][s->block_index[i] - s->block_wrap[i]])
|| ((s->mb_x || (i==1 || i==3)) && v->mb_type[0][s->block_index[i] - 1])) {
intrapred = 1;
break;
}
}
if(intrapred)s->ac_pred = get_bits1(gb);
else s->ac_pred = 0;
}
if (!v->ttmbf && coded_inter)
ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
for (i=0; i<6; i++)
{
dst_idx += i >> 2;
off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize);
s->mb_intra = is_intra[i];
if (is_intra[i]) {
v->a_avail = v->c_avail = 0;
if(i == 2 || i == 3 || !s->first_slice_line)
v->a_avail = v->mb_type[0][s->block_index[i] - s->block_wrap[i]];
if(i == 1 || i == 3 || s->mb_x)
v->c_avail = v->mb_type[0][s->block_index[i] - 1];
vc1_decode_intra_block(v, s->block[i], i, is_coded[i], mquant, (i&4)?v->codingset2:v->codingset);
if((i>3) && (s->flags & CODEC_FLAG_GRAY)) continue;
s->dsp.vc1_inv_trans_8x8(s->block[i]);
if(v->rangeredfrm) for(j = 0; j < 64; j++) s->block[i][j] <<= 1;
s->dsp.put_signed_pixels_clamped(s->block[i], s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize);
if(v->pq >= 9 && v->overlap) {
if(v->c_avail)
s->dsp.vc1_h_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
if(v->a_avail)
s->dsp.vc1_v_overlap(s->dest[dst_idx] + off, s->linesize >> ((i & 4) >> 2));
}
} else if(is_coded[i]) {
status = vc1_decode_p_block(v, s->block[i], i, mquant, ttmb, first_block, s->dest[dst_idx] + off, (i&4)?s->uvlinesize:s->linesize, (i&4) && (s->flags & CODEC_FLAG_GRAY));
if(!v->ttmbf && ttmb < 8) ttmb = -1;
first_block = 0;
}
}
return status;
}
else
{
s->mb_intra = 0;
s->current_picture.qscale_table[mb_pos] = 0;
for (i=0; i<6; i++) {
v->mb_type[0][s->block_index[i]] = 0;
s->dc_val[0][s->block_index[i]] = 0;
}
for (i=0; i<4; i++)
{
vc1_pred_mv(s, i, 0, 0, 0, v->range_x, v->range_y, v->mb_type[0]);
vc1_mc_4mv_luma(v, i);
}
vc1_mc_4mv_chroma(v);
s->current_picture.qscale_table[mb_pos] = 0;
return 0;
}
}
return -1;
}
libavcodec/vc1.c:3156: error: Uninitialized Value
The value read from is_intra[_] was never initialized.
libavcodec/vc1.c:3156:49:
3154. if(i == 4) vc1_mc_4mv_chroma(v);
3155. v->mb_type[0][s->block_index[i]] = is_intra[i];
3156. if(!coded_inter) coded_inter = !is_intra[i] & is_coded[i];
^
3157. }
3158. // if there are no coded blocks then don't do anything more
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vc1.c/#L3156
|
d2a_code_trace_data_43657
|
static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest,
LHASH *conf, char *section)
{
EVP_PKEY *pktmp;
pktmp = X509_get_pubkey(x);
EVP_PKEY_copy_parameters(pktmp,pkey);
EVP_PKEY_save_parameters(pktmp,1);
EVP_PKEY_free(pktmp);
if (!X509_set_issuer_name(x,X509_get_subject_name(x))) goto err;
if (X509_gmtime_adj(X509_get_notBefore(x),0) == NULL) goto err;
if (X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days) == NULL)
goto err;
if (!X509_set_pubkey(x,pkey)) goto err;
if(clrext) {
while(X509_get_ext_count(x) > 0) X509_delete_ext(x, 0);
}
if(conf) {
X509V3_CTX ctx;
X509_set_version(x,2);
X509V3_set_ctx(&ctx, x, x, NULL, NULL, 0);
X509V3_set_conf_lhash(&ctx, conf);
if(!X509V3_EXT_add_conf(conf, &ctx, section, x)) goto err;
}
if (!X509_sign(x,pkey,digest)) goto err;
return(1);
err:
ERR_print_errors(bio_err);
return(0);
}
apps/x509.c:1127: error: NULL_DEREFERENCE
pointer `pktmp` last assigned on line 1125 could be null and is dereferenced by call to `EVP_PKEY_save_parameters()` at line 1127, column 2.
Showing all 11 steps of the trace
apps/x509.c:1119:1: start of procedure sign()
1117.
1118. /* self sign */
1119. > static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest,
1120. LHASH *conf, char *section)
1121. {
apps/x509.c:1125:2:
1123. EVP_PKEY *pktmp;
1124.
1125. > pktmp = X509_get_pubkey(x);
1126. EVP_PKEY_copy_parameters(pktmp,pkey);
1127. EVP_PKEY_save_parameters(pktmp,1);
crypto/x509/x509_cmp.c:260:1: start of procedure X509_get_pubkey()
258. }
259.
260. > EVP_PKEY *X509_get_pubkey(X509 *x)
261. {
262. if ((x == NULL) || (x->cert_info == NULL))
crypto/x509/x509_cmp.c:262:7: Taking false branch
260. EVP_PKEY *X509_get_pubkey(X509 *x)
261. {
262. if ((x == NULL) || (x->cert_info == NULL))
^
263. return(NULL);
264. return(X509_PUBKEY_get(x->cert_info->key));
crypto/x509/x509_cmp.c:262:22: Taking true branch
260. EVP_PKEY *X509_get_pubkey(X509 *x)
261. {
262. if ((x == NULL) || (x->cert_info == NULL))
^
263. return(NULL);
264. return(X509_PUBKEY_get(x->cert_info->key));
crypto/x509/x509_cmp.c:263:3:
261. {
262. if ((x == NULL) || (x->cert_info == NULL))
263. > return(NULL);
264. return(X509_PUBKEY_get(x->cert_info->key));
265. }
crypto/x509/x509_cmp.c:265:2: return from a call to X509_get_pubkey
263. return(NULL);
264. return(X509_PUBKEY_get(x->cert_info->key));
265. }
^
266.
267. int X509_check_private_key(X509 *x, EVP_PKEY *k)
apps/x509.c:1126:2: Skipping EVP_PKEY_copy_parameters(): empty list of specs
1124.
1125. pktmp = X509_get_pubkey(x);
1126. EVP_PKEY_copy_parameters(pktmp,pkey);
^
1127. EVP_PKEY_save_parameters(pktmp,1);
1128. EVP_PKEY_free(pktmp);
apps/x509.c:1127:2:
1125. pktmp = X509_get_pubkey(x);
1126. EVP_PKEY_copy_parameters(pktmp,pkey);
1127. > EVP_PKEY_save_parameters(pktmp,1);
1128. EVP_PKEY_free(pktmp);
1129.
crypto/evp/p_lib.c:97:1: start of procedure EVP_PKEY_save_parameters()
95. }
96.
97. > int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode)
98. {
99. #ifndef NO_DSA
crypto/evp/p_lib.c:100:6:
98. {
99. #ifndef NO_DSA
100. > if (pkey->type == EVP_PKEY_DSA)
101. {
102. int ret=pkey->save_parameters=mode;
|
https://github.com/openssl/openssl/blob/a657546f9c376f4b7ba4dce14649598fb1a38de5/apps/x509.c/#L1127
|
d2a_code_trace_data_43658
|
static C_cell *
create_colorcell(int red, int green, int blue)
{
register int ir, ig, ib, i;
register C_cell *ptr;
int mindist, next_n;
register int tmp, dist, n;
ir = red >> (COLOR_DEPTH-C_DEPTH);
ig = green >> (COLOR_DEPTH-C_DEPTH);
ib = blue >> (COLOR_DEPTH-C_DEPTH);
ptr = (C_cell *)_TIFFmalloc(sizeof (C_cell));
*(ColorCells + ir*C_LEN*C_LEN + ig*C_LEN + ib) = ptr;
ptr->num_ents = 0;
mindist = 99999999;
for (i = 0; i < num_colors; ++i) {
if (rm[i]>>(COLOR_DEPTH-C_DEPTH) != ir ||
gm[i]>>(COLOR_DEPTH-C_DEPTH) != ig ||
bm[i]>>(COLOR_DEPTH-C_DEPTH) != ib)
continue;
ptr->entries[ptr->num_ents][0] = i;
ptr->entries[ptr->num_ents][1] = 0;
++ptr->num_ents;
tmp = rm[i] - red;
if (tmp < (MAX_COLOR/C_LEN/2))
tmp = MAX_COLOR/C_LEN-1 - tmp;
dist = tmp*tmp;
tmp = gm[i] - green;
if (tmp < (MAX_COLOR/C_LEN/2))
tmp = MAX_COLOR/C_LEN-1 - tmp;
dist += tmp*tmp;
tmp = bm[i] - blue;
if (tmp < (MAX_COLOR/C_LEN/2))
tmp = MAX_COLOR/C_LEN-1 - tmp;
dist += tmp*tmp;
if (dist < mindist)
mindist = dist;
}
for (i = 0; i < num_colors; ++i) {
if (rm[i] >> (COLOR_DEPTH-C_DEPTH) == ir &&
gm[i] >> (COLOR_DEPTH-C_DEPTH) == ig &&
bm[i] >> (COLOR_DEPTH-C_DEPTH) == ib)
continue;
dist = 0;
if ((tmp = red - rm[i]) > 0 ||
(tmp = rm[i] - (red + MAX_COLOR/C_LEN-1)) > 0 )
dist += tmp*tmp;
if ((tmp = green - gm[i]) > 0 ||
(tmp = gm[i] - (green + MAX_COLOR/C_LEN-1)) > 0 )
dist += tmp*tmp;
if ((tmp = blue - bm[i]) > 0 ||
(tmp = bm[i] - (blue + MAX_COLOR/C_LEN-1)) > 0 )
dist += tmp*tmp;
if (dist < mindist) {
ptr->entries[ptr->num_ents][0] = i;
ptr->entries[ptr->num_ents][1] = dist;
++ptr->num_ents;
}
}
for (n = ptr->num_ents - 1; n > 0; n = next_n) {
next_n = 0;
for (i = 0; i < n; ++i)
if (ptr->entries[i][1] > ptr->entries[i+1][1]) {
tmp = ptr->entries[i][0];
ptr->entries[i][0] = ptr->entries[i+1][0];
ptr->entries[i+1][0] = tmp;
tmp = ptr->entries[i][1];
ptr->entries[i][1] = ptr->entries[i+1][1];
ptr->entries[i+1][1] = tmp;
next_n = i;
}
}
return (ptr);
}
tools/tiffmedian.c:638: error: Null Dereference
pointer `ptr` last assigned on line 636 could be null and is dereferenced at line 638, column 2.
tools/tiffmedian.c:625:1: start of procedure create_colorcell()
623. }
624.
625. static C_cell *
^
626. create_colorcell(int red, int green, int blue)
627. {
tools/tiffmedian.c:633:2:
631. register int tmp, dist, n;
632.
633. ir = red >> (COLOR_DEPTH-C_DEPTH);
^
634. ig = green >> (COLOR_DEPTH-C_DEPTH);
635. ib = blue >> (COLOR_DEPTH-C_DEPTH);
tools/tiffmedian.c:634:2:
632.
633. ir = red >> (COLOR_DEPTH-C_DEPTH);
634. ig = green >> (COLOR_DEPTH-C_DEPTH);
^
635. ib = blue >> (COLOR_DEPTH-C_DEPTH);
636. ptr = (C_cell *)_TIFFmalloc(sizeof (C_cell));
tools/tiffmedian.c:635:2:
633. ir = red >> (COLOR_DEPTH-C_DEPTH);
634. ig = green >> (COLOR_DEPTH-C_DEPTH);
635. ib = blue >> (COLOR_DEPTH-C_DEPTH);
^
636. ptr = (C_cell *)_TIFFmalloc(sizeof (C_cell));
637. *(ColorCells + ir*C_LEN*C_LEN + ig*C_LEN + ib) = ptr;
tools/tiffmedian.c:636:2:
634. ig = green >> (COLOR_DEPTH-C_DEPTH);
635. ib = blue >> (COLOR_DEPTH-C_DEPTH);
636. ptr = (C_cell *)_TIFFmalloc(sizeof (C_cell));
^
637. *(ColorCells + ir*C_LEN*C_LEN + ig*C_LEN + ib) = ptr;
638. ptr->num_ents = 0;
libtiff/tif_unix.c:310:1: start of procedure _TIFFmalloc()
308. #endif
309.
310. void*
^
311. _TIFFmalloc(tmsize_t s)
312. {
libtiff/tif_unix.c:313:13: Taking false branch
311. _TIFFmalloc(tmsize_t s)
312. {
313. if (s == 0)
^
314. return ((void *) NULL);
315.
libtiff/tif_unix.c:316:2:
314. return ((void *) NULL);
315.
316. return (malloc((size_t) s));
^
317. }
318.
libtiff/tif_unix.c:317:1: return from a call to _TIFFmalloc
315.
316. return (malloc((size_t) s));
317. }
^
318.
319. void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)
tools/tiffmedian.c:637:2:
635. ib = blue >> (COLOR_DEPTH-C_DEPTH);
636. ptr = (C_cell *)_TIFFmalloc(sizeof (C_cell));
637. *(ColorCells + ir*C_LEN*C_LEN + ig*C_LEN + ib) = ptr;
^
638. ptr->num_ents = 0;
639.
tools/tiffmedian.c:638:2:
636. ptr = (C_cell *)_TIFFmalloc(sizeof (C_cell));
637. *(ColorCells + ir*C_LEN*C_LEN + ig*C_LEN + ib) = ptr;
638. ptr->num_ents = 0;
^
639.
640. /*
|
https://gitlab.com/libtiff/libtiff/blob/6dac309a9701d15ac52d895d566ddae2ed49db9b/tools/tiffmedian.c/#L638
|
d2a_code_trace_data_43659
|
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:461: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_free`.
Showing all 17 steps of the trace
test/sslapitest.c:445:17: Call
443. if (!TEST_true(SSL_CTX_set_cipher_list(cctx,
444. "AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384"))
445. || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl,
^
446. &clientssl, NULL, NULL))
447. || !TEST_false(create_ssl_connection(serverssl, clientssl,
test/ssltestlib.c:559:15: Call
557. if (*sssl != NULL)
558. serverssl = *sssl;
559. else if (!TEST_ptr(serverssl = SSL_new(serverctx)))
^
560. goto error;
561. if (*cssl != NULL)
ssl/ssl_lib.c:522:1: Parameter `ctx->sessions->num_items`
520. }
521.
522. > SSL *SSL_new(SSL_CTX *ctx)
523. {
524. SSL *s;
test/sslapitest.c:461:5: Call
459.
460. end:
461. SSL_free(serverssl);
^
462. SSL_free(clientssl);
463. SSL_CTX_free(sctx);
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_43660
|
char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
{
X509_NAME_ENTRY *ne;
int i;
int n, lold, l, l1, l2, num, j, type;
const char *s;
char *p;
unsigned char *q;
BUF_MEM *b = NULL;
static const char hex[17] = "0123456789ABCDEF";
int gs_doit[4];
char tmp_buf[80];
#ifdef CHARSET_EBCDIC
unsigned char ebcdic_buf[1024];
#endif
if (buf == NULL) {
if ((b = BUF_MEM_new()) == NULL)
goto err;
if (!BUF_MEM_grow(b, 200))
goto err;
b->data[0] = '\0';
len = 200;
} else if (len == 0) {
return NULL;
}
if (a == NULL) {
if (b) {
buf = b->data;
OPENSSL_free(b);
}
strncpy(buf, "NO X509_NAME", len);
buf[len - 1] = '\0';
return buf;
}
len--;
l = 0;
for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
ne = sk_X509_NAME_ENTRY_value(a->entries, i);
n = OBJ_obj2nid(ne->object);
if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) {
i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object);
s = tmp_buf;
}
l1 = strlen(s);
type = ne->value->type;
num = ne->value->length;
if (num > NAME_ONELINE_MAX) {
X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG);
goto end;
}
q = ne->value->data;
#ifdef CHARSET_EBCDIC
if (type == V_ASN1_GENERALSTRING ||
type == V_ASN1_VISIBLESTRING ||
type == V_ASN1_PRINTABLESTRING ||
type == V_ASN1_TELETEXSTRING ||
type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) {
ascii2ebcdic(ebcdic_buf, q, (num > (int)sizeof(ebcdic_buf))
? (int)sizeof(ebcdic_buf) : num);
q = ebcdic_buf;
}
#endif
if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) {
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0;
for (j = 0; j < num; j++)
if (q[j] != 0)
gs_doit[j & 3] = 1;
if (gs_doit[0] | gs_doit[1] | gs_doit[2])
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
else {
gs_doit[0] = gs_doit[1] = gs_doit[2] = 0;
gs_doit[3] = 1;
}
} else
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
for (l2 = j = 0; j < num; j++) {
if (!gs_doit[j & 3])
continue;
l2++;
#ifndef CHARSET_EBCDIC
if ((q[j] < ' ') || (q[j] > '~'))
l2 += 3;
#else
if ((os_toascii[q[j]] < os_toascii[' ']) ||
(os_toascii[q[j]] > os_toascii['~']))
l2 += 3;
#endif
}
lold = l;
l += 1 + l1 + 1 + l2;
if (l > NAME_ONELINE_MAX) {
X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG);
goto end;
}
if (b != NULL) {
if (!BUF_MEM_grow(b, l + 1))
goto err;
p = &(b->data[lold]);
} else if (l > len) {
break;
} else
p = &(buf[lold]);
*(p++) = '/';
memcpy(p, s, (unsigned int)l1);
p += l1;
*(p++) = '=';
#ifndef CHARSET_EBCDIC
q = ne->value->data;
#endif
for (j = 0; j < num; j++) {
if (!gs_doit[j & 3])
continue;
#ifndef CHARSET_EBCDIC
n = q[j];
if ((n < ' ') || (n > '~')) {
*(p++) = '\\';
*(p++) = 'x';
*(p++) = hex[(n >> 4) & 0x0f];
*(p++) = hex[n & 0x0f];
} else
*(p++) = n;
#else
n = os_toascii[q[j]];
if ((n < os_toascii[' ']) || (n > os_toascii['~'])) {
*(p++) = '\\';
*(p++) = 'x';
*(p++) = hex[(n >> 4) & 0x0f];
*(p++) = hex[n & 0x0f];
} else
*(p++) = q[j];
#endif
}
*p = '\0';
}
if (b != NULL) {
p = b->data;
OPENSSL_free(b);
} else
p = buf;
if (i == 0)
*p = '\0';
return (p);
err:
X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE);
end:
BUF_MEM_free(b);
return (NULL);
}
crypto/x509/x_name.c:536: error: BUFFER_OVERRUN_L3
Offset added: [0, 200] Size: [1, 2147483644] by call to `X509_NAME_oneline`.
Showing all 6 steps of the trace
crypto/x509/x_name.c:536:9: Call
534. l = 80 - 2 - obase;
535.
536. b = X509_NAME_oneline(name, NULL, 0);
^
537. if (!b)
538. return 0;
crypto/x509/x509_obj.c:73:1: <Offset trace>
71. #define NAME_ONELINE_MAX (1024 * 1024)
72.
73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
74. {
75. X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:73:1: Parameter `len`
71. #define NAME_ONELINE_MAX (1024 * 1024)
72.
73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
74. {
75. X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:73:1: <Length trace>
71. #define NAME_ONELINE_MAX (1024 * 1024)
72.
73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
74. {
75. X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:73:1: Parameter `*buf`
71. #define NAME_ONELINE_MAX (1024 * 1024)
72.
73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
74. {
75. X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:104:9: Array access: Offset added: [0, 200] Size: [1, 2147483644] by call to `X509_NAME_oneline`
102. OPENSSL_free(b);
103. }
104. strncpy(buf, "NO X509_NAME", len);
^
105. buf[len - 1] = '\0';
106. return buf;
|
https://github.com/openssl/openssl/blob/24c2cd3967ed23acc0bd31a3781c4525e2e42a2c/crypto/x509/x509_obj.c/#L104
|
d2a_code_trace_data_43661
|
static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, int motion_y, int mb_block_height, int mb_block_count)
{
int16_t weight[8][64];
DCTELEM orig[8][64];
const int mb_x= s->mb_x;
const int mb_y= s->mb_y;
int i;
int skip_dct[8];
int dct_offset = s->linesize*8;
uint8_t *ptr_y, *ptr_cb, *ptr_cr;
int wrap_y, wrap_c;
for(i=0; i<mb_block_count; i++) skip_dct[i]=s->skipdct;
if(s->adaptive_quant){
const int last_qp= s->qscale;
const int mb_xy= mb_x + mb_y*s->mb_stride;
s->lambda= s->lambda_table[mb_xy];
update_qscale(s);
if(!(s->flags&CODEC_FLAG_QP_RD)){
s->qscale= s->current_picture_ptr->qscale_table[mb_xy];
s->dquant= s->qscale - last_qp;
if(s->out_format==FMT_H263){
s->dquant= av_clip(s->dquant, -2, 2);
if(s->codec_id==CODEC_ID_MPEG4){
if(!s->mb_intra){
if(s->pict_type == FF_B_TYPE){
if(s->dquant&1 || s->mv_dir&MV_DIRECT)
s->dquant= 0;
}
if(s->mv_type==MV_TYPE_8X8)
s->dquant=0;
}
}
}
}
ff_set_qscale(s, last_qp + s->dquant);
}else if(s->flags&CODEC_FLAG_QP_RD)
ff_set_qscale(s, s->qscale + s->dquant);
wrap_y = s->linesize;
wrap_c = s->uvlinesize;
ptr_y = s->new_picture.data[0] + (mb_y * 16 * wrap_y) + mb_x * 16;
ptr_cb = s->new_picture.data[1] + (mb_y * mb_block_height * wrap_c) + mb_x * 8;
ptr_cr = s->new_picture.data[2] + (mb_y * mb_block_height * wrap_c) + mb_x * 8;
if(mb_x*16+16 > s->width || mb_y*16+16 > s->height){
uint8_t *ebuf= s->edge_emu_buffer + 32;
ff_emulated_edge_mc(ebuf , ptr_y , wrap_y,16,16,mb_x*16,mb_y*16, s->width , s->height);
ptr_y= ebuf;
ff_emulated_edge_mc(ebuf+18*wrap_y , ptr_cb, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1);
ptr_cb= ebuf+18*wrap_y;
ff_emulated_edge_mc(ebuf+18*wrap_y+8, ptr_cr, wrap_c, 8, mb_block_height, mb_x*8, mb_y*8, s->width>>1, s->height>>1);
ptr_cr= ebuf+18*wrap_y+8;
}
if (s->mb_intra) {
if(s->flags&CODEC_FLAG_INTERLACED_DCT){
int progressive_score, interlaced_score;
s->interlaced_dct=0;
progressive_score= s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y, 8)
+s->dsp.ildct_cmp[4](s, ptr_y + wrap_y*8, NULL, wrap_y, 8) - 400;
if(progressive_score > 0){
interlaced_score = s->dsp.ildct_cmp[4](s, ptr_y , NULL, wrap_y*2, 8)
+s->dsp.ildct_cmp[4](s, ptr_y + wrap_y , NULL, wrap_y*2, 8);
if(progressive_score > interlaced_score){
s->interlaced_dct=1;
dct_offset= wrap_y;
wrap_y<<=1;
if (s->chroma_format == CHROMA_422)
wrap_c<<=1;
}
}
}
s->dsp.get_pixels(s->block[0], ptr_y , wrap_y);
s->dsp.get_pixels(s->block[1], ptr_y + 8, wrap_y);
s->dsp.get_pixels(s->block[2], ptr_y + dct_offset , wrap_y);
s->dsp.get_pixels(s->block[3], ptr_y + dct_offset + 8, wrap_y);
if(s->flags&CODEC_FLAG_GRAY){
skip_dct[4]= 1;
skip_dct[5]= 1;
}else{
s->dsp.get_pixels(s->block[4], ptr_cb, wrap_c);
s->dsp.get_pixels(s->block[5], ptr_cr, wrap_c);
if(!s->chroma_y_shift){
s->dsp.get_pixels(s->block[6], ptr_cb + (dct_offset>>1), wrap_c);
s->dsp.get_pixels(s->block[7], ptr_cr + (dct_offset>>1), wrap_c);
}
}
}else{
op_pixels_func (*op_pix)[4];
qpel_mc_func (*op_qpix)[16];
uint8_t *dest_y, *dest_cb, *dest_cr;
dest_y = s->dest[0];
dest_cb = s->dest[1];
dest_cr = s->dest[2];
if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){
op_pix = s->dsp.put_pixels_tab;
op_qpix= s->dsp.put_qpel_pixels_tab;
}else{
op_pix = s->dsp.put_no_rnd_pixels_tab;
op_qpix= s->dsp.put_no_rnd_qpel_pixels_tab;
}
if (s->mv_dir & MV_DIR_FORWARD) {
MPV_motion(s, dest_y, dest_cb, dest_cr, 0, s->last_picture.data, op_pix, op_qpix);
op_pix = s->dsp.avg_pixels_tab;
op_qpix= s->dsp.avg_qpel_pixels_tab;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
MPV_motion(s, dest_y, dest_cb, dest_cr, 1, s->next_picture.data, op_pix, op_qpix);
}
if(s->flags&CODEC_FLAG_INTERLACED_DCT){
int progressive_score, interlaced_score;
s->interlaced_dct=0;
progressive_score= s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y, 8)
+s->dsp.ildct_cmp[0](s, dest_y + wrap_y*8, ptr_y + wrap_y*8, wrap_y, 8) - 400;
if(s->avctx->ildct_cmp == FF_CMP_VSSE) progressive_score -= 400;
if(progressive_score>0){
interlaced_score = s->dsp.ildct_cmp[0](s, dest_y , ptr_y , wrap_y*2, 8)
+s->dsp.ildct_cmp[0](s, dest_y + wrap_y , ptr_y + wrap_y , wrap_y*2, 8);
if(progressive_score > interlaced_score){
s->interlaced_dct=1;
dct_offset= wrap_y;
wrap_y<<=1;
if (s->chroma_format == CHROMA_422)
wrap_c<<=1;
}
}
}
s->dsp.diff_pixels(s->block[0], ptr_y , dest_y , wrap_y);
s->dsp.diff_pixels(s->block[1], ptr_y + 8, dest_y + 8, wrap_y);
s->dsp.diff_pixels(s->block[2], ptr_y + dct_offset , dest_y + dct_offset , wrap_y);
s->dsp.diff_pixels(s->block[3], ptr_y + dct_offset + 8, dest_y + dct_offset + 8, wrap_y);
if(s->flags&CODEC_FLAG_GRAY){
skip_dct[4]= 1;
skip_dct[5]= 1;
}else{
s->dsp.diff_pixels(s->block[4], ptr_cb, dest_cb, wrap_c);
s->dsp.diff_pixels(s->block[5], ptr_cr, dest_cr, wrap_c);
if(!s->chroma_y_shift){
s->dsp.diff_pixels(s->block[6], ptr_cb + (dct_offset>>1), dest_cb + (dct_offset>>1), wrap_c);
s->dsp.diff_pixels(s->block[7], ptr_cr + (dct_offset>>1), dest_cr + (dct_offset>>1), wrap_c);
}
}
if(s->current_picture.mc_mb_var[s->mb_stride*mb_y+ mb_x]<2*s->qscale*s->qscale){
if(s->dsp.sad[1](NULL, ptr_y , dest_y , wrap_y, 8) < 20*s->qscale) skip_dct[0]= 1;
if(s->dsp.sad[1](NULL, ptr_y + 8, dest_y + 8, wrap_y, 8) < 20*s->qscale) skip_dct[1]= 1;
if(s->dsp.sad[1](NULL, ptr_y +dct_offset , dest_y +dct_offset , wrap_y, 8) < 20*s->qscale) skip_dct[2]= 1;
if(s->dsp.sad[1](NULL, ptr_y +dct_offset+ 8, dest_y +dct_offset+ 8, wrap_y, 8) < 20*s->qscale) skip_dct[3]= 1;
if(s->dsp.sad[1](NULL, ptr_cb , dest_cb , wrap_c, 8) < 20*s->qscale) skip_dct[4]= 1;
if(s->dsp.sad[1](NULL, ptr_cr , dest_cr , wrap_c, 8) < 20*s->qscale) skip_dct[5]= 1;
if(!s->chroma_y_shift){
if(s->dsp.sad[1](NULL, ptr_cb +(dct_offset>>1), dest_cb +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[6]= 1;
if(s->dsp.sad[1](NULL, ptr_cr +(dct_offset>>1), dest_cr +(dct_offset>>1), wrap_c, 8) < 20*s->qscale) skip_dct[7]= 1;
}
}
}
if(s->avctx->quantizer_noise_shaping){
if(!skip_dct[0]) get_visual_weight(weight[0], ptr_y , wrap_y);
if(!skip_dct[1]) get_visual_weight(weight[1], ptr_y + 8, wrap_y);
if(!skip_dct[2]) get_visual_weight(weight[2], ptr_y + dct_offset , wrap_y);
if(!skip_dct[3]) get_visual_weight(weight[3], ptr_y + dct_offset + 8, wrap_y);
if(!skip_dct[4]) get_visual_weight(weight[4], ptr_cb , wrap_c);
if(!skip_dct[5]) get_visual_weight(weight[5], ptr_cr , wrap_c);
if(!s->chroma_y_shift){
if(!skip_dct[6]) get_visual_weight(weight[6], ptr_cb + (dct_offset>>1), wrap_c);
if(!skip_dct[7]) get_visual_weight(weight[7], ptr_cr + (dct_offset>>1), wrap_c);
}
memcpy(orig[0], s->block[0], sizeof(DCTELEM)*64*mb_block_count);
}
assert(s->out_format!=FMT_MJPEG || s->qscale==8);
{
for(i=0;i<mb_block_count;i++) {
if(!skip_dct[i]){
int overflow;
s->block_last_index[i] = s->dct_quantize(s, s->block[i], i, s->qscale, &overflow);
if (overflow) clip_coeffs(s, s->block[i], s->block_last_index[i]);
}else
s->block_last_index[i]= -1;
}
if(s->avctx->quantizer_noise_shaping){
for(i=0;i<mb_block_count;i++) {
if(!skip_dct[i]){
s->block_last_index[i] = dct_quantize_refine(s, s->block[i], weight[i], orig[i], i, s->qscale);
}
}
}
if(s->luma_elim_threshold && !s->mb_intra)
for(i=0; i<4; i++)
dct_single_coeff_elimination(s, i, s->luma_elim_threshold);
if(s->chroma_elim_threshold && !s->mb_intra)
for(i=4; i<mb_block_count; i++)
dct_single_coeff_elimination(s, i, s->chroma_elim_threshold);
if(s->flags & CODEC_FLAG_CBP_RD){
for(i=0;i<mb_block_count;i++) {
if(s->block_last_index[i] == -1)
s->coded_score[i]= INT_MAX/256;
}
}
}
if((s->flags&CODEC_FLAG_GRAY) && s->mb_intra){
s->block_last_index[4]=
s->block_last_index[5]= 0;
s->block[4][0]=
s->block[5][0]= (1024 + s->c_dc_scale/2)/ s->c_dc_scale;
}
if(s->alternate_scan && s->dct_quantize != dct_quantize_c){
for(i=0; i<mb_block_count; i++){
int j;
if(s->block_last_index[i]>0){
for(j=63; j>0; j--){
if(s->block[i][ s->intra_scantable.permutated[j] ]) break;
}
s->block_last_index[i]= j;
}
}
}
switch(s->codec_id){
case CODEC_ID_MPEG1VIDEO:
case CODEC_ID_MPEG2VIDEO:
if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER)
mpeg1_encode_mb(s, s->block, motion_x, motion_y);
break;
case CODEC_ID_MPEG4:
if (ENABLE_MPEG4_ENCODER)
mpeg4_encode_mb(s, s->block, motion_x, motion_y);
break;
case CODEC_ID_MSMPEG4V2:
case CODEC_ID_MSMPEG4V3:
case CODEC_ID_WMV1:
if (ENABLE_MSMPEG4_ENCODER)
msmpeg4_encode_mb(s, s->block, motion_x, motion_y);
break;
case CODEC_ID_WMV2:
if (ENABLE_WMV2_ENCODER)
ff_wmv2_encode_mb(s, s->block, motion_x, motion_y);
break;
case CODEC_ID_H261:
if (ENABLE_H261_ENCODER)
ff_h261_encode_mb(s, s->block, motion_x, motion_y);
break;
case CODEC_ID_H263:
case CODEC_ID_H263P:
case CODEC_ID_FLV1:
case CODEC_ID_RV10:
case CODEC_ID_RV20:
if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER ||
ENABLE_FLV_ENCODER || ENABLE_RV10_ENCODER || ENABLE_RV20_ENCODER)
h263_encode_mb(s, s->block, motion_x, motion_y);
break;
case CODEC_ID_MJPEG:
if (ENABLE_MJPEG_ENCODER)
ff_mjpeg_encode_mb(s, s->block);
break;
default:
assert(0);
}
}
libavcodec/mpegvideo_enc.c:1667: error: Uninitialized Value
The value read from skip_dct[_] was never initialized.
libavcodec/mpegvideo_enc.c:1667:21:
1665. if(s->avctx->quantizer_noise_shaping){
1666. for(i=0;i<mb_block_count;i++) {
1667. if(!skip_dct[i]){
^
1668. s->block_last_index[i] = dct_quantize_refine(s, s->block[i], weight[i], orig[i], i, s->qscale);
1669. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L1667
|
d2a_code_trace_data_43662
|
int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
{
PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
(diff > (0 - (PTRDIFF_T)len)));
return overlapped;
}
crypto/rand/drbg_ctr.c:238: error: INTEGER_OVERFLOW_L2
(0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`.
Showing all 9 steps of the trace
crypto/rand/drbg_ctr.c:238:10: Call
236. /* correct key is already set up. */
237. inc_128(ctr);
238. if (!EVP_CipherUpdate(ctr->ctx, ctr->K, &outlen, ctr->V, AES_BLOCK_SIZE)
^
239. || outlen != AES_BLOCK_SIZE)
240. return 0;
crypto/evp/evp_enc.c:209:1: Parameter `ctx->cipher->block_size`
207. }
208.
209. > int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
210. const unsigned char *in, int inl)
211. {
crypto/evp/evp_enc.c:215:16: Call
213. return EVP_EncryptUpdate(ctx, out, outl, in, inl);
214. else
215. return EVP_DecryptUpdate(ctx, out, outl, in, inl);
^
216. }
217.
crypto/evp/evp_enc.c:423:1: Parameter `ctx->cipher->block_size`
421. }
422.
423. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
424. const unsigned char *in, int inl)
425. {
crypto/evp/evp_enc.c:429:5: Assignment
427. unsigned int b;
428.
429. b = ctx->cipher->block_size;
^
430.
431. if (EVP_CIPHER_CTX_test_flags(ctx, EVP_CIPH_FLAG_LENGTH_BITS))
crypto/evp/evp_enc.c:462:16: Call
460. /* see comment about PTRDIFF_T comparison above */
461. if (((PTRDIFF_T)out == (PTRDIFF_T)in)
462. || is_partially_overlapping(out, in, b)) {
^
463. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING);
464. return 0;
crypto/evp/evp_enc.c:283:1: <RHS trace>
281. #endif
282.
283. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
284. {
285. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:283:1: Parameter `len`
281. #endif
282.
283. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
284. {
285. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:292:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`
290. */
291. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
292. (diff > (0 - (PTRDIFF_T)len)));
^
293.
294. return overlapped;
|
https://github.com/openssl/openssl/blob/e613b1eff40f21cd99240f9884cd3396b0ab50f1/crypto/evp/evp_enc.c/#L292
|
d2a_code_trace_data_43663
|
int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b, *c, *d, *e;
int i;
a = BN_new();
b = BN_new();
c = BN_new();
d = BN_new();
e = BN_new();
BN_one(a);
BN_one(b);
BN_zero(c);
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
"succeeded\n");
return 0;
}
BN_set_word(c, 16);
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
"succeeded\n");
return 0;
}
BN_bntest_rand(c, 30, 0, 1);
for (i = 0; i < num2; i++) {
BN_bntest_rand(a, 20 + i * 5, 0, 0);
BN_bntest_rand(b, 2 + i, 0, 0);
if (!BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL))
return (00);
if (bp != NULL) {
if (!results) {
BN_print(bp, a);
BIO_puts(bp, " ^ ");
BN_print(bp, b);
BIO_puts(bp, " % ");
BN_print(bp, c);
BIO_puts(bp, " - ");
}
BN_print(bp, d);
BIO_puts(bp, "\n");
}
BN_exp(e, a, b, ctx);
BN_sub(e, e, d);
BN_div(a, b, e, c, ctx);
if (!BN_is_zero(b)) {
fprintf(stderr, "Modulo exponentiation test failed!\n");
return 0;
}
}
BN_free(a);
BN_free(b);
BN_free(c);
BN_free(d);
BN_free(e);
return (1);
}
test/bntest.c:1074: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 1058, column 9 is not reachable after line 1074, column 17.
Showing all 154 steps of the trace
test/bntest.c:1052:1: start of procedure test_mod_exp_mont_consttime()
1050. }
1051.
1052. > int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
1053. {
1054. BIGNUM *a, *b, *c, *d, *e;
test/bntest.c:1057:5:
1055. int i;
1056.
1057. > a = BN_new();
1058. b = BN_new();
1059. c = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1058:5:
1056.
1057. a = BN_new();
1058. > b = BN_new();
1059. c = BN_new();
1060. d = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1059:5:
1057. a = BN_new();
1058. b = BN_new();
1059. > c = BN_new();
1060. d = BN_new();
1061. e = BN_new();
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1060:5:
1058. b = BN_new();
1059. c = BN_new();
1060. > d = BN_new();
1061. e = BN_new();
1062.
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1061:5:
1059. c = BN_new();
1060. d = BN_new();
1061. > e = BN_new();
1062.
1063. BN_one(a);
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1063:5:
1061. e = BN_new();
1062.
1063. > BN_one(a);
1064. BN_one(b);
1065. BN_zero(c);
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is true
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:1064:5:
1062.
1063. BN_one(a);
1064. > BN_one(b);
1065. BN_zero(c);
1066. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is true
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:1065:5:
1063. BN_one(a);
1064. BN_one(b);
1065. > BN_zero(c);
1066. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
1067. fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is false
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:1066:9: Taking false branch
1064. BN_one(b);
1065. BN_zero(c);
1066. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
^
1067. fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
1068. "succeeded\n");
test/bntest.c:1072:5:
1070. }
1071.
1072. > BN_set_word(c, 16);
1073. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
1074. fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
crypto/bn/bn_lib.c:530:1: start of procedure BN_set_word()
528. }
529.
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531. {
532. bn_check_top(a);
crypto/bn/bn_lib.c:533:9: Condition is true
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:533:9: Taking false branch
531. {
532. bn_check_top(a);
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
534. return (0);
535. a->neg = 0;
crypto/bn/bn_lib.c:535:5:
533. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
534. return (0);
535. > a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
crypto/bn/bn_lib.c:536:5:
534. return (0);
535. a->neg = 0;
536. > a->d[0] = w;
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
crypto/bn/bn_lib.c:537:15: Condition is true
535. a->neg = 0;
536. a->d[0] = w;
537. a->top = (w ? 1 : 0);
^
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:537:5:
535. a->neg = 0;
536. a->d[0] = w;
537. > a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. return (1);
crypto/bn/bn_lib.c:539:5:
537. a->top = (w ? 1 : 0);
538. bn_check_top(a);
539. > return (1);
540. }
541.
crypto/bn/bn_lib.c:540:1: return from a call to BN_set_word
538. bn_check_top(a);
539. return (1);
540. > }
541.
542. BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
test/bntest.c:1073:9: Taking true branch
1071.
1072. BN_set_word(c, 16);
1073. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
^
1074. fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
1075. "succeeded\n");
test/bntest.c:1074:9:
1072. BN_set_word(c, 16);
1073. if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
1074. > fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
1075. "succeeded\n");
1076. return 0;
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L1074
|
d2a_code_trace_data_43664
|
int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop,
OSSL_PROPERTY_LIST *pl)
{
PROPERTY_DEFN_ELEM elem, *old, *p = NULL;
size_t len;
LHASH_OF(PROPERTY_DEFN_ELEM) *property_defns;
property_defns = openssl_ctx_get_data(ctx, OPENSSL_CTX_PROPERTY_DEFN_INDEX,
&property_defns_method);
if (property_defns == NULL)
return 0;
if (prop == NULL)
return 1;
if (pl == NULL) {
elem.prop = prop;
lh_PROPERTY_DEFN_ELEM_delete(property_defns, &elem);
return 1;
}
len = strlen(prop);
p = OPENSSL_malloc(sizeof(*p) + len);
if (p != NULL) {
p->prop = p->body;
p->defn = pl;
memcpy(p->body, prop, len + 1);
old = lh_PROPERTY_DEFN_ELEM_insert(property_defns, p);
if (old != NULL) {
property_defn_free(old);
return 1;
}
if (!lh_PROPERTY_DEFN_ELEM_error(property_defns))
return 1;
}
OPENSSL_free(p);
return 0;
}
test/property_test.c:232: error: BUFFER_OVERRUN_L3
Offset added: [1, 11] Size: [0, +oo] by call to `ossl_method_store_add`.
Showing all 10 steps of the trace
test/property_test.c:218:9: Array declaration
216. char *impl;
217. } impls[] = {
218. { 6, "position=1", "a" },
^
219. { 6, "position=2", "b" },
220. { 6, "position=3", "c" },
test/property_test.c:232:14: Call
230.
231. for (i = 0; i < OSSL_NELEM(impls); i++)
232. if (!TEST_true(ossl_method_store_add(store, impls[i].nid, impls[i].prop,
^
233. impls[i].impl, NULL))) {
234. TEST_note("iteration %zd", i + 1);
crypto/property/property.c:176:1: Parameter `*properties`
174. }
175.
176. > int ossl_method_store_add(OSSL_METHOD_STORE *store,
177. int nid, const char *properties,
178. void *method, void (*method_destruct)(void *))
crypto/property/property.c:208:9: Call
206. if (impl->properties == NULL)
207. goto err;
208. ossl_prop_defn_set(store->ctx, properties, impl->properties);
^
209. }
210.
crypto/property/defn_cache.c:84:1: <Offset trace>
82. }
83.
84. > int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop,
85. OSSL_PROPERTY_LIST *pl)
86. {
crypto/property/defn_cache.c:84:1: Parameter `prop->strlen`
82. }
83.
84. > int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop,
85. OSSL_PROPERTY_LIST *pl)
86. {
crypto/property/defn_cache.c:104:5: Assignment
102. return 1;
103. }
104. len = strlen(prop);
^
105. p = OPENSSL_malloc(sizeof(*p) + len);
106. if (p != NULL) {
crypto/property/defn_cache.c:84:1: <Length trace>
82. }
83.
84. > int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop,
85. OSSL_PROPERTY_LIST *pl)
86. {
crypto/property/defn_cache.c:84:1: Parameter `*prop`
82. }
83.
84. > int ossl_prop_defn_set(OPENSSL_CTX *ctx, const char *prop,
85. OSSL_PROPERTY_LIST *pl)
86. {
crypto/property/defn_cache.c:109:9: Array access: Offset added: [1, 11] Size: [0, +oo] by call to `ossl_method_store_add`
107. p->prop = p->body;
108. p->defn = pl;
109. memcpy(p->body, prop, len + 1);
^
110. old = lh_PROPERTY_DEFN_ELEM_insert(property_defns, p);
111. if (old != NULL) {
|
https://github.com/openssl/openssl/blob/260a16f33682a819414fcba6161708a5e6bdff50/crypto/property/defn_cache.c/#L109
|
d2a_code_trace_data_43665
|
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:948: error: Uninitialized Value
The value read from t7 was never initialized.
libavcodec/h264pred.c:948:32:
946. SRC(3,6)=SRC(4,4)=SRC(5,2)=SRC(6,0)= (t6 + t7 + 1) >> 1;
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;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264pred.c/#L948
|
d2a_code_trace_data_43666
|
unsigned char *next_protos_parse(size_t *outlen, const char *in)
{
size_t len;
unsigned char *out;
size_t i, start = 0;
len = strlen(in);
if (len >= 65535)
return NULL;
out = app_malloc(strlen(in) + 1, "NPN buffer");
for (i = 0; i <= len; ++i) {
if (i == len || in[i] == ',') {
if (i - start > 255) {
OPENSSL_free(out);
return NULL;
}
out[start] = (unsigned char)(i - start);
start = i + 1;
} else {
out[i + 1] = in[i];
}
}
*outlen = len + 1;
return out;
}
apps/apps.c:1803: error: NULL_DEREFERENCE
pointer `out` last assigned on line 1793 could be null and is dereferenced at line 1803, column 13.
Showing all 25 steps of the trace
apps/apps.c:1783:1: start of procedure next_protos_parse()
1781. * returns: a malloc'd buffer or NULL on failure.
1782. */
1783. > unsigned char *next_protos_parse(size_t *outlen, const char *in)
1784. {
1785. size_t len;
apps/apps.c:1787:5:
1785. size_t len;
1786. unsigned char *out;
1787. > size_t i, start = 0;
1788.
1789. len = strlen(in);
apps/apps.c:1789:5:
1787. size_t i, start = 0;
1788.
1789. > len = strlen(in);
1790. if (len >= 65535)
1791. return NULL;
apps/apps.c:1790:9: Taking false branch
1788.
1789. len = strlen(in);
1790. if (len >= 65535)
^
1791. return NULL;
1792.
apps/apps.c:1793:5:
1791. return NULL;
1792.
1793. > out = app_malloc(strlen(in) + 1, "NPN buffer");
1794. for (i = 0; i <= len; ++i) {
1795. if (i == len || in[i] == ',') {
test/testutil/apps_mem.c:14:1: start of procedure app_malloc()
12. /* shim that avoids sucking in too much from apps/apps.c */
13.
14. > void* app_malloc(int sz, const char *what)
15. {
16. void *vp = OPENSSL_malloc(sz);
test/testutil/apps_mem.c:16:5:
14. void* app_malloc(int sz, const char *what)
15. {
16. > void *vp = OPENSSL_malloc(sz);
17.
18. return vp;
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking true branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:210:9:
208. * allocation.
209. */
210. > allow_customize = 0;
211. }
212. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
test/testutil/apps_mem.c:18:5:
16. void *vp = OPENSSL_malloc(sz);
17.
18. > return vp;
19. }
test/testutil/apps_mem.c:19:1: return from a call to app_malloc
17.
18. return vp;
19. > }
apps/apps.c:1794:10:
1792.
1793. out = app_malloc(strlen(in) + 1, "NPN buffer");
1794. > for (i = 0; i <= len; ++i) {
1795. if (i == len || in[i] == ',') {
1796. if (i - start > 255) {
apps/apps.c:1794:17: Loop condition is true. Entering loop body
1792.
1793. out = app_malloc(strlen(in) + 1, "NPN buffer");
1794. for (i = 0; i <= len; ++i) {
^
1795. if (i == len || in[i] == ',') {
1796. if (i - start > 255) {
apps/apps.c:1795:13: Taking false branch
1793. out = app_malloc(strlen(in) + 1, "NPN buffer");
1794. for (i = 0; i <= len; ++i) {
1795. if (i == len || in[i] == ',') {
^
1796. if (i - start > 255) {
1797. OPENSSL_free(out);
apps/apps.c:1795:25: Taking false branch
1793. out = app_malloc(strlen(in) + 1, "NPN buffer");
1794. for (i = 0; i <= len; ++i) {
1795. if (i == len || in[i] == ',') {
^
1796. if (i - start > 255) {
1797. OPENSSL_free(out);
apps/apps.c:1803:13:
1801. start = i + 1;
1802. } else {
1803. > out[i + 1] = in[i];
1804. }
1805. }
|
https://github.com/openssl/openssl/blob/ce506d27ab5e7d17dfe3fe649768a0d19b6c86ee/apps/apps.c/#L1803
|
d2a_code_trace_data_43667
|
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:2256: error: NULL_DEREFERENCE
pointer `null` is dereferenced by call to `ssl_security_cert()` at line 2256, column 10.
Showing all 11 steps of the trace
ssl/t1_lib.c:2247:1: start of procedure ssl_security_cert_chain()
2245. */
2246.
2247. > int ssl_security_cert_chain(SSL *s, STACK_OF(X509) *sk, X509 *x, int vfy)
2248. {
2249. int rv, start_idx, i;
ssl/t1_lib.c:2250:9: Taking true branch
2248. {
2249. int rv, start_idx, i;
2250. if (x == NULL) {
^
2251. x = sk_X509_value(sk, 0);
2252. start_idx = 1;
ssl/t1_lib.c:2251:9:
2249. int rv, start_idx, i;
2250. if (x == NULL) {
2251. > x = sk_X509_value(sk, 0);
2252. start_idx = 1;
2253. } 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:2252:9:
2250. if (x == NULL) {
2251. x = sk_X509_value(sk, 0);
2252. > start_idx = 1;
2253. } else
2254. start_idx = 0;
ssl/t1_lib.c:2256:5:
2254. start_idx = 0;
2255.
2256. > rv = ssl_security_cert(s, NULL, x, vfy, 1);
2257. if (rv != 1)
2258. return rv;
|
https://github.com/openssl/openssl/blob/4954fd13b3c71f0f74677b78533f1176e13de032/ssl/t1_lib.c/#L2256
|
d2a_code_trace_data_43668
|
void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
{
CRYPTO_gcm128_finish(ctx, NULL, 0);
memcpy(tag, ctx->Xi.c,
len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));
}
crypto/evp/e_aes.c:1532: error: BUFFER_OVERRUN_L3
Offset added: 16 Size: [0, +oo] by call to `CRYPTO_gcm128_tag`.
Showing all 6 steps of the trace
crypto/evp/e_aes.c:1532:9: Call
1530. out += len;
1531. /* Finally write tag */
1532. CRYPTO_gcm128_tag(&gctx->gcm, out, EVP_GCM_TLS_TAG_LEN);
^
1533. rv = len + EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN;
1534. } else {
crypto/modes/gcm128.c:1706:12: <Offset trace>
1704. CRYPTO_gcm128_finish(ctx, NULL, 0);
1705. memcpy(tag, ctx->Xi.c,
1706. len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));
^
1707. }
1708.
crypto/modes/gcm128.c:1706:12: Assignment
1704. CRYPTO_gcm128_finish(ctx, NULL, 0);
1705. memcpy(tag, ctx->Xi.c,
1706. len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));
^
1707. }
1708.
crypto/modes/gcm128.c:1702:1: <Length trace>
1700. }
1701.
1702. > void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
1703. {
1704. CRYPTO_gcm128_finish(ctx, NULL, 0);
crypto/modes/gcm128.c:1702:1: Parameter `ctx->Xi.c[*]`
1700. }
1701.
1702. > void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
1703. {
1704. CRYPTO_gcm128_finish(ctx, NULL, 0);
crypto/modes/gcm128.c:1705:5: Array access: Offset added: 16 Size: [0, +oo] by call to `CRYPTO_gcm128_tag`
1703. {
1704. CRYPTO_gcm128_finish(ctx, NULL, 0);
1705. memcpy(tag, ctx->Xi.c,
^
1706. len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c));
1707. }
|
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/crypto/modes/gcm128.c/#L1705
|
d2a_code_trace_data_43669
|
static int append_buf(char **buf, const char *s, int *size, int step)
{
if (*buf == NULL) {
*size = step;
*buf = app_malloc(*size, "engine buffer");
**buf = '\0';
}
if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
*size += step;
*buf = OPENSSL_realloc(*buf, *size);
}
if (*buf == NULL)
return 0;
if (**buf != '\0')
OPENSSL_strlcat(*buf, ", ", *size);
OPENSSL_strlcat(*buf, s, *size);
return 1;
}
apps/engine.c:105: error: MEMORY_LEAK
memory dynamically allocated by call to `app_malloc()` at line 99, column 16 is not reachable after line 105, column 9.
Showing all 30 steps of the trace
apps/engine.c:95:1: start of procedure append_buf()
93. }
94.
95. > static int append_buf(char **buf, const char *s, int *size, int step)
96. {
97. if (*buf == NULL) {
apps/engine.c:97:9: Taking true branch
95. static int append_buf(char **buf, const char *s, int *size, int step)
96. {
97. if (*buf == NULL) {
^
98. *size = step;
99. *buf = app_malloc(*size, "engine buffer");
apps/engine.c:98:9:
96. {
97. if (*buf == NULL) {
98. > *size = step;
99. *buf = app_malloc(*size, "engine buffer");
100. **buf = '\0';
apps/engine.c:99:9:
97. if (*buf == NULL) {
98. *size = step;
99. > *buf = app_malloc(*size, "engine buffer");
100. **buf = '\0';
101. }
apps/apps.c:976:1: start of procedure app_malloc()
974. }
975.
976. > void* app_malloc(int sz, const char *what)
977. {
978. void *vp = OPENSSL_malloc(sz);
apps/apps.c:978:5:
976. void* app_malloc(int sz, const char *what)
977. {
978. > void *vp = OPENSSL_malloc(sz);
979.
980. if (vp == NULL) {
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
apps/apps.c:980:9: Taking false branch
978. void *vp = OPENSSL_malloc(sz);
979.
980. if (vp == NULL) {
^
981. BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n",
982. opt_getprog(), sz, what);
apps/apps.c:986:5:
984. exit(1);
985. }
986. > return vp;
987. }
988.
apps/apps.c:987:1: return from a call to app_malloc
985. }
986. return vp;
987. > }
988.
989. /*
apps/engine.c:100:9:
98. *size = step;
99. *buf = app_malloc(*size, "engine buffer");
100. > **buf = '\0';
101. }
102.
apps/engine.c:103:9: Taking true branch
101. }
102.
103. if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
^
104. *size += step;
105. *buf = OPENSSL_realloc(*buf, *size);
apps/engine.c:104:9:
102.
103. if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
104. > *size += step;
105. *buf = OPENSSL_realloc(*buf, *size);
106. }
apps/engine.c:105:9:
103. if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
104. *size += step;
105. > *buf = OPENSSL_realloc(*buf, *size);
106. }
107.
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 false 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:171:9: Taking false branch
169. return CRYPTO_malloc(num, file, line);
170.
171. if (num == 0) {
^
172. CRYPTO_free(str);
173. return NULL;
crypto/mem.c:176:5:
174. }
175.
176. > allow_customize = 0;
177. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
178. if (call_malloc_debug) {
crypto/mem.c:186:5:
184. }
185. #else
186. > (void)file;
187. (void)line;
188. #endif
crypto/mem.c:187:5:
185. #else
186. (void)file;
187. > (void)line;
188. #endif
189. return realloc(str, num);
crypto/mem.c:189:5:
187. (void)line;
188. #endif
189. > return realloc(str, num);
190.
191. }
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,
|
https://github.com/openssl/openssl/blob/fe05264e32327e33f0b0c091479affeecbf55e89/apps/engine.c/#L105
|
d2a_code_trace_data_43670
|
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);
}
if (st->attached_pic.data)
av_free_packet(&st->attached_pic);
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);
}
libavformat/segment.c:223: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `avformat_free_context`.
libavformat/segment.c:169:20: Call
167. "expect issues decoding it.\n");
168.
169. seg->oformat = av_guess_format(seg->format, s->filename, NULL);
^
170.
171. if (!seg->oformat) {
libavformat/utils.c:162:16: Unknown value from: av_guess_format
160. av_filename_number_test(filename) &&
161. ff_guess_image2_codec(filename) != AV_CODEC_ID_NONE) {
162. return av_guess_format("image2", NULL, NULL);
^
163. }
164. #endif
libavformat/segment.c:223:13: Call
221. avio_close(seg->pb);
222. if (seg->avf)
223. avformat_free_context(seg->avf);
^
224. }
225. return ret;
libavformat/utils.c:2623:1: <LHS trace>
2621. }
2622.
2623. void avformat_free_context(AVFormatContext *s)
^
2624. {
2625. int i;
libavformat/utils.c:2623:1: Parameter `s->nb_programs`
2621. }
2622.
2623. void avformat_free_context(AVFormatContext *s)
^
2624. {
2625. int i;
libavformat/utils.c:2649:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `avformat_free_context`
2647. av_free(st);
2648. }
2649. for(i=s->nb_programs-1; i>=0; i--) {
^
2650. av_dict_free(&s->programs[i]->metadata);
2651. av_freep(&s->programs[i]->stream_index);
|
https://github.com/libav/libav/blob/a7329e5fc22433dfeaf7af22fb40fe3cada21385/libavformat/utils.c/#L2649
|
d2a_code_trace_data_43671
|
static int
OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
{
static const char module[]="OJPEGReadHeaderInfoSecTablesQTable";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
uint8 m;
uint8 n;
uint32 oa;
uint8* ob;
uint32 p;
if (sp->qtable_offset[0]==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables");
return(0);
}
sp->in_buffer_file_pos_log=0;
for (m=0; m<sp->samples_per_pixel; m++)
{
if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
{
for (n=0; n<m-1; n++)
{
if (sp->qtable_offset[m]==sp->qtable_offset[n])
{
TIFFErrorExt(tif->tif_clientdata,module,"Corrupt JpegQTables tag value");
return(0);
}
}
oa=sizeof(uint32)+69;
ob=_TIFFmalloc(oa);
if (ob==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
*(uint32*)ob=oa;
ob[sizeof(uint32)]=255;
ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
ob[sizeof(uint32)+2]=0;
ob[sizeof(uint32)+3]=67;
ob[sizeof(uint32)+4]=m;
TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET);
p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
if (p!=64)
return(0);
sp->qtable[m]=ob;
sp->sof_tq[m]=m;
}
else
sp->sof_tq[m]=sp->sof_tq[m-1];
}
return(1);
}
libtiff/tif_ojpeg.c:1769: error: Memory Leak
memory dynamically allocated to `return` by call to `_TIFFmalloc()` at line 1754, column 7 is not reachable after line 1769, column 5.
libtiff/tif_ojpeg.c:1725:1: start of procedure OJPEGReadHeaderInfoSecTablesQTable()
1723. }
1724.
1725. static int
^
1726. OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
1727. {
libtiff/tif_ojpeg.c:1728:2:
1726. OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
1727. {
1728. static const char module[]="OJPEGReadHeaderInfoSecTablesQTable";
^
1729. OJPEGState* sp=(OJPEGState*)tif->tif_data;
1730. uint8 m;
libtiff/tif_ojpeg.c:1729:2:
1727. {
1728. static const char module[]="OJPEGReadHeaderInfoSecTablesQTable";
1729. OJPEGState* sp=(OJPEGState*)tif->tif_data;
^
1730. uint8 m;
1731. uint8 n;
libtiff/tif_ojpeg.c:1735:6: Taking false branch
1733. uint8* ob;
1734. uint32 p;
1735. if (sp->qtable_offset[0]==0)
^
1736. {
1737. TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables");
libtiff/tif_ojpeg.c:1740:2:
1738. return(0);
1739. }
1740. sp->in_buffer_file_pos_log=0;
^
1741. for (m=0; m<sp->samples_per_pixel; m++)
1742. {
libtiff/tif_ojpeg.c:1741:7:
1739. }
1740. sp->in_buffer_file_pos_log=0;
1741. for (m=0; m<sp->samples_per_pixel; m++)
^
1742. {
1743. if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
libtiff/tif_ojpeg.c:1741:12: Loop condition is true. Entering loop body
1739. }
1740. sp->in_buffer_file_pos_log=0;
1741. for (m=0; m<sp->samples_per_pixel; m++)
^
1742. {
1743. if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
libtiff/tif_ojpeg.c:1743:8: Taking true branch
1741. for (m=0; m<sp->samples_per_pixel; m++)
1742. {
1743. if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
^
1744. {
1745. for (n=0; n<m-1; n++)
libtiff/tif_ojpeg.c:1743:38: Taking true branch
1741. for (m=0; m<sp->samples_per_pixel; m++)
1742. {
1743. if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
^
1744. {
1745. for (n=0; n<m-1; n++)
libtiff/tif_ojpeg.c:1745:9:
1743. if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
1744. {
1745. for (n=0; n<m-1; n++)
^
1746. {
1747. if (sp->qtable_offset[m]==sp->qtable_offset[n])
libtiff/tif_ojpeg.c:1745:14: Loop condition is false. Leaving loop
1743. if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
1744. {
1745. for (n=0; n<m-1; n++)
^
1746. {
1747. if (sp->qtable_offset[m]==sp->qtable_offset[n])
libtiff/tif_ojpeg.c:1753:4:
1751. }
1752. }
1753. oa=sizeof(uint32)+69;
^
1754. ob=_TIFFmalloc(oa);
1755. if (ob==0)
libtiff/tif_ojpeg.c:1754:4:
1752. }
1753. oa=sizeof(uint32)+69;
1754. ob=_TIFFmalloc(oa);
^
1755. if (ob==0)
1756. {
libtiff/tif_unix.c:253:1: start of procedure _TIFFmalloc()
251. #endif
252.
253. void*
^
254. _TIFFmalloc(tmsize_t s)
255. {
libtiff/tif_unix.c:256:2:
254. _TIFFmalloc(tmsize_t s)
255. {
256. return (malloc((size_t) s));
^
257. }
258.
libtiff/tif_unix.c:257:1: return from a call to _TIFFmalloc
255. {
256. return (malloc((size_t) s));
257. }
^
258.
259. void
libtiff/tif_ojpeg.c:1755:8: Taking false branch
1753. oa=sizeof(uint32)+69;
1754. ob=_TIFFmalloc(oa);
1755. if (ob==0)
^
1756. {
1757. TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
libtiff/tif_ojpeg.c:1760:4:
1758. return(0);
1759. }
1760. *(uint32*)ob=oa;
^
1761. ob[sizeof(uint32)]=255;
1762. ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
libtiff/tif_ojpeg.c:1761:4:
1759. }
1760. *(uint32*)ob=oa;
1761. ob[sizeof(uint32)]=255;
^
1762. ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
1763. ob[sizeof(uint32)+2]=0;
libtiff/tif_ojpeg.c:1762:4:
1760. *(uint32*)ob=oa;
1761. ob[sizeof(uint32)]=255;
1762. ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
^
1763. ob[sizeof(uint32)+2]=0;
1764. ob[sizeof(uint32)+3]=67;
libtiff/tif_ojpeg.c:1763:4:
1761. ob[sizeof(uint32)]=255;
1762. ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
1763. ob[sizeof(uint32)+2]=0;
^
1764. ob[sizeof(uint32)+3]=67;
1765. ob[sizeof(uint32)+4]=m;
libtiff/tif_ojpeg.c:1764:4:
1762. ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
1763. ob[sizeof(uint32)+2]=0;
1764. ob[sizeof(uint32)+3]=67;
^
1765. ob[sizeof(uint32)+4]=m;
1766. TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET);
libtiff/tif_ojpeg.c:1765:4:
1763. ob[sizeof(uint32)+2]=0;
1764. ob[sizeof(uint32)+3]=67;
1765. ob[sizeof(uint32)+4]=m;
^
1766. TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET);
1767. p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
libtiff/tif_ojpeg.c:1766:4: Skipping __function_pointer__(): unresolved function pointer
1764. ob[sizeof(uint32)+3]=67;
1765. ob[sizeof(uint32)+4]=m;
1766. TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET);
^
1767. p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
1768. if (p!=64)
libtiff/tif_ojpeg.c:1767:4: Skipping __function_pointer__(): unresolved function pointer
1765. ob[sizeof(uint32)+4]=m;
1766. TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET);
1767. p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
^
1768. if (p!=64)
1769. return(0);
libtiff/tif_ojpeg.c:1768:8: Taking true branch
1766. TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET);
1767. p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
1768. if (p!=64)
^
1769. return(0);
1770. sp->qtable[m]=ob;
libtiff/tif_ojpeg.c:1769:5:
1767. p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
1768. if (p!=64)
1769. return(0);
^
1770. sp->qtable[m]=ob;
1771. sp->sof_tq[m]=m;
|
https://gitlab.com/libtiff/libtiff/blob/b69a1998bedfabc32cd541408bffdef05bd01e45/libtiff/tif_ojpeg.c/#L1769
|
d2a_code_trace_data_43672
|
static inline void pred_direct_motion(H264Context * const h, int *mb_type){
MpegEncContext * const s = &h->s;
const int mb_xy = s->mb_x + s->mb_y*s->mb_stride;
const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride;
const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy];
const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy];
const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy];
const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy];
const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy];
const int is_b8x8 = IS_8X8(*mb_type);
unsigned int sub_mb_type;
int i8, i4;
#define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)
if(IS_8X8(mb_type_col) && !h->sps.direct_8x8_inference_flag){
sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1;
}else if(!is_b8x8 && (mb_type_col & MB_TYPE_16x16_OR_INTRA)){
sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
}else{
sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1;
}
if(!is_b8x8)
*mb_type |= MB_TYPE_DIRECT2;
if(MB_FIELD)
*mb_type |= MB_TYPE_INTERLACED;
tprintf(s->avctx, "mb_type = %08x, sub_mb_type = %08x, is_b8x8 = %d, mb_type_col = %08x\n", *mb_type, sub_mb_type, is_b8x8, mb_type_col);
if(h->direct_spatial_mv_pred){
int ref[2];
int mv[2][2];
int list;
for(list=0; list<2; list++){
int refa = h->ref_cache[list][scan8[0] - 1];
int refb = h->ref_cache[list][scan8[0] - 8];
int refc = h->ref_cache[list][scan8[0] - 8 + 4];
if(refc == -2)
refc = h->ref_cache[list][scan8[0] - 8 - 1];
ref[list] = refa;
if(ref[list] < 0 || (refb < ref[list] && refb >= 0))
ref[list] = refb;
if(ref[list] < 0 || (refc < ref[list] && refc >= 0))
ref[list] = refc;
if(ref[list] < 0)
ref[list] = -1;
}
if(ref[0] < 0 && ref[1] < 0){
ref[0] = ref[1] = 0;
mv[0][0] = mv[0][1] =
mv[1][0] = mv[1][1] = 0;
}else{
for(list=0; list<2; list++){
if(ref[list] >= 0)
pred_motion(h, 0, 4, list, ref[list], &mv[list][0], &mv[list][1]);
else
mv[list][0] = mv[list][1] = 0;
}
}
if(ref[1] < 0){
if(!is_b8x8)
*mb_type &= ~MB_TYPE_L1;
sub_mb_type &= ~MB_TYPE_L1;
}else if(ref[0] < 0){
if(!is_b8x8)
*mb_type &= ~MB_TYPE_L0;
sub_mb_type &= ~MB_TYPE_L0;
}
if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){
int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride;
int mb_types_col[2];
int b8_stride = h->b8_stride;
int b4_stride = h->b_stride;
*mb_type = (*mb_type & ~MB_TYPE_16x16) | MB_TYPE_8x8;
if(IS_INTERLACED(*mb_type)){
mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy];
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
if(s->mb_y&1){
l1ref0 -= 2*b8_stride;
l1ref1 -= 2*b8_stride;
l1mv0 -= 4*b4_stride;
l1mv1 -= 4*b4_stride;
}
b8_stride *= 3;
b4_stride *= 6;
}else{
int cur_poc = s->current_picture_ptr->poc;
int *col_poc = h->ref_list[1]->field_poc;
int col_parity = FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc);
int dy = 2*col_parity - (s->mb_y&1);
mb_types_col[0] =
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy + col_parity*s->mb_stride];
l1ref0 += dy*b8_stride;
l1ref1 += dy*b8_stride;
l1mv0 += 2*dy*b4_stride;
l1mv1 += 2*dy*b4_stride;
b8_stride = 0;
}
for(i8=0; i8<4; i8++){
int x8 = i8&1;
int y8 = i8>>1;
int xy8 = x8+y8*b8_stride;
int xy4 = 3*x8+y8*b4_stride;
int a=0, b=0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_types_col[y8])
&& ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1)
|| (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){
if(ref[0] > 0)
a= pack16to32(mv[0][0],mv[0][1]);
if(ref[1] > 0)
b= pack16to32(mv[1][0],mv[1][1]);
}else{
a= pack16to32(mv[0][0],mv[0][1]);
b= pack16to32(mv[1][0],mv[1][1]);
}
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4);
}
}else if(IS_16X16(*mb_type)){
int a=0, b=0;
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_type_col)
&& ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1)
|| (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1
&& (h->x264_build>33 || !h->x264_build)))){
if(ref[0] > 0)
a= pack16to32(mv[0][0],mv[0][1]);
if(ref[1] > 0)
b= pack16to32(mv[1][0],mv[1][1]);
}else{
a= pack16to32(mv[0][0],mv[0][1]);
b= pack16to32(mv[1][0],mv[1][1]);
}
fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4);
fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4);
}else{
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4);
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0
|| (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0
&& (h->x264_build>33 || !h->x264_build)))){
const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1;
if(IS_SUB_8X8(sub_mb_type)){
const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride];
if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
if(ref[0] == 0)
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
if(ref[1] == 0)
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
}
}else
for(i4=0; i4<4; i4++){
const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
if(ref[0] == 0)
*(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0;
if(ref[1] == 0)
*(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0;
}
}
}
}
}
}else{
const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]};
const int *dist_scale_factor = h->dist_scale_factor;
if(FRAME_MBAFF){
if(IS_INTERLACED(*mb_type)){
map_col_to_list0[0] = h->map_col_to_list0_field[0];
map_col_to_list0[1] = h->map_col_to_list0_field[1];
dist_scale_factor = h->dist_scale_factor_field;
}
if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){
const int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride;
int mb_types_col[2];
int y_shift;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1
| (is_b8x8 ? 0 : MB_TYPE_DIRECT2)
| (*mb_type & MB_TYPE_INTERLACED);
sub_mb_type = MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_16x16;
if(IS_INTERLACED(*mb_type)){
mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy];
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
if(s->mb_y&1){
l1ref0 -= 2*h->b8_stride;
l1ref1 -= 2*h->b8_stride;
l1mv0 -= 4*h->b_stride;
l1mv1 -= 4*h->b_stride;
}
y_shift = 0;
if( (mb_types_col[0] & MB_TYPE_16x16_OR_INTRA)
&& (mb_types_col[1] & MB_TYPE_16x16_OR_INTRA)
&& !is_b8x8)
*mb_type |= MB_TYPE_16x8;
else
*mb_type |= MB_TYPE_8x8;
}else{
int dy = (s->mb_y&1) ? 1 : 2;
mb_types_col[0] =
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
l1ref0 += dy*h->b8_stride;
l1ref1 += dy*h->b8_stride;
l1mv0 += 2*dy*h->b_stride;
l1mv1 += 2*dy*h->b_stride;
y_shift = 2;
if((mb_types_col[0] & (MB_TYPE_16x16_OR_INTRA|MB_TYPE_16x8))
&& !is_b8x8)
*mb_type |= MB_TYPE_16x16;
else
*mb_type |= MB_TYPE_8x8;
}
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
int ref0, scale;
const int16_t (*l1mv)[2]= l1mv0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
if(IS_INTRA(mb_types_col[y8])){
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
continue;
}
ref0 = l1ref0[x8 + (y8*2>>y_shift)*h->b8_stride];
if(ref0 >= 0)
ref0 = map_col_to_list0[0][ref0*2>>y_shift];
else{
ref0 = map_col_to_list0[1][l1ref1[x8 + (y8*2>>y_shift)*h->b8_stride]*2>>y_shift];
l1mv= l1mv1;
}
scale = dist_scale_factor[ref0];
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
{
const int16_t *mv_col = l1mv[x8*3 + (y8*6>>y_shift)*h->b_stride];
int my_col = (mv_col[1]<<y_shift)/2;
int mx = (scale * mv_col[0] + 128) >> 8;
int my = (scale * my_col + 128) >> 8;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4);
}
}
return;
}
}
if(IS_16X16(*mb_type)){
int ref, mv0, mv1;
fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1);
if(IS_INTRA(mb_type_col)){
ref=mv0=mv1=0;
}else{
const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0]]
: map_col_to_list0[1][l1ref1[0]];
const int scale = dist_scale_factor[ref0];
const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0];
int mv_l0[2];
mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
ref= ref0;
mv0= pack16to32(mv_l0[0],mv_l0[1]);
mv1= pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
}
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);
fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, mv0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, mv1, 4);
}else{
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
int ref0, scale;
const int16_t (*l1mv)[2]= l1mv0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
if(IS_INTRA(mb_type_col)){
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
continue;
}
ref0 = l1ref0[x8 + y8*h->b8_stride];
if(ref0 >= 0)
ref0 = map_col_to_list0[0][ref0];
else{
ref0 = map_col_to_list0[1][l1ref1[x8 + y8*h->b8_stride]];
l1mv= l1mv1;
}
scale = dist_scale_factor[ref0];
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
if(IS_SUB_8X8(sub_mb_type)){
const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride];
int mx = (scale * mv_col[0] + 128) >> 8;
int my = (scale * mv_col[1] + 128) >> 8;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4);
}else
for(i4=0; i4<4; i4++){
const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]];
mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
*(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] =
pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
}
}
}
}
}
libavcodec/h264.c:1145: error: Uninitialized Value
The value read from ref[_] was never initialized.
libavcodec/h264.c:1145:32:
1143. const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
1144. if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
1145. if(ref[0] == 0)
^
1146. *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0;
1147. if(ref[1] == 0)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1145
|
d2a_code_trace_data_43673
|
static av_cold int dvvideo_init(AVCodecContext *avctx)
{
DVVideoContext *s = avctx->priv_data;
DSPContext dsp;
static int done=0;
int i, j;
if (!done) {
VLC dv_vlc;
uint16_t new_dv_vlc_bits[NB_DV_VLC*2];
uint8_t new_dv_vlc_len[NB_DV_VLC*2];
uint8_t new_dv_vlc_run[NB_DV_VLC*2];
int16_t new_dv_vlc_level[NB_DV_VLC*2];
done = 1;
for (i=0; i<DV_ANCHOR_SIZE; i++)
dv_anchor[i] = (void*)(size_t)i;
for (i=0, j=0; i<NB_DV_VLC; i++, j++) {
new_dv_vlc_bits[j] = dv_vlc_bits[i];
new_dv_vlc_len[j] = dv_vlc_len[i];
new_dv_vlc_run[j] = dv_vlc_run[i];
new_dv_vlc_level[j] = dv_vlc_level[i];
if (dv_vlc_level[i]) {
new_dv_vlc_bits[j] <<= 1;
new_dv_vlc_len[j]++;
j++;
new_dv_vlc_bits[j] = (dv_vlc_bits[i] << 1) | 1;
new_dv_vlc_len[j] = dv_vlc_len[i] + 1;
new_dv_vlc_run[j] = dv_vlc_run[i];
new_dv_vlc_level[j] = -dv_vlc_level[i];
}
}
init_vlc(&dv_vlc, TEX_VLC_BITS, j,
new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2, 0);
assert(dv_vlc.table_size == 1184);
for(i = 0; i < dv_vlc.table_size; i++){
int code= dv_vlc.table[i][0];
int len = dv_vlc.table[i][1];
int level, run;
if(len<0){
run= 0;
level= code;
} else {
run= new_dv_vlc_run[code] + 1;
level= new_dv_vlc_level[code];
}
dv_rl_vlc[i].len = len;
dv_rl_vlc[i].level = level;
dv_rl_vlc[i].run = run;
}
free_vlc(&dv_vlc);
for (i = 0; i < NB_DV_VLC - 1; i++) {
if (dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE)
continue;
#ifdef DV_CODEC_TINY_TARGET
if (dv_vlc_level[i] >= DV_VLC_MAP_LEV_SIZE)
continue;
#endif
if (dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size != 0)
continue;
dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].vlc = dv_vlc_bits[i] <<
(!!dv_vlc_level[i]);
dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size = dv_vlc_len[i] +
(!!dv_vlc_level[i]);
}
for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) {
#ifdef DV_CODEC_TINY_TARGET
for (j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) {
if (dv_vlc_map[i][j].size == 0) {
dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
(dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
dv_vlc_map[0][j].size;
}
}
#else
for (j = 1; j < DV_VLC_MAP_LEV_SIZE/2; j++) {
if (dv_vlc_map[i][j].size == 0) {
dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
(dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
dv_vlc_map[0][j].size;
}
dv_vlc_map[i][((uint16_t)(-j))&0x1ff].vlc =
dv_vlc_map[i][j].vlc | 1;
dv_vlc_map[i][((uint16_t)(-j))&0x1ff].size =
dv_vlc_map[i][j].size;
}
#endif
}
}
dsputil_init(&dsp, avctx);
s->get_pixels = dsp.get_pixels;
s->fdct[0] = dsp.fdct;
s->idct_put[0] = dsp.idct_put;
for (i=0; i<64; i++)
s->dv_zigzag[0][i] = dsp.idct_permutation[ff_zigzag_direct[i]];
s->fdct[1] = dsp.fdct248;
s->idct_put[1] = ff_simple_idct248_put;
if(avctx->lowres){
for (i=0; i<64; i++){
int j= ff_zigzag248_direct[i];
s->dv_zigzag[1][i] = dsp.idct_permutation[(j&7) + (j&8)*4 + (j&48)/2];
}
}else
memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64);
dv_build_unquantize_tables(s, dsp.idct_permutation);
avctx->coded_frame = &s->picture;
s->avctx= avctx;
return 0;
}
libavcodec/dv.c:164: error: Uninitialized Value
The value read from new_dv_vlc_run[_] was never initialized.
libavcodec/dv.c:164:17:
162. level= code;
163. } else {
164. run= new_dv_vlc_run[code] + 1;
^
165. level= new_dv_vlc_level[code];
166. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/dv.c/#L164
|
d2a_code_trace_data_43674
|
static int epzs_motion_search4(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int P[10][2],
int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d, dmin;
int map_generation;
const int penalty_factor= c->penalty_factor;
const int size=1;
const int h=8;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
int flags= c->flags;
LOAD_COMMON2
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
map_generation= update_map_generation(c);
dmin = 1000000;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
}else{
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}
if(dmin>64*4){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1162: error: Uninitialized Value
The value read from ymin was never initialized.
libavcodec/motion_est_template.c:1162:9:
1160. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
1161. (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
1162. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
^
1163. }else{
1164. CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1162
|
d2a_code_trace_data_43675
|
static inline void skip_remaining(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
bc->bits >>= n;
#else
bc->bits <<= n;
#endif
bc->bits_left -= n;
}
libavcodec/alsdec.c:1426: error: Integer Overflow L2
([-3, +oo] - 5):unsigned32 by call to `read_block`.
libavcodec/alsdec.c:1402:9: Call
1400. bd.prev_raw_samples = ctx->prev_raw_samples;
1401.
1402. get_block_sizes(ctx, div_blocks, &bs_info);
^
1403.
1404. for (b = 0; b < ctx->num_blocks; b++) {
libavcodec/alsdec.c:504:1: Parameter `ctx->bc.bits_left`
502. * actual number of samples.
503. */
504. static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks,
^
505. uint32_t *bs_info)
506. {
libavcodec/alsdec.c:1426:28: Call
1424. bd.raw_other = NULL;
1425.
1426. if ((ret = read_block(ctx, &bd)) < 0)
^
1427. return ret;
1428. if ((ret = read_channel_data(ctx, ctx->chan_data[c], c)) < 0)
libavcodec/alsdec.c:968:1: Parameter `ctx->bc.bits_left`
966. /** Read the block data.
967. */
968. static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
^
969. {
970. int ret = 0;
libavcodec/alsdec.c:975:9: Call
973. *bd->shift_lsbs = 0;
974. // read block type flag and read the samples accordingly
975. if (bitstream_read_bit(bc)) {
^
976. ret = read_var_block_data(ctx, bd);
977. } else {
libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
143.
144. /* Return one bit from the buffer. */
145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
^
146. {
147. if (!bc->bits_left)
libavcodec/bitstream.h:150:12: Call
148. refill_64(bc);
149.
150. return get_val(bc, 1);
^
151. }
152.
libavcodec/bitstream.h:130:1: Parameter `n`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:139:5: Assignment
137. bc->bits <<= n;
138. #endif
139. bc->bits_left -= n;
^
140.
141. return ret;
libavcodec/alsdec.c:978:9: Call
976. ret = read_var_block_data(ctx, bd);
977. } else {
978. read_const_block_data(ctx, bd);
^
979. }
980.
libavcodec/alsdec.c:557:1: Parameter `ctx->bc.bits_left`
555. /** Read the block data for a constant block
556. */
557. static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
^
558. {
559. ALSSpecificConfig *sconf = &ctx->sconf;
libavcodec/alsdec.c:564:24: Call
562.
563. *bd->raw_samples = 0;
564. *bd->const_block = bitstream_read_bit(bc); // 1 = constant value, 0 = zero block (silence)
^
565. bd->js_blocks = bitstream_read_bit(bc);
566.
libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
143.
144. /* Return one bit from the buffer. */
145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
^
146. {
147. if (!bc->bits_left)
libavcodec/bitstream.h:150:12: Call
148. refill_64(bc);
149.
150. return get_val(bc, 1);
^
151. }
152.
libavcodec/bitstream.h:130:1: Parameter `n`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:139:5: Assignment
137. bc->bits <<= n;
138. #endif
139. bc->bits_left -= n;
^
140.
141. return ret;
libavcodec/alsdec.c:565:24: Call
563. *bd->raw_samples = 0;
564. *bd->const_block = bitstream_read_bit(bc); // 1 = constant value, 0 = zero block (silence)
565. bd->js_blocks = bitstream_read_bit(bc);
^
566.
567. // skip 5 reserved bits
libavcodec/bitstream.h:145:1: Parameter `bc->bits_left`
143.
144. /* Return one bit from the buffer. */
145. static inline unsigned bitstream_read_bit(BitstreamContext *bc)
^
146. {
147. if (!bc->bits_left)
libavcodec/bitstream.h:150:12: Call
148. refill_64(bc);
149.
150. return get_val(bc, 1);
^
151. }
152.
libavcodec/bitstream.h:130:1: Parameter `n`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:139:5: Assignment
137. bc->bits <<= n;
138. #endif
139. bc->bits_left -= n;
^
140.
141. return ret;
libavcodec/alsdec.c:568:5: Call
566.
567. // skip 5 reserved bits
568. bitstream_skip(bc, 5);
^
569.
570. if (*bd->const_block) {
libavcodec/bitstream.h:241:1: Parameter `n`
239.
240. /* Skip n bits in the buffer. */
241. static inline void bitstream_skip(BitstreamContext *bc, unsigned n)
^
242. {
243. if (n <= bc->bits_left)
libavcodec/bitstream.h:244:9: Call
242. {
243. if (n <= bc->bits_left)
244. skip_remaining(bc, n);
^
245. else {
246. n -= bc->bits_left;
libavcodec/bitstream.h:230:1: <LHS trace>
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:230:1: Parameter `bc->bits_left`
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:230:1: <RHS trace>
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:230:1: Parameter `n`
228. }
229.
230. static inline void skip_remaining(BitstreamContext *bc, unsigned n)
^
231. {
232. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:237:5: Binary operation: ([-3, +oo] - 5):unsigned32 by call to `read_block`
235. bc->bits <<= n;
236. #endif
237. bc->bits_left -= n;
^
238. }
239.
|
https://github.com/libav/libav/blob/7ff018c1cb43a5fe5ee2049d325cdd785852067a/libavcodec/bitstream.h/#L237
|
d2a_code_trace_data_43676
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ecdsa_ossl.c:246: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul_montgomery`.
Showing all 21 steps of the trace
crypto/ec/ecdsa_ossl.c:212:18: Call
210. do {
211. if (in_kinv == NULL || in_r == NULL) {
212. if (!ecdsa_sign_setup(eckey, ctx, &kinv, &ret->r, dgst, dgst_len)) {
^
213. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_ECDSA_LIB);
214. goto err;
crypto/ec/ecdsa_ossl.c:33:1: Parameter `ctx_in->stack.depth`
31. }
32.
33. > static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
34. BIGNUM **kinvp, BIGNUM **rp,
35. const unsigned char *dgst, int dlen)
crypto/ec/ecdsa_ossl.c:246:17: Call
244. */
245. if (!bn_to_mont_fixed_top(s, s, group->mont_data, ctx)
246. || !BN_mod_mul_montgomery(s, s, ckinv, group->mont_data, ctx)) {
^
247. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
248. goto err;
crypto/bn/bn_mont.c:26:1: Parameter `ctx->stack.depth`
24. #endif
25.
26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
crypto/bn/bn_mont.c:29:15: Call
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
29. int ret = bn_mul_mont_fixed_top(r, a, b, mont, ctx);
^
30.
31. bn_correct_top(r);
crypto/bn/bn_mont.c:37:1: Parameter `ctx->stack.depth`
35. }
36.
37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
38. BN_MONT_CTX *mont, BN_CTX *ctx)
39. {
crypto/bn/bn_mont.c:60:5: Call
58. return 0;
59.
60. BN_CTX_start(ctx);
^
61. tmp = BN_CTX_get(ctx);
62. if (tmp == NULL)
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_mont.c:61:11: Call
59.
60. BN_CTX_start(ctx);
61. tmp = BN_CTX_get(ctx);
^
62. if (tmp == NULL)
63. goto err;
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_mont.c:67:14: Call
65. bn_check_top(tmp);
66. if (a == b) {
67. if (!bn_sqr_fixed_top(tmp, a, ctx))
^
68. goto err;
69. } else {
crypto/bn/bn_sqr.c:42:5: Call
40. }
41.
42. BN_CTX_start(ctx);
^
43. rr = (a != r) ? r : BN_CTX_get(ctx);
44. tmp = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_sqr.c:104:5: Call
102. bn_check_top(rr);
103. bn_check_top(tmp);
104. BN_CTX_end(ctx);
^
105. return ret;
106. }
crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/bn/bn_ctx.c:191:27: Call
189. ctx->err_stack--;
190. else {
191. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
192. /* Does this stack frame have anything to release? */
193. if (fp < ctx->used)
crypto/bn/bn_ctx.c:266:1: <Offset trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: <Length trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_mul_montgomery`
266. static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
^
269. }
270.
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_ctx.c/#L268
|
d2a_code_trace_data_43677
|
static int fill_default_ref_list(H264Context *h){
MpegEncContext * const s = &h->s;
int i;
int smallest_poc_greater_than_current = -1;
int structure_sel;
Picture sorted_short_ref[32];
Picture field_entry_list[2][32];
Picture *frame_list[2];
if (FIELD_PICTURE) {
structure_sel = PICT_FRAME;
frame_list[0] = field_entry_list[0];
frame_list[1] = field_entry_list[1];
} else {
structure_sel = 0;
frame_list[0] = h->default_ref_list[0];
frame_list[1] = h->default_ref_list[1];
}
if(h->slice_type==FF_B_TYPE){
int list;
int len[2];
int short_len[2];
int out_i;
int limit= INT_MIN;
for(out_i=0; out_i<h->short_ref_count; out_i++){
int best_i=INT_MIN;
int best_poc=INT_MAX;
for(i=0; i<h->short_ref_count; i++){
const int poc= h->short_ref[i]->poc;
if(poc > limit && poc < best_poc){
best_poc= poc;
best_i= i;
}
}
assert(best_i != INT_MIN);
limit= best_poc;
sorted_short_ref[out_i]= *h->short_ref[best_i];
tprintf(h->s.avctx, "sorted poc: %d->%d poc:%d fn:%d\n", best_i, out_i, sorted_short_ref[out_i].poc, sorted_short_ref[out_i].frame_num);
if (-1 == smallest_poc_greater_than_current) {
if (h->short_ref[best_i]->poc >= s->current_picture_ptr->poc) {
smallest_poc_greater_than_current = out_i;
}
}
}
tprintf(h->s.avctx, "current poc: %d, smallest_poc_greater_than_current: %d\n", s->current_picture_ptr->poc, smallest_poc_greater_than_current);
for(list=0; list<2; list++){
int index = 0;
int j= -99;
int step= list ? -1 : 1;
for(i=0; i<h->short_ref_count && index < h->ref_count[list]; i++, j+=step) {
int sel;
while(j<0 || j>= h->short_ref_count){
if(j != -99 && step == (list ? -1 : 1))
return -1;
step = -step;
j= smallest_poc_greater_than_current + (step>>1);
}
sel = sorted_short_ref[j].reference | structure_sel;
if(sel != PICT_FRAME) continue;
frame_list[list][index ]= sorted_short_ref[j];
frame_list[list][index++].pic_id= sorted_short_ref[j].frame_num;
}
short_len[list] = index;
for(i = 0; i < 16 && index < h->ref_count[ list ]; i++){
int sel;
if(h->long_ref[i] == NULL) continue;
sel = h->long_ref[i]->reference | structure_sel;
if(sel != PICT_FRAME) continue;
frame_list[ list ][index ]= *h->long_ref[i];
frame_list[ list ][index++].pic_id= i;
}
len[list] = index;
}
for(list=0; list<2; list++){
if (FIELD_PICTURE)
len[list] = split_field_ref_list(h->default_ref_list[list],
h->ref_count[list],
frame_list[list],
len[list],
s->picture_structure,
short_len[list]);
if(list && len[0] > 1 && len[0] == len[1])
for(i=0; h->default_ref_list[0][i].data[0] == h->default_ref_list[1][i].data[0]; i++)
if(i == len[0]){
FFSWAP(Picture, h->default_ref_list[1][0], h->default_ref_list[1][1]);
break;
}
if(len[list] < h->ref_count[ list ])
memset(&h->default_ref_list[list][len[list]], 0, sizeof(Picture)*(h->ref_count[ list ] - len[list]));
}
}else{
int index=0;
int short_len;
for(i=0; i<h->short_ref_count; i++){
int sel;
sel = h->short_ref[i]->reference | structure_sel;
if(sel != PICT_FRAME) continue;
frame_list[0][index ]= *h->short_ref[i];
frame_list[0][index++].pic_id= h->short_ref[i]->frame_num;
}
short_len = index;
for(i = 0; i < 16; i++){
int sel;
if(h->long_ref[i] == NULL) continue;
sel = h->long_ref[i]->reference | structure_sel;
if(sel != PICT_FRAME) continue;
frame_list[0][index ]= *h->long_ref[i];
frame_list[0][index++].pic_id= i;
}
if (FIELD_PICTURE)
index = split_field_ref_list(h->default_ref_list[0],
h->ref_count[0], frame_list[0],
index, s->picture_structure,
short_len);
if(index < h->ref_count[0])
memset(&h->default_ref_list[0][index], 0, sizeof(Picture)*(h->ref_count[0] - index));
}
#ifdef TRACE
for (i=0; i<h->ref_count[0]; i++) {
tprintf(h->s.avctx, "List0: %s fn:%d 0x%p\n", (h->default_ref_list[0][i].long_ref ? "LT" : "ST"), h->default_ref_list[0][i].pic_id, h->default_ref_list[0][i].data[0]);
}
if(h->slice_type==FF_B_TYPE){
for (i=0; i<h->ref_count[1]; i++) {
tprintf(h->s.avctx, "List1: %s fn:%d 0x%p\n", (h->default_ref_list[1][i].long_ref ? "LT" : "ST"), h->default_ref_list[1][i].pic_id, h->default_ref_list[1][i].data[0]);
}
}
#endif
return 0;
}
libavcodec/h264.c:2930: error: Uninitialized Value
The value read from len[_] was never initialized.
libavcodec/h264.c:2930:29:
2928. for(list=0; list<2; list++){
2929. if (FIELD_PICTURE)
2930. len[list] = split_field_ref_list(h->default_ref_list[list],
^
2931. h->ref_count[list],
2932. frame_list[list],
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L2930
|
d2a_code_trace_data_43678
|
static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s)
{
int x, y;
unsigned char P[16];
unsigned char B[16];
int flags = 0;
int shifter = 0;
int index;
int split;
int lower_half;
CHECK_STREAM_PTR(4);
for (y = 0; y < 4; y++)
P[y] = *s->stream_ptr++;
if (P[0] <= P[1]) {
CHECK_STREAM_PTR(28);
for (y = 0; y < 4; y++)
B[y] = *s->stream_ptr++;
for (y = 4; y < 16; y += 4) {
for (x = y; x < y + 4; x++)
P[x] = *s->stream_ptr++;
for (x = y; x < y + 4; x++)
B[x] = *s->stream_ptr++;
}
for (y = 0; y < 8; y++) {
lower_half = (y >= 4) ? 4 : 0;
flags = (B[y + 8] << 8) | B[y];
for (x = 0, shifter = 0; x < 8; x++, shifter += 2) {
split = (x >= 4) ? 8 : 0;
index = split + lower_half + ((flags >> shifter) & 0x03);
*s->pixel_ptr++ = P[index];
}
s->pixel_ptr += s->line_inc;
}
} else {
CHECK_STREAM_PTR(20);
for (y = 0; y < 8; y++)
B[y] = *s->stream_ptr++;
for (y = 4; y < 8; y++)
P[y] = *s->stream_ptr++;
for (y = 8; y < 16; y++)
B[y] = *s->stream_ptr++;
if (P[4] <= P[5]) {
for (y = 0; y < 8; y++) {
flags = (B[y + 8] << 8) | B[y];
split = 0;
for (x = 0, shifter = 0; x < 8; x++, shifter += 2) {
if (x == 4)
split = 4;
*s->pixel_ptr++ = P[split + ((flags >> shifter) & 0x03)];
}
s->pixel_ptr += s->line_inc;
}
} else {
split = 0;
for (y = 0; y < 8; y++) {
flags = (B[y * 2 + 1] << 8) | B[y * 2];
if (y == 4)
split = 4;
for (x = 0, shifter = 0; x < 8; x++, shifter += 2)
*s->pixel_ptr++ = P[split + ((flags >> shifter) & 0x03)];
s->pixel_ptr += s->line_inc;
}
}
}
return 0;
}
libavcodec/interplayvideo.c:592: error: Buffer Overrun L2
Offset: [4, 18] Size: 16.
libavcodec/interplayvideo.c:590:14: <Offset trace>
588. for (y = 0; y < 4; y++)
589. B[y] = *s->stream_ptr++;
590. for (y = 4; y < 16; y += 4) {
^
591. for (x = y; x < y + 4; x++)
592. P[x] = *s->stream_ptr++;
libavcodec/interplayvideo.c:590:14: Assignment
588. for (y = 0; y < 4; y++)
589. B[y] = *s->stream_ptr++;
590. for (y = 4; y < 16; y += 4) {
^
591. for (x = y; x < y + 4; x++)
592. P[x] = *s->stream_ptr++;
libavcodec/interplayvideo.c:565:1: <Length trace>
563. }
564.
565. static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s)
^
566. {
567. int x, y;
libavcodec/interplayvideo.c:565:1: Array declaration
563. }
564.
565. static int ipvideo_decode_block_opcode_0xA(IpvideoContext *s)
^
566. {
567. int x, y;
libavcodec/interplayvideo.c:592:17: Array access: Offset: [4, 18] Size: 16
590. for (y = 4; y < 16; y += 4) {
591. for (x = y; x < y + 4; x++)
592. P[x] = *s->stream_ptr++;
^
593. for (x = y; x < y + 4; x++)
594. B[x] = *s->stream_ptr++;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/interplayvideo.c/#L592
|
d2a_code_trace_data_43679
|
void CRYPTO_free(void *str)
{
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
if (call_malloc_debug) {
CRYPTO_mem_debug_free(str, 0);
free(str);
CRYPTO_mem_debug_free(str, 1);
} else {
free(str);
}
#else
free(str);
#endif
}
crypto/cms/cms_sd.c:700: error: USE_AFTER_FREE
call to `EVP_DigestSignInit()` eventually accesses memory that was invalidated by call to `free()` on line 699 indirectly during the call to `EVP_MD_CTX_reset()`.
Showing all 16 steps of the trace
crypto/cms/cms_sd.c:678:1: invalidation part of the trace starts here
676. }
677.
678. > int CMS_SignerInfo_sign(CMS_SignerInfo *si)
679. {
680. EVP_MD_CTX *mctx = si->mctx;
crypto/cms/cms_sd.c:678:1: parameter `si` of CMS_SignerInfo_sign
676. }
677.
678. > int CMS_SignerInfo_sign(CMS_SignerInfo *si)
679. {
680. EVP_MD_CTX *mctx = si->mctx;
crypto/cms/cms_sd.c:680:5: assigned
678. int CMS_SignerInfo_sign(CMS_SignerInfo *si)
679. {
680. EVP_MD_CTX *mctx = si->mctx;
^
681. EVP_PKEY_CTX *pctx;
682. unsigned char *abuf = NULL;
crypto/cms/cms_sd.c:699:9: when calling `EVP_MD_CTX_reset` here
697. pctx = si->pctx;
698. else {
699. EVP_MD_CTX_reset(mctx);
^
700. if (EVP_DigestSignInit(mctx, &pctx, md, NULL, si->pkey) <= 0)
701. goto err;
crypto/evp/digest.c:123:1: parameter `ctx` of EVP_MD_CTX_reset
121.
122. /* This call frees resources associated with the context */
123. > int EVP_MD_CTX_reset(EVP_MD_CTX *ctx)
124. {
125. if (ctx == NULL)
crypto/evp/digest.c:137:9: when calling `CRYPTO_clear_free` here
135. if (ctx->digest && ctx->digest->ctx_size && ctx->md_data
136. && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)) {
137. OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size);
^
138. }
139. EVP_PKEY_CTX_free(ctx->pctx);
crypto/mem.c:249:1: parameter `str` of CRYPTO_clear_free
247. }
248.
249. > void CRYPTO_clear_free(void *str, size_t num)
250. {
251. if (str == NULL)
crypto/mem.c:255:5: when calling `CRYPTO_free` here
253. if (num)
254. OPENSSL_cleanse(str, num);
255. CRYPTO_free(str);
^
256. }
crypto/mem.c:234:1: parameter `str` of CRYPTO_free
232. }
233.
234. > void CRYPTO_free(void *str)
235. {
236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:245:5: was invalidated by call to `free()`
243. }
244. #else
245. free(str);
^
246. #endif
247. }
crypto/cms/cms_sd.c:678:1: use-after-lifetime part of the trace starts here
676. }
677.
678. > int CMS_SignerInfo_sign(CMS_SignerInfo *si)
679. {
680. EVP_MD_CTX *mctx = si->mctx;
crypto/cms/cms_sd.c:678:1: parameter `si` of CMS_SignerInfo_sign
676. }
677.
678. > int CMS_SignerInfo_sign(CMS_SignerInfo *si)
679. {
680. EVP_MD_CTX *mctx = si->mctx;
crypto/cms/cms_sd.c:680:5: assigned
678. int CMS_SignerInfo_sign(CMS_SignerInfo *si)
679. {
680. EVP_MD_CTX *mctx = si->mctx;
^
681. EVP_PKEY_CTX *pctx;
682. unsigned char *abuf = NULL;
crypto/cms/cms_sd.c:700:13: when calling `EVP_DigestSignInit` here
698. else {
699. EVP_MD_CTX_reset(mctx);
700. if (EVP_DigestSignInit(mctx, &pctx, md, NULL, si->pkey) <= 0)
^
701. goto err;
702. }
crypto/mem.c:234:1: parameter `str` of CRYPTO_free
232. }
233.
234. > void CRYPTO_free(void *str)
235. {
236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:245:5: invalid access occurs here
243. }
244. #else
245. free(str);
^
246. #endif
247. }
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/crypto/mem.c/#L245
|
d2a_code_trace_data_43680
|
static int update_index(CA_DB *db, char **row)
{
char **irow;
int i;
irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
for (i = 0; i < DB_NUMBER; i++)
irow[i] = row[i];
irow[DB_NUMBER] = NULL;
if (!TXT_DB_insert(db->db, irow)) {
BIO_printf(bio_err, "failed to update srpvfile\n");
BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
OPENSSL_free(irow);
return 0;
}
return 1;
}
apps/srp.c:102: error: NULL_DEREFERENCE
pointer `irow` last assigned on line 100 could be null and is dereferenced at line 102, column 9.
Showing all 19 steps of the trace
apps/srp.c:95:1: start of procedure update_index()
93. }
94.
95. > static int update_index(CA_DB *db, char **row)
96. {
97. char **irow;
apps/srp.c:100:5:
98. int i;
99.
100. > irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
101. for (i = 0; i < DB_NUMBER; i++)
102. irow[i] = row[i];
test/testutil/apps_mem.c:14:1: start of procedure app_malloc()
12. /* shim that avoids sucking in too much from apps/apps.c */
13.
14. > void* app_malloc(int sz, const char *what)
15. {
16. void *vp = OPENSSL_malloc(sz);
test/testutil/apps_mem.c:16:5:
14. void* app_malloc(int sz, const char *what)
15. {
16. > void *vp = OPENSSL_malloc(sz);
17.
18. return vp;
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking false branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
test/testutil/apps_mem.c:18:5:
16. void *vp = OPENSSL_malloc(sz);
17.
18. > return vp;
19. }
test/testutil/apps_mem.c:19:1: return from a call to app_malloc
17.
18. return vp;
19. > }
apps/srp.c:101:10:
99.
100. irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
101. > for (i = 0; i < DB_NUMBER; i++)
102. irow[i] = row[i];
103. irow[DB_NUMBER] = NULL;
apps/srp.c:101:17: Loop condition is true. Entering loop body
99.
100. irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
101. for (i = 0; i < DB_NUMBER; i++)
^
102. irow[i] = row[i];
103. irow[DB_NUMBER] = NULL;
apps/srp.c:102:9:
100. irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
101. for (i = 0; i < DB_NUMBER; i++)
102. > irow[i] = row[i];
103. irow[DB_NUMBER] = NULL;
104.
|
https://github.com/openssl/openssl/blob/ce506d27ab5e7d17dfe3fe649768a0d19b6c86ee/apps/srp.c/#L102
|
d2a_code_trace_data_43681
|
STACK *SSL_dup_CA_list(STACK *sk)
{
int i;
STACK *ret;
X509_NAME *name;
ret=sk_new_null();
for (i=0; i<sk_num(sk); i++)
{
name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
if ((name == NULL) || !sk_push(ret,(char *)name))
{
sk_pop_free(ret,X509_NAME_free);
return(NULL);
}
}
return(ret);
}
ssl/ssl_cert.c:465: error: NULL_DEREFERENCE
pointer `ret` last assigned on line 461 could be null and is dereferenced by call to `sk_push()` at line 465, column 26.
Showing all 38 steps of the trace
ssl/ssl_cert.c:455:1: start of procedure SSL_dup_CA_list()
453. }
454.
455. > STACK *SSL_dup_CA_list(STACK *sk)
456. {
457. int i;
ssl/ssl_cert.c:461:2:
459. X509_NAME *name;
460.
461. > ret=sk_new_null();
462. for (i=0; i<sk_num(sk); i++)
463. {
crypto/stack/stack.c:112:1: start of procedure sk_new()
110. }
111.
112. > STACK *sk_new(int (*c)())
113. {
114. STACK *ret;
crypto/stack/stack.c:117:6: Taking true branch
115. int i;
116.
117. if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
^
118. goto err0;
119. if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
crypto/stack/stack.c:130:1:
128. err1:
129. Free((char *)ret);
130. > err0:
131. return(NULL);
132. }
crypto/stack/stack.c:131:2:
129. Free((char *)ret);
130. err0:
131. > return(NULL);
132. }
133.
crypto/stack/stack.c:132:2: return from a call to sk_new
130. err0:
131. return(NULL);
132. }
^
133.
134. int sk_insert(STACK *st, char *data, int loc)
ssl/ssl_cert.c:462:7:
460.
461. ret=sk_new_null();
462. > for (i=0; i<sk_num(sk); i++)
463. {
464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
ssl/ssl_cert.c:462:12:
460.
461. ret=sk_new_null();
462. > for (i=0; i<sk_num(sk); i++)
463. {
464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
crypto/stack/stack.c:287:1: start of procedure sk_num()
285. }
286.
287. > int sk_num(STACK *st)
288. {
289. if(st == NULL) return -1;
crypto/stack/stack.c:289:5: Taking false branch
287. int sk_num(STACK *st)
288. {
289. if(st == NULL) return -1;
^
290. return st->num;
291. }
crypto/stack/stack.c:290:2:
288. {
289. if(st == NULL) return -1;
290. > return st->num;
291. }
292.
crypto/stack/stack.c:291:1: return from a call to sk_num
289. if(st == NULL) return -1;
290. return st->num;
291. > }
292.
293. char *sk_value(STACK *st, int i)
ssl/ssl_cert.c:462:12: Loop condition is true. Entering loop body
460.
461. ret=sk_new_null();
462. for (i=0; i<sk_num(sk); i++)
^
463. {
464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
ssl/ssl_cert.c:464:3:
462. for (i=0; i<sk_num(sk); i++)
463. {
464. > name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
465. if ((name == NULL) || !sk_push(ret,(char *)name))
466. {
crypto/stack/stack.c:293:1: start of procedure sk_value()
291. }
292.
293. > char *sk_value(STACK *st, int i)
294. {
295. if(st == NULL) return NULL;
crypto/stack/stack.c:295:5: Taking false branch
293. char *sk_value(STACK *st, int i)
294. {
295. if(st == NULL) return NULL;
^
296. return st->data[i];
297. }
crypto/stack/stack.c:296:2:
294. {
295. if(st == NULL) return NULL;
296. > return st->data[i];
297. }
298.
crypto/stack/stack.c:297:1: return from a call to sk_value
295. if(st == NULL) return NULL;
296. return st->data[i];
297. > }
298.
299. char *sk_set(STACK *st, int i, char *value)
crypto/x509/x_all.c:353:1: start of procedure X509_NAME_dup()
351. }
352.
353. > X509_NAME *X509_NAME_dup(X509_NAME *xn)
354. {
355. return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME,
crypto/x509/x_all.c:355:2:
353. X509_NAME *X509_NAME_dup(X509_NAME *xn)
354. {
355. > return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME,
356. (char *(*)())d2i_X509_NAME,(char *)xn));
357. }
crypto/asn1/a_dup.c:65:1: start of procedure ASN1_dup()
63. #define READ_CHUNK 2048
64.
65. > char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x)
66. {
67. unsigned char *b,*p;
crypto/asn1/a_dup.c:71:6: Taking false branch
69. char *ret;
70.
71. if (x == NULL) return(NULL);
^
72.
73. i=(long)i2d(x,NULL);
crypto/asn1/a_dup.c:73:2: Skipping __function_pointer__(): unresolved function pointer
71. if (x == NULL) return(NULL);
72.
73. i=(long)i2d(x,NULL);
^
74. b=(unsigned char *)Malloc((unsigned int)i+10);
75. if (b == NULL)
crypto/asn1/a_dup.c:74:2:
72.
73. i=(long)i2d(x,NULL);
74. > b=(unsigned char *)Malloc((unsigned int)i+10);
75. if (b == NULL)
76. { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
crypto/asn1/a_dup.c:75:6: Taking false branch
73. i=(long)i2d(x,NULL);
74. b=(unsigned char *)Malloc((unsigned int)i+10);
75. if (b == NULL)
^
76. { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
77. p= b;
crypto/asn1/a_dup.c:77:2:
75. if (b == NULL)
76. { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
77. > p= b;
78. i=i2d(x,&p);
79. p= b;
crypto/asn1/a_dup.c:78:2: Skipping __function_pointer__(): unresolved function pointer
76. { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
77. p= b;
78. i=i2d(x,&p);
^
79. p= b;
80. ret=d2i(NULL,&p,i);
crypto/asn1/a_dup.c:79:2:
77. p= b;
78. i=i2d(x,&p);
79. > p= b;
80. ret=d2i(NULL,&p,i);
81. Free((char *)b);
crypto/asn1/a_dup.c:80:2: Skipping __function_pointer__(): unresolved function pointer
78. i=i2d(x,&p);
79. p= b;
80. ret=d2i(NULL,&p,i);
^
81. Free((char *)b);
82. return(ret);
crypto/asn1/a_dup.c:81:2:
79. p= b;
80. ret=d2i(NULL,&p,i);
81. > Free((char *)b);
82. return(ret);
83. }
crypto/asn1/a_dup.c:82:2:
80. ret=d2i(NULL,&p,i);
81. Free((char *)b);
82. > return(ret);
83. }
crypto/asn1/a_dup.c:83:2: return from a call to ASN1_dup
81. Free((char *)b);
82. return(ret);
83. }
^
crypto/x509/x_all.c:357:2: return from a call to X509_NAME_dup
355. return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME,
356. (char *(*)())d2i_X509_NAME,(char *)xn));
357. }
^
358.
359. X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne)
ssl/ssl_cert.c:465:8: Taking false branch
463. {
464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
465. if ((name == NULL) || !sk_push(ret,(char *)name))
^
466. {
467. sk_pop_free(ret,X509_NAME_free);
ssl/ssl_cert.c:465:26:
463. {
464. name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
465. > if ((name == NULL) || !sk_push(ret,(char *)name))
466. {
467. sk_pop_free(ret,X509_NAME_free);
crypto/stack/stack.c:237:1: start of procedure sk_push()
235. }
236.
237. > int sk_push(STACK *st, char *data)
238. {
239. return(sk_insert(st,data,st->num));
crypto/stack/stack.c:239:2: Skipping sk_insert(): empty list of specs
237. int sk_push(STACK *st, char *data)
238. {
239. return(sk_insert(st,data,st->num));
^
240. }
241.
|
https://github.com/openssl/openssl/blob/c1c96de01c5a9bd1b715f6968bf9972141c2ade6/ssl/ssl_cert.c/#L465
|
d2a_code_trace_data_43682
|
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
{
int i, j, max;
const BN_ULONG *ap;
BN_ULONG *rp;
max = n * 2;
ap = a;
rp = r;
rp[0] = rp[max - 1] = 0;
rp++;
j = n;
if (--j > 0) {
ap++;
rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
rp += 2;
}
for (i = n - 2; i > 0; i--) {
j--;
ap++;
rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
rp += 2;
}
bn_add_words(r, r, r, max);
bn_sqr_words(tmp, a, n);
bn_add_words(r, r, tmp, max);
}
test/srptest.c:69: error: BUFFER_OVERRUN_L3
Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `SRP_create_verifier_BN`.
Showing all 30 steps of the trace
test/srptest.c:69:10: Call
67.
68. /* Set up server's password entry */
69. if (!TEST_true(SRP_create_verifier_BN(username, server_pass,
^
70. &s, &v, GN->N, GN->g)))
71. goto end;
crypto/srp/srp_vfy.c:633:1: Parameter `N->top`
631. * BIGNUMS.
632. */
633. > int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
634. BIGNUM **verifier, const BIGNUM *N,
635. const BIGNUM *g)
crypto/srp/srp_vfy.c:664:10: Call
662. goto err;
663.
664. if (!BN_mod_exp(*verifier, g, x, N, bn_ctx)) {
^
665. BN_clear_free(*verifier);
666. goto err;
crypto/bn/bn_exp.c:91:1: Parameter `m->top`
89. }
90.
91. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
92. BN_CTX *ctx)
93. {
crypto/bn/bn_exp.c:136:9: Call
134.
135. #ifdef MONT_MUL_MOD
136. if (BN_is_odd(m)) {
^
137. # ifdef MONT_EXP_WORD
138. if (a->top == 1 && !a->neg
crypto/bn/bn_lib.c:867:1: Parameter `a->top`
865. }
866.
867. > int BN_is_odd(const BIGNUM *a)
868. {
869. return (a->top > 0) && (a->d[0] & 1);
crypto/bn/bn_exp.c:144:19: Call
142. } else
143. # endif
144. ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
^
145. } else
146. #endif
crypto/bn/bn_exp.c:294:1: Parameter `m->top`
292. }
293.
294. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
295. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
296. {
crypto/bn/bn_exp.c:306:16: Call
304.
305. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) {
306. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
^
307. }
308.
crypto/bn/bn_exp.c:737:14: Assignment
735. /* 2^(top*BN_BITS2) - m */
736. tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
737. for (i = 1; i < top; i++)
^
738. tmp.d[i] = (~m->d[i]) & BN_MASK2;
739. tmp.top = top;
crypto/bn/bn_exp.c:1036:14: Call
1034. for (wvalue = 0, i = bits % window; i >= 0; i--, bits--)
1035. wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);
1036. if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
^
1037. window))
1038. goto err;
crypto/bn/bn_exp.c:518:1: Parameter `top`
516. }
517.
518. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
519. unsigned char *buf, int idx,
520. int window)
crypto/bn/bn_exp.c:575:5: Assignment
573. }
574.
575. b->top = top;
^
576. bn_correct_top(b);
577. return 1;
crypto/bn/bn_exp.c:576:5: Call
574.
575. b->top = top;
576. bn_correct_top(b);
^
577. return 1;
578. }
crypto/bn/bn_lib.c:953:1: Parameter `a->top`
951. }
952.
953. > void bn_correct_top(BIGNUM *a)
954. {
955. BN_ULONG *ftl;
crypto/bn/bn_exp.c:1049:22: Call
1047. /* Scan the window, squaring the result as we go */
1048. for (i = 0; i < window; i++, bits--) {
1049. if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx))
^
1050. goto err;
1051. wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);
crypto/bn/bn_mont.c:26:1: Parameter `a->top`
24. #endif
25.
26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
crypto/bn/bn_mont.c:53:14: Call
51. bn_check_top(tmp);
52. if (a == b) {
53. if (!BN_sqr(tmp, a, ctx))
^
54. goto err;
55. } else {
crypto/bn/bn_sqr.c:17:1: Parameter `a->top`
15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
16. */
17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int max, al;
crypto/bn/bn_sqr.c:25:5: Assignment
23. bn_check_top(a);
24.
25. al = a->top;
^
26. if (al <= 0) {
27. r->top = 0;
crypto/bn/bn_sqr.c:74:17: Call
72. if (bn_wexpand(tmp, max) == NULL)
73. goto err;
74. bn_sqr_normal(rr->d, a->d, al, tmp->d);
^
75. }
76. }
crypto/bn/bn_sqr.c:105:1: <Offset trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `n`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:116:5: Assignment
114. rp[0] = rp[max - 1] = 0;
115. rp++;
116. j = n;
^
117.
118. if (--j > 0) {
crypto/bn/bn_sqr.c:118:9: Assignment
116. j = n;
117.
118. if (--j > 0) {
^
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
crypto/bn/bn_sqr.c:105:1: <Length trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `*r`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:113:5: Assignment
111. max = n * 2;
112. ap = a;
113. rp = r;
^
114. rp[0] = rp[max - 1] = 0;
115. rp++;
crypto/bn/bn_sqr.c:115:5: Assignment
113. rp = r;
114. rp[0] = rp[max - 1] = 0;
115. rp++;
^
116. j = n;
117.
crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `SRP_create_verifier_BN`
118. if (--j > 0) {
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
^
121. rp += 2;
122. }
|
https://github.com/openssl/openssl/blob/b66411f6cda6970c01283ddde6d8063c57b3b7d9/crypto/bn/bn_sqr.c/#L120
|
d2a_code_trace_data_43683
|
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
*allocbytes = (unsigned char *)pkt->buf->data + pkt->curr;
return 1;
}
ssl/statem/statem_srvr.c:853: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 5]):unsigned64 by call to `WPACKET_sub_memcpy__`.
Showing all 16 steps of the trace
ssl/statem/statem_srvr.c:848:1: Parameter `pkt->written`
846. }
847.
848. > int dtls_raw_hello_verify_request(WPACKET *pkt, unsigned char *cookie,
849. unsigned char cookie_len)
850. {
ssl/statem/statem_srvr.c:852:10: Call
850. {
851. /* Always use DTLS 1.0 version: see RFC 6347 */
852. if (!WPACKET_put_bytes_u16(pkt, DTLS1_VERSION)
^
853. || !WPACKET_sub_memcpy_u8(pkt, cookie, cookie_len))
854. return 0;
ssl/packet.c:261:1: Parameter `pkt->written`
259. }
260.
261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
262. {
263. unsigned char *data;
ssl/statem/statem_srvr.c:853:17: Call
851. /* Always use DTLS 1.0 version: see RFC 6347 */
852. if (!WPACKET_put_bytes_u16(pkt, DTLS1_VERSION)
853. || !WPACKET_sub_memcpy_u8(pkt, cookie, cookie_len))
^
854. return 0;
855.
ssl/packet.c:320:10: Call
318. size_t lenbytes)
319. {
320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
^
321. || !WPACKET_memcpy(pkt, src, len)
322. || !WPACKET_close(pkt))
ssl/packet.c:224:1: Parameter `pkt->buf->length`
222. }
223.
224. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
225. {
226. WPACKET_SUB *sub;
ssl/packet.c:321:17: Call
319. {
320. if (!WPACKET_start_sub_packet_len__(pkt, lenbytes)
321. || !WPACKET_memcpy(pkt, src, len)
^
322. || !WPACKET_close(pkt))
323. return 0;
ssl/packet.c:302:1: Parameter `pkt->written`
300. }
301.
302. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
303. {
304. unsigned char *dest;
ssl/packet.c:309:10: Call
307. return 1;
308.
309. if (!WPACKET_allocate_bytes(pkt, len, &dest))
^
310. return 0;
311.
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:36:1: <LHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `pkt->buf->length`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: <RHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `len`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:46:9: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 5]):unsigned64 by call to `WPACKET_sub_memcpy__`
44. return 0;
45.
46. if (pkt->buf->length - pkt->written < len) {
^
47. size_t newlen;
48. size_t reflen;
|
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
|
d2a_code_trace_data_43684
|
static void mdct512(int32_t *out, int16_t *in)
{
int i, re, im, re1, im1;
int16_t rot[N];
IComplex x[N/4];
for(i=0;i<N/4;i++)
rot[i] = -in[i + 3*N/4];
for(i=N/4;i<N;i++)
rot[i] = in[i - N/4];
for(i=0;i<N/4;i++) {
re = ((int)rot[2*i] - (int)rot[N-1-2*i]) >> 1;
im = -((int)rot[N/2+2*i] - (int)rot[N/2-1-2*i]) >> 1;
CMUL(x[i].re, x[i].im, re, im, -xcos1[i], xsin1[i]);
}
fft(x, MDCT_NBITS - 2);
for(i=0;i<N/4;i++) {
re = x[i].re;
im = x[i].im;
CMUL(re1, im1, re, im, xsin1[i], xcos1[i]);
out[2*i] = im1;
out[N/2-1-2*i] = re1;
}
}
libavcodec/ac3enc.c:1194: error: Buffer Overrun L2
Offset: [1, 255] Size: 6 by call to `mdct512`.
libavcodec/ac3enc.c:1144:1: Array declaration
1142. }
1143.
1144. static int AC3_encode_frame(AVCodecContext *avctx,
^
1145. unsigned char *frame, int buf_size, void *data)
1146. {
libavcodec/ac3enc.c:1194:13: Call
1192.
1193. /* do the MDCT */
1194. mdct512(mdct_coef[i][ch], input_samples);
^
1195.
1196. /* compute "exponents". We take into account the
libavcodec/ac3enc.c:220:9: <Offset trace>
218.
219. /* post rotation */
220. for(i=0;i<N/4;i++) {
^
221. re = x[i].re;
222. im = x[i].im;
libavcodec/ac3enc.c:220:9: Assignment
218.
219. /* post rotation */
220. for(i=0;i<N/4;i++) {
^
221. re = x[i].re;
222. im = x[i].im;
libavcodec/ac3enc.c:198:1: <Length trace>
196.
197. /* do a 512 point mdct */
198. static void mdct512(int32_t *out, int16_t *in)
^
199. {
200. int i, re, im, re1, im1;
libavcodec/ac3enc.c:198:1: Parameter `*out`
196.
197. /* do a 512 point mdct */
198. static void mdct512(int32_t *out, int16_t *in)
^
199. {
200. int i, re, im, re1, im1;
libavcodec/ac3enc.c:225:9: Array access: Offset: [1, 255] Size: 6 by call to `mdct512`
223. CMUL(re1, im1, re, im, xsin1[i], xcos1[i]);
224. out[2*i] = im1;
225. out[N/2-1-2*i] = re1;
^
226. }
227. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ac3enc.c/#L225
|
d2a_code_trace_data_43685
|
void t2p_read_tiff_size(T2P* t2p, TIFF* input){
uint64* sbc=NULL;
#if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
unsigned char* jpt=NULL;
tstrip_t i=0;
tstrip_t stripcount=0;
#endif
#ifdef OJPEG_SUPPORT
tsize_t k = 0;
#endif
if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
#ifdef CCITT_SUPPORT
if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
t2p->tiff_datasize=(tmsize_t)sbc[0];
return;
}
#endif
#ifdef ZIP_SUPPORT
if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
t2p->tiff_datasize=(tmsize_t)sbc[0];
return;
}
#endif
#ifdef OJPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_OJPEG){
if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
stripcount=TIFFNumberOfStrips(input);
for(i=0;i<stripcount;i++){
k += sbc[i];
}
if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
if(t2p->tiff_dataoffset != 0){
if(TIFFGetField(input, TIFFTAG_JPEGIFBYTECOUNT, &(t2p->tiff_datasize))!=0){
if(t2p->tiff_datasize < k) {
t2p->pdf_ojpegiflength=t2p->tiff_datasize;
t2p->tiff_datasize+=k;
t2p->tiff_datasize+=6;
t2p->tiff_datasize+=2*stripcount;
TIFFWarning(TIFF2PDF_MODULE,
"Input file %s has short JPEG interchange file byte count",
TIFFFileName(input));
return;
}
return;
}else {
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_JPEGIFBYTECOUNT",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
}
}
t2p->tiff_datasize+=k;
t2p->tiff_datasize+=2*stripcount;
t2p->tiff_datasize+=2048;
return;
}
#endif
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_JPEG) {
uint32 count = 0;
if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0 ){
if(count > 4){
t2p->tiff_datasize += count;
t2p->tiff_datasize -= 2;
}
} else {
t2p->tiff_datasize = 2;
}
stripcount=TIFFNumberOfStrips(input);
if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
TIFFError(TIFF2PDF_MODULE,
"Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
for(i=0;i<stripcount;i++){
t2p->tiff_datasize += sbc[i];
t2p->tiff_datasize -=4;
}
t2p->tiff_datasize +=2;
return;
}
#endif
(void) 0;
}
t2p->tiff_datasize=TIFFScanlineSize(input) * t2p->tiff_length;
if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){
t2p->tiff_datasize*= t2p->tiff_samplesperpixel;
}
return;
}
tools/tiff2pdf.c:1810: error: Null Dereference
pointer `sbc` last assigned on line 1774 could be null and is dereferenced at line 1810, column 10.
tools/tiff2pdf.c:1772:1: start of procedure t2p_read_tiff_size()
1770. */
1771.
1772. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
^
1773.
1774. uint64* sbc=NULL;
tools/tiff2pdf.c:1774:2:
1772. void t2p_read_tiff_size(T2P* t2p, TIFF* input){
1773.
1774. uint64* sbc=NULL;
^
1775. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1776. unsigned char* jpt=NULL;
tools/tiff2pdf.c:1776:2:
1774. uint64* sbc=NULL;
1775. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1776. unsigned char* jpt=NULL;
^
1777. tstrip_t i=0;
1778. tstrip_t stripcount=0;
tools/tiff2pdf.c:1777:2:
1775. #if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
1776. unsigned char* jpt=NULL;
1777. tstrip_t i=0;
^
1778. tstrip_t stripcount=0;
1779. #endif
tools/tiff2pdf.c:1778:2:
1776. unsigned char* jpt=NULL;
1777. tstrip_t i=0;
1778. tstrip_t stripcount=0;
^
1779. #endif
1780. #ifdef OJPEG_SUPPORT
tools/tiff2pdf.c:1781:9:
1779. #endif
1780. #ifdef OJPEG_SUPPORT
1781. tsize_t k = 0;
^
1782. #endif
1783.
tools/tiff2pdf.c:1784:5: Taking true branch
1782. #endif
1783.
1784. if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
^
1785. #ifdef CCITT_SUPPORT
1786. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
tools/tiff2pdf.c:1786:6: Taking false branch
1784. if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
1785. #ifdef CCITT_SUPPORT
1786. if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
^
1787. TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1788. t2p->tiff_datasize=(tmsize_t)sbc[0];
tools/tiff2pdf.c:1793:6: Taking false branch
1791. #endif
1792. #ifdef ZIP_SUPPORT
1793. if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
^
1794. TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
1795. t2p->tiff_datasize=(tmsize_t)sbc[0];
tools/tiff2pdf.c:1800:6: Taking true branch
1798. #endif
1799. #ifdef OJPEG_SUPPORT
1800. if(t2p->tiff_compression == COMPRESSION_OJPEG){
^
1801. if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
1802. TIFFError(TIFF2PDF_MODULE,
tools/tiff2pdf.c:1801:8:
1799. #ifdef OJPEG_SUPPORT
1800. if(t2p->tiff_compression == COMPRESSION_OJPEG){
1801. if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
^
1802. TIFFError(TIFF2PDF_MODULE,
1803. "Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",
libtiff/tif_dir.c:1100:1: start of procedure TIFFGetField()
1098. * internal directory structure.
1099. */
1100. int
^
1101. TIFFGetField(TIFF* tif, uint32 tag, ...)
1102. {
libtiff/tif_dir.c:1106:2:
1104. va_list ap;
1105.
1106. va_start(ap, tag);
^
1107. status = TIFFVGetField(tif, tag, ap);
1108. va_end(ap);
libtiff/tif_dir.c:1107:2: Skipping TIFFVGetField(): empty list of specs
1105.
1106. va_start(ap, tag);
1107. status = TIFFVGetField(tif, tag, ap);
^
1108. va_end(ap);
1109. return (status);
libtiff/tif_dir.c:1108:2:
1106. va_start(ap, tag);
1107. status = TIFFVGetField(tif, tag, ap);
1108. va_end(ap);
^
1109. return (status);
1110. }
libtiff/tif_dir.c:1109:2:
1107. status = TIFFVGetField(tif, tag, ap);
1108. va_end(ap);
1109. return (status);
^
1110. }
1111.
libtiff/tif_dir.c:1110:1: return from a call to TIFFGetField
1108. va_end(ap);
1109. return (status);
1110. }
^
1111.
1112. /*
tools/tiff2pdf.c:1801:8: Taking false branch
1799. #ifdef OJPEG_SUPPORT
1800. if(t2p->tiff_compression == COMPRESSION_OJPEG){
1801. if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){
^
1802. TIFFError(TIFF2PDF_MODULE,
1803. "Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS",
tools/tiff2pdf.c:1808:4:
1806. return;
1807. }
1808. stripcount=TIFFNumberOfStrips(input);
^
1809. for(i=0;i<stripcount;i++){
1810. k += sbc[i];
libtiff/tif_strip.c:60:1: start of procedure TIFFNumberOfStrips()
58. * Compute how many strips are in an image.
59. */
60. uint32
^
61. TIFFNumberOfStrips(TIFF* tif)
62. {
libtiff/tif_strip.c:63:2:
61. TIFFNumberOfStrips(TIFF* tif)
62. {
63. TIFFDirectory *td = &tif->tif_dir;
^
64. uint32 nstrips;
65.
libtiff/tif_strip.c:66:13: Condition is false
64. uint32 nstrips;
65.
66. nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
^
67. TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
68. if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
libtiff/tif_strip.c:67:7: Condition is true
65.
66. nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
67. TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
^
68. if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
69. nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
libtiff/tif_strip.c:66:13:
64. uint32 nstrips;
65.
66. nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
^
67. TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
68. if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
libtiff/tif_strip.c:66:2:
64. uint32 nstrips;
65.
66. nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
^
67. TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
68. if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
libtiff/tif_strip.c:68:6: Taking true branch
66. nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
67. TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
68. if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
^
69. nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
70. "TIFFNumberOfStrips");
libtiff/tif_strip.c:69:3:
67. TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
68. if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
69. nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
^
70. "TIFFNumberOfStrips");
71. return (nstrips);
libtiff/tif_aux.c:36:1: start of procedure _TIFFMultiply32()
34. #include <math.h>
35.
36. uint32
^
37. _TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
38. {
libtiff/tif_aux.c:39:2:
37. _TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
38. {
39. uint32 bytes = first * second;
^
40.
41. if (second && bytes / second != first) {
libtiff/tif_aux.c:41:6: Taking true branch
39. uint32 bytes = first * second;
40.
41. if (second && bytes / second != first) {
^
42. TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
43. bytes = 0;
libtiff/tif_aux.c:41:16: Taking false branch
39. uint32 bytes = first * second;
40.
41. if (second && bytes / second != first) {
^
42. TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
43. bytes = 0;
libtiff/tif_aux.c:46:2:
44. }
45.
46. return bytes;
^
47. }
48.
libtiff/tif_aux.c:47:1: return from a call to _TIFFMultiply32
45.
46. return bytes;
47. }
^
48.
49. uint64
libtiff/tif_strip.c:71:2:
69. nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
70. "TIFFNumberOfStrips");
71. return (nstrips);
^
72. }
73.
libtiff/tif_strip.c:72:1: return from a call to TIFFNumberOfStrips
70. "TIFFNumberOfStrips");
71. return (nstrips);
72. }
^
73.
74. /*
tools/tiff2pdf.c:1809:8:
1807. }
1808. stripcount=TIFFNumberOfStrips(input);
1809. for(i=0;i<stripcount;i++){
^
1810. k += sbc[i];
1811. }
tools/tiff2pdf.c:1809:12: Loop condition is true. Entering loop body
1807. }
1808. stripcount=TIFFNumberOfStrips(input);
1809. for(i=0;i<stripcount;i++){
^
1810. k += sbc[i];
1811. }
tools/tiff2pdf.c:1810:5:
1808. stripcount=TIFFNumberOfStrips(input);
1809. for(i=0;i<stripcount;i++){
1810. k += sbc[i];
^
1811. }
1812. if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
|
https://gitlab.com/libtiff/libtiff/blob/b69a1998bedfabc32cd541408bffdef05bd01e45/tools/tiff2pdf.c/#L1810
|
d2a_code_trace_data_43686
|
static const char *skip_space(const char *s)
{
while (ossl_isspace(*s))
s++;
return s;
}
test/property_test.c:350: error: BUFFER_OVERRUN_L3
Offset: [2, +oo] Size: [1, 50] by call to `ossl_method_store_add`.
Showing all 25 steps of the trace
test/property_test.c:333:1: Array declaration
331. }
332.
333. > static int test_query_cache_stochastic(void)
334. {
335. const int max = 10000, tail = 10;
test/property_test.c:350:14: Call
348. v[i] = 2 * i;
349. BIO_snprintf(buf, sizeof(buf), "n=%d\n", i);
350. if (!TEST_true(ossl_method_store_add(store, i, buf, "abc", NULL))
^
351. || !TEST_true(ossl_method_store_cache_set(store, i, buf, v + i))
352. || !TEST_true(ossl_method_store_cache_set(store, i, "n=1234",
crypto/property/property.c:176:1: Parameter `*properties`
174. }
175.
176. > int ossl_method_store_add(OSSL_METHOD_STORE *store,
177. int nid, const char *properties,
178. void *method, void (*method_destruct)(void *))
crypto/property/property.c:205:28: Call
203. ossl_method_cache_flush(store, nid);
204. if ((impl->properties = ossl_prop_defn_get(store->ctx, properties)) == NULL) {
205. impl->properties = ossl_parse_property(store->ctx, properties);
^
206. if (impl->properties == NULL)
207. goto err;
crypto/property/property_parse.c:322:1: Parameter `*defn`
320. }
321.
322. > OSSL_PROPERTY_LIST *ossl_parse_property(OPENSSL_CTX *ctx, const char *defn)
323. {
324. PROPERTY_DEFINITION *prop = NULL;
crypto/property/property_parse.c:327:5: Assignment
325. OSSL_PROPERTY_LIST *res = NULL;
326. STACK_OF(PROPERTY_DEFINITION) *sk;
327. const char *s = defn;
^
328. int done;
329.
crypto/property/property_parse.c:333:9: Call
331. return NULL;
332.
333. s = skip_space(s);
^
334. done = *s == '\0';
335. while (!done) {
crypto/property/property_parse.c:52:1: Parameter `*s`
50. DEFINE_STACK_OF(PROPERTY_DEFINITION)
51.
52. > static const char *skip_space(const char *s)
53. {
54. while (ossl_isspace(*s))
crypto/property/property_parse.c:56:5: Assignment
54. while (ossl_isspace(*s))
55. s++;
56. return s;
^
57. }
58.
crypto/property/property_parse.c:333:5: Assignment
331. return NULL;
332.
333. s = skip_space(s);
^
334. done = *s == '\0';
335. while (!done) {
crypto/property/property_parse.c:341:14: Call
339. memset(&prop->v, 0, sizeof(prop->v));
340. prop->optional = 0;
341. if (!parse_name(ctx, &s, 1, &prop->name_idx))
^
342. goto err;
343. prop->oper = PROPERTY_OPER_EQ;
crypto/property/property_parse.c:83:1: Parameter `**t`
81. }
82.
83. > static int parse_name(OPENSSL_CTX *ctx, const char *t[], int create,
84. OSSL_PROPERTY_IDX *idx)
85. {
crypto/property/property_parse.c:348:13: Call
346. goto err;
347. }
348. if (match_ch(&s, '=')) {
^
349. if (!parse_value(ctx, &s, prop, 1)) {
350. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE);
crypto/property/property_parse.c:59:1: Parameter `**t`
57. }
58.
59. > static int match_ch(const char *t[], char m)
60. {
61. const char *s = *t;
crypto/property/property_parse.c:349:18: Call
347. }
348. if (match_ch(&s, '=')) {
349. if (!parse_value(ctx, &s, prop, 1)) {
^
350. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE);
351. goto err;
crypto/property/property_parse.c:247:1: Parameter `**t`
245. }
246.
247. > static int parse_value(OPENSSL_CTX *ctx, const char *t[],
248. PROPERTY_DEFINITION *res, int create)
249. {
crypto/property/property_parse.c:250:5: Assignment
248. PROPERTY_DEFINITION *res, int create)
249. {
250. const char *s = *t;
^
251. int r = 0;
252.
crypto/property/property_parse.c:254:9: Assignment
252.
253. if (*s == '"' || *s == '\'') {
254. s++;
^
255. r = parse_string(ctx, &s, s[-1], res, create);
256. } else if (*s == '+') {
crypto/property/property_parse.c:255:13: Call
253. if (*s == '"' || *s == '\'') {
254. s++;
255. r = parse_string(ctx, &s, s[-1], res, create);
^
256. } else if (*s == '+') {
257. s++;
crypto/property/property_parse.c:186:1: Parameter `**t`
184. }
185.
186. > static int parse_string(OPENSSL_CTX *ctx, const char *t[], char delim,
187. PROPERTY_DEFINITION *res, const int create)
188. {
crypto/property/property_parse.c:190:5: Assignment
188. {
189. char v[1000];
190. const char *s = *t;
^
191. size_t i = 0;
192. int err = 0;
crypto/property/property_parse.c:207:10: Call
205. }
206. v[i] = '\0';
207. *t = skip_space(s + 1);
^
208. if (err)
209. PROPerr(PROP_F_PARSE_STRING, PROP_R_STRING_TOO_LONG);
crypto/property/property_parse.c:52:1: <Length trace>
50. DEFINE_STACK_OF(PROPERTY_DEFINITION)
51.
52. > static const char *skip_space(const char *s)
53. {
54. while (ossl_isspace(*s))
crypto/property/property_parse.c:52:1: Parameter `*s`
50. DEFINE_STACK_OF(PROPERTY_DEFINITION)
51.
52. > static const char *skip_space(const char *s)
53. {
54. while (ossl_isspace(*s))
crypto/property/property_parse.c:54:12: Array access: Offset: [2, +oo] Size: [1, 50] by call to `ossl_method_store_add`
52. static const char *skip_space(const char *s)
53. {
54. while (ossl_isspace(*s))
^
55. s++;
56. return s;
|
https://github.com/openssl/openssl/blob/bddf965d29cb4a9c4d6eeb94aa96dfa47d0cfa5d/crypto/property/property_parse.c/#L54
|
d2a_code_trace_data_43687
|
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
{
int i, j, max;
const BN_ULONG *ap;
BN_ULONG *rp;
max = n * 2;
ap = a;
rp = r;
rp[0] = rp[max - 1] = 0;
rp++;
j = n;
if (--j > 0) {
ap++;
rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
rp += 2;
}
for (i = n - 2; i > 0; i--) {
j--;
ap++;
rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
rp += 2;
}
bn_add_words(r, r, r, max);
bn_sqr_words(tmp, a, n);
bn_add_words(r, r, tmp, max);
}
crypto/rsa/rsa_ossl.c:306: error: BUFFER_OVERRUN_L3
Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `rsa_blinding_convert`.
Showing all 21 steps of the trace
crypto/rsa/rsa_ossl.c:283:9: Call
281. goto err;
282.
283. if (BN_bin2bn(buf, num, f) == NULL)
^
284. goto err;
285.
crypto/bn/bn_lib.c:407:1: Parameter `ret->top`
405. }
406.
407. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
408. {
409. unsigned int i, m;
crypto/rsa/rsa_ossl.c:306:14: Call
304. goto err;
305. }
306. if (!rsa_blinding_convert(blinding, f, unblind, ctx))
^
307. goto err;
308. }
crypto/rsa/rsa_ossl.c:200:1: Parameter `f->top`
198. }
199.
200. > static int rsa_blinding_convert(BN_BLINDING *b, BIGNUM *f, BIGNUM *unblind,
201. BN_CTX *ctx)
202. {
crypto/rsa/rsa_ossl.c:207:16: Call
205. * Local blinding: store the unblinding factor in BN_BLINDING.
206. */
207. return BN_BLINDING_convert_ex(f, NULL, b, ctx);
^
208. } else {
209. /*
crypto/bn/bn_blind.c:130:1: Parameter `n->top`
128. }
129.
130. > int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
131. {
132. int ret = 1;
crypto/bn/bn_blind.c:152:10: Call
150. }
151.
152. if (!BN_mod_mul(n, n, b->A, b->mod, ctx))
^
153. ret = 0;
154.
crypto/bn/bn_mod.c:73:1: Parameter `a->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:87:14: Call
85. goto err;
86. if (a == b) {
87. if (!BN_sqr(t, a, ctx))
^
88. goto err;
89. } else {
crypto/bn/bn_sqr.c:17:1: Parameter `a->top`
15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
16. */
17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int max, al;
crypto/bn/bn_sqr.c:25:5: Assignment
23. bn_check_top(a);
24.
25. al = a->top;
^
26. if (al <= 0) {
27. r->top = 0;
crypto/bn/bn_sqr.c:74:17: Call
72. if (bn_wexpand(tmp, max) == NULL)
73. goto err;
74. bn_sqr_normal(rr->d, a->d, al, tmp->d);
^
75. }
76. }
crypto/bn/bn_sqr.c:105:1: <Offset trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `n`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:116:5: Assignment
114. rp[0] = rp[max - 1] = 0;
115. rp++;
116. j = n;
^
117.
118. if (--j > 0) {
crypto/bn/bn_sqr.c:118:9: Assignment
116. j = n;
117.
118. if (--j > 0) {
^
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
crypto/bn/bn_sqr.c:105:1: <Length trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `*r`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:113:5: Assignment
111. max = n * 2;
112. ap = a;
113. rp = r;
^
114. rp[0] = rp[max - 1] = 0;
115. rp++;
crypto/bn/bn_sqr.c:115:5: Assignment
113. rp = r;
114. rp[0] = rp[max - 1] = 0;
115. rp++;
^
116. j = n;
117.
crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `rsa_blinding_convert`
118. if (--j > 0) {
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
^
121. rp += 2;
122. }
|
https://github.com/openssl/openssl/blob/aa048aef0b9146f90c06333dedfc105d1f9e2c22/crypto/bn/bn_sqr.c/#L120
|
d2a_code_trace_data_43688
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/bntest.c:1424: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_mod_sqrt`.
Showing all 16 steps of the trace
test/bntest.c:1424:10: Call
1422.
1423. /* There are two possible answers. */
1424. if (!BN_mod_sqrt(ret, a, p, ctx) || !BN_sub(ret2, p, ret))
^
1425. goto err;
1426.
crypto/bn/bn_sqrt.c:13:1: Parameter `ctx->stack.depth`
11. #include "bn_lcl.h"
12.
13. > BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
14. /*
15. * Returns 'ret' such that ret^2 == a (mod p), using the Tonelli/Shanks
crypto/bn/bn_sqrt.c:59:5: Call
57. }
58.
59. BN_CTX_start(ctx);
^
60. A = BN_CTX_get(ctx);
61. b = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_sqrt.c:75:10: Call
73.
74. /* A = a mod p */
75. if (!BN_nnmod(A, a, p, ctx))
^
76. goto end;
77.
crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c:140:1: Parameter `ctx->stack.depth`
138. * If 'dv' or 'rm' is NULL, the respective value is not returned.
139. */
140. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
141. BN_CTX *ctx)
142. {
crypto/bn/bn_div.c:193:5: Call
191. }
192.
193. BN_CTX_start(ctx);
^
194. tmp = BN_CTX_get(ctx);
195. snum = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_div.c:416:5: Call
414. if (no_branch)
415. bn_correct_top(res);
416. BN_CTX_end(ctx);
^
417. return (1);
418. err:
crypto/bn/bn_ctx.c:195:1: Parameter `ctx->stack.depth`
193. }
194.
195. > void BN_CTX_end(BN_CTX *ctx)
196. {
197. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:201:27: Call
199. ctx->err_stack--;
200. else {
201. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
202. /* Does this stack frame have anything to release? */
203. if (fp < ctx->used)
crypto/bn/bn_ctx.c:271:1: <LHS trace>
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: Parameter `st->depth`
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:273:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_mod_sqrt`
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_43689
|
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:1058: error: Uninitialized Value
The value read from xmin was never initialized.
libavcodec/motion_est_template.c:1058:9:
1056. CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift)
1057. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1)
1058. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1)
^
1059. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) )
1060. CHECK_CLIPPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) )
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1058
|
d2a_code_trace_data_43690
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/bntest.c:320: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_div`.
Showing all 17 steps of the trace
test/bntest.c:320:9: Call
318. BN_set_negative(a, rand_neg());
319. BN_set_negative(b, rand_neg());
320. BN_mod(c, a, b, ctx);
^
321. BN_div(d, e, a, b, ctx);
322. BN_sub(e, e, c);
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. {
test/bntest.c:321:9: Call
319. BN_set_negative(b, rand_neg());
320. BN_mod(c, a, b, ctx);
321. BN_div(d, e, a, b, ctx);
^
322. BN_sub(e, e, c);
323. if (!TEST_BN_eq_zero(e))
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. {
test/bntest.c:320:9: Call
318. BN_set_negative(a, rand_neg());
319. BN_set_negative(b, rand_neg());
320. BN_mod(c, a, b, ctx);
^
321. BN_div(d, e, a, b, ctx);
322. BN_sub(e, e, c);
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_43691
|
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();
if (dhp == NULL)
return NULL;
dhp->g = BN_new();
if (dhp->g != NULL)
BN_set_word(dhp->g, 2);
if (dh_secbits >= 192)
dhp->p = get_rfc3526_prime_8192(NULL);
else
dhp->p = get_rfc3526_prime_3072(NULL);
if (dhp->p == NULL || dhp->g == NULL) {
DH_free(dhp);
return NULL;
}
return dhp;
}
if (dh_secbits >= 112)
return DH_get_2048_224();
return DH_get_1024_160();
}
ssl/t1_lib.c:4225: error: NULL_DEREFERENCE
pointer `cpk` last assigned on line 4224 could be null and is dereferenced at line 4225, column 45.
Showing all 32 steps of the trace
ssl/t1_lib.c:4213:1: start of procedure ssl_get_auto_dh()
4211.
4212. #ifndef OPENSSL_NO_DH
4213. > DH *ssl_get_auto_dh(SSL *s)
4214. {
4215. int dh_secbits = 80;
ssl/t1_lib.c:4215:5:
4213. DH *ssl_get_auto_dh(SSL *s)
4214. {
4215. > int dh_secbits = 80;
4216. if (s->cert->dh_tmp_auto == 2)
4217. return DH_get_1024_160();
ssl/t1_lib.c:4216:9: Taking false branch
4214. {
4215. int dh_secbits = 80;
4216. if (s->cert->dh_tmp_auto == 2)
^
4217. return DH_get_1024_160();
4218. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
ssl/t1_lib.c:4218:9: Taking false branch
4216. if (s->cert->dh_tmp_auto == 2)
4217. return DH_get_1024_160();
4218. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
^
4219. if (s->s3->tmp.new_cipher->strength_bits == 256)
4220. dh_secbits = 128;
ssl/t1_lib.c:4224:9:
4222. dh_secbits = 80;
4223. } else {
4224. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4225. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4226. }
ssl/ssl_lib.c:2217:1: start of procedure ssl_get_server_send_pkey()
2215. }
2216.
2217. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
2218. {
2219. CERT *c;
ssl/ssl_lib.c:2222:5:
2220. int i;
2221.
2222. > c = s->cert;
2223. if (!s->s3 || !s->s3->tmp.new_cipher)
2224. return NULL;
ssl/ssl_lib.c:2223:10: Taking false branch
2221.
2222. c = s->cert;
2223. if (!s->s3 || !s->s3->tmp.new_cipher)
^
2224. return NULL;
2225. ssl_set_masks(s, s->s3->tmp.new_cipher);
ssl/ssl_lib.c:2223:20: Taking false branch
2221.
2222. c = s->cert;
2223. if (!s->s3 || !s->s3->tmp.new_cipher)
^
2224. return NULL;
2225. ssl_set_masks(s, s->s3->tmp.new_cipher);
ssl/ssl_lib.c:2225:5: Skipping ssl_set_masks(): empty list of specs
2223. if (!s->s3 || !s->s3->tmp.new_cipher)
2224. return NULL;
2225. ssl_set_masks(s, s->s3->tmp.new_cipher);
^
2226.
2227. #ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
ssl/ssl_lib.c:2236:5:
2234. #endif
2235.
2236. > i = ssl_get_server_cert_index(s);
2237.
2238. /* This may or may not be an error. */
ssl/ssl_lib.c:2196:1: start of procedure ssl_get_server_cert_index()
2194. #endif
2195.
2196. > static int ssl_get_server_cert_index(const SSL *s)
2197. {
2198. int idx;
ssl/ssl_lib.c:2199:5:
2197. {
2198. int idx;
2199. > idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2200. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
2201. idx = SSL_PKEY_RSA_SIGN;
ssl/ssl_ciph.c:1949:1: start of procedure ssl_cipher_get_cert_index()
1947.
1948. /* For a cipher return the index corresponding to the certificate type */
1949. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c)
1950. {
1951. uint32_t alg_k, alg_a;
ssl/ssl_ciph.c:1953:5:
1951. uint32_t alg_k, alg_a;
1952.
1953. > alg_k = c->algorithm_mkey;
1954. alg_a = c->algorithm_auth;
1955.
ssl/ssl_ciph.c:1954:5:
1952.
1953. alg_k = c->algorithm_mkey;
1954. > alg_a = c->algorithm_auth;
1955.
1956. if (alg_k & (SSL_kECDHr | SSL_kECDHe)) {
ssl/ssl_ciph.c:1956:9: Taking false branch
1954. alg_a = c->algorithm_auth;
1955.
1956. if (alg_k & (SSL_kECDHr | SSL_kECDHe)) {
^
1957. /*
1958. * we don't need to look at SSL_kECDHE since no certificate is needed
ssl/ssl_ciph.c:1966:16: Taking false branch
1964. */
1965. return SSL_PKEY_ECC;
1966. } else if (alg_a & SSL_aECDSA)
^
1967. return SSL_PKEY_ECC;
1968. else if (alg_a & SSL_aDSS)
ssl/ssl_ciph.c:1968:14: Taking false branch
1966. } else if (alg_a & SSL_aECDSA)
1967. return SSL_PKEY_ECC;
1968. else if (alg_a & SSL_aDSS)
^
1969. return SSL_PKEY_DSA_SIGN;
1970. else if (alg_a & SSL_aRSA)
ssl/ssl_ciph.c:1970:14: Taking true branch
1968. else if (alg_a & SSL_aDSS)
1969. return SSL_PKEY_DSA_SIGN;
1970. else if (alg_a & SSL_aRSA)
^
1971. return SSL_PKEY_RSA_ENC;
1972. else if (alg_a & SSL_aGOST12)
ssl/ssl_ciph.c:1971:9:
1969. return SSL_PKEY_DSA_SIGN;
1970. else if (alg_a & SSL_aRSA)
1971. > return SSL_PKEY_RSA_ENC;
1972. else if (alg_a & SSL_aGOST12)
1973. return SSL_PKEY_GOST_EC;
ssl/ssl_ciph.c:1978:1: return from a call to ssl_cipher_get_cert_index
1976.
1977. return -1;
1978. > }
1979.
1980. const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr)
ssl/ssl_lib.c:2200:9: Taking true branch
2198. int idx;
2199. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2200. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
^
2201. idx = SSL_PKEY_RSA_SIGN;
2202. if (idx == SSL_PKEY_GOST_EC) {
ssl/ssl_lib.c:2200:37: Taking false branch
2198. int idx;
2199. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2200. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
^
2201. idx = SSL_PKEY_RSA_SIGN;
2202. if (idx == SSL_PKEY_GOST_EC) {
ssl/ssl_lib.c:2202:9: Taking false branch
2200. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
2201. idx = SSL_PKEY_RSA_SIGN;
2202. if (idx == SSL_PKEY_GOST_EC) {
^
2203. if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509)
2204. idx = SSL_PKEY_GOST12_512;
ssl/ssl_lib.c:2212:9: Taking false branch
2210. idx = -1;
2211. }
2212. if (idx == -1)
^
2213. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2214. return idx;
ssl/ssl_lib.c:2214:5:
2212. if (idx == -1)
2213. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2214. > return idx;
2215. }
2216.
ssl/ssl_lib.c:2215:1: return from a call to ssl_get_server_cert_index
2213. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2214. return idx;
2215. > }
2216.
2217. CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
ssl/ssl_lib.c:2239:9: Taking true branch
2237.
2238. /* This may or may not be an error. */
2239. if (i < 0)
^
2240. return NULL;
2241.
ssl/ssl_lib.c:2240:9:
2238. /* This may or may not be an error. */
2239. if (i < 0)
2240. > return NULL;
2241.
2242. /* May be NULL. */
ssl/ssl_lib.c:2244:1: return from a call to ssl_get_server_send_pkey
2242. /* May be NULL. */
2243. return &c->pkeys[i];
2244. > }
2245.
2246. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher,
ssl/t1_lib.c:4225:9:
4223. } else {
4224. CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4225. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4226. }
4227.
|
https://github.com/openssl/openssl/blob/57ce7b617c602ae8513c22daa2bda31f179edb0f/ssl/t1_lib.c/#L4225
|
d2a_code_trace_data_43692
|
static unsigned constant_time_ge(unsigned a, unsigned b)
{
a -= b;
return DUPLICATE_MSB_TO_ALL(~a);
}
ssl/d1_pkt.c:314: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, 17728]):unsigned32 by call to `dtls1_process_record`.
Showing all 11 steps of the trace
ssl/d1_pkt.c:298:1: Parameter `s->s3->rrec.length`
296. &((s)->d1->processed_rcds))
297.
298. > static int
299. dtls1_process_buffered_records(SSL *s)
300. {
ssl/d1_pkt.c:314:20: Call
312. {
313. dtls1_get_unprocessed_record(s);
314. if ( ! dtls1_process_record(s))
^
315. return(0);
316. dtls1_buffer_record(s, &(s->d1->processed_rcds),
ssl/d1_pkt.c:375:1: Parameter `s->s3->rrec.length`
373. #endif
374.
375. > static int
376. dtls1_process_record(SSL *s)
377. {
ssl/d1_pkt.c:470:4: Call
468. * */
469. mac = mac_tmp;
470. ssl3_cbc_copy_mac(mac_tmp, rr, mac_size, orig_len);
^
471. rr->length -= mac_size;
472. }
ssl/s3_cbc.c:254:1: Parameter `orig_len`
252. #define CBC_MAC_ROTATE_IN_PLACE
253.
254. > void ssl3_cbc_copy_mac(unsigned char* out,
255. const SSL3_RECORD *rec,
256. unsigned md_size,unsigned orig_len)
ssl/s3_cbc.c:300:29: Call
298. {
299. unsigned char mac_started = constant_time_ge(i, mac_start);
300. unsigned char mac_ended = constant_time_ge(i, mac_end);
^
301. unsigned char b = rec->data[i];
302. rotated_mac[j++] |= b & mac_started & ~mac_ended;
ssl/s3_cbc.c:87:1: <LHS trace>
85.
86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */
87. > static unsigned constant_time_ge(unsigned a, unsigned b)
88. {
89. a -= b;
ssl/s3_cbc.c:87:1: Parameter `a`
85.
86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */
87. > static unsigned constant_time_ge(unsigned a, unsigned b)
88. {
89. a -= b;
ssl/s3_cbc.c:87:1: <RHS trace>
85.
86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */
87. > static unsigned constant_time_ge(unsigned a, unsigned b)
88. {
89. a -= b;
ssl/s3_cbc.c:87:1: Parameter `b`
85.
86. /* constant_time_ge returns 0xff if a>=b and 0x00 otherwise. */
87. > static unsigned constant_time_ge(unsigned a, unsigned b)
88. {
89. a -= b;
ssl/s3_cbc.c:89:2: Binary operation: ([0, +oo] - [0, 17728]):unsigned32 by call to `dtls1_process_record`
87. static unsigned constant_time_ge(unsigned a, unsigned b)
88. {
89. a -= b;
^
90. return DUPLICATE_MSB_TO_ALL(~a);
91. }
|
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/ssl/s3_cbc.c/#L89
|
d2a_code_trace_data_43693
|
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
{
unsigned long hash;
OPENSSL_LH_NODE *nn, **rn;
void *ret;
lh->error = 0;
rn = getrn(lh, data, &hash);
if (*rn == NULL) {
lh->num_no_delete++;
return (NULL);
} else {
nn = *rn;
*rn = nn->next;
ret = nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
contract(lh);
return (ret);
}
apps/s_time.c:421: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_free`.
Showing all 16 steps of the trace
apps/s_time.c:384:21: Call
382.
383. if (scon == NULL)
384. serverCon = SSL_new(ctx);
^
385. else {
386. serverCon = scon;
ssl/ssl_lib.c:522:1: Parameter `ctx->sessions->num_items`
520. }
521.
522. > SSL *SSL_new(SSL_CTX *ctx)
523. {
524. SSL *s;
apps/s_time.c:421:13: Call
419. ERR_print_errors(bio_err);
420. if (scon == NULL)
421. SSL_free(serverCon);
^
422. return NULL;
423. }
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_43694
|
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
{
int i, j, max;
const BN_ULONG *ap;
BN_ULONG *rp;
max = n * 2;
ap = a;
rp = r;
rp[0] = rp[max - 1] = 0;
rp++;
j = n;
if (--j > 0) {
ap++;
rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
rp += 2;
}
for (i = n - 2; i > 0; i--) {
j--;
ap++;
rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
rp += 2;
}
bn_add_words(r, r, r, max);
bn_sqr_words(tmp, a, n);
bn_add_words(r, r, tmp, max);
}
crypto/bn/bn_prime.c:286: error: BUFFER_OVERRUN_L3
Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `witness`.
Showing all 25 steps of the trace
crypto/bn/bn_prime.c:243:13: Call
241. if ((t = BN_CTX_get(ctx)) == NULL)
242. goto err;
243. if (BN_copy(t, a) == NULL)
^
244. goto err;
245. t->neg = 0;
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/bn/bn_prime.c:286:13: Call
284. /* now 1 <= check < A */
285.
286. j = witness(check, A, A1, A1_odd, k, ctx, mont);
^
287. if (j == -1)
288. goto err;
crypto/bn/bn_prime.c:385:1: Parameter `w->top`
383. }
384.
385. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,
386. const BIGNUM *a1_odd, int k, BN_CTX *ctx,
387. BN_MONT_CTX *mont)
crypto/bn/bn_prime.c:389:10: Call
387. BN_MONT_CTX *mont)
388. {
389. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
^
390. return -1;
391. if (BN_is_one(w))
crypto/bn/bn_exp.c:301:1: Parameter `a->top`
299. }
300.
301. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
302. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
303. {
crypto/bn/bn_exp.c:313:16: Call
311.
312. if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) {
313. return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
^
314. }
315.
crypto/bn/bn_exp.c:601:1: Parameter `a->top`
599. * http://www.daemonology.net/hyperthreading-considered-harmful/)
600. */
601. > int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
602. const BIGNUM *m, BN_CTX *ctx,
603. BN_MONT_CTX *in_mont)
crypto/bn/bn_exp.c:758:17: Call
756. if (!BN_to_montgomery(&am, &am, mont, ctx))
757. goto err;
758. } else if (!BN_to_montgomery(&am, a, mont, ctx))
^
759. goto err;
760.
crypto/bn/bn_lib.c:945:1: Parameter `a->top`
943. }
944.
945. > int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
946. BN_CTX *ctx)
947. {
crypto/bn/bn_lib.c:948:12: Call
946. BN_CTX *ctx)
947. {
948. return BN_mod_mul_montgomery(r, a, &(mont->RR), mont, ctx);
^
949. }
950.
crypto/bn/bn_mont.c:26:1: Parameter `a->top`
24. #endif
25.
26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
27. BN_MONT_CTX *mont, BN_CTX *ctx)
28. {
crypto/bn/bn_mont.c:53:14: Call
51. bn_check_top(tmp);
52. if (a == b) {
53. if (!BN_sqr(tmp, a, ctx))
^
54. goto err;
55. } else {
crypto/bn/bn_sqr.c:17:1: Parameter `a->top`
15. * I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96
16. */
17. > int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
18. {
19. int max, al;
crypto/bn/bn_sqr.c:25:5: Assignment
23. bn_check_top(a);
24.
25. al = a->top;
^
26. if (al <= 0) {
27. r->top = 0;
crypto/bn/bn_sqr.c:74:17: Call
72. if (bn_wexpand(tmp, max) == NULL)
73. goto err;
74. bn_sqr_normal(rr->d, a->d, al, tmp->d);
^
75. }
76. }
crypto/bn/bn_sqr.c:105:1: <Offset trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `n`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:116:5: Assignment
114. rp[0] = rp[max - 1] = 0;
115. rp++;
116. j = n;
^
117.
118. if (--j > 0) {
crypto/bn/bn_sqr.c:118:9: Assignment
116. j = n;
117.
118. if (--j > 0) {
^
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
crypto/bn/bn_sqr.c:105:1: <Length trace>
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:105:1: Parameter `*r`
103.
104. /* tmp must have 2*n words */
105. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
106. {
107. int i, j, max;
crypto/bn/bn_sqr.c:113:5: Assignment
111. max = n * 2;
112. ap = a;
113. rp = r;
^
114. rp[0] = rp[max - 1] = 0;
115. rp++;
crypto/bn/bn_sqr.c:115:5: Assignment
113. rp = r;
114. rp[0] = rp[max - 1] = 0;
115. rp++;
^
116. j = n;
117.
crypto/bn/bn_sqr.c:120:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `witness`
118. if (--j > 0) {
119. ap++;
120. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
^
121. rp += 2;
122. }
|
https://github.com/openssl/openssl/blob/d7c42d71ba407a4b3c26ed58263ae225976bbac3/crypto/bn/bn_sqr.c/#L120
|
d2a_code_trace_data_43695
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/dh/dh_key.c:225: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked`.
Showing all 28 steps of the trace
crypto/dh/dh_key.c:216:5: Call
214. if (ctx == NULL)
215. goto err;
216. BN_CTX_start(ctx);
^
217. tmp = BN_CTX_get(ctx);
218.
crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
234. }
235.
236. > void BN_CTX_start(BN_CTX *ctx)
237. {
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/dh/dh_key.c:225:16: Call
223.
224. if (dh->flags & DH_FLAG_CACHE_MONT_P) {
225. mont = BN_MONT_CTX_set_locked(&dh->method_mont_p,
^
226. CRYPTO_LOCK_DH, dh->p, ctx);
227. if ((dh->flags & DH_FLAG_NO_EXP_CONSTTIME) == 0) {
crypto/bn/bn_mont.c:500:1: Parameter `ctx->stack.depth`
498. }
499.
500. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
501. const BIGNUM *mod, BN_CTX *ctx)
502. {
crypto/bn/bn_mont.c:522:10: Call
520. if (ret == NULL)
521. return NULL;
522. if (!BN_MONT_CTX_set(ret, mod, ctx)) {
^
523. BN_MONT_CTX_free(ret);
524. return NULL;
crypto/bn/bn_mont.c:349:1: Parameter `ctx->stack.depth`
347. }
348.
349. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
350. {
351. int ret = 0;
crypto/bn/bn_mont.c:357:5: Call
355. return 0;
356.
357. BN_CTX_start(ctx);
^
358. if ((Ri = BN_CTX_get(ctx)) == NULL)
359. goto err;
crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
234. }
235.
236. > void BN_CTX_start(BN_CTX *ctx)
237. {
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_mont.c:428:14: Call
426. tmod.top = buf[0] != 0 ? 1 : 0;
427. /* Ri = R^-1 mod N */
428. if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
^
429. goto err;
430. if (!BN_lshift(Ri, Ri, BN_BITS2))
crypto/bn/bn_gcd.c:226:1: Parameter `ctx->stack.depth`
224. BN_CTX *ctx);
225.
226. > BIGNUM *BN_mod_inverse(BIGNUM *in,
227. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
228. {
crypto/bn/bn_gcd.c:231:10: Call
229. BIGNUM *rv;
230. int noinv;
231. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
^
232. if (noinv)
233. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);
crypto/bn/bn_gcd.c:237:1: Parameter `ctx->stack.depth`
235. }
236.
237. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
238. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
239. int *pnoinv)
crypto/bn/bn_gcd.c:250:16: Call
248. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
249. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
250. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
251. }
252.
crypto/bn/bn_gcd.c:557:1: Parameter `ctx->stack.depth`
555. * not contain branches that may leak sensitive information.
556. */
557. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
558. const BIGNUM *a, const BIGNUM *n,
559. BN_CTX *ctx)
crypto/bn/bn_gcd.c:568:5: Call
566. bn_check_top(n);
567.
568. BN_CTX_start(ctx);
^
569. A = BN_CTX_get(ctx);
570. B = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
234. }
235.
236. > void BN_CTX_start(BN_CTX *ctx)
237. {
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gcd.c:603:18: Call
601. BN_init(&local_B);
602. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME);
603. if (!BN_nnmod(B, &local_B, A, ctx))
^
604. goto err;
605. /* Ensure local_B goes out of scope before any further use of B */
crypto/bn/bn_mod.c:119:1: Parameter `ctx->stack.depth`
117. #include "bn_lcl.h"
118.
119. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
120. {
121. /*
crypto/bn/bn_mod.c:126:11: Call
124. */
125.
126. if (!(BN_mod(r, m, d, ctx)))
^
127. return 0;
128. if (!r->neg)
crypto/bn/bn_div.c:189:1: Parameter `ctx->stack.depth`
187. * If 'dv' or 'rm' is NULL, the respective value is not returned.
188. */
189. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
190. BN_CTX *ctx)
191. {
crypto/bn/bn_div.c:242:5: Call
240. }
241.
242. BN_CTX_start(ctx);
^
243. tmp = BN_CTX_get(ctx);
244. snum = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:236:1: Parameter `ctx->stack.depth`
234. }
235.
236. > void BN_CTX_start(BN_CTX *ctx)
237. {
238. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_div.c:469:5: Call
467. if (no_branch)
468. bn_correct_top(res);
469. BN_CTX_end(ctx);
^
470. return (1);
471. err:
crypto/bn/bn_ctx.c:250:1: Parameter `ctx->stack.depth`
248. }
249.
250. > void BN_CTX_end(BN_CTX *ctx)
251. {
252. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:256:27: Call
254. ctx->err_stack--;
255. else {
256. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
257. /* Does this stack frame have anything to release? */
258. if (fp < ctx->used)
crypto/bn/bn_ctx.c:326:1: <LHS trace>
324. }
325.
326. > static unsigned int BN_STACK_pop(BN_STACK *st)
327. {
328. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:326:1: Parameter `st->depth`
324. }
325.
326. > static unsigned int BN_STACK_pop(BN_STACK *st)
327. {
328. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:328:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked`
326. static unsigned int BN_STACK_pop(BN_STACK *st)
327. {
328. return st->indexes[--(st->depth)];
^
329. }
330.
|
https://github.com/openssl/openssl/blob/e113c9c59dcb419dd00525cec431edb854a6c897/crypto/bn/bn_ctx.c/#L328
|
d2a_code_trace_data_43696
|
static int opt_input_ts_scale(const char *opt, const char *arg)
{
unsigned int stream;
double scale;
char *p;
stream = strtol(arg, &p, 0);
if (*p)
p++;
scale= strtod(p, &p);
ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
ts_scale[stream] = scale;
return 0;
}
avconv.c:2773: error: Null Dereference
pointer `ts_scale` last assigned on line 2772 could be null and is dereferenced at line 2773, column 5.
avconv.c:2761:1: start of procedure opt_input_ts_scale()
2759. }
2760.
2761. static int opt_input_ts_scale(const char *opt, const char *arg)
^
2762. {
2763. unsigned int stream;
avconv.c:2767:5:
2765. char *p;
2766.
2767. stream = strtol(arg, &p, 0);
^
2768. if (*p)
2769. p++;
avconv.c:2768:9: Taking false branch
2766.
2767. stream = strtol(arg, &p, 0);
2768. if (*p)
^
2769. p++;
2770. scale= strtod(p, &p);
avconv.c:2770:5:
2768. if (*p)
2769. p++;
2770. scale= strtod(p, &p);
^
2771.
2772. ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
avconv.c:2772:5:
2770. scale= strtod(p, &p);
2771.
2772. ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
^
2773. ts_scale[stream] = scale;
2774. return 0;
avconv.c:515:1: start of procedure grow_array()
513.
514. /* similar to ff_dynarray_add() and av_fast_realloc() */
515. static void *grow_array(void *array, int elem_size, int *size, int new_size)
^
516. {
517. if (new_size >= INT_MAX / elem_size) {
avconv.c:517:9: Taking true branch
515. static void *grow_array(void *array, int elem_size, int *size, int new_size)
516. {
517. if (new_size >= INT_MAX / elem_size) {
^
518. fprintf(stderr, "Array too big.\n");
519. exit_program(1);
avconv.c:518:9:
516. {
517. if (new_size >= INT_MAX / elem_size) {
518. fprintf(stderr, "Array too big.\n");
^
519. exit_program(1);
520. }
avconv.c:519:9: Skipping exit_program(): empty list of specs
517. if (new_size >= INT_MAX / elem_size) {
518. fprintf(stderr, "Array too big.\n");
519. exit_program(1);
^
520. }
521. if (*size < new_size) {
avconv.c:521:9: Taking true branch
519. exit_program(1);
520. }
521. if (*size < new_size) {
^
522. uint8_t *tmp = av_realloc(array, new_size*elem_size);
523. if (!tmp) {
avconv.c:522:9:
520. }
521. if (*size < new_size) {
522. uint8_t *tmp = av_realloc(array, new_size*elem_size);
^
523. if (!tmp) {
524. fprintf(stderr, "Could not alloc buffer.\n");
libavutil/mem.c:117:1: start of procedure av_realloc()
115. }
116.
117. void *av_realloc(void *ptr, size_t size)
^
118. {
119. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:124:8: Taking false branch
122.
123. /* let's disallow possible ambiguous cases */
124. if(size > (INT_MAX-16) )
^
125. return NULL;
126.
libavutil/mem.c:133:5:
131. return (char*)realloc((char*)ptr - diff, size + diff) + diff;
132. #else
133. return realloc(ptr, size);
^
134. #endif
135. }
libavutil/mem.c:135:1: return from a call to av_realloc
133. return realloc(ptr, size);
134. #endif
135. }
^
136.
137. void av_free(void *ptr)
avconv.c:523:14: Taking true branch
521. if (*size < new_size) {
522. uint8_t *tmp = av_realloc(array, new_size*elem_size);
523. if (!tmp) {
^
524. fprintf(stderr, "Could not alloc buffer.\n");
525. exit_program(1);
avconv.c:524:13:
522. uint8_t *tmp = av_realloc(array, new_size*elem_size);
523. if (!tmp) {
524. fprintf(stderr, "Could not alloc buffer.\n");
^
525. exit_program(1);
526. }
avconv.c:525:13: Skipping exit_program(): empty list of specs
523. if (!tmp) {
524. fprintf(stderr, "Could not alloc buffer.\n");
525. exit_program(1);
^
526. }
527. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
avconv.c:527:9:
525. exit_program(1);
526. }
527. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
^
528. *size = new_size;
529. return tmp;
avconv.c:528:9:
526. }
527. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
528. *size = new_size;
^
529. return tmp;
530. }
avconv.c:529:9:
527. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
528. *size = new_size;
529. return tmp;
^
530. }
531. return array;
avconv.c:532:1: return from a call to grow_array
530. }
531. return array;
532. }
^
533.
534. static void choose_sample_fmt(AVStream *st, AVCodec *codec)
avconv.c:2773:5:
2771.
2772. ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
2773. ts_scale[stream] = scale;
^
2774. return 0;
2775. }
|
https://github.com/libav/libav/blob/eb97dbb05a990266b04830ea8e179e0428656b98/avconv.c/#L2773
|
d2a_code_trace_data_43697
|
static void opt_input_ts_scale(const char *arg)
{
unsigned int stream;
double scale;
char *p;
stream = strtol(arg, &p, 0);
if (*p)
p++;
scale= strtod(p, &p);
if(stream >= MAX_STREAMS)
ffmpeg_exit(1);
input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
input_files_ts_scale[nb_input_files][stream]= scale;
}
ffmpeg.c:3064: error: Null Dereference
pointer `input_files_ts_scale[nb_input_files]` last assigned on line 3063 could be null and is dereferenced at line 3064, column 5.
ffmpeg.c:3049:1: start of procedure opt_input_ts_scale()
3047. }
3048.
3049. static void opt_input_ts_scale(const char *arg)
^
3050. {
3051. unsigned int stream;
ffmpeg.c:3055:5:
3053. char *p;
3054.
3055. stream = strtol(arg, &p, 0);
^
3056. if (*p)
3057. p++;
ffmpeg.c:3056:9: Taking true branch
3054.
3055. stream = strtol(arg, &p, 0);
3056. if (*p)
^
3057. p++;
3058. scale= strtod(p, &p);
ffmpeg.c:3057:9:
3055. stream = strtol(arg, &p, 0);
3056. if (*p)
3057. p++;
^
3058. scale= strtod(p, &p);
3059.
ffmpeg.c:3058:5:
3056. if (*p)
3057. p++;
3058. scale= strtod(p, &p);
^
3059.
3060. if(stream >= MAX_STREAMS)
ffmpeg.c:3060:8: Taking true branch
3058. scale= strtod(p, &p);
3059.
3060. if(stream >= MAX_STREAMS)
^
3061. ffmpeg_exit(1);
3062.
ffmpeg.c:3061:9: Skipping ffmpeg_exit(): empty list of specs
3059.
3060. if(stream >= MAX_STREAMS)
3061. ffmpeg_exit(1);
^
3062.
3063. input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
ffmpeg.c:3063:5:
3061. ffmpeg_exit(1);
3062.
3063. input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
^
3064. input_files_ts_scale[nb_input_files][stream]= scale;
3065. }
ffmpeg.c:575:1: start of procedure grow_array()
573.
574. /* similar to ff_dynarray_add() and av_fast_realloc() */
575. static void *grow_array(void *array, int elem_size, int *size, int new_size)
^
576. {
577. if (new_size >= INT_MAX / elem_size) {
ffmpeg.c:577:9: Taking true branch
575. static void *grow_array(void *array, int elem_size, int *size, int new_size)
576. {
577. if (new_size >= INT_MAX / elem_size) {
^
578. fprintf(stderr, "Array too big.\n");
579. ffmpeg_exit(1);
ffmpeg.c:578:9:
576. {
577. if (new_size >= INT_MAX / elem_size) {
578. fprintf(stderr, "Array too big.\n");
^
579. ffmpeg_exit(1);
580. }
ffmpeg.c:579:9: Skipping ffmpeg_exit(): empty list of specs
577. if (new_size >= INT_MAX / elem_size) {
578. fprintf(stderr, "Array too big.\n");
579. ffmpeg_exit(1);
^
580. }
581. if (*size < new_size) {
ffmpeg.c:581:9: Taking true branch
579. ffmpeg_exit(1);
580. }
581. if (*size < new_size) {
^
582. uint8_t *tmp = av_realloc(array, new_size*elem_size);
583. if (!tmp) {
ffmpeg.c:582:9:
580. }
581. if (*size < new_size) {
582. uint8_t *tmp = av_realloc(array, new_size*elem_size);
^
583. if (!tmp) {
584. fprintf(stderr, "Could not alloc buffer.\n");
libavutil/mem.c:119:1: start of procedure av_realloc()
117. }
118.
119. void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
^
120. {
121. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:126:8: Taking false branch
124.
125. /* let's disallow possible ambiguous cases */
126. if(size > (INT_MAX-16) )
^
127. return NULL;
128.
libavutil/mem.c:135:5:
133. return (char*)realloc((char*)ptr - diff, size + diff) + diff;
134. #else
135. return realloc(ptr, size);
^
136. #endif
137. }
libavutil/mem.c:137:1: return from a call to av_realloc
135. return realloc(ptr, size);
136. #endif
137. }
^
138.
139. void av_free(void *ptr)
ffmpeg.c:583:14: Taking true branch
581. if (*size < new_size) {
582. uint8_t *tmp = av_realloc(array, new_size*elem_size);
583. if (!tmp) {
^
584. fprintf(stderr, "Could not alloc buffer.\n");
585. ffmpeg_exit(1);
ffmpeg.c:584:13:
582. uint8_t *tmp = av_realloc(array, new_size*elem_size);
583. if (!tmp) {
584. fprintf(stderr, "Could not alloc buffer.\n");
^
585. ffmpeg_exit(1);
586. }
ffmpeg.c:585:13: Skipping ffmpeg_exit(): empty list of specs
583. if (!tmp) {
584. fprintf(stderr, "Could not alloc buffer.\n");
585. ffmpeg_exit(1);
^
586. }
587. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
ffmpeg.c:587:9:
585. ffmpeg_exit(1);
586. }
587. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
^
588. *size = new_size;
589. return tmp;
ffmpeg.c:588:9:
586. }
587. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
588. *size = new_size;
^
589. return tmp;
590. }
ffmpeg.c:589:9:
587. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
588. *size = new_size;
589. return tmp;
^
590. }
591. return array;
ffmpeg.c:592:1: return from a call to grow_array
590. }
591. return array;
592. }
^
593.
594. static void choose_sample_fmt(AVStream *st, AVCodec *codec)
ffmpeg.c:3064:5:
3062.
3063. input_files_ts_scale[nb_input_files] = grow_array(input_files_ts_scale[nb_input_files], sizeof(*input_files_ts_scale[nb_input_files]), &nb_input_files_ts_scale[nb_input_files], stream + 1);
3064. input_files_ts_scale[nb_input_files][stream]= scale;
^
3065. }
3066.
|
https://github.com/libav/libav/blob/2d777bb7a20041ac0564ffef85bf40619af8ccd1/ffmpeg.c/#L3064
|
d2a_code_trace_data_43698
|
static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
long max)
{
const unsigned char *p = *pp;
unsigned long ret = 0;
int i;
if (max-- < 1)
return 0;
if (*p == 0x80) {
*inf = 1;
p++;
} else {
*inf = 0;
i = *p & 0x7f;
if (*p++ & 0x80) {
if (max < i + 1)
return 0;
while (i > 0 && *p == 0) {
p++;
i--;
}
if (i > (int)sizeof(long))
return 0;
while (i > 0) {
ret <<= 8;
ret |= *p++;
i--;
}
if (ret > LONG_MAX)
return 0;
} else
ret = i;
}
*pp = p;
*rl = (long)ret;
return 1;
}
test/ct_test.c:525: error: BUFFER_OVERRUN_L3
Offset: [2, +oo] Size: [1, 12] by call to `CTLOG_new_from_base64`.
Showing all 33 steps of the trace
test/ct_test.c:520:5: Array declaration
518. {
519. CTLOG *ctlogp = NULL;
520. const char notb64[] = "\01\02\03\04";
^
521. const char pad[] = "====";
522. const char name[] = "name";
test/ct_test.c:525:10: Call
523.
524. /* We expect these to both fail! */
525. if (!TEST_true(!CTLOG_new_from_base64(&ctlogp, notb64, name))
^
526. || !TEST_true(!CTLOG_new_from_base64(&ctlogp, pad, name)))
527. return 0;
crypto/ct/ct_b64.c:135:1: Parameter `pkey_base64->strlen`
133. * -1 on internal (malloc) failure
134. */
135. > int CTLOG_new_from_base64(CTLOG **ct_log, const char *pkey_base64, const char *name)
136. {
137. unsigned char *pkey_der = NULL;
crypto/ct/ct_b64.c:147:20: Call
145. }
146.
147. pkey_der_len = ct_base64_decode(pkey_base64, &pkey_der);
^
148. if (pkey_der_len < 0) {
149. CTerr(CT_F_CTLOG_NEW_FROM_BASE64, CT_R_LOG_CONF_INVALID_KEY);
crypto/ct/ct_b64.c:24:1: Parameter `**out`
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:153:5: Assignment
151. }
152.
153. p = pkey_der;
^
154. pkey = d2i_PUBKEY(NULL, &p, pkey_der_len);
155. OPENSSL_free(pkey_der);
crypto/ct/ct_b64.c:154:12: Call
152.
153. p = pkey_der;
154. pkey = d2i_PUBKEY(NULL, &p, pkey_der_len);
^
155. OPENSSL_free(pkey_der);
156. if (pkey == NULL) {
crypto/x509/x_pubkey.c:182:1: Parameter `**pp`
180. */
181.
182. > EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length)
183. {
184. X509_PUBKEY *xpk;
crypto/x509/x_pubkey.c:187:5: Assignment
185. EVP_PKEY *pktmp;
186. const unsigned char *q;
187. q = *pp;
^
188. xpk = d2i_X509_PUBKEY(NULL, &q, length);
189. if (!xpk)
crypto/x509/x_pubkey.c:188:11: Call
186. const unsigned char *q;
187. q = *pp;
188. xpk = d2i_X509_PUBKEY(NULL, &q, length);
^
189. if (!xpk)
190. return NULL;
crypto/x509/x_pubkey.c:58:1: Parameter `**in`
56. } ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY)
57.
58. > IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY)
59.
60. /* TODO should better be called X509_PUBKEY_set1 */
crypto/x509/x_pubkey.c:58:1: Call
56. } ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY)
57.
58. > IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY)
59.
60. /* TODO should better be called X509_PUBKEY_set1 */
crypto/asn1/tasn_dec.c:105:1: Parameter `**in`
103. */
104.
105. > ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval,
106. const unsigned char **in, long len,
107. const ASN1_ITEM *it)
crypto/asn1/tasn_dec.c:114:9: Call
112. pval = &ptmpval;
113. asn1_tlc_clear_nc(&c);
114. if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0)
^
115. return *pval;
116. return NULL;
crypto/asn1/tasn_dec.c:119:1: Parameter `**in`
117. }
118.
119. > int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
120. const ASN1_ITEM *it,
121. int tag, int aclass, char opt, ASN1_TLC *ctx)
crypto/asn1/tasn_dec.c:124:10: Call
122. {
123. int rv;
124. rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0);
^
125. if (rv <= 0)
126. ASN1_item_ex_free(pval, it);
crypto/asn1/tasn_dec.c:135:1: Parameter `**in`
133. */
134.
135. > static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
136. long len, const ASN1_ITEM *it,
137. int tag, int aclass, char opt, ASN1_TLC *ctx,
crypto/asn1/tasn_dec.c:178:20: Call
176. goto err;
177. }
178. return asn1_template_ex_d2i(pval, in, len,
^
179. it->templates, opt, ctx, depth);
180. }
crypto/asn1/tasn_dec.c:437:1: Parameter `**in`
435. */
436.
437. > static int asn1_template_ex_d2i(ASN1_VALUE **val,
438. const unsigned char **in, long inlen,
439. const ASN1_TEMPLATE *tt, char opt,
crypto/asn1/tasn_dec.c:452:5: Assignment
450. aclass = flags & ASN1_TFLG_TAG_CLASS;
451.
452. p = *in;
^
453.
454. /* Check if EXPLICIT tag expected */
crypto/asn1/tasn_dec.c:461:15: Call
459. * where it starts: so read in EXPLICIT header to get the info.
460. */
461. ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst,
^
462. &p, inlen, tt->tag, aclass, opt, ctx);
463. q = p;
crypto/asn1/tasn_dec.c:1078:1: Parameter `**in`
1076. */
1077.
1078. > static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass,
1079. char *inf, char *cst,
1080. const unsigned char **in, long len,
crypto/asn1/tasn_dec.c:1087:5: Assignment
1085. long plen;
1086. const unsigned char *p, *q;
1087. p = *in;
^
1088. q = p;
1089.
crypto/asn1/tasn_dec.c:1097:13: Call
1095. p += ctx->hdrlen;
1096. } else {
1097. i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
^
1098. if (ctx) {
1099. ctx->ret = i;
crypto/asn1/asn1_lib.c:44:1: Parameter `**pp`
42. }
43.
44. > int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
45. int *pclass, long omax)
46. {
crypto/asn1/asn1_lib.c:49:5: Assignment
47. int i, ret;
48. long l;
49. const unsigned char *p = *pp;
^
50. int tag, xclass, inf;
51. long max = omax;
crypto/asn1/asn1_lib.c:78:9: Assignment
76. } else {
77. tag = i;
78. p++;
^
79. if (--max == 0)
80. goto err;
crypto/asn1/asn1_lib.c:84:10: Call
82. *ptag = tag;
83. *pclass = xclass;
84. if (!asn1_get_length(&p, &inf, plength, max))
^
85. goto err;
86.
crypto/asn1/asn1_lib.c:112:1: <Length trace>
110. * are stored most significant digit first.
111. */
112. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
113. long max)
114. {
crypto/asn1/asn1_lib.c:112:1: Parameter `**pp`
110. * are stored most significant digit first.
111. */
112. > static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
113. long max)
114. {
crypto/asn1/asn1_lib.c:115:5: Assignment
113. long max)
114. {
115. const unsigned char *p = *pp;
^
116. unsigned long ret = 0;
117. int i;
crypto/asn1/asn1_lib.c:127:14: Assignment
125. *inf = 0;
126. i = *p & 0x7f;
127. if (*p++ & 0x80) {
^
128. if (max < i + 1)
129. return 0;
crypto/asn1/asn1_lib.c:131:29: Array access: Offset: [2, +oo] Size: [1, 12] by call to `CTLOG_new_from_base64`
129. return 0;
130. /* Skip leading zeroes */
131. while (i > 0 && *p == 0) {
^
132. p++;
133. i--;
|
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/asn1/asn1_lib.c/#L131
|
d2a_code_trace_data_43699
|
int BN_hex2bn(BIGNUM **bn, const char *a)
{
BIGNUM *ret = NULL;
BN_ULONG l = 0;
int neg = 0, h, m, i, j, k, c;
int num;
if ((a == NULL) || (*a == '\0'))
return (0);
if (*a == '-') {
neg = 1;
a++;
}
for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++)
continue;
if (i == 0 || i > INT_MAX/4)
goto err;
num = i + neg;
if (bn == NULL)
return (num);
if (*bn == NULL) {
if ((ret = BN_new()) == NULL)
return (0);
} else {
ret = *bn;
BN_zero(ret);
}
if (bn_expand(ret, i * 4) == NULL)
goto err;
j = i;
m = 0;
h = 0;
while (j > 0) {
m = ((BN_BYTES * 2) <= j) ? (BN_BYTES * 2) : j;
l = 0;
for (;;) {
c = a[j - m];
k = OPENSSL_hexchar2int(c);
if (k < 0)
k = 0;
l = (l << 4) | k;
if (--m <= 0) {
ret->d[h++] = l;
break;
}
}
j -= (BN_BYTES * 2);
}
ret->top = h;
bn_correct_top(ret);
*bn = ret;
bn_check_top(ret);
if (ret->top != 0)
ret->neg = neg;
return (num);
err:
if (*bn == NULL)
BN_free(ret);
return (0);
}
test/bntest.c:720: error: BUFFER_OVERRUN_L2
Offset: [-15, 536870911] (⇐ [0, 1] + [-15, 536870910]) Size: 65 by call to `BN_hex2bn`.
Showing all 7 steps of the trace
test/bntest.c:720:5: Call
718.
719. /* Regression test for a BN_sqr overflow bug. */
720. BN_hex2bn(&a,
^
721. "80000000000000008000000000000001"
722. "FFFFFFFFFFFFFFFE0000000000000000");
crypto/bn/bn_print.c:141:10: <Offset trace>
139. }
140.
141. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++)
^
142. continue;
143.
crypto/bn/bn_print.c:141:10: Assignment
139. }
140.
141. for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++)
^
142. continue;
143.
crypto/bn/bn_print.c:164:5: Assignment
162. goto err;
163.
164. j = i; /* least significant 'hex' */
^
165. m = 0;
166. h = 0;
crypto/bn/bn_print.c:126:1: <Length trace>
124. }
125.
126. > int BN_hex2bn(BIGNUM **bn, const char *a)
127. {
128. BIGNUM *ret = NULL;
crypto/bn/bn_print.c:126:1: Parameter `*a`
124. }
125.
126. > int BN_hex2bn(BIGNUM **bn, const char *a)
127. {
128. BIGNUM *ret = NULL;
crypto/bn/bn_print.c:171:17: Array access: Offset: [-15, 536870911] (⇐ [0, 1] + [-15, 536870910]) Size: 65 by call to `BN_hex2bn`
169. l = 0;
170. for (;;) {
171. c = a[j - m];
^
172. k = OPENSSL_hexchar2int(c);
173. if (k < 0)
|
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_print.c/#L171
|
d2a_code_trace_data_43700
|
static int decode_audio_specific_config(AACContext *ac,
AVCodecContext *avctx,
MPEG4AudioConfig *m4ac,
const uint8_t *data, int data_size)
{
GetBitContext gb;
int i;
av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);
for (i = 0; i < avctx->extradata_size; i++)
av_dlog(avctx, "%02x ", avctx->extradata[i]);
av_dlog(avctx, "\n");
init_get_bits(&gb, data, data_size * 8);
if ((i = avpriv_mpeg4audio_get_config(m4ac, data, data_size)) < 0)
return -1;
if (m4ac->sampling_index > 12) {
av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index);
return -1;
}
if (m4ac->sbr == 1 && m4ac->ps == -1)
m4ac->ps = 1;
skip_bits_long(&gb, i);
switch (m4ac->object_type) {
case AOT_AAC_MAIN:
case AOT_AAC_LC:
case AOT_AAC_LTP:
if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config))
return -1;
break;
default:
av_log(avctx, AV_LOG_ERROR, "Audio object type %s%d is not supported.\n",
m4ac->sbr == 1? "SBR+" : "", m4ac->object_type);
return -1;
}
av_dlog(avctx, "AOT %d chan config %d sampling index %d (%d) SBR %d PS %d\n",
m4ac->object_type, m4ac->chan_config, m4ac->sampling_index,
m4ac->sample_rate, m4ac->sbr, m4ac->ps);
return get_bits_count(&gb);
}
libavcodec/aacdec.c:490: error: Null Dereference
pointer `&gb->buffer` last assigned on line 473 could be null and is dereferenced by call to `decode_ga_specific_config()` at line 490, column 13.
libavcodec/aacdec.c:460:1: start of procedure decode_audio_specific_config()
458. * @return Returns error status or number of consumed bits. <0 - error
459. */
460. static int decode_audio_specific_config(AACContext *ac,
^
461. AVCodecContext *avctx,
462. MPEG4AudioConfig *m4ac,
libavcodec/aacdec.c:469:10:
467.
468. av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);
469. for (i = 0; i < avctx->extradata_size; i++)
^
470. av_dlog(avctx, "%02x ", avctx->extradata[i]);
471. av_dlog(avctx, "\n");
libavcodec/aacdec.c:469:17: Loop condition is false. Leaving loop
467.
468. av_dlog(avctx, "extradata size %d\n", avctx->extradata_size);
469. for (i = 0; i < avctx->extradata_size; i++)
^
470. av_dlog(avctx, "%02x ", avctx->extradata[i]);
471. av_dlog(avctx, "\n");
libavcodec/aacdec.c:473:5:
471. av_dlog(avctx, "\n");
472.
473. init_get_bits(&gb, data, data_size * 8);
^
474.
475. if ((i = avpriv_mpeg4audio_get_config(m4ac, data, data_size)) < 0)
libavcodec/get_bits.h:383:1: start of procedure init_get_bits()
381. * responsible for checking for the buffer end yourself (take advantage of the padding)!
382. */
383. static inline void init_get_bits(GetBitContext *s,
^
384. const uint8_t *buffer, int bit_size)
385. {
libavcodec/get_bits.h:386:5:
384. const uint8_t *buffer, int bit_size)
385. {
386. int buffer_size = (bit_size+7)>>3;
^
387. if (buffer_size < 0 || bit_size < 0) {
388. buffer_size = bit_size = 0;
libavcodec/get_bits.h:387:9: Taking true branch
385. {
386. int buffer_size = (bit_size+7)>>3;
387. if (buffer_size < 0 || bit_size < 0) {
^
388. buffer_size = bit_size = 0;
389. buffer = NULL;
libavcodec/get_bits.h:388:9:
386. int buffer_size = (bit_size+7)>>3;
387. if (buffer_size < 0 || bit_size < 0) {
388. buffer_size = bit_size = 0;
^
389. buffer = NULL;
390. }
libavcodec/get_bits.h:389:9:
387. if (buffer_size < 0 || bit_size < 0) {
388. buffer_size = bit_size = 0;
389. buffer = NULL;
^
390. }
391.
libavcodec/get_bits.h:392:5:
390. }
391.
392. s->buffer = buffer;
^
393. s->size_in_bits = bit_size;
394. s->buffer_end = buffer + buffer_size;
libavcodec/get_bits.h:393:5:
391.
392. s->buffer = buffer;
393. s->size_in_bits = bit_size;
^
394. s->buffer_end = buffer + buffer_size;
395. #ifdef ALT_BITSTREAM_READER
libavcodec/get_bits.h:394:5:
392. s->buffer = buffer;
393. s->size_in_bits = bit_size;
394. s->buffer_end = buffer + buffer_size;
^
395. #ifdef ALT_BITSTREAM_READER
396. s->index = 0;
libavcodec/get_bits.h:396:5:
394. s->buffer_end = buffer + buffer_size;
395. #ifdef ALT_BITSTREAM_READER
396. s->index = 0;
^
397. #elif defined A32_BITSTREAM_READER
398. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3);
libavcodec/get_bits.h:402:1: return from a call to init_get_bits
400. skip_bits_long(s, 0);
401. #endif
402. }
^
403.
404. static inline void align_get_bits(GetBitContext *s)
libavcodec/aacdec.c:475:9: Taking false branch
473. init_get_bits(&gb, data, data_size * 8);
474.
475. if ((i = avpriv_mpeg4audio_get_config(m4ac, data, data_size)) < 0)
^
476. return -1;
477. if (m4ac->sampling_index > 12) {
libavcodec/aacdec.c:477:9: Taking false branch
475. if ((i = avpriv_mpeg4audio_get_config(m4ac, data, data_size)) < 0)
476. return -1;
477. if (m4ac->sampling_index > 12) {
^
478. av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index);
479. return -1;
libavcodec/aacdec.c:481:9: Taking true branch
479. return -1;
480. }
481. if (m4ac->sbr == 1 && m4ac->ps == -1)
^
482. m4ac->ps = 1;
483.
libavcodec/aacdec.c:481:27: Taking false branch
479. return -1;
480. }
481. if (m4ac->sbr == 1 && m4ac->ps == -1)
^
482. m4ac->ps = 1;
483.
libavcodec/aacdec.c:484:5:
482. m4ac->ps = 1;
483.
484. skip_bits_long(&gb, i);
^
485.
486. switch (m4ac->object_type) {
libavcodec/get_bits.h:173:1: start of procedure skip_bits_long()
171. }
172.
173. static inline void skip_bits_long(GetBitContext *s, int n){
^
174. s->index += n;
175. }
libavcodec/get_bits.h:174:5:
172.
173. static inline void skip_bits_long(GetBitContext *s, int n){
174. s->index += n;
^
175. }
176.
libavcodec/get_bits.h:175:1: return from a call to skip_bits_long
173. static inline void skip_bits_long(GetBitContext *s, int n){
174. s->index += n;
175. }
^
176.
177. #elif defined A32_BITSTREAM_READER
libavcodec/aacdec.c:486:5:
484. skip_bits_long(&gb, i);
485.
486. switch (m4ac->object_type) {
^
487. case AOT_AAC_MAIN:
488. case AOT_AAC_LC:
libavcodec/aacdec.c:487:5: Switch condition is true. Entering switch case
485.
486. switch (m4ac->object_type) {
487. case AOT_AAC_MAIN:
^
488. case AOT_AAC_LC:
489. case AOT_AAC_LTP:
libavcodec/aacdec.c:490:13:
488. case AOT_AAC_LC:
489. case AOT_AAC_LTP:
490. if (decode_ga_specific_config(ac, avctx, &gb, m4ac, m4ac->chan_config))
^
491. return -1;
492. break;
|
https://github.com/libav/libav/blob/8664682d0e6b6071ca7b3f6b9e350305d3fbcf76/libavcodec/aacdec.c/#L490
|
d2a_code_trace_data_43701
|
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;
}
apps/s_client.c:287: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_exp`.
Showing all 30 steps of the trace
apps/s_client.c:274:1: Parameter `N->top`
272. # define SRP_NUMBER_ITERATIONS_FOR_PRIME 64
273.
274. > static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g)
275. {
276. BN_CTX *bn_ctx = BN_CTX_new();
apps/s_client.c:280:53: Call
278. BIGNUM *r = BN_new();
279. int ret =
280. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&
^
281. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 &&
282. p != NULL && BN_rshift1(p, N) &&
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);
apps/s_client.c:281:9: Call
279. int ret =
280. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&
281. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 &&
^
282. p != NULL && BN_rshift1(p, N) &&
283. /* p = (N-1)/2 */
crypto/bn/bn_prime.c:145:1: Parameter `a->top`
143. }
144.
145. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
146. BN_GENCB *cb)
147. {
crypto/bn/bn_prime.c:148:12: Call
146. BN_GENCB *cb)
147. {
148. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
^
149. }
150.
crypto/bn/bn_prime.c:151:1: Parameter `a->top`
149. }
150.
151. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
152. int do_trial_division, BN_GENCB *cb)
153. {
crypto/bn/bn_prime.c:161:9: Call
159.
160. /* Take care of the really small primes 2 & 3 */
161. if (BN_is_word(a, 2) || BN_is_word(a, 3))
^
162. return 1;
163.
crypto/bn/bn_lib.c:855:1: Parameter `a->top`
853. }
854.
855. > int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
crypto/bn/bn_lib.c:857:12: Call
855. int BN_is_word(const BIGNUM *a, const BN_ULONG w)
856. {
857. return BN_abs_is_word(a, w) && (!w || !a->neg);
^
858. }
859.
crypto/bn/bn_lib.c:840:1: Parameter `a->top`
838. }
839.
840. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
841. {
842. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
apps/s_client.c:282:22: Call
280. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&
281. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 &&
282. p != NULL && BN_rshift1(p, N) &&
^
283. /* p = (N-1)/2 */
284. BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 &&
crypto/bn/bn_shift.c:54:9: Call
52. bn_check_top(a);
53.
54. if (BN_is_zero(a)) {
^
55. BN_zero(r);
56. return 1;
crypto/bn/bn_lib.c:845:1: Parameter `a->top`
843. }
844.
845. > int BN_is_zero(const BIGNUM *a)
846. {
847. return a->top == 0;
apps/s_client.c:287:9: Call
285. r != NULL &&
286. /* verify g^((N-1)/2) == -1 (mod N) */
287. BN_mod_exp(r, g, p, N, bn_ctx) &&
^
288. BN_add_word(r, 1) && BN_cmp(r, N) == 0;
289.
crypto/bn/bn_exp.c:89:1: Parameter `m->top`
87. }
88.
89. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
90. BN_CTX *ctx)
91. {
crypto/bn/bn_exp.c:134:9: Call
132.
133. #ifdef MONT_MUL_MOD
134. if (BN_is_odd(m)) {
^
135. # ifdef MONT_EXP_WORD
136. if (a->top == 1 && !a->neg
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:149:15: Call
147. #ifdef RECP_MUL_MOD
148. {
149. ret = BN_mod_exp_recp(r, a, p, m, ctx);
^
150. }
151. #else
crypto/bn/bn_exp.c:161:1: Parameter `m->top`
159. }
160.
161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
162. const BIGNUM *m, BN_CTX *ctx)
163. {
crypto/bn/bn_exp.c:206:13: Call
204. goto err;
205. } else {
206. if (BN_RECP_CTX_set(&recp, m, ctx) <= 0)
^
207. goto err;
208. }
crypto/bn/bn_recp.c:45:1: Parameter `d->top`
43. }
44.
45. > int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
46. {
47. if (!BN_copy(&(recp->N), d))
crypto/bn/bn_recp.c:47:10: Call
45. int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
46. {
47. if (!BN_copy(&(recp->N), d))
^
48. return 0;
49. BN_zero(&(recp->Nr));
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 `BN_mod_exp`
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/b48d4397b8ee4256f0b0a115eb99f27ae89995e0/crypto/bn/bn_lib.c/#L295
|
d2a_code_trace_data_43702
|
static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg)
{
int i;
LHASH_NODE *a,*n;
if (lh == NULL)
return;
for (i=lh->num_nodes-1; i>=0; i--)
{
a=lh->b[i];
while (a != NULL)
{
n=a->next;
if(use_arg)
func_arg(a->data,arg);
else
func(a->data);
a=n;
}
}
}
apps/s_time.c:625: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `SSL_free`.
Showing all 14 steps of the trace
apps/s_time.c:580:13: Call
578.
579. if (scon == NULL)
580. serverCon=SSL_new(tm_ctx);
^
581. else
582. {
ssl/ssl_lib.c:275:1: Parameter `ctx->sessions->num_nodes`
273. }
274.
275. > SSL *SSL_new(SSL_CTX *ctx)
276. {
277. SSL *s;
apps/s_time.c:625:4: Call
623. ERR_print_errors(bio_err);
624. if (scon == NULL)
625. SSL_free(serverCon);
^
626. return NULL;
627. }
ssl/ssl_lib.c:505:1: Parameter `s->initial_ctx->sessions->num_nodes`
503. }
504.
505. > void SSL_free(SSL *s)
506. {
507. int i;
ssl/ssl_lib.c:568:22: Call
566. if (s->tlsext_hostname)
567. OPENSSL_free(s->tlsext_hostname);
568. if (s->initial_ctx) SSL_CTX_free(s->initial_ctx);
^
569. #ifndef OPENSSL_NO_EC
570. if (s->tlsext_ecpointformatlist) OPENSSL_free(s->tlsext_ecpointformatlist);
ssl/ssl_lib.c:1899:1: Parameter `a->sessions->num_nodes`
1897. #endif
1898.
1899. > void SSL_CTX_free(SSL_CTX *a)
1900. {
1901. int i;
ssl/ssl_lib.c:1931:3: Call
1929. */
1930. if (a->sessions != NULL)
1931. SSL_CTX_flush_sessions(a,0);
^
1932.
1933. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data);
ssl/ssl_sess.c:985:1: Parameter `s->sessions->num_nodes`
983. static IMPLEMENT_LHASH_DOALL_ARG_FN(timeout, SSL_SESSION, TIMEOUT_PARAM)
984.
985. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
986. {
987. unsigned long i;
ssl/ssl_sess.c:997:2: Call
995. i=CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load;
996. CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=0;
997. lh_SSL_SESSION_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout),
^
998. TIMEOUT_PARAM, &tp);
999. CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=i;
crypto/lhash/lhash.c:305:1: Parameter `lh->num_nodes`
303. }
304.
305. > void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg)
306. {
307. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg);
crypto/lhash/lhash.c:307:2: Call
305. void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg)
306. {
307. doall_util_fn(lh, 1, (LHASH_DOALL_FN_TYPE)0, func, arg);
^
308. }
309.
crypto/lhash/lhash.c:270:1: <LHS trace>
268. }
269.
270. > static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg)
272. {
crypto/lhash/lhash.c:270:1: Parameter `lh->num_nodes`
268. }
269.
270. > static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
271. LHASH_DOALL_ARG_FN_TYPE func_arg, void *arg)
272. {
crypto/lhash/lhash.c:281:7: Binary operation: ([0, +oo] - 1):unsigned32 by call to `SSL_free`
279. /* reverse the order so we search from 'top to bottom'
280. * We were having memory leaks otherwise */
281. for (i=lh->num_nodes-1; i>=0; i--)
^
282. {
283. a=lh->b[i];
|
https://github.com/openssl/openssl/blob/4af793036f6ef4f0a1078e5d7155426a98d50e37/crypto/lhash/lhash.c/#L281
|
d2a_code_trace_data_43703
|
PUT_HEVC_QPEL_HV(3, 1)
libavcodec/hevcdsp_template.c:983: error: Buffer Overrun L3
Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h3v1_8`.
libavcodec/hevcdsp_template.c:983:1: Call
981. QPEL(12)
982. QPEL(8)
983. QPEL(4)
^
984.
985. static inline void FUNC(put_hevc_epel_pixels)(int16_t *dst, ptrdiff_t dststride,
libavcodec/hevcdsp_template.c:907:1: <Offset trace>
905. PUT_HEVC_QPEL_HV(2, 2)
906. PUT_HEVC_QPEL_HV(2, 3)
907. PUT_HEVC_QPEL_HV(3, 1)
^
908. PUT_HEVC_QPEL_HV(3, 2)
909. PUT_HEVC_QPEL_HV(3, 3)
libavcodec/hevcdsp_template.c:907:1: Assignment
905. PUT_HEVC_QPEL_HV(2, 2)
906. PUT_HEVC_QPEL_HV(2, 3)
907. PUT_HEVC_QPEL_HV(3, 1)
^
908. PUT_HEVC_QPEL_HV(3, 2)
909. PUT_HEVC_QPEL_HV(3, 3)
libavcodec/hevcdsp_template.c:907:1: <Length trace>
905. PUT_HEVC_QPEL_HV(2, 2)
906. PUT_HEVC_QPEL_HV(2, 3)
907. PUT_HEVC_QPEL_HV(3, 1)
^
908. PUT_HEVC_QPEL_HV(3, 2)
909. PUT_HEVC_QPEL_HV(3, 3)
libavcodec/hevcdsp_template.c:907:1: Array declaration
905. PUT_HEVC_QPEL_HV(2, 2)
906. PUT_HEVC_QPEL_HV(2, 3)
907. PUT_HEVC_QPEL_HV(3, 1)
^
908. PUT_HEVC_QPEL_HV(3, 2)
909. PUT_HEVC_QPEL_HV(3, 3)
libavcodec/hevcdsp_template.c:907:1: Assignment
905. PUT_HEVC_QPEL_HV(2, 2)
906. PUT_HEVC_QPEL_HV(2, 3)
907. PUT_HEVC_QPEL_HV(3, 1)
^
908. PUT_HEVC_QPEL_HV(3, 2)
909. PUT_HEVC_QPEL_HV(3, 3)
libavcodec/hevcdsp_template.c:907:1: Array access: Offset: [-64, +oo] (⇐ [0, +oo] + [-64, -61]) Size: 4544 by call to `put_hevc_qpel_h3v1_8`
905. PUT_HEVC_QPEL_HV(2, 2)
906. PUT_HEVC_QPEL_HV(2, 3)
907. PUT_HEVC_QPEL_HV(3, 1)
^
908. PUT_HEVC_QPEL_HV(3, 2)
909. PUT_HEVC_QPEL_HV(3, 3)
|
https://github.com/libav/libav/blob/688417399c69aadd4c287bdb0dec82ef8799011c/libavcodec/hevcdsp_template.c/#L907
|
d2a_code_trace_data_43704
|
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();
if (dhp == NULL)
return NULL;
dhp->g = BN_new();
if (dhp->g != NULL)
BN_set_word(dhp->g, 2);
if (dh_secbits >= 192)
dhp->p = get_rfc3526_prime_8192(NULL);
else
dhp->p = get_rfc3526_prime_3072(NULL);
if (dhp->p == NULL || dhp->g == NULL) {
DH_free(dhp);
return NULL;
}
return dhp;
}
if (dh_secbits >= 112)
return DH_get_2048_224();
return DH_get_1024_160();
}
ssl/t1_lib.c:4086: error: NULL_DEREFERENCE
pointer `cpk` last assigned on line 4085 could be null and is dereferenced at line 4086, column 45.
Showing all 30 steps of the trace
ssl/t1_lib.c:4074:1: start of procedure ssl_get_auto_dh()
4072.
4073. #ifndef OPENSSL_NO_DH
4074. > DH *ssl_get_auto_dh(SSL *s)
4075. {
4076. int dh_secbits = 80;
ssl/t1_lib.c:4076:5:
4074. DH *ssl_get_auto_dh(SSL *s)
4075. {
4076. > int dh_secbits = 80;
4077. if (s->cert->dh_tmp_auto == 2)
4078. return DH_get_1024_160();
ssl/t1_lib.c:4077:9: Taking false branch
4075. {
4076. int dh_secbits = 80;
4077. if (s->cert->dh_tmp_auto == 2)
^
4078. return DH_get_1024_160();
4079. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
ssl/t1_lib.c:4079:9: Taking false branch
4077. if (s->cert->dh_tmp_auto == 2)
4078. return DH_get_1024_160();
4079. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
^
4080. if (s->s3->tmp.new_cipher->strength_bits == 256)
4081. dh_secbits = 128;
ssl/t1_lib.c:4085:9:
4083. dh_secbits = 80;
4084. } else {
4085. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4086. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4087. }
ssl/ssl_lib.c:2770:1: start of procedure ssl_get_server_send_pkey()
2768. }
2769.
2770. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
2771. {
2772. CERT *c;
ssl/ssl_lib.c:2775:5:
2773. int i;
2774.
2775. > c = s->cert;
2776. if (!s->s3 || !s->s3->tmp.new_cipher)
2777. return NULL;
ssl/ssl_lib.c:2776:10: Taking false branch
2774.
2775. c = s->cert;
2776. if (!s->s3 || !s->s3->tmp.new_cipher)
^
2777. return NULL;
2778. ssl_set_masks(s);
ssl/ssl_lib.c:2776:20: Taking false branch
2774.
2775. c = s->cert;
2776. if (!s->s3 || !s->s3->tmp.new_cipher)
^
2777. return NULL;
2778. ssl_set_masks(s);
ssl/ssl_lib.c:2778:5: Skipping ssl_set_masks(): empty list of specs
2776. if (!s->s3 || !s->s3->tmp.new_cipher)
2777. return NULL;
2778. ssl_set_masks(s);
^
2779.
2780. i = ssl_get_server_cert_index(s);
ssl/ssl_lib.c:2780:5:
2778. ssl_set_masks(s);
2779.
2780. > i = ssl_get_server_cert_index(s);
2781.
2782. /* This may or may not be an error. */
ssl/ssl_lib.c:2749:1: start of procedure ssl_get_server_cert_index()
2747. #endif
2748.
2749. > static int ssl_get_server_cert_index(const SSL *s)
2750. {
2751. int idx;
ssl/ssl_lib.c:2752:5:
2750. {
2751. int idx;
2752. > idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2753. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
2754. idx = SSL_PKEY_RSA_SIGN;
ssl/ssl_ciph.c:1983:1: start of procedure ssl_cipher_get_cert_index()
1981.
1982. /* For a cipher return the index corresponding to the certificate type */
1983. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c)
1984. {
1985. uint32_t alg_a;
ssl/ssl_ciph.c:1987:5:
1985. uint32_t alg_a;
1986.
1987. > alg_a = c->algorithm_auth;
1988.
1989. if (alg_a & SSL_aECDSA)
ssl/ssl_ciph.c:1989:9: Taking false branch
1987. alg_a = c->algorithm_auth;
1988.
1989. if (alg_a & SSL_aECDSA)
^
1990. return SSL_PKEY_ECC;
1991. else if (alg_a & SSL_aDSS)
ssl/ssl_ciph.c:1991:14: Taking false branch
1989. if (alg_a & SSL_aECDSA)
1990. return SSL_PKEY_ECC;
1991. else if (alg_a & SSL_aDSS)
^
1992. return SSL_PKEY_DSA_SIGN;
1993. else if (alg_a & SSL_aRSA)
ssl/ssl_ciph.c:1993:14: Taking true branch
1991. else if (alg_a & SSL_aDSS)
1992. return SSL_PKEY_DSA_SIGN;
1993. else if (alg_a & SSL_aRSA)
^
1994. return SSL_PKEY_RSA_ENC;
1995. else if (alg_a & SSL_aGOST12)
ssl/ssl_ciph.c:1994:9:
1992. return SSL_PKEY_DSA_SIGN;
1993. else if (alg_a & SSL_aRSA)
1994. > return SSL_PKEY_RSA_ENC;
1995. else if (alg_a & SSL_aGOST12)
1996. return SSL_PKEY_GOST_EC;
ssl/ssl_ciph.c:2001:1: return from a call to ssl_cipher_get_cert_index
1999.
2000. return -1;
2001. > }
2002.
2003. const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr)
ssl/ssl_lib.c:2753:9: Taking true branch
2751. int idx;
2752. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2753. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
^
2754. idx = SSL_PKEY_RSA_SIGN;
2755. if (idx == SSL_PKEY_GOST_EC) {
ssl/ssl_lib.c:2753:37: Taking false branch
2751. int idx;
2752. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2753. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
^
2754. idx = SSL_PKEY_RSA_SIGN;
2755. if (idx == SSL_PKEY_GOST_EC) {
ssl/ssl_lib.c:2755:9: Taking false branch
2753. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
2754. idx = SSL_PKEY_RSA_SIGN;
2755. if (idx == SSL_PKEY_GOST_EC) {
^
2756. if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509)
2757. idx = SSL_PKEY_GOST12_512;
ssl/ssl_lib.c:2765:9: Taking false branch
2763. idx = -1;
2764. }
2765. if (idx == -1)
^
2766. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2767. return idx;
ssl/ssl_lib.c:2767:5:
2765. if (idx == -1)
2766. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2767. > return idx;
2768. }
2769.
ssl/ssl_lib.c:2768:1: return from a call to ssl_get_server_cert_index
2766. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2767. return idx;
2768. > }
2769.
2770. CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
ssl/ssl_lib.c:2783:9: Taking true branch
2781.
2782. /* This may or may not be an error. */
2783. if (i < 0)
^
2784. return NULL;
2785.
ssl/ssl_lib.c:2784:9:
2782. /* This may or may not be an error. */
2783. if (i < 0)
2784. > return NULL;
2785.
2786. /* May be NULL. */
ssl/ssl_lib.c:2788:1: return from a call to ssl_get_server_send_pkey
2786. /* May be NULL. */
2787. return &c->pkeys[i];
2788. > }
2789.
2790. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher,
ssl/t1_lib.c:4086:9:
4084. } else {
4085. CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4086. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4087. }
4088.
|
https://github.com/openssl/openssl/blob/91056e72693b4ee8cb5339d9091871ffc3b6f776/ssl/t1_lib.c/#L4086
|
d2a_code_trace_data_43705
|
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
{
bn_check_top(b);
if (a == b)
return a;
if (bn_wexpand(a, b->top) == NULL)
return NULL;
if (b->top > 0)
memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
a->neg = b->neg;
a->top = b->top;
a->flags |= b->flags & BN_FLG_FIXED_TOP;
bn_check_top(a);
return a;
}
test/ectest.c:576: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINTs_mul`.
Showing all 16 steps of the trace
test/ectest.c:165:13: Call
163. || !TEST_ptr(a = BN_new())
164. || !TEST_ptr(b = BN_new())
165. || !TEST_true(BN_hex2bn(&p, "17"))
^
166. || !TEST_true(BN_hex2bn(&a, "1"))
167. || !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;
test/ectest.c:576:10: Call
574.
575. /* z is still the group order */
576. if (!TEST_true(EC_POINTs_mul(group, P, NULL, 2, points, scalars, ctx))
^
577. || !TEST_true(EC_POINTs_mul(group, R, z, 2, points, scalars, ctx))
578. || !TEST_int_eq(0, EC_POINT_cmp(group, P, R, ctx))
crypto/ec/ec_lib.c:933:1: Parameter `(*scalars)->top`
931. */
932.
933. > int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
934. size_t num, const EC_POINT *points[],
935. const BIGNUM *scalars[], BN_CTX *ctx)
crypto/ec/ec_lib.c:965:15: Call
963. else
964. /* use default */
965. ret = ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
^
966.
967. BN_CTX_free(new_ctx);
crypto/ec/ec_mult.c:410:1: Parameter `(*scalars)->top`
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:463:20: Call
461. * actually set and we always call the ladder version.
462. */
463. return ec_scalar_mul_ladder(group, r, scalars[0], points[0], ctx);
^
464. }
465. }
crypto/ec/ec_mult.c:139:1: Parameter `scalar->top`
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:215:10: Call
213. }
214.
215. if (!BN_copy(k, scalar)) {
^
216. ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB);
217. goto err;
crypto/bn/bn_lib.c:281:1: <Offset trace>
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: Parameter `b->top`
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: <Length trace>
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:281:1: Parameter `*a->d`
279. }
280.
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282. {
283. bn_check_top(b);
crypto/bn/bn_lib.c:287:9: Call
285. if (a == b)
286. return a;
287. if (bn_wexpand(a, b->top) == NULL)
^
288. return NULL;
289.
crypto/bn/bn_lib.c:962:1: Parameter `*a->d`
960. }
961.
962. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
963. {
964. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:291:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `EC_POINTs_mul`
289.
290. if (b->top > 0)
291. memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
^
292.
293. a->neg = b->neg;
|
https://github.com/openssl/openssl/blob/3051bf2afab7ac8b7b9c64e68755d1addd2fb8ff/crypto/bn/bn_lib.c/#L291
|
d2a_code_trace_data_43706
|
static inline void pred_direct_motion(H264Context * const h, int *mb_type){
MpegEncContext * const s = &h->s;
const int mb_xy = s->mb_x + s->mb_y*s->mb_stride;
const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride;
const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy];
const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy];
const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy];
const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy];
const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy];
const int is_b8x8 = IS_8X8(*mb_type);
unsigned int sub_mb_type;
int i8, i4;
#define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)
if(IS_8X8(mb_type_col) && !h->sps.direct_8x8_inference_flag){
sub_mb_type = MB_TYPE_8x8|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1;
}else if(!is_b8x8 && (mb_type_col & MB_TYPE_16x16_OR_INTRA)){
sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
}else{
sub_mb_type = MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1;
}
if(!is_b8x8)
*mb_type |= MB_TYPE_DIRECT2;
if(MB_FIELD)
*mb_type |= MB_TYPE_INTERLACED;
tprintf(s->avctx, "mb_type = %08x, sub_mb_type = %08x, is_b8x8 = %d, mb_type_col = %08x\n", *mb_type, sub_mb_type, is_b8x8, mb_type_col);
if(h->direct_spatial_mv_pred){
int ref[2];
int mv[2][2];
int list;
for(list=0; list<2; list++){
int refa = h->ref_cache[list][scan8[0] - 1];
int refb = h->ref_cache[list][scan8[0] - 8];
int refc = h->ref_cache[list][scan8[0] - 8 + 4];
if(refc == -2)
refc = h->ref_cache[list][scan8[0] - 8 - 1];
ref[list] = refa;
if(ref[list] < 0 || (refb < ref[list] && refb >= 0))
ref[list] = refb;
if(ref[list] < 0 || (refc < ref[list] && refc >= 0))
ref[list] = refc;
if(ref[list] < 0)
ref[list] = -1;
}
if(ref[0] < 0 && ref[1] < 0){
ref[0] = ref[1] = 0;
mv[0][0] = mv[0][1] =
mv[1][0] = mv[1][1] = 0;
}else{
for(list=0; list<2; list++){
if(ref[list] >= 0)
pred_motion(h, 0, 4, list, ref[list], &mv[list][0], &mv[list][1]);
else
mv[list][0] = mv[list][1] = 0;
}
}
if(ref[1] < 0){
if(!is_b8x8)
*mb_type &= ~MB_TYPE_L1;
sub_mb_type &= ~MB_TYPE_L1;
}else if(ref[0] < 0){
if(!is_b8x8)
*mb_type &= ~MB_TYPE_L0;
sub_mb_type &= ~MB_TYPE_L0;
}
if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){
int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride;
int mb_types_col[2];
int b8_stride = h->b8_stride;
int b4_stride = h->b_stride;
*mb_type = (*mb_type & ~MB_TYPE_16x16) | MB_TYPE_8x8;
if(IS_INTERLACED(*mb_type)){
mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy];
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
if(s->mb_y&1){
l1ref0 -= 2*b8_stride;
l1ref1 -= 2*b8_stride;
l1mv0 -= 4*b4_stride;
l1mv1 -= 4*b4_stride;
}
b8_stride *= 3;
b4_stride *= 6;
}else{
int cur_poc = s->current_picture_ptr->poc;
int *col_poc = h->ref_list[1]->field_poc;
int col_parity = FFABS(col_poc[0] - cur_poc) >= FFABS(col_poc[1] - cur_poc);
int dy = 2*col_parity - (s->mb_y&1);
mb_types_col[0] =
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy + col_parity*s->mb_stride];
l1ref0 += dy*b8_stride;
l1ref1 += dy*b8_stride;
l1mv0 += 2*dy*b4_stride;
l1mv1 += 2*dy*b4_stride;
b8_stride = 0;
}
for(i8=0; i8<4; i8++){
int x8 = i8&1;
int y8 = i8>>1;
int xy8 = x8+y8*b8_stride;
int xy4 = 3*x8+y8*b4_stride;
int a=0, b=0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_types_col[y8])
&& ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1)
|| (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){
if(ref[0] > 0)
a= pack16to32(mv[0][0],mv[0][1]);
if(ref[1] > 0)
b= pack16to32(mv[1][0],mv[1][1]);
}else{
a= pack16to32(mv[0][0],mv[0][1]);
b= pack16to32(mv[1][0],mv[1][1]);
}
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, a, 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, b, 4);
}
}else if(IS_16X16(*mb_type)){
int a=0, b=0;
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_type_col)
&& ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1)
|| (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1
&& (h->x264_build>33 || !h->x264_build)))){
if(ref[0] > 0)
a= pack16to32(mv[0][0],mv[0][1]);
if(ref[1] > 0)
b= pack16to32(mv[1][0],mv[1][1]);
}else{
a= pack16to32(mv[0][0],mv[0][1]);
b= pack16to32(mv[1][0],mv[1][1]);
}
fill_rectangle(&h->mv_cache[0][scan8[0]], 4, 4, 8, a, 4);
fill_rectangle(&h->mv_cache[1][scan8[0]], 4, 4, 8, b, 4);
}else{
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mv[0][0],mv[0][1]), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4);
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
if(!IS_INTRA(mb_type_col) && ( l1ref0[x8 + y8*h->b8_stride] == 0
|| (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0
&& (h->x264_build>33 || !h->x264_build)))){
const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1;
if(IS_SUB_8X8(sub_mb_type)){
const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride];
if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
if(ref[0] == 0)
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
if(ref[1] == 0)
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
}
}else
for(i4=0; i4<4; i4++){
const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
if(ref[0] == 0)
*(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0;
if(ref[1] == 0)
*(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0;
}
}
}
}
}
}else{
const int *map_col_to_list0[2] = {h->map_col_to_list0[0], h->map_col_to_list0[1]};
const int *dist_scale_factor = h->dist_scale_factor;
if(FRAME_MBAFF){
if(IS_INTERLACED(*mb_type)){
map_col_to_list0[0] = h->map_col_to_list0_field[0];
map_col_to_list0[1] = h->map_col_to_list0_field[1];
dist_scale_factor = h->dist_scale_factor_field;
}
if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col)){
const int pair_xy = s->mb_x + (s->mb_y&~1)*s->mb_stride;
int mb_types_col[2];
int y_shift;
*mb_type = MB_TYPE_8x8|MB_TYPE_L0L1
| (is_b8x8 ? 0 : MB_TYPE_DIRECT2)
| (*mb_type & MB_TYPE_INTERLACED);
sub_mb_type = MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_16x16;
if(IS_INTERLACED(*mb_type)){
mb_types_col[0] = h->ref_list[1][0].mb_type[pair_xy];
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
if(s->mb_y&1){
l1ref0 -= 2*h->b8_stride;
l1ref1 -= 2*h->b8_stride;
l1mv0 -= 4*h->b_stride;
l1mv1 -= 4*h->b_stride;
}
y_shift = 0;
if( (mb_types_col[0] & MB_TYPE_16x16_OR_INTRA)
&& (mb_types_col[1] & MB_TYPE_16x16_OR_INTRA)
&& !is_b8x8)
*mb_type |= MB_TYPE_16x8;
else
*mb_type |= MB_TYPE_8x8;
}else{
int dy = (s->mb_y&1) ? 1 : 2;
mb_types_col[0] =
mb_types_col[1] = h->ref_list[1][0].mb_type[pair_xy+s->mb_stride];
l1ref0 += dy*h->b8_stride;
l1ref1 += dy*h->b8_stride;
l1mv0 += 2*dy*h->b_stride;
l1mv1 += 2*dy*h->b_stride;
y_shift = 2;
if((mb_types_col[0] & (MB_TYPE_16x16_OR_INTRA|MB_TYPE_16x8))
&& !is_b8x8)
*mb_type |= MB_TYPE_16x16;
else
*mb_type |= MB_TYPE_8x8;
}
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
int ref0, scale;
const int16_t (*l1mv)[2]= l1mv0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
if(IS_INTRA(mb_types_col[y8])){
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
continue;
}
ref0 = l1ref0[x8 + (y8*2>>y_shift)*h->b8_stride];
if(ref0 >= 0)
ref0 = map_col_to_list0[0][ref0*2>>y_shift];
else{
ref0 = map_col_to_list0[1][l1ref1[x8 + (y8*2>>y_shift)*h->b8_stride]*2>>y_shift];
l1mv= l1mv1;
}
scale = dist_scale_factor[ref0];
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
{
const int16_t *mv_col = l1mv[x8*3 + (y8*6>>y_shift)*h->b_stride];
int my_col = (mv_col[1]<<y_shift)/2;
int mx = (scale * mv_col[0] + 128) >> 8;
int my = (scale * my_col + 128) >> 8;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-my_col), 4);
}
}
return;
}
}
if(IS_16X16(*mb_type)){
int ref, mv0, mv1;
fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, 0, 1);
if(IS_INTRA(mb_type_col)){
ref=mv0=mv1=0;
}else{
const int ref0 = l1ref0[0] >= 0 ? map_col_to_list0[0][l1ref0[0]]
: map_col_to_list0[1][l1ref1[0]];
const int scale = dist_scale_factor[ref0];
const int16_t *mv_col = l1ref0[0] >= 0 ? l1mv0[0] : l1mv1[0];
int mv_l0[2];
mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
ref= ref0;
mv0= pack16to32(mv_l0[0],mv_l0[1]);
mv1= pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
}
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);
fill_rectangle(&h-> mv_cache[0][scan8[0]], 4, 4, 8, mv0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[0]], 4, 4, 8, mv1, 4);
}else{
for(i8=0; i8<4; i8++){
const int x8 = i8&1;
const int y8 = i8>>1;
int ref0, scale;
const int16_t (*l1mv)[2]= l1mv0;
if(is_b8x8 && !IS_DIRECT(h->sub_mb_type[i8]))
continue;
h->sub_mb_type[i8] = sub_mb_type;
fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, 0, 1);
if(IS_INTRA(mb_type_col)){
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, 0, 1);
fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4);
fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4);
continue;
}
ref0 = l1ref0[x8 + y8*h->b8_stride];
if(ref0 >= 0)
ref0 = map_col_to_list0[0][ref0];
else{
ref0 = map_col_to_list0[1][l1ref1[x8 + y8*h->b8_stride]];
l1mv= l1mv1;
}
scale = dist_scale_factor[ref0];
fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1);
if(IS_SUB_8X8(sub_mb_type)){
const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride];
int mx = (scale * mv_col[0] + 128) >> 8;
int my = (scale * mv_col[1] + 128) >> 8;
fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4);
fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4);
}else
for(i4=0; i4<4; i4++){
const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride];
int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]];
mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
*(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] =
pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
}
}
}
}
}
libavcodec/h264.c:1029: error: Uninitialized Value
The value read from ref[_] was never initialized.
libavcodec/h264.c:1029:18:
1027. *mb_type &= ~MB_TYPE_L1;
1028. sub_mb_type &= ~MB_TYPE_L1;
1029. }else if(ref[0] < 0){
^
1030. if(!is_b8x8)
1031. *mb_type &= ~MB_TYPE_L0;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1029
|
d2a_code_trace_data_43707
|
static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
OPENSSL_LH_DOALL_FUNC func,
OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg)
{
int i;
OPENSSL_LH_NODE *a, *n;
if (lh == NULL)
return;
for (i = lh->num_nodes - 1; i >= 0; i--) {
a = lh->b[i];
while (a != NULL) {
n = a->next;
if (use_arg)
func_arg(a->data, arg);
else
func(a->data);
a = n;
}
}
}
test/servername_test.c:123: error: INTEGER_OVERFLOW_L2
([0, 8] - 1):unsigned32 by call to `SSL_free`.
Showing all 18 steps of the trace
test/servername_test.c:90:11: Call
88.
89. /* use TLS_method to blur 'side' */
90. ctx = SSL_CTX_new(TLS_method());
^
91. if (!TEST_ptr(ctx))
92. goto end;
ssl/ssl_lib.c:2765:21: Call
2763. goto err;
2764.
2765. ret->sessions = lh_SSL_SESSION_new(ssl_session_hash, ssl_session_cmp);
^
2766. if (ret->sessions == NULL)
2767. goto err;
ssl/ssl_locl.h:702:1: Call
700. } TLSEXT_INDEX;
701.
702. > DEFINE_LHASH_OF(SSL_SESSION);
703. /* Needed in ssl_cert.c */
704. DEFINE_LHASH_OF(X509_NAME);
crypto/lhash/lhash.c:39:5: Assignment
37. ret->comp = ((c == NULL) ? (OPENSSL_LH_COMPFUNC)strcmp : c);
38. ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
39. ret->num_nodes = MIN_NODES / 2;
^
40. ret->num_alloc_nodes = MIN_NODES;
41. ret->pmax = MIN_NODES / 2;
test/servername_test.c:123:5: Call
121. end:
122. OPENSSL_free(hostname);
123. SSL_free(con);
^
124. SSL_CTX_free(ctx);
125. return ret;
ssl/ssl_lib.c:1051:1: Parameter `s->ctx->sessions->num_nodes`
1049. }
1050.
1051. > void SSL_free(SSL *s)
1052. {
1053. int i;
ssl/ssl_lib.c:1120:5: Call
1118. RECORD_LAYER_release(&s->rlayer);
1119.
1120. SSL_CTX_free(s->ctx);
^
1121.
1122. ASYNC_WAIT_CTX_free(s->waitctx);
ssl/ssl_lib.c:2882:1: Parameter `a->sessions->num_nodes`
2880. }
2881.
2882. > void SSL_CTX_free(SSL_CTX *a)
2883. {
2884. int i;
ssl/ssl_lib.c:2908:9: Call
2906. */
2907. if (a->sessions != NULL)
2908. SSL_CTX_flush_sessions(a, 0);
^
2909.
2910. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data);
ssl/ssl_sess.c:1044:1: Parameter `s->sessions->num_nodes`
1042. IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
1043.
1044. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
1045. {
1046. unsigned long i;
ssl/ssl_sess.c:1057:5: Call
1055. i = lh_SSL_SESSION_get_down_load(s->sessions);
1056. lh_SSL_SESSION_set_down_load(s->sessions, 0);
1057. lh_SSL_SESSION_doall_TIMEOUT_PARAM(tp.cache, timeout_cb, &tp);
^
1058. lh_SSL_SESSION_set_down_load(s->sessions, i);
1059. CRYPTO_THREAD_unlock(s->lock);
ssl/ssl_sess.c:1042:1: Parameter `lh->num_nodes`
1040. }
1041.
1042. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
1043.
1044. void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
ssl/ssl_sess.c:1042:1: Call
1040. }
1041.
1042. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
1043.
1044. void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
crypto/lhash/lhash.c:186:1: Parameter `lh->num_nodes`
184. }
185.
186. > void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg)
187. {
188. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
crypto/lhash/lhash.c:188:5: Call
186. void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg)
187. {
188. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
^
189. }
190.
crypto/lhash/lhash.c:154:1: <LHS trace>
152. }
153.
154. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
155. OPENSSL_LH_DOALL_FUNC func,
156. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg)
crypto/lhash/lhash.c:154:1: Parameter `lh->num_nodes`
152. }
153.
154. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
155. OPENSSL_LH_DOALL_FUNC func,
156. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg)
crypto/lhash/lhash.c:168:10: Binary operation: ([0, 8] - 1):unsigned32 by call to `SSL_free`
166. * memory leaks otherwise
167. */
168. for (i = lh->num_nodes - 1; i >= 0; i--) {
^
169. a = lh->b[i];
170. while (a != NULL) {
|
https://github.com/openssl/openssl/blob/190b9a03b72a8029c27e4bd0ab000129e240a413/crypto/lhash/lhash.c/#L168
|
d2a_code_trace_data_43708
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/bn/bn_mod.c:227: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_div`.
Showing all 30 steps of the trace
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: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 `r->top`
25. }
26.
27. > int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
28. {
29. int max, al;
crypto/bn/bn_sqr.c:21:5: Call
19. int ret = bn_sqr_fixed_top(r, a, ctx);
20.
21. bn_correct_top(r);
^
22. bn_check_top(r);
23.
crypto/bn/bn_lib.c:965:1: Parameter `a->top`
963. }
964.
965. > void bn_correct_top(BIGNUM *a)
966. {
967. BN_ULONG *ftl;
crypto/bn/bn_mod.c:227:12: Call
225. return 0;
226. /* r->neg == 0, thus we don't need BN_nnmod */
227. return BN_mod(r, r, m, ctx);
^
228. }
229.
crypto/bn/bn_div.c:209:1: Parameter `rm->top`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:229:11: Call
227. }
228.
229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
^
230.
231. if (ret) {
crypto/bn/bn_div.c:264:1: Parameter `rm->top`
262. * divisor's length is considered public;
263. */
264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
265. const BIGNUM *divisor, BN_CTX *ctx)
266. {
crypto/bn/bn_div.c:449:9: Call
447. snum->flags |= BN_FLG_FIXED_TOP;
448. if (rm != NULL)
449. bn_rshift_fixed_top(rm, snum, norm_shift);
^
450. BN_CTX_end(ctx);
451. return 1;
crypto/bn/bn_shift.c:214:1: Parameter `r->top`
212. * |n < BN_BITS2| or |n / BN_BITS2| being non-secret.
213. */
214. > int bn_rshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n)
215. {
216. int i, top, nw;
crypto/bn/bn_shift.c:229:9: Call
227. if (nw >= a->top) {
228. /* shouldn't happen, but formally required */
229. BN_zero(r);
^
230. return 1;
231. }
crypto/bn/bn_lib.c:359:1: Parameter `a->top`
357. }
358.
359. > int BN_set_word(BIGNUM *a, BN_ULONG w)
360. {
361. bn_check_top(a);
crypto/bn/bn_lib.c:362:9: Call
360. {
361. bn_check_top(a);
362. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
363. return 0;
364. a->neg = 0;
crypto/bn/bn_lcl.h:660:1: Parameter `a->top`
658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
659.
660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
661. {
662. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/bn/bn_lcl.h:668:12: Call
666. return a;
667.
668. return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);
^
669. }
670.
crypto/bn/bn_lib.c:245:1: Parameter `b->top`
243. */
244.
245. > BIGNUM *bn_expand2(BIGNUM *b, int words)
246. {
247. if (words > b->dmax) {
crypto/bn/bn_lib.c:248:23: Call
246. {
247. if (words > b->dmax) {
248. BN_ULONG *a = bn_expand_internal(b, words);
^
249. if (!a)
250. return NULL;
crypto/bn/bn_lib.c:209:1: <Offset trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `b->top`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: <Length trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `words`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:224:13: Call
222. a = OPENSSL_secure_zalloc(words * sizeof(*a));
223. else
224. a = OPENSSL_zalloc(words * sizeof(*a));
^
225. if (a == NULL) {
226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/mem.c:228:1: Parameter `num`
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:17: Call
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
^
231.
232. FAILTEST();
crypto/mem.c:201:9: Assignment
199.
200. if (num == 0)
201. return NULL;
^
202.
203. FAILTEST();
crypto/mem.c:230:5: Assignment
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
^
231.
232. FAILTEST();
crypto/mem.c:235:5: Assignment
233. if (ret != NULL)
234. memset(ret, 0, num);
235. return ret;
^
236. }
237.
crypto/bn/bn_lib.c:224:9: Assignment
222. a = OPENSSL_secure_zalloc(words * sizeof(*a));
223. else
224. a = OPENSSL_zalloc(words * sizeof(*a));
^
225. if (a == NULL) {
226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_div`
230. assert(b->top <= words);
231. if (b->top > 0)
232. memcpy(a, b->d, sizeof(*a) * b->top);
^
233.
234. return a;
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_43709
|
static int epzs_motion_search4(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int P[10][2],
int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d, dmin;
int map_generation;
const int penalty_factor= c->penalty_factor;
const int size=1;
const int h=8;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
int flags= c->flags;
LOAD_COMMON2
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
map_generation= update_map_generation(c);
dmin = 1000000;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
}else{
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}
if(dmin>64*4){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1167: error: Uninitialized Value
The value read from xmin was never initialized.
libavcodec/motion_est_template.c:1167:9:
1165. //FIXME try some early stop
1166. CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
1167. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
^
1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
1169. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1167
|
d2a_code_trace_data_43710
|
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:278: error: Uninitialized Value
The value read from inbuffer[_] was never initialized.
libavcodec/ra144.c:278:3:
276. *(ptr++)=(inbuffer[2]>>12)&7;
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;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L278
|
d2a_code_trace_data_43711
|
static void perform_idle_server_maintenance(void)
{
int i, j;
int idle_thread_count;
worker_score *ws;
process_score *ps;
int free_length;
int totally_free_length = 0;
int free_slots[MAX_SPAWN_RATE];
int last_non_dead;
int total_non_dead;
int active_thread_count = 0;
free_length = 0;
idle_thread_count = 0;
last_non_dead = -1;
total_non_dead = 0;
for (i = 0; i < ap_daemons_limit; ++i) {
int status = SERVER_DEAD;
int any_dying_threads = 0;
int any_dead_threads = 0;
int all_dead_threads = 1;
if (i >= retained->max_daemons_limit
&& totally_free_length == retained->idle_spawn_rate)
break;
ps = &ap_scoreboard_image->parent[i];
for (j = 0; j < threads_per_child; j++) {
ws = &ap_scoreboard_image->servers[i][j];
status = ws->status;
any_dying_threads = any_dying_threads ||
(status == SERVER_GRACEFUL);
any_dead_threads = any_dead_threads || (status == SERVER_DEAD);
all_dead_threads = all_dead_threads &&
(status == SERVER_DEAD || status == SERVER_GRACEFUL);
if (ps->pid != 0) {
if (status <= SERVER_READY && !ps->quiescing && !ps->not_accepting
&& ps->generation == retained->my_generation)
{
++idle_thread_count;
}
if (status >= SERVER_READY && status < SERVER_GRACEFUL) {
++active_thread_count;
}
}
}
if (any_dead_threads
&& totally_free_length < retained->idle_spawn_rate
&& free_length < MAX_SPAWN_RATE
&& (!ps->pid
|| ps->quiescing)) {
if (all_dead_threads) {
free_slots[free_length] = free_slots[totally_free_length];
free_slots[totally_free_length++] = i;
}
else {
free_slots[free_length] = i;
}
++free_length;
}
if (!any_dying_threads) {
last_non_dead = i;
++total_non_dead;
}
}
if (retained->sick_child_detected) {
if (active_thread_count > 0) {
retained->sick_child_detected = 0;
}
else {
shutdown_pending = 1;
child_fatal = 1;
ap_log_error(APLOG_MARK, APLOG_ALERT, 0,
ap_server_conf, APLOGNO(00483)
"No active workers found..."
" Apache is exiting!");
return;
}
}
retained->max_daemons_limit = last_non_dead + 1;
if (idle_thread_count > max_spare_threads) {
ap_event_pod_signal(pod, TRUE);
retained->idle_spawn_rate = 1;
}
else if (idle_thread_count < min_spare_threads) {
if (free_length == 0) {
if (active_thread_count >= ap_daemons_limit * threads_per_child) {
if (!retained->maxclients_reported) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(00484)
"server reached MaxRequestWorkers setting, "
"consider raising the MaxRequestWorkers "
"setting");
retained->maxclients_reported = 1;
}
}
else {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, APLOGNO(00485)
"scoreboard is full, not at MaxRequestWorkers");
}
retained->idle_spawn_rate = 1;
}
else {
if (free_length > retained->idle_spawn_rate) {
free_length = retained->idle_spawn_rate;
}
if (retained->idle_spawn_rate >= 8) {
ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf, APLOGNO(00486)
"server seems busy, (you may need "
"to increase StartServers, ThreadsPerChild "
"or Min/MaxSpareThreads), "
"spawning %d children, there are around %d idle "
"threads, and %d total children", free_length,
idle_thread_count, total_non_dead);
}
for (i = 0; i < free_length; ++i) {
make_child(ap_server_conf, free_slots[i]);
}
if (retained->hold_off_on_exponential_spawning) {
--retained->hold_off_on_exponential_spawning;
}
else if (retained->idle_spawn_rate < MAX_SPAWN_RATE) {
retained->idle_spawn_rate *= 2;
}
}
}
else {
retained->idle_spawn_rate = 1;
}
}
server/mpm/event/event.c:2525: error: UNINITIALIZED_VALUE
The value read from free_slots[_] was never initialized.
server/mpm/event/event.c:2525:17:
2523. }
2524. for (i = 0; i < free_length; ++i) {
2525. make_child(ap_server_conf, free_slots[i]);
^
2526. }
2527. /* the next time around we want to spawn twice as many if this
|
https://github.com/apache/httpd/blob/8b2ec33ac5d314be345814db08e194ffeda6beb0/server/mpm/event/event.c/#L2525
|
d2a_code_trace_data_43712
|
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:269: error: Uninitialized Value
The value read from inbuffer[_] was never initialized.
libavcodec/ra144.c:269:3:
267. *(ptr++)=27;
268. *(ptr++)=(inbuffer[0]>>10)&0x3f;
269. *(ptr++)=(inbuffer[0]>>5)&0x1f;
^
270. *(ptr++)=inbuffer[0]&0x1f;
271. *(ptr++)=(inbuffer[1]>>12)&0xf;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L269
|
d2a_code_trace_data_43713
|
static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
*h = desc->log2_chroma_w;
*v = desc->log2_chroma_h;
}
libswscale/utils.c:782: error: Null Dereference
pointer `desc` last assigned on line 781 could be null and is dereferenced at line 782, column 10.
libswscale/utils.c:779:1: start of procedure getSubSampleFactors()
777. #endif /* HAVE_MMXEXT_INLINE */
778.
779. static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
^
780. {
781. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
libswscale/utils.c:781:5:
779. static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
780. {
781. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
^
782. *h = desc->log2_chroma_w;
783. *v = desc->log2_chroma_h;
libavutil/pixdesc.c:1464:1: start of procedure av_pix_fmt_desc_get()
1462. }
1463.
1464. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
^
1465. {
1466. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
libavutil/pixdesc.c:1466:9: Taking false branch
1464. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1465. {
1466. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1467. return NULL;
1468. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1466:24: Taking true branch
1464. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1465. {
1466. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1467. return NULL;
1468. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1467:9:
1465. {
1466. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1467. return NULL;
^
1468. return &av_pix_fmt_descriptors[pix_fmt];
1469. }
libavutil/pixdesc.c:1469:1: return from a call to av_pix_fmt_desc_get
1467. return NULL;
1468. return &av_pix_fmt_descriptors[pix_fmt];
1469. }
^
1470.
1471. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
libswscale/utils.c:782:5:
780. {
781. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
782. *h = desc->log2_chroma_w;
^
783. *v = desc->log2_chroma_h;
784. }
|
https://github.com/libav/libav/blob/5f87c277bd5caa09cc4f9061d4ccdd58dc121110/libswscale/utils.c/#L782
|
d2a_code_trace_data_43714
|
static void qdm2_synthesis_filter (QDM2Context *q, int index)
{
OUT_INT samples[MPA_MAX_CHANNELS * MPA_FRAME_SIZE];
int i, k, ch, sb_used, sub_sampling, dither_state = 0;
sb_used = QDM2_SB_USED(q->sub_sampling);
for (ch = 0; ch < q->channels; ch++)
for (i = 0; i < 8; i++)
for (k=sb_used; k < SBLIMIT; k++)
q->sb_samples[ch][(8 * index) + i][k] = 0;
for (ch = 0; ch < q->nb_channels; ch++) {
OUT_INT *samples_ptr = samples + ch;
for (i = 0; i < 8; i++) {
ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]),
mpa_window, &dither_state,
samples_ptr, q->nb_channels,
q->sb_samples[ch][(8 * index) + i]);
samples_ptr += 32 * q->nb_channels;
}
}
sub_sampling = (4 >> q->sub_sampling);
for (ch = 0; ch < q->channels; ch++)
for (i = 0; i < q->frame_size; i++)
q->output_buffer[q->channels * i + ch] += (float)(samples[q->nb_channels * sub_sampling * i + ch] >> (sizeof(OUT_INT)*8-16));
}
libavcodec/qdm2.c:1685: error: Uninitialized Value
The value read from samples[_] was never initialized.
libavcodec/qdm2.c:1685:13:
1683. for (ch = 0; ch < q->channels; ch++)
1684. for (i = 0; i < q->frame_size; i++)
1685. q->output_buffer[q->channels * i + ch] += (float)(samples[q->nb_channels * sub_sampling * i + ch] >> (sizeof(OUT_INT)*8-16));
^
1686. }
1687.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/qdm2.c/#L1685
|
d2a_code_trace_data_43715
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/rsa/rsa_ossl.c:633: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set_locked`.
Showing all 60 steps of the trace
crypto/rsa/rsa_ossl.c:591:1: Parameter `ctx->stack.depth`
589. }
590.
591. > static int rsa_ossl_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
592. {
593. BIGNUM *r1, *m1, *vrfy, *r2, *m[RSA_MAX_PRIME_NUM - 2];
crypto/rsa/rsa_ossl.c:597:5: Call
595. RSA_PRIME_INFO *pinfo;
596.
597. BN_CTX_start(ctx);
^
598.
599. r1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/rsa/rsa_ossl.c:599:10: Call
597. BN_CTX_start(ctx);
598.
599. r1 = BN_CTX_get(ctx);
^
600. r2 = BN_CTX_get(ctx);
601. m1 = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_ossl.c:600:10: Call
598.
599. r1 = BN_CTX_get(ctx);
600. r2 = BN_CTX_get(ctx);
^
601. m1 = BN_CTX_get(ctx);
602. vrfy = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_ossl.c:601:10: Call
599. r1 = BN_CTX_get(ctx);
600. r2 = BN_CTX_get(ctx);
601. m1 = BN_CTX_get(ctx);
^
602. vrfy = BN_CTX_get(ctx);
603. if (vrfy == NULL)
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_ossl.c:602:12: Call
600. r2 = BN_CTX_get(ctx);
601. m1 = BN_CTX_get(ctx);
602. vrfy = BN_CTX_get(ctx);
^
603. if (vrfy == NULL)
604. goto err;
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/rsa/rsa_ossl.c:622:15: Call
620. */
621. if (!(BN_with_flags(factor, rsa->p, BN_FLG_CONSTTIME),
622. BN_MONT_CTX_set_locked(&rsa->_method_mod_p, rsa->lock,
^
623. factor, ctx))
624. || !(BN_with_flags(factor, rsa->q, BN_FLG_CONSTTIME),
crypto/bn/bn_mont.c:428:1: Parameter `ctx->stack.depth`
426. }
427.
428. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
429. const BIGNUM *mod, BN_CTX *ctx)
430. {
crypto/rsa/rsa_ossl.c:625:18: Call
623. factor, ctx))
624. || !(BN_with_flags(factor, rsa->q, BN_FLG_CONSTTIME),
625. BN_MONT_CTX_set_locked(&rsa->_method_mod_q, rsa->lock,
^
626. factor, ctx))) {
627. BN_free(factor);
crypto/bn/bn_mont.c:428:1: Parameter `ctx->stack.depth`
426. }
427.
428. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
429. const BIGNUM *mod, BN_CTX *ctx)
430. {
crypto/rsa/rsa_ossl.c:633:18: Call
631. pinfo = sk_RSA_PRIME_INFO_value(rsa->prime_infos, i);
632. BN_with_flags(factor, pinfo->r, BN_FLG_CONSTTIME);
633. if (!BN_MONT_CTX_set_locked(&pinfo->m, rsa->lock, factor, ctx)) {
^
634. BN_free(factor);
635. goto err;
crypto/bn/bn_mont.c:428:1: Parameter `ctx->stack.depth`
426. }
427.
428. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
429. const BIGNUM *mod, BN_CTX *ctx)
430. {
crypto/bn/bn_mont.c:450:10: Call
448. if (ret == NULL)
449. return NULL;
450. if (!BN_MONT_CTX_set(ret, mod, ctx)) {
^
451. BN_MONT_CTX_free(ret);
452. return NULL;
crypto/bn/bn_mont.c:263:1: Parameter `ctx->stack.depth`
261. }
262.
263. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
264. {
265. int i, ret = 0;
crypto/bn/bn_mont.c:271:5: Call
269. return 0;
270.
271. BN_CTX_start(ctx);
^
272. if ((Ri = BN_CTX_get(ctx)) == NULL)
273. goto err;
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_mont.c:272:15: Call
270.
271. BN_CTX_start(ctx);
272. if ((Ri = BN_CTX_get(ctx)) == NULL)
^
273. goto err;
274. R = &(mont->RR); /* grab RR as a temp */
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_mont.c:351:19: Call
349. if (BN_is_one(&tmod))
350. BN_zero(Ri);
351. else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
^
352. goto err;
353. if (!BN_lshift(Ri, Ri, BN_BITS2))
crypto/bn/bn_gcd.c:124:1: Parameter `ctx->stack.depth`
122. BN_CTX *ctx);
123.
124. > BIGNUM *BN_mod_inverse(BIGNUM *in,
125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
126. {
crypto/bn/bn_gcd.c:129:10: Call
127. BIGNUM *rv;
128. int noinv;
129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
^
130. if (noinv)
131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);
crypto/bn/bn_gcd.c:135:1: Parameter `ctx->stack.depth`
133. }
134.
135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
137. int *pnoinv)
crypto/bn/bn_gcd.c:155:16: Call
153. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
154. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
155. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
156. }
157.
crypto/bn/bn_gcd.c:458:1: Parameter `ctx->stack.depth`
456. * not contain branches that may leak sensitive information.
457. */
458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
459. const BIGNUM *a, const BIGNUM *n,
460. BN_CTX *ctx)
crypto/bn/bn_gcd.c:469:5: Call
467. bn_check_top(n);
468.
469. BN_CTX_start(ctx);
^
470. A = BN_CTX_get(ctx);
471. B = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_gcd.c:470:9: Call
468.
469. BN_CTX_start(ctx);
470. A = BN_CTX_get(ctx);
^
471. B = BN_CTX_get(ctx);
472. X = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:471:9: Call
469. BN_CTX_start(ctx);
470. A = BN_CTX_get(ctx);
471. B = BN_CTX_get(ctx);
^
472. X = BN_CTX_get(ctx);
473. D = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:472:9: Call
470. A = BN_CTX_get(ctx);
471. B = BN_CTX_get(ctx);
472. X = BN_CTX_get(ctx);
^
473. D = BN_CTX_get(ctx);
474. M = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:473:9: Call
471. B = BN_CTX_get(ctx);
472. X = BN_CTX_get(ctx);
473. D = BN_CTX_get(ctx);
^
474. M = BN_CTX_get(ctx);
475. Y = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:474:9: Call
472. X = BN_CTX_get(ctx);
473. D = BN_CTX_get(ctx);
474. M = BN_CTX_get(ctx);
^
475. Y = BN_CTX_get(ctx);
476. T = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:475:9: Call
473. D = BN_CTX_get(ctx);
474. M = BN_CTX_get(ctx);
475. Y = BN_CTX_get(ctx);
^
476. T = BN_CTX_get(ctx);
477. if (T == NULL)
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:476:9: Call
474. M = BN_CTX_get(ctx);
475. Y = BN_CTX_get(ctx);
476. T = BN_CTX_get(ctx);
^
477. if (T == NULL)
478. goto err;
crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
200. }
201.
202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
203. {
204. BIGNUM *ret;
crypto/bn/bn_gcd.c:504:18: Call
502. bn_init(&local_B);
503. BN_with_flags(&local_B, B, BN_FLG_CONSTTIME);
504. if (!BN_nnmod(B, &local_B, A, ctx))
^
505. goto err;
506. /* Ensure local_B goes out of scope before any further use of B */
crypto/bn/bn_mod.c:13:1: Parameter `ctx->stack.depth`
11. #include "bn_lcl.h"
12.
13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
14. {
15. /*
crypto/bn/bn_mod.c:20:11: Call
18. */
19.
20. if (!(BN_mod(r, m, d, ctx)))
^
21. return 0;
22. if (!r->neg)
crypto/bn/bn_div.c:209:1: Parameter `ctx->stack.depth`
207. * If 'dv' or 'rm' is NULL, the respective value is not returned.
208. */
209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
210. BN_CTX *ctx)
211. {
crypto/bn/bn_div.c:229:11: Call
227. }
228.
229. ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
^
230.
231. if (ret) {
crypto/bn/bn_div.c:280:5: Call
278. bn_check_top(rm);
279.
280. BN_CTX_start(ctx);
^
281. res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
282. tmp = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_div.c:450:5: Call
448. if (rm != NULL)
449. bn_rshift_fixed_top(rm, snum, norm_shift);
450. BN_CTX_end(ctx);
^
451. return 1;
452. err:
crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/bn/bn_ctx.c:191:27: Call
189. ctx->err_stack--;
190. else {
191. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
192. /* Does this stack frame have anything to release? */
193. if (fp < ctx->used)
crypto/bn/bn_ctx.c:266:1: <Offset trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: <Length trace>
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:266:1: Parameter `*st->indexes`
264. }
265.
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:268:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set_locked`
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_43716
|
static void run_cert(X509 *crt, const char *nameincert,
const struct set_name_fn *fn)
{
const char *const *pname = names;
while (*pname) {
int samename = strcasecmp(nameincert, *pname) == 0;
size_t namelen = strlen(*pname);
char *name = malloc(namelen);
int match, ret;
memcpy(name, *pname, namelen);
ret = X509_check_host(crt, name, namelen, 0, NULL);
match = -1;
if (ret < 0) {
fprintf(stderr, "internal error in X509_check_host");
++errors;
} else if (fn->host) {
if (ret == 1 && !samename)
match = 1;
if (ret == 0 && samename)
match = 0;
} else if (ret == 1)
match = 1;
check_message(fn, "host", nameincert, match, *pname);
ret = X509_check_host(crt, name, namelen,
X509_CHECK_FLAG_NO_WILDCARDS, NULL);
match = -1;
if (ret < 0) {
fprintf(stderr, "internal error in X509_check_host");
++errors;
} else if (fn->host) {
if (ret == 1 && !samename)
match = 1;
if (ret == 0 && samename)
match = 0;
} else if (ret == 1)
match = 1;
check_message(fn, "host-no-wildcards", nameincert, match, *pname);
ret = X509_check_email(crt, name, namelen, 0);
match = -1;
if (fn->email) {
if (ret && !samename)
match = 1;
if (!ret && samename && strchr(nameincert, '@') != NULL)
match = 0;
} else if (ret)
match = 1;
check_message(fn, "email", nameincert, match, *pname);
++pname;
free(name);
}
}
test/v3nametest.c:278: error: NULL_DEREFERENCE
pointer `name` last assigned on line 276 could be null and is dereferenced by call to `memcpy()` at line 278, column 9.
Showing all 8 steps of the trace
test/v3nametest.c:269:1: start of procedure run_cert()
267. }
268.
269. > static void run_cert(X509 *crt, const char *nameincert,
270. const struct set_name_fn *fn)
271. {
test/v3nametest.c:272:5:
270. const struct set_name_fn *fn)
271. {
272. > const char *const *pname = names;
273. while (*pname) {
274. int samename = strcasecmp(nameincert, *pname) == 0;
test/v3nametest.c:273:12: Loop condition is true. Entering loop body
271. {
272. const char *const *pname = names;
273. while (*pname) {
^
274. int samename = strcasecmp(nameincert, *pname) == 0;
275. size_t namelen = strlen(*pname);
test/v3nametest.c:274:24: Condition is false
272. const char *const *pname = names;
273. while (*pname) {
274. int samename = strcasecmp(nameincert, *pname) == 0;
^
275. size_t namelen = strlen(*pname);
276. char *name = malloc(namelen);
test/v3nametest.c:274:9:
272. const char *const *pname = names;
273. while (*pname) {
274. > int samename = strcasecmp(nameincert, *pname) == 0;
275. size_t namelen = strlen(*pname);
276. char *name = malloc(namelen);
test/v3nametest.c:275:9:
273. while (*pname) {
274. int samename = strcasecmp(nameincert, *pname) == 0;
275. > size_t namelen = strlen(*pname);
276. char *name = malloc(namelen);
277. int match, ret;
test/v3nametest.c:276:9:
274. int samename = strcasecmp(nameincert, *pname) == 0;
275. size_t namelen = strlen(*pname);
276. > char *name = malloc(namelen);
277. int match, ret;
278. memcpy(name, *pname, namelen);
test/v3nametest.c:278:9:
276. char *name = malloc(namelen);
277. int match, ret;
278. > memcpy(name, *pname, namelen);
279.
280. ret = X509_check_host(crt, name, namelen, 0, NULL);
|
https://github.com/openssl/openssl/blob/25be7a0feacdbd3326774f0da8aaeb966c1f57f8/test/v3nametest.c/#L278
|
d2a_code_trace_data_43717
|
static int query_formats(AVFilterContext *ctx)
{
AVFilterLink *inlink = ctx->inputs[0];
AVFilterLink *outlink = ctx->outputs[0];
AVFilterFormats *in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
AVFilterFormats *out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
AVFilterFormats *in_samplerates = ff_all_samplerates();
AVFilterFormats *out_samplerates = ff_all_samplerates();
AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts();
AVFilterChannelLayouts *out_layouts = ff_all_channel_layouts();
ff_formats_ref(in_formats, &inlink->out_formats);
ff_formats_ref(out_formats, &outlink->in_formats);
ff_formats_ref(in_samplerates, &inlink->out_samplerates);
ff_formats_ref(out_samplerates, &outlink->in_samplerates);
ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts);
ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts);
return 0;
}
libavfilter/af_resample.c:102: error: Null Dereference
pointer `in_formats` last assigned on line 95 could be null and is dereferenced by call to `ff_formats_ref()` at line 102, column 5.
libavfilter/af_resample.c:90:1: start of procedure query_formats()
88. }
89.
90. static int query_formats(AVFilterContext *ctx)
^
91. {
92. AVFilterLink *inlink = ctx->inputs[0];
libavfilter/af_resample.c:92:5:
90. static int query_formats(AVFilterContext *ctx)
91. {
92. AVFilterLink *inlink = ctx->inputs[0];
^
93. AVFilterLink *outlink = ctx->outputs[0];
94.
libavfilter/af_resample.c:93:5:
91. {
92. AVFilterLink *inlink = ctx->inputs[0];
93. AVFilterLink *outlink = ctx->outputs[0];
^
94.
95. AVFilterFormats *in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
libavfilter/af_resample.c:95:5:
93. AVFilterLink *outlink = ctx->outputs[0];
94.
95. AVFilterFormats *in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
^
96. AVFilterFormats *out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
97. AVFilterFormats *in_samplerates = ff_all_samplerates();
libavfilter/formats.c:218:1: start of procedure ff_all_formats()
216. }
217.
218. AVFilterFormats *ff_all_formats(enum AVMediaType type)
^
219. {
220. AVFilterFormats *ret = NULL;
libavfilter/formats.c:220:5:
218. AVFilterFormats *ff_all_formats(enum AVMediaType type)
219. {
220. AVFilterFormats *ret = NULL;
^
221.
222. if (type == AVMEDIA_TYPE_VIDEO) {
libavfilter/formats.c:222:9: Taking false branch
220. AVFilterFormats *ret = NULL;
221.
222. if (type == AVMEDIA_TYPE_VIDEO) {
^
223. const AVPixFmtDescriptor *desc = NULL;
224. while ((desc = av_pix_fmt_desc_next(desc))) {
libavfilter/formats.c:227:16: Taking true branch
225. ff_add_format(&ret, av_pix_fmt_desc_get_id(desc));
226. }
227. } else if (type == AVMEDIA_TYPE_AUDIO) {
^
228. enum AVSampleFormat fmt = 0;
229. while (av_get_sample_fmt_name(fmt)) {
libavfilter/formats.c:228:9:
226. }
227. } else if (type == AVMEDIA_TYPE_AUDIO) {
228. enum AVSampleFormat fmt = 0;
^
229. while (av_get_sample_fmt_name(fmt)) {
230. ff_add_format(&ret, fmt);
libavfilter/formats.c:229:16:
227. } else if (type == AVMEDIA_TYPE_AUDIO) {
228. enum AVSampleFormat fmt = 0;
229. while (av_get_sample_fmt_name(fmt)) {
^
230. ff_add_format(&ret, fmt);
231. fmt++;
libavutil/samplefmt.c:47:1: start of procedure av_get_sample_fmt_name()
45. };
46.
47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
^
48. {
49. if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
libavutil/samplefmt.c:49:9: Taking false branch
47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
48. {
49. if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
^
50. return NULL;
51. return sample_fmt_info[sample_fmt].name;
libavutil/samplefmt.c:49:27: Taking false branch
47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
48. {
49. if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
^
50. return NULL;
51. return sample_fmt_info[sample_fmt].name;
libavutil/samplefmt.c:51:5:
49. if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
50. return NULL;
51. return sample_fmt_info[sample_fmt].name;
^
52. }
53.
libavutil/samplefmt.c:52:1: return from a call to av_get_sample_fmt_name
50. return NULL;
51. return sample_fmt_info[sample_fmt].name;
52. }
^
53.
54. enum AVSampleFormat av_get_sample_fmt(const char *name)
libavfilter/formats.c:229:16: Loop condition is false. Leaving loop
227. } else if (type == AVMEDIA_TYPE_AUDIO) {
228. enum AVSampleFormat fmt = 0;
229. while (av_get_sample_fmt_name(fmt)) {
^
230. ff_add_format(&ret, fmt);
231. fmt++;
libavfilter/formats.c:235:5:
233. }
234.
235. return ret;
^
236. }
237.
libavfilter/formats.c:236:1: return from a call to ff_all_formats
234.
235. return ret;
236. }
^
237.
238. AVFilterFormats *ff_planar_sample_fmts(void)
libavfilter/af_resample.c:96:5:
94.
95. AVFilterFormats *in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
96. AVFilterFormats *out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
^
97. AVFilterFormats *in_samplerates = ff_all_samplerates();
98. AVFilterFormats *out_samplerates = ff_all_samplerates();
libavfilter/formats.c:218:1: start of procedure ff_all_formats()
216. }
217.
218. AVFilterFormats *ff_all_formats(enum AVMediaType type)
^
219. {
220. AVFilterFormats *ret = NULL;
libavfilter/formats.c:220:5:
218. AVFilterFormats *ff_all_formats(enum AVMediaType type)
219. {
220. AVFilterFormats *ret = NULL;
^
221.
222. if (type == AVMEDIA_TYPE_VIDEO) {
libavfilter/formats.c:222:9: Taking false branch
220. AVFilterFormats *ret = NULL;
221.
222. if (type == AVMEDIA_TYPE_VIDEO) {
^
223. const AVPixFmtDescriptor *desc = NULL;
224. while ((desc = av_pix_fmt_desc_next(desc))) {
libavfilter/formats.c:227:16: Taking true branch
225. ff_add_format(&ret, av_pix_fmt_desc_get_id(desc));
226. }
227. } else if (type == AVMEDIA_TYPE_AUDIO) {
^
228. enum AVSampleFormat fmt = 0;
229. while (av_get_sample_fmt_name(fmt)) {
libavfilter/formats.c:228:9:
226. }
227. } else if (type == AVMEDIA_TYPE_AUDIO) {
228. enum AVSampleFormat fmt = 0;
^
229. while (av_get_sample_fmt_name(fmt)) {
230. ff_add_format(&ret, fmt);
libavfilter/formats.c:229:16:
227. } else if (type == AVMEDIA_TYPE_AUDIO) {
228. enum AVSampleFormat fmt = 0;
229. while (av_get_sample_fmt_name(fmt)) {
^
230. ff_add_format(&ret, fmt);
231. fmt++;
libavutil/samplefmt.c:47:1: start of procedure av_get_sample_fmt_name()
45. };
46.
47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
^
48. {
49. if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
libavutil/samplefmt.c:49:9: Taking false branch
47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
48. {
49. if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
^
50. return NULL;
51. return sample_fmt_info[sample_fmt].name;
libavutil/samplefmt.c:49:27: Taking false branch
47. const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
48. {
49. if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
^
50. return NULL;
51. return sample_fmt_info[sample_fmt].name;
libavutil/samplefmt.c:51:5:
49. if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
50. return NULL;
51. return sample_fmt_info[sample_fmt].name;
^
52. }
53.
libavutil/samplefmt.c:52:1: return from a call to av_get_sample_fmt_name
50. return NULL;
51. return sample_fmt_info[sample_fmt].name;
52. }
^
53.
54. enum AVSampleFormat av_get_sample_fmt(const char *name)
libavfilter/formats.c:229:16: Loop condition is false. Leaving loop
227. } else if (type == AVMEDIA_TYPE_AUDIO) {
228. enum AVSampleFormat fmt = 0;
229. while (av_get_sample_fmt_name(fmt)) {
^
230. ff_add_format(&ret, fmt);
231. fmt++;
libavfilter/formats.c:235:5:
233. }
234.
235. return ret;
^
236. }
237.
libavfilter/formats.c:236:1: return from a call to ff_all_formats
234.
235. return ret;
236. }
^
237.
238. AVFilterFormats *ff_planar_sample_fmts(void)
libavfilter/af_resample.c:97:5: Skipping ff_all_samplerates(): empty list of specs
95. AVFilterFormats *in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
96. AVFilterFormats *out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
97. AVFilterFormats *in_samplerates = ff_all_samplerates();
^
98. AVFilterFormats *out_samplerates = ff_all_samplerates();
99. AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts();
libavfilter/af_resample.c:98:5: Skipping ff_all_samplerates(): empty list of specs
96. AVFilterFormats *out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
97. AVFilterFormats *in_samplerates = ff_all_samplerates();
98. AVFilterFormats *out_samplerates = ff_all_samplerates();
^
99. AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts();
100. AVFilterChannelLayouts *out_layouts = ff_all_channel_layouts();
libavfilter/af_resample.c:99:5: Skipping ff_all_channel_layouts(): empty list of specs
97. AVFilterFormats *in_samplerates = ff_all_samplerates();
98. AVFilterFormats *out_samplerates = ff_all_samplerates();
99. AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts();
^
100. AVFilterChannelLayouts *out_layouts = ff_all_channel_layouts();
101.
libavfilter/af_resample.c:100:5: Skipping ff_all_channel_layouts(): empty list of specs
98. AVFilterFormats *out_samplerates = ff_all_samplerates();
99. AVFilterChannelLayouts *in_layouts = ff_all_channel_layouts();
100. AVFilterChannelLayouts *out_layouts = ff_all_channel_layouts();
^
101.
102. ff_formats_ref(in_formats, &inlink->out_formats);
libavfilter/af_resample.c:102:5:
100. AVFilterChannelLayouts *out_layouts = ff_all_channel_layouts();
101.
102. ff_formats_ref(in_formats, &inlink->out_formats);
^
103. ff_formats_ref(out_formats, &outlink->in_formats);
104.
libavfilter/formats.c:276:1: start of procedure ff_formats_ref()
274. }
275.
276. void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
^
277. {
278. FORMATS_REF(f, ref);
libavfilter/formats.c:278:5:
276. void ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
277. {
278. FORMATS_REF(f, ref);
^
279. }
280.
|
https://github.com/libav/libav/blob/83847cc8fa97e0fc637a0962bafb837acdb6eacc/libavfilter/af_resample.c/#L102
|
d2a_code_trace_data_43718
|
static int epzs_motion_search4(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int P[10][2],
int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d, dmin;
int map_generation;
const int penalty_factor= c->penalty_factor;
const int size=1;
const int h=8;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
int flags= c->flags;
LOAD_COMMON2
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
map_generation= update_map_generation(c);
dmin = 1000000;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
}else{
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}
if(dmin>64*4){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1174: error: Uninitialized Value
The value read from ymin was never initialized.
libavcodec/motion_est_template.c:1174:9:
1172. }
1173. if(dmin>64*4){
1174. CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
^
1175. (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
1176. if(s->mb_y+1<s->end_mb_y) //FIXME replace at least with last_slice_line
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1174
|
d2a_code_trace_data_43719
|
static int mp_decode_layer2(MPADecodeContext *s)
{
int sblimit;
const unsigned char *alloc_table;
int table, bit_alloc_bits, i, j, ch, bound, v;
unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT];
unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT];
unsigned char scale_factors[MPA_MAX_CHANNELS][SBLIMIT][3], *sf;
int scale, qindex, bits, steps, k, l, m, b;
table = ff_mpa_l2_select_table(s->bit_rate / 1000, s->nb_channels,
s->sample_rate, s->lsf);
sblimit = ff_mpa_sblimit_table[table];
alloc_table = ff_mpa_alloc_tables[table];
if (s->mode == MPA_JSTEREO)
bound = (s->mode_ext + 1) * 4;
else
bound = sblimit;
dprintf(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
if( bound > sblimit ) bound = sblimit;
j = 0;
for(i=0;i<bound;i++) {
bit_alloc_bits = alloc_table[j];
for(ch=0;ch<s->nb_channels;ch++) {
bit_alloc[ch][i] = get_bits(&s->gb, bit_alloc_bits);
}
j += 1 << bit_alloc_bits;
}
for(i=bound;i<sblimit;i++) {
bit_alloc_bits = alloc_table[j];
v = get_bits(&s->gb, bit_alloc_bits);
bit_alloc[0][i] = v;
bit_alloc[1][i] = v;
j += 1 << bit_alloc_bits;
}
#ifdef DEBUG
{
for(ch=0;ch<s->nb_channels;ch++) {
for(i=0;i<sblimit;i++)
dprintf(s->avctx, " %d", bit_alloc[ch][i]);
dprintf(s->avctx, "\n");
}
}
#endif
for(i=0;i<sblimit;i++) {
for(ch=0;ch<s->nb_channels;ch++) {
if (bit_alloc[ch][i])
scale_code[ch][i] = get_bits(&s->gb, 2);
}
}
for(i=0;i<sblimit;i++) {
for(ch=0;ch<s->nb_channels;ch++) {
if (bit_alloc[ch][i]) {
sf = scale_factors[ch][i];
switch(scale_code[ch][i]) {
default:
case 0:
sf[0] = get_bits(&s->gb, 6);
sf[1] = get_bits(&s->gb, 6);
sf[2] = get_bits(&s->gb, 6);
break;
case 2:
sf[0] = get_bits(&s->gb, 6);
sf[1] = sf[0];
sf[2] = sf[0];
break;
case 1:
sf[0] = get_bits(&s->gb, 6);
sf[2] = get_bits(&s->gb, 6);
sf[1] = sf[0];
break;
case 3:
sf[0] = get_bits(&s->gb, 6);
sf[2] = get_bits(&s->gb, 6);
sf[1] = sf[2];
break;
}
}
}
}
#ifdef DEBUG
for(ch=0;ch<s->nb_channels;ch++) {
for(i=0;i<sblimit;i++) {
if (bit_alloc[ch][i]) {
sf = scale_factors[ch][i];
dprintf(s->avctx, " %d %d %d", sf[0], sf[1], sf[2]);
} else {
dprintf(s->avctx, " -");
}
}
dprintf(s->avctx, "\n");
}
#endif
for(k=0;k<3;k++) {
for(l=0;l<12;l+=3) {
j = 0;
for(i=0;i<bound;i++) {
bit_alloc_bits = alloc_table[j];
for(ch=0;ch<s->nb_channels;ch++) {
b = bit_alloc[ch][i];
if (b) {
scale = scale_factors[ch][i][k];
qindex = alloc_table[j+b];
bits = ff_mpa_quant_bits[qindex];
if (bits < 0) {
v = get_bits(&s->gb, -bits);
steps = ff_mpa_quant_steps[qindex];
s->sb_samples[ch][k * 12 + l + 0][i] =
l2_unscale_group(steps, v % steps, scale);
v = v / steps;
s->sb_samples[ch][k * 12 + l + 1][i] =
l2_unscale_group(steps, v % steps, scale);
v = v / steps;
s->sb_samples[ch][k * 12 + l + 2][i] =
l2_unscale_group(steps, v, scale);
} else {
for(m=0;m<3;m++) {
v = get_bits(&s->gb, bits);
v = l1_unscale(bits - 1, v, scale);
s->sb_samples[ch][k * 12 + l + m][i] = v;
}
}
} else {
s->sb_samples[ch][k * 12 + l + 0][i] = 0;
s->sb_samples[ch][k * 12 + l + 1][i] = 0;
s->sb_samples[ch][k * 12 + l + 2][i] = 0;
}
}
j += 1 << bit_alloc_bits;
}
for(i=bound;i<sblimit;i++) {
bit_alloc_bits = alloc_table[j];
b = bit_alloc[0][i];
if (b) {
int mant, scale0, scale1;
scale0 = scale_factors[0][i][k];
scale1 = scale_factors[1][i][k];
qindex = alloc_table[j+b];
bits = ff_mpa_quant_bits[qindex];
if (bits < 0) {
v = get_bits(&s->gb, -bits);
steps = ff_mpa_quant_steps[qindex];
mant = v % steps;
v = v / steps;
s->sb_samples[0][k * 12 + l + 0][i] =
l2_unscale_group(steps, mant, scale0);
s->sb_samples[1][k * 12 + l + 0][i] =
l2_unscale_group(steps, mant, scale1);
mant = v % steps;
v = v / steps;
s->sb_samples[0][k * 12 + l + 1][i] =
l2_unscale_group(steps, mant, scale0);
s->sb_samples[1][k * 12 + l + 1][i] =
l2_unscale_group(steps, mant, scale1);
s->sb_samples[0][k * 12 + l + 2][i] =
l2_unscale_group(steps, v, scale0);
s->sb_samples[1][k * 12 + l + 2][i] =
l2_unscale_group(steps, v, scale1);
} else {
for(m=0;m<3;m++) {
mant = get_bits(&s->gb, bits);
s->sb_samples[0][k * 12 + l + m][i] =
l1_unscale(bits - 1, mant, scale0);
s->sb_samples[1][k * 12 + l + m][i] =
l1_unscale(bits - 1, mant, scale1);
}
}
} else {
s->sb_samples[0][k * 12 + l + 0][i] = 0;
s->sb_samples[0][k * 12 + l + 1][i] = 0;
s->sb_samples[0][k * 12 + l + 2][i] = 0;
s->sb_samples[1][k * 12 + l + 0][i] = 0;
s->sb_samples[1][k * 12 + l + 1][i] = 0;
s->sb_samples[1][k * 12 + l + 2][i] = 0;
}
j += 1 << bit_alloc_bits;
}
for(i=sblimit;i<SBLIMIT;i++) {
for(ch=0;ch<s->nb_channels;ch++) {
s->sb_samples[ch][k * 12 + l + 0][i] = 0;
s->sb_samples[ch][k * 12 + l + 1][i] = 0;
s->sb_samples[ch][k * 12 + l + 2][i] = 0;
}
}
}
}
return 3 * 12;
}
libavcodec/mpegaudiodec.c:1391: error: Buffer Overrun L2
Offset: [2, 37] Size: 36.
libavcodec/mpegaudiodec.c:1297:9: <Offset trace>
1295.
1296. /* samples */
1297. for(k=0;k<3;k++) {
^
1298. for(l=0;l<12;l+=3) {
1299. j = 0;
libavcodec/mpegaudiodec.c:1297:9: Assignment
1295.
1296. /* samples */
1297. for(k=0;k<3;k++) {
^
1298. for(l=0;l<12;l+=3) {
1299. j = 0;
libavcodec/mpegaudiodec.c:1189:1: <Length trace>
1187. }
1188.
1189. static int mp_decode_layer2(MPADecodeContext *s)
^
1190. {
1191. int sblimit; /* number of used subbands */
libavcodec/mpegaudiodec.c:1189:1: Parameter `s->sb_samples[*][*]`
1187. }
1188.
1189. static int mp_decode_layer2(MPADecodeContext *s)
^
1190. {
1191. int sblimit; /* number of used subbands */
libavcodec/mpegaudiodec.c:1391:21: Array access: Offset: [2, 37] Size: 36
1389. s->sb_samples[ch][k * 12 + l + 0][i] = 0;
1390. s->sb_samples[ch][k * 12 + l + 1][i] = 0;
1391. s->sb_samples[ch][k * 12 + l + 2][i] = 0;
^
1392. }
1393. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L1391
|
d2a_code_trace_data_43720
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/rsa/rsa_sp800_56b_check.c:60: error: INTEGER_OVERFLOW_L2
([0, 6+max(0, `ctx->stack.depth`)] - 1):unsigned32 by call to `BN_mod_mul`.
Showing all 35 steps of the trace
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:218:5: Call
216. ret = 1;
217. err:
218. BN_CTX_end(ctx);
^
219. return ret;
220. }
crypto/bn/bn_ctx.c:185:1: Parameter `ctx->stack.depth`
183. }
184.
185. > void BN_CTX_end(BN_CTX *ctx)
186. {
187. CTXDBG("ENTER BN_CTX_end()", ctx);
crypto/rsa/rsa_sp800_56b_check.c:60:14: Call
58. && BN_is_one(r)
59. /* (e) 1 = (dQ . e) mod (q - 1) */
60. && BN_mod_mul(r, rsa->dmq1, rsa->e, q1, ctx)
^
61. && BN_is_one(r)
62. /* (f) 1 = (qInv . q) mod p */
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:210:14: Call
208. goto err;
209. } else {
210. if (!BN_mul(t, a, b, ctx))
^
211. goto err;
212. }
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/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.depth`
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.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, 6+max(0, ctx->stack.depth)] - 1):unsigned32 by call to `BN_mod_mul`
266. static unsigned int BN_STACK_pop(BN_STACK *st)
267. {
268. return st->indexes[--(st->depth)];
^
269. }
270.
|
https://github.com/openssl/openssl/blob/fff684168c7923aa85e6b4381d71d933396e32b0/crypto/bn/bn_ctx.c/#L268
|
d2a_code_trace_data_43721
|
static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
const uint8_t *payload, int payload_size,
int64_t pts, int64_t dts)
{
MpegTSWriteStream *ts_st = st->priv_data;
uint8_t buf[TS_PACKET_SIZE];
uint8_t *q;
int val, is_start, len, header_len, write_pcr, private_code, flags;
int afc_len, stuffing_len;
int64_t pcr = -1;
is_start = 1;
while (payload_size > 0) {
retransmit_si_info(s);
write_pcr = 0;
if (ts_st->pid == ts_st->service->pcr_pid) {
ts_st->service->pcr_packet_count++;
if (ts_st->service->pcr_packet_count >=
ts_st->service->pcr_packet_freq) {
ts_st->service->pcr_packet_count = 0;
write_pcr = 1;
pcr = pts;
}
}
q = buf;
*q++ = 0x47;
val = (ts_st->pid >> 8);
if (is_start)
val |= 0x40;
*q++ = val;
*q++ = ts_st->pid;
*q++ = 0x10 | ts_st->cc | (write_pcr ? 0x20 : 0);
ts_st->cc = (ts_st->cc + 1) & 0xf;
if (write_pcr) {
*q++ = 7;
*q++ = 0x10;
*q++ = pcr >> 25;
*q++ = pcr >> 17;
*q++ = pcr >> 9;
*q++ = pcr >> 1;
*q++ = (pcr & 1) << 7;
*q++ = 0;
}
if (is_start) {
*q++ = 0x00;
*q++ = 0x00;
*q++ = 0x01;
private_code = 0;
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
*q++ = 0xe0;
} else if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
(st->codec->codec_id == CODEC_ID_MP2 ||
st->codec->codec_id == CODEC_ID_MP3)) {
*q++ = 0xc0;
} else {
*q++ = 0xbd;
if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) {
private_code = 0x20;
}
}
header_len = 0;
flags = 0;
if (pts != AV_NOPTS_VALUE) {
header_len += 5;
flags |= 0x80;
}
if (dts != AV_NOPTS_VALUE) {
header_len += 5;
flags |= 0x40;
}
len = payload_size + header_len + 3;
if (private_code != 0)
len++;
*q++ = len >> 8;
*q++ = len;
val = 0x80;
if (st->codec->codec_type == CODEC_TYPE_SUBTITLE)
val |= 0x04;
*q++ = val;
*q++ = flags;
*q++ = header_len;
if (pts != AV_NOPTS_VALUE) {
write_pts(q, flags >> 6, pts);
q += 5;
}
if (dts != AV_NOPTS_VALUE) {
write_pts(q, 1, dts);
q += 5;
}
if (private_code != 0)
*q++ = private_code;
is_start = 0;
}
header_len = q - buf;
len = TS_PACKET_SIZE - header_len;
if (len > payload_size)
len = payload_size;
stuffing_len = TS_PACKET_SIZE - header_len - len;
if (stuffing_len > 0) {
if (buf[3] & 0x20) {
afc_len = buf[4] + 1;
memmove(buf + 4 + afc_len + stuffing_len,
buf + 4 + afc_len,
header_len - (4 + afc_len));
buf[4] += stuffing_len;
memset(buf + 4 + afc_len, 0xff, stuffing_len);
} else {
memmove(buf + 4 + stuffing_len, buf + 4, header_len - 4);
buf[3] |= 0x20;
buf[4] = stuffing_len - 1;
if (stuffing_len >= 2) {
buf[5] = 0x00;
memset(buf + 6, 0xff, stuffing_len - 2);
}
}
}
memcpy(buf + TS_PACKET_SIZE - len, payload, len);
payload += len;
payload_size -= len;
put_buffer(s->pb, buf, TS_PACKET_SIZE);
}
put_flush_packet(s->pb);
}
libavformat/mpegtsenc.c:644: error: Buffer Overrun L2
Offset added: [5, 371] (⇐ [4, 187] + [1, 184]) Size: 188 by call to `mpegts_write_pes`.
libavformat/mpegtsenc.c:616:1: Parameter `pkt->pts`
614. }
615.
616. static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
^
617. {
618. AVStream *st = s->streams[pkt->stream_index];
libavformat/mpegtsenc.c:640:13: Assignment
638. ts_st->payload_index += len;
639. if (ts_st->payload_pts == AV_NOPTS_VALUE)
640. ts_st->payload_pts = pkt->pts;
^
641. if (ts_st->payload_dts == AV_NOPTS_VALUE)
642. ts_st->payload_dts = pkt->dts;
libavformat/mpegtsenc.c:644:13: Call
642. ts_st->payload_dts = pkt->dts;
643. if (ts_st->payload_index >= max_payload_size) {
644. mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_index,
^
645. ts_st->payload_pts, ts_st->payload_dts);
646. ts_st->payload_pts = AV_NOPTS_VALUE;
libavformat/mpegtsenc.c:480:1: <Offset trace>
478.
479. /* NOTE: pes_data contains all the PES packet */
480. static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
^
481. const uint8_t *payload, int payload_size,
482. int64_t pts, int64_t dts)
libavformat/mpegtsenc.c:480:1: Parameter `payload_size`
478.
479. /* NOTE: pes_data contains all the PES packet */
480. static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
^
481. const uint8_t *payload, int payload_size,
482. int64_t pts, int64_t dts)
libavformat/mpegtsenc.c:480:1: <Length trace>
478.
479. /* NOTE: pes_data contains all the PES packet */
480. static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
^
481. const uint8_t *payload, int payload_size,
482. int64_t pts, int64_t dts)
libavformat/mpegtsenc.c:480:1: Array declaration
478.
479. /* NOTE: pes_data contains all the PES packet */
480. static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
^
481. const uint8_t *payload, int payload_size,
482. int64_t pts, int64_t dts)
libavformat/mpegtsenc.c:608:9: Array access: Offset added: [5, 371] (⇐ [4, 187] + [1, 184]) Size: 188 by call to `mpegts_write_pes`
606. }
607. }
608. memcpy(buf + TS_PACKET_SIZE - len, payload, len);
^
609. payload += len;
610. payload_size -= len;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/mpegtsenc.c/#L608
|
d2a_code_trace_data_43722
|
ngx_pool_t *
ngx_create_pool(size_t size, ngx_log_t *log)
{
ngx_pool_t *p;
p = ngx_alloc(size, log);
if (p == NULL) {
return NULL;
}
p->d.last = (u_char *) p + sizeof(ngx_pool_t);
p->d.end = (u_char *) p + size;
p->d.next = NULL;
size = size - sizeof(ngx_pool_t);
p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;
p->current = p;
p->chain = NULL;
p->large = NULL;
p->cleanup = NULL;
p->log = log;
return p;
}
src/http/ngx_http.c:1441: error: Integer Overflow L2
([0, +oo] - 1):unsigned64 by call to `ngx_create_pool`.
src/http/ngx_http.c:1441:20: Call
1439. ngx_memzero(&ha, sizeof(ngx_hash_keys_arrays_t));
1440.
1441. ha.temp_pool = ngx_create_pool(16384, cf->log);
^
1442. if (ha.temp_pool == NULL) {
1443. return NGX_ERROR;
src/core/ngx_palloc.c:15:1: <LHS trace>
13.
14.
15. ngx_pool_t *
^
16. ngx_create_pool(size_t size, ngx_log_t *log)
17. {
src/core/ngx_palloc.c:15:1: Global `ngx_pagesize`
13.
14.
15. ngx_pool_t *
^
16. ngx_create_pool(size_t size, ngx_log_t *log)
17. {
src/core/ngx_palloc.c:30:15: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_create_pool`
28.
29. size = size - sizeof(ngx_pool_t);
30. p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;
^
31.
32. p->current = p;
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_palloc.c/#L30
|
d2a_code_trace_data_43723
|
static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
{
unsigned char *buf = NULL;
int ret = 0, bit, bytes, mask;
time_t tim;
if (bits == 0) {
if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
goto toosmall;
BN_zero(rnd);
return 1;
}
if (bits < 0 || (bits == 1 && top > 0))
goto toosmall;
bytes = (bits + 7) / 8;
bit = (bits - 1) % 8;
mask = 0xff << (bit + 1);
buf = OPENSSL_malloc(bytes);
if (buf == NULL) {
BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
goto err;
}
time(&tim);
RAND_add(&tim, sizeof(tim), 0.0);
if (RAND_bytes(buf, bytes) <= 0)
goto err;
if (pseudorand == 2) {
int i;
unsigned char c;
for (i = 0; i < bytes; i++) {
if (RAND_bytes(&c, 1) <= 0)
goto err;
if (c >= 128 && i > 0)
buf[i] = buf[i - 1];
else if (c < 42)
buf[i] = 0;
else if (c < 84)
buf[i] = 255;
}
}
if (top >= 0) {
if (top) {
if (bit == 0) {
buf[0] = 1;
buf[1] |= 0x80;
} else {
buf[0] |= (3 << (bit - 1));
}
} else {
buf[0] |= (1 << bit);
}
}
buf[0] &= ~mask;
if (bottom)
buf[bytes - 1] |= 1;
if (!BN_bin2bn(buf, bytes, rnd))
goto err;
ret = 1;
err:
OPENSSL_clear_free(buf, bytes);
bn_check_top(rnd);
return (ret);
toosmall:
BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL);
return 0;
}
test/bntest.c:1934: error: BUFFER_OVERRUN_L3
Offset: [-1, 206] Size: [1, 207] by call to `BN_bntest_rand`.
Showing all 12 steps of the trace
test/bntest.c:1934:9: Call
1932. else {
1933. a = BN_new();
1934. BN_bntest_rand(a, 200, 0, 0);
^
1935. a->neg = rand_neg();
1936. }
crypto/bn/bn_rand.c:106:1: Parameter `bits`
104. }
105.
106. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(2, rnd, bits, top, bottom);
crypto/bn/bn_rand.c:108:12: Call
106. int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(2, rnd, bits, top, bottom);
^
109. }
110.
crypto/bn/bn_rand.c:56:14: <Offset trace>
54. unsigned char c;
55.
56. for (i = 0; i < bytes; i++) {
^
57. if (RAND_bytes(&c, 1) <= 0)
58. goto err;
crypto/bn/bn_rand.c:56:14: Assignment
54. unsigned char c;
55.
56. for (i = 0; i < bytes; i++) {
^
57. if (RAND_bytes(&c, 1) <= 0)
58. goto err;
crypto/bn/bn_rand.c:17:1: <Length trace>
15. #include <openssl/sha.h>
16.
17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
18. {
19. unsigned char *buf = NULL;
crypto/bn/bn_rand.c:17:1: Parameter `bits`
15. #include <openssl/sha.h>
16.
17. > static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
18. {
19. unsigned char *buf = NULL;
crypto/bn/bn_rand.c:32:5: Assignment
30. goto toosmall;
31.
32. bytes = (bits + 7) / 8;
^
33. bit = (bits - 1) % 8;
34. mask = 0xff << (bit + 1);
crypto/bn/bn_rand.c:36:11: Call
34. mask = 0xff << (bit + 1);
35.
36. buf = OPENSSL_malloc(bytes);
^
37. if (buf == NULL) {
38. BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
crypto/mem.c:79:9: Assignment
77.
78. if (num <= 0)
79. return NULL;
^
80.
81. allow_customize = 0;
crypto/bn/bn_rand.c:36:5: Assignment
34. mask = 0xff << (bit + 1);
35.
36. buf = OPENSSL_malloc(bytes);
^
37. if (buf == NULL) {
38. BNerr(BN_F_BNRAND, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_rand.c:82:9: Array access: Offset: [-1, 206] Size: [1, 207] by call to `BN_bntest_rand`
80. buf[0] &= ~mask;
81. if (bottom) /* set bottom bit if requested */
82. buf[bytes - 1] |= 1;
^
83. if (!BN_bin2bn(buf, bytes, rnd))
84. goto err;
|
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_rand.c/#L82
|
d2a_code_trace_data_43724
|
static void av_always_inline filter_mb_edgeh( uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h ) {
const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;
const int alpha = alpha_table[index_a];
const int beta = beta_table[qp - qp_bd_offset + h->slice_beta_offset];
if (alpha ==0 || beta == 0) return;
if( bS[0] < 4 ) {
int8_t tc[4];
tc[0] = tc0_table[index_a][bS[0]];
tc[1] = tc0_table[index_a][bS[1]];
tc[2] = tc0_table[index_a][bS[2]];
tc[3] = tc0_table[index_a][bS[3]];
h->h264dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);
} else {
h->h264dsp.h264_v_loop_filter_luma_intra(pix, stride, alpha, beta);
}
}
libavcodec/h264_loopfilter.c:260: error: Buffer Overrun L2
Offset: [3, 4] Size: 4 by call to `filter_mb_edgeh`.
libavcodec/h264_loopfilter.c:251:39: Assignment
249. if( IS_INTRA(mb_type) ) {
250. static const int16_t bS4[4] = {4,4,4,4};
251. static const int16_t bS3[4] = {3,3,3,3};
^
252. const int16_t *bSH = FIELD_PICTURE ? bS3 : bS4;
253. if(left_type)
libavcodec/h264_loopfilter.c:260:13: Call
258. filter_mb_edgeh( &img_y[4*0*linesize], linesize, bSH, qp1, h);
259. }
260. filter_mb_edgeh( &img_y[4*2*linesize], linesize, bS3, qp, h);
^
261. } else {
262. filter_mb_edgev( &img_y[4*1], linesize, bS3, qp, h);
libavcodec/h264_loopfilter.c:177:1: <Offset trace>
175. }
176.
177. static void av_always_inline filter_mb_edgeh( uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h ) {
^
178. const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
179. const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;
libavcodec/h264_loopfilter.c:177:1: Parameter `*bS`
175. }
176.
177. static void av_always_inline filter_mb_edgeh( uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h ) {
^
178. const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
179. const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;
libavcodec/h264_loopfilter.c:73:1: <Length trace>
71. 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
72. };
73. static const uint8_t tc0_table[52*3][4] = {
^
74. {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
75. {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
libavcodec/h264_loopfilter.c:73:1: Array declaration
71. 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
72. };
73. static const uint8_t tc0_table[52*3][4] = {
^
74. {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
75. {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 }, {-1, 0, 0, 0 },
libavcodec/h264_loopfilter.c:186:17: Array access: Offset: [3, 4] Size: 4 by call to `filter_mb_edgeh`
184. if( bS[0] < 4 ) {
185. int8_t tc[4];
186. tc[0] = tc0_table[index_a][bS[0]];
^
187. tc[1] = tc0_table[index_a][bS[1]];
188. tc[2] = tc0_table[index_a][bS[2]];
|
https://github.com/libav/libav/blob/ecf026f1aa8ffe170b5b8c577cae56a405ebafc8/libavcodec/h264_loopfilter.c/#L186
|
d2a_code_trace_data_43725
|
int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
{
EVP_CIPHER_CTX *ctx;
unsigned char iv[EVP_MAX_IV_LENGTH];
size_t ivlen, taglen, offset, loop;
unsigned char *staticiv;
unsigned char *seq;
int lenu, lenf;
SSL3_RECORD *rec = &recs[0];
uint32_t alg_enc;
if (n_recs != 1) {
return -1;
}
if (send) {
ctx = s->enc_write_ctx;
staticiv = s->write_iv;
seq = RECORD_LAYER_get_write_sequence(&s->rlayer);
} else {
ctx = s->enc_read_ctx;
staticiv = s->read_iv;
seq = RECORD_LAYER_get_read_sequence(&s->rlayer);
}
if (ctx == NULL) {
memmove(rec->data, rec->input, rec->length);
rec->input = rec->data;
return 1;
}
ivlen = EVP_CIPHER_CTX_iv_length(ctx);
if (s->early_data_state == SSL_EARLY_DATA_WRITING) {
alg_enc = s->session->cipher->algorithm_enc;
} else {
assert(s->s3->tmp.new_cipher != NULL);
if (s->s3->tmp.new_cipher == NULL)
return -1;
alg_enc = s->s3->tmp.new_cipher->algorithm_enc;
}
if (alg_enc & SSL_AESCCM) {
if (alg_enc & (SSL_AES128CCM8 | SSL_AES256CCM8))
taglen = EVP_CCM8_TLS_TAG_LEN;
else
taglen = EVP_CCM_TLS_TAG_LEN;
if (send && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, taglen,
NULL) <= 0)
return -1;
} else if (alg_enc & SSL_AESGCM) {
taglen = EVP_GCM_TLS_TAG_LEN;
} else if (alg_enc & SSL_CHACHA20) {
taglen = EVP_CHACHAPOLY_TLS_TAG_LEN;
} else {
return -1;
}
if (!send) {
if (rec->length < taglen + 1)
return 0;
rec->length -= taglen;
}
if (ivlen < SEQ_NUM_SIZE) {
return -1;
}
offset = ivlen - SEQ_NUM_SIZE;
memcpy(iv, staticiv, offset);
for (loop = 0; loop < SEQ_NUM_SIZE; loop++)
iv[offset + loop] = staticiv[offset + loop] ^ seq[loop];
for (loop = SEQ_NUM_SIZE; loop > 0; loop--) {
++seq[loop - 1];
if (seq[loop - 1] != 0)
break;
}
if (loop == 0) {
return -1;
}
if (EVP_CipherInit_ex(ctx, NULL, NULL, NULL, iv, send) <= 0
|| (!send && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
taglen,
rec->data + rec->length) <= 0)
|| EVP_CipherUpdate(ctx, rec->data, &lenu, rec->input,
(unsigned int)rec->length) <= 0
|| EVP_CipherFinal_ex(ctx, rec->data + lenu, &lenf) <= 0
|| (size_t)(lenu + lenf) != rec->length) {
return -1;
}
if (send) {
if (EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_GET_TAG, taglen,
rec->data + rec->length) <= 0)
return -1;
rec->length += taglen;
}
return 1;
}
ssl/record/rec_layer_s3.c:895: error: INTEGER_OVERFLOW_L2
([9, +oo] - [8, 16]):unsigned64 by call to `tls13_enc`.
Showing all 8 steps of the trace
ssl/record/rec_layer_s3.c:608:1: Parameter `*pipelens`
606. }
607.
608. > int do_ssl3_write(SSL *s, int type, const unsigned char *buf,
609. size_t *pipelens, size_t numpipes,
610. int create_empty_fragment, size_t *written)
ssl/record/rec_layer_s3.c:811:9: Assignment
809. /* lets setup the record stuff. */
810. SSL3_RECORD_set_data(thiswr, compressdata);
811. SSL3_RECORD_set_length(thiswr, pipelens[j]);
^
812. SSL3_RECORD_set_input(thiswr, (unsigned char *)&buf[totlen]);
813. totlen += pipelens[j];
ssl/record/rec_layer_s3.c:895:13: Call
893. * send early data - so we need to use the the tls13enc function.
894. */
895. if (tls13_enc(s, wr, numpipes, 1) < 1)
^
896. goto err;
897. } else {
ssl/record/ssl3_record_tls13.c:24:1: <LHS trace>
22. * an internal error occurred.
23. */
24. > int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
25. {
26. EVP_CIPHER_CTX *ctx;
ssl/record/ssl3_record_tls13.c:24:1: Parameter `recs->length`
22. * an internal error occurred.
23. */
24. > int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
25. {
26. EVP_CIPHER_CTX *ctx;
ssl/record/ssl3_record_tls13.c:24:1: <RHS trace>
22. * an internal error occurred.
23. */
24. > int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
25. {
26. EVP_CIPHER_CTX *ctx;
ssl/record/ssl3_record_tls13.c:24:1: Parameter `recs->length`
22. * an internal error occurred.
23. */
24. > int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int send)
25. {
26. EVP_CIPHER_CTX *ctx;
ssl/record/ssl3_record_tls13.c:95:9: Binary operation: ([9, +oo] - [8, 16]):unsigned64 by call to `tls13_enc`
93. if (rec->length < taglen + 1)
94. return 0;
95. rec->length -= taglen;
^
96. }
97.
|
https://github.com/openssl/openssl/blob/538bea6c8184670a8d1608ef288a4e1813dcefa6/ssl/record/ssl3_record_tls13.c/#L95
|
d2a_code_trace_data_43726
|
static void put_ebml_void(ByteIOContext *pb, uint64_t size)
{
offset_t currentpos = url_ftell(pb);
assert(size >= 2);
put_ebml_id(pb, EBML_ID_VOID);
if (size < 10)
put_ebml_num(pb, size-1, 0);
else
put_ebml_num(pb, size-9, 8);
while(url_ftell(pb) < currentpos + size)
put_byte(pb, 0);
}
libavformat/matroskaenc.c:794: error: Integer Overflow L2
([0, 9] - 1):unsigned64 by call to `mkv_write_seekhead`.
libavformat/matroskaenc.c:792:15: Call
790. ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES , cuespos);
791. if (ret < 0) return ret;
792. ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_SEEKHEAD, second_seekhead);
^
793. if (ret < 0) return ret;
794. mkv_write_seekhead(pb, mkv->main_seekhead);
libavformat/matroskaenc.c:266:1: Parameter `seekhead->entries->segmentpos`
264. }
265.
266. static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos)
^
267. {
268. mkv_seekhead_entry *entries = seekhead->entries;
libavformat/matroskaenc.c:794:9: Call
792. ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_SEEKHEAD, second_seekhead);
793. if (ret < 0) return ret;
794. mkv_write_seekhead(pb, mkv->main_seekhead);
^
795.
796. // update the duration
libavformat/matroskaenc.c:293:1: Parameter `seekhead->filepos`
291. * @return The file offset where the seekhead was written.
292. */
293. static offset_t mkv_write_seekhead(ByteIOContext *pb, mkv_seekhead *seekhead)
^
294. {
295. ebml_master metaseek, seekentry;
libavformat/matroskaenc.c:320:9: Assignment
318.
319. if (seekhead->reserved_size > 0) {
320. uint64_t remaining = seekhead->filepos + seekhead->reserved_size - url_ftell(pb);
^
321. put_ebml_void(pb, remaining);
322. url_fseek(pb, currentpos, SEEK_SET);
libavformat/matroskaenc.c:321:9: Call
319. if (seekhead->reserved_size > 0) {
320. uint64_t remaining = seekhead->filepos + seekhead->reserved_size - url_ftell(pb);
321. put_ebml_void(pb, remaining);
^
322. url_fseek(pb, currentpos, SEEK_SET);
323.
libavformat/matroskaenc.c:188:1: <LHS trace>
186. * @param size The number of bytes to reserve, which must be at least 2.
187. */
188. static void put_ebml_void(ByteIOContext *pb, uint64_t size)
^
189. {
190. offset_t currentpos = url_ftell(pb);
libavformat/matroskaenc.c:188:1: Parameter `size`
186. * @param size The number of bytes to reserve, which must be at least 2.
187. */
188. static void put_ebml_void(ByteIOContext *pb, uint64_t size)
^
189. {
190. offset_t currentpos = url_ftell(pb);
libavformat/matroskaenc.c:199:9: Binary operation: ([0, 9] - 1):unsigned64 by call to `mkv_write_seekhead`
197. // size if possible, 1 byte otherwise
198. if (size < 10)
199. put_ebml_num(pb, size-1, 0);
^
200. else
201. put_ebml_num(pb, size-9, 8);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/matroskaenc.c/#L199
|
d2a_code_trace_data_43727
|
static void filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) {
MpegEncContext * const s = &h->s;
const int mb_xy= mb_x + mb_y*s->mb_stride;
const int mb_type = s->current_picture.mb_type[mb_xy];
const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;
int first_vertical_edge_done = 0;
int dir;
static const int ref2frm[34] = {-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
if(!FRAME_MBAFF){
int qp_thresh = 15 - h->slice_alpha_c0_offset - FFMAX(0, FFMAX(h->pps.chroma_qp_index_offset[0], h->pps.chroma_qp_index_offset[1]));
int qp = s->current_picture.qscale_table[mb_xy];
if(qp <= qp_thresh
&& (mb_x == 0 || ((qp + s->current_picture.qscale_table[mb_xy-1] + 1)>>1) <= qp_thresh)
&& (mb_y == 0 || ((qp + s->current_picture.qscale_table[h->top_mb_xy] + 1)>>1) <= qp_thresh)){
return;
}
}
if (FRAME_MBAFF
&& h->slice_table[mb_xy-1] != 255
&& (IS_INTERLACED(mb_type) != IS_INTERLACED(s->current_picture.mb_type[mb_xy-1]))
&& (h->deblocking_filter!=2 || h->slice_table[mb_xy-1] == h->slice_table[mb_xy])) {
const int pair_xy = mb_x + (mb_y&~1)*s->mb_stride;
const int left_mb_xy[2] = { pair_xy-1, pair_xy-1+s->mb_stride };
int16_t bS[8];
int qp[2];
int bqp[2];
int rqp[2];
int mb_qp, mbn0_qp, mbn1_qp;
int i;
first_vertical_edge_done = 1;
if( IS_INTRA(mb_type) )
bS[0] = bS[1] = bS[2] = bS[3] = bS[4] = bS[5] = bS[6] = bS[7] = 4;
else {
for( i = 0; i < 8; i++ ) {
int mbn_xy = MB_FIELD ? left_mb_xy[i>>2] : left_mb_xy[i&1];
if( IS_INTRA( s->current_picture.mb_type[mbn_xy] ) )
bS[i] = 4;
else if( h->non_zero_count_cache[12+8*(i>>1)] != 0 ||
h->non_zero_count[mbn_xy][MB_FIELD ? i&3 : (i>>2)+(mb_y&1)*2] )
bS[i] = 2;
else
bS[i] = 1;
}
}
mb_qp = s->current_picture.qscale_table[mb_xy];
mbn0_qp = s->current_picture.qscale_table[left_mb_xy[0]];
mbn1_qp = s->current_picture.qscale_table[left_mb_xy[1]];
qp[0] = ( mb_qp + mbn0_qp + 1 ) >> 1;
bqp[0] = ( get_chroma_qp( h, 0, mb_qp ) +
get_chroma_qp( h, 0, mbn0_qp ) + 1 ) >> 1;
rqp[0] = ( get_chroma_qp( h, 1, mb_qp ) +
get_chroma_qp( h, 1, mbn0_qp ) + 1 ) >> 1;
qp[1] = ( mb_qp + mbn1_qp + 1 ) >> 1;
bqp[1] = ( get_chroma_qp( h, 0, mb_qp ) +
get_chroma_qp( h, 0, mbn1_qp ) + 1 ) >> 1;
rqp[1] = ( get_chroma_qp( h, 1, mb_qp ) +
get_chroma_qp( h, 1, mbn1_qp ) + 1 ) >> 1;
tprintf(s->avctx, "filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize);
{ int i; for (i = 0; i < 8; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); }
filter_mb_mbaff_edgev ( h, &img_y [0], linesize, bS, qp );
filter_mb_mbaff_edgecv( h, &img_cb[0], uvlinesize, bS, bqp );
filter_mb_mbaff_edgecv( h, &img_cr[0], uvlinesize, bS, rqp );
}
for( dir = 0; dir < 2; dir++ )
{
int edge;
const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy;
const int mbm_type = s->current_picture.mb_type[mbm_xy];
int start = h->slice_table[mbm_xy] == 255 ? 1 : 0;
const int edges = (mb_type & (MB_TYPE_16x16|MB_TYPE_SKIP))
== (MB_TYPE_16x16|MB_TYPE_SKIP) ? 1 : 4;
const int mask_edge = (mb_type & (MB_TYPE_16x16 | (MB_TYPE_16x8 << dir))) ? 3 :
(mb_type & (MB_TYPE_8x16 >> dir)) ? 1 : 0;
const int mask_par0 = mb_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir));
if (first_vertical_edge_done) {
start = 1;
first_vertical_edge_done = 0;
}
if (h->deblocking_filter==2 && h->slice_table[mbm_xy] != h->slice_table[mb_xy])
start = 1;
if (FRAME_MBAFF && (dir == 1) && ((mb_y&1) == 0) && start == 0
&& !IS_INTERLACED(mb_type)
&& IS_INTERLACED(mbm_type)
) {
static const int nnz_idx[4] = {4,5,6,3};
unsigned int tmp_linesize = 2 * linesize;
unsigned int tmp_uvlinesize = 2 * uvlinesize;
int mbn_xy = mb_xy - 2 * s->mb_stride;
int qp;
int i, j;
int16_t bS[4];
for(j=0; j<2; j++, mbn_xy += s->mb_stride){
if( IS_INTRA(mb_type) ||
IS_INTRA(s->current_picture.mb_type[mbn_xy]) ) {
bS[0] = bS[1] = bS[2] = bS[3] = 3;
} else {
const uint8_t *mbn_nnz = h->non_zero_count[mbn_xy];
for( i = 0; i < 4; i++ ) {
if( h->non_zero_count_cache[scan8[0]+i] != 0 ||
mbn_nnz[nnz_idx[i]] != 0 )
bS[i] = 2;
else
bS[i] = 1;
}
}
qp = ( s->current_picture.qscale_table[mb_xy] + s->current_picture.qscale_table[mbn_xy] + 1 ) >> 1;
tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, tmp_linesize, tmp_uvlinesize);
{ int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); }
filter_mb_edgeh( h, &img_y[j*linesize], tmp_linesize, bS, qp );
filter_mb_edgech( h, &img_cb[j*uvlinesize], tmp_uvlinesize, bS,
( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1);
filter_mb_edgech( h, &img_cr[j*uvlinesize], tmp_uvlinesize, bS,
( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1);
}
start = 1;
}
for( edge = start; edge < edges; edge++ ) {
const int mbn_xy = edge > 0 ? mb_xy : mbm_xy;
const int mbn_type = s->current_picture.mb_type[mbn_xy];
int16_t bS[4];
int qp;
if( (edge&1) && IS_8x8DCT(mb_type) )
continue;
if( IS_INTRA(mb_type) ||
IS_INTRA(mbn_type) ) {
int value;
if (edge == 0) {
if ( (!IS_INTERLACED(mb_type) && !IS_INTERLACED(mbm_type))
|| ((FRAME_MBAFF || (s->picture_structure != PICT_FRAME)) && (dir == 0))
) {
value = 4;
} else {
value = 3;
}
} else {
value = 3;
}
bS[0] = bS[1] = bS[2] = bS[3] = value;
} else {
int i, l;
int mv_done;
if( edge & mask_edge ) {
bS[0] = bS[1] = bS[2] = bS[3] = 0;
mv_done = 1;
}
else if( FRAME_MBAFF && IS_INTERLACED(mb_type ^ mbn_type)) {
bS[0] = bS[1] = bS[2] = bS[3] = 1;
mv_done = 1;
}
else if( mask_par0 && (edge || (mbn_type & (MB_TYPE_16x16 | (MB_TYPE_8x16 >> dir)))) ) {
int b_idx= 8 + 4 + edge * (dir ? 8:1);
int bn_idx= b_idx - (dir ? 8:1);
int v = 0;
for( l = 0; !v && l < 1 + (h->slice_type == FF_B_TYPE); l++ ) {
v |= ref2frm[h->ref_cache[l][b_idx]+2] != ref2frm[h->ref_cache[l][bn_idx]+2] ||
FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] ) >= 4 ||
FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit;
}
bS[0] = bS[1] = bS[2] = bS[3] = v;
mv_done = 1;
}
else
mv_done = 0;
for( i = 0; i < 4; i++ ) {
int x = dir == 0 ? edge : i;
int y = dir == 0 ? i : edge;
int b_idx= 8 + 4 + x + 8*y;
int bn_idx= b_idx - (dir ? 8:1);
if( h->non_zero_count_cache[b_idx] != 0 ||
h->non_zero_count_cache[bn_idx] != 0 ) {
bS[i] = 2;
}
else if(!mv_done)
{
bS[i] = 0;
for( l = 0; l < 1 + (h->slice_type == FF_B_TYPE); l++ ) {
if( ref2frm[h->ref_cache[l][b_idx]+2] != ref2frm[h->ref_cache[l][bn_idx]+2] ||
FFABS( h->mv_cache[l][b_idx][0] - h->mv_cache[l][bn_idx][0] ) >= 4 ||
FFABS( h->mv_cache[l][b_idx][1] - h->mv_cache[l][bn_idx][1] ) >= mvy_limit ) {
bS[i] = 1;
break;
}
}
}
}
if(bS[0]+bS[1]+bS[2]+bS[3] == 0)
continue;
}
qp = ( s->current_picture.qscale_table[mb_xy] + s->current_picture.qscale_table[mbn_xy] + 1 ) >> 1;
tprintf(s->avctx, "filter mb:%d/%d dir:%d edge:%d, QPy:%d ls:%d uvls:%d", mb_x, mb_y, dir, edge, qp, linesize, uvlinesize);
{ int i; for (i = 0; i < 4; i++) tprintf(s->avctx, " bS[%d]:%d", i, bS[i]); tprintf(s->avctx, "\n"); }
if( dir == 0 ) {
filter_mb_edgev( h, &img_y[4*edge], linesize, bS, qp );
if( (edge&1) == 0 ) {
filter_mb_edgecv( h, &img_cb[2*edge], uvlinesize, bS,
( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1);
filter_mb_edgecv( h, &img_cr[2*edge], uvlinesize, bS,
( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1);
}
} else {
filter_mb_edgeh( h, &img_y[4*edge*linesize], linesize, bS, qp );
if( (edge&1) == 0 ) {
filter_mb_edgech( h, &img_cb[2*edge*uvlinesize], uvlinesize, bS,
( h->chroma_qp[0] + get_chroma_qp( h, 0, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1);
filter_mb_edgech( h, &img_cr[2*edge*uvlinesize], uvlinesize, bS,
( h->chroma_qp[1] + get_chroma_qp( h, 1, s->current_picture.qscale_table[mbn_xy] ) + 1 ) >> 1);
}
}
}
}
}
libavcodec/h264.c:6715: error: Uninitialized Value
The value read from bS[_] was never initialized.
libavcodec/h264.c:6715:20:
6713. }
6714.
6715. if(bS[0]+bS[1]+bS[2]+bS[3] == 0)
^
6716. continue;
6717. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L6715
|
d2a_code_trace_data_43728
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/bn/bn_gf2m.c:1004: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_GF2m_mod_arr`.
Showing all 18 steps of the trace
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:219:5: Call
217. }
218. /* OK, make sure the returned bignum is "zero" */
219. BN_zero(ret);
^
220. /* clear BN_FLG_CONSTTIME if leaked from previous frames */
221. ret->flags &= (~BN_FLG_CONSTTIME);
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/bn/bn_gf2m.c:1004:10: Call
1002. goto err;
1003.
1004. if (!BN_GF2m_mod_arr(a, a_, p))
^
1005. goto err;
1006.
crypto/bn/bn_gf2m.c:292:1: Parameter `*r->d`
290.
291. /* Performs modular reduction of a and store result in r. r could be a. */
292. > int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[])
293. {
294. int j, k;
crypto/bn/bn_gf2m.c:302:9: Call
300. if (!p[0]) {
301. /* reduction mod 1 => return 0 */
302. BN_zero(r);
^
303. return 1;
304. }
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_GF2m_mod_arr`
230. assert(b->top <= words);
231. if (b->top > 0)
232. memcpy(a, b->d, sizeof(*a) * b->top);
^
233.
234. return a;
|
https://github.com/openssl/openssl/blob/18e1e302452e6dea4500b6f981cee7e151294dea/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_43729
|
static void
ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
ngx_uint_t from_upstream)
{
size_t size;
ssize_t n;
ngx_buf_t *b;
ngx_uint_t do_write;
ngx_connection_t *c, *downstream, *upstream, *dst, *src;
ngx_http_upstream_t *u;
ngx_http_core_loc_conf_t *clcf;
c = r->connection;
u = r->upstream;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http upstream process upgraded, fu:%ui", from_upstream);
downstream = c;
upstream = u->peer.connection;
if (downstream->write->timedout) {
c->timedout = 1;
ngx_connection_error(c, NGX_ETIMEDOUT, "client timed out");
ngx_http_upstream_finalize_request(r, u, NGX_HTTP_REQUEST_TIME_OUT);
return;
}
if (upstream->read->timedout || upstream->write->timedout) {
ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
ngx_http_upstream_finalize_request(r, u, 0);
return;
}
if (from_upstream) {
src = upstream;
dst = downstream;
b = &u->buffer;
} else {
src = downstream;
dst = upstream;
b = &u->from_client;
if (r->header_in->last > r->header_in->pos) {
b = r->header_in;
b->end = b->last;
do_write = 1;
}
if (b->start == NULL) {
b->start = ngx_palloc(r->pool, u->conf->buffer_size);
if (b->start == NULL) {
ngx_http_upstream_finalize_request(r, u, 0);
return;
}
b->pos = b->start;
b->last = b->start;
b->end = b->start + u->conf->buffer_size;
b->temporary = 1;
b->tag = u->output.tag;
}
}
for ( ;; ) {
if (do_write) {
size = b->last - b->pos;
if (size && dst->write->ready) {
n = dst->send(dst, b->pos, size);
if (n == NGX_ERROR) {
ngx_http_upstream_finalize_request(r, u, 0);
return;
}
if (n > 0) {
b->pos += n;
if (b->pos == b->last) {
b->pos = b->start;
b->last = b->start;
}
}
}
}
size = b->end - b->last;
if (size && src->read->ready) {
n = src->recv(src, b->last, size);
if (n == NGX_AGAIN || n == 0) {
break;
}
if (n > 0) {
do_write = 1;
b->last += n;
continue;
}
if (n == NGX_ERROR) {
src->read->eof = 1;
}
}
break;
}
if ((upstream->read->eof && u->buffer.pos == u->buffer.last)
|| (downstream->read->eof && u->from_client.pos == u->from_client.last)
|| (downstream->read->eof && upstream->read->eof))
{
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http upstream upgraded done");
ngx_http_upstream_finalize_request(r, u, 0);
return;
}
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
if (ngx_handle_write_event(upstream->write, u->conf->send_lowat)
!= NGX_OK)
{
ngx_http_upstream_finalize_request(r, u, 0);
return;
}
if (upstream->write->active && !upstream->write->ready) {
ngx_add_timer(upstream->write, u->conf->send_timeout);
} else if (upstream->write->timer_set) {
ngx_del_timer(upstream->write);
}
if (ngx_handle_read_event(upstream->read, 0) != NGX_OK) {
ngx_http_upstream_finalize_request(r, u, 0);
return;
}
if (upstream->read->active && !upstream->read->ready) {
ngx_add_timer(upstream->read, u->conf->read_timeout);
} else if (upstream->read->timer_set) {
ngx_del_timer(upstream->read);
}
if (ngx_handle_write_event(downstream->write, clcf->send_lowat)
!= NGX_OK)
{
ngx_http_upstream_finalize_request(r, u, 0);
return;
}
if (ngx_handle_read_event(downstream->read, 0) != NGX_OK) {
ngx_http_upstream_finalize_request(r, u, 0);
return;
}
if (downstream->write->active && !downstream->write->ready) {
ngx_add_timer(downstream->write, clcf->send_timeout);
} else if (downstream->write->timer_set) {
ngx_del_timer(downstream->write);
}
}
src/http/ngx_http_upstream.c:2543: error: Uninitialized Value
The value read from do_write was never initialized.
src/http/ngx_http_upstream.c:2543:13:
2541. for ( ;; ) {
2542.
2543. if (do_write) {
^
2544.
2545. size = b->last - b->pos;
|
https://github.com/nginx/nginx/blob/08a73b4aadebd9405ac52ec1f6eef5ca1fe8c11a/src/http/ngx_http_upstream.c/#L2543
|
d2a_code_trace_data_43730
|
static int ctr_BCC_final(RAND_DRBG_CTR *ctr)
{
if (ctr->bltmp_pos) {
memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
if (!ctr_BCC_blocks(ctr, ctr->bltmp))
return 0;
}
return 1;
}
crypto/rand/drbg_ctr.c:200: error: INTEGER_OVERFLOW_L2
(16 - [1, 68]):unsigned64 by call to `ctr_BCC_final`.
Showing all 13 steps of the trace
crypto/rand/drbg_ctr.c:195:5: Assignment
193. *p++ = 0;
194. *p = (unsigned char)((ctr->keylen + 16) & 0xff);
195. ctr->bltmp_pos = 8;
^
196. if (!ctr_BCC_update(ctr, in1, in1len)
197. || !ctr_BCC_update(ctr, in2, in2len)
crypto/rand/drbg_ctr.c:196:10: Call
194. *p = (unsigned char)((ctr->keylen + 16) & 0xff);
195. ctr->bltmp_pos = 8;
196. if (!ctr_BCC_update(ctr, in1, in1len)
^
197. || !ctr_BCC_update(ctr, in2, in2len)
198. || !ctr_BCC_update(ctr, in3, in3len)
crypto/rand/drbg_ctr.c:120:8: Parameter `ctr->bltmp_pos`
118. * Process several blocks into BCC algorithm, some possibly partial
119. */
120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
^
121. const unsigned char *in, size_t inlen)
122. {
crypto/rand/drbg_ctr.c:197:13: Call
195. ctr->bltmp_pos = 8;
196. if (!ctr_BCC_update(ctr, in1, in1len)
197. || !ctr_BCC_update(ctr, in2, in2len)
^
198. || !ctr_BCC_update(ctr, in3, in3len)
199. || !ctr_BCC_update(ctr, &c80, 1)
crypto/rand/drbg_ctr.c:120:8: Parameter `ctr->bltmp_pos`
118. * Process several blocks into BCC algorithm, some possibly partial
119. */
120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
^
121. const unsigned char *in, size_t inlen)
122. {
crypto/rand/drbg_ctr.c:198:13: Call
196. if (!ctr_BCC_update(ctr, in1, in1len)
197. || !ctr_BCC_update(ctr, in2, in2len)
198. || !ctr_BCC_update(ctr, in3, in3len)
^
199. || !ctr_BCC_update(ctr, &c80, 1)
200. || !ctr_BCC_final(ctr))
crypto/rand/drbg_ctr.c:120:8: Parameter `ctr->bltmp_pos`
118. * Process several blocks into BCC algorithm, some possibly partial
119. */
120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
^
121. const unsigned char *in, size_t inlen)
122. {
crypto/rand/drbg_ctr.c:199:13: Call
197. || !ctr_BCC_update(ctr, in2, in2len)
198. || !ctr_BCC_update(ctr, in3, in3len)
199. || !ctr_BCC_update(ctr, &c80, 1)
^
200. || !ctr_BCC_final(ctr))
201. return 0;
crypto/rand/drbg_ctr.c:120:8: Parameter `ctr->bltmp_pos`
118. * Process several blocks into BCC algorithm, some possibly partial
119. */
120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
^
121. const unsigned char *in, size_t inlen)
122. {
crypto/rand/drbg_ctr.c:200:13: Call
198. || !ctr_BCC_update(ctr, in3, in3len)
199. || !ctr_BCC_update(ctr, &c80, 1)
200. || !ctr_BCC_final(ctr))
^
201. return 0;
202. /* Set up key K */
crypto/rand/drbg_ctr.c:155:8: <RHS trace>
153. }
154.
155. __owur static int ctr_BCC_final(RAND_DRBG_CTR *ctr)
^
156. {
157. if (ctr->bltmp_pos) {
crypto/rand/drbg_ctr.c:155:8: Parameter `ctr->bltmp_pos`
153. }
154.
155. __owur static int ctr_BCC_final(RAND_DRBG_CTR *ctr)
^
156. {
157. if (ctr->bltmp_pos) {
crypto/rand/drbg_ctr.c:158:9: Binary operation: (16 - [1, 68]):unsigned64 by call to `ctr_BCC_final`
156. {
157. if (ctr->bltmp_pos) {
158. memset(ctr->bltmp + ctr->bltmp_pos, 0, 16 - ctr->bltmp_pos);
^
159. if (!ctr_BCC_blocks(ctr, ctr->bltmp))
160. return 0;
|
https://github.com/openssl/openssl/blob/e613b1eff40f21cd99240f9884cd3396b0ab50f1/crypto/rand/drbg_ctr.c/#L158
|
d2a_code_trace_data_43731
|
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:1072: error: Uninitialized Value
The value read from ymin was never initialized.
libavcodec/motion_est_template.c:1072:17:
1070. (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16)
1071. if(!s->first_slice_line)
1072. CHECK_CLIPPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
^
1073. (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
1074. }else{
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1072
|
d2a_code_trace_data_43732
|
int ngx_cdecl
main(int argc, char *const *argv)
{
char *p;
ssize_t n;
ngx_int_t i;
ngx_log_t *log;
ngx_cycle_t *cycle, init_cycle;
ngx_core_conf_t *ccf;
#if (NGX_FREEBSD)
ngx_debug_init();
#endif
ngx_max_sockets = -1;
ngx_time_init();
#if (NGX_PCRE)
ngx_regex_init();
#endif
ngx_pid = ngx_getpid();
log = ngx_log_init();
if (log == NULL) {
return 1;
}
#if (NGX_OPENSSL)
ngx_ssl_init(log);
#endif
ngx_memzero(&init_cycle, sizeof(ngx_cycle_t));
init_cycle.log = log;
ngx_cycle = &init_cycle;
init_cycle.pool = ngx_create_pool(1024, log);
if (init_cycle.pool == NULL) {
return 1;
}
if (ngx_save_argv(&init_cycle, argc, argv) != NGX_OK) {
return 1;
}
if (ngx_getopt(&init_cycle, argc, ngx_argv) != NGX_OK) {
return 1;
}
if (ngx_show_version) {
p = "nginx version: " NGINX_VER CRLF;
n = sizeof("nginx version: " NGINX_VER CRLF) - 1;
if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
return 1;
}
if (ngx_show_configure) {
#ifdef NGX_COMPILER
p = "built by " NGX_COMPILER CRLF;
n = sizeof("built by " NGX_COMPILER CRLF) - 1;
if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
return 1;
}
#endif
p = "configure arguments: " NGX_CONFIGURE CRLF;
n = sizeof("configure arguments :" NGX_CONFIGURE CRLF) - 1;
if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
return 1;
}
}
if (!ngx_test_config) {
return 0;
}
}
if (ngx_test_config) {
log->log_level = NGX_LOG_INFO;
}
if (ngx_os_init(log) != NGX_OK) {
return 1;
}
if (ngx_crc32_table_init() != NGX_OK) {
return 1;
}
if (ngx_add_inherited_sockets(&init_cycle) != NGX_OK) {
return 1;
}
ngx_max_module = 0;
for (i = 0; ngx_modules[i]; i++) {
ngx_modules[i]->index = ngx_max_module++;
}
cycle = ngx_init_cycle(&init_cycle);
if (cycle == NULL) {
if (ngx_test_config) {
ngx_log_error(NGX_LOG_EMERG, log, 0,
"the configuration file %s test failed",
init_cycle.conf_file.data);
}
return 1;
}
if (ngx_test_config) {
ngx_log_error(NGX_LOG_INFO, log, 0,
"the configuration file %s was tested successfully",
cycle->conf_file.data);
return 0;
}
ngx_os_status(cycle->log);
ngx_cycle = cycle;
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
ngx_process = ccf->master ? NGX_PROCESS_MASTER : NGX_PROCESS_SINGLE;
#if (NGX_WIN32)
#if 0
TODO:
if (ccf->run_as_service) {
if (ngx_service(cycle->log) != NGX_OK) {
return 1;
}
return 0;
}
#endif
#else
if (ngx_init_signals(cycle->log) != NGX_OK) {
return 1;
}
if (!ngx_inherited && ccf->daemon) {
if (ngx_daemon(cycle->log) != NGX_OK) {
return 1;
}
ngx_daemonized = 1;
}
if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) {
return 1;
}
#endif
if (ngx_process == NGX_PROCESS_MASTER) {
ngx_master_process_cycle(cycle);
} else {
ngx_single_process_cycle(cycle);
}
return 0;
}
src/core/nginx.c:323: error: Buffer Overrun S2
Offset: `ngx_core_module.index` Size: [0, +oo].
src/core/nginx.c:191:1: <Offset trace>
189.
190.
191. int ngx_cdecl
^
192. main(int argc, char *const *argv)
193. {
src/core/nginx.c:191:1: Global `ngx_core_module.index`
189.
190.
191. int ngx_cdecl
^
192. main(int argc, char *const *argv)
193. {
src/core/nginx.c:301:13: <Length trace>
299. }
300.
301. cycle = ngx_init_cycle(&init_cycle);
^
302. if (cycle == NULL) {
303. if (ngx_test_config) {
src/core/nginx.c:301:13: Call
299. }
300.
301. cycle = ngx_init_cycle(&init_cycle);
^
302. if (cycle == NULL) {
303. if (ngx_test_config) {
src/core/ngx_cycle.c:42:1: Global `ngx_max_module`
40.
41.
42. ngx_cycle_t *
^
43. ngx_init_cycle(ngx_cycle_t *old_cycle)
44. {
src/core/ngx_cycle.c:188:23: Call
186.
187.
188. cycle->conf_ctx = ngx_pcalloc(pool, ngx_max_module * sizeof(void *));
^
189. if (cycle->conf_ctx == NULL) {
190. ngx_destroy_pool(pool);
src/core/ngx_palloc.c:283:1: Parameter `size`
281.
282.
283. void *
^
284. ngx_pcalloc(ngx_pool_t *pool, size_t size)
285. {
src/core/ngx_palloc.c:288:9: Call
286. void *p;
287.
288. p = ngx_palloc(pool, size);
^
289. if (p) {
290. ngx_memzero(p, size);
src/core/ngx_palloc.c:125:13: Assignment
123.
124. do {
125. m = ngx_align_ptr(p->d.last, NGX_ALIGNMENT);
^
126.
127. if ((size_t) (p->d.end - m) >= size) {
src/core/ngx_palloc.c:130:17: Assignment
128. p->d.last = m + size;
129.
130. return m;
^
131. }
132.
src/core/ngx_palloc.c:288:5: Assignment
286. void *p;
287.
288. p = ngx_palloc(pool, size);
^
289. if (p) {
290. ngx_memzero(p, size);
src/core/ngx_palloc.c:293:5: Assignment
291. }
292.
293. return p;
^
294. }
295.
src/core/ngx_cycle.c:188:5: Assignment
186.
187.
188. cycle->conf_ctx = ngx_pcalloc(pool, ngx_max_module * sizeof(void *));
^
189. if (cycle->conf_ctx == NULL) {
190. ngx_destroy_pool(pool);
src/core/nginx.c:323:31: Array access: Offset: ngx_core_module.index Size: [0, +oo]
321. ngx_cycle = cycle;
322.
323. ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
^
324.
325. ngx_process = ccf->master ? NGX_PROCESS_MASTER : NGX_PROCESS_SINGLE;
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/nginx.c/#L323
|
d2a_code_trace_data_43733
|
IMPLEMENT_new_ctx(ofb, OFB, 192)
providers/common/ciphers/aes.c:299: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 299 could be null and is dereferenced at line 299, column 1.
Showing all 18 steps of the trace
providers/common/ciphers/aes.c:299:1: start of procedure aes_192_ofb_newctx()
297. IMPLEMENT_new_params(ofb, OFB)
298. IMPLEMENT_new_ctx(ofb, OFB, 256)
299. > IMPLEMENT_new_ctx(ofb, OFB, 192)
300. IMPLEMENT_new_ctx(ofb, OFB, 128)
301.
crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:5:
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. > void *ret = CRYPTO_malloc(num, file, line);
231.
232. FAILTEST();
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking true branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:210:9:
208. * allocation.
209. */
210. > allow_customize = 0;
211. }
212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE)
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:233:9: Taking false branch
231.
232. FAILTEST();
233. if (ret != NULL)
^
234. memset(ret, 0, num);
235. return ret;
crypto/mem.c:235:5:
233. if (ret != NULL)
234. memset(ret, 0, num);
235. > return ret;
236. }
237.
crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
234. memset(ret, 0, num);
235. return ret;
236. > }
237.
238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
providers/common/ciphers/aes.c:299:1:
297. IMPLEMENT_new_params(ofb, OFB)
298. IMPLEMENT_new_ctx(ofb, OFB, 256)
299. > IMPLEMENT_new_ctx(ofb, OFB, 192)
300. IMPLEMENT_new_ctx(ofb, OFB, 128)
301.
|
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L299
|
d2a_code_trace_data_43734
|
char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
{
const X509_NAME_ENTRY *ne;
int i;
int n, lold, l, l1, l2, num, j, type;
const char *s;
char *p;
unsigned char *q;
BUF_MEM *b = NULL;
static const char hex[17] = "0123456789ABCDEF";
int gs_doit[4];
char tmp_buf[80];
#ifdef CHARSET_EBCDIC
unsigned char ebcdic_buf[1024];
#endif
if (buf == NULL) {
if ((b = BUF_MEM_new()) == NULL)
goto err;
if (!BUF_MEM_grow(b, 200))
goto err;
b->data[0] = '\0';
len = 200;
} else if (len == 0) {
return NULL;
}
if (a == NULL) {
if (b) {
buf = b->data;
OPENSSL_free(b);
}
strncpy(buf, "NO X509_NAME", len);
buf[len - 1] = '\0';
return buf;
}
len--;
l = 0;
for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
ne = sk_X509_NAME_ENTRY_value(a->entries, i);
n = OBJ_obj2nid(ne->object);
if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) {
i2t_ASN1_OBJECT(tmp_buf, sizeof(tmp_buf), ne->object);
s = tmp_buf;
}
l1 = strlen(s);
type = ne->value->type;
num = ne->value->length;
if (num > NAME_ONELINE_MAX) {
X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG);
goto end;
}
q = ne->value->data;
#ifdef CHARSET_EBCDIC
if (type == V_ASN1_GENERALSTRING ||
type == V_ASN1_VISIBLESTRING ||
type == V_ASN1_PRINTABLESTRING ||
type == V_ASN1_TELETEXSTRING ||
type == V_ASN1_IA5STRING) {
if (num > (int)sizeof(ebcdic_buf))
num = sizeof(ebcdic_buf);
ascii2ebcdic(ebcdic_buf, q, num);
q = ebcdic_buf;
}
#endif
if ((type == V_ASN1_GENERALSTRING) && ((num % 4) == 0)) {
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 0;
for (j = 0; j < num; j++)
if (q[j] != 0)
gs_doit[j & 3] = 1;
if (gs_doit[0] | gs_doit[1] | gs_doit[2])
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
else {
gs_doit[0] = gs_doit[1] = gs_doit[2] = 0;
gs_doit[3] = 1;
}
} else
gs_doit[0] = gs_doit[1] = gs_doit[2] = gs_doit[3] = 1;
for (l2 = j = 0; j < num; j++) {
if (!gs_doit[j & 3])
continue;
l2++;
#ifndef CHARSET_EBCDIC
if ((q[j] < ' ') || (q[j] > '~'))
l2 += 3;
#else
if ((os_toascii[q[j]] < os_toascii[' ']) ||
(os_toascii[q[j]] > os_toascii['~']))
l2 += 3;
#endif
}
lold = l;
l += 1 + l1 + 1 + l2;
if (l > NAME_ONELINE_MAX) {
X509err(X509_F_X509_NAME_ONELINE, X509_R_NAME_TOO_LONG);
goto end;
}
if (b != NULL) {
if (!BUF_MEM_grow(b, l + 1))
goto err;
p = &(b->data[lold]);
} else if (l > len) {
break;
} else
p = &(buf[lold]);
*(p++) = '/';
memcpy(p, s, (unsigned int)l1);
p += l1;
*(p++) = '=';
#ifndef CHARSET_EBCDIC
q = ne->value->data;
#endif
for (j = 0; j < num; j++) {
if (!gs_doit[j & 3])
continue;
#ifndef CHARSET_EBCDIC
n = q[j];
if ((n < ' ') || (n > '~')) {
*(p++) = '\\';
*(p++) = 'x';
*(p++) = hex[(n >> 4) & 0x0f];
*(p++) = hex[n & 0x0f];
} else
*(p++) = n;
#else
n = os_toascii[q[j]];
if ((n < os_toascii[' ']) || (n > os_toascii['~'])) {
*(p++) = '\\';
*(p++) = 'x';
*(p++) = hex[(n >> 4) & 0x0f];
*(p++) = hex[n & 0x0f];
} else
*(p++) = q[j];
#endif
}
*p = '\0';
}
if (b != NULL) {
p = b->data;
OPENSSL_free(b);
} else
p = buf;
if (i == 0)
*p = '\0';
return (p);
err:
X509err(X509_F_X509_NAME_ONELINE, ERR_R_MALLOC_FAILURE);
end:
BUF_MEM_free(b);
return (NULL);
}
crypto/x509/t_crl.c:53: error: BUFFER_OVERRUN_L3
Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline`.
Showing all 6 steps of the trace
crypto/x509/t_crl.c:53:9: Call
51. X509_CRL_get0_signature(x, &sig, &sig_alg);
52. X509_signature_print(out, sig_alg, NULL);
53. p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0);
^
54. BIO_printf(out, "%8sIssuer: %s\n", "", p);
55. OPENSSL_free(p);
crypto/x509/x509_obj.c:25:1: <Offset trace>
23. #define NAME_ONELINE_MAX (1024 * 1024)
24.
25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
26. {
27. const X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:25:1: Parameter `len`
23. #define NAME_ONELINE_MAX (1024 * 1024)
24.
25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
26. {
27. const X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:25:1: <Length trace>
23. #define NAME_ONELINE_MAX (1024 * 1024)
24.
25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
26. {
27. const X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:25:1: Parameter `*buf`
23. #define NAME_ONELINE_MAX (1024 * 1024)
24.
25. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
26. {
27. const X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:57:9: Array access: Offset: [-1, 199] Size: [1, 2147483644] by call to `X509_NAME_oneline`
55. }
56. strncpy(buf, "NO X509_NAME", len);
57. buf[len - 1] = '\0';
^
58. return buf;
59. }
|
https://github.com/openssl/openssl/blob/645c694d85c8f48c74e7db8730ead874656c781e/crypto/x509/x509_obj.c/#L57
|
d2a_code_trace_data_43735
|
static int do_multi(int multi, int size_num)
{
int n;
int fd[2];
int *fds;
static char sep[] = ":";
fds = malloc(sizeof(*fds) * multi);
for (n = 0; n < multi; ++n) {
if (pipe(fd) == -1) {
BIO_printf(bio_err, "pipe failure\n");
exit(1);
}
fflush(stdout);
(void)BIO_flush(bio_err);
if (fork()) {
close(fd[1]);
fds[n] = fd[0];
} else {
close(fd[0]);
close(1);
if (dup(fd[1]) == -1) {
BIO_printf(bio_err, "dup failed\n");
exit(1);
}
close(fd[1]);
mr = 1;
usertime = 0;
free(fds);
return 0;
}
printf("Forked child %d\n", n);
}
for (n = 0; n < multi; ++n) {
FILE *f;
char buf[1024];
char *p;
f = fdopen(fds[n], "r");
while (fgets(buf, sizeof(buf), f)) {
p = strchr(buf, '\n');
if (p)
*p = '\0';
if (buf[0] != '+') {
BIO_printf(bio_err,
"Don't understand line '%s' from child %d\n", buf,
n);
continue;
}
printf("Got: %s from %d\n", buf, n);
if (strncmp(buf, "+F:", 3) == 0) {
int alg;
int j;
p = buf + 3;
alg = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
for (j = 0; j < size_num; ++j)
results[alg][j] += atof(sstrsep(&p, sep));
} else if (strncmp(buf, "+F2:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
rsa_results[k][0] += d;
d = atof(sstrsep(&p, sep));
rsa_results[k][1] += d;
}
# ifndef OPENSSL_NO_DSA
else if (strncmp(buf, "+F3:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
dsa_results[k][0] += d;
d = atof(sstrsep(&p, sep));
dsa_results[k][1] += d;
}
# endif
# ifndef OPENSSL_NO_EC
else if (strncmp(buf, "+F4:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
ecdsa_results[k][0] += d;
d = atof(sstrsep(&p, sep));
ecdsa_results[k][1] += d;
} else if (strncmp(buf, "+F5:", 4) == 0) {
int k;
double d;
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
ecdh_results[k][0] += d;
}
# endif
else if (strncmp(buf, "+H:", 3) == 0) {
;
} else
BIO_printf(bio_err, "Unknown type '%s' from child %d\n", buf,
n);
}
fclose(f);
}
free(fds);
return 1;
}
apps/speed.c:3132: error: NULL_DEREFERENCE
pointer `fds` last assigned on line 3122 could be null and is dereferenced at line 3132, column 13.
Showing all 19 steps of the trace
apps/speed.c:3115:1: start of procedure do_multi()
3113. }
3114.
3115. > static int do_multi(int multi, int size_num)
3116. {
3117. int n;
apps/speed.c:3120:5:
3118. int fd[2];
3119. int *fds;
3120. > static char sep[] = ":";
3121.
3122. fds = malloc(sizeof(*fds) * multi);
apps/speed.c:3122:5:
3120. static char sep[] = ":";
3121.
3122. > fds = malloc(sizeof(*fds) * multi);
3123. for (n = 0; n < multi; ++n) {
3124. if (pipe(fd) == -1) {
apps/speed.c:3123:10:
3121.
3122. fds = malloc(sizeof(*fds) * multi);
3123. > for (n = 0; n < multi; ++n) {
3124. if (pipe(fd) == -1) {
3125. BIO_printf(bio_err, "pipe failure\n");
apps/speed.c:3123:17: Loop condition is true. Entering loop body
3121.
3122. fds = malloc(sizeof(*fds) * multi);
3123. for (n = 0; n < multi; ++n) {
^
3124. if (pipe(fd) == -1) {
3125. BIO_printf(bio_err, "pipe failure\n");
apps/speed.c:3124:13: Taking false branch
3122. fds = malloc(sizeof(*fds) * multi);
3123. for (n = 0; n < multi; ++n) {
3124. if (pipe(fd) == -1) {
^
3125. BIO_printf(bio_err, "pipe failure\n");
3126. exit(1);
apps/speed.c:3128:9:
3126. exit(1);
3127. }
3128. > fflush(stdout);
3129. (void)BIO_flush(bio_err);
3130. if (fork()) {
apps/speed.c:3129:15:
3127. }
3128. fflush(stdout);
3129. > (void)BIO_flush(bio_err);
3130. if (fork()) {
3131. close(fd[1]);
crypto/bio/bio_lib.c:509:1: start of procedure BIO_ctrl()
507. }
508.
509. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
510. {
511. long ret;
crypto/bio/bio_lib.c:513:9: Taking false branch
511. long ret;
512.
513. if (b == NULL)
^
514. return 0;
515.
crypto/bio/bio_lib.c:516:10: Taking false branch
514. return 0;
515.
516. if ((b->method == NULL) || (b->method->ctrl == NULL)) {
^
517. BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
518. return -2;
crypto/bio/bio_lib.c:516:33: Taking true branch
514. return 0;
515.
516. if ((b->method == NULL) || (b->method->ctrl == NULL)) {
^
517. BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
518. return -2;
crypto/bio/bio_lib.c:517:9: Skipping ERR_put_error(): empty list of specs
515.
516. if ((b->method == NULL) || (b->method->ctrl == NULL)) {
517. BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
^
518. return -2;
519. }
crypto/bio/bio_lib.c:518:9:
516. if ((b->method == NULL) || (b->method->ctrl == NULL)) {
517. BIOerr(BIO_F_BIO_CTRL, BIO_R_UNSUPPORTED_METHOD);
518. > return -2;
519. }
520.
crypto/bio/bio_lib.c:534:1: return from a call to BIO_ctrl
532.
533. return ret;
534. > }
535.
536. long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
apps/speed.c:3129:9:
3127. }
3128. fflush(stdout);
3129. > (void)BIO_flush(bio_err);
3130. if (fork()) {
3131. close(fd[1]);
apps/speed.c:3130:13: Taking true branch
3128. fflush(stdout);
3129. (void)BIO_flush(bio_err);
3130. if (fork()) {
^
3131. close(fd[1]);
3132. fds[n] = fd[0];
apps/speed.c:3131:13:
3129. (void)BIO_flush(bio_err);
3130. if (fork()) {
3131. > close(fd[1]);
3132. fds[n] = fd[0];
3133. } else {
apps/speed.c:3132:13:
3130. if (fork()) {
3131. close(fd[1]);
3132. > fds[n] = fd[0];
3133. } else {
3134. close(fd[0]);
|
https://github.com/openssl/openssl/blob/2b1aa1988189773497d6edba443cf77f5c31feba/apps/speed.c/#L3132
|
d2a_code_trace_data_43736
|
int vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
vp56_context_t *s = avctx->priv_data;
AVFrame *const p = s->framep[VP56_FRAME_CURRENT];
int is_alpha, alpha_offset;
if (s->has_alpha) {
alpha_offset = bytestream_get_be24(&buf);
buf_size -= 3;
}
for (is_alpha=0; is_alpha < 1+s->has_alpha; is_alpha++) {
int mb_row, mb_col, mb_row_flip, mb_offset = 0;
int block, y, uv, stride_y, stride_uv;
int golden_frame = 0;
int res;
s->modelp = &s->models[is_alpha];
res = s->parse_header(s, buf, buf_size, &golden_frame);
if (!res)
return -1;
if (!is_alpha) {
p->reference = 1;
if (avctx->get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
if (res == 2)
if (vp56_size_changed(avctx)) {
avctx->release_buffer(avctx, p);
return -1;
}
}
if (p->key_frame) {
p->pict_type = FF_I_TYPE;
s->default_models_init(s);
for (block=0; block<s->mb_height*s->mb_width; block++)
s->macroblocks[block].type = VP56_MB_INTRA;
} else {
p->pict_type = FF_P_TYPE;
vp56_parse_mb_type_models(s);
s->parse_vector_models(s);
s->mb_type = VP56_MB_INTER_NOVEC_PF;
}
s->parse_coeff_models(s);
memset(s->prev_dc, 0, sizeof(s->prev_dc));
s->prev_dc[1][VP56_FRAME_CURRENT] = 128;
s->prev_dc[2][VP56_FRAME_CURRENT] = 128;
for (block=0; block < 4*s->mb_width+6; block++) {
s->above_blocks[block].ref_frame = -1;
s->above_blocks[block].dc_coeff = 0;
s->above_blocks[block].not_null_dc = 0;
}
s->above_blocks[2*s->mb_width + 2].ref_frame = 0;
s->above_blocks[3*s->mb_width + 4].ref_frame = 0;
stride_y = p->linesize[0];
stride_uv = p->linesize[1];
if (s->flip < 0)
mb_offset = 7;
for (mb_row=0; mb_row<s->mb_height; mb_row++) {
if (s->flip < 0)
mb_row_flip = s->mb_height - mb_row - 1;
else
mb_row_flip = mb_row;
for (block=0; block<4; block++) {
s->left_block[block].ref_frame = -1;
s->left_block[block].dc_coeff = 0;
s->left_block[block].not_null_dc = 0;
}
memset(s->coeff_ctx, 0, sizeof(s->coeff_ctx));
memset(s->coeff_ctx_last, 24, sizeof(s->coeff_ctx_last));
s->above_block_idx[0] = 1;
s->above_block_idx[1] = 2;
s->above_block_idx[2] = 1;
s->above_block_idx[3] = 2;
s->above_block_idx[4] = 2*s->mb_width + 2 + 1;
s->above_block_idx[5] = 3*s->mb_width + 4 + 1;
s->block_offset[s->frbi] = (mb_row_flip*16 + mb_offset) * stride_y;
s->block_offset[s->srbi] = s->block_offset[s->frbi] + 8*stride_y;
s->block_offset[1] = s->block_offset[0] + 8;
s->block_offset[3] = s->block_offset[2] + 8;
s->block_offset[4] = (mb_row_flip*8 + mb_offset) * stride_uv;
s->block_offset[5] = s->block_offset[4];
for (mb_col=0; mb_col<s->mb_width; mb_col++) {
vp56_decode_mb(s, mb_row, mb_col, is_alpha);
for (y=0; y<4; y++) {
s->above_block_idx[y] += 2;
s->block_offset[y] += 16;
}
for (uv=4; uv<6; uv++) {
s->above_block_idx[uv] += 1;
s->block_offset[uv] += 8;
}
}
}
if (p->key_frame || golden_frame) {
if (s->framep[VP56_FRAME_GOLDEN]->data[0] &&
s->framep[VP56_FRAME_GOLDEN] != s->framep[VP56_FRAME_GOLDEN2])
avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN]);
s->framep[VP56_FRAME_GOLDEN] = p;
}
if (s->has_alpha) {
FFSWAP(AVFrame *, s->framep[VP56_FRAME_GOLDEN],
s->framep[VP56_FRAME_GOLDEN2]);
buf += alpha_offset;
buf_size -= alpha_offset;
}
}
if (s->framep[VP56_FRAME_PREVIOUS] == s->framep[VP56_FRAME_GOLDEN] ||
s->framep[VP56_FRAME_PREVIOUS] == s->framep[VP56_FRAME_GOLDEN2]) {
if (s->framep[VP56_FRAME_UNUSED] != s->framep[VP56_FRAME_GOLDEN] &&
s->framep[VP56_FRAME_UNUSED] != s->framep[VP56_FRAME_GOLDEN2])
FFSWAP(AVFrame *, s->framep[VP56_FRAME_PREVIOUS],
s->framep[VP56_FRAME_UNUSED]);
else
FFSWAP(AVFrame *, s->framep[VP56_FRAME_PREVIOUS],
s->framep[VP56_FRAME_UNUSED2]);
} else if (s->framep[VP56_FRAME_PREVIOUS]->data[0])
avctx->release_buffer(avctx, s->framep[VP56_FRAME_PREVIOUS]);
FFSWAP(AVFrame *, s->framep[VP56_FRAME_CURRENT],
s->framep[VP56_FRAME_PREVIOUS]);
*(AVFrame*)data = *p;
*data_size = sizeof(AVFrame);
return buf_size;
}
libavcodec/vp56.c:622: error: Uninitialized Value
The value read from alpha_offset was never initialized.
libavcodec/vp56.c:622:13:
620. s->framep[VP56_FRAME_GOLDEN2]);
621. buf += alpha_offset;
622. buf_size -= alpha_offset;
^
623. }
624. }
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/vp56.c/#L622
|
d2a_code_trace_data_43737
|
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/sm2/sm2_sign.c:121: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_inverse`.
Showing all 17 steps of the trace
crypto/sm2/sm2_sign.c:120:9: Call
118. continue;
119.
120. BN_add(s, dA, BN_value_one());
^
121. BN_mod_inverse(s, s, order, ctx);
122.
crypto/bn/bn_add.c:40:18: Call
38.
39. if (BN_ucmp(a, b) < 0) {
40. if (!BN_usub(r, b, a))
^
41. return 0;
42. r->neg = 1;
crypto/bn/bn_add.c:107:1: Parameter `r->top`
105.
106. /* unsigned subtraction of b from a, a must be larger than b. */
107. > int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
108. {
109. int max, min, dif;
crypto/sm2/sm2_sign.c:121:9: Call
119.
120. BN_add(s, dA, BN_value_one());
121. BN_mod_inverse(s, s, order, ctx);
^
122.
123. BN_mod_mul(tmp, dA, r, order, ctx);
crypto/bn/bn_gcd.c:124:1: Parameter `a->top`
122. BN_CTX *ctx);
123.
124. > BIGNUM *BN_mod_inverse(BIGNUM *in,
125. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
126. {
crypto/bn/bn_gcd.c:129:10: Call
127. BIGNUM *rv;
128. int noinv;
129. rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
^
130. if (noinv)
131. BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);
crypto/bn/bn_gcd.c:135:1: Parameter `a->top`
133. }
134.
135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
136. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
137. int *pnoinv)
crypto/bn/bn_gcd.c:148:16: Call
146. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
147. || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
148. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
149. }
150.
crypto/bn/bn_gcd.c:451:1: Parameter `a->top`
449. * not contain branches that may leak sensitive information.
450. */
451. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
452. const BIGNUM *a, const BIGNUM *n,
453. BN_CTX *ctx)
crypto/bn/bn_gcd.c:482:9: Call
480. BN_one(X);
481. BN_zero(Y);
482. if (BN_copy(B, a) == NULL)
^
483. goto err;
484. if (BN_copy(A, n) == NULL)
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:910:1: Parameter `*a->d`
908. }
909.
910. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
911. {
912. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:295:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_inverse`
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/440bce8f813fa661437ce52378c3df38e2fd073b/crypto/bn/bn_lib.c/#L295
|
d2a_code_trace_data_43738
|
void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur,
Picture *last, int y, int h, int picture_structure,
int first_field, int draw_edges, int low_delay,
int v_edge_pos, int h_edge_pos)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
int hshift = desc->log2_chroma_w;
int vshift = desc->log2_chroma_h;
const int field_pic = picture_structure != PICT_FRAME;
if(field_pic){
h <<= 1;
y <<= 1;
}
if (!avctx->hwaccel &&
draw_edges &&
cur->reference &&
!(avctx->flags & CODEC_FLAG_EMU_EDGE)) {
int *linesize = cur->f.linesize;
int sides = 0, edge_h;
if (y==0) sides |= EDGE_TOP;
if (y + h >= v_edge_pos)
sides |= EDGE_BOTTOM;
edge_h= FFMIN(h, v_edge_pos - y);
dsp->draw_edges(cur->f.data[0] + y * linesize[0],
linesize[0], h_edge_pos, edge_h,
EDGE_WIDTH, EDGE_WIDTH, sides);
dsp->draw_edges(cur->f.data[1] + (y >> vshift) * linesize[1],
linesize[1], h_edge_pos >> hshift, edge_h >> vshift,
EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides);
dsp->draw_edges(cur->f.data[2] + (y >> vshift) * linesize[2],
linesize[2], h_edge_pos >> hshift, edge_h >> vshift,
EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift, sides);
}
h = FFMIN(h, avctx->height - y);
if(field_pic && first_field && !(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
if (avctx->draw_horiz_band) {
AVFrame *src;
int offset[AV_NUM_DATA_POINTERS];
int i;
if(cur->f.pict_type == AV_PICTURE_TYPE_B || low_delay ||
(avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
src = &cur->f;
else if (last)
src = &last->f;
else
return;
if (cur->f.pict_type == AV_PICTURE_TYPE_B &&
picture_structure == PICT_FRAME &&
avctx->codec_id != AV_CODEC_ID_SVQ3) {
for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
offset[i] = 0;
}else{
offset[0]= y * src->linesize[0];
offset[1]=
offset[2]= (y >> vshift) * src->linesize[1];
for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
offset[i] = 0;
}
emms_c();
avctx->draw_horiz_band(avctx, src, offset,
y, picture_structure, h);
}
}
libavcodec/mpegvideo.c:2208: error: Null Dereference
pointer `desc` last assigned on line 2207 could be null and is dereferenced at line 2208, column 18.
libavcodec/mpegvideo.c:2202:1: start of procedure ff_draw_horiz_band()
2200. * @param h is the normal height, this will be reduced automatically if needed for the last row
2201. */
2202. void ff_draw_horiz_band(AVCodecContext *avctx, DSPContext *dsp, Picture *cur,
^
2203. Picture *last, int y, int h, int picture_structure,
2204. int first_field, int draw_edges, int low_delay,
libavcodec/mpegvideo.c:2207:5:
2205. int v_edge_pos, int h_edge_pos)
2206. {
2207. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
^
2208. int hshift = desc->log2_chroma_w;
2209. int vshift = desc->log2_chroma_h;
libavutil/pixdesc.c:1504:1: start of procedure av_pix_fmt_desc_get()
1502. }
1503.
1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
^
1505. {
1506. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
libavutil/pixdesc.c:1506:9: Taking false branch
1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1505. {
1506. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1507. return NULL;
1508. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1506:24: Taking true branch
1504. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
1505. {
1506. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
^
1507. return NULL;
1508. return &av_pix_fmt_descriptors[pix_fmt];
libavutil/pixdesc.c:1507:9:
1505. {
1506. if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
1507. return NULL;
^
1508. return &av_pix_fmt_descriptors[pix_fmt];
1509. }
libavutil/pixdesc.c:1509:1: return from a call to av_pix_fmt_desc_get
1507. return NULL;
1508. return &av_pix_fmt_descriptors[pix_fmt];
1509. }
^
1510.
1511. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
libavcodec/mpegvideo.c:2208:5:
2206. {
2207. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
2208. int hshift = desc->log2_chroma_w;
^
2209. int vshift = desc->log2_chroma_h;
2210. const int field_pic = picture_structure != PICT_FRAME;
|
https://github.com/libav/libav/blob/72072bf9de3241848ea86f68d2297b7a5d6ad49b/libavcodec/mpegvideo.c/#L2208
|
d2a_code_trace_data_43739
|
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:275: error: Uninitialized Value
The value read from inbuffer[_] was never initialized.
libavcodec/ra144.c:275:3:
273. *(ptr++)=(inbuffer[1]>>5)&7;
274. *(ptr++)=(inbuffer[1]>>2)&7;
275. *(ptr++)=((inbuffer[1]<<1)&6)|((inbuffer[2]>>15)&1);
^
276. *(ptr++)=(inbuffer[2]>>12)&7;
277. *(ptr++)=(inbuffer[2]>>10)&3;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra144.c/#L275
|
d2a_code_trace_data_43740
|
static int smka_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
SmackerAudioContext *s = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
GetBitContext gb;
HuffContext h[4] = { { 0 } };
VLC vlc[4] = { { 0 } };
int16_t *samples;
uint8_t *samples8;
int val;
int i, res, ret;
int unp_size;
int bits, stereo;
int pred[2] = {0, 0};
if (buf_size <= 4) {
av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
return AVERROR(EINVAL);
}
unp_size = AV_RL32(buf);
init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);
if(!get_bits1(&gb)){
av_log(avctx, AV_LOG_INFO, "Sound: no data\n");
*got_frame_ptr = 0;
return 1;
}
stereo = get_bits1(&gb);
bits = get_bits1(&gb);
if (stereo ^ (avctx->channels != 1)) {
av_log(avctx, AV_LOG_ERROR, "channels mismatch\n");
return AVERROR(EINVAL);
}
if (bits && avctx->sample_fmt == AV_SAMPLE_FMT_U8) {
av_log(avctx, AV_LOG_ERROR, "sample format mismatch\n");
return AVERROR(EINVAL);
}
s->frame.nb_samples = unp_size / (avctx->channels * (bits + 1));
if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
samples = (int16_t *)s->frame.data[0];
samples8 = s->frame.data[0];
for(i = 0; i < (1 << (bits + stereo)); i++) {
h[i].length = 256;
h[i].maxlength = 0;
h[i].current = 0;
h[i].bits = av_mallocz(256 * 4);
h[i].lengths = av_mallocz(256 * sizeof(int));
h[i].values = av_mallocz(256 * sizeof(int));
skip_bits1(&gb);
smacker_decode_tree(&gb, &h[i], 0, 0);
skip_bits1(&gb);
if(h[i].current > 1) {
res = init_vlc(&vlc[i], SMKTREE_BITS, h[i].length,
h[i].lengths, sizeof(int), sizeof(int),
h[i].bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
if(res < 0) {
av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
return -1;
}
}
}
if(bits) {
for(i = stereo; i >= 0; i--)
pred[i] = sign_extend(av_bswap16(get_bits(&gb, 16)), 16);
for(i = 0; i <= stereo; i++)
*samples++ = pred[i];
for(; i < unp_size / 2; i++) {
if(i & stereo) {
if(vlc[2].table)
res = get_vlc2(&gb, vlc[2].table, SMKTREE_BITS, 3);
else
res = 0;
val = h[2].values[res];
if(vlc[3].table)
res = get_vlc2(&gb, vlc[3].table, SMKTREE_BITS, 3);
else
res = 0;
val |= h[3].values[res] << 8;
pred[1] += sign_extend(val, 16);
*samples++ = av_clip_int16(pred[1]);
} else {
if(vlc[0].table)
res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
else
res = 0;
val = h[0].values[res];
if(vlc[1].table)
res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3);
else
res = 0;
val |= h[1].values[res] << 8;
pred[0] += sign_extend(val, 16);
*samples++ = av_clip_int16(pred[0]);
}
}
} else {
for(i = stereo; i >= 0; i--)
pred[i] = get_bits(&gb, 8);
for(i = 0; i <= stereo; i++)
*samples8++ = pred[i];
for(; i < unp_size; i++) {
if(i & stereo){
if(vlc[1].table)
res = get_vlc2(&gb, vlc[1].table, SMKTREE_BITS, 3);
else
res = 0;
pred[1] += sign_extend(h[1].values[res], 8);
*samples8++ = av_clip_uint8(pred[1]);
} else {
if(vlc[0].table)
res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
else
res = 0;
pred[0] += sign_extend(h[0].values[res], 8);
*samples8++ = av_clip_uint8(pred[0]);
}
}
}
for(i = 0; i < 4; i++) {
if(vlc[i].table)
ff_free_vlc(&vlc[i]);
av_free(h[i].bits);
av_free(h[i].lengths);
av_free(h[i].values);
}
*got_frame_ptr = 1;
*(AVFrame *)data = s->frame;
return buf_size;
}
libavcodec/smacker.c:606: error: Null Dereference
pointer `&gb->buffer` last assigned on line 604 could be null and is dereferenced by call to `get_bits1()` at line 606, column 9.
libavcodec/smacker.c:580:1: start of procedure smka_decode_frame()
578. * Decode Smacker audio data
579. */
580. static int smka_decode_frame(AVCodecContext *avctx, void *data,
^
581. int *got_frame_ptr, AVPacket *avpkt)
582. {
libavcodec/smacker.c:583:5:
581. int *got_frame_ptr, AVPacket *avpkt)
582. {
583. SmackerAudioContext *s = avctx->priv_data;
^
584. const uint8_t *buf = avpkt->data;
585. int buf_size = avpkt->size;
libavcodec/smacker.c:584:5:
582. {
583. SmackerAudioContext *s = avctx->priv_data;
584. const uint8_t *buf = avpkt->data;
^
585. int buf_size = avpkt->size;
586. GetBitContext gb;
libavcodec/smacker.c:585:5:
583. SmackerAudioContext *s = avctx->priv_data;
584. const uint8_t *buf = avpkt->data;
585. int buf_size = avpkt->size;
^
586. GetBitContext gb;
587. HuffContext h[4] = { { 0 } };
libavcodec/smacker.c:587:5:
585. int buf_size = avpkt->size;
586. GetBitContext gb;
587. HuffContext h[4] = { { 0 } };
^
588. VLC vlc[4] = { { 0 } };
589. int16_t *samples;
libavcodec/smacker.c:588:5:
586. GetBitContext gb;
587. HuffContext h[4] = { { 0 } };
588. VLC vlc[4] = { { 0 } };
^
589. int16_t *samples;
590. uint8_t *samples8;
libavcodec/smacker.c:595:5:
593. int unp_size;
594. int bits, stereo;
595. int pred[2] = {0, 0};
^
596.
597. if (buf_size <= 4) {
libavcodec/smacker.c:597:9: Taking false branch
595. int pred[2] = {0, 0};
596.
597. if (buf_size <= 4) {
^
598. av_log(avctx, AV_LOG_ERROR, "packet is too small\n");
599. return AVERROR(EINVAL);
libavcodec/smacker.c:602:5:
600. }
601.
602. unp_size = AV_RL32(buf);
^
603.
604. init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);
libavcodec/smacker.c:604:5:
602. unp_size = AV_RL32(buf);
603.
604. init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);
^
605.
606. if(!get_bits1(&gb)){
libavcodec/get_bits.h:352:1: start of procedure init_get_bits()
350. * @param bit_size the size of the buffer in bits
351. */
352. static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
^
353. int bit_size)
354. {
libavcodec/get_bits.h:355:5:
353. int bit_size)
354. {
355. int buffer_size = (bit_size+7)>>3;
^
356. if (buffer_size < 0 || bit_size < 0) {
357. buffer_size = bit_size = 0;
libavcodec/get_bits.h:356:9: Taking true branch
354. {
355. int buffer_size = (bit_size+7)>>3;
356. if (buffer_size < 0 || bit_size < 0) {
^
357. buffer_size = bit_size = 0;
358. buffer = NULL;
libavcodec/get_bits.h:357:9:
355. int buffer_size = (bit_size+7)>>3;
356. if (buffer_size < 0 || bit_size < 0) {
357. buffer_size = bit_size = 0;
^
358. buffer = NULL;
359. }
libavcodec/get_bits.h:358:9:
356. if (buffer_size < 0 || bit_size < 0) {
357. buffer_size = bit_size = 0;
358. buffer = NULL;
^
359. }
360.
libavcodec/get_bits.h:361:5:
359. }
360.
361. s->buffer = buffer;
^
362. s->size_in_bits = bit_size;
363. #if !UNCHECKED_BITSTREAM_READER
libavcodec/get_bits.h:362:5:
360.
361. s->buffer = buffer;
362. s->size_in_bits = bit_size;
^
363. #if !UNCHECKED_BITSTREAM_READER
364. s->size_in_bits_plus8 = bit_size + 8;
libavcodec/get_bits.h:364:5:
362. s->size_in_bits = bit_size;
363. #if !UNCHECKED_BITSTREAM_READER
364. s->size_in_bits_plus8 = bit_size + 8;
^
365. #endif
366. s->buffer_end = buffer + buffer_size;
libavcodec/get_bits.h:366:5:
364. s->size_in_bits_plus8 = bit_size + 8;
365. #endif
366. s->buffer_end = buffer + buffer_size;
^
367. s->index = 0;
368. }
libavcodec/get_bits.h:367:5:
365. #endif
366. s->buffer_end = buffer + buffer_size;
367. s->index = 0;
^
368. }
369.
libavcodec/get_bits.h:368:1: return from a call to init_get_bits
366. s->buffer_end = buffer + buffer_size;
367. s->index = 0;
368. }
^
369.
370. static inline void align_get_bits(GetBitContext *s)
libavcodec/smacker.c:606:9:
604. init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);
605.
606. if(!get_bits1(&gb)){
^
607. av_log(avctx, AV_LOG_INFO, "Sound: no data\n");
608. *got_frame_ptr = 0;
libavcodec/get_bits.h:268:1: start of procedure get_bits1()
266. }
267.
268. static inline unsigned int get_bits1(GetBitContext *s)
^
269. {
270. unsigned int index = s->index;
libavcodec/get_bits.h:270:5:
268. static inline unsigned int get_bits1(GetBitContext *s)
269. {
270. unsigned int index = s->index;
^
271. uint8_t result = s->buffer[index>>3];
272. #ifdef BITSTREAM_READER_LE
libavcodec/get_bits.h:271:5:
269. {
270. unsigned int index = s->index;
271. uint8_t result = s->buffer[index>>3];
^
272. #ifdef BITSTREAM_READER_LE
273. result >>= index & 7;
|
https://github.com/libav/libav/blob/33bb63cb3e1de6d78c475cf14384089ef3f1867d/libavcodec/smacker.c/#L606
|
d2a_code_trace_data_43741
|
static int decode_header_trees(SmackVContext *smk) {
GetBitContext gb;
int mmap_size, mclr_size, full_size, type_size;
mmap_size = AV_RL32(smk->avctx->extradata);
mclr_size = AV_RL32(smk->avctx->extradata + 4);
full_size = AV_RL32(smk->avctx->extradata + 8);
type_size = AV_RL32(smk->avctx->extradata + 12);
init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
if(!get_bits1(&gb)) {
av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
smk->mmap_tbl = av_malloc(sizeof(int) * 2);
smk->mmap_tbl[0] = 0;
smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
} else {
if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size))
return -1;
}
if(!get_bits1(&gb)) {
av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
smk->mclr_tbl = av_malloc(sizeof(int) * 2);
smk->mclr_tbl[0] = 0;
smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
} else {
if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size))
return -1;
}
if(!get_bits1(&gb)) {
av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
smk->full_tbl = av_malloc(sizeof(int) * 2);
smk->full_tbl[0] = 0;
smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
} else {
if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size))
return -1;
}
if(!get_bits1(&gb)) {
av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
smk->type_tbl = av_malloc(sizeof(int) * 2);
smk->type_tbl[0] = 0;
smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;
} else {
if (smacker_decode_header_tree(smk, &gb, &smk->type_tbl, smk->type_last, type_size))
return -1;
}
return 0;
}
libavcodec/smacker.c:319: error: Null Dereference
pointer `smk->type_tbl` last assigned on line 318 could be null and is dereferenced at line 319, column 9.
libavcodec/smacker.c:278:1: start of procedure decode_header_trees()
276. }
277.
278. static int decode_header_trees(SmackVContext *smk) {
^
279. GetBitContext gb;
280. int mmap_size, mclr_size, full_size, type_size;
libavcodec/smacker.c:282:5:
280. int mmap_size, mclr_size, full_size, type_size;
281.
282. mmap_size = AV_RL32(smk->avctx->extradata);
^
283. mclr_size = AV_RL32(smk->avctx->extradata + 4);
284. full_size = AV_RL32(smk->avctx->extradata + 8);
libavcodec/smacker.c:283:5:
281.
282. mmap_size = AV_RL32(smk->avctx->extradata);
283. mclr_size = AV_RL32(smk->avctx->extradata + 4);
^
284. full_size = AV_RL32(smk->avctx->extradata + 8);
285. type_size = AV_RL32(smk->avctx->extradata + 12);
libavcodec/smacker.c:284:5:
282. mmap_size = AV_RL32(smk->avctx->extradata);
283. mclr_size = AV_RL32(smk->avctx->extradata + 4);
284. full_size = AV_RL32(smk->avctx->extradata + 8);
^
285. type_size = AV_RL32(smk->avctx->extradata + 12);
286.
libavcodec/smacker.c:285:5:
283. mclr_size = AV_RL32(smk->avctx->extradata + 4);
284. full_size = AV_RL32(smk->avctx->extradata + 8);
285. type_size = AV_RL32(smk->avctx->extradata + 12);
^
286.
287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
libavcodec/smacker.c:287:5:
285. type_size = AV_RL32(smk->avctx->extradata + 12);
286.
287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
^
288.
289. if(!get_bits1(&gb)) {
libavcodec/get_bits.h:383:1: start of procedure init_get_bits()
381. * responsible for checking for the buffer end yourself (take advantage of the padding)!
382. */
383. static inline void init_get_bits(GetBitContext *s,
^
384. const uint8_t *buffer, int bit_size)
385. {
libavcodec/get_bits.h:386:5:
384. const uint8_t *buffer, int bit_size)
385. {
386. int buffer_size = (bit_size+7)>>3;
^
387. if (buffer_size < 0 || bit_size < 0) {
388. buffer_size = bit_size = 0;
libavcodec/get_bits.h:387:9: Taking false branch
385. {
386. int buffer_size = (bit_size+7)>>3;
387. if (buffer_size < 0 || bit_size < 0) {
^
388. buffer_size = bit_size = 0;
389. buffer = NULL;
libavcodec/get_bits.h:387:28: Taking false branch
385. {
386. int buffer_size = (bit_size+7)>>3;
387. if (buffer_size < 0 || bit_size < 0) {
^
388. buffer_size = bit_size = 0;
389. buffer = NULL;
libavcodec/get_bits.h:392:5:
390. }
391.
392. s->buffer = buffer;
^
393. s->size_in_bits = bit_size;
394. s->buffer_end = buffer + buffer_size;
libavcodec/get_bits.h:393:5:
391.
392. s->buffer = buffer;
393. s->size_in_bits = bit_size;
^
394. s->buffer_end = buffer + buffer_size;
395. #ifdef ALT_BITSTREAM_READER
libavcodec/get_bits.h:394:5:
392. s->buffer = buffer;
393. s->size_in_bits = bit_size;
394. s->buffer_end = buffer + buffer_size;
^
395. #ifdef ALT_BITSTREAM_READER
396. s->index = 0;
libavcodec/get_bits.h:396:5:
394. s->buffer_end = buffer + buffer_size;
395. #ifdef ALT_BITSTREAM_READER
396. s->index = 0;
^
397. #elif defined A32_BITSTREAM_READER
398. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3);
libavcodec/get_bits.h:402:1: return from a call to init_get_bits
400. skip_bits_long(s, 0);
401. #endif
402. }
^
403.
404. static inline void align_get_bits(GetBitContext *s)
libavcodec/smacker.c:289:9:
287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
288.
289. if(!get_bits1(&gb)) {
^
290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
291. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
libavcodec/get_bits.h:303:1: start of procedure get_bits1()
301. }
302.
303. static inline unsigned int get_bits1(GetBitContext *s){
^
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
libavcodec/get_bits.h:305:5:
303. static inline unsigned int get_bits1(GetBitContext *s){
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
^
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
libavcodec/get_bits.h:306:5:
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
306. uint8_t result = s->buffer[index>>3];
^
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
libavcodec/get_bits.h:308:5:
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
^
309. result &= 1;
310. #else
libavcodec/get_bits.h:309:5:
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
309. result &= 1;
^
310. #else
311. result <<= index & 7;
libavcodec/get_bits.h:314:5:
312. result >>= 8 - 1;
313. #endif
314. index++;
^
315. s->index = index;
316.
libavcodec/get_bits.h:315:5:
313. #endif
314. index++;
315. s->index = index;
^
316.
317. return result;
libavcodec/get_bits.h:317:5:
315. s->index = index;
316.
317. return result;
^
318. #else
319. return get_bits(s, 1);
libavcodec/get_bits.h:321:1: return from a call to get_bits1
319. return get_bits(s, 1);
320. #endif
321. }
^
322.
323. static inline unsigned int show_bits1(GetBitContext *s){
libavcodec/smacker.c:289:9: Taking true branch
287. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
288.
289. if(!get_bits1(&gb)) {
^
290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
291. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
libavcodec/smacker.c:290:9: Skipping av_log(): empty list of specs
288.
289. if(!get_bits1(&gb)) {
290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
^
291. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
292. smk->mmap_tbl[0] = 0;
libavcodec/smacker.c:291:9:
289. if(!get_bits1(&gb)) {
290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
291. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
^
292. smk->mmap_tbl[0] = 0;
293. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:83:9: Taking false branch
81. ((char*)ptr)[-1]= diff;
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,32,size))
^
84. ptr = NULL;
85. #elif HAVE_MEMALIGN
libavutil/mem.c:114:5:
112. ptr = malloc(size);
113. #endif
114. return ptr;
^
115. }
116.
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavcodec/smacker.c:292:9:
290. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
291. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
292. smk->mmap_tbl[0] = 0;
^
293. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
294. } else {
libavcodec/smacker.c:293:9:
291. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
292. smk->mmap_tbl[0] = 0;
293. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
^
294. } else {
295. if (smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size))
libavcodec/smacker.c:298:9:
296. return -1;
297. }
298. if(!get_bits1(&gb)) {
^
299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
300. smk->mclr_tbl = av_malloc(sizeof(int) * 2);
libavcodec/get_bits.h:303:1: start of procedure get_bits1()
301. }
302.
303. static inline unsigned int get_bits1(GetBitContext *s){
^
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
libavcodec/get_bits.h:305:5:
303. static inline unsigned int get_bits1(GetBitContext *s){
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
^
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
libavcodec/get_bits.h:306:5:
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
306. uint8_t result = s->buffer[index>>3];
^
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
libavcodec/get_bits.h:308:5:
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
^
309. result &= 1;
310. #else
libavcodec/get_bits.h:309:5:
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
309. result &= 1;
^
310. #else
311. result <<= index & 7;
libavcodec/get_bits.h:314:5:
312. result >>= 8 - 1;
313. #endif
314. index++;
^
315. s->index = index;
316.
libavcodec/get_bits.h:315:5:
313. #endif
314. index++;
315. s->index = index;
^
316.
317. return result;
libavcodec/get_bits.h:317:5:
315. s->index = index;
316.
317. return result;
^
318. #else
319. return get_bits(s, 1);
libavcodec/get_bits.h:321:1: return from a call to get_bits1
319. return get_bits(s, 1);
320. #endif
321. }
^
322.
323. static inline unsigned int show_bits1(GetBitContext *s){
libavcodec/smacker.c:298:9: Taking true branch
296. return -1;
297. }
298. if(!get_bits1(&gb)) {
^
299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
300. smk->mclr_tbl = av_malloc(sizeof(int) * 2);
libavcodec/smacker.c:299:9: Skipping av_log(): empty list of specs
297. }
298. if(!get_bits1(&gb)) {
299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
^
300. smk->mclr_tbl = av_malloc(sizeof(int) * 2);
301. smk->mclr_tbl[0] = 0;
libavcodec/smacker.c:300:9:
298. if(!get_bits1(&gb)) {
299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
300. smk->mclr_tbl = av_malloc(sizeof(int) * 2);
^
301. smk->mclr_tbl[0] = 0;
302. smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:83:9: Taking false branch
81. ((char*)ptr)[-1]= diff;
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,32,size))
^
84. ptr = NULL;
85. #elif HAVE_MEMALIGN
libavutil/mem.c:114:5:
112. ptr = malloc(size);
113. #endif
114. return ptr;
^
115. }
116.
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavcodec/smacker.c:301:9:
299. av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
300. smk->mclr_tbl = av_malloc(sizeof(int) * 2);
301. smk->mclr_tbl[0] = 0;
^
302. smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
303. } else {
libavcodec/smacker.c:302:9:
300. smk->mclr_tbl = av_malloc(sizeof(int) * 2);
301. smk->mclr_tbl[0] = 0;
302. smk->mclr_last[0] = smk->mclr_last[1] = smk->mclr_last[2] = 1;
^
303. } else {
304. if (smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size))
libavcodec/smacker.c:307:9:
305. return -1;
306. }
307. if(!get_bits1(&gb)) {
^
308. av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
309. smk->full_tbl = av_malloc(sizeof(int) * 2);
libavcodec/get_bits.h:303:1: start of procedure get_bits1()
301. }
302.
303. static inline unsigned int get_bits1(GetBitContext *s){
^
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
libavcodec/get_bits.h:305:5:
303. static inline unsigned int get_bits1(GetBitContext *s){
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
^
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
libavcodec/get_bits.h:306:5:
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
306. uint8_t result = s->buffer[index>>3];
^
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
libavcodec/get_bits.h:308:5:
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
^
309. result &= 1;
310. #else
libavcodec/get_bits.h:309:5:
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
309. result &= 1;
^
310. #else
311. result <<= index & 7;
libavcodec/get_bits.h:314:5:
312. result >>= 8 - 1;
313. #endif
314. index++;
^
315. s->index = index;
316.
libavcodec/get_bits.h:315:5:
313. #endif
314. index++;
315. s->index = index;
^
316.
317. return result;
libavcodec/get_bits.h:317:5:
315. s->index = index;
316.
317. return result;
^
318. #else
319. return get_bits(s, 1);
libavcodec/get_bits.h:321:1: return from a call to get_bits1
319. return get_bits(s, 1);
320. #endif
321. }
^
322.
323. static inline unsigned int show_bits1(GetBitContext *s){
libavcodec/smacker.c:307:9: Taking true branch
305. return -1;
306. }
307. if(!get_bits1(&gb)) {
^
308. av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
309. smk->full_tbl = av_malloc(sizeof(int) * 2);
libavcodec/smacker.c:308:9: Skipping av_log(): empty list of specs
306. }
307. if(!get_bits1(&gb)) {
308. av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
^
309. smk->full_tbl = av_malloc(sizeof(int) * 2);
310. smk->full_tbl[0] = 0;
libavcodec/smacker.c:309:9:
307. if(!get_bits1(&gb)) {
308. av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
309. smk->full_tbl = av_malloc(sizeof(int) * 2);
^
310. smk->full_tbl[0] = 0;
311. smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:83:9: Taking false branch
81. ((char*)ptr)[-1]= diff;
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,32,size))
^
84. ptr = NULL;
85. #elif HAVE_MEMALIGN
libavutil/mem.c:114:5:
112. ptr = malloc(size);
113. #endif
114. return ptr;
^
115. }
116.
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavcodec/smacker.c:310:9:
308. av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
309. smk->full_tbl = av_malloc(sizeof(int) * 2);
310. smk->full_tbl[0] = 0;
^
311. smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
312. } else {
libavcodec/smacker.c:311:9:
309. smk->full_tbl = av_malloc(sizeof(int) * 2);
310. smk->full_tbl[0] = 0;
311. smk->full_last[0] = smk->full_last[1] = smk->full_last[2] = 1;
^
312. } else {
313. if (smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size))
libavcodec/smacker.c:316:9:
314. return -1;
315. }
316. if(!get_bits1(&gb)) {
^
317. av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
318. smk->type_tbl = av_malloc(sizeof(int) * 2);
libavcodec/get_bits.h:303:1: start of procedure get_bits1()
301. }
302.
303. static inline unsigned int get_bits1(GetBitContext *s){
^
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
libavcodec/get_bits.h:305:5:
303. static inline unsigned int get_bits1(GetBitContext *s){
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
^
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
libavcodec/get_bits.h:306:5:
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
306. uint8_t result = s->buffer[index>>3];
^
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
libavcodec/get_bits.h:308:5:
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
^
309. result &= 1;
310. #else
libavcodec/get_bits.h:309:5:
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
309. result &= 1;
^
310. #else
311. result <<= index & 7;
libavcodec/get_bits.h:314:5:
312. result >>= 8 - 1;
313. #endif
314. index++;
^
315. s->index = index;
316.
libavcodec/get_bits.h:315:5:
313. #endif
314. index++;
315. s->index = index;
^
316.
317. return result;
libavcodec/get_bits.h:317:5:
315. s->index = index;
316.
317. return result;
^
318. #else
319. return get_bits(s, 1);
libavcodec/get_bits.h:321:1: return from a call to get_bits1
319. return get_bits(s, 1);
320. #endif
321. }
^
322.
323. static inline unsigned int show_bits1(GetBitContext *s){
libavcodec/smacker.c:316:9: Taking true branch
314. return -1;
315. }
316. if(!get_bits1(&gb)) {
^
317. av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
318. smk->type_tbl = av_malloc(sizeof(int) * 2);
libavcodec/smacker.c:317:9: Skipping av_log(): empty list of specs
315. }
316. if(!get_bits1(&gb)) {
317. av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
^
318. smk->type_tbl = av_malloc(sizeof(int) * 2);
319. smk->type_tbl[0] = 0;
libavcodec/smacker.c:318:9:
316. if(!get_bits1(&gb)) {
317. av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
318. smk->type_tbl = av_malloc(sizeof(int) * 2);
^
319. smk->type_tbl[0] = 0;
320. smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking false branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:83:9: Taking true branch
81. ((char*)ptr)[-1]= diff;
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,32,size))
^
84. ptr = NULL;
85. #elif HAVE_MEMALIGN
libavutil/mem.c:84:9:
82. #elif HAVE_POSIX_MEMALIGN
83. if (posix_memalign(&ptr,32,size))
84. ptr = NULL;
^
85. #elif HAVE_MEMALIGN
86. ptr = memalign(32,size);
libavutil/mem.c:114:5:
112. ptr = malloc(size);
113. #endif
114. return ptr;
^
115. }
116.
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavcodec/smacker.c:319:9:
317. av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
318. smk->type_tbl = av_malloc(sizeof(int) * 2);
319. smk->type_tbl[0] = 0;
^
320. smk->type_last[0] = smk->type_last[1] = smk->type_last[2] = 1;
321. } else {
|
https://github.com/libav/libav/blob/d7d2f0e63c8187d531168256a0ce2aac21d5fce6/libavcodec/smacker.c/#L319
|
d2a_code_trace_data_43742
|
static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
const unsigned char *in, size_t inlen)
{
if (in == NULL || inlen == 0)
return 1;
if (ctr->bltmp_pos) {
size_t left = 16 - ctr->bltmp_pos;
if (inlen >= left) {
memcpy(ctr->bltmp + ctr->bltmp_pos, in, left);
if (!ctr_BCC_blocks(ctr, ctr->bltmp))
return 0;
ctr->bltmp_pos = 0;
inlen -= left;
in += left;
}
}
for (; inlen >= 16; in += 16, inlen -= 16) {
if (!ctr_BCC_blocks(ctr, in))
return 0;
}
if (inlen > 0) {
memcpy(ctr->bltmp + ctr->bltmp_pos, in, inlen);
ctr->bltmp_pos += inlen;
}
return 1;
}
crypto/rand/drbg_ctr.c:196: error: INTEGER_OVERFLOW_L2
([1, `in1len`] - 8):unsigned64 by call to `ctr_BCC_update`.
Showing all 7 steps of the trace
crypto/rand/drbg_ctr.c:165:8: Parameter `in1len`
163. }
164.
165. __owur static int ctr_df(RAND_DRBG_CTR *ctr,
^
166. const unsigned char *in1, size_t in1len,
167. const unsigned char *in2, size_t in2len,
crypto/rand/drbg_ctr.c:196:10: Call
194. *p = (unsigned char)((ctr->keylen + 16) & 0xff);
195. ctr->bltmp_pos = 8;
196. if (!ctr_BCC_update(ctr, in1, in1len)
^
197. || !ctr_BCC_update(ctr, in2, in2len)
198. || !ctr_BCC_update(ctr, in3, in3len)
crypto/rand/drbg_ctr.c:120:8: <LHS trace>
118. * Process several blocks into BCC algorithm, some possibly partial
119. */
120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
^
121. const unsigned char *in, size_t inlen)
122. {
crypto/rand/drbg_ctr.c:120:8: Parameter `inlen`
118. * Process several blocks into BCC algorithm, some possibly partial
119. */
120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
^
121. const unsigned char *in, size_t inlen)
122. {
crypto/rand/drbg_ctr.c:120:8: <RHS trace>
118. * Process several blocks into BCC algorithm, some possibly partial
119. */
120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
^
121. const unsigned char *in, size_t inlen)
122. {
crypto/rand/drbg_ctr.c:120:8: Parameter `inlen`
118. * Process several blocks into BCC algorithm, some possibly partial
119. */
120. __owur static int ctr_BCC_update(RAND_DRBG_CTR *ctr,
^
121. const unsigned char *in, size_t inlen)
122. {
crypto/rand/drbg_ctr.c:136:13: Binary operation: ([1, in1len] - 8):unsigned64 by call to `ctr_BCC_update`
134. return 0;
135. ctr->bltmp_pos = 0;
136. inlen -= left;
^
137. in += left;
138. }
|
https://github.com/openssl/openssl/blob/e613b1eff40f21cd99240f9884cd3396b0ab50f1/crypto/rand/drbg_ctr.c/#L136
|
d2a_code_trace_data_43743
|
static void clone_slice(H264Context *dst, H264Context *src)
{
memcpy(dst->block_offset, src->block_offset, sizeof(dst->block_offset));
dst->s.current_picture_ptr = src->s.current_picture_ptr;
dst->s.current_picture = src->s.current_picture;
dst->s.linesize = src->s.linesize;
dst->s.uvlinesize = src->s.uvlinesize;
dst->s.first_field = src->s.first_field;
dst->prev_poc_msb = src->prev_poc_msb;
dst->prev_poc_lsb = src->prev_poc_lsb;
dst->prev_frame_num_offset = src->prev_frame_num_offset;
dst->prev_frame_num = src->prev_frame_num;
dst->short_ref_count = src->short_ref_count;
memcpy(dst->short_ref, src->short_ref, sizeof(dst->short_ref));
memcpy(dst->long_ref, src->long_ref, sizeof(dst->long_ref));
memcpy(dst->default_ref_list, src->default_ref_list, sizeof(dst->default_ref_list));
memcpy(dst->ref_list, src->ref_list, sizeof(dst->ref_list));
memcpy(dst->dequant4_coeff, src->dequant4_coeff, sizeof(src->dequant4_coeff));
memcpy(dst->dequant8_coeff, src->dequant8_coeff, sizeof(src->dequant8_coeff));
}
libavcodec/h264.c:3845: error: Buffer Overrun L3
Offset added: 256 Size: [0, +oo].
libavcodec/h264.c:3829:1: <Length trace>
3827. * Replicates H264 "master" context to thread contexts.
3828. */
3829. static void clone_slice(H264Context *dst, H264Context *src)
^
3830. {
3831. memcpy(dst->block_offset, src->block_offset, sizeof(dst->block_offset));
libavcodec/h264.c:3829:1: Parameter `src->long_ref[*]`
3827. * Replicates H264 "master" context to thread contexts.
3828. */
3829. static void clone_slice(H264Context *dst, H264Context *src)
^
3830. {
3831. memcpy(dst->block_offset, src->block_offset, sizeof(dst->block_offset));
libavcodec/h264.c:3845:5: Array access: Offset added: 256 Size: [0, +oo]
3843.
3844. memcpy(dst->short_ref, src->short_ref, sizeof(dst->short_ref));
3845. memcpy(dst->long_ref, src->long_ref, sizeof(dst->long_ref));
^
3846. memcpy(dst->default_ref_list, src->default_ref_list, sizeof(dst->default_ref_list));
3847. memcpy(dst->ref_list, src->ref_list, sizeof(dst->ref_list));
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L3845
|
d2a_code_trace_data_43744
|
static int epzs_motion_search4(MpegEncContext * s,
int *mx_ptr, int *my_ptr, int P[10][2],
int src_index, int ref_index, int16_t (*last_mv)[2],
int ref_mv_scale)
{
MotionEstContext * const c= &s->me;
int best[2]={0, 0};
int d, dmin;
int map_generation;
const int penalty_factor= c->penalty_factor;
const int size=1;
const int h=8;
const int ref_mv_stride= s->mb_stride;
const int ref_mv_xy= s->mb_x + s->mb_y *ref_mv_stride;
me_cmp_func cmpf, chroma_cmpf;
LOAD_COMMON
int flags= c->flags;
LOAD_COMMON2
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
map_generation= update_map_generation(c);
dmin = 1000000;
if (s->first_slice_line) {
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
}else{
CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift)
CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16)
}
if(dmin>64*4){
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16)
if(s->mb_y+1<s->end_mb_y)
CHECK_CLIPPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16,
(last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16)
}
dmin= diamond_search(s, best, dmin, src_index, ref_index, penalty_factor, size, h, flags);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
libavcodec/motion_est_template.c:1168: error: Uninitialized Value
The value read from ymax was never initialized.
libavcodec/motion_est_template.c:1168:9:
1166. CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift)
1167. CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift)
1168. CHECK_MV(P_TOP[0]>>shift, P_TOP[1]>>shift)
^
1169. CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift)
1170. CHECK_CLIPPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16,
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L1168
|
d2a_code_trace_data_43745
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ec2_oct.c:103: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`.
Showing all 10 steps of the trace
crypto/ec/ec2_oct.c:53:5: Call
51. y_bit = (y_bit != 0) ? 1 : 0;
52.
53. BN_CTX_start(ctx);
^
54. tmp = BN_CTX_get(ctx);
55. x = 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/ec/ec2_oct.c:103:5: Call
101.
102. err:
103. BN_CTX_end(ctx);
^
104. BN_CTX_free(new_ctx);
105. 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_43746
|
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
{
int i, nw, lb, rb;
BN_ULONG *t, *f;
BN_ULONG l;
bn_check_top(r);
bn_check_top(a);
if (n < 0) {
BNerr(BN_F_BN_LSHIFT, BN_R_INVALID_SHIFT);
return 0;
}
nw = n / BN_BITS2;
if (bn_wexpand(r, a->top + nw + 1) == NULL)
return (0);
r->neg = a->neg;
lb = n % BN_BITS2;
rb = BN_BITS2 - lb;
f = a->d;
t = r->d;
t[a->top + nw] = 0;
if (lb == 0)
for (i = a->top - 1; i >= 0; i--)
t[nw + i] = f[i];
else
for (i = a->top - 1; i >= 0; i--) {
l = f[i];
t[nw + i + 1] |= (l >> rb) & BN_MASK2;
t[nw + i] = (l << lb) & BN_MASK2;
}
memset(t, 0, sizeof(*t) * nw);
r->top = a->top + nw + 1;
bn_correct_top(r);
bn_check_top(r);
return (1);
}
crypto/rsa/rsa_ossl.c:207: error: BUFFER_OVERRUN_L3
Offset: [1, +oo] Size: [0, 8388607] by call to `BN_BLINDING_convert_ex`.
Showing all 22 steps of the trace
crypto/rsa/rsa_ossl.c:207:16: Call
205. * Local blinding: store the unblinding factor in BN_BLINDING.
206. */
207. return BN_BLINDING_convert_ex(f, NULL, b, ctx);
^
208. } else {
209. /*
crypto/bn/bn_blind.c:130:1: Parameter `b->mod->top`
128. }
129.
130. > int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx)
131. {
132. int ret = 1;
crypto/bn/bn_blind.c:144:15: Call
142. /* Fresh blinding, doesn't need updating. */
143. b->counter = 0;
144. else if (!BN_BLINDING_update(b, ctx))
^
145. return (0);
146.
crypto/bn/bn_blind.c:94:1: Parameter `b->mod->top`
92. }
93.
94. > int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx)
95. {
96. int ret = 0;
crypto/bn/bn_blind.c:112:14: Call
110. goto err;
111. } else if (!(b->flags & BN_BLINDING_NO_UPDATE)) {
112. if (!BN_mod_mul(b->A, b->A, b->A, b->mod, ctx))
^
113. goto err;
114. if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx))
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:202:31: Call
200.
201. /* First we normalise the numbers */
202. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
^
203. if (!(BN_lshift(sdiv, divisor, norm_shift)))
204. 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:202:5: Assignment
200.
201. /* First we normalise the numbers */
202. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
^
203. if (!(BN_lshift(sdiv, divisor, norm_shift)))
204. goto err;
crypto/bn/bn_div.c:203:11: Call
201. /* First we normalise the numbers */
202. norm_shift = BN_BITS2 - ((BN_num_bits(divisor)) % BN_BITS2);
203. if (!(BN_lshift(sdiv, divisor, norm_shift)))
^
204. goto err;
205. sdiv->neg = 0;
crypto/bn/bn_shift.c:83:1: <Offset trace>
81. }
82.
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84. {
85. int i, nw, lb, rb;
crypto/bn/bn_shift.c:83:1: Parameter `n`
81. }
82.
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84. {
85. int i, nw, lb, rb;
crypto/bn/bn_shift.c:97:5: Assignment
95. }
96.
97. nw = n / BN_BITS2;
^
98. if (bn_wexpand(r, a->top + nw + 1) == NULL)
99. return (0);
crypto/bn/bn_shift.c:83:1: <Length trace>
81. }
82.
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84. {
85. int i, nw, lb, rb;
crypto/bn/bn_shift.c:83:1: Parameter `*r->d`
81. }
82.
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84. {
85. int i, nw, lb, rb;
crypto/bn/bn_shift.c:98:9: Call
96.
97. nw = n / BN_BITS2;
98. if (bn_wexpand(r, a->top + nw + 1) == NULL)
^
99. return (0);
100. r->neg = a->neg;
crypto/bn/bn_lib.c:948:1: Parameter `*a->d`
946. }
947.
948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_shift.c:104:5: Assignment
102. rb = BN_BITS2 - lb;
103. f = a->d;
104. t = r->d;
^
105. t[a->top + nw] = 0;
106. if (lb == 0)
crypto/bn/bn_shift.c:112:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_BLINDING_convert_ex`
110. for (i = a->top - 1; i >= 0; i--) {
111. l = f[i];
112. t[nw + i + 1] |= (l >> rb) & BN_MASK2;
^
113. t[nw + i] = (l << lb) & BN_MASK2;
114. }
|
https://github.com/openssl/openssl/blob/aa048aef0b9146f90c06333dedfc105d1f9e2c22/crypto/bn/bn_shift.c/#L112
|
d2a_code_trace_data_43747
|
static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegEncContext *best, int type,
PutBitContext pb[2], PutBitContext pb2[2], PutBitContext tex_pb[2],
int *dmin, int *next_block, int motion_x, int motion_y)
{
int score;
uint8_t *dest_backup[3];
copy_context_before_encode(s, backup, type);
s->block= s->blocks[*next_block];
s->pb= pb[*next_block];
if(s->data_partitioning){
s->pb2 = pb2 [*next_block];
s->tex_pb= tex_pb[*next_block];
}
if(*next_block){
memcpy(dest_backup, s->dest, sizeof(s->dest));
s->dest[0] = s->rd_scratchpad;
s->dest[1] = s->rd_scratchpad + 16*s->linesize;
s->dest[2] = s->rd_scratchpad + 16*s->linesize + 8;
assert(s->linesize >= 32);
}
encode_mb(s, motion_x, motion_y);
score= put_bits_count(&s->pb);
if(s->data_partitioning){
score+= put_bits_count(&s->pb2);
score+= put_bits_count(&s->tex_pb);
}
if(s->avctx->mb_decision == FF_MB_DECISION_RD){
MPV_decode_mb(s, s->block);
score *= s->lambda2;
score += sse_mb(s) << FF_LAMBDA_SHIFT;
}
if(*next_block){
memcpy(s->dest, dest_backup, sizeof(s->dest));
}
if(score<*dmin){
*dmin= score;
*next_block^=1;
copy_context_after_encode(best, s, type);
}
}
libavcodec/mpegvideo_enc.c:1841: error: Buffer Overrun L3
Offset added: 24 Size: [0, +oo].
libavcodec/mpegvideo_enc.c:1824:1: <Length trace>
1822. }
1823.
1824. static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegEncContext *best, int type,
^
1825. PutBitContext pb[2], PutBitContext pb2[2], PutBitContext tex_pb[2],
1826. int *dmin, int *next_block, int motion_x, int motion_y)
libavcodec/mpegvideo_enc.c:1824:1: Parameter `s->dest[*]`
1822. }
1823.
1824. static inline void encode_mb_hq(MpegEncContext *s, MpegEncContext *backup, MpegEncContext *best, int type,
^
1825. PutBitContext pb[2], PutBitContext pb2[2], PutBitContext tex_pb[2],
1826. int *dmin, int *next_block, int motion_x, int motion_y)
libavcodec/mpegvideo_enc.c:1841:9: Array access: Offset added: 24 Size: [0, +oo]
1839.
1840. if(*next_block){
1841. memcpy(dest_backup, s->dest, sizeof(s->dest));
^
1842. s->dest[0] = s->rd_scratchpad;
1843. s->dest[1] = s->rd_scratchpad + 16*s->linesize;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L1841
|
d2a_code_trace_data_43748
|
static void decode_audio_s16(int16_t *out, const uint8_t *buf, int buf_size,
int channels)
{
int ch;
const uint8_t *buf_end = buf + buf_size;
int predictor[2];
int st = channels - 1;
for (ch = 0; ch < channels; ch++) {
predictor[ch] = (int16_t)AV_RL16(buf);
buf += 2;
*out++ = predictor[ch];
}
ch = 0;
while (buf < buf_end) {
uint8_t b = *buf++;
if (b & 0x80)
predictor[ch] -= vmdaudio_table[b & 0x7F];
else
predictor[ch] += vmdaudio_table[b];
predictor[ch] = av_clip_int16(predictor[ch]);
*out++ = predictor[ch];
ch ^= st;
}
}
libavcodec/vmdav.c:489: error: Uninitialized Value
The value read from predictor[_] was never initialized.
libavcodec/vmdav.c:489:13:
487. uint8_t b = *buf++;
488. if (b & 0x80)
489. predictor[ch] -= vmdaudio_table[b & 0x7F];
^
490. else
491. predictor[ch] += vmdaudio_table[b];
|
https://github.com/libav/libav/blob/4568c2bf975e51d843bf1ff6ac06060a8a6291b3/libavcodec/vmdav.c/#L489
|
d2a_code_trace_data_43749
|
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
*allocbytes = (unsigned char *)pkt->buf->data + pkt->curr;
return 1;
}
ssl/t1_lib.c:1074: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + `s->tlsext_hostname->strlen` + 21]):unsigned64 by call to `WPACKET_put_bytes__`.
Showing all 11 steps of the trace
ssl/t1_lib.c:1016:1: Parameter `pkt->written`
1014. }
1015.
1016. > int ssl_add_clienthello_tlsext(SSL *s, WPACKET *pkt, int *al)
1017. {
1018. #ifndef OPENSSL_NO_EC
ssl/t1_lib.c:1074:14: Call
1072. /* Add SRP username if there is one */
1073. if (s->srp_ctx.login != NULL) {
1074. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_srp)
^
1075. /* Sub-packet for SRP extension */
1076. || !WPACKET_start_sub_packet_u16(pkt)
ssl/packet.c:261:1: Parameter `pkt->written`
259. }
260.
261. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
262. {
263. unsigned char *data;
ssl/packet.c:269:17: Call
267.
268. if (size > sizeof(unsigned int)
269. || !WPACKET_allocate_bytes(pkt, size, &data)
^
270. || !put_value(data, val, size))
271. return 0;
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:36:1: <LHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `pkt->buf->length`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: <RHS trace>
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:36:1: Parameter `len`
34. }
35.
36. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
37. {
38. /* Internal API, so should not fail */
ssl/packet.c:46:9: Binary operation: ([0, +oo] - [0, s->s3->previous_client_finished_len + pkt->written + s->tlsext_hostname->strlen + 21]):unsigned64 by call to `WPACKET_put_bytes__`
44. return 0;
45.
46. if (pkt->buf->length - pkt->written < len) {
^
47. size_t newlen;
48. size_t reflen;
|
https://github.com/openssl/openssl/blob/e4e1aa903e624044d3319622fc50222f1b2c7328/ssl/packet.c/#L46
|
d2a_code_trace_data_43750
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ecp_smpl.c:605: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`.
Showing all 10 steps of the trace
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: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/ec/ecp_smpl.c:605:5: Call
603.
604. err:
605. BN_CTX_end(ctx);
^
606. BN_CTX_free(new_ctx);
607. return ret;
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_CTX_end`
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_43751
|
char *make_config_name()
{
const char *t=X509_get_default_cert_area();
size_t len;
char *p;
len=strlen(t)+strlen(OPENSSL_CONF)+2;
p=OPENSSL_malloc(len);
BUF_strlcpy(p,t,len);
#ifndef OPENSSL_SYS_VMS
BUF_strlcat(p,"/",len);
#endif
BUF_strlcat(p,OPENSSL_CONF,len);
return p;
}
apps/apps.c:1538: error: NULL_DEREFERENCE
pointer `p` last assigned on line 1535 could be null and is dereferenced by call to `BUF_strlcat()` at line 1538, column 2.
Showing all 26 steps of the trace
apps/apps.c:1528:1: start of procedure make_config_name()
1526. }
1527.
1528. > char *make_config_name()
1529. {
1530. const char *t=X509_get_default_cert_area();
apps/apps.c:1530:2:
1528. char *make_config_name()
1529. {
1530. > const char *t=X509_get_default_cert_area();
1531. size_t len;
1532. char *p;
crypto/x509/x509_def.c:67:1: start of procedure X509_get_default_cert_area()
65. { return(X509_PRIVATE_DIR); }
66.
67. > const char *X509_get_default_cert_area(void)
68. { return(X509_CERT_AREA); }
69.
crypto/x509/x509_def.c:68:4:
66.
67. const char *X509_get_default_cert_area(void)
68. > { return(X509_CERT_AREA); }
69.
70. const char *X509_get_default_cert_dir(void)
crypto/x509/x509_def.c:68:28: return from a call to X509_get_default_cert_area
66.
67. const char *X509_get_default_cert_area(void)
68. { return(X509_CERT_AREA); }
^
69.
70. const char *X509_get_default_cert_dir(void)
apps/apps.c:1534:2:
1532. char *p;
1533.
1534. > len=strlen(t)+strlen(OPENSSL_CONF)+2;
1535. p=OPENSSL_malloc(len);
1536. BUF_strlcpy(p,t,len);
apps/apps.c:1535:2:
1533.
1534. len=strlen(t)+strlen(OPENSSL_CONF)+2;
1535. > p=OPENSSL_malloc(len);
1536. BUF_strlcpy(p,t,len);
1537. #ifndef OPENSSL_SYS_VMS
crypto/mem.c:294:1: start of procedure CRYPTO_malloc()
292. }
293.
294. > void *CRYPTO_malloc(int num, const char *file, int line)
295. {
296. void *ret = NULL;
crypto/mem.c:296:2:
294. void *CRYPTO_malloc(int num, const char *file, int line)
295. {
296. > void *ret = NULL;
297.
298. if (num <= 0) return NULL;
crypto/mem.c:298:6: Taking false branch
296. void *ret = NULL;
297.
298. if (num <= 0) return NULL;
^
299.
300. allow_customize = 0;
crypto/mem.c:300:2:
298. if (num <= 0) return NULL;
299.
300. > allow_customize = 0;
301. if (malloc_debug_func != NULL)
302. {
crypto/mem.c:301:6: Taking true branch
299.
300. allow_customize = 0;
301. if (malloc_debug_func != NULL)
^
302. {
303. allow_customize_debug = 0;
crypto/mem.c:303:3:
301. if (malloc_debug_func != NULL)
302. {
303. > allow_customize_debug = 0;
304. malloc_debug_func(NULL, num, file, line, 0);
305. }
crypto/mem.c:304:3: Skipping __function_pointer__(): unresolved function pointer
302. {
303. allow_customize_debug = 0;
304. malloc_debug_func(NULL, num, file, line, 0);
^
305. }
306. ret = malloc_ex_func(num,file,line);
crypto/mem.c:306:2: Skipping __function_pointer__(): unresolved function pointer
304. malloc_debug_func(NULL, num, file, line, 0);
305. }
306. ret = malloc_ex_func(num,file,line);
^
307. #ifdef LEVITTE_DEBUG_MEM
308. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
crypto/mem.c:310:6: Taking true branch
308. fprintf(stderr, "LEVITTE_DEBUG_MEM: > 0x%p (%d)\n", ret, num);
309. #endif
310. if (malloc_debug_func != NULL)
^
311. malloc_debug_func(ret, num, file, line, 1);
312.
crypto/mem.c:311:3: Skipping __function_pointer__(): unresolved function pointer
309. #endif
310. if (malloc_debug_func != NULL)
311. malloc_debug_func(ret, num, file, line, 1);
^
312.
313. #ifndef OPENSSL_CPUID_OBJ
crypto/mem.c:317:12: Taking false branch
315. * sanitisation function can't be optimised out. NB: We only do
316. * this for >2Kb so the overhead doesn't bother us. */
317. if(ret && (num > 2048))
^
318. { extern unsigned char cleanse_ctr;
319. ((unsigned char *)ret)[0] = cleanse_ctr;
crypto/mem.c:323:2:
321. #endif
322.
323. > return ret;
324. }
325. char *CRYPTO_strdup(const char *str, const char *file, int line)
crypto/mem.c:324:2: return from a call to CRYPTO_malloc
322.
323. return ret;
324. }
^
325. char *CRYPTO_strdup(const char *str, const char *file, int line)
326. {
apps/apps.c:1536:2: Skipping BUF_strlcpy(): empty list of specs
1534. len=strlen(t)+strlen(OPENSSL_CONF)+2;
1535. p=OPENSSL_malloc(len);
1536. BUF_strlcpy(p,t,len);
^
1537. #ifndef OPENSSL_SYS_VMS
1538. BUF_strlcat(p,"/",len);
apps/apps.c:1538:2:
1536. BUF_strlcpy(p,t,len);
1537. #ifndef OPENSSL_SYS_VMS
1538. > BUF_strlcat(p,"/",len);
1539. #endif
1540. BUF_strlcat(p,OPENSSL_CONF,len);
crypto/buffer/buffer.c:215:1: start of procedure BUF_strlcat()
213. }
214.
215. > size_t BUF_strlcat(char *dst, const char *src, size_t size)
216. {
217. size_t l = 0;
crypto/buffer/buffer.c:217:2:
215. size_t BUF_strlcat(char *dst, const char *src, size_t size)
216. {
217. > size_t l = 0;
218. for(; size > 0 && *dst; size--, dst++)
219. l++;
crypto/buffer/buffer.c:218:8: Loop condition is true. Entering loop body
216. {
217. size_t l = 0;
218. for(; size > 0 && *dst; size--, dst++)
^
219. l++;
220. return l + BUF_strlcpy(dst, src, size);
crypto/buffer/buffer.c:218:20: Loop condition is false. Leaving loop
216. {
217. size_t l = 0;
218. for(; size > 0 && *dst; size--, dst++)
^
219. l++;
220. return l + BUF_strlcpy(dst, src, size);
|
https://github.com/openssl/openssl/blob/417a24dba560ce1419b75d0f8cf5ded819b31f31/apps/apps.c/#L1538
|
d2a_code_trace_data_43752
|
static int sab_diamond_search(MpegEncContext * s, int *best, int dmin,
int src_index, int ref_index, int const penalty_factor,
int size, int h, int flags)
{
MotionEstContext * const c= &s->me;
me_cmp_func cmpf, chroma_cmpf;
Minima minima[MAX_SAB_SIZE];
const int minima_count= FFABS(c->dia_size);
int i, j;
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
for(j=i=0; i<ME_MAP_SIZE && j<MAX_SAB_SIZE; i++){
uint32_t key= map[i];
key += (1<<(ME_MAP_MV_BITS-1)) + (1<<(2*ME_MAP_MV_BITS-1));
if((key&((-1)<<(2*ME_MAP_MV_BITS))) != map_generation) continue;
minima[j].height= score_map[i];
minima[j].x= key & ((1<<ME_MAP_MV_BITS)-1); key>>=ME_MAP_MV_BITS;
minima[j].y= key & ((1<<ME_MAP_MV_BITS)-1);
minima[j].x-= (1<<(ME_MAP_MV_BITS-1));
minima[j].y-= (1<<(ME_MAP_MV_BITS-1));
if( minima[j].x > xmax || minima[j].x < xmin
|| minima[j].y > ymax || minima[j].y < ymin)
continue;
minima[j].checked=0;
if(minima[j].x || minima[j].y)
minima[j].height+= (mv_penalty[((minima[j].x)<<shift)-pred_x] + mv_penalty[((minima[j].y)<<shift)-pred_y])*penalty_factor;
j++;
}
qsort(minima, j, sizeof(Minima), minima_cmp);
for(; j<minima_count; j++){
minima[j].height=256*256*256*64;
minima[j].checked=0;
minima[j].x= minima[j].y=0;
}
for(i=0; i<minima_count; i++){
const int x= minima[i].x;
const int y= minima[i].y;
int d;
if(minima[i].checked) continue;
if( x >= xmax || x <= xmin
|| y >= ymax || y <= ymin)
continue;
SAB_CHECK_MV(x-1, y)
SAB_CHECK_MV(x+1, y)
SAB_CHECK_MV(x , y-1)
SAB_CHECK_MV(x , y+1)
minima[i].checked= 1;
}
best[0]= minima[0].x;
best[1]= minima[0].y;
dmin= minima[0].height;
if( best[0] < xmax && best[0] > xmin
&& best[1] < ymax && best[1] > ymin){
int d;
CHECK_MV(best[0]-1, best[1])
CHECK_MV(best[0]+1, best[1])
CHECK_MV(best[0], best[1]-1)
CHECK_MV(best[0], best[1]+1)
}
return dmin;
}
libavcodec/motion_est_template.c:843: error: Uninitialized Value
The value read from ymin was never initialized.
libavcodec/motion_est_template.c:843:37:
841. // all entries in map should be in range except if the mv overflows their ME_MAP_MV_BITS bits space
842. if( minima[j].x > xmax || minima[j].x < xmin
843. || minima[j].y > ymax || minima[j].y < ymin)
^
844. continue;
845.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L843
|
d2a_code_trace_data_43753
|
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:655: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 653 could be null and is dereferenced at line 655, column 9.
Showing all 14 steps of the trace
crypto/rand/rand_lib.c:651:1: start of procedure RAND_pseudo_bytes()
649.
650. #if OPENSSL_API_COMPAT < 0x10100000L
651. > int RAND_pseudo_bytes(unsigned char *buf, int num)
652. {
653. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:653:5:
651. int RAND_pseudo_bytes(unsigned char *buf, int num)
652. {
653. > const RAND_METHOD *meth = RAND_get_rand_method();
654.
655. if (meth->pseudorand != 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:655:9:
653. const RAND_METHOD *meth = RAND_get_rand_method();
654.
655. > if (meth->pseudorand != NULL)
656. return meth->pseudorand(buf, num);
657. return -1;
|
https://github.com/openssl/openssl/blob/e0b625f9db00509af9004b7907d44b78f332754a/crypto/rand/rand_lib.c/#L655
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.