id
stringlengths 25
25
| content
stringlengths 649
72.1k
| max_stars_repo_path
stringlengths 91
133
|
|---|---|---|
d2a_code_trace_data_45654
|
void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
uint64* tbc = NULL;
uint16 edge=0;
#ifdef JPEG_SUPPORT
unsigned char* jpt;
#endif
uint64 k;
edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
if(edge
#if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)
&& !(t2p->pdf_compression==T2P_COMPRESS_JPEG)
#endif
){
t2p->tiff_datasize=TIFFTileSize(input);
if (t2p->tiff_datasize == 0) {
t2p->t2p_error = T2P_ERR_ERROR;
}
return;
} else {
TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
k=tbc[tile];
#ifdef OJPEG_SUPPORT
if(t2p->tiff_compression==COMPRESSION_OJPEG){
k = checkAdd64(k, 2048, t2p);
}
#endif
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression==COMPRESSION_JPEG) {
uint32 count = 0;
if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt)!=0){
if(count > 4){
k = checkAdd64(k, count, t2p);
k -= 2;
}
}
}
#endif
t2p->tiff_datasize = (tsize_t) k;
if ((uint64) t2p->tiff_datasize != k) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
t2p->t2p_error = T2P_ERR_ERROR;
}
return;
}
}
k = TIFFTileSize(input);
if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){
k = checkMultiply64(k, t2p->tiff_samplesperpixel, t2p);
}
if (k == 0) {
t2p->t2p_error = T2P_ERR_ERROR;
}
t2p->tiff_datasize = (tsize_t) k;
if ((uint64) t2p->tiff_datasize != k) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
t2p->t2p_error = T2P_ERR_ERROR;
}
return;
}
tools/tiff2pdf.c:2068: error: Null Dereference
pointer `tbc` last assigned on line 2044 could be null and is dereferenced at line 2068, column 6.
tools/tiff2pdf.c:2042:1: start of procedure t2p_read_tiff_size_tile()
2040. */
2041.
2042. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
^
2043.
2044. uint64* tbc = NULL;
tools/tiff2pdf.c:2044:2:
2042. void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
2043.
2044. uint64* tbc = NULL;
^
2045. uint16 edge=0;
2046. #ifdef JPEG_SUPPORT
tools/tiff2pdf.c:2045:2:
2043.
2044. uint64* tbc = NULL;
2045. uint16 edge=0;
^
2046. #ifdef JPEG_SUPPORT
2047. unsigned char* jpt;
tools/tiff2pdf.c:2051:2:
2049. uint64 k;
2050.
2051. edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
^
2052. edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2053.
tools/tiff2pdf.c:2116:1: start of procedure t2p_tile_is_right_edge()
2114. */
2115.
2116. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
^
2117.
2118. if( ((tile+1) % tiles.tiles_tilecountx == 0)
tools/tiff2pdf.c:2118:7: Taking false branch
2116. int t2p_tile_is_right_edge(T2P_TILES tiles, ttile_t tile){
2117.
2118. if( ((tile+1) % tiles.tiles_tilecountx == 0)
^
2119. && (tiles.tiles_edgetilewidth != 0) ){
2120. return(1);
tools/tiff2pdf.c:2122:3:
2120. return(1);
2121. } else {
2122. return(0);
^
2123. }
2124. }
tools/tiff2pdf.c:2124:1: return from a call to t2p_tile_is_right_edge
2122. return(0);
2123. }
2124. }
^
2125.
2126. /*
tools/tiff2pdf.c:2052:2:
2050.
2051. edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2052. edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
^
2053.
2054. if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
tools/tiff2pdf.c:2131:1: start of procedure t2p_tile_is_bottom_edge()
2129. */
2130.
2131. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
^
2132.
2133. if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )
tools/tiff2pdf.c:2133:7: Taking false branch
2131. int t2p_tile_is_bottom_edge(T2P_TILES tiles, ttile_t tile){
2132.
2133. if( ((tile+1) > (tiles.tiles_tilecount-tiles.tiles_tilecountx) )
^
2134. && (tiles.tiles_edgetilelength != 0) ){
2135. return(1);
tools/tiff2pdf.c:2137:3:
2135. return(1);
2136. } else {
2137. return(0);
^
2138. }
2139. }
tools/tiff2pdf.c:2139:1: return from a call to t2p_tile_is_bottom_edge
2137. return(0);
2138. }
2139. }
^
2140.
2141. /*
tools/tiff2pdf.c:2054:5: Taking true branch
2052. edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
2053.
2054. if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
^
2055. if(edge
2056. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)
tools/tiff2pdf.c:2055:6: Taking false branch
2053.
2054. if(t2p->pdf_transcode==T2P_TRANSCODE_RAW){
2055. if(edge
^
2056. #if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)
2057. && !(t2p->pdf_compression==T2P_COMPRESS_JPEG)
tools/tiff2pdf.c:2067:4:
2065. return;
2066. } else {
2067. TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
^
2068. k=tbc[tile];
2069. #ifdef OJPEG_SUPPORT
libtiff/tif_dir.c:1213:1: start of procedure TIFFGetField()
1211. * internal directory structure.
1212. */
1213. int
^
1214. TIFFGetField(TIFF* tif, uint32 tag, ...)
1215. {
libtiff/tif_dir.c:1219:2:
1217. va_list ap;
1218.
1219. va_start(ap, tag);
^
1220. status = TIFFVGetField(tif, tag, ap);
1221. va_end(ap);
libtiff/tif_dir.c:1220:2: Skipping TIFFVGetField(): empty list of specs
1218.
1219. va_start(ap, tag);
1220. status = TIFFVGetField(tif, tag, ap);
^
1221. va_end(ap);
1222. return (status);
libtiff/tif_dir.c:1221:2:
1219. va_start(ap, tag);
1220. status = TIFFVGetField(tif, tag, ap);
1221. va_end(ap);
^
1222. return (status);
1223. }
libtiff/tif_dir.c:1222:2:
1220. status = TIFFVGetField(tif, tag, ap);
1221. va_end(ap);
1222. return (status);
^
1223. }
1224.
libtiff/tif_dir.c:1223:1: return from a call to TIFFGetField
1221. va_end(ap);
1222. return (status);
1223. }
^
1224.
1225. /*
tools/tiff2pdf.c:2068:4:
2066. } else {
2067. TIFFGetField(input, TIFFTAG_TILEBYTECOUNTS, &tbc);
2068. k=tbc[tile];
^
2069. #ifdef OJPEG_SUPPORT
2070. if(t2p->tiff_compression==COMPRESSION_OJPEG){
|
https://gitlab.com/libtiff/libtiff/blob/6dac309a9701d15ac52d895d566ddae2ed49db9b/tools/tiff2pdf.c/#L2068
|
d2a_code_trace_data_45655
|
static int rtp_new_av_stream(HTTPContext *c,
int stream_index, struct sockaddr_in *dest_addr,
HTTPContext *rtsp_c)
{
AVFormatContext *ctx;
AVStream *st;
char *ipaddr;
URLContext *h;
uint8_t *dummy_buf;
char buf2[32];
int max_packet_size;
ctx = av_alloc_format_context();
if (!ctx)
return -1;
ctx->oformat = guess_format("rtp", NULL, NULL);
st = av_mallocz(sizeof(AVStream));
if (!st)
goto fail;
st->codec= avcodec_alloc_context();
ctx->nb_streams = 1;
ctx->streams[0] = st;
if (!c->stream->feed ||
c->stream->feed == c->stream)
memcpy(st, c->stream->streams[stream_index], sizeof(AVStream));
else
memcpy(st,
c->stream->feed->streams[c->stream->feed_streams[stream_index]],
sizeof(AVStream));
st->priv_data = NULL;
ipaddr = inet_ntoa(dest_addr->sin_addr);
switch(c->rtp_protocol) {
case RTSP_PROTOCOL_RTP_UDP:
case RTSP_PROTOCOL_RTP_UDP_MULTICAST:
if (c->stream->is_multicast) {
int ttl;
ttl = c->stream->multicast_ttl;
if (!ttl)
ttl = 16;
snprintf(ctx->filename, sizeof(ctx->filename),
"rtp://%s:%d?multicast=1&ttl=%d",
ipaddr, ntohs(dest_addr->sin_port), ttl);
} else {
snprintf(ctx->filename, sizeof(ctx->filename),
"rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
}
if (url_open(&h, ctx->filename, URL_WRONLY) < 0)
goto fail;
c->rtp_handles[stream_index] = h;
max_packet_size = url_get_max_packet_size(h);
break;
case RTSP_PROTOCOL_RTP_TCP:
c->rtsp_c = rtsp_c;
max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
break;
default:
goto fail;
}
http_log("%s:%d - - [%s] \"PLAY %s/streamid=%d %s\"\n",
ipaddr, ntohs(dest_addr->sin_port),
ctime1(buf2),
c->stream->filename, stream_index, c->protocol);
if (url_open_dyn_packet_buf(&ctx->pb, max_packet_size) < 0) {
goto fail;
}
av_set_parameters(ctx, NULL);
if (av_write_header(ctx) < 0) {
fail:
if (h)
url_close(h);
av_free(ctx);
return -1;
}
url_close_dyn_buf(ctx->pb, &dummy_buf);
av_free(dummy_buf);
c->rtp_ctx[stream_index] = ctx;
return 0;
}
ffserver.c:3159: error: Uninitialized Value
The value read from h was never initialized.
ffserver.c:3159:13:
3157. if (av_write_header(ctx) < 0) {
3158. fail:
3159. if (h)
^
3160. url_close(h);
3161. av_free(ctx);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/ffserver.c/#L3159
|
d2a_code_trace_data_45656
|
u_char *
ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
{
u_char *p, zero, *last;
int d;
float f, scale;
size_t len, slen;
int64_t i64;
uint64_t ui64;
ngx_msec_t ms;
ngx_uint_t width, sign, hex, max_width, frac_width, i;
ngx_str_t *v;
ngx_variable_value_t *vv;
if (max == 0) {
return buf;
}
last = buf + max;
while (*fmt && buf < last) {
if (*fmt == '%') {
i64 = 0;
ui64 = 0;
zero = (u_char) ((*++fmt == '0') ? '0' : ' ');
width = 0;
sign = 1;
hex = 0;
max_width = 0;
frac_width = 0;
slen = (size_t) -1;
while (*fmt >= '0' && *fmt <= '9') {
width = width * 10 + *fmt++ - '0';
}
for ( ;; ) {
switch (*fmt) {
case 'u':
sign = 0;
fmt++;
continue;
case 'm':
max_width = 1;
fmt++;
continue;
case 'X':
hex = 2;
sign = 0;
fmt++;
continue;
case 'x':
hex = 1;
sign = 0;
fmt++;
continue;
case '.':
fmt++;
while (*fmt >= '0' && *fmt <= '9') {
frac_width = frac_width * 10 + *fmt++ - '0';
}
break;
case '*':
slen = va_arg(args, size_t);
fmt++;
continue;
default:
break;
}
break;
}
switch (*fmt) {
case 'V':
v = va_arg(args, ngx_str_t *);
len = v->len;
len = (buf + len < last) ? len : (size_t) (last - buf);
buf = ngx_cpymem(buf, v->data, len);
fmt++;
continue;
case 'v':
vv = va_arg(args, ngx_variable_value_t *);
len = vv->len;
len = (buf + len < last) ? len : (size_t) (last - buf);
buf = ngx_cpymem(buf, vv->data, len);
fmt++;
continue;
case 's':
p = va_arg(args, u_char *);
if (slen == (size_t) -1) {
while (*p && buf < last) {
*buf++ = *p++;
}
} else {
len = (buf + slen < last) ? slen : (size_t) (last - buf);
buf = ngx_cpymem(buf, p, len);
}
fmt++;
continue;
case 'O':
i64 = (int64_t) va_arg(args, off_t);
sign = 1;
break;
case 'P':
i64 = (int64_t) va_arg(args, ngx_pid_t);
sign = 1;
break;
case 'T':
i64 = (int64_t) va_arg(args, time_t);
sign = 1;
break;
case 'M':
ms = (ngx_msec_t) va_arg(args, ngx_msec_t);
if ((ngx_msec_int_t) ms == -1) {
sign = 1;
i64 = -1;
} else {
sign = 0;
ui64 = (uint64_t) ms;
}
break;
case 'z':
if (sign) {
i64 = (int64_t) va_arg(args, ssize_t);
} else {
ui64 = (uint64_t) va_arg(args, size_t);
}
break;
case 'i':
if (sign) {
i64 = (int64_t) va_arg(args, ngx_int_t);
} else {
ui64 = (uint64_t) va_arg(args, ngx_uint_t);
}
if (max_width) {
width = NGX_INT_T_LEN;
}
break;
case 'd':
if (sign) {
i64 = (int64_t) va_arg(args, int);
} else {
ui64 = (uint64_t) va_arg(args, u_int);
}
break;
case 'l':
if (sign) {
i64 = (int64_t) va_arg(args, long);
} else {
ui64 = (uint64_t) va_arg(args, u_long);
}
break;
case 'D':
if (sign) {
i64 = (int64_t) va_arg(args, int32_t);
} else {
ui64 = (uint64_t) va_arg(args, uint32_t);
}
break;
case 'L':
if (sign) {
i64 = va_arg(args, int64_t);
} else {
ui64 = va_arg(args, uint64_t);
}
break;
case 'A':
if (sign) {
i64 = (int64_t) va_arg(args, ngx_atomic_int_t);
} else {
ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t);
}
if (max_width) {
width = NGX_ATOMIC_T_LEN;
}
break;
case 'f':
f = (float) va_arg(args, double);
if (f < 0) {
*buf++ = '-';
f = -f;
}
ui64 = (int64_t) f;
buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width);
if (frac_width) {
if (buf < last) {
*buf++ = '.';
}
scale = 1.0;
for (i = 0; i < frac_width; i++) {
scale *= 10.0;
}
ui64 = (uint64_t) ((f - (int64_t) ui64) * scale);
buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width);
}
fmt++;
continue;
#if !(NGX_WIN32)
case 'r':
i64 = (int64_t) va_arg(args, rlim_t);
sign = 1;
break;
#endif
case 'p':
ui64 = (uintptr_t) va_arg(args, void *);
hex = 2;
sign = 0;
zero = '0';
width = NGX_PTR_SIZE * 2;
break;
case 'c':
d = va_arg(args, int);
*buf++ = (u_char) (d & 0xff);
fmt++;
continue;
case 'Z':
*buf++ = '\0';
fmt++;
continue;
case 'N':
#if (NGX_WIN32)
*buf++ = CR;
#endif
*buf++ = LF;
fmt++;
continue;
case '%':
*buf++ = '%';
fmt++;
continue;
default:
*buf++ = *fmt++;
continue;
}
if (sign) {
if (i64 < 0) {
*buf++ = '-';
ui64 = (uint64_t) -i64;
} else {
ui64 = (uint64_t) i64;
}
}
buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width);
fmt++;
} else {
*buf++ = *fmt++;
}
}
return buf;
}
src/http/ngx_http_core_module.c:1412: error: Buffer Overrun L2
Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`.
src/http/ngx_http_core_module.c:1373:14: Unknown value from: ngx_http_core_find_location
1371. /* look up nested locations */
1372.
1373. rc = ngx_http_core_find_location(r);
^
1374. }
1375.
src/http/ngx_http_core_module.c:1412:17: Call
1410.
1411. if (n < 0) {
1412. ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
^
1413. ngx_regex_exec_n
1414. " failed: %d on \"%V\" using \"%V\"",
src/core/ngx_log.c:67:1: Array declaration
65. #if (NGX_HAVE_VARIADIC_MACROS)
66.
67. void
^
68. ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
69. const char *fmt, ...)
src/core/ngx_log.c:88:5: Assignment
86. }
87.
88. last = errstr + NGX_MAX_ERROR_STR;
^
89.
90. ngx_memcpy(errstr, ngx_cached_err_log_time.data,
src/core/ngx_log.c:133:13: Call
131. ? " (%d: " : " (%Xd: ", err);
132. #else
133. p = ngx_snprintf(p, last - p, " (%d: ", err);
^
134. #endif
135.
src/core/ngx_string.c:109:1: Parameter `max`
107.
108.
109. u_char * ngx_cdecl
^
110. ngx_snprintf(u_char *buf, size_t max, const char *fmt, ...)
111. {
src/core/ngx_string.c:116:9: Call
114.
115. va_start(args, fmt);
116. p = ngx_vsnprintf(buf, max, fmt, args);
^
117. va_end(args);
118.
src/core/ngx_string.c:123:1: <Length trace>
121.
122.
123. u_char *
^
124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
125. {
src/core/ngx_string.c:123:1: Parameter `*buf`
121.
122.
123. u_char *
^
124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
125. {
src/core/ngx_string.c:244:25: Array access: Offset: [0, 4048] Size: 2048 by call to `ngx_log_error_core`
242. if (slen == (size_t) -1) {
243. while (*p && buf < last) {
244. *buf++ = *p++;
^
245. }
246.
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/core/ngx_string.c/#L244
|
d2a_code_trace_data_45657
|
void avformat_free_context(AVFormatContext *s)
{
int i;
if (!s)
return;
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++)
free_stream(&s->streams[i]);
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_freep(&s->internal);
av_free(s);
}
libavformat/segment.c:279: error: Integer Overflow L2
([0, +oo] - 1):unsigned32 by call to `seg_free_context`.
libavformat/segment.c:213:20: Unknown value from: non-const function
211.
212. if (seg->list && seg->list_type != LIST_HLS)
213. if ((ret = s->io_open(s, &seg->pb, seg->list, AVIO_FLAG_WRITE, NULL)) < 0)
^
214. goto fail;
215.
libavformat/segment.c:279:9: Call
277. fail:
278. if (ret < 0)
279. seg_free_context(seg);
^
280.
281. return ret;
libavformat/segment.c:193:1: Parameter `seg->avf->nb_programs`
191. }
192.
193. static void seg_free_context(SegmentContext *seg)
^
194. {
195. ff_format_io_close(seg->avf, &seg->pb);
libavformat/segment.c:196:5: Call
194. {
195. ff_format_io_close(seg->avf, &seg->pb);
196. avformat_free_context(seg->avf);
^
197. seg->avf = NULL;
198. }
libavformat/utils.c:2477:1: <LHS trace>
2475. }
2476.
2477. void avformat_free_context(AVFormatContext *s)
^
2478. {
2479. int i;
libavformat/utils.c:2477:1: Parameter `s->nb_programs`
2475. }
2476.
2477. void avformat_free_context(AVFormatContext *s)
^
2478. {
2479. int i;
libavformat/utils.c:2491:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `seg_free_context`
2489. free_stream(&s->streams[i]);
2490.
2491. for (i = s->nb_programs - 1; i >= 0; i--) {
^
2492. av_dict_free(&s->programs[i]->metadata);
2493. av_freep(&s->programs[i]->stream_index);
|
https://github.com/libav/libav/blob/611ba89b896a5286b6d8ad9bfdbb8b4f5c11df9c/libavformat/utils.c/#L2491
|
d2a_code_trace_data_45658
|
int av_write_trailer(AVFormatContext *s)
{
int ret, i;
for(;;){
AVPacket pkt;
ret= av_interleave_packet(s, &pkt, NULL, 1);
if(ret<0)
goto fail;
if(!ret)
break;
truncate_ts(s->streams[pkt.stream_index], &pkt);
ret= s->oformat->write_packet(s, &pkt);
av_free_packet(&pkt);
if(ret<0)
goto fail;
if(url_ferror(s->pb))
goto fail;
}
if(s->oformat->write_trailer)
ret = s->oformat->write_trailer(s);
fail:
if(ret == 0)
ret=url_ferror(s->pb);
for(i=0;i<s->nb_streams;i++)
av_freep(&s->streams[i]->priv_data);
av_freep(&s->priv_data);
return ret;
}
libavformat/utils.c:2555: error: Uninitialized Value
The value read from ret was never initialized.
libavformat/utils.c:2555:8:
2553. ret = s->oformat->write_trailer(s);
2554. fail:
2555. if(ret == 0)
^
2556. ret=url_ferror(s->pb);
2557. for(i=0;i<s->nb_streams;i++)
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/utils.c/#L2555
|
d2a_code_trace_data_45659
|
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
enum AVSampleFormat sample_fmt, int align)
{
int line_size;
int sample_size = av_get_bytes_per_sample(sample_fmt);
int planar = av_sample_fmt_is_planar(sample_fmt);
if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
return AVERROR(EINVAL);
if (!align) {
if (nb_samples > INT_MAX - 31)
return AVERROR(EINVAL);
align = 1;
nb_samples = FFALIGN(nb_samples, 32);
}
if (nb_channels > INT_MAX / align ||
(int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)
return AVERROR(EINVAL);
line_size = planar ? FFALIGN(nb_samples * sample_size, align) :
FFALIGN(nb_samples * sample_size * nb_channels, align);
if (linesize)
*linesize = line_size;
return planar ? line_size * nb_channels : line_size;
}
libavresample/utils.c:411: error: Integer Overflow L2
([1, 2147483616] + 32):signed32 by call to `ff_audio_data_copy`.
libavresample/utils.c:367:15: Call
365. if (input) {
366. /* initialize input_buffer with input data */
367. ret = ff_audio_data_init(&input_buffer, input, in_plane_size,
^
368. avr->in_channels, in_samples,
369. avr->in_sample_fmt, 1, "input");
libavresample/audio_data.c:65:1: Parameter `a->nb_samples`
63. }
64.
65. int ff_audio_data_init(AudioData *a, uint8_t **src, int plane_size, int channels,
^
66. int nb_samples, enum AVSampleFormat sample_fmt,
67. int read_only, const char *name)
libavresample/utils.c:411:23: Call
409. } else {
410. av_dlog(avr, "[copy] %s to in_buffer\n", current_buffer->name);
411. ret = ff_audio_data_copy(avr->in_buffer, current_buffer,
^
412. avr->remap_point == REMAP_IN_COPY ?
413. &avr->ch_map_info : NULL);
libavresample/audio_data.c:216:1: Parameter `src->nb_samples`
214. }
215.
216. int ff_audio_data_copy(AudioData *dst, AudioData *src, ChannelMapInfo *map)
^
217. {
218. int ret, p;
libavresample/audio_data.c:236:11: Call
234.
235. /* reallocate output if necessary */
236. ret = ff_audio_data_realloc(dst, src->nb_samples);
^
237. if (ret < 0)
238. return ret;
libavresample/audio_data.c:153:1: Parameter `nb_samples`
151. }
152.
153. int ff_audio_data_realloc(AudioData *a, int nb_samples)
^
154. {
155. int ret, new_buf_size, plane_size, p;
libavresample/audio_data.c:165:20: Call
163. return AVERROR(EINVAL);
164.
165. new_buf_size = av_samples_get_buffer_size(&plane_size,
^
166. a->allocated_channels, nb_samples,
167. a->sample_fmt, 0);
libavutil/samplefmt.c:108:1: <LHS trace>
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:108:1: Parameter `nb_samples`
106. }
107.
108. int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
^
109. enum AVSampleFormat sample_fmt, int align)
110. {
libavutil/samplefmt.c:124:9: Binary operation: ([1, 2147483616] + 32):signed32 by call to `ff_audio_data_copy`
122. return AVERROR(EINVAL);
123. align = 1;
124. nb_samples = FFALIGN(nb_samples, 32);
^
125. }
126.
|
https://github.com/libav/libav/blob/0e830094ad0dc251613a0aa3234d9c5c397e02e6/libavutil/samplefmt.c/#L124
|
d2a_code_trace_data_45660
|
static const char *skip_space(const char *s)
{
while (ossl_isspace(*s))
s++;
return s;
}
test/property_test.c:232: error: BUFFER_OVERRUN_L3
Offset: [2, +oo] Size: [1, 11] by call to `ossl_method_store_add`.
Showing all 25 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:186:1: Parameter `*properties`
184. }
185.
186. > int ossl_method_store_add(OSSL_METHOD_STORE *store,
187. int nid, const char *properties,
188. void *method, void (*method_destruct)(void *))
crypto/property/property.c:215:33: Call
213. ossl_method_cache_flush(store, nid);
214. if ((impl->properties = ossl_prop_defn_get(properties)) == NULL) {
215. if ((impl->properties = ossl_parse_property(properties)) == NULL)
^
216. goto err;
217. ossl_prop_defn_set(properties, impl->properties);
crypto/property/property_parse.c:315:1: Parameter `*defn`
313. }
314.
315. > OSSL_PROPERTY_LIST *ossl_parse_property(const char *defn)
316. {
317. PROPERTY_DEFINITION *prop = NULL;
crypto/property/property_parse.c:320:5: Assignment
318. OSSL_PROPERTY_LIST *res = NULL;
319. STACK_OF(PROPERTY_DEFINITION) *sk;
320. const char *s = defn;
^
321. int done;
322.
crypto/property/property_parse.c:326:9: Call
324. return NULL;
325.
326. s = skip_space(s);
^
327. done = *s == '\0';
328. while (!done) {
crypto/property/property_parse.c:50:1: Parameter `*s`
48. DEFINE_STACK_OF(PROPERTY_DEFINITION)
49.
50. > static const char *skip_space(const char *s)
51. {
52. while (ossl_isspace(*s))
crypto/property/property_parse.c:54:5: Assignment
52. while (ossl_isspace(*s))
53. s++;
54. return s;
^
55. }
56.
crypto/property/property_parse.c:326:5: Assignment
324. return NULL;
325.
326. s = skip_space(s);
^
327. done = *s == '\0';
328. while (!done) {
crypto/property/property_parse.c:333:14: Call
331. goto err;
332. memset(&prop->v, 0, sizeof(prop->v));
333. if (!parse_name(&s, 1, &prop->name_idx))
^
334. goto err;
335. prop->oper = PROPERTY_OPER_EQ;
crypto/property/property_parse.c:81:1: Parameter `**t`
79. }
80.
81. > static int parse_name(const char *t[], int create, OSSL_PROPERTY_IDX *idx)
82. {
83. char name[100];
crypto/property/property_parse.c:340:13: Call
338. goto err;
339. }
340. if (match_ch(&s, '=')) {
^
341. if (!parse_value(&s, prop, 1)) {
342. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE);
crypto/property/property_parse.c:57:1: Parameter `**t`
55. }
56.
57. > static int match_ch(const char *t[], char m)
58. {
59. const char *s = *t;
crypto/property/property_parse.c:341:18: Call
339. }
340. if (match_ch(&s, '=')) {
341. if (!parse_value(&s, prop, 1)) {
^
342. PROPerr(PROP_F_OSSL_PARSE_PROPERTY, PROP_R_NO_VALUE);
343. goto err;
crypto/property/property_parse.c:244:1: Parameter `**t`
242. }
243.
244. > static int parse_value(const char *t[], PROPERTY_DEFINITION *res, int create)
245. {
246. const char *s = *t;
crypto/property/property_parse.c:246:5: Assignment
244. static int parse_value(const char *t[], PROPERTY_DEFINITION *res, int create)
245. {
246. const char *s = *t;
^
247. int r = 0;
248.
crypto/property/property_parse.c:250:9: Assignment
248.
249. if (*s == '"' || *s == '\'') {
250. s++;
^
251. r = parse_string(&s, s[-1], res, create);
252. } else if (*s == '+') {
crypto/property/property_parse.c:251:13: Call
249. if (*s == '"' || *s == '\'') {
250. s++;
251. r = parse_string(&s, s[-1], res, create);
^
252. } else if (*s == '+') {
253. s++;
crypto/property/property_parse.c:183:1: Parameter `**t`
181. }
182.
183. > static int parse_string(const char *t[], char delim, PROPERTY_DEFINITION *res,
184. const int create)
185. {
crypto/property/property_parse.c:187:5: Assignment
185. {
186. char v[1000];
187. const char *s = *t;
^
188. size_t i = 0;
189. int err = 0;
crypto/property/property_parse.c:204:10: Call
202. }
203. v[i] = '\0';
204. *t = skip_space(s + 1);
^
205. if (err)
206. PROPerr(PROP_F_PARSE_STRING, PROP_R_STRING_TOO_LONG);
crypto/property/property_parse.c:50:1: <Length trace>
48. DEFINE_STACK_OF(PROPERTY_DEFINITION)
49.
50. > static const char *skip_space(const char *s)
51. {
52. while (ossl_isspace(*s))
crypto/property/property_parse.c:50:1: Parameter `*s`
48. DEFINE_STACK_OF(PROPERTY_DEFINITION)
49.
50. > static const char *skip_space(const char *s)
51. {
52. while (ossl_isspace(*s))
crypto/property/property_parse.c:52:12: Array access: Offset: [2, +oo] Size: [1, 11] by call to `ossl_method_store_add`
50. static const char *skip_space(const char *s)
51. {
52. while (ossl_isspace(*s))
^
53. s++;
54. return s;
|
https://github.com/openssl/openssl/blob/4460ad90af0338abe31286f29b36baf2e41abf19/crypto/property/property_parse.c/#L52
|
d2a_code_trace_data_45661
|
c448_error_t curve448_point_decode_like_eddsa_and_mul_by_ratio(
curve448_point_t p,
const uint8_t enc[EDDSA_448_PUBLIC_BYTES])
{
uint8_t enc2[EDDSA_448_PUBLIC_BYTES];
mask_t low;
mask_t succ;
memcpy(enc2, enc, sizeof(enc2));
low = ~word_is_zero(enc2[EDDSA_448_PRIVATE_BYTES - 1] & 0x80);
enc2[EDDSA_448_PRIVATE_BYTES - 1] &= ~0x80;
succ = gf_deserialize(p->y, enc2, 1, 0);
#if 0 == 0
succ &= word_is_zero(enc2[EDDSA_448_PRIVATE_BYTES - 1]);
#endif
gf_sqr(p->x, p->y);
gf_sub(p->z, ONE, p->x);
gf_mulw(p->t, p->x, EDWARDS_D);
gf_sub(p->t, ONE, p->t);
gf_mul(p->x, p->z, p->t);
succ &= gf_isr(p->t, p->x);
gf_mul(p->x, p->t, p->z);
gf_cond_neg(p->x, gf_lobit(p->x) ^ low);
gf_copy(p->z, ONE);
{
gf a, b, c, d;
gf_sqr(c, p->x);
gf_sqr(a, p->y);
gf_add(d, c, a);
gf_add(p->t, p->y, p->x);
gf_sqr(b, p->t);
gf_sub(b, b, d);
gf_sub(p->t, a, c);
gf_sqr(p->x, p->z);
gf_add(p->z, p->x, p->x);
gf_sub(a, p->z, d);
gf_mul(p->x, a, b);
gf_mul(p->z, p->t, a);
gf_mul(p->y, p->t, d);
gf_mul(p->t, b, d);
OPENSSL_cleanse(a, sizeof(a));
OPENSSL_cleanse(b, sizeof(b));
OPENSSL_cleanse(c, sizeof(c));
OPENSSL_cleanse(d, sizeof(d));
}
OPENSSL_cleanse(enc2, sizeof(enc2));
assert(curve448_point_valid(p) || ~succ);
return c448_succeed_if(mask_to_bool(succ));
}
crypto/ec/curve448/curve448.c:358: error: INTEGER_OVERFLOW_L2
([0, `*enc`] - 1):unsigned64 by call to `word_is_zero`.
Showing all 5 steps of the trace
crypto/ec/curve448/curve448.c:343:1: Parameter `*enc`
341. }
342.
343. > c448_error_t curve448_point_decode_like_eddsa_and_mul_by_ratio(
344. curve448_point_t p,
345. const uint8_t enc[EDDSA_448_PUBLIC_BYTES])
crypto/ec/curve448/curve448.c:358:13: Call
356. succ = gf_deserialize(p->y, enc2, 1, 0);
357. #if 0 == 0
358. succ &= word_is_zero(enc2[EDDSA_448_PRIVATE_BYTES - 1]);
^
359. #endif
360.
crypto/ec/curve448/arch_32/arch_intrinsics.h:18:1: <LHS trace>
16. # define ARCH_WORD_BITS 32
17.
18. > static ossl_inline uint32_t word_is_zero(uint32_t a)
19. {
20. /* let's hope the compiler isn't clever enough to optimize this. */
crypto/ec/curve448/arch_32/arch_intrinsics.h:18:1: Parameter `a`
16. # define ARCH_WORD_BITS 32
17.
18. > static ossl_inline uint32_t word_is_zero(uint32_t a)
19. {
20. /* let's hope the compiler isn't clever enough to optimize this. */
crypto/ec/curve448/arch_32/arch_intrinsics.h:21:5: Binary operation: ([0, *enc] - 1):unsigned64 by call to `word_is_zero`
19. {
20. /* let's hope the compiler isn't clever enough to optimize this. */
21. return (((uint64_t)a) - 1) >> 32;
^
22. }
23.
|
https://github.com/openssl/openssl/blob/0cdcdacc337005e08a906b2e07d4e44e3ee48138/crypto/ec/curve448/curve448.c/#L358
|
d2a_code_trace_data_45662
|
static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
{
#ifdef BITSTREAM_READER_LE
uint64_t ret = bc->bits & ((UINT64_C(1) << n) - 1);
bc->bits >>= n;
#else
uint64_t ret = bc->bits >> (64 - n);
bc->bits <<= n;
#endif
bc->bits_left -= n;
return ret;
}
libavcodec/wavpack.c:313: error: Integer Overflow L2
([1, +oo] - [1, 32]):unsigned32 by call to `bitstream_read`.
libavcodec/wavpack.c:309:17: Call
307. }
308. } else {
309. t = get_unary_0_33(bc);
^
310. if (t >= 2) {
311. if (bitstream_bits_left(bc) < t - 1)
libavcodec/unary.h:49:12: Call
47. static inline int get_unary_0_33(BitstreamContext *bc)
48. {
49. return get_unary(bc, 0, 33);
^
50. }
51.
libavcodec/unary.h:33:1: Parameter `len`
31. * @return Unary length/index
32. */
33. static inline int get_unary(BitstreamContext *bc, int stop, int len)
^
34. {
35. int i;
libavcodec/unary.h:39:5: Assignment
37. for (i = 0; i < len && bitstream_read_bit(bc) != stop; i++)
38. ;
39. return i;
^
40. }
41.
libavcodec/unary.h:49:5: Assignment
47. static inline int get_unary_0_33(BitstreamContext *bc)
48. {
49. return get_unary(bc, 0, 33);
^
50. }
51.
libavcodec/wavpack.c:309:13: Assignment
307. }
308. } else {
309. t = get_unary_0_33(bc);
^
310. if (t >= 2) {
311. if (bitstream_bits_left(bc) < t - 1)
libavcodec/wavpack.c:313:21: Call
311. if (bitstream_bits_left(bc) < t - 1)
312. goto error;
313. t = bitstream_read(bc, t - 1) | (1 << (t - 1));
^
314. } else {
315. if (bitstream_bits_left(bc) < 0)
libavcodec/bitstream.h:183:1: Parameter `n`
181.
182. /* Return n bits from the buffer. n has to be in the 0-32 range. */
183. static inline uint32_t bitstream_read(BitstreamContext *bc, unsigned n)
^
184. {
185. if (!n)
libavcodec/bitstream.h:194:12: Call
192. }
193.
194. return get_val(bc, n);
^
195. }
196.
libavcodec/bitstream.h:130:1: <LHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `bc->bits_left`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: <RHS trace>
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:130:1: Parameter `n`
128. }
129.
130. static inline uint64_t get_val(BitstreamContext *bc, unsigned n)
^
131. {
132. #ifdef BITSTREAM_READER_LE
libavcodec/bitstream.h:139:5: Binary operation: ([1, +oo] - [1, 32]):unsigned32 by call to `bitstream_read`
137. bc->bits <<= n;
138. #endif
139. bc->bits_left -= n;
^
140.
141. return ret;
|
https://github.com/libav/libav/blob/562ef82d6a7f96f6b9da1219a5aaf7d9d7056f1b/libavcodec/bitstream.h/#L139
|
d2a_code_trace_data_45663
|
void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
{
int i, j, max;
const BN_ULONG *ap;
BN_ULONG *rp;
max = n * 2;
ap = a;
rp = r;
rp[0] = rp[max - 1] = 0;
rp++;
j = n;
if (--j > 0) {
ap++;
rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
rp += 2;
}
for (i = n - 2; i > 0; i--) {
j--;
ap++;
rp[j] = bn_mul_add_words(rp, ap, j, ap[-1]);
rp += 2;
}
bn_add_words(r, r, r, max);
bn_sqr_words(tmp, a, n);
bn_add_words(r, r, tmp, max);
}
crypto/ec/ecdsa_ossl.c:281: error: BUFFER_OVERRUN_L3
Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_mul`.
Showing all 17 steps of the trace
crypto/ec/ecdsa_ossl.c:249:10: Call
247. if (8 * dgst_len > i)
248. dgst_len = (i + 7) / 8;
249. if (!BN_bin2bn(dgst, dgst_len, m)) {
^
250. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
251. goto err;
crypto/bn/bn_lib.c:475:1: Parameter `ret->top`
473. }
474.
475. > BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
476. {
477. unsigned int i, m;
crypto/ec/ecdsa_ossl.c:281:14: Call
279. goto err;
280. }
281. if (!BN_mod_mul(s, s, ckinv, order, ctx)) {
^
282. ECerr(EC_F_OSSL_ECDSA_SIGN_SIG, ERR_R_BN_LIB);
283. goto err;
crypto/bn/bn_mod.c:73:1: Parameter `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:104:1: <Offset trace>
102.
103. /* tmp must have 2*n words */
104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
105. {
106. int i, j, max;
crypto/bn/bn_sqr.c:104:1: Parameter `n`
102.
103. /* tmp must have 2*n words */
104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
105. {
106. int i, j, max;
crypto/bn/bn_sqr.c:115:5: Assignment
113. rp[0] = rp[max - 1] = 0;
114. rp++;
115. j = n;
^
116.
117. if (--j > 0) {
crypto/bn/bn_sqr.c:117:9: Assignment
115. j = n;
116.
117. if (--j > 0) {
^
118. ap++;
119. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
crypto/bn/bn_sqr.c:104:1: <Length trace>
102.
103. /* tmp must have 2*n words */
104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
105. {
106. int i, j, max;
crypto/bn/bn_sqr.c:104:1: Parameter `*r`
102.
103. /* tmp must have 2*n words */
104. > void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
105. {
106. int i, j, max;
crypto/bn/bn_sqr.c:112:5: Assignment
110. max = n * 2;
111. ap = a;
112. rp = r;
^
113. rp[0] = rp[max - 1] = 0;
114. rp++;
crypto/bn/bn_sqr.c:114:5: Assignment
112. rp = r;
113. rp[0] = rp[max - 1] = 0;
114. rp++;
^
115. j = n;
116.
crypto/bn/bn_sqr.c:119:9: Array access: Offset: [16, +oo] (⇐ 1 + [15, +oo]) Size: [0, 8388607] by call to `BN_mod_mul`
117. if (--j > 0) {
118. ap++;
119. rp[j] = bn_mul_words(rp, ap, j, ap[-1]);
^
120. rp += 2;
121. }
|
https://github.com/openssl/openssl/blob/69588edbaa424beb71c6a9b1be416588232cb78c/crypto/bn/bn_sqr.c/#L119
|
d2a_code_trace_data_45664
|
int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file)
{
int ret = 0;
char *enabled_logs;
CTLOG_STORE_LOAD_CTX* load_ctx = ctlog_store_load_ctx_new();
if (load_ctx == NULL)
goto end;
load_ctx->log_store = store;
load_ctx->conf = NCONF_new(NULL);
if (load_ctx->conf == NULL)
goto end;
if (NCONF_load(load_ctx->conf, file, NULL) <= 0) {
CTerr(CT_F_CTLOG_STORE_LOAD_FILE, CT_R_LOG_CONF_INVALID);
goto end;
}
enabled_logs = NCONF_get_string(load_ctx->conf, NULL, "enabled_logs");
if (enabled_logs == NULL) {
CTerr(CT_F_CTLOG_STORE_LOAD_FILE, CT_R_LOG_CONF_INVALID);
goto end;
}
if (!CONF_parse_list(enabled_logs, ',', 1, ctlog_store_load_log, load_ctx) ||
load_ctx->invalid_log_entries > 0) {
CTerr(CT_F_CTLOG_STORE_LOAD_FILE, CT_R_LOG_CONF_INVALID);
goto end;
}
ret = 1;
end:
NCONF_free(load_ctx->conf);
ctlog_store_load_ctx_free(load_ctx);
return ret;
}
crypto/ct/ct_log.c:227: error: NULL_DEREFERENCE
pointer `load_ctx` last assigned on line 199 could be null and is dereferenced at line 227, column 16.
Showing all 27 steps of the trace
crypto/ct/ct_log.c:195:1: start of procedure CTLOG_STORE_load_file()
193. }
194.
195. > int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file)
196. {
197. int ret = 0;
crypto/ct/ct_log.c:197:5:
195. int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file)
196. {
197. > int ret = 0;
198. char *enabled_logs;
199. CTLOG_STORE_LOAD_CTX* load_ctx = ctlog_store_load_ctx_new();
crypto/ct/ct_log.c:199:5:
197. int ret = 0;
198. char *enabled_logs;
199. > CTLOG_STORE_LOAD_CTX* load_ctx = ctlog_store_load_ctx_new();
200.
201. if (load_ctx == NULL)
crypto/ct/ct_log.c:57:1: start of procedure ctlog_store_load_ctx_new()
55. static void ctlog_store_load_ctx_free(CTLOG_STORE_LOAD_CTX* ctx);
56.
57. > static CTLOG_STORE_LOAD_CTX *ctlog_store_load_ctx_new()
58. {
59. CTLOG_STORE_LOAD_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
crypto/ct/ct_log.c:59:5:
57. static CTLOG_STORE_LOAD_CTX *ctlog_store_load_ctx_new()
58. {
59. > CTLOG_STORE_LOAD_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
60.
61. if (ctx == NULL)
crypto/mem.c:198:1: start of procedure CRYPTO_zalloc()
196. }
197.
198. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
199. {
200. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:200:5:
198. void *CRYPTO_zalloc(size_t num, const char *file, int line)
199. {
200. > void *ret = CRYPTO_malloc(num, file, line);
201.
202. FAILTEST();
crypto/mem.c:170:1: start of procedure CRYPTO_malloc()
168. #endif
169.
170. > void *CRYPTO_malloc(size_t num, const char *file, int line)
171. {
172. void *ret = NULL;
crypto/mem.c:172:5:
170. void *CRYPTO_malloc(size_t num, const char *file, int line)
171. {
172. > void *ret = NULL;
173.
174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
crypto/mem.c:174:9: Taking false branch
172. void *ret = NULL;
173.
174. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
175. return malloc_impl(num, file, line);
176.
crypto/mem.c:177:9: Taking false branch
175. return malloc_impl(num, file, line);
176.
177. if (num == 0)
^
178. return NULL;
179.
crypto/mem.c:181:5:
179.
180. FAILTEST();
181. > allow_customize = 0;
182. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
183. if (call_malloc_debug) {
crypto/mem.c:191:5:
189. }
190. #else
191. > (void)(file); (void)(line);
192. ret = malloc(num);
193. #endif
crypto/mem.c:191:19:
189. }
190. #else
191. > (void)(file); (void)(line);
192. ret = malloc(num);
193. #endif
crypto/mem.c:192:5:
190. #else
191. (void)(file); (void)(line);
192. > ret = malloc(num);
193. #endif
194.
crypto/mem.c:195:5:
193. #endif
194.
195. > return ret;
196. }
197.
crypto/mem.c:196:1: return from a call to CRYPTO_malloc
194.
195. return ret;
196. > }
197.
198. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:203:9: Taking false branch
201.
202. FAILTEST();
203. if (ret != NULL)
^
204. memset(ret, 0, num);
205. return ret;
crypto/mem.c:205:5:
203. if (ret != NULL)
204. memset(ret, 0, num);
205. > return ret;
206. }
207.
crypto/mem.c:206:1: return from a call to CRYPTO_zalloc
204. memset(ret, 0, num);
205. return ret;
206. > }
207.
208. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/ct/ct_log.c:61:9: Taking true branch
59. CTLOG_STORE_LOAD_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
60.
61. if (ctx == NULL)
^
62. CTerr(CT_F_CTLOG_STORE_LOAD_CTX_NEW, ERR_R_MALLOC_FAILURE);
63.
crypto/ct/ct_log.c:62:9: Skipping ERR_put_error(): empty list of specs
60.
61. if (ctx == NULL)
62. CTerr(CT_F_CTLOG_STORE_LOAD_CTX_NEW, ERR_R_MALLOC_FAILURE);
^
63.
64. return ctx;
crypto/ct/ct_log.c:64:5:
62. CTerr(CT_F_CTLOG_STORE_LOAD_CTX_NEW, ERR_R_MALLOC_FAILURE);
63.
64. > return ctx;
65. }
66.
crypto/ct/ct_log.c:65:1: return from a call to ctlog_store_load_ctx_new
63.
64. return ctx;
65. > }
66.
67. static void ctlog_store_load_ctx_free(CTLOG_STORE_LOAD_CTX* ctx)
crypto/ct/ct_log.c:201:9: Taking true branch
199. CTLOG_STORE_LOAD_CTX* load_ctx = ctlog_store_load_ctx_new();
200.
201. if (load_ctx == NULL)
^
202. goto end;
203. load_ctx->log_store = store;
crypto/ct/ct_log.c:226:1:
224.
225. ret = 1;
226. > end:
227. NCONF_free(load_ctx->conf);
228. ctlog_store_load_ctx_free(load_ctx);
crypto/ct/ct_log.c:227:5:
225. ret = 1;
226. end:
227. > NCONF_free(load_ctx->conf);
228. ctlog_store_load_ctx_free(load_ctx);
229. return ret;
|
https://github.com/openssl/openssl/blob/d3c3dfc5778ab2cca0d25c5959c8b814a334addb/crypto/ct/ct_log.c/#L227
|
d2a_code_trace_data_45665
|
static int int_ts_RESP_verify_token(TS_VERIFY_CTX *ctx,
PKCS7 *token, TS_TST_INFO *tst_info)
{
X509 *signer = NULL;
GENERAL_NAME *tsa_name = tst_info->tsa;
X509_ALGOR *md_alg = NULL;
unsigned char *imprint = NULL;
unsigned imprint_len = 0;
int ret = 0;
int flags = ctx->flags;
if (((flags & TS_VFY_SIGNER) && tsa_name != NULL)
|| (flags & TS_VFY_TSA_NAME)) {
flags |= TS_VFY_SIGNATURE;
}
if ((flags & TS_VFY_SIGNATURE)
&& !TS_RESP_verify_signature(token, ctx->certs, ctx->store, &signer))
goto err;
if ((flags & TS_VFY_VERSION)
&& TS_TST_INFO_get_version(tst_info) != 1) {
TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_UNSUPPORTED_VERSION);
goto err;
}
if ((flags & TS_VFY_POLICY)
&& !ts_check_policy(ctx->policy, tst_info))
goto err;
if ((flags & TS_VFY_IMPRINT)
&& !ts_check_imprints(ctx->md_alg, ctx->imprint, ctx->imprint_len,
tst_info))
goto err;
if ((flags & TS_VFY_DATA)
&& (!ts_compute_imprint(ctx->data, tst_info,
&md_alg, &imprint, &imprint_len)
|| !ts_check_imprints(md_alg, imprint, imprint_len, tst_info)))
goto err;
if ((flags & TS_VFY_NONCE)
&& !ts_check_nonces(ctx->nonce, tst_info))
goto err;
if ((flags & TS_VFY_SIGNER)
&& tsa_name && !ts_check_signer_name(tsa_name, signer)) {
TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);
goto err;
}
if ((flags & TS_VFY_TSA_NAME)
&& !ts_check_signer_name(ctx->tsa_name, signer)) {
TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_UNTRUSTED);
goto err;
}
ret = 1;
err:
X509_free(signer);
X509_ALGOR_free(md_alg);
OPENSSL_free(imprint);
return ret;
}
crypto/ts/ts_rsp_verify.c:452: error: NULL_DEREFERENCE
pointer `signer` last assigned on line 414 could be null and is dereferenced by call to `ts_check_signer_name()` at line 452, column 25.
Showing all 34 steps of the trace
crypto/ts/ts_rsp_verify.c:411:1: start of procedure int_ts_RESP_verify_token()
409. * - Check if the TSA name is the expected TSA.
410. */
411. > static int int_ts_RESP_verify_token(TS_VERIFY_CTX *ctx,
412. PKCS7 *token, TS_TST_INFO *tst_info)
413. {
crypto/ts/ts_rsp_verify.c:414:5:
412. PKCS7 *token, TS_TST_INFO *tst_info)
413. {
414. > X509 *signer = NULL;
415. GENERAL_NAME *tsa_name = tst_info->tsa;
416. X509_ALGOR *md_alg = NULL;
crypto/ts/ts_rsp_verify.c:415:5:
413. {
414. X509 *signer = NULL;
415. > GENERAL_NAME *tsa_name = tst_info->tsa;
416. X509_ALGOR *md_alg = NULL;
417. unsigned char *imprint = NULL;
crypto/ts/ts_rsp_verify.c:416:5:
414. X509 *signer = NULL;
415. GENERAL_NAME *tsa_name = tst_info->tsa;
416. > X509_ALGOR *md_alg = NULL;
417. unsigned char *imprint = NULL;
418. unsigned imprint_len = 0;
crypto/ts/ts_rsp_verify.c:417:5:
415. GENERAL_NAME *tsa_name = tst_info->tsa;
416. X509_ALGOR *md_alg = NULL;
417. > unsigned char *imprint = NULL;
418. unsigned imprint_len = 0;
419. int ret = 0;
crypto/ts/ts_rsp_verify.c:418:5:
416. X509_ALGOR *md_alg = NULL;
417. unsigned char *imprint = NULL;
418. > unsigned imprint_len = 0;
419. int ret = 0;
420. int flags = ctx->flags;
crypto/ts/ts_rsp_verify.c:419:5:
417. unsigned char *imprint = NULL;
418. unsigned imprint_len = 0;
419. > int ret = 0;
420. int flags = ctx->flags;
421.
crypto/ts/ts_rsp_verify.c:420:5:
418. unsigned imprint_len = 0;
419. int ret = 0;
420. > int flags = ctx->flags;
421.
422. /* Some options require us to also check the signature */
crypto/ts/ts_rsp_verify.c:423:11: Taking true branch
421.
422. /* Some options require us to also check the signature */
423. if (((flags & TS_VFY_SIGNER) && tsa_name != NULL)
^
424. || (flags & TS_VFY_TSA_NAME)) {
425. flags |= TS_VFY_SIGNATURE;
crypto/ts/ts_rsp_verify.c:423:37: Taking true branch
421.
422. /* Some options require us to also check the signature */
423. if (((flags & TS_VFY_SIGNER) && tsa_name != NULL)
^
424. || (flags & TS_VFY_TSA_NAME)) {
425. flags |= TS_VFY_SIGNATURE;
crypto/ts/ts_rsp_verify.c:425:9:
423. if (((flags & TS_VFY_SIGNER) && tsa_name != NULL)
424. || (flags & TS_VFY_TSA_NAME)) {
425. > flags |= TS_VFY_SIGNATURE;
426. }
427.
crypto/ts/ts_rsp_verify.c:428:10: Taking false branch
426. }
427.
428. if ((flags & TS_VFY_SIGNATURE)
^
429. && !TS_RESP_verify_signature(token, ctx->certs, ctx->store, &signer))
430. goto err;
crypto/ts/ts_rsp_verify.c:431:10: Taking false branch
429. && !TS_RESP_verify_signature(token, ctx->certs, ctx->store, &signer))
430. goto err;
431. if ((flags & TS_VFY_VERSION)
^
432. && TS_TST_INFO_get_version(tst_info) != 1) {
433. TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_UNSUPPORTED_VERSION);
crypto/ts/ts_rsp_verify.c:436:10: Taking true branch
434. goto err;
435. }
436. if ((flags & TS_VFY_POLICY)
^
437. && !ts_check_policy(ctx->policy, tst_info))
438. goto err;
crypto/ts/ts_rsp_verify.c:437:13:
435. }
436. if ((flags & TS_VFY_POLICY)
437. > && !ts_check_policy(ctx->policy, tst_info))
438. goto err;
439. if ((flags & TS_VFY_IMPRINT)
crypto/ts/ts_rsp_verify.c:552:1: start of procedure ts_check_policy()
550. }
551.
552. > static int ts_check_policy(const ASN1_OBJECT *req_oid,
553. const TS_TST_INFO *tst_info)
554. {
crypto/ts/ts_rsp_verify.c:555:5:
553. const TS_TST_INFO *tst_info)
554. {
555. > const ASN1_OBJECT *resp_oid = tst_info->policy_id;
556.
557. if (OBJ_cmp(req_oid, resp_oid) != 0) {
crypto/ts/ts_rsp_verify.c:557:9:
555. const ASN1_OBJECT *resp_oid = tst_info->policy_id;
556.
557. > if (OBJ_cmp(req_oid, resp_oid) != 0) {
558. TSerr(TS_F_TS_CHECK_POLICY, TS_R_POLICY_MISMATCH);
559. return 0;
crypto/objects/obj_lib.c:58:1: start of procedure OBJ_cmp()
56. }
57.
58. > int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
59. {
60. int ret;
crypto/objects/obj_lib.c:62:5:
60. int ret;
61.
62. > ret = (a->length - b->length);
63. if (ret)
64. return (ret);
crypto/objects/obj_lib.c:63:9: Taking true branch
61.
62. ret = (a->length - b->length);
63. if (ret)
^
64. return (ret);
65. return (memcmp(a->data, b->data, a->length));
crypto/objects/obj_lib.c:64:9:
62. ret = (a->length - b->length);
63. if (ret)
64. > return (ret);
65. return (memcmp(a->data, b->data, a->length));
66. }
crypto/objects/obj_lib.c:66:1: return from a call to OBJ_cmp
64. return (ret);
65. return (memcmp(a->data, b->data, a->length));
66. > }
crypto/ts/ts_rsp_verify.c:557:9: Taking false branch
555. const ASN1_OBJECT *resp_oid = tst_info->policy_id;
556.
557. if (OBJ_cmp(req_oid, resp_oid) != 0) {
^
558. TSerr(TS_F_TS_CHECK_POLICY, TS_R_POLICY_MISMATCH);
559. return 0;
crypto/ts/ts_rsp_verify.c:562:5:
560. }
561.
562. > return 1;
563. }
564.
crypto/ts/ts_rsp_verify.c:563:1: return from a call to ts_check_policy
561.
562. return 1;
563. > }
564.
565. static int ts_compute_imprint(BIO *data, TS_TST_INFO *tst_info,
crypto/ts/ts_rsp_verify.c:437:13: Taking false branch
435. }
436. if ((flags & TS_VFY_POLICY)
437. && !ts_check_policy(ctx->policy, tst_info))
^
438. goto err;
439. if ((flags & TS_VFY_IMPRINT)
crypto/ts/ts_rsp_verify.c:439:10: Taking true branch
437. && !ts_check_policy(ctx->policy, tst_info))
438. goto err;
439. if ((flags & TS_VFY_IMPRINT)
^
440. && !ts_check_imprints(ctx->md_alg, ctx->imprint, ctx->imprint_len,
441. tst_info))
crypto/ts/ts_rsp_verify.c:440:13: Taking false branch
438. goto err;
439. if ((flags & TS_VFY_IMPRINT)
440. && !ts_check_imprints(ctx->md_alg, ctx->imprint, ctx->imprint_len,
^
441. tst_info))
442. goto err;
crypto/ts/ts_rsp_verify.c:443:10: Taking false branch
441. tst_info))
442. goto err;
443. if ((flags & TS_VFY_DATA)
^
444. && (!ts_compute_imprint(ctx->data, tst_info,
445. &md_alg, &imprint, &imprint_len)
crypto/ts/ts_rsp_verify.c:448:10: Taking false branch
446. || !ts_check_imprints(md_alg, imprint, imprint_len, tst_info)))
447. goto err;
448. if ((flags & TS_VFY_NONCE)
^
449. && !ts_check_nonces(ctx->nonce, tst_info))
450. goto err;
crypto/ts/ts_rsp_verify.c:451:10: Taking true branch
449. && !ts_check_nonces(ctx->nonce, tst_info))
450. goto err;
451. if ((flags & TS_VFY_SIGNER)
^
452. && tsa_name && !ts_check_signer_name(tsa_name, signer)) {
453. TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);
crypto/ts/ts_rsp_verify.c:452:12: Taking true branch
450. goto err;
451. if ((flags & TS_VFY_SIGNER)
452. && tsa_name && !ts_check_signer_name(tsa_name, signer)) {
^
453. TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);
454. goto err;
crypto/ts/ts_rsp_verify.c:452:25:
450. goto err;
451. if ((flags & TS_VFY_SIGNER)
452. > && tsa_name && !ts_check_signer_name(tsa_name, signer)) {
453. TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH);
454. goto err;
|
https://github.com/openssl/openssl/blob/84c34ba8762463057d372e22ad98a045dbd9a51f/crypto/ts/ts_rsp_verify.c/#L452
|
d2a_code_trace_data_45666
|
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:352: error: BUFFER_OVERRUN_L3
Offset added: [1, +oo] Size: [0, +oo] by call to `ossl_method_store_add`.
Showing all 10 steps of the trace
test/property_test.c:335:1: Array declaration
333. }
334.
335. > static int test_query_cache_stochastic(void)
336. {
337. const int max = 10000, tail = 10;
test/property_test.c:352:14: Call
350. v[i] = 2 * i;
351. BIO_snprintf(buf, sizeof(buf), "n=%d\n", i);
352. if (!TEST_true(ossl_method_store_add(store, NULL, i, buf, "abc",
^
353. NULL, NULL))
354. || !TEST_true(ossl_method_store_cache_set(store, i, buf, v + i))
crypto/property/property.c:177:1: Parameter `*properties`
175. }
176.
177. > int ossl_method_store_add(OSSL_METHOD_STORE *store, const OSSL_PROVIDER *prov,
178. int nid, const char *properties, void *method,
179. int (*method_up_ref)(void *),
crypto/property/property.c:216:9: Call
214. if (impl->properties == NULL)
215. goto err;
216. ossl_prop_defn_set(store->ctx, properties, impl->properties);
^
217. }
218.
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, +oo] 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/c1d56231ef6385b557ec72eec508e55ea26ca8b0/crypto/property/defn_cache.c/#L109
|
d2a_code_trace_data_45667
|
static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
{
const char *codec_string = encoder ? "encoder" : "decoder";
AVCodec *codec;
if(!name)
return CODEC_ID_NONE;
codec = encoder ?
avcodec_find_encoder_by_name(name) :
avcodec_find_decoder_by_name(name);
if(!codec) {
fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
ffmpeg_exit(1);
}
if(codec->type != type) {
fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
ffmpeg_exit(1);
}
if(codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
strict > FF_COMPLIANCE_EXPERIMENTAL) {
fprintf(stderr, "%s '%s' is experimental and might produce bad "
"results.\nAdd '-strict experimental' if you want to use it.\n",
codec_string, codec->name);
codec = encoder ?
avcodec_find_encoder(codec->id) :
avcodec_find_decoder(codec->id);
if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
fprintf(stderr, "Or use the non experimental %s '%s'.\n",
codec_string, codec->name);
ffmpeg_exit(1);
}
return codec->id;
}
ffmpeg.c:3127: error: Null Dereference
pointer `codec` last assigned on line 3120 could be null and is dereferenced at line 3127, column 8.
ffmpeg.c:3113:1: start of procedure find_codec_or_die()
3111. }
3112.
3113. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
^
3114. {
3115. const char *codec_string = encoder ? "encoder" : "decoder";
ffmpeg.c:3115:32: Condition is true
3113. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3114. {
3115. const char *codec_string = encoder ? "encoder" : "decoder";
^
3116. AVCodec *codec;
3117.
ffmpeg.c:3115:5:
3113. static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
3114. {
3115. const char *codec_string = encoder ? "encoder" : "decoder";
^
3116. AVCodec *codec;
3117.
ffmpeg.c:3118:9: Taking false branch
3116. AVCodec *codec;
3117.
3118. if(!name)
^
3119. return CODEC_ID_NONE;
3120. codec = encoder ?
ffmpeg.c:3120:13: Condition is true
3118. if(!name)
3119. return CODEC_ID_NONE;
3120. codec = encoder ?
^
3121. avcodec_find_encoder_by_name(name) :
3122. avcodec_find_decoder_by_name(name);
ffmpeg.c:3120:5:
3118. if(!name)
3119. return CODEC_ID_NONE;
3120. codec = encoder ?
^
3121. avcodec_find_encoder_by_name(name) :
3122. avcodec_find_decoder_by_name(name);
ffmpeg.c:3123:9: Taking true branch
3121. avcodec_find_encoder_by_name(name) :
3122. avcodec_find_decoder_by_name(name);
3123. if(!codec) {
^
3124. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3125. ffmpeg_exit(1);
ffmpeg.c:3124:9:
3122. avcodec_find_decoder_by_name(name);
3123. if(!codec) {
3124. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
^
3125. ffmpeg_exit(1);
3126. }
ffmpeg.c:3125:9: Skipping ffmpeg_exit(): empty list of specs
3123. if(!codec) {
3124. fprintf(stderr, "Unknown %s '%s'\n", codec_string, name);
3125. ffmpeg_exit(1);
^
3126. }
3127. if(codec->type != type) {
ffmpeg.c:3127:8:
3125. ffmpeg_exit(1);
3126. }
3127. if(codec->type != type) {
^
3128. fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
3129. ffmpeg_exit(1);
|
https://github.com/libav/libav/blob/6465c820da7b104150366a8cdd837c00cf364235/ffmpeg.c/#L3127
|
d2a_code_trace_data_45668
|
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:4228: error: NULL_DEREFERENCE
pointer `cpk` last assigned on line 4227 could be null and is dereferenced at line 4228, column 45.
Showing all 32 steps of the trace
ssl/t1_lib.c:4216:1: start of procedure ssl_get_auto_dh()
4214.
4215. #ifndef OPENSSL_NO_DH
4216. > DH *ssl_get_auto_dh(SSL *s)
4217. {
4218. int dh_secbits = 80;
ssl/t1_lib.c:4218:5:
4216. DH *ssl_get_auto_dh(SSL *s)
4217. {
4218. > int dh_secbits = 80;
4219. if (s->cert->dh_tmp_auto == 2)
4220. return DH_get_1024_160();
ssl/t1_lib.c:4219:9: Taking false branch
4217. {
4218. int dh_secbits = 80;
4219. if (s->cert->dh_tmp_auto == 2)
^
4220. return DH_get_1024_160();
4221. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
ssl/t1_lib.c:4221:9: Taking false branch
4219. if (s->cert->dh_tmp_auto == 2)
4220. return DH_get_1024_160();
4221. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
^
4222. if (s->s3->tmp.new_cipher->strength_bits == 256)
4223. dh_secbits = 128;
ssl/t1_lib.c:4227:9:
4225. dh_secbits = 80;
4226. } else {
4227. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4228. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4229. }
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:1945:1: start of procedure ssl_cipher_get_cert_index()
1943.
1944. /* For a cipher return the index corresponding to the certificate type */
1945. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c)
1946. {
1947. uint32_t alg_k, alg_a;
ssl/ssl_ciph.c:1949:5:
1947. uint32_t alg_k, alg_a;
1948.
1949. > alg_k = c->algorithm_mkey;
1950. alg_a = c->algorithm_auth;
1951.
ssl/ssl_ciph.c:1950:5:
1948.
1949. alg_k = c->algorithm_mkey;
1950. > alg_a = c->algorithm_auth;
1951.
1952. if (alg_k & (SSL_kECDHr | SSL_kECDHe)) {
ssl/ssl_ciph.c:1952:9: Taking false branch
1950. alg_a = c->algorithm_auth;
1951.
1952. if (alg_k & (SSL_kECDHr | SSL_kECDHe)) {
^
1953. /*
1954. * we don't need to look at SSL_kECDHE since no certificate is needed
ssl/ssl_ciph.c:1962:16: Taking false branch
1960. */
1961. return SSL_PKEY_ECC;
1962. } else if (alg_a & SSL_aECDSA)
^
1963. return SSL_PKEY_ECC;
1964. else if (alg_a & SSL_aDSS)
ssl/ssl_ciph.c:1964:14: Taking false branch
1962. } else if (alg_a & SSL_aECDSA)
1963. return SSL_PKEY_ECC;
1964. else if (alg_a & SSL_aDSS)
^
1965. return SSL_PKEY_DSA_SIGN;
1966. else if (alg_a & SSL_aRSA)
ssl/ssl_ciph.c:1966:14: Taking true branch
1964. else if (alg_a & SSL_aDSS)
1965. return SSL_PKEY_DSA_SIGN;
1966. else if (alg_a & SSL_aRSA)
^
1967. return SSL_PKEY_RSA_ENC;
1968. else if (alg_a & SSL_aGOST12)
ssl/ssl_ciph.c:1967:9:
1965. return SSL_PKEY_DSA_SIGN;
1966. else if (alg_a & SSL_aRSA)
1967. > return SSL_PKEY_RSA_ENC;
1968. else if (alg_a & SSL_aGOST12)
1969. return SSL_PKEY_GOST_EC;
ssl/ssl_ciph.c:1974:1: return from a call to ssl_cipher_get_cert_index
1972.
1973. return -1;
1974. > }
1975.
1976. 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:4228:9:
4226. } else {
4227. CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
4228. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
4229. }
4230.
|
https://github.com/openssl/openssl/blob/e29c73c93b88a4b7f492c7c8c7343223e7548612/ssl/t1_lib.c/#L4228
|
d2a_code_trace_data_45669
|
static av_cold int movie_init(AVFilterContext *ctx)
{
MovieContext *movie = ctx->priv;
AVInputFormat *iformat = NULL;
AVStream *st;
AVCodec *codec;
int ret;
int64_t timestamp;
av_register_all();
iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
movie->format_ctx = NULL;
if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
av_log(ctx, AV_LOG_ERROR,
"Failed to avformat_open_input '%s'\n", movie->file_name);
return ret;
}
if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)
av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
if (movie->seek_point > 0) {
timestamp = movie->seek_point;
if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
av_log(ctx, AV_LOG_ERROR,
"%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
movie->file_name, movie->format_ctx->start_time, movie->seek_point);
return AVERROR(EINVAL);
}
timestamp += movie->format_ctx->start_time;
}
if ((ret = av_seek_frame(movie->format_ctx, -1, timestamp, AVSEEK_FLAG_BACKWARD)) < 0) {
av_log(ctx, AV_LOG_ERROR, "%s: could not seek to position %"PRId64"\n",
movie->file_name, timestamp);
return ret;
}
}
if ((ret = av_find_best_stream(movie->format_ctx, AVMEDIA_TYPE_VIDEO,
movie->stream_index, -1, NULL, 0)) < 0) {
av_log(ctx, AV_LOG_ERROR, "No video stream with index '%d' found\n",
movie->stream_index);
return ret;
}
movie->stream_index = ret;
st = movie->format_ctx->streams[movie->stream_index];
codec = avcodec_find_decoder(st->codecpar->codec_id);
if (!codec) {
av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\n");
return AVERROR(EINVAL);
}
movie->codec_ctx = avcodec_alloc_context3(codec);
if (!movie->codec_ctx)
return AVERROR(ENOMEM);
ret = avcodec_parameters_to_context(movie->codec_ctx, st->codecpar);
if (ret < 0)
return ret;
movie->codec_ctx->refcounted_frames = 1;
if ((ret = avcodec_open2(movie->codec_ctx, codec, NULL)) < 0) {
av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n");
return ret;
}
movie->w = movie->codec_ctx->width;
movie->h = movie->codec_ctx->height;
av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
movie->seek_point, movie->format_name, movie->file_name,
movie->stream_index);
return 0;
}
libavfilter/vsrc_movie.c:116: error: Null Dereference
pointer `movie->format_ctx` last assigned on line 103 could be null and is dereferenced at line 116, column 13.
libavfilter/vsrc_movie.c:89:1: start of procedure movie_init()
87. };
88.
89. static av_cold int movie_init(AVFilterContext *ctx)
^
90. {
91. MovieContext *movie = ctx->priv;
libavfilter/vsrc_movie.c:91:5:
89. static av_cold int movie_init(AVFilterContext *ctx)
90. {
91. MovieContext *movie = ctx->priv;
^
92. AVInputFormat *iformat = NULL;
93. AVStream *st;
libavfilter/vsrc_movie.c:92:5:
90. {
91. MovieContext *movie = ctx->priv;
92. AVInputFormat *iformat = NULL;
^
93. AVStream *st;
94. AVCodec *codec;
libavfilter/vsrc_movie.c:98:5:
96. int64_t timestamp;
97.
98. av_register_all();
^
99.
100. // Try to find the movie format (container)
libavformat/allformats.c:44:1: start of procedure av_register_all()
42. #define REGISTER_MUXDEMUX(X, x) REGISTER_MUXER(X, x); REGISTER_DEMUXER(X, x)
43.
44. void av_register_all(void)
^
45. {
46. static int initialized;
libavformat/allformats.c:48:9: Taking true branch
46. static int initialized;
47.
48. if (initialized)
^
49. return;
50. initialized = 1;
libavformat/allformats.c:49:9:
47.
48. if (initialized)
49. return;
^
50. initialized = 1;
51.
libavformat/allformats.c:261:1: return from a call to av_register_all
259. REGISTER_DEMUXER (YOP, yop);
260. REGISTER_MUXDEMUX(YUV4MPEGPIPE, yuv4mpegpipe);
261. }
^
libavfilter/vsrc_movie.c:101:15: Condition is true
99.
100. // Try to find the movie format (container)
101. iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
^
102.
103. movie->format_ctx = NULL;
libavfilter/vsrc_movie.c:101:5:
99.
100. // Try to find the movie format (container)
101. iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
^
102.
103. movie->format_ctx = NULL;
libavfilter/vsrc_movie.c:103:5:
101. iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
102.
103. movie->format_ctx = NULL;
^
104. if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
105. av_log(ctx, AV_LOG_ERROR,
libavfilter/vsrc_movie.c:104:9: Taking false branch
102.
103. movie->format_ctx = NULL;
104. if ((ret = avformat_open_input(&movie->format_ctx, movie->file_name, iformat, NULL)) < 0) {
^
105. av_log(ctx, AV_LOG_ERROR,
106. "Failed to avformat_open_input '%s'\n", movie->file_name);
libavfilter/vsrc_movie.c:109:9: Taking true branch
107. return ret;
108. }
109. if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)
^
110. av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
111.
libavfilter/vsrc_movie.c:110:9: Skipping av_log(): empty list of specs
108. }
109. if ((ret = avformat_find_stream_info(movie->format_ctx, NULL)) < 0)
110. av_log(ctx, AV_LOG_WARNING, "Failed to find stream info\n");
^
111.
112. // if seeking requested, we execute it
libavfilter/vsrc_movie.c:113:9: Taking true branch
111.
112. // if seeking requested, we execute it
113. if (movie->seek_point > 0) {
^
114. timestamp = movie->seek_point;
115. // add the stream start time, should it exist
libavfilter/vsrc_movie.c:114:9:
112. // if seeking requested, we execute it
113. if (movie->seek_point > 0) {
114. timestamp = movie->seek_point;
^
115. // add the stream start time, should it exist
116. if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
libavfilter/vsrc_movie.c:116:13:
114. timestamp = movie->seek_point;
115. // add the stream start time, should it exist
116. if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
^
117. if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
118. av_log(ctx, AV_LOG_ERROR,
|
https://github.com/libav/libav/blob/d0c84c41d33ffd270d5f9fe0290e08341397fdee/libavfilter/vsrc_movie.c/#L116
|
d2a_code_trace_data_45670
|
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
{
unsigned long hash;
OPENSSL_LH_NODE *nn, **rn;
void *ret;
lh->error = 0;
rn = getrn(lh, data, &hash);
if (*rn == NULL) {
lh->num_no_delete++;
return (NULL);
} else {
nn = *rn;
*rn = nn->next;
ret = nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
contract(lh);
return (ret);
}
ssl/bio_ssl.c:248: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_clear`.
Showing all 14 steps of the trace
ssl/bio_ssl.c:248:14: Call
246. SSL_set_accept_state(ssl);
247.
248. if (!SSL_clear(ssl)) {
^
249. ret = 0;
250. break;
ssl/ssl_lib.c:440:1: Parameter `s->initial_ctx->sessions->num_items`
438. }
439.
440. > int SSL_clear(SSL *s)
441. {
442. if (s->method == NULL) {
ssl/ssl_lib.c:447:9: Call
445. }
446.
447. if (ssl_clear_bad_session(s)) {
^
448. SSL_SESSION_free(s->session);
449. s->session = NULL;
ssl/ssl_sess.c:986:1: Parameter `s->initial_ctx->sessions->num_items`
984. }
985.
986. > int ssl_clear_bad_session(SSL *s)
987. {
988. if ((s->session != NULL) &&
ssl/ssl_sess.c:991:9: Call
989. !(s->shutdown & SSL_SENT_SHUTDOWN) &&
990. !(SSL_in_init(s) || SSL_in_before(s))) {
991. SSL_CTX_remove_session(s->session_ctx, s->session);
^
992. return (1);
993. } else
ssl/ssl_sess.c:693:1: Parameter `ctx->sessions->num_items`
691. }
692.
693. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
694. {
695. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:695:12: Call
693. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
694. {
695. return remove_session_lock(ctx, c, 1);
^
696. }
697.
ssl/ssl_sess.c:698:1: Parameter `ctx->sessions->num_items`
696. }
697.
698. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
699. {
700. SSL_SESSION *r;
ssl/ssl_sess.c:708:17: Call
706. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
707. ret = 1;
708. r = lh_SSL_SESSION_delete(ctx->sessions, c);
^
709. SSL_SESSION_list_remove(ctx, c);
710. }
ssl/ssl_locl.h:581:1: Parameter `lh->num_items`
579. };
580.
581. > DEFINE_LHASH_OF(SSL_SESSION);
582. /* Needed in ssl_cert.c */
583. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:581:1: Call
579. };
580.
581. > DEFINE_LHASH_OF(SSL_SESSION);
582. /* Needed in ssl_cert.c */
583. DEFINE_LHASH_OF(X509_NAME);
crypto/lhash/lhash.c:103:1: <LHS trace>
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:103:1: Parameter `lh->num_items`
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:123:5: Binary operation: ([0, +oo] - 1):unsigned64 by call to `SSL_clear`
121. }
122.
123. lh->num_items--;
^
124. if ((lh->num_nodes > MIN_NODES) &&
125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
|
https://github.com/openssl/openssl/blob/2dca984babedf93c560aba54da3f4c9222ee0d12/crypto/lhash/lhash.c/#L123
|
d2a_code_trace_data_45671
|
static int cert_status_cb(SSL *s, void *arg)
{
tlsextstatusctx *srctx = arg;
BIO *err = srctx->err;
char *host, *port, *path;
int use_ssl;
unsigned char *rspder = NULL;
int rspderlen;
STACK_OF(OPENSSL_STRING) *aia = NULL;
X509 *x = NULL;
X509_STORE_CTX inctx;
X509_OBJECT obj;
OCSP_REQUEST *req = NULL;
OCSP_RESPONSE *resp = NULL;
OCSP_CERTID *id = NULL;
STACK_OF(X509_EXTENSION) *exts;
int ret = SSL_TLSEXT_ERR_NOACK;
int i;
#if 0
STACK_OF(OCSP_RESPID) *ids;
SSL_get_tlsext_status_ids(s, &ids);
BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
#endif
if (srctx->verbose)
BIO_puts(err, "cert_status: callback called\n");
x = SSL_get_certificate(s);
aia = X509_get1_ocsp(x);
if (aia)
{
if (!OCSP_parse_url(sk_OPENSSL_STRING_value(aia, 0),
&host, &port, &path, &use_ssl))
{
BIO_puts(err, "cert_status: can't parse AIA URL\n");
goto err;
}
if (srctx->verbose)
BIO_printf(err, "cert_status: AIA URL: %s\n",
sk_OPENSSL_STRING_value(aia, 0));
}
else
{
if (!srctx->host)
{
BIO_puts(srctx->err, "cert_status: no AIA and no default responder URL\n");
goto done;
}
host = srctx->host;
path = srctx->path;
port = srctx->port;
use_ssl = srctx->use_ssl;
}
if (!X509_STORE_CTX_init(&inctx,
SSL_CTX_get_cert_store(SSL_get_SSL_CTX(s)),
NULL, NULL))
goto err;
if (X509_STORE_get_by_subject(&inctx,X509_LU_X509,
X509_get_issuer_name(x),&obj) <= 0)
{
BIO_puts(err, "cert_status: Can't retrieve issuer certificate.\n");
X509_STORE_CTX_cleanup(&inctx);
goto done;
}
req = OCSP_REQUEST_new();
if (!req)
goto err;
id = OCSP_cert_to_id(NULL, x, obj.data.x509);
X509_free(obj.data.x509);
X509_STORE_CTX_cleanup(&inctx);
if (!id)
goto err;
if (!OCSP_request_add0_id(req, id))
goto err;
id = NULL;
SSL_get_tlsext_status_exts(s, &exts);
for (i = 0; i < sk_X509_EXTENSION_num(exts); i++)
{
X509_EXTENSION *ext = sk_X509_EXTENSION_value(exts, i);
if (!OCSP_REQUEST_add_ext(req, ext, -1))
goto err;
}
resp = process_responder(err, req, host, path, port, use_ssl, NULL,
srctx->timeout);
if (!resp)
{
BIO_puts(err, "cert_status: error querying responder\n");
goto done;
}
rspderlen = i2d_OCSP_RESPONSE(resp, &rspder);
if (rspderlen <= 0)
goto err;
SSL_set_tlsext_status_ocsp_resp(s, rspder, rspderlen);
if (srctx->verbose)
{
BIO_puts(err, "cert_status: ocsp response sent:\n");
OCSP_RESPONSE_print(err, resp, 2);
}
ret = SSL_TLSEXT_ERR_OK;
done:
if (ret != SSL_TLSEXT_ERR_OK)
ERR_print_errors(err);
if (aia)
{
OPENSSL_free(host);
OPENSSL_free(path);
OPENSSL_free(port);
X509_email_free(aia);
}
if (id)
OCSP_CERTID_free(id);
if (req)
OCSP_REQUEST_free(req);
if (resp)
OCSP_RESPONSE_free(resp);
return ret;
err:
ret = SSL_TLSEXT_ERR_ALERT_FATAL;
goto done;
}
apps/s_server.c:824: error: NULL_DEREFERENCE
pointer `x` last assigned on line 823 could be null and is dereferenced by call to `X509_get1_ocsp()` at line 824, column 8.
Showing all 31 steps of the trace
apps/s_server.c:797:1: start of procedure cert_status_cb()
795. */
796.
797. > static int cert_status_cb(SSL *s, void *arg)
798. {
799. tlsextstatusctx *srctx = arg;
apps/s_server.c:799:2:
797. static int cert_status_cb(SSL *s, void *arg)
798. {
799. > tlsextstatusctx *srctx = arg;
800. BIO *err = srctx->err;
801. char *host, *port, *path;
apps/s_server.c:800:2:
798. {
799. tlsextstatusctx *srctx = arg;
800. > BIO *err = srctx->err;
801. char *host, *port, *path;
802. int use_ssl;
apps/s_server.c:803:2:
801. char *host, *port, *path;
802. int use_ssl;
803. > unsigned char *rspder = NULL;
804. int rspderlen;
805. STACK_OF(OPENSSL_STRING) *aia = NULL;
apps/s_server.c:805:2:
803. unsigned char *rspder = NULL;
804. int rspderlen;
805. > STACK_OF(OPENSSL_STRING) *aia = NULL;
806. X509 *x = NULL;
807. X509_STORE_CTX inctx;
apps/s_server.c:806:2:
804. int rspderlen;
805. STACK_OF(OPENSSL_STRING) *aia = NULL;
806. > X509 *x = NULL;
807. X509_STORE_CTX inctx;
808. X509_OBJECT obj;
apps/s_server.c:809:2:
807. X509_STORE_CTX inctx;
808. X509_OBJECT obj;
809. > OCSP_REQUEST *req = NULL;
810. OCSP_RESPONSE *resp = NULL;
811. OCSP_CERTID *id = NULL;
apps/s_server.c:810:2:
808. X509_OBJECT obj;
809. OCSP_REQUEST *req = NULL;
810. > OCSP_RESPONSE *resp = NULL;
811. OCSP_CERTID *id = NULL;
812. STACK_OF(X509_EXTENSION) *exts;
apps/s_server.c:811:2:
809. OCSP_REQUEST *req = NULL;
810. OCSP_RESPONSE *resp = NULL;
811. > OCSP_CERTID *id = NULL;
812. STACK_OF(X509_EXTENSION) *exts;
813. int ret = SSL_TLSEXT_ERR_NOACK;
apps/s_server.c:813:2:
811. OCSP_CERTID *id = NULL;
812. STACK_OF(X509_EXTENSION) *exts;
813. > int ret = SSL_TLSEXT_ERR_NOACK;
814. int i;
815. #if 0
apps/s_server.c:820:6: Taking true branch
818. BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids));
819. #endif
820. if (srctx->verbose)
^
821. BIO_puts(err, "cert_status: callback called\n");
822. /* Build up OCSP query from server certificate */
apps/s_server.c:821:3:
819. #endif
820. if (srctx->verbose)
821. > BIO_puts(err, "cert_status: callback called\n");
822. /* Build up OCSP query from server certificate */
823. x = SSL_get_certificate(s);
crypto/bio/bio_lib.c:257:1: start of procedure BIO_puts()
255. }
256.
257. > int BIO_puts(BIO *b, const char *in)
258. {
259. int i;
crypto/bio/bio_lib.c:262:7: Taking false branch
260. long (*cb)(BIO *,int,const char *,int,long,long);
261.
262. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL))
^
263. {
264. BIOerr(BIO_F_BIO_PUTS,BIO_R_UNSUPPORTED_METHOD);
crypto/bio/bio_lib.c:262:22: Taking false branch
260. long (*cb)(BIO *,int,const char *,int,long,long);
261.
262. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL))
^
263. {
264. BIOerr(BIO_F_BIO_PUTS,BIO_R_UNSUPPORTED_METHOD);
crypto/bio/bio_lib.c:262:45: Taking false branch
260. long (*cb)(BIO *,int,const char *,int,long,long);
261.
262. if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL))
^
263. {
264. BIOerr(BIO_F_BIO_PUTS,BIO_R_UNSUPPORTED_METHOD);
crypto/bio/bio_lib.c:268:2:
266. }
267.
268. > cb=b->callback;
269.
270. if ((cb != NULL) &&
crypto/bio/bio_lib.c:270:7: Taking false branch
268. cb=b->callback;
269.
270. if ((cb != NULL) &&
^
271. ((i=(int)cb(b,BIO_CB_PUTS,in,0,0L,1L)) <= 0))
272. return(i);
crypto/bio/bio_lib.c:274:7: Taking false branch
272. return(i);
273.
274. if (!b->init)
^
275. {
276. BIOerr(BIO_F_BIO_PUTS,BIO_R_UNINITIALIZED);
crypto/bio/bio_lib.c:280:2: Skipping __function_pointer__(): unresolved function pointer
278. }
279.
280. i=b->method->bputs(b,in);
^
281.
282. if (i > 0) b->num_write+=(unsigned long)i;
crypto/bio/bio_lib.c:282:6: Taking true branch
280. i=b->method->bputs(b,in);
281.
282. if (i > 0) b->num_write+=(unsigned long)i;
^
283.
284. if (cb != NULL)
crypto/bio/bio_lib.c:282:13:
280. i=b->method->bputs(b,in);
281.
282. > if (i > 0) b->num_write+=(unsigned long)i;
283.
284. if (cb != NULL)
crypto/bio/bio_lib.c:284:6: Taking false branch
282. if (i > 0) b->num_write+=(unsigned long)i;
283.
284. if (cb != NULL)
^
285. i=(int)cb(b,BIO_CB_PUTS|BIO_CB_RETURN,in,0,
286. 0L,(long)i);
crypto/bio/bio_lib.c:287:2:
285. i=(int)cb(b,BIO_CB_PUTS|BIO_CB_RETURN,in,0,
286. 0L,(long)i);
287. > return(i);
288. }
289.
crypto/bio/bio_lib.c:288:2: return from a call to BIO_puts
286. 0L,(long)i);
287. return(i);
288. }
^
289.
290. int BIO_gets(BIO *b, char *in, int inl)
apps/s_server.c:823:2:
821. BIO_puts(err, "cert_status: callback called\n");
822. /* Build up OCSP query from server certificate */
823. > x = SSL_get_certificate(s);
824. aia = X509_get1_ocsp(x);
825. if (aia)
ssl/ssl_lib.c:2855:1: start of procedure SSL_get_certificate()
2853.
2854. /* Fix this function so that it takes an optional type parameter */
2855. > X509 *SSL_get_certificate(const SSL *s)
2856. {
2857. if (s->cert != NULL)
ssl/ssl_lib.c:2857:6: Taking false branch
2855. X509 *SSL_get_certificate(const SSL *s)
2856. {
2857. if (s->cert != NULL)
^
2858. return(s->cert->key->x509);
2859. else
ssl/ssl_lib.c:2860:3:
2858. return(s->cert->key->x509);
2859. else
2860. > return(NULL);
2861. }
2862.
ssl/ssl_lib.c:2861:2: return from a call to SSL_get_certificate
2859. else
2860. return(NULL);
2861. }
^
2862.
2863. /* Fix this function so that it takes an optional type parameter */
apps/s_server.c:824:2:
822. /* Build up OCSP query from server certificate */
823. x = SSL_get_certificate(s);
824. > aia = X509_get1_ocsp(x);
825. if (aia)
826. {
|
https://github.com/openssl/openssl/blob/2a7cbe77b3abb244c2211d22d7aa3416b97c9342/apps/s_server.c/#L824
|
d2a_code_trace_data_45672
|
void ssl3_cbc_copy_mac(unsigned char *out,
const SSL3_RECORD *rec, size_t md_size)
{
#if defined(CBC_MAC_ROTATE_IN_PLACE)
unsigned char rotated_mac_buf[64 + EVP_MAX_MD_SIZE];
unsigned char *rotated_mac;
#else
unsigned char rotated_mac[EVP_MAX_MD_SIZE];
#endif
size_t mac_end = rec->length;
size_t mac_start = mac_end - md_size;
size_t scan_start = 0;
size_t i, j;
size_t div_spoiler;
size_t rotate_offset;
OPENSSL_assert(rec->orig_len >= md_size);
OPENSSL_assert(md_size <= EVP_MAX_MD_SIZE);
#if defined(CBC_MAC_ROTATE_IN_PLACE)
rotated_mac = rotated_mac_buf + ((0 - (size_t)rotated_mac_buf) & 63);
#endif
if (rec->orig_len > md_size + 255 + 1)
scan_start = rec->orig_len - (md_size + 255 + 1);
div_spoiler = md_size >> 1;
div_spoiler <<= (sizeof(div_spoiler) - 1) * 8;
rotate_offset = (div_spoiler + mac_start - scan_start) % md_size;
memset(rotated_mac, 0, md_size);
for (i = scan_start, j = 0; i < rec->orig_len; i++) {
unsigned char mac_started = constant_time_ge_8_s(i, mac_start);
unsigned char mac_ended = constant_time_ge_8_s(i, mac_end);
unsigned char b = rec->data[i];
rotated_mac[j++] |= b & mac_started & ~mac_ended;
j &= constant_time_lt_s(j, md_size);
}
#if defined(CBC_MAC_ROTATE_IN_PLACE)
j = 0;
for (i = 0; i < md_size; i++) {
((volatile unsigned char *)rotated_mac)[rotate_offset ^ 32];
out[j++] = rotated_mac[rotate_offset++];
rotate_offset &= constant_time_lt_s(rotate_offset, md_size);
}
#else
memset(out, 0, md_size);
rotate_offset = md_size - rotate_offset;
rotate_offset &= constant_time_lt_s(rotate_offset, md_size);
for (i = 0; i < md_size; i++) {
for (j = 0; j < md_size; j++)
out[j] |= rotated_mac[i] & constant_time_eq_8_s(j, rotate_offset);
rotate_offset++;
rotate_offset &= constant_time_lt_s(rotate_offset, md_size);
}
#endif
}
ssl/record/rec_layer_d1.c:286: error: INTEGER_OVERFLOW_L2
([0, 17728] - [256, 320]):unsigned64 by call to `dtls1_process_record`.
Showing all 10 steps of the trace
ssl/record/rec_layer_d1.c:229:1: Parameter `s->rlayer.rrec.length`
227. &((s)->rlayer.d->unprocessed_rcds))
228.
229. > int dtls1_process_buffered_records(SSL *s)
230. {
231. pitem *item;
ssl/record/rec_layer_d1.c:286:31: Call
284. }
285.
286. if (!replayok || !dtls1_process_record(s, bitmap)) {
^
287. /* dump this record */
288. rr->length = 0;
ssl/record/ssl3_record.c:1308:1: Parameter `s->rlayer.rrec.length`
1306. }
1307.
1308. > int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap)
1309. {
1310. int i, al;
ssl/record/ssl3_record.c:1348:5: Assignment
1346. /* decrypt in place in 'rr->input' */
1347. rr->data = rr->input;
1348. rr->orig_len = rr->length;
^
1349.
1350. if (SSL_USE_ETM(s) && s->read_hash) {
ssl/record/ssl3_record.c:1433:13: Call
1431. */
1432. mac = mac_tmp;
1433. ssl3_cbc_copy_mac(mac_tmp, rr, mac_size);
^
1434. rr->length -= mac_size;
1435. } else {
ssl/record/ssl3_record.c:1231:1: <LHS trace>
1229. #define CBC_MAC_ROTATE_IN_PLACE
1230.
1231. > void ssl3_cbc_copy_mac(unsigned char *out,
1232. const SSL3_RECORD *rec, size_t md_size)
1233. {
ssl/record/ssl3_record.c:1231:1: Parameter `md_size`
1229. #define CBC_MAC_ROTATE_IN_PLACE
1230.
1231. > void ssl3_cbc_copy_mac(unsigned char *out,
1232. const SSL3_RECORD *rec, size_t md_size)
1233. {
ssl/record/ssl3_record.c:1231:1: <RHS trace>
1229. #define CBC_MAC_ROTATE_IN_PLACE
1230.
1231. > void ssl3_cbc_copy_mac(unsigned char *out,
1232. const SSL3_RECORD *rec, size_t md_size)
1233. {
ssl/record/ssl3_record.c:1231:1: Parameter `md_size`
1229. #define CBC_MAC_ROTATE_IN_PLACE
1230.
1231. > void ssl3_cbc_copy_mac(unsigned char *out,
1232. const SSL3_RECORD *rec, size_t md_size)
1233. {
ssl/record/ssl3_record.c:1264:9: Binary operation: ([0, 17728] - [256, 320]):unsigned64 by call to `dtls1_process_record`
1262. /* This information is public so it's safe to branch based on it. */
1263. if (rec->orig_len > md_size + 255 + 1)
1264. scan_start = rec->orig_len - (md_size + 255 + 1);
^
1265. /*
1266. * div_spoiler contains a multiple of md_size that is used to cause the
|
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/record/ssl3_record.c/#L1264
|
d2a_code_trace_data_45673
|
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:1703: 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:1703:9: Call
1701. return 0;
1702. }
1703. CRYPTO_gcm128_tag(&gctx->gcm, ctx->buf, 16);
^
1704. gctx->taglen = 16;
1705. /* Don't reuse the IV */
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_45674
|
MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
{
EVP_PKEY *pkey = NULL;
unsigned char *sig, *data;
int al, ret = MSG_PROCESS_ERROR;
int type = 0, j;
unsigned int len;
X509 *peer;
const EVP_MD *md = NULL;
long hdatalen = 0;
void *hdata;
EVP_MD_CTX *mctx = EVP_MD_CTX_new();
if (mctx == NULL) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_MALLOC_FAILURE);
al = SSL_AD_INTERNAL_ERROR;
goto f_err;
}
peer = s->session->peer;
pkey = X509_get0_pubkey(peer);
type = X509_certificate_type(peer, pkey);
if (!(type & EVP_PKT_SIGN)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY,
SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);
al = SSL_AD_ILLEGAL_PARAMETER;
goto f_err;
}
#ifndef OPENSSL_NO_GOST
if (PACKET_remaining(pkt) == 64 && pkey->type == NID_id_GostR3410_2001) {
len = 64;
} else
#endif
{
if (SSL_USE_SIGALGS(s)) {
int rv;
if (!PACKET_get_bytes(pkt, &sig, 2)) {
al = SSL_AD_DECODE_ERROR;
goto f_err;
}
rv = tls12_check_peer_sigalg(&md, s, sig, pkey);
if (rv == -1) {
al = SSL_AD_INTERNAL_ERROR;
goto f_err;
} else if (rv == 0) {
al = SSL_AD_DECODE_ERROR;
goto f_err;
}
#ifdef SSL_DEBUG
fprintf(stderr, "USING TLSv1.2 HASH %s\n", EVP_MD_name(md));
#endif
} else {
int idx = ssl_cert_type(NULL, pkey);
if (idx >= 0)
md = s->s3->tmp.md[idx];
if (md == NULL) {
al = SSL_AD_INTERNAL_ERROR;
goto f_err;
}
}
if (!PACKET_get_net_2(pkt, &len)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, SSL_R_LENGTH_MISMATCH);
al = SSL_AD_DECODE_ERROR;
goto f_err;
}
}
j = EVP_PKEY_size(pkey);
if (((int)len > j) || ((int)PACKET_remaining(pkt) > j)
|| (PACKET_remaining(pkt) == 0)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, SSL_R_WRONG_SIGNATURE_SIZE);
al = SSL_AD_DECODE_ERROR;
goto f_err;
}
if (!PACKET_get_bytes(pkt, &data, len)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, SSL_R_LENGTH_MISMATCH);
al = SSL_AD_DECODE_ERROR;
goto f_err;
}
hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata);
if (hdatalen <= 0) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_INTERNAL_ERROR);
al = SSL_AD_INTERNAL_ERROR;
goto f_err;
}
#ifdef SSL_DEBUG
fprintf(stderr, "Using client verify alg %s\n", EVP_MD_name(md));
#endif
if (!EVP_VerifyInit_ex(mctx, md, NULL)
|| !EVP_VerifyUpdate(mctx, hdata, hdatalen)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_EVP_LIB);
al = SSL_AD_INTERNAL_ERROR;
goto f_err;
}
#ifndef OPENSSL_NO_GOST
if (pkey->type == NID_id_GostR3410_2001
|| pkey->type == NID_id_GostR3410_2012_256
|| pkey->type == NID_id_GostR3410_2012_512) {
BUF_reverse(data, NULL, len);
}
#endif
if (s->version == SSL3_VERSION
&& !EVP_MD_CTX_ctrl(mctx, EVP_CTRL_SSL3_MASTER_SECRET,
s->session->master_key_length,
s->session->master_key)) {
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_EVP_LIB);
al = SSL_AD_INTERNAL_ERROR;
goto f_err;
}
if (EVP_VerifyFinal(mctx, data, len, pkey) <= 0) {
al = SSL_AD_DECRYPT_ERROR;
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, SSL_R_BAD_SIGNATURE);
goto f_err;
}
ret = MSG_PROCESS_CONTINUE_PROCESSING;
if (0) {
f_err:
ssl3_send_alert(s, SSL3_AL_FATAL, al);
ossl_statem_set_error(s);
}
BIO_free(s->s3->handshake_buffer);
s->s3->handshake_buffer = NULL;
EVP_MD_CTX_free(mctx);
return ret;
}
ssl/statem/statem_srvr.c:2697: error: NULL_DEREFERENCE
pointer `pkey` last assigned on line 2681 could be null and is dereferenced at line 2697, column 40.
Showing all 53 steps of the trace
ssl/statem/statem_srvr.c:2660:1: start of procedure tls_process_cert_verify()
2658. }
2659.
2660. > MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
2661. {
2662. EVP_PKEY *pkey = NULL;
ssl/statem/statem_srvr.c:2662:5:
2660. MSG_PROCESS_RETURN tls_process_cert_verify(SSL *s, PACKET *pkt)
2661. {
2662. > EVP_PKEY *pkey = NULL;
2663. unsigned char *sig, *data;
2664. int al, ret = MSG_PROCESS_ERROR;
ssl/statem/statem_srvr.c:2664:5:
2662. EVP_PKEY *pkey = NULL;
2663. unsigned char *sig, *data;
2664. > int al, ret = MSG_PROCESS_ERROR;
2665. int type = 0, j;
2666. unsigned int len;
ssl/statem/statem_srvr.c:2665:5:
2663. unsigned char *sig, *data;
2664. int al, ret = MSG_PROCESS_ERROR;
2665. > int type = 0, j;
2666. unsigned int len;
2667. X509 *peer;
ssl/statem/statem_srvr.c:2668:5:
2666. unsigned int len;
2667. X509 *peer;
2668. > const EVP_MD *md = NULL;
2669. long hdatalen = 0;
2670. void *hdata;
ssl/statem/statem_srvr.c:2669:5:
2667. X509 *peer;
2668. const EVP_MD *md = NULL;
2669. > long hdatalen = 0;
2670. void *hdata;
2671.
ssl/statem/statem_srvr.c:2672:5:
2670. void *hdata;
2671.
2672. > EVP_MD_CTX *mctx = EVP_MD_CTX_new();
2673.
2674. if (mctx == NULL) {
crypto/evp/digest.c:153:1: start of procedure EVP_MD_CTX_new()
151. }
152.
153. > EVP_MD_CTX *EVP_MD_CTX_new(void)
154. {
155. return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
crypto/evp/digest.c:155:5:
153. EVP_MD_CTX *EVP_MD_CTX_new(void)
154. {
155. > return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
156. }
157.
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/evp/digest.c:156:1: return from a call to EVP_MD_CTX_new
154. {
155. return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
156. > }
157.
158. void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
ssl/statem/statem_srvr.c:2674:9: Taking false branch
2672. EVP_MD_CTX *mctx = EVP_MD_CTX_new();
2673.
2674. if (mctx == NULL) {
^
2675. SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_MALLOC_FAILURE);
2676. al = SSL_AD_INTERNAL_ERROR;
ssl/statem/statem_srvr.c:2680:5:
2678. }
2679.
2680. > peer = s->session->peer;
2681. pkey = X509_get0_pubkey(peer);
2682. type = X509_certificate_type(peer, pkey);
ssl/statem/statem_srvr.c:2681:5:
2679.
2680. peer = s->session->peer;
2681. > pkey = X509_get0_pubkey(peer);
2682. type = X509_certificate_type(peer, pkey);
2683.
crypto/x509/x509_cmp.c:308:1: start of procedure X509_get0_pubkey()
306. }
307.
308. > EVP_PKEY *X509_get0_pubkey(X509 *x)
309. {
310. if (x == NULL)
crypto/x509/x509_cmp.c:310:9: Taking false branch
308. EVP_PKEY *X509_get0_pubkey(X509 *x)
309. {
310. if (x == NULL)
^
311. return NULL;
312. return X509_PUBKEY_get0(x->cert_info.key);
crypto/x509/x509_cmp.c:312:5:
310. if (x == NULL)
311. return NULL;
312. > return X509_PUBKEY_get0(x->cert_info.key);
313. }
314.
crypto/asn1/x_pubkey.c:124:1: start of procedure X509_PUBKEY_get0()
122. }
123.
124. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
125. {
126. EVP_PKEY *ret = NULL;
crypto/asn1/x_pubkey.c:126:5:
124. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
125. {
126. > EVP_PKEY *ret = NULL;
127.
128. if (key == NULL)
crypto/asn1/x_pubkey.c:128:9: Taking false branch
126. EVP_PKEY *ret = NULL;
127.
128. if (key == NULL)
^
129. goto error;
130.
crypto/asn1/x_pubkey.c:131:9: Taking false branch
129. goto error;
130.
131. if (key->pkey != NULL)
^
132. return key->pkey;
133.
crypto/asn1/x_pubkey.c:134:9: Taking true branch
132. return key->pkey;
133.
134. if (key->public_key == NULL)
^
135. goto error;
136.
crypto/asn1/x_pubkey.c:170:2:
168. return ret;
169.
170. > error:
171. EVP_PKEY_free(ret);
172. return (NULL);
crypto/asn1/x_pubkey.c:171:5:
169.
170. error:
171. > EVP_PKEY_free(ret);
172. return (NULL);
173. }
crypto/evp/p_lib.c:420:1: start of procedure EVP_PKEY_free()
418. }
419.
420. > void EVP_PKEY_free(EVP_PKEY *x)
421. {
422. int i;
crypto/evp/p_lib.c:424:9: Taking true branch
422. int i;
423.
424. if (x == NULL)
^
425. return;
426.
crypto/evp/p_lib.c:425:9:
423.
424. if (x == NULL)
425. > return;
426.
427. i = CRYPTO_add(&x->references, -1, CRYPTO_LOCK_EVP_PKEY);
crypto/evp/p_lib.c:442:1: return from a call to EVP_PKEY_free
440. sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
441. OPENSSL_free(x);
442. > }
443.
444. static void EVP_PKEY_free_it(EVP_PKEY *x)
crypto/asn1/x_pubkey.c:172:5:
170. error:
171. EVP_PKEY_free(ret);
172. > return (NULL);
173. }
174.
crypto/asn1/x_pubkey.c:173:1: return from a call to X509_PUBKEY_get0
171. EVP_PKEY_free(ret);
172. return (NULL);
173. > }
174.
175. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
crypto/x509/x509_cmp.c:313:1: return from a call to X509_get0_pubkey
311. return NULL;
312. return X509_PUBKEY_get0(x->cert_info.key);
313. > }
314.
315. EVP_PKEY *X509_get_pubkey(X509 *x)
ssl/statem/statem_srvr.c:2682:5: Skipping X509_certificate_type(): empty list of specs
2680. peer = s->session->peer;
2681. pkey = X509_get0_pubkey(peer);
2682. type = X509_certificate_type(peer, pkey);
^
2683.
2684. if (!(type & EVP_PKT_SIGN)) {
ssl/statem/statem_srvr.c:2684:11: Taking false branch
2682. type = X509_certificate_type(peer, pkey);
2683.
2684. if (!(type & EVP_PKT_SIGN)) {
^
2685. SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY,
2686. SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);
ssl/statem/statem_srvr.c:2697:9:
2695. */
2696. #ifndef OPENSSL_NO_GOST
2697. > if (PACKET_remaining(pkt) == 64 && pkey->type == NID_id_GostR3410_2001) {
2698. len = 64;
2699. } else
ssl/packet_locl.h:91:1: start of procedure PACKET_remaining()
89. * Returns the number of bytes remaining to be read in the PACKET
90. */
91. > static ossl_inline size_t PACKET_remaining(const PACKET *pkt)
92. {
93. return pkt->remaining;
ssl/packet_locl.h:93:5:
91. static ossl_inline size_t PACKET_remaining(const PACKET *pkt)
92. {
93. > return pkt->remaining;
94. }
95.
ssl/packet_locl.h:94:1: return from a call to PACKET_remaining
92. {
93. return pkt->remaining;
94. > }
95.
96. /*
ssl/statem/statem_srvr.c:2697:9: Taking true branch
2695. */
2696. #ifndef OPENSSL_NO_GOST
2697. if (PACKET_remaining(pkt) == 64 && pkey->type == NID_id_GostR3410_2001) {
^
2698. len = 64;
2699. } else
ssl/statem/statem_srvr.c:2697:40:
2695. */
2696. #ifndef OPENSSL_NO_GOST
2697. > if (PACKET_remaining(pkt) == 64 && pkey->type == NID_id_GostR3410_2001) {
2698. len = 64;
2699. } else
|
https://github.com/openssl/openssl/blob/928623825cc59e272e2031cd3f07c5b7bbd605d4/ssl/statem/statem_srvr.c/#L2697
|
d2a_code_trace_data_45675
|
static int
dtls1_process_out_of_seq_message(SSL *s, const struct hm_header_st *msg_hdr,
int *ok)
{
int i = -1;
hm_fragment *frag = NULL;
pitem *item = NULL;
unsigned char seq64be[8];
unsigned long frag_len = msg_hdr->frag_len;
if ((msg_hdr->frag_off + frag_len) > msg_hdr->msg_len)
goto err;
memset(seq64be, 0, sizeof(seq64be));
seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
seq64be[7] = (unsigned char)msg_hdr->seq;
item = pqueue_find(s->d1->buffered_messages, seq64be);
if (item != NULL && frag_len != msg_hdr->msg_len)
item = NULL;
if (msg_hdr->seq <= s->d1->handshake_read_seq ||
msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL ||
(s->d1->handshake_read_seq == 0 && msg_hdr->type == SSL3_MT_FINISHED))
{
unsigned char devnull[256];
while (frag_len) {
i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL,
devnull,
frag_len >
sizeof(devnull) ? sizeof(devnull) :
frag_len, 0);
if (i <= 0)
goto err;
frag_len -= i;
}
} else {
if (frag_len != msg_hdr->msg_len)
return dtls1_reassemble_fragment(s, msg_hdr, ok);
if (frag_len > dtls1_max_handshake_message_len(s))
goto err;
frag = dtls1_hm_fragment_new(frag_len, 0);
if (frag == NULL)
goto err;
memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
if (frag_len) {
i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL,
frag->fragment, frag_len, 0);
if ((unsigned long)i != frag_len)
i = -1;
if (i <= 0)
goto err;
}
item = pitem_new(seq64be, frag);
if (item == NULL)
goto err;
item = pqueue_insert(s->d1->buffered_messages, item);
OPENSSL_assert(item != NULL);
}
return DTLS1_HM_FRAGMENT_RETRY;
err:
if (item == NULL)
dtls1_hm_fragment_free(frag);
*ok = 0;
return i;
}
ssl/statem/statem_dtls.c:789: error: MEMORY_LEAK
memory dynamically allocated by call to `dtls1_hm_fragment_new()` at line 767, column 16 is not reachable after line 789, column 16.
Showing all 87 steps of the trace
ssl/statem/statem_dtls.c:713:1: start of procedure dtls1_process_out_of_seq_message()
711. }
712.
713. > static int
714. dtls1_process_out_of_seq_message(SSL *s, const struct hm_header_st *msg_hdr,
715. int *ok)
ssl/statem/statem_dtls.c:717:5:
715. int *ok)
716. {
717. > int i = -1;
718. hm_fragment *frag = NULL;
719. pitem *item = NULL;
ssl/statem/statem_dtls.c:718:5:
716. {
717. int i = -1;
718. > hm_fragment *frag = NULL;
719. pitem *item = NULL;
720. unsigned char seq64be[8];
ssl/statem/statem_dtls.c:719:5:
717. int i = -1;
718. hm_fragment *frag = NULL;
719. > pitem *item = NULL;
720. unsigned char seq64be[8];
721. unsigned long frag_len = msg_hdr->frag_len;
ssl/statem/statem_dtls.c:721:5:
719. pitem *item = NULL;
720. unsigned char seq64be[8];
721. > unsigned long frag_len = msg_hdr->frag_len;
722.
723. if ((msg_hdr->frag_off + frag_len) > msg_hdr->msg_len)
ssl/statem/statem_dtls.c:723:9: Taking false branch
721. unsigned long frag_len = msg_hdr->frag_len;
722.
723. if ((msg_hdr->frag_off + frag_len) > msg_hdr->msg_len)
^
724. goto err;
725.
ssl/statem/statem_dtls.c:727:5:
725.
726. /* Try to find item in queue, to prevent duplicate entries */
727. > memset(seq64be, 0, sizeof(seq64be));
728. seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
729. seq64be[7] = (unsigned char)msg_hdr->seq;
ssl/statem/statem_dtls.c:728:5:
726. /* Try to find item in queue, to prevent duplicate entries */
727. memset(seq64be, 0, sizeof(seq64be));
728. > seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
729. seq64be[7] = (unsigned char)msg_hdr->seq;
730. item = pqueue_find(s->d1->buffered_messages, seq64be);
ssl/statem/statem_dtls.c:729:5:
727. memset(seq64be, 0, sizeof(seq64be));
728. seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
729. > seq64be[7] = (unsigned char)msg_hdr->seq;
730. item = pqueue_find(s->d1->buffered_messages, seq64be);
731.
ssl/statem/statem_dtls.c:730:5:
728. seq64be[6] = (unsigned char)(msg_hdr->seq >> 8);
729. seq64be[7] = (unsigned char)msg_hdr->seq;
730. > item = pqueue_find(s->d1->buffered_messages, seq64be);
731.
732. /*
crypto/pqueue/pqueue.c:151:1: start of procedure pqueue_find()
149. }
150.
151. > pitem *pqueue_find(pqueue_s *pq, unsigned char *prio64be)
152. {
153. pitem *next;
crypto/pqueue/pqueue.c:154:5:
152. {
153. pitem *next;
154. > pitem *found = NULL;
155.
156. if (pq->items == NULL)
crypto/pqueue/pqueue.c:156:9: Taking true branch
154. pitem *found = NULL;
155.
156. if (pq->items == NULL)
^
157. return NULL;
158.
crypto/pqueue/pqueue.c:157:9:
155.
156. if (pq->items == NULL)
157. > return NULL;
158.
159. for (next = pq->items; next->next != NULL; next = next->next) {
crypto/pqueue/pqueue.c:174:1: return from a call to pqueue_find
172.
173. return found;
174. > }
175.
176. void pqueue_print(pqueue_s *pq)
ssl/statem/statem_dtls.c:736:9: Taking false branch
734. * it and rather try to reassemble it.
735. */
736. if (item != NULL && frag_len != msg_hdr->msg_len)
^
737. item = NULL;
738.
ssl/statem/statem_dtls.c:744:9: Taking false branch
742. * before the SERVER_HELLO, which then must be a stale retransmit.
743. */
744. if (msg_hdr->seq <= s->d1->handshake_read_seq ||
^
745. msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL ||
746. (s->d1->handshake_read_seq == 0 && msg_hdr->type == SSL3_MT_FINISHED))
ssl/statem/statem_dtls.c:745:9: Taking false branch
743. */
744. if (msg_hdr->seq <= s->d1->handshake_read_seq ||
745. msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL ||
^
746. (s->d1->handshake_read_seq == 0 && msg_hdr->type == SSL3_MT_FINISHED))
747. {
ssl/statem/statem_dtls.c:745:58: Taking false branch
743. */
744. if (msg_hdr->seq <= s->d1->handshake_read_seq ||
745. msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL ||
^
746. (s->d1->handshake_read_seq == 0 && msg_hdr->type == SSL3_MT_FINISHED))
747. {
ssl/statem/statem_dtls.c:746:10: Taking false branch
744. if (msg_hdr->seq <= s->d1->handshake_read_seq ||
745. msg_hdr->seq > s->d1->handshake_read_seq + 10 || item != NULL ||
746. (s->d1->handshake_read_seq == 0 && msg_hdr->type == SSL3_MT_FINISHED))
^
747. {
748. unsigned char devnull[256];
ssl/statem/statem_dtls.c:761:13: Taking false branch
759. }
760. } else {
761. if (frag_len != msg_hdr->msg_len)
^
762. return dtls1_reassemble_fragment(s, msg_hdr, ok);
763.
ssl/statem/statem_dtls.c:764:13:
762. return dtls1_reassemble_fragment(s, msg_hdr, ok);
763.
764. > if (frag_len > dtls1_max_handshake_message_len(s))
765. goto err;
766.
ssl/statem/statem_dtls.c:599:1: start of procedure dtls1_max_handshake_message_len()
597. * may be greater if the maximum certificate list size requires it.
598. */
599. > static unsigned long dtls1_max_handshake_message_len(const SSL *s)
600. {
601. unsigned long max_len =
ssl/statem/statem_dtls.c:601:5:
599. static unsigned long dtls1_max_handshake_message_len(const SSL *s)
600. {
601. > unsigned long max_len =
602. DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH;
603. if (max_len < (unsigned long)s->max_cert_list)
ssl/statem/statem_dtls.c:603:9: Taking true branch
601. unsigned long max_len =
602. DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH;
603. if (max_len < (unsigned long)s->max_cert_list)
^
604. return s->max_cert_list;
605. return max_len;
ssl/statem/statem_dtls.c:604:9:
602. DTLS1_HM_HEADER_LENGTH + SSL3_RT_MAX_ENCRYPTED_LENGTH;
603. if (max_len < (unsigned long)s->max_cert_list)
604. > return s->max_cert_list;
605. return max_len;
606. }
ssl/statem/statem_dtls.c:606:1: return from a call to dtls1_max_handshake_message_len
604. return s->max_cert_list;
605. return max_len;
606. > }
607.
608. static int
ssl/statem/statem_dtls.c:764:13: Taking false branch
762. return dtls1_reassemble_fragment(s, msg_hdr, ok);
763.
764. if (frag_len > dtls1_max_handshake_message_len(s))
^
765. goto err;
766.
ssl/statem/statem_dtls.c:767:9:
765. goto err;
766.
767. > frag = dtls1_hm_fragment_new(frag_len, 0);
768. if (frag == NULL)
769. goto err;
ssl/statem/statem_dtls.c:163:1: start of procedure dtls1_hm_fragment_new()
161. static int dtls_get_reassembled_message(SSL *s, long *len);
162.
163. > static hm_fragment *dtls1_hm_fragment_new(unsigned long frag_len,
164. int reassembly)
165. {
ssl/statem/statem_dtls.c:166:5:
164. int reassembly)
165. {
166. > hm_fragment *frag = NULL;
167. unsigned char *buf = NULL;
168. unsigned char *bitmask = NULL;
ssl/statem/statem_dtls.c:167:5:
165. {
166. hm_fragment *frag = NULL;
167. > unsigned char *buf = NULL;
168. unsigned char *bitmask = NULL;
169.
ssl/statem/statem_dtls.c:168:5:
166. hm_fragment *frag = NULL;
167. unsigned char *buf = NULL;
168. > unsigned char *bitmask = NULL;
169.
170. frag = OPENSSL_malloc(sizeof(*frag));
ssl/statem/statem_dtls.c:170:5:
168. unsigned char *bitmask = NULL;
169.
170. > frag = OPENSSL_malloc(sizeof(*frag));
171. if (frag == NULL)
172. return 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)
ssl/statem/statem_dtls.c:171:9: Taking false branch
169.
170. frag = OPENSSL_malloc(sizeof(*frag));
171. if (frag == NULL)
^
172. return NULL;
173.
ssl/statem/statem_dtls.c:174:9: Taking true branch
172. return NULL;
173.
174. if (frag_len) {
^
175. buf = OPENSSL_malloc(frag_len);
176. if (buf == NULL) {
ssl/statem/statem_dtls.c:175:9:
173.
174. if (frag_len) {
175. > buf = OPENSSL_malloc(frag_len);
176. if (buf == NULL) {
177. OPENSSL_free(frag);
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)
ssl/statem/statem_dtls.c:176:13: Taking false branch
174. if (frag_len) {
175. buf = OPENSSL_malloc(frag_len);
176. if (buf == NULL) {
^
177. OPENSSL_free(frag);
178. return NULL;
ssl/statem/statem_dtls.c:183:5:
181.
182. /* zero length fragment gets zero frag->fragment */
183. > frag->fragment = buf;
184.
185. /* Initialize reassembly bitmask if necessary */
ssl/statem/statem_dtls.c:186:9: Taking false branch
184.
185. /* Initialize reassembly bitmask if necessary */
186. if (reassembly) {
^
187. bitmask = OPENSSL_zalloc(RSMBLY_BITMASK_SIZE(frag_len));
188. if (bitmask == NULL) {
ssl/statem/statem_dtls.c:195:5:
193. }
194.
195. > frag->reassembly = bitmask;
196.
197. return frag;
ssl/statem/statem_dtls.c:197:5:
195. frag->reassembly = bitmask;
196.
197. > return frag;
198. }
199.
ssl/statem/statem_dtls.c:198:1: return from a call to dtls1_hm_fragment_new
196.
197. return frag;
198. > }
199.
200. void dtls1_hm_fragment_free(hm_fragment *frag)
ssl/statem/statem_dtls.c:768:13: Taking false branch
766.
767. frag = dtls1_hm_fragment_new(frag_len, 0);
768. if (frag == NULL)
^
769. goto err;
770.
ssl/statem/statem_dtls.c:771:9:
769. goto err;
770.
771. > memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
772.
773. if (frag_len) {
ssl/statem/statem_dtls.c:773:13: Taking true branch
771. memcpy(&(frag->msg_header), msg_hdr, sizeof(*msg_hdr));
772.
773. if (frag_len) {
^
774. /*
775. * read the body of the fragment (header has already been read
ssl/statem/statem_dtls.c:777:13: Skipping __function_pointer__(): unresolved function pointer
775. * read the body of the fragment (header has already been read
776. */
777. i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL,
^
778. frag->fragment, frag_len, 0);
779. if ((unsigned long)i != frag_len)
ssl/statem/statem_dtls.c:779:17: Taking false branch
777. i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL,
778. frag->fragment, frag_len, 0);
779. if ((unsigned long)i != frag_len)
^
780. i = -1;
781. if (i <= 0)
ssl/statem/statem_dtls.c:781:17: Taking false branch
779. if ((unsigned long)i != frag_len)
780. i = -1;
781. if (i <= 0)
^
782. goto err;
783. }
ssl/statem/statem_dtls.c:785:9:
783. }
784.
785. > item = pitem_new(seq64be, frag);
786. if (item == NULL)
787. goto err;
crypto/pqueue/pqueue.c:69:1: start of procedure pitem_new()
67. } pqueue_s;
68.
69. > pitem *pitem_new(unsigned char *prio64be, void *data)
70. {
71. pitem *item = OPENSSL_malloc(sizeof(*item));
crypto/pqueue/pqueue.c:71:5:
69. pitem *pitem_new(unsigned char *prio64be, void *data)
70. {
71. > pitem *item = OPENSSL_malloc(sizeof(*item));
72. if (item == NULL)
73. return 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/pqueue/pqueue.c:72:9: Taking false branch
70. {
71. pitem *item = OPENSSL_malloc(sizeof(*item));
72. if (item == NULL)
^
73. return NULL;
74.
crypto/pqueue/pqueue.c:75:5:
73. return NULL;
74.
75. > memcpy(item->priority, prio64be, sizeof(item->priority));
76.
77. item->data = data;
crypto/pqueue/pqueue.c:77:5:
75. memcpy(item->priority, prio64be, sizeof(item->priority));
76.
77. > item->data = data;
78. item->next = NULL;
79.
crypto/pqueue/pqueue.c:78:5:
76.
77. item->data = data;
78. > item->next = NULL;
79.
80. return item;
crypto/pqueue/pqueue.c:80:5:
78. item->next = NULL;
79.
80. > return item;
81. }
82.
crypto/pqueue/pqueue.c:81:1: return from a call to pitem_new
79.
80. return item;
81. > }
82.
83. void pitem_free(pitem *item)
ssl/statem/statem_dtls.c:786:13: Taking false branch
784.
785. item = pitem_new(seq64be, frag);
786. if (item == NULL)
^
787. goto err;
788.
ssl/statem/statem_dtls.c:789:9: Skipping pqueue_insert(): empty list of specs
787. goto err;
788.
789. item = pqueue_insert(s->d1->buffered_messages, item);
^
790. /*
791. * pqueue_insert fails iff a duplicate item is inserted. However,
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/ssl/statem/statem_dtls.c/#L789
|
d2a_code_trace_data_45676
|
static void new_video_stream(AVFormatContext *oc)
{
AVStream *st;
AVCodecContext *video_enc;
enum CodecID codec_id;
st = av_new_stream(oc, streamid_map[oc->nb_streams]);
if (!st) {
fprintf(stderr, "Could not alloc stream\n");
av_exit(1);
}
avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_VIDEO);
bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
video_bitstream_filters= NULL;
avcodec_thread_init(st->codec, thread_count);
video_enc = st->codec;
if(video_codec_tag)
video_enc->codec_tag= video_codec_tag;
if( (video_global_header&1)
|| (video_global_header==0 && (oc->oformat->flags & AVFMT_GLOBALHEADER))){
video_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
}
if(video_global_header&2){
video_enc->flags2 |= CODEC_FLAG2_LOCAL_HEADER;
avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags2|= CODEC_FLAG2_LOCAL_HEADER;
}
if (video_stream_copy) {
st->stream_copy = 1;
video_enc->codec_type = AVMEDIA_TYPE_VIDEO;
video_enc->sample_aspect_ratio =
st->sample_aspect_ratio = av_d2q(frame_aspect_ratio*frame_height/frame_width, 255);
} else {
const char *p;
int i;
AVCodec *codec;
AVRational fps= frame_rate.num ? frame_rate : (AVRational){25,1};
if (video_codec_name) {
codec_id = find_codec_or_die(video_codec_name, AVMEDIA_TYPE_VIDEO, 1,
video_enc->strict_std_compliance);
codec = avcodec_find_encoder_by_name(video_codec_name);
output_codecs[nb_ocodecs] = codec;
} else {
codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
codec = avcodec_find_encoder(codec_id);
}
video_enc->codec_id = codec_id;
set_context_opts(video_enc, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
if (codec && codec->supported_framerates && !force_fps)
fps = codec->supported_framerates[av_find_nearest_q_idx(fps, codec->supported_framerates)];
video_enc->time_base.den = fps.num;
video_enc->time_base.num = fps.den;
video_enc->width = frame_width;
video_enc->height = frame_height;
video_enc->sample_aspect_ratio = av_d2q(frame_aspect_ratio*video_enc->height/video_enc->width, 255);
video_enc->pix_fmt = frame_pix_fmt;
st->sample_aspect_ratio = video_enc->sample_aspect_ratio;
choose_pixel_fmt(st, codec);
if (intra_only)
video_enc->gop_size = 0;
if (video_qscale || same_quality) {
video_enc->flags |= CODEC_FLAG_QSCALE;
video_enc->global_quality=
st->quality = FF_QP2LAMBDA * video_qscale;
}
if(intra_matrix)
video_enc->intra_matrix = intra_matrix;
if(inter_matrix)
video_enc->inter_matrix = inter_matrix;
p= video_rc_override_string;
for(i=0; p; i++){
int start, end, q;
int e=sscanf(p, "%d,%d,%d", &start, &end, &q);
if(e!=3){
fprintf(stderr, "error parsing rc_override\n");
av_exit(1);
}
video_enc->rc_override=
av_realloc(video_enc->rc_override,
sizeof(RcOverride)*(i+1));
video_enc->rc_override[i].start_frame= start;
video_enc->rc_override[i].end_frame = end;
if(q>0){
video_enc->rc_override[i].qscale= q;
video_enc->rc_override[i].quality_factor= 1.0;
}
else{
video_enc->rc_override[i].qscale= 0;
video_enc->rc_override[i].quality_factor= -q/100.0;
}
p= strchr(p, '/');
if(p) p++;
}
video_enc->rc_override_count=i;
if (!video_enc->rc_initial_buffer_occupancy)
video_enc->rc_initial_buffer_occupancy = video_enc->rc_buffer_size*3/4;
video_enc->me_threshold= me_threshold;
video_enc->intra_dc_precision= intra_dc_precision - 8;
if (do_psnr)
video_enc->flags|= CODEC_FLAG_PSNR;
if (do_pass) {
if (do_pass == 1) {
video_enc->flags |= CODEC_FLAG_PASS1;
} else {
video_enc->flags |= CODEC_FLAG_PASS2;
}
}
}
nb_ocodecs++;
if (video_language) {
av_metadata_set2(&st->metadata, "language", video_language, 0);
av_freep(&video_language);
}
video_disable = 0;
av_freep(&video_codec_name);
video_stream_copy = 0;
frame_pix_fmt = PIX_FMT_NONE;
}
ffmpeg.c:3360: error: Null Dereference
pointer `st` last assigned on line 3355 could be null and is dereferenced at line 3360, column 35.
ffmpeg.c:3349:1: start of procedure new_video_stream()
3347. }
3348.
3349. static void new_video_stream(AVFormatContext *oc)
^
3350. {
3351. AVStream *st;
ffmpeg.c:3355:5:
3353. enum CodecID codec_id;
3354.
3355. st = av_new_stream(oc, streamid_map[oc->nb_streams]);
^
3356. if (!st) {
3357. fprintf(stderr, "Could not alloc stream\n");
libavformat/utils.c:2500:1: start of procedure av_new_stream()
2498. }
2499.
2500. AVStream *av_new_stream(AVFormatContext *s, int id)
^
2501. {
2502. AVStream *st;
libavformat/utils.c:2505:9: Taking true branch
2503. int i;
2504.
2505. if (s->nb_streams >= MAX_STREAMS){
^
2506. av_log(s, AV_LOG_ERROR, "Too many streams\n");
2507. return NULL;
libavformat/utils.c:2506:9: Skipping av_log(): empty list of specs
2504.
2505. if (s->nb_streams >= MAX_STREAMS){
2506. av_log(s, AV_LOG_ERROR, "Too many streams\n");
^
2507. return NULL;
2508. }
libavformat/utils.c:2507:9:
2505. if (s->nb_streams >= MAX_STREAMS){
2506. av_log(s, AV_LOG_ERROR, "Too many streams\n");
2507. return NULL;
^
2508. }
2509.
libavformat/utils.c:2542:1: return from a call to av_new_stream
2540. s->streams[s->nb_streams++] = st;
2541. return st;
2542. }
^
2543.
2544. AVProgram *av_new_program(AVFormatContext *ac, int id)
ffmpeg.c:3356:10: Taking true branch
3354.
3355. st = av_new_stream(oc, streamid_map[oc->nb_streams]);
3356. if (!st) {
^
3357. fprintf(stderr, "Could not alloc stream\n");
3358. av_exit(1);
ffmpeg.c:3357:9:
3355. st = av_new_stream(oc, streamid_map[oc->nb_streams]);
3356. if (!st) {
3357. fprintf(stderr, "Could not alloc stream\n");
^
3358. av_exit(1);
3359. }
ffmpeg.c:3358:9: Skipping av_exit(): empty list of specs
3356. if (!st) {
3357. fprintf(stderr, "Could not alloc stream\n");
3358. av_exit(1);
^
3359. }
3360. avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_VIDEO);
ffmpeg.c:3360:5:
3358. av_exit(1);
3359. }
3360. avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_VIDEO);
^
3361. bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
3362. video_bitstream_filters= NULL;
|
https://github.com/libav/libav/blob/66b84e4ab2fc96222dab32173d84f4a403129deb/ffmpeg.c/#L3360
|
d2a_code_trace_data_45677
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/bn/bn_prime.c:93: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `bn_probable_prime_dh`.
Showing all 13 steps of the trace
crypto/bn/bn_prime.c:79:5: Call
77. if (ctx == NULL)
78. goto err;
79. BN_CTX_start(ctx);
^
80. t = BN_CTX_get(ctx);
81. if (t == 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_prime.c:93:18: Call
91. goto err;
92. } else {
93. if (!bn_probable_prime_dh(ret, bits, add, rem, ctx))
^
94. goto err;
95. }
crypto/bn/bn_prime.c:361:5: Call
359. BIGNUM *t1;
360.
361. BN_CTX_start(ctx);
^
362. if ((t1 = BN_CTX_get(ctx)) == NULL)
363. goto err;
crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
169. }
170.
171. > void BN_CTX_start(BN_CTX *ctx)
172. {
173. CTXDBG("ENTER BN_CTX_start()", ctx);
crypto/bn/bn_prime.c:399:5: Call
397.
398. err:
399. BN_CTX_end(ctx);
^
400. bn_check_top(rnd);
401. 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_probable_prime_dh`
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_45678
|
int RAND_bytes(unsigned char *buf, int num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth->bytes != NULL)
return meth->bytes(buf, num);
RANDerr(RAND_F_RAND_BYTES, RAND_R_FUNC_NOT_IMPLEMENTED);
return -1;
}
crypto/rand/rand_lib.c:812: error: NULL_DEREFERENCE
pointer `meth` last assigned on line 810 could be null and is dereferenced at line 812, column 9.
Showing all 14 steps of the trace
crypto/rand/rand_lib.c:808:1: start of procedure RAND_bytes()
806. }
807.
808. > int RAND_bytes(unsigned char *buf, int num)
809. {
810. const RAND_METHOD *meth = RAND_get_rand_method();
crypto/rand/rand_lib.c:810:5:
808. int RAND_bytes(unsigned char *buf, int num)
809. {
810. > const RAND_METHOD *meth = RAND_get_rand_method();
811.
812. if (meth->bytes != NULL)
crypto/rand/rand_lib.c:714:1: start of procedure RAND_get_rand_method()
712. }
713.
714. > const RAND_METHOD *RAND_get_rand_method(void)
715. {
716. const RAND_METHOD *tmp_meth = NULL;
crypto/rand/rand_lib.c:716:5:
714. const RAND_METHOD *RAND_get_rand_method(void)
715. {
716. > const RAND_METHOD *tmp_meth = NULL;
717.
718. if (!RUN_ONCE(&rand_init, do_rand_init))
crypto/rand/rand_lib.c:718:10:
716. const RAND_METHOD *tmp_meth = NULL;
717.
718. > if (!RUN_ONCE(&rand_init, do_rand_init))
719. return NULL;
720.
crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once()
109. }
110.
111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
112. {
113. if (pthread_once(once, init) != 0)
crypto/threads_pthread.c:113:9: Taking true branch
111. int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
112. {
113. if (pthread_once(once, init) != 0)
^
114. return 0;
115.
crypto/threads_pthread.c:114:9:
112. {
113. if (pthread_once(once, init) != 0)
114. > return 0;
115.
116. return 1;
crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once
115.
116. return 1;
117. > }
118.
119. int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))
crypto/rand/rand_lib.c:718:10: Condition is false
716. const RAND_METHOD *tmp_meth = NULL;
717.
718. if (!RUN_ONCE(&rand_init, do_rand_init))
^
719. return NULL;
720.
crypto/rand/rand_lib.c:718:10: Taking true branch
716. const RAND_METHOD *tmp_meth = NULL;
717.
718. if (!RUN_ONCE(&rand_init, do_rand_init))
^
719. return NULL;
720.
crypto/rand/rand_lib.c:719:9:
717.
718. if (!RUN_ONCE(&rand_init, do_rand_init))
719. > return NULL;
720.
721. CRYPTO_THREAD_write_lock(rand_meth_lock);
crypto/rand/rand_lib.c:742:1: return from a call to RAND_get_rand_method
740. CRYPTO_THREAD_unlock(rand_meth_lock);
741. return tmp_meth;
742. > }
743.
744. #ifndef OPENSSL_NO_ENGINE
crypto/rand/rand_lib.c:812:9:
810. const RAND_METHOD *meth = RAND_get_rand_method();
811.
812. > if (meth->bytes != NULL)
813. return meth->bytes(buf, num);
814. RANDerr(RAND_F_RAND_BYTES, RAND_R_FUNC_NOT_IMPLEMENTED);
|
https://github.com/openssl/openssl/blob/92ebf6c4c21ff4b41ba1fd69af74b2039e138114/crypto/rand/rand_lib.c/#L812
|
d2a_code_trace_data_45679
|
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);
}
apps/x509.c:762: error: BUFFER_OVERRUN_L3
Offset: [199, 255] Size: [1, 2147483644] by call to `X509_NAME_oneline`.
Showing all 6 steps of the trace
apps/x509.c:762:17: Call
760. int len;
761.
762. X509_NAME_oneline(X509_get_subject_name(x), buf, sizeof buf);
^
763. BIO_printf(out, "/*\n"
764. " * Subject: %s\n", buf);
crypto/x509/x509_obj.c:73:1: <Offset trace>
71. #define NAME_ONELINE_MAX (1024 * 1024)
72.
73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
74. {
75. X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:73:1: Parameter `len`
71. #define NAME_ONELINE_MAX (1024 * 1024)
72.
73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
74. {
75. X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:73:1: <Length trace>
71. #define NAME_ONELINE_MAX (1024 * 1024)
72.
73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
74. {
75. X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:73:1: Parameter `*buf`
71. #define NAME_ONELINE_MAX (1024 * 1024)
72.
73. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
74. {
75. X509_NAME_ENTRY *ne;
crypto/x509/x509_obj.c:105:9: Array access: Offset: [199, 255] Size: [1, 2147483644] by call to `X509_NAME_oneline`
103. }
104. strncpy(buf, "NO X509_NAME", len);
105. buf[len - 1] = '\0';
^
106. return buf;
107. }
|
https://github.com/openssl/openssl/blob/24c2cd3967ed23acc0bd31a3781c4525e2e42a2c/crypto/x509/x509_obj.c/#L105
|
d2a_code_trace_data_45680
|
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:1079: error: Uninitialized Value
The value read from ref[_] was never initialized.
libavcodec/h264.c:1079:17:
1077. h->sub_mb_type[i8] = sub_mb_type;
1078.
1079. fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
^
1080. fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
1081. if(!IS_INTRA(mb_types_col[y8])
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264.c/#L1079
|
d2a_code_trace_data_45681
|
static int mpc8_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
const uint8_t * buf, int buf_size)
{
MPCContext *c = avctx->priv_data;
GetBitContext gb2, *gb = &gb2;
int i, j, k, ch, cnt, res, t;
Band *bands = c->bands;
int off;
int maxband, keyframe;
int last[2];
keyframe = c->cur_frame == 0;
if(keyframe){
memset(c->Q, 0, sizeof(c->Q));
c->last_bits_used = 0;
}
init_get_bits(gb, buf, buf_size * 8);
skip_bits(gb, c->last_bits_used & 7);
if(keyframe)
maxband = mpc8_get_mod_golomb(gb, c->maxbands + 1);
else{
maxband = c->last_max_band + get_vlc2(gb, band_vlc.table, MPC8_BANDS_BITS, 2);
if(maxband > 32) maxband -= 33;
}
c->last_max_band = maxband;
if(maxband){
last[0] = last[1] = 0;
for(i = maxband - 1; i >= 0; i--){
for(ch = 0; ch < 2; ch++){
last[ch] = get_vlc2(gb, res_vlc[last[ch] > 2].table, MPC8_RES_BITS, 2) + last[ch];
if(last[ch] > 15) last[ch] -= 17;
bands[i].res[ch] = last[ch];
}
}
if(c->MSS){
int mask;
cnt = 0;
for(i = 0; i < maxband; i++)
if(bands[i].res[0] || bands[i].res[1])
cnt++;
t = mpc8_get_mod_golomb(gb, cnt);
mask = mpc8_get_mask(gb, cnt, t);
for(i = maxband - 1; i >= 0; i--)
if(bands[i].res[0] || bands[i].res[1]){
bands[i].msf = mask & 1;
mask >>= 1;
}
}
}
for(i = maxband; i < c->maxbands; i++)
bands[i].res[0] = bands[i].res[1] = 0;
if(keyframe){
for(i = 0; i < 32; i++)
c->oldDSCF[0][i] = c->oldDSCF[1][i] = 1;
}
for(i = 0; i < maxband; i++){
if(bands[i].res[0] || bands[i].res[1]){
cnt = !!bands[i].res[0] + !!bands[i].res[1] - 1;
if(cnt >= 0){
t = get_vlc2(gb, scfi_vlc[cnt].table, scfi_vlc[cnt].bits, 1);
if(bands[i].res[0]) bands[i].scfi[0] = t >> (2 * cnt);
if(bands[i].res[1]) bands[i].scfi[1] = t & 3;
}
}
}
for(i = 0; i < maxband; i++){
for(ch = 0; ch < 2; ch++){
if(!bands[i].res[ch]) continue;
if(c->oldDSCF[ch][i]){
bands[i].scf_idx[ch][0] = get_bits(gb, 7) - 6;
c->oldDSCF[ch][i] = 0;
}else{
t = get_vlc2(gb, dscf_vlc[1].table, MPC8_DSCF1_BITS, 2);
if(t == 64)
t += get_bits(gb, 6);
bands[i].scf_idx[ch][0] = ((bands[i].scf_idx[ch][2] + t - 25) & 0x7F) - 6;
}
for(j = 0; j < 2; j++){
if((bands[i].scfi[ch] << j) & 2)
bands[i].scf_idx[ch][j + 1] = bands[i].scf_idx[ch][j];
else{
t = get_vlc2(gb, dscf_vlc[0].table, MPC8_DSCF0_BITS, 2);
if(t == 31)
t = 64 + get_bits(gb, 6);
bands[i].scf_idx[ch][j + 1] = ((bands[i].scf_idx[ch][j] + t - 25) & 0x7F) - 6;
}
}
}
}
for(i = 0, off = 0; i < maxband; i++, off += SAMPLES_PER_BAND){
for(ch = 0; ch < 2; ch++){
res = bands[i].res[ch];
switch(res){
case -1:
for(j = 0; j < SAMPLES_PER_BAND; j++)
c->Q[ch][off + j] = (av_random(&c->rnd) & 0x3FC) - 510;
break;
case 0:
break;
case 1:
for(j = 0; j < SAMPLES_PER_BAND; j += SAMPLES_PER_BAND / 2){
cnt = get_vlc2(gb, q1_vlc.table, MPC8_Q1_BITS, 2);
t = mpc8_get_mask(gb, 18, cnt);
for(k = 0; k < SAMPLES_PER_BAND / 2; k++, t <<= 1)
c->Q[ch][off + j + k] = (t & 0x20000) ? (get_bits1(gb) << 1) - 1 : 0;
}
break;
case 2:
cnt = 6;
for(j = 0; j < SAMPLES_PER_BAND; j += 3){
t = get_vlc2(gb, q2_vlc[cnt > 3].table, MPC8_Q2_BITS, 2);
c->Q[ch][off + j + 0] = mpc8_idx50[t];
c->Q[ch][off + j + 1] = mpc8_idx51[t];
c->Q[ch][off + j + 2] = mpc8_idx52[t];
cnt = (cnt >> 1) + mpc8_huffq2[t];
}
break;
case 3:
case 4:
for(j = 0; j < SAMPLES_PER_BAND; j += 2){
t = get_vlc2(gb, q3_vlc[res - 3].table, MPC8_Q3_BITS, 2) + q3_offsets[res - 3];
c->Q[ch][off + j + 1] = t >> 4;
c->Q[ch][off + j + 0] = (t & 8) ? (t & 0xF) - 16 : (t & 0xF);
}
break;
case 5:
case 6:
case 7:
case 8:
cnt = 2 * mpc8_thres[res];
for(j = 0; j < SAMPLES_PER_BAND; j++){
t = get_vlc2(gb, quant_vlc[res - 5][cnt > mpc8_thres[res]].table, quant_vlc[res - 5][cnt > mpc8_thres[res]].bits, 2) + quant_offsets[res - 5];
c->Q[ch][off + j] = t;
cnt = (cnt >> 1) + FFABS(c->Q[ch][off + j]);
}
break;
default:
for(j = 0; j < SAMPLES_PER_BAND; j++){
c->Q[ch][off + j] = get_vlc2(gb, q9up_vlc.table, MPC8_Q9UP_BITS, 2);
if(res != 9){
c->Q[ch][off + j] <<= res - 9;
c->Q[ch][off + j] |= get_bits(gb, res - 9);
}
c->Q[ch][off + j] -= (1 << (res - 2)) - 1;
}
}
}
}
ff_mpc_dequantize_and_synth(c, maxband, data);
c->cur_frame++;
c->last_bits_used = get_bits_count(gb);
if(c->cur_frame >= c->frames)
c->cur_frame = 0;
*data_size = MPC_FRAME_SIZE * 4;
return c->cur_frame ? c->last_bits_used >> 3 : buf_size;
}
libavcodec/mpc8.c:289: error: Integer Overflow L2
([0, 1020] - 510):unsigned32.
libavcodec/mpc8.c:289:42: <LHS trace>
287. case -1:
288. for(j = 0; j < SAMPLES_PER_BAND; j++)
289. c->Q[ch][off + j] = (av_random(&c->rnd) & 0x3FC) - 510;
^
290. break;
291. case 0:
libavcodec/mpc8.c:289:42: Call
287. case -1:
288. for(j = 0; j < SAMPLES_PER_BAND; j++)
289. c->Q[ch][off + j] = (av_random(&c->rnd) & 0x3FC) - 510;
^
290. break;
291. case 0:
libavutil/random.h:39:1: Parameter `state->mt[*]`
37.
38. /** generates a random number on [0,0xffffffff]-interval */
39. static inline unsigned int av_random(AVRandomState *state)
^
40. {
41. unsigned int y;
libavutil/random.h:48:5: Assignment
46.
47. // grab one...
48. y = state->mt[state->index++];
^
49.
50. /* Now temper (Mersenne Twister coefficients) The coefficients for MT19937 are.. */
libavutil/random.h:51:5: Assignment
49.
50. /* Now temper (Mersenne Twister coefficients) The coefficients for MT19937 are.. */
51. y ^= (y >> 11);
^
52. y ^= (y << 7) & 0x9d2c5680;
53. y ^= (y << 15) & 0xefc60000;
libavutil/random.h:52:5: Assignment
50. /* Now temper (Mersenne Twister coefficients) The coefficients for MT19937 are.. */
51. y ^= (y >> 11);
52. y ^= (y << 7) & 0x9d2c5680;
^
53. y ^= (y << 15) & 0xefc60000;
54. y ^= (y >> 18);
libavutil/random.h:53:5: Assignment
51. y ^= (y >> 11);
52. y ^= (y << 7) & 0x9d2c5680;
53. y ^= (y << 15) & 0xefc60000;
^
54. y ^= (y >> 18);
55.
libavutil/random.h:54:5: Assignment
52. y ^= (y << 7) & 0x9d2c5680;
53. y ^= (y << 15) & 0xefc60000;
54. y ^= (y >> 18);
^
55.
56. return y;
libavutil/random.h:56:5: Assignment
54. y ^= (y >> 18);
55.
56. return y;
^
57. }
58.
libavcodec/mpc8.c:289:21: Binary operation: ([0, 1020] - 510):unsigned32
287. case -1:
288. for(j = 0; j < SAMPLES_PER_BAND; j++)
289. c->Q[ch][off + j] = (av_random(&c->rnd) & 0x3FC) - 510;
^
290. break;
291. case 0:
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpc8.c/#L289
|
d2a_code_trace_data_45682
|
int ossl_init_thread_start(uint64_t opts)
{
struct thread_local_inits_st *locals;
if (!OPENSSL_init_crypto(0, NULL))
return 0;
locals = ossl_init_get_thread_local(1);
if (locals == NULL)
return 0;
if (opts & OPENSSL_INIT_THREAD_ASYNC) {
#ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
"marking thread for async\n");
#endif
locals->async = 1;
}
if (opts & OPENSSL_INIT_THREAD_ERR_STATE) {
#ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
"marking thread for err_state\n");
#endif
locals->err_state = 1;
}
return 1;
}
crypto/init.c:389: error: MEMORY_LEAK
memory dynamically allocated by call to `ossl_init_get_thread_local()` at line 371, column 14 is not reachable after line 389, column 9.
Showing all 41 steps of the trace
crypto/init.c:364:1: start of procedure ossl_init_thread_start()
362. }
363.
364. > int ossl_init_thread_start(uint64_t opts)
365. {
366. struct thread_local_inits_st *locals;
crypto/init.c:368:10: Taking false branch
366. struct thread_local_inits_st *locals;
367.
368. if (!OPENSSL_init_crypto(0, NULL))
^
369. return 0;
370.
crypto/init.c:371:5:
369. return 0;
370.
371. > locals = ossl_init_get_thread_local(1);
372.
373. if (locals == NULL)
crypto/init.c:41:1: start of procedure ossl_init_get_thread_local()
39. }
40.
41. > static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc)
42. {
43. struct thread_local_inits_st *local =
crypto/init.c:43:5:
41. static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc)
42. {
43. > struct thread_local_inits_st *local =
44. CRYPTO_THREAD_get_local(&threadstopkey);
45.
crypto/threads_pthread.c:121:1: start of procedure CRYPTO_THREAD_get_local()
119. }
120.
121. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
122. {
123. return pthread_getspecific(*key);
crypto/threads_pthread.c:123:5: Skipping pthread_getspecific(): method has no implementation
121. void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
122. {
123. return pthread_getspecific(*key);
^
124. }
125.
crypto/threads_pthread.c:124:1: return from a call to CRYPTO_THREAD_get_local
122. {
123. return pthread_getspecific(*key);
124. > }
125.
126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
crypto/init.c:46:9: Taking true branch
44. CRYPTO_THREAD_get_local(&threadstopkey);
45.
46. if (local == NULL && alloc) {
^
47. local = OPENSSL_zalloc(sizeof(*local));
48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
crypto/init.c:46:26: Taking true branch
44. CRYPTO_THREAD_get_local(&threadstopkey);
45.
46. if (local == NULL && alloc) {
^
47. local = OPENSSL_zalloc(sizeof(*local));
48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
crypto/init.c:47:9:
45.
46. if (local == NULL && alloc) {
47. > local = OPENSSL_zalloc(sizeof(*local));
48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
49. OPENSSL_free(local);
crypto/mem.c:221:1: start of procedure CRYPTO_zalloc()
219. }
220.
221. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
222. {
223. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:223:5:
221. void *CRYPTO_zalloc(size_t num, const char *file, int line)
222. {
223. > void *ret = CRYPTO_malloc(num, file, line);
224.
225. 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:5:
202.
203. FAILTEST();
204. > allow_customize = 0;
205. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
206. if (call_malloc_debug) {
crypto/mem.c:214:5:
212. }
213. #else
214. > (void)(file); (void)(line);
215. ret = malloc(num);
216. #endif
crypto/mem.c:214:19:
212. }
213. #else
214. > (void)(file); (void)(line);
215. ret = malloc(num);
216. #endif
crypto/mem.c:215:5:
213. #else
214. (void)(file); (void)(line);
215. > ret = malloc(num);
216. #endif
217.
crypto/mem.c:218:5:
216. #endif
217.
218. > return ret;
219. }
220.
crypto/mem.c:219:1: return from a call to CRYPTO_malloc
217.
218. return ret;
219. > }
220.
221. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:226:9: Taking true branch
224.
225. FAILTEST();
226. if (ret != NULL)
^
227. memset(ret, 0, num);
228. return ret;
crypto/mem.c:227:9:
225. FAILTEST();
226. if (ret != NULL)
227. > memset(ret, 0, num);
228. return ret;
229. }
crypto/mem.c:228:5:
226. if (ret != NULL)
227. memset(ret, 0, num);
228. > return ret;
229. }
230.
crypto/mem.c:229:1: return from a call to CRYPTO_zalloc
227. memset(ret, 0, num);
228. return ret;
229. > }
230.
231. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/init.c:48:13: Taking true branch
46. if (local == NULL && alloc) {
47. local = OPENSSL_zalloc(sizeof(*local));
48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
^
49. OPENSSL_free(local);
50. return NULL;
crypto/init.c:48:31:
46. if (local == NULL && alloc) {
47. local = OPENSSL_zalloc(sizeof(*local));
48. > if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
49. OPENSSL_free(local);
50. return NULL;
crypto/threads_pthread.c:126:1: start of procedure CRYPTO_THREAD_set_local()
124. }
125.
126. > int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
127. {
128. if (pthread_setspecific(*key, val) != 0)
crypto/threads_pthread.c:128:9: Taking false branch
126. int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
127. {
128. if (pthread_setspecific(*key, val) != 0)
^
129. return 0;
130.
crypto/threads_pthread.c:131:5:
129. return 0;
130.
131. > return 1;
132. }
133.
crypto/threads_pthread.c:132:1: return from a call to CRYPTO_THREAD_set_local
130.
131. return 1;
132. > }
133.
134. int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
crypto/init.c:48:31: Taking false branch
46. if (local == NULL && alloc) {
47. local = OPENSSL_zalloc(sizeof(*local));
48. if (local != NULL && !CRYPTO_THREAD_set_local(&threadstopkey, local)) {
^
49. OPENSSL_free(local);
50. return NULL;
crypto/init.c:53:10: Taking false branch
51. }
52. }
53. if (!alloc) {
^
54. CRYPTO_THREAD_set_local(&threadstopkey, NULL);
55. }
crypto/init.c:57:5:
55. }
56.
57. > return local;
58. }
59.
crypto/init.c:58:1: return from a call to ossl_init_get_thread_local
56.
57. return local;
58. > }
59.
60. typedef struct ossl_init_stop_st OPENSSL_INIT_STOP;
crypto/init.c:373:9: Taking false branch
371. locals = ossl_init_get_thread_local(1);
372.
373. if (locals == NULL)
^
374. return 0;
375.
crypto/init.c:376:9: Taking false branch
374. return 0;
375.
376. if (opts & OPENSSL_INIT_THREAD_ASYNC) {
^
377. #ifdef OPENSSL_INIT_DEBUG
378. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
crypto/init.c:384:9: Taking true branch
382. }
383.
384. if (opts & OPENSSL_INIT_THREAD_ERR_STATE) {
^
385. #ifdef OPENSSL_INIT_DEBUG
386. fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
crypto/init.c:389:9:
387. "marking thread for err_state\n");
388. #endif
389. > locals->err_state = 1;
390. }
391.
|
https://github.com/openssl/openssl/blob/63ab5ea13b671cb60dd4b7cfde2bcae9d14c5a60/crypto/init.c/#L389
|
d2a_code_trace_data_45683
|
static int encode_test_init(struct evp_test *t, const char *encoding)
{
struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
if (strcmp(encoding, "canonical") == 0) {
edata->encoding = BASE64_CANONICAL_ENCODING;
} else if (strcmp(encoding, "valid") == 0) {
edata->encoding = BASE64_VALID_ENCODING;
} else if (strcmp(encoding, "invalid") == 0) {
edata->encoding = BASE64_INVALID_ENCODING;
t->expected_err = OPENSSL_strdup("DECODE_ERROR");
if (t->expected_err == NULL)
return 0;
} else {
fprintf(stderr, "Bad encoding: %s. Should be one of "
"{canonical, valid, invalid}\n", encoding);
return 0;
}
t->data = edata;
return 1;
}
test/evp_test.c:1559: error: NULL_DEREFERENCE
pointer `edata` last assigned on line 1554 could be null and is dereferenced at line 1559, column 9.
Showing all 19 steps of the trace
test/evp_test.c:1552:1: start of procedure encode_test_init()
1550. };
1551.
1552. > static int encode_test_init(struct evp_test *t, const char *encoding)
1553. {
1554. struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
test/evp_test.c:1554:5:
1552. static int encode_test_init(struct evp_test *t, const char *encoding)
1553. {
1554. > struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1555.
1556. if (strcmp(encoding, "canonical") == 0) {
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 false 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: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)
test/evp_test.c:1556:9: Taking false branch
1554. struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1555.
1556. if (strcmp(encoding, "canonical") == 0) {
^
1557. edata->encoding = BASE64_CANONICAL_ENCODING;
1558. } else if (strcmp(encoding, "valid") == 0) {
test/evp_test.c:1558:16: Taking true branch
1556. if (strcmp(encoding, "canonical") == 0) {
1557. edata->encoding = BASE64_CANONICAL_ENCODING;
1558. } else if (strcmp(encoding, "valid") == 0) {
^
1559. edata->encoding = BASE64_VALID_ENCODING;
1560. } else if (strcmp(encoding, "invalid") == 0) {
test/evp_test.c:1559:9:
1557. edata->encoding = BASE64_CANONICAL_ENCODING;
1558. } else if (strcmp(encoding, "valid") == 0) {
1559. > edata->encoding = BASE64_VALID_ENCODING;
1560. } else if (strcmp(encoding, "invalid") == 0) {
1561. edata->encoding = BASE64_INVALID_ENCODING;
|
https://github.com/openssl/openssl/blob/928623825cc59e272e2031cd3f07c5b7bbd605d4/test/evp_test.c/#L1559
|
d2a_code_trace_data_45684
|
int test_mont(BIO *bp, BN_CTX *ctx)
{
BIGNUM *a, *b, *c, *d, *A, *B;
BIGNUM *n;
int i;
BN_MONT_CTX *mont;
a = BN_new();
b = BN_new();
c = BN_new();
d = BN_new();
A = BN_new();
B = BN_new();
n = BN_new();
mont = BN_MONT_CTX_new();
if (mont == NULL)
return 0;
BN_zero(n);
if (BN_MONT_CTX_set(mont, n, ctx)) {
fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
return 0;
}
BN_set_word(n, 16);
if (BN_MONT_CTX_set(mont, n, ctx)) {
fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n");
return 0;
}
BN_bntest_rand(a, 100, 0, 0);
BN_bntest_rand(b, 100, 0, 0);
for (i = 0; i < num2; i++) {
int bits = (200 * (i + 1)) / num2;
if (bits == 0)
continue;
BN_bntest_rand(n, bits, 0, 1);
BN_MONT_CTX_set(mont, n, ctx);
BN_nnmod(a, a, n, ctx);
BN_nnmod(b, b, n, ctx);
BN_to_montgomery(A, a, mont, ctx);
BN_to_montgomery(B, b, mont, ctx);
BN_mod_mul_montgomery(c, A, B, mont, ctx);
BN_from_montgomery(A, c, mont, ctx);
if (bp != NULL) {
if (!results) {
BN_print(bp, a);
BIO_puts(bp, " * ");
BN_print(bp, b);
BIO_puts(bp, " % ");
BN_print(bp, &mont->N);
BIO_puts(bp, " - ");
}
BN_print(bp, A);
BIO_puts(bp, "\n");
}
BN_mod_mul(d, a, b, n, ctx);
BN_sub(d, d, A);
if (!BN_is_zero(d)) {
fprintf(stderr, "Montgomery multiplication test failed!\n");
return 0;
}
}
BN_MONT_CTX_free(mont);
BN_free(a);
BN_free(b);
BN_free(c);
BN_free(d);
BN_free(A);
BN_free(B);
BN_free(n);
return (1);
}
test/bntest.c:796: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 784, column 9 is not reachable after line 796, column 17.
Showing all 193 steps of the trace
test/bntest.c:775:1: start of procedure test_mont()
773. }
774.
775. > int test_mont(BIO *bp, BN_CTX *ctx)
776. {
777. BIGNUM *a, *b, *c, *d, *A, *B;
test/bntest.c:782:5:
780. BN_MONT_CTX *mont;
781.
782. > a = BN_new();
783. b = BN_new();
784. 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:783:5:
781.
782. a = BN_new();
783. > b = BN_new();
784. c = BN_new();
785. 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:784:5:
782. a = BN_new();
783. b = BN_new();
784. > c = BN_new();
785. d = BN_new();
786. A = 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:785:5:
783. b = BN_new();
784. c = BN_new();
785. > d = BN_new();
786. A = BN_new();
787. B = 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:786:5:
784. c = BN_new();
785. d = BN_new();
786. > A = BN_new();
787. B = BN_new();
788. n = 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:787:5:
785. d = BN_new();
786. A = BN_new();
787. > B = BN_new();
788. n = BN_new();
789.
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:788:5:
786. A = BN_new();
787. B = BN_new();
788. > n = BN_new();
789.
790. mont = BN_MONT_CTX_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:790:5:
788. n = BN_new();
789.
790. > mont = BN_MONT_CTX_new();
791. if (mont == NULL)
792. return 0;
crypto/bn/bn_mont.c:315:1: start of procedure BN_MONT_CTX_new()
313. }
314.
315. > BN_MONT_CTX *BN_MONT_CTX_new(void)
316. {
317. BN_MONT_CTX *ret;
crypto/bn/bn_mont.c:319:9:
317. BN_MONT_CTX *ret;
318.
319. > if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
320. return (NULL);
321.
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/bn/bn_mont.c:319:9: Taking false branch
317. BN_MONT_CTX *ret;
318.
319. if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
^
320. return (NULL);
321.
crypto/bn/bn_mont.c:322:5:
320. return (NULL);
321.
322. > BN_MONT_CTX_init(ret);
323. ret->flags = BN_FLG_MALLOCED;
324. return (ret);
crypto/bn/bn_mont.c:327:1: start of procedure BN_MONT_CTX_init()
325. }
326.
327. > void BN_MONT_CTX_init(BN_MONT_CTX *ctx)
328. {
329. ctx->ri = 0;
crypto/bn/bn_mont.c:329:5:
327. void BN_MONT_CTX_init(BN_MONT_CTX *ctx)
328. {
329. > ctx->ri = 0;
330. bn_init(&(ctx->RR));
331. bn_init(&(ctx->N));
crypto/bn/bn_mont.c:330:5: Skipping bn_init(): empty list of specs
328. {
329. ctx->ri = 0;
330. bn_init(&(ctx->RR));
^
331. bn_init(&(ctx->N));
332. bn_init(&(ctx->Ni));
crypto/bn/bn_mont.c:331:5: Skipping bn_init(): empty list of specs
329. ctx->ri = 0;
330. bn_init(&(ctx->RR));
331. bn_init(&(ctx->N));
^
332. bn_init(&(ctx->Ni));
333. ctx->n0[0] = ctx->n0[1] = 0;
crypto/bn/bn_mont.c:332:5: Skipping bn_init(): empty list of specs
330. bn_init(&(ctx->RR));
331. bn_init(&(ctx->N));
332. bn_init(&(ctx->Ni));
^
333. ctx->n0[0] = ctx->n0[1] = 0;
334. ctx->flags = 0;
crypto/bn/bn_mont.c:333:5:
331. bn_init(&(ctx->N));
332. bn_init(&(ctx->Ni));
333. > ctx->n0[0] = ctx->n0[1] = 0;
334. ctx->flags = 0;
335. }
crypto/bn/bn_mont.c:334:5:
332. bn_init(&(ctx->Ni));
333. ctx->n0[0] = ctx->n0[1] = 0;
334. > ctx->flags = 0;
335. }
336.
crypto/bn/bn_mont.c:335:1: return from a call to BN_MONT_CTX_init
333. ctx->n0[0] = ctx->n0[1] = 0;
334. ctx->flags = 0;
335. > }
336.
337. void BN_MONT_CTX_free(BN_MONT_CTX *mont)
crypto/bn/bn_mont.c:323:5:
321.
322. BN_MONT_CTX_init(ret);
323. > ret->flags = BN_FLG_MALLOCED;
324. return (ret);
325. }
crypto/bn/bn_mont.c:324:5:
322. BN_MONT_CTX_init(ret);
323. ret->flags = BN_FLG_MALLOCED;
324. > return (ret);
325. }
326.
crypto/bn/bn_mont.c:325:1: return from a call to BN_MONT_CTX_new
323. ret->flags = BN_FLG_MALLOCED;
324. return (ret);
325. > }
326.
327. void BN_MONT_CTX_init(BN_MONT_CTX *ctx)
test/bntest.c:791:9: Taking false branch
789.
790. mont = BN_MONT_CTX_new();
791. if (mont == NULL)
^
792. return 0;
793.
test/bntest.c:794:5:
792. return 0;
793.
794. > BN_zero(n);
795. if (BN_MONT_CTX_set(mont, n, ctx)) {
796. fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
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:795:9: Taking true branch
793.
794. BN_zero(n);
795. if (BN_MONT_CTX_set(mont, n, ctx)) {
^
796. fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
797. return 0;
test/bntest.c:796:9:
794. BN_zero(n);
795. if (BN_MONT_CTX_set(mont, n, ctx)) {
796. > fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
797. return 0;
798. }
|
https://github.com/openssl/openssl/blob/d9e309a675900030d7308e36f614962a344816f9/test/bntest.c/#L796
|
d2a_code_trace_data_45685
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *A, *a = NULL;
const BN_ULONG *B;
int i;
bn_check_top(b);
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return (NULL);
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = A = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = A = OPENSSL_zalloc(words * sizeof(*a));
if (A == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return (NULL);
}
#if 1
B = b->d;
if (B != NULL) {
for (i = b->top >> 2; i > 0; i--, A += 4, B += 4) {
BN_ULONG a0, a1, a2, a3;
a0 = B[0];
a1 = B[1];
a2 = B[2];
a3 = B[3];
A[0] = a0;
A[1] = a1;
A[2] = a2;
A[3] = a3;
}
switch (b->top & 3) {
case 3:
A[2] = B[2];
case 2:
A[1] = B[1];
case 1:
A[0] = B[0];
case 0:
;
}
}
#else
memset(A, 0, sizeof(*A) * words);
memcpy(A, b->d, sizeof(b->d[0]) * b->top);
#endif
return (a);
}
crypto/dh/dh_check.c:41: error: BUFFER_OVERRUN_L3
Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_copy`.
Showing all 16 steps of the trace
crypto/dh/dh_check.c:33:11: Call
31. goto err;
32. BN_CTX_start(ctx);
33. tmp = BN_CTX_get(ctx);
^
34. if (tmp == NULL)
35. goto err;
crypto/bn/bn_ctx.c:229:5: Call
227. }
228. /* OK, make sure the returned bignum is "zero" */
229. BN_zero(ret);
^
230. ctx->used++;
231. CTXDBG_RET(ctx, ret);
crypto/bn/bn_lib.c:463:1: Parameter `*a->d`
461. }
462.
463. > int BN_set_word(BIGNUM *a, BN_ULONG w)
464. {
465. bn_check_top(a);
crypto/bn/bn_lib.c:466:9: Call
464. {
465. bn_check_top(a);
466. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
467. return (0);
468. a->neg = 0;
crypto/bn/bn_lcl.h:676:1: Parameter `*a->d`
674. int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx);
675.
676. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
677. {
678. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/dh/dh_check.c:41:9: Call
39. if (BN_is_negative(dh->g) || BN_is_zero(dh->g) || BN_is_one(dh->g))
40. *ret |= DH_NOT_SUITABLE_GENERATOR;
41. if (BN_copy(tmp, dh->p) == NULL || !BN_sub_word(tmp, 1))
^
42. goto err;
43. if (BN_cmp(dh->g, tmp) >= 0)
crypto/bn/bn_lib.c:362:1: Parameter `*a->d`
360. }
361.
362. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
363. {
364. int i;
crypto/bn/bn_lib.c:372:9: Call
370. if (a == b)
371. return (a);
372. if (bn_wexpand(a, b->top) == NULL)
^
373. return (NULL);
374.
crypto/bn/bn_lib.c:1016:1: Parameter `*a->d`
1014. }
1015.
1016. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
1017. {
1018. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:1018:37: Call
1016. BIGNUM *bn_wexpand(BIGNUM *a, int words)
1017. {
1018. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
1019. }
1020.
crypto/bn/bn_lib.c:323:1: Parameter `*b->d`
321. */
322.
323. > BIGNUM *bn_expand2(BIGNUM *b, int words)
324. {
325. bn_check_top(b);
crypto/bn/bn_lib.c:328:23: Call
326.
327. if (words > b->dmax) {
328. BN_ULONG *a = bn_expand_internal(b, words);
^
329. if (!a)
330. return NULL;
crypto/bn/bn_lib.c:246:1: <Length trace>
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *A, *a = NULL;
crypto/bn/bn_lib.c:246:1: Parameter `*b->d`
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *A, *a = NULL;
crypto/bn/bn_lib.c:272:5: Assignment
270.
271. #if 1
272. B = b->d;
^
273. /* Check if the previous number needs to be copied */
274. if (B != NULL) {
crypto/bn/bn_lib.c:289:18: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: [0, 8388607] by call to `BN_copy`
287. a1 = B[1];
288. a2 = B[2];
289. a3 = B[3];
^
290. A[0] = a0;
291. A[1] = a1;
|
https://github.com/openssl/openssl/blob/6f8950a3cc466a7e2660dd9d7c8e9d11f47643ed/crypto/bn/bn_lib.c/#L289
|
d2a_code_trace_data_45686
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
bn_check_top(b);
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return (NULL);
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return (NULL);
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/ec/ecp_oct.c:97: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_add_quick`.
Showing all 23 steps of the trace
crypto/ec/ecp_oct.c:62:14: Call
60. if (!BN_mod_sqr(tmp2, x_, group->field, ctx))
61. goto err;
62. if (!BN_mod_mul(tmp1, tmp2, x_, group->field, ctx))
^
63. goto err;
64. }
crypto/bn/bn_mod.c:73:1: Parameter `r->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/ec/ecp_oct.c:97:14: Call
95. goto err;
96. } else {
97. if (!BN_mod_add_quick(tmp1, tmp1, group->b, group->field))
^
98. goto err;
99. }
crypto/bn/bn_mod.c:40:1: Parameter `r->top`
38. * less than m
39. */
40. > int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
41. const BIGNUM *m)
42. {
crypto/bn/bn_mod.c:43:10: Call
41. const BIGNUM *m)
42. {
43. if (!BN_uadd(r, a, b))
^
44. return 0;
45. if (BN_ucmp(r, m) >= 0)
crypto/bn/bn_add.c:58:1: Parameter `r->top`
56.
57. /* unsigned add of b to a */
58. > int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
59. {
60. int max, min, dif;
crypto/bn/bn_add.c:78:9: Call
76. dif = max - min;
77.
78. if (bn_wexpand(r, max + 1) == NULL)
^
79. return 0;
80.
crypto/bn/bn_lib.c:948:1: Parameter `a->top`
946. }
947.
948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:950:37: Call
948. BIGNUM *bn_wexpand(BIGNUM *a, int words)
949. {
950. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
951. }
952.
crypto/bn/bn_lib.c:284:1: Parameter `b->top`
282. */
283.
284. > BIGNUM *bn_expand2(BIGNUM *b, int words)
285. {
286. bn_check_top(b);
crypto/bn/bn_lib.c:289:23: Call
287.
288. if (words > b->dmax) {
289. BN_ULONG *a = bn_expand_internal(b, words);
^
290. if (!a)
291. return NULL;
crypto/bn/bn_lib.c:246:1: <Offset trace>
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: Parameter `b->top`
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: <Length trace>
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:246:1: Parameter `words`
244. /* This is used by bn_expand2() */
245. /* The caller MUST check that words > b->dmax before calling this */
246. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
247. {
248. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:263:13: Call
261. a = OPENSSL_secure_zalloc(words * sizeof(*a));
262. else
263. a = OPENSSL_zalloc(words * sizeof(*a));
^
264. if (a == NULL) {
265. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/mem.c:186:1: Parameter `num`
184. }
185.
186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:188:17: Call
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
^
189.
190. FAILTEST();
crypto/mem.c:166:9: Assignment
164.
165. if (num == 0)
166. return NULL;
^
167.
168. FAILTEST();
crypto/mem.c:188:5: Assignment
186. void *CRYPTO_zalloc(size_t num, const char *file, int line)
187. {
188. void *ret = CRYPTO_malloc(num, file, line);
^
189.
190. FAILTEST();
crypto/mem.c:193:5: Assignment
191. if (ret != NULL)
192. memset(ret, 0, num);
193. return ret;
^
194. }
195.
crypto/bn/bn_lib.c:263:9: Assignment
261. a = OPENSSL_secure_zalloc(words * sizeof(*a));
262. else
263. a = OPENSSL_zalloc(words * sizeof(*a));
^
264. if (a == NULL) {
265. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:271:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_add_quick`
269. assert(b->top <= words);
270. if (b->top > 0)
271. memcpy(a, b->d, sizeof(*a) * b->top);
^
272.
273. return a;
|
https://github.com/openssl/openssl/blob/05eec39505ba8af6f3c1558a26c565987707cd37/crypto/bn/bn_lib.c/#L271
|
d2a_code_trace_data_45687
|
void
TIFFReverseBits(uint8* cp, tmsize_t n)
{
for (; n > 8; n -= 8) {
cp[0] = TIFFBitRevTable[cp[0]];
cp[1] = TIFFBitRevTable[cp[1]];
cp[2] = TIFFBitRevTable[cp[2]];
cp[3] = TIFFBitRevTable[cp[3]];
cp[4] = TIFFBitRevTable[cp[4]];
cp[5] = TIFFBitRevTable[cp[5]];
cp[6] = TIFFBitRevTable[cp[6]];
cp[7] = TIFFBitRevTable[cp[7]];
cp += 8;
}
while (n-- > 0)
*cp = TIFFBitRevTable[*cp], cp++;
}
tools/tiffcp.c:1005: error: Buffer Overrun L3
Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFWriteScanline`.
tools/tiffcp.c:980:1: Parameter `out->tif_rawdata`
978. * Contig -> separate by row.
979. */
980. DECLAREcpFunc(cpContig2SeparateByRow)
^
981. {
982. tdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));
tools/tiffcp.c:1005:8: Call
1003. inp += spp;
1004. }
1005. if (TIFFWriteScanline(out, outbuf, row, s) < 0) {
^
1006. TIFFError(TIFFFileName(out),
1007. "Error, can't write scanline %lu",
libtiff/tif_write.c:48:1: Parameter `*tif->tif_rawdata`
46. static int TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc);
47.
48. int
^
49. TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
50. {
libtiff/tif_write.c:107:8: Call
105. * Changing strips -- flush any data present.
106. */
107. if (!TIFFFlushData(tif))
^
108. return (-1);
109. tif->tif_curstrip = strip;
libtiff/tif_flush.c:98:1: Parameter `*tif->tif_rawdata`
96. * problems for other people.
97. */
98. int
^
99. TIFFFlushData(TIFF* tif)
100. {
libtiff/tif_flush.c:108:10: Call
106. return (0);
107. }
108. return (TIFFFlushData1(tif));
^
109. }
110.
libtiff/tif_write.c:709:1: Parameter `*tif->tif_rawdata`
707. * for infinite recursion.
708. */
709. int
^
710. TIFFFlushData1(TIFF* tif)
711. {
libtiff/tif_write.c:715:4: Call
713. if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
714. (tif->tif_flags & TIFF_NOBITREV) == 0)
715. TIFFReverseBits((uint8*)tif->tif_rawdata,
^
716. tif->tif_rawcc);
717. if (!TIFFAppendToStrip(tif,
libtiff/tif_swab.c:285:1: <Length trace>
283. }
284.
285. void
^
286. TIFFReverseBits(uint8* cp, tmsize_t n)
287. {
libtiff/tif_swab.c:285:1: Parameter `*cp`
283. }
284.
285. void
^
286. TIFFReverseBits(uint8* cp, tmsize_t n)
287. {
libtiff/tif_swab.c:296:3: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFWriteScanline`
294. cp[5] = TIFFBitRevTable[cp[5]];
295. cp[6] = TIFFBitRevTable[cp[6]];
296. cp[7] = TIFFBitRevTable[cp[7]];
^
297. cp += 8;
298. }
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L296
|
d2a_code_trace_data_45688
|
int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
{
const tls_curve_info *cinfo;
if (curve[0])
return 1;
if ((curve[1] < 1) || ((size_t)curve[1] > OSSL_NELEM(nid_list)))
return 0;
cinfo = &nid_list[curve[1] - 1];
# ifdef OPENSSL_NO_EC2M
if (cinfo->flags & TLS_CURVE_CHAR2)
return 0;
# endif
return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve);
}
ssl/statem/extensions.c:1136: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: 29 by call to `check_in_list`.
Showing all 9 steps of the trace
ssl/t1_lib.c:176:1: Array declaration
174.
175. /* The default curves */
176. > static const unsigned char eccurves_default[] = {
177. 0, 29, /* X25519 (29) */
178. 0, 23, /* secp256r1 (23) */
ssl/statem/extensions.c:1136:21: Call
1134. group_id = bytestogroup(pcurvestmp);
1135.
1136. if (check_in_list(s, group_id, clntcurves, clnt_num_curves, 1))
^
1137. break;
1138. }
ssl/statem/statem_lib.c:1951:1: Parameter `*groups`
1949. */
1950. #ifndef OPENSSL_NO_EC
1951. > int check_in_list(SSL *s, unsigned int group_id, const unsigned char *groups,
1952. size_t num_groups, int checkallow)
1953. {
ssl/statem/statem_lib.c:1962:24: Call
1960. if (group_id == GET_GROUP_ID(groups, 0)
1961. && (!checkallow
1962. || tls_curve_allowed(s, groups, SSL_SECOP_CURVE_CHECK))) {
^
1963. return 1;
1964. }
ssl/t1_lib.c:268:1: <Offset trace>
266.
267. /* See if curve is allowed by security callback */
268. > int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
269. {
270. const tls_curve_info *cinfo;
ssl/t1_lib.c:268:1: Parameter `*curve`
266.
267. /* See if curve is allowed by security callback */
268. > int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
269. {
270. const tls_curve_info *cinfo;
ssl/t1_lib.c:137:1: <Length trace>
135. * table: the index of each entry is one less than the TLS curve id.
136. */
137. > static const tls_curve_info nid_list[] = {
138. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */
139. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */
ssl/t1_lib.c:137:1: Array declaration
135. * table: the index of each entry is one less than the TLS curve id.
136. */
137. > static const tls_curve_info nid_list[] = {
138. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */
139. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */
ssl/t1_lib.c:275:5: Array access: Offset: [-1, +oo] Size: 29 by call to `check_in_list`
273. if ((curve[1] < 1) || ((size_t)curve[1] > OSSL_NELEM(nid_list)))
274. return 0;
275. cinfo = &nid_list[curve[1] - 1];
^
276. # ifdef OPENSSL_NO_EC2M
277. if (cinfo->flags & TLS_CURVE_CHAR2)
|
https://github.com/openssl/openssl/blob/7671342e550ed2de676b23c79d0e7f45a381c76e/ssl/t1_lib.c/#L275
|
d2a_code_trace_data_45689
|
static void contract(LHASH *lh)
{
LHASH_NODE **n,*n1,*np;
np=lh->b[lh->p+lh->pmax-1];
lh->b[lh->p+lh->pmax-1]=NULL;
if (lh->p == 0)
{
n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
(unsigned int)(sizeof(LHASH_NODE *)*lh->pmax));
if (n == NULL)
{
lh->error++;
return;
}
lh->num_contract_reallocs++;
lh->num_alloc_nodes/=2;
lh->pmax/=2;
lh->p=lh->pmax-1;
lh->b=n;
}
else
lh->p--;
lh->num_nodes--;
lh->num_contracts++;
n1=lh->b[(int)lh->p];
if (n1 == NULL)
lh->b[(int)lh->p]=np;
else
{
while (n1->next != NULL)
n1=n1->next;
n1->next=np;
}
}
ssl/d1_srvr.c:270: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `ssl3_get_client_hello`.
Showing all 17 steps of the trace
ssl/d1_srvr.c:145:1: Parameter `s->ctx->sessions->p`
143. dtls1_get_server_method)
144.
145. > int dtls1_accept(SSL *s)
146. {
147. BUF_MEM *buf;
ssl/d1_srvr.c:270:8: Call
268.
269. s->shutdown=0;
270. ret=ssl3_get_client_hello(s);
^
271. if (ret <= 0) goto end;
272. s->new_session = 2;
ssl/s3_srvr.c:697:1: Parameter `s->ctx->sessions->p`
695. }
696.
697. > int ssl3_get_client_hello(SSL *s)
698. {
699. int i,j,ok,al,ret= -1;
ssl/s3_srvr.c:946:7: Call
944. }
945. }
946. if (ssl_check_clienthello_tlsext(s) <= 0) {
^
947. SSLerr(SSL_F_SSL3_ACCEPT,SSL_R_CLIENTHELLO_TLSEXT);
948. goto err;
ssl/t1_lib.c:759:1: Parameter `s->ctx->sessions->p`
757. }
758.
759. > int ssl_check_clienthello_tlsext(SSL *s)
760. {
761. int ret=SSL_TLSEXT_ERR_NOACK;
ssl/t1_lib.c:781:4: Call
779. {
780. case SSL_TLSEXT_ERR_ALERT_FATAL:
781. ssl3_send_alert(s,SSL3_AL_FATAL,al);
^
782. return -1;
783.
ssl/s3_pkt.c:1317:1: Parameter `s->ctx->sessions->p`
1315. }
1316.
1317. > void ssl3_send_alert(SSL *s, int level, int desc)
1318. {
1319. /* Map tls/ssl alert value to correct one */
ssl/s3_pkt.c:1326:3: Call
1324. /* If a fatal one, remove from cache */
1325. if ((level == 2) && (s->session != NULL))
1326. SSL_CTX_remove_session(s->ctx,s->session);
^
1327.
1328. s->s3->alert_dispatch=1;
ssl/ssl_sess.c:614:1: Parameter `ctx->sessions->p`
612. }
613.
614. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
615. {
616. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:616:9: Call
614. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
615. {
616. return remove_session_lock(ctx, c, 1);
^
617. }
618.
ssl/ssl_sess.c:619:1: Parameter `ctx->sessions->pmax`
617. }
618.
619. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
620. {
621. SSL_SESSION *r;
ssl/ssl_sess.c:630:21: Call
628. {
629. ret=1;
630. r=(SSL_SESSION *)lh_delete(ctx->sessions,c);
^
631. SSL_SESSION_list_remove(ctx,c);
632. }
crypto/lhash/lhash.c:217:1: Parameter `lh->pmax`
215. }
216.
217. > void *lh_delete(LHASH *lh, const void *data)
218. {
219. unsigned long hash;
crypto/lhash/lhash.c:243:3: Call
241. if ((lh->num_nodes > MIN_NODES) &&
242. (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
243. contract(lh);
^
244.
245. return(ret);
crypto/lhash/lhash.c:364:1: <LHS trace>
362. }
363.
364. > static void contract(LHASH *lh)
365. {
366. LHASH_NODE **n,*n1,*np;
crypto/lhash/lhash.c:364:1: Parameter `lh->p`
362. }
363.
364. > static void contract(LHASH *lh)
365. {
366. LHASH_NODE **n,*n1,*np;
crypto/lhash/lhash.c:368:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ssl3_get_client_hello`
366. LHASH_NODE **n,*n1,*np;
367.
368. np=lh->b[lh->p+lh->pmax-1];
^
369. lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */
370. if (lh->p == 0)
|
https://github.com/openssl/openssl/blob/02756aa8ba36af6e718d7a07c4e6bd8ad12e7ba1/crypto/lhash/lhash.c/#L368
|
d2a_code_trace_data_45690
|
ngx_int_t
ngx_atoi(u_char *line, size_t n)
{
ngx_int_t value, cutoff, cutlim;
if (n == 0) {
return NGX_ERROR;
}
cutoff = NGX_MAX_INT_T_VALUE / 10;
cutlim = NGX_MAX_INT_T_VALUE % 10;
for (value = 0; n--; line++) {
if (*line < '0' || *line > '9') {
return NGX_ERROR;
}
if (value >= cutoff && (value > cutoff || *line - '0' > cutlim)) {
return NGX_ERROR;
}
value = value * 10 + (*line - '0');
}
return value;
}
src/http/modules/ngx_http_geo_module.c:339: error: Integer Overflow L2
([0, 9223372036854775800] + [0, 9]):signed64 by call to `ngx_http_get_forwarded_addr`.
src/http/modules/ngx_http_geo_module.c:332:9: Call
330. ngx_array_t *xfwd;
331.
332. if (ngx_http_geo_real_addr(r, ctx, addr) != NGX_OK) {
^
333. return NGX_ERROR;
334. }
src/http/modules/ngx_http_geo_module.c:364:9: Call
362. }
363.
364. v = ngx_http_get_flushed_variable(r, ctx->index);
^
365.
366. if (v == NULL || v->not_found) {
src/http/ngx_http_variables.c:665:12: Call
663. }
664.
665. return ngx_http_get_indexed_variable(r, index);
^
666. }
667.
src/http/ngx_http_variables.c:628:9: Unknown value from: non-const function
626. ngx_http_variable_depth--;
627.
628. if (v[index].get_handler(r, &r->variables[index], v[index].data)
^
629. == NGX_OK)
630. {
src/http/modules/ngx_http_geo_module.c:339:16: Call
337.
338. if (xfwd->nelts > 0 && ctx->proxies != NULL) {
339. (void) ngx_http_get_forwarded_addr(r, addr, xfwd, NULL,
^
340. ctx->proxies, ctx->proxy_recursive);
341. }
src/http/ngx_http_core_module.c:2618:1: Parameter `*value->data`
2616.
2617.
2618. ngx_int_t
^
2619. ngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr,
2620. ngx_array_t *headers, ngx_str_t *value, ngx_array_t *proxies,
src/http/ngx_http_core_module.c:2628:16: Call
2626.
2627. if (headers == NULL) {
2628. return ngx_http_get_forwarded_addr_internal(r, addr, value->data,
^
2629. value->len, proxies,
2630. recursive);
src/http/ngx_http_core_module.c:2665:1: Parameter `*xff`
2663.
2664.
2665. static ngx_int_t
^
2666. ngx_http_get_forwarded_addr_internal(ngx_http_request_t *r, ngx_addr_t *addr,
2667. u_char *xff, size_t xfflen, ngx_array_t *proxies, int recursive)
src/http/ngx_http_core_module.c:2694:13: Call
2692. }
2693.
2694. if (ngx_parse_addr_port(r->pool, &paddr, p, xfflen - (p - xff))
^
2695. != NGX_OK)
2696. {
src/core/ngx_inet.c:621:1: Parameter `*text`
619.
620.
621. ngx_int_t
^
622. ngx_parse_addr_port(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text,
623. size_t len)
src/core/ngx_inet.c:629:10: Call
627. ngx_int_t rc, port;
628.
629. rc = ngx_parse_addr(pool, addr, text, len);
^
630.
631. if (rc != NGX_DECLINED) {
src/core/ngx_inet.c:561:1: Parameter `*text`
559.
560.
561. ngx_int_t
^
562. ngx_parse_addr(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text, size_t len)
563. {
src/core/ngx_inet.c:663:12: Call
661. plen = last - p;
662.
663. port = ngx_atoi(p, plen);
^
664.
665. if (port < 1 || port > 65535) {
src/core/ngx_string.c:926:5: <LHS trace>
924. }
925.
926. cutoff = NGX_MAX_INT_T_VALUE / 10;
^
927. cutlim = NGX_MAX_INT_T_VALUE % 10;
928.
src/core/ngx_string.c:926:5: Assignment
924. }
925.
926. cutoff = NGX_MAX_INT_T_VALUE / 10;
^
927. cutlim = NGX_MAX_INT_T_VALUE % 10;
928.
src/core/ngx_string.c:917:1: <RHS trace>
915.
916.
917. ngx_int_t
^
918. ngx_atoi(u_char *line, size_t n)
919. {
src/core/ngx_string.c:917:1: Parameter `*line`
915.
916.
917. ngx_int_t
^
918. ngx_atoi(u_char *line, size_t n)
919. {
src/core/ngx_string.c:938:9: Binary operation: ([0, 9223372036854775800] + [0, 9]):signed64 by call to `ngx_http_get_forwarded_addr`
936. }
937.
938. value = value * 10 + (*line - '0');
^
939. }
940.
|
https://github.com/nginx/nginx/blob/f909a7dc331621a8638ea46056e437b8be1496da/src/core/ngx_string.c/#L938
|
d2a_code_trace_data_45691
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/dh/dh_check.c:174: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`.
Showing all 10 steps of the trace
crypto/dh/dh_check.c:152:5: Call
150. if (ctx == NULL)
151. goto err;
152. BN_CTX_start(ctx);
^
153. tmp = BN_CTX_get(ctx);
154. if (tmp == NULL || !BN_set_word(tmp, 1))
crypto/bn/bn_ctx.c:235:1: Parameter `*ctx->stack.indexes`
233. }
234.
235. > void BN_CTX_start(BN_CTX *ctx)
236. {
237. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/dh/dh_check.c:174:9: Call
172. err:
173. if (ctx != NULL) {
174. BN_CTX_end(ctx);
^
175. BN_CTX_free(ctx);
176. }
crypto/bn/bn_ctx.c:249:1: Parameter `*ctx->stack.indexes`
247. }
248.
249. > void BN_CTX_end(BN_CTX *ctx)
250. {
251. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:255:27: Call
253. ctx->err_stack--;
254. else {
255. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
256. /* Does this stack frame have anything to release? */
257. if (fp < ctx->used)
crypto/bn/bn_ctx.c:325:1: <Offset trace>
323. }
324.
325. > static unsigned int BN_STACK_pop(BN_STACK *st)
326. {
327. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:325:1: Parameter `st->depth`
323. }
324.
325. > static unsigned int BN_STACK_pop(BN_STACK *st)
326. {
327. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:325:1: <Length trace>
323. }
324.
325. > static unsigned int BN_STACK_pop(BN_STACK *st)
326. {
327. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:325:1: Parameter `*st->indexes`
323. }
324.
325. > static unsigned int BN_STACK_pop(BN_STACK *st)
326. {
327. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:327:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`
325. static unsigned int BN_STACK_pop(BN_STACK *st)
326. {
327. return st->indexes[--(st->depth)];
^
328. }
329.
|
https://github.com/openssl/openssl/blob/c10d1bc81cb047cbd53f8cc430632b6a4a70252d/crypto/bn/bn_ctx.c/#L327
|
d2a_code_trace_data_45692
|
static int var_diamond_search(MpegEncContext * s, int *best, int dmin,
int src_index, int ref_index, int const penalty_factor,
int size, int h, int flags)
{
MotionEstContext * const c= &s->me;
me_cmp_func cmpf, chroma_cmpf;
int dia_size;
LOAD_COMMON
LOAD_COMMON2
int map_generation= c->map_generation;
cmpf= s->dsp.me_cmp[size];
chroma_cmpf= s->dsp.me_cmp[size+1];
for(dia_size=1; dia_size<=c->dia_size; dia_size++){
int dir, start, end;
const int x= best[0];
const int y= best[1];
start= FFMAX(0, y + dia_size - ymax);
end = FFMIN(dia_size, xmax - x + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dir , y + dia_size - dir);
}
start= FFMAX(0, x + dia_size - xmax);
end = FFMIN(dia_size, y - ymin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x + dia_size - dir, y - dir );
}
start= FFMAX(0, -y + dia_size + ymin );
end = FFMIN(dia_size, x - xmin + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dir , y - dia_size + dir);
}
start= FFMAX(0, -x + dia_size + xmin );
end = FFMIN(dia_size, ymax - y + 1);
for(dir= start; dir<end; dir++){
int d;
CHECK_MV(x - dia_size + dir, y + dir );
}
if(x!=best[0] || y!=best[1])
dia_size=0;
#if 0
{
int dx, dy, i;
static int stats[8*8];
dx= FFABS(x-best[0]);
dy= FFABS(y-best[1]);
stats[dy*8 + dx] ++;
if(256*256*256*64 % (stats[0]+1)==0){
for(i=0; i<64; i++){
if((i&7)==0) printf("\n");
printf("%6d ", stats[i]);
}
printf("\n");
}
}
#endif
}
return dmin;
}
libavcodec/motion_est_template.c:948: error: Uninitialized Value
The value read from xmax was never initialized.
libavcodec/motion_est_template.c:948:13:
946.
947. //check(x - dia_size + dir, y + dir,0, a3)
948. CHECK_MV(x - dia_size + dir, y + dir );
^
949. }
950.
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/motion_est_template.c/#L948
|
d2a_code_trace_data_45693
|
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/dtlstest.c:99: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `SSL_free`.
Showing all 17 steps of the trace
test/dtlstest.c:69:10: Call
67.
68. /* BIO is freed by create_ssl_connection on error */
69. if (!create_ssl_objects(sctx, cctx, &serverssl1, &clientssl1, NULL,
^
70. c_to_s_fbio)) {
71. printf("Unable to create SSL objects\n");
test/ssltestlib.c:577:21: Call
575.
576. if (*sssl == NULL)
577. serverssl = SSL_new(serverctx);
^
578. else
579. serverssl = *sssl;
ssl/ssl_lib.c:520:1: Parameter `ctx->sessions->num_nodes`
518. }
519.
520. > SSL *SSL_new(SSL_CTX *ctx)
521. {
522. SSL *s;
test/dtlstest.c:99:5: Call
97. testresult = 1;
98. end:
99. SSL_free(serverssl1);
^
100. SSL_free(clientssl1);
101. SSL_CTX_free(sctx);
ssl/ssl_lib.c:962:1: Parameter `s->ctx->sessions->num_nodes`
960. }
961.
962. > void SSL_free(SSL *s)
963. {
964. int i;
ssl/ssl_lib.c:1027:5: Call
1025. RECORD_LAYER_release(&s->rlayer);
1026.
1027. SSL_CTX_free(s->ctx);
^
1028.
1029. ASYNC_WAIT_CTX_free(s->waitctx);
ssl/ssl_lib.c:2496:1: Parameter `a->sessions->num_nodes`
2494. }
2495.
2496. > void SSL_CTX_free(SSL_CTX *a)
2497. {
2498. int i;
ssl/ssl_lib.c:2522:9: Call
2520. */
2521. if (a->sessions != NULL)
2522. SSL_CTX_flush_sessions(a, 0);
^
2523.
2524. CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_CTX, a, &a->ex_data);
ssl/ssl_sess.c:990:1: Parameter `s->sessions->num_nodes`
988. IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
989.
990. > void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
991. {
992. unsigned long i;
ssl/ssl_sess.c:1003:5: Call
1001. i = lh_SSL_SESSION_get_down_load(s->sessions);
1002. lh_SSL_SESSION_set_down_load(s->sessions, 0);
1003. lh_SSL_SESSION_doall_TIMEOUT_PARAM(tp.cache, timeout_cb, &tp);
^
1004. lh_SSL_SESSION_set_down_load(s->sessions, i);
1005. CRYPTO_THREAD_unlock(s->lock);
ssl/ssl_sess.c:988:1: Parameter `lh->num_nodes`
986. }
987.
988. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
989.
990. void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
ssl/ssl_sess.c:988:1: Call
986. }
987.
988. > IMPLEMENT_LHASH_DOALL_ARG(SSL_SESSION, TIMEOUT_PARAM);
989.
990. void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
crypto/lhash/lhash.c:182:1: Parameter `lh->num_nodes`
180. }
181.
182. > void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg)
183. {
184. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
crypto/lhash/lhash.c:184:5: Call
182. void OPENSSL_LH_doall_arg(OPENSSL_LHASH *lh, OPENSSL_LH_DOALL_FUNCARG func, void *arg)
183. {
184. doall_util_fn(lh, 1, (OPENSSL_LH_DOALL_FUNC)0, func, arg);
^
185. }
186.
crypto/lhash/lhash.c:150:1: <LHS trace>
148. }
149.
150. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
151. OPENSSL_LH_DOALL_FUNC func,
152. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg)
crypto/lhash/lhash.c:150:1: Parameter `lh->num_nodes`
148. }
149.
150. > static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,
151. OPENSSL_LH_DOALL_FUNC func,
152. OPENSSL_LH_DOALL_FUNCARG func_arg, void *arg)
crypto/lhash/lhash.c:164:10: Binary operation: ([0, +oo] - 1):unsigned32 by call to `SSL_free`
162. * memory leaks otherwise
163. */
164. for (i = lh->num_nodes - 1; i >= 0; i--) {
^
165. a = lh->b[i];
166. while (a != NULL) {
|
https://github.com/openssl/openssl/blob/1fb9fdc3027b27d8eb6a1e6a846435b070980770/crypto/lhash/lhash.c/#L164
|
d2a_code_trace_data_45694
|
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
if (!ossl_assert(pkt->subs != NULL && len != 0))
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
if (allocbytes != NULL)
*allocbytes = WPACKET_get_curr(pkt);
return 1;
}
ssl/statem/extensions_srvr.c:1051: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 10]):unsigned64 by call to `WPACKET_put_bytes__`.
Showing all 12 steps of the trace
ssl/statem/extensions_srvr.c:1050:17: Call
1048. if (!WPACKET_put_bytes_u16(pkt, TLSEXT_TYPE_use_srtp)
1049. || !WPACKET_start_sub_packet_u16(pkt)
1050. || !WPACKET_put_bytes_u16(pkt, 2)
^
1051. || !WPACKET_put_bytes_u16(pkt, s->srtp_profile->id)
1052. || !WPACKET_put_bytes_u8(pkt, 0)
ssl/packet.c:306:1: Parameter `pkt->buf->length`
304. }
305.
306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
307. {
308. unsigned char *data;
ssl/statem/extensions_srvr.c:1051:17: Call
1049. || !WPACKET_start_sub_packet_u16(pkt)
1050. || !WPACKET_put_bytes_u16(pkt, 2)
1051. || !WPACKET_put_bytes_u16(pkt, s->srtp_profile->id)
^
1052. || !WPACKET_put_bytes_u8(pkt, 0)
1053. || !WPACKET_close(pkt)) {
ssl/packet.c:306:1: Parameter `pkt->written`
304. }
305.
306. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
307. {
308. unsigned char *data;
ssl/packet.c:312:17: Call
310. /* Internal API, so should not fail */
311. if (!ossl_assert(size <= sizeof(unsigned int))
312. || !WPACKET_allocate_bytes(pkt, size, &data)
^
313. || !put_value(data, val, size))
314. return 0;
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:39:1: <LHS trace>
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: Parameter `pkt->buf->length`
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: <RHS trace>
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: Parameter `len`
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:48:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 10]):unsigned64 by call to `WPACKET_put_bytes__`
46. return 0;
47.
48. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) {
^
49. size_t newlen;
50. size_t reflen;
|
https://github.com/openssl/openssl/blob/7f7eb90b8ac55997c5c825bb3ebcfe28611e06f5/ssl/packet.c/#L48
|
d2a_code_trace_data_45695
|
static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_array tone_level_idx_temp,
sb_int8_array coding_method, int nb_channels,
int c, int superblocktype_2_3, int cm_table_select)
{
int ch, sb, j;
int tmp, acc, esp_40, comp;
int add1, add2, add3, add4;
int64_t multres;
if (nb_channels <= 0)
return;
if (!superblocktype_2_3) {
SAMPLES_NEEDED
for (ch = 0; ch < nb_channels; ch++)
for (sb = 0; sb < 30; sb++) {
for (j = 1; j < 64; j++) {
add1 = tone_level_idx[ch][sb][j] - 10;
if (add1 < 0)
add1 = 0;
add2 = add3 = add4 = 0;
if (sb > 1) {
add2 = tone_level_idx[ch][sb - 2][j] + tone_level_idx_offset_table[sb][0] - 6;
if (add2 < 0)
add2 = 0;
}
if (sb > 0) {
add3 = tone_level_idx[ch][sb - 1][j] + tone_level_idx_offset_table[sb][1] - 6;
if (add3 < 0)
add3 = 0;
}
if (sb < 29) {
add4 = tone_level_idx[ch][sb + 1][j] + tone_level_idx_offset_table[sb][3] - 6;
if (add4 < 0)
add4 = 0;
}
tmp = tone_level_idx[ch][sb][j + 1] * 2 - add4 - add3 - add2 - add1;
if (tmp < 0)
tmp = 0;
tone_level_idx_temp[ch][sb][j + 1] = tmp & 0xff;
}
tone_level_idx_temp[ch][sb][0] = tone_level_idx_temp[ch][sb][1];
}
acc = 0;
for (ch = 0; ch < nb_channels; ch++)
for (sb = 0; sb < 30; sb++)
for (j = 0; j < 64; j++)
acc += tone_level_idx_temp[ch][sb][j];
if (acc)
tmp = c * 256 / (acc & 0xffff);
multres = 0x66666667 * (acc * 10);
esp_40 = (multres >> 32) / 8 + ((multres & 0xffffffff) >> 31);
for (ch = 0; ch < nb_channels; ch++)
for (sb = 0; sb < 30; sb++)
for (j = 0; j < 64; j++) {
comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
if (comp < 0)
comp += 0xff;
comp /= 256;
switch(sb) {
case 0:
if (comp < 30)
comp = 30;
comp += 15;
break;
case 1:
if (comp < 24)
comp = 24;
comp += 10;
break;
case 2:
case 3:
case 4:
if (comp < 16)
comp = 16;
}
if (comp <= 5)
tmp = 0;
else if (comp <= 10)
tmp = 10;
else if (comp <= 16)
tmp = 16;
else if (comp <= 24)
tmp = -1;
else
tmp = 0;
coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 0xff;
}
for (sb = 0; sb < 30; sb++)
fix_coding_method_array(sb, nb_channels, coding_method);
for (ch = 0; ch < nb_channels; ch++)
for (sb = 0; sb < 30; sb++)
for (j = 0; j < 64; j++)
if (sb >= 10) {
if (coding_method[ch][sb][j] < 10)
coding_method[ch][sb][j] = 10;
} else {
if (sb >= 2) {
if (coding_method[ch][sb][j] < 16)
coding_method[ch][sb][j] = 16;
} else {
if (coding_method[ch][sb][j] < 30)
coding_method[ch][sb][j] = 30;
}
}
} else {
for (ch = 0; ch < nb_channels; ch++)
for (sb = 0; sb < 30; sb++)
for (j = 0; j < 64; j++)
coding_method[ch][sb][j] = coding_method_table[cm_table_select][sb];
}
return;
}
libavcodec/qdm2.c:707: error: Buffer Overrun L2
Offset: [2, 64] Size: 64.
libavcodec/qdm2.c:687:22: <Offset trace>
685. for (ch = 0; ch < nb_channels; ch++)
686. for (sb = 0; sb < 30; sb++) {
687. for (j = 1; j < 64; j++) {
^
688. add1 = tone_level_idx[ch][sb][j] - 10;
689. if (add1 < 0)
libavcodec/qdm2.c:687:22: Assignment
685. for (ch = 0; ch < nb_channels; ch++)
686. for (sb = 0; sb < 30; sb++) {
687. for (j = 1; j < 64; j++) {
^
688. add1 = tone_level_idx[ch][sb][j] - 10;
689. if (add1 < 0)
libavcodec/qdm2.c:669:1: <Length trace>
667. * @param cm_table_select q->cm_table_select
668. */
669. static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_array tone_level_idx_temp,
^
670. sb_int8_array coding_method, int nb_channels,
671. int c, int superblocktype_2_3, int cm_table_select)
libavcodec/qdm2.c:669:1: Parameter `(*tone_level_idx)[*][*]`
667. * @param cm_table_select q->cm_table_select
668. */
669. static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_array tone_level_idx_temp,
^
670. sb_int8_array coding_method, int nb_channels,
671. int c, int superblocktype_2_3, int cm_table_select)
libavcodec/qdm2.c:707:27: Array access: Offset: [2, 64] Size: 64
705. add4 = 0;
706. }
707. tmp = tone_level_idx[ch][sb][j + 1] * 2 - add4 - add3 - add2 - add1;
^
708. if (tmp < 0)
709. tmp = 0;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/qdm2.c/#L707
|
d2a_code_trace_data_45696
|
int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->buf->length - pkt->written < len) {
size_t newlen;
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;
pkt->written += len;
pkt->curr += len;
return 1;
}
ssl/t1_lib.c:1080: error: INTEGER_OVERFLOW_L2
([0, +oo] - [0, `s->s3->previous_client_finished_len` + `pkt->written` + `s->tlsext_hostname->strlen` + 28]):unsigned64 by call to `WPACKET_memcpy`.
Showing all 10 steps of the trace
ssl/t1_lib.c:1077:21: Call
1075. /* Sub-packet for SRP extension */
1076. || !WPACKET_start_sub_packet_u16(pkt)
1077. || !WPACKET_start_sub_packet_u8(pkt)
^
1078. /* login must not be zero...internal error if so */
1079. || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH)
ssl/packet.c:205:1: Parameter `pkt->buf->length`
203. }
204.
205. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
206. {
207. WPACKET_SUB *sub;
ssl/t1_lib.c:1080:21: Call
1078. /* login must not be zero...internal error if so */
1079. || !WPACKET_set_flags(pkt, WPACKET_FLAGS_NON_ZERO_LENGTH)
1080. || !WPACKET_memcpy(pkt, s->srp_ctx.login,
^
1081. strlen(s->srp_ctx.login))
1082. || !WPACKET_close(pkt)
ssl/packet.c:283:1: Parameter `pkt->written`
281. }
282.
283. > int WPACKET_memcpy(WPACKET *pkt, const void *src, size_t len)
284. {
285. unsigned char *dest;
ssl/packet.c:290:10: Call
288. return 1;
289.
290. if (!WPACKET_allocate_bytes(pkt, len, &dest))
^
291. return 0;
292.
ssl/packet.c:15:1: <LHS trace>
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: Parameter `pkt->buf->length`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: <RHS trace>
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:15:1: Parameter `len`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. /* Internal API, so should not fail */
ssl/packet.c:25:9: Binary operation: ([0, +oo] - [0, s->s3->previous_client_finished_len + pkt->written + s->tlsext_hostname->strlen + 28]):unsigned64 by call to `WPACKET_memcpy`
23. return 0;
24.
25. if (pkt->buf->length - pkt->written < len) {
^
26. size_t newlen;
27. size_t reflen;
|
https://github.com/openssl/openssl/blob/a6972f346248fbc37e42056bb943fae0896a2967/ssl/packet.c/#L25
|
d2a_code_trace_data_45697
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ec2_smpl.c:659: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_CTX_end`.
Showing all 9 steps of the trace
crypto/ec/ec2_smpl.c:620:1: Parameter `ctx->stack.depth`
618. * 1 not equal
619. */
620. > int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
621. const EC_POINT *b, BN_CTX *ctx)
622. {
crypto/ec/ec2_smpl.c:644:5: Call
642. }
643.
644. BN_CTX_start(ctx);
^
645. aX = BN_CTX_get(ctx);
646. aY = 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/ec/ec2_smpl.c:659:5: Call
657.
658. err:
659. BN_CTX_end(ctx);
^
660. BN_CTX_free(new_ctx);
661. return ret;
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_CTX_end`
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/a8ea8018fa187e22fb4989450b550589e20f62c2/crypto/bn/bn_ctx.c/#L273
|
d2a_code_trace_data_45698
|
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr,
int32_t sb_samples[SBLIMIT])
{
int32_t tmp[32];
register MPA_INT *synth_buf;
register const MPA_INT *w, *w2, *p;
int j, offset, v;
OUT_INT *samples2;
#if FRAC_BITS <= 15
int sum, sum2;
#else
int64_t sum, sum2;
#endif
dct32(tmp, sb_samples);
offset = *synth_buf_offset;
synth_buf = synth_buf_ptr + offset;
for(j=0;j<32;j++) {
v = tmp[j];
#if FRAC_BITS <= 15
v = av_clip_int16(v);
#endif
synth_buf[j] = v;
}
memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT));
samples2 = samples + 31 * incr;
w = window;
w2 = window + 31;
sum = *dither_state;
p = synth_buf + 16;
SUM8(sum, +=, w, p);
p = synth_buf + 48;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
samples += incr;
w++;
for(j=1;j<16;j++) {
sum2 = 0;
p = synth_buf + 16 + j;
SUM8P2(sum, +=, sum2, -=, w, w2, p);
p = synth_buf + 48 - j;
SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
*samples = round_sample(&sum);
samples += incr;
sum += sum2;
*samples2 = round_sample(&sum);
samples2 -= incr;
w++;
w2--;
}
p = synth_buf + 32;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
*dither_state= sum;
offset = (offset - 32) & 511;
*synth_buf_offset = offset;
}
libavcodec/mpc.c:60: error: Buffer Overrun L2
Offset: [32+min(0, `c->synth_buf_offset[*]`), 33+max(511, `c->synth_buf_offset[*]`)] Size: 2 by call to `ff_mpa_synth_filter`.
libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]`
49. * Process decoded Musepack data and produce PCM
50. */
51. static void mpc_synth(MPCContext *c, int16_t *out)
^
52. {
53. int dither_state = 0;
libavcodec/mpc.c:60:13: Call
58. samples_ptr = samples + ch;
59. for(i = 0; i < SAMPLES_PER_BAND; i++) {
60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
^
61. mpa_window, &dither_state,
62. samples_ptr, 2,
libavcodec/mpegaudiodec.c:858:1: <Length trace>
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:858:1: Parameter `*synth_buf_ptr`
856. 32 samples. */
857. /* XXX: optimize by avoiding ring buffer usage */
858. void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
^
859. MPA_INT *window, int *dither_state,
860. OUT_INT *samples, int incr,
libavcodec/mpegaudiodec.c:877:5: Assignment
875.
876. offset = *synth_buf_offset;
877. synth_buf = synth_buf_ptr + offset;
^
878.
879. for(j=0;j<32;j++) {
libavcodec/mpegaudiodec.c:922:5: Assignment
920. }
921.
922. p = synth_buf + 32;
^
923. SUM8(sum, -=, w + 32, p);
924. *samples = round_sample(&sum);
libavcodec/mpegaudiodec.c:923:5: Array access: Offset: [32+min(0, c->synth_buf_offset[*]), 33+max(511, c->synth_buf_offset[*])] Size: 2 by call to `ff_mpa_synth_filter`
921.
922. p = synth_buf + 32;
923. SUM8(sum, -=, w + 32, p);
^
924. *samples = round_sample(&sum);
925. *dither_state= sum;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L923
|
d2a_code_trace_data_45699
|
static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
{
const tls_curve_info *cinfo;
if (curve[0])
return 1;
if ((curve[1] < 1) || ((size_t)curve[1] >
sizeof(nid_list) / sizeof(nid_list[0])))
return 0;
cinfo = &nid_list[curve[1] - 1];
# ifdef OPENSSL_NO_EC2M
if (cinfo->flags & TLS_CURVE_CHAR2)
return 0;
# endif
return ssl_security(s, op, cinfo->secbits, cinfo->nid, (void *)curve);
}
ssl/t1_lib.c:538: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: 28 by call to `tls_curve_allowed`.
Showing all 7 steps of the trace
ssl/t1_lib.c:273:1: Array declaration
271. };
272.
273. > static const unsigned char eccurves_default[] = {
274. 0, 14, /* sect571r1 (14) */
275. 0, 13, /* sect571k1 (13) */
ssl/t1_lib.c:538:22: Call
536. for (j = 0; j < num_supp; j++, tsupp += 2) {
537. if (pref[0] == tsupp[0] && pref[1] == tsupp[1]) {
538. if (!tls_curve_allowed(s, pref, SSL_SECOP_CURVE_SHARED))
^
539. continue;
540. if (nmatch == k) {
ssl/t1_lib.c:442:1: <Offset trace>
440.
441. /* See if curve is allowed by security callback */
442. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
443. {
444. const tls_curve_info *cinfo;
ssl/t1_lib.c:442:1: Parameter `*curve`
440.
441. /* See if curve is allowed by security callback */
442. > static int tls_curve_allowed(SSL *s, const unsigned char *curve, int op)
443. {
444. const tls_curve_info *cinfo;
ssl/t1_lib.c:236:1: <Length trace>
234. # define TLS_CURVE_PRIME 0x0
235.
236. > static const tls_curve_info nid_list[] = {
237. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */
238. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */
ssl/t1_lib.c:236:1: Array declaration
234. # define TLS_CURVE_PRIME 0x0
235.
236. > static const tls_curve_info nid_list[] = {
237. {NID_sect163k1, 80, TLS_CURVE_CHAR2}, /* sect163k1 (1) */
238. {NID_sect163r1, 80, TLS_CURVE_CHAR2}, /* sect163r1 (2) */
ssl/t1_lib.c:450:5: Array access: Offset: [-1, +oo] Size: 28 by call to `tls_curve_allowed`
448. sizeof(nid_list) / sizeof(nid_list[0])))
449. return 0;
450. cinfo = &nid_list[curve[1] - 1];
^
451. # ifdef OPENSSL_NO_EC2M
452. if (cinfo->flags & TLS_CURVE_CHAR2)
|
https://github.com/openssl/openssl/blob/9c46f4b9cd4912b61cb546c48b678488d7f26ed6/ssl/t1_lib.c/#L450
|
d2a_code_trace_data_45700
|
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/sslcorrupttest.c:169: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_free`.
Showing all 16 steps of the trace
test/sslcorrupttest.c:146:11: Call
144. ctx = SSL_CTX_new(TLS_server_method());
145. TEST_check(ctx != NULL);
146. ssl = SSL_new(ctx);
^
147. TEST_check(ssl != NULL);
148. sk_ciphers = SSL_get1_supported_ciphers(ssl);
ssl/ssl_lib.c:519:1: Parameter `ctx->sessions->num_items`
517. }
518.
519. > SSL *SSL_new(SSL_CTX *ctx)
520. {
521. SSL *s;
test/sslcorrupttest.c:169:5: Call
167.
168. sk_SSL_CIPHER_free(sk_ciphers);
169. SSL_free(ssl);
^
170. SSL_CTX_free(ctx);
171.
ssl/ssl_lib.c:961:1: Parameter `s->initial_ctx->sessions->num_items`
959. }
960.
961. > void SSL_free(SSL *s)
962. {
963. int i;
ssl/ssl_lib.c:991:9: Call
989. /* Make the next call work :-) */
990. if (s->session != NULL) {
991. ssl_clear_bad_session(s);
^
992. SSL_SESSION_free(s->session);
993. }
ssl/ssl_sess.c:1009:1: Parameter `s->initial_ctx->sessions->num_items`
1007. }
1008.
1009. > int ssl_clear_bad_session(SSL *s)
1010. {
1011. if ((s->session != NULL) &&
ssl/ssl_sess.c:1014:9: Call
1012. !(s->shutdown & SSL_SENT_SHUTDOWN) &&
1013. !(SSL_in_init(s) || SSL_in_before(s))) {
1014. SSL_CTX_remove_session(s->session_ctx, s->session);
^
1015. return (1);
1016. } else
ssl/ssl_sess.c:698:1: Parameter `ctx->sessions->num_items`
696. }
697.
698. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
699. {
700. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:700:12: Call
698. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
699. {
700. return remove_session_lock(ctx, c, 1);
^
701. }
702.
ssl/ssl_sess.c:703:1: Parameter `ctx->sessions->num_items`
701. }
702.
703. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
704. {
705. SSL_SESSION *r;
ssl/ssl_sess.c:713:17: Call
711. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
712. ret = 1;
713. r = lh_SSL_SESSION_delete(ctx->sessions, c);
^
714. SSL_SESSION_list_remove(ctx, c);
715. }
ssl/ssl_locl.h:602:1: Parameter `lh->num_items`
600. };
601.
602. > DEFINE_LHASH_OF(SSL_SESSION);
603. /* Needed in ssl_cert.c */
604. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:602:1: Call
600. };
601.
602. > DEFINE_LHASH_OF(SSL_SESSION);
603. /* Needed in ssl_cert.c */
604. 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/6a69e8694af23dae1d1927813932f4296d133416/crypto/lhash/lhash.c/#L123
|
d2a_code_trace_data_45701
|
static void tls1_lookup_sigalg(int *phash_nid, int *psign_nid,
int *psignhash_nid, const unsigned char *data)
{
int sign_nid, hash_nid;
if (!phash_nid && !psign_nid && !psignhash_nid)
return;
if (phash_nid || psignhash_nid)
{
hash_nid = tls12_find_nid(data[0], tls12_md,
sizeof(tls12_md)/sizeof(tls12_lookup));
if (phash_nid)
*phash_nid = hash_nid;
}
if (psign_nid || psignhash_nid)
{
sign_nid = tls12_find_nid(data[1], tls12_sig,
sizeof(tls12_sig)/sizeof(tls12_lookup));
if (psign_nid)
*psign_nid = sign_nid;
}
if (psignhash_nid)
{
if (sign_nid && hash_nid)
OBJ_find_sigid_by_algs(psignhash_nid,
hash_nid, sign_nid);
else
*psignhash_nid = NID_undef;
}
}
ssl/t1_lib.c:2922: error: UNINITIALIZED_VALUE
The value read from hash_nid was never initialized.
Showing all 1 steps of the trace
ssl/t1_lib.c:2922:4:
2920. {
2921. if (sign_nid && hash_nid)
2922. > OBJ_find_sigid_by_algs(psignhash_nid,
2923. hash_nid, sign_nid);
2924. else
|
https://github.com/openssl/openssl/blob/be681e123c3582f7bef18ed41b5ffa4793e8c4f7/ssl/t1_lib.c/#L2922
|
d2a_code_trace_data_45702
|
IMPLEMENT_new_ctx(cfb, CFB, 128)
providers/common/ciphers/aes.c:308: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 308 could be null and is dereferenced at line 308, column 1.
Showing all 18 steps of the trace
providers/common/ciphers/aes.c:308:1: start of procedure aes_128_cfb_newctx()
306. IMPLEMENT_new_ctx(cfb, CFB, 256)
307. IMPLEMENT_new_ctx(cfb, CFB, 192)
308. > IMPLEMENT_new_ctx(cfb, CFB, 128)
309. IMPLEMENT_new_ctx(cfb1, CFB, 256)
310. IMPLEMENT_new_ctx(cfb1, CFB, 192)
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:308:1:
306. IMPLEMENT_new_ctx(cfb, CFB, 256)
307. IMPLEMENT_new_ctx(cfb, CFB, 192)
308. > IMPLEMENT_new_ctx(cfb, CFB, 128)
309. IMPLEMENT_new_ctx(cfb1, CFB, 256)
310. IMPLEMENT_new_ctx(cfb1, CFB, 192)
|
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L308
|
d2a_code_trace_data_45703
|
HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx,
SSL_CTX *client_ctx, const SSL_TEST_CTX *test_ctx)
{
SSL *server, *client;
BIO *client_to_server, *server_to_client;
HANDSHAKE_EX_DATA server_ex_data, client_ex_data;
CTX_DATA client_ctx_data, server_ctx_data, server2_ctx_data;
HANDSHAKE_RESULT *ret = HANDSHAKE_RESULT_new();
int client_turn = 1;
peer_status_t client_status = PEER_RETRY, server_status = PEER_RETRY;
handshake_status_t status = HANDSHAKE_RETRY;
unsigned char* tick = NULL;
size_t tick_len = 0;
SSL_SESSION* sess = NULL;
const unsigned char *proto = NULL;
unsigned int proto_len = 0;
memset(&server_ctx_data, 0, sizeof(server_ctx_data));
memset(&server2_ctx_data, 0, sizeof(server2_ctx_data));
memset(&client_ctx_data, 0, sizeof(client_ctx_data));
configure_handshake_ctx(server_ctx, server2_ctx, client_ctx, test_ctx,
&server_ctx_data, &server2_ctx_data, &client_ctx_data);
server = SSL_new(server_ctx);
client = SSL_new(client_ctx);
OPENSSL_assert(server != NULL && client != NULL);
configure_handshake_ssl(server, client, test_ctx);
memset(&server_ex_data, 0, sizeof(server_ex_data));
memset(&client_ex_data, 0, sizeof(client_ex_data));
ret->result = SSL_TEST_INTERNAL_ERROR;
client_to_server = BIO_new(BIO_s_mem());
server_to_client = BIO_new(BIO_s_mem());
OPENSSL_assert(client_to_server != NULL && server_to_client != NULL);
BIO_set_nbio(client_to_server, 1);
BIO_set_nbio(server_to_client, 1);
SSL_set_connect_state(client);
SSL_set_accept_state(server);
SSL_set_bio(client, server_to_client, client_to_server);
OPENSSL_assert(BIO_up_ref(server_to_client) > 0);
OPENSSL_assert(BIO_up_ref(client_to_server) > 0);
SSL_set_bio(server, client_to_server, server_to_client);
ex_data_idx = SSL_get_ex_new_index(0, "ex data", NULL, NULL, NULL);
OPENSSL_assert(ex_data_idx >= 0);
OPENSSL_assert(SSL_set_ex_data(server, ex_data_idx,
&server_ex_data) == 1);
OPENSSL_assert(SSL_set_ex_data(client, ex_data_idx,
&client_ex_data) == 1);
SSL_set_info_callback(server, &info_cb);
SSL_set_info_callback(client, &info_cb);
for(;;) {
if (client_turn) {
client_status = do_handshake_step(client);
status = handshake_status(client_status, server_status,
1 );
} else {
server_status = do_handshake_step(server);
status = handshake_status(server_status, client_status,
0 );
}
switch (status) {
case HANDSHAKE_SUCCESS:
ret->result = SSL_TEST_SUCCESS;
goto err;
case CLIENT_ERROR:
ret->result = SSL_TEST_CLIENT_FAIL;
goto err;
case SERVER_ERROR:
ret->result = SSL_TEST_SERVER_FAIL;
goto err;
case INTERNAL_ERROR:
ret->result = SSL_TEST_INTERNAL_ERROR;
goto err;
case HANDSHAKE_RETRY:
client_turn ^= 1;
break;
}
}
err:
ret->server_alert_sent = server_ex_data.alert_sent;
ret->server_alert_received = client_ex_data.alert_received;
ret->client_alert_sent = client_ex_data.alert_sent;
ret->client_alert_received = server_ex_data.alert_received;
ret->server_protocol = SSL_version(server);
ret->client_protocol = SSL_version(client);
ret->servername = server_ex_data.servername;
if ((sess = SSL_get0_session(client)) != NULL)
SSL_SESSION_get0_ticket(sess, &tick, &tick_len);
if (tick == NULL || tick_len == 0)
ret->session_ticket = SSL_TEST_SESSION_TICKET_NO;
else
ret->session_ticket = SSL_TEST_SESSION_TICKET_YES;
ret->session_ticket_do_not_call = server_ex_data.session_ticket_do_not_call;
SSL_get0_next_proto_negotiated(client, &proto, &proto_len);
ret->client_npn_negotiated = dup_str(proto, proto_len);
SSL_get0_next_proto_negotiated(server, &proto, &proto_len);
ret->server_npn_negotiated = dup_str(proto, proto_len);
SSL_get0_alpn_selected(client, &proto, &proto_len);
ret->client_alpn_negotiated = dup_str(proto, proto_len);
SSL_get0_alpn_selected(server, &proto, &proto_len);
ret->server_alpn_negotiated = dup_str(proto, proto_len);
ctx_data_free_data(&server_ctx_data);
ctx_data_free_data(&server2_ctx_data);
ctx_data_free_data(&client_ctx_data);
SSL_free(server);
SSL_free(client);
return ret;
}
test/handshake_helper.c:591: error: UNINITIALIZED_VALUE
The value read from server_ex_data.alert_sent was never initialized.
Showing all 1 steps of the trace
test/handshake_helper.c:591:5:
589. }
590. err:
591. > ret->server_alert_sent = server_ex_data.alert_sent;
592. ret->server_alert_received = client_ex_data.alert_received;
593. ret->client_alert_sent = client_ex_data.alert_sent;
|
https://github.com/openssl/openssl/blob/70c22888c1648fe8652e77107f3c74bf2212de36/test/handshake_helper.c/#L591
|
d2a_code_trace_data_45704
|
static int opt_streamid(const char *opt, const char *arg)
{
int idx;
char *p;
char idx_str[16];
strncpy(idx_str, arg, sizeof(idx_str));
idx_str[sizeof(idx_str)-1] = '\0';
p = strchr(idx_str, ':');
if (!p) {
fprintf(stderr,
"Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
arg, opt);
ffmpeg_exit(1);
}
*p++ = '\0';
idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
streamid_map[idx] = parse_number_or_die(opt, p, OPT_INT, 0, INT_MAX);
return 0;
}
ffmpeg.c:3674: error: Null Dereference
pointer `p` last assigned on line 3674 could be null and is dereferenced at line 3674, column 5.
ffmpeg.c:3659:1: start of procedure opt_streamid()
3657.
3658. /* arg format is "output-stream-index:streamid-value". */
3659. static int opt_streamid(const char *opt, const char *arg)
^
3660. {
3661. int idx;
ffmpeg.c:3665:5:
3663. char idx_str[16];
3664.
3665. strncpy(idx_str, arg, sizeof(idx_str));
^
3666. idx_str[sizeof(idx_str)-1] = '\0';
3667. p = strchr(idx_str, ':');
ffmpeg.c:3666:5:
3664.
3665. strncpy(idx_str, arg, sizeof(idx_str));
3666. idx_str[sizeof(idx_str)-1] = '\0';
^
3667. p = strchr(idx_str, ':');
3668. if (!p) {
ffmpeg.c:3667:5:
3665. strncpy(idx_str, arg, sizeof(idx_str));
3666. idx_str[sizeof(idx_str)-1] = '\0';
3667. p = strchr(idx_str, ':');
^
3668. if (!p) {
3669. fprintf(stderr,
ffmpeg.c:3668:10: Taking true branch
3666. idx_str[sizeof(idx_str)-1] = '\0';
3667. p = strchr(idx_str, ':');
3668. if (!p) {
^
3669. fprintf(stderr,
3670. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
ffmpeg.c:3669:9:
3667. p = strchr(idx_str, ':');
3668. if (!p) {
3669. fprintf(stderr,
^
3670. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3671. arg, opt);
ffmpeg.c:3672:9: Skipping ffmpeg_exit(): empty list of specs
3670. "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
3671. arg, opt);
3672. ffmpeg_exit(1);
^
3673. }
3674. *p++ = '\0';
ffmpeg.c:3674:5:
3672. ffmpeg_exit(1);
3673. }
3674. *p++ = '\0';
^
3675. idx = parse_number_or_die(opt, idx_str, OPT_INT, 0, MAX_STREAMS-1);
3676. streamid_map = grow_array(streamid_map, sizeof(*streamid_map), &nb_streamid_map, idx+1);
|
https://github.com/libav/libav/blob/f4c79d1e0b2e797012304db57903e4091b0c2d7c/ffmpeg.c/#L3674
|
d2a_code_trace_data_45705
|
static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
int i;
init_get_bits(&gb, buf, buf_size * 8);
if (s->theora && get_bits1(&gb))
{
av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
return -1;
}
s->keyframe = !get_bits1(&gb);
if (!s->theora)
skip_bits(&gb, 1);
for (i = 0; i < 3; i++)
s->last_qps[i] = s->qps[i];
s->nqps=0;
do{
s->qps[s->nqps++]= get_bits(&gb, 6);
} while(s->theora >= 0x030200 && s->nqps<3 && get_bits1(&gb));
for (i = s->nqps; i < 3; i++)
s->qps[i] = -1;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n",
s->keyframe?"key":"", avctx->frame_number+1, s->qps[0]);
s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] ||
avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL : AVDISCARD_NONKEY);
if (s->qps[0] != s->last_qps[0])
init_loop_filter(s);
for (i = 0; i < s->nqps; i++)
if (s->qps[i] != s->last_qps[i] || s->qps[0] != s->last_qps[0])
init_dequantizer(s, i);
if (avctx->skip_frame >= AVDISCARD_NONKEY && !s->keyframe)
return buf_size;
s->current_frame.reference = 3;
s->current_frame.pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
if (ff_thread_get_buffer(avctx, &s->current_frame) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
goto error;
}
if (!s->edge_emu_buffer)
s->edge_emu_buffer = av_malloc(9*FFABS(s->current_frame.linesize[0]));
if (s->keyframe) {
if (!s->theora)
{
skip_bits(&gb, 4);
skip_bits(&gb, 4);
if (s->version)
{
s->version = get_bits(&gb, 5);
if (avctx->frame_number == 0)
av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version);
}
}
if (s->version || s->theora)
{
if (get_bits1(&gb))
av_log(s->avctx, AV_LOG_ERROR, "Warning, unsupported keyframe coding type?!\n");
skip_bits(&gb, 2);
}
} else {
if (!s->golden_frame.data[0]) {
av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
s->golden_frame.reference = 3;
s->golden_frame.pict_type = AV_PICTURE_TYPE_I;
if (ff_thread_get_buffer(avctx, &s->golden_frame) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
goto error;
}
s->last_frame = s->golden_frame;
s->last_frame.type = FF_BUFFER_TYPE_COPY;
ff_thread_report_progress(&s->last_frame, INT_MAX, 0);
}
}
memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment));
ff_thread_finish_setup(avctx);
if (unpack_superblocks(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n");
goto error;
}
if (unpack_modes(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n");
goto error;
}
if (unpack_vectors(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n");
goto error;
}
if (unpack_block_qpis(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_block_qpis\n");
goto error;
}
if (unpack_dct_coeffs(s, &gb)){
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n");
goto error;
}
for (i = 0; i < 3; i++) {
int height = s->height >> (i && s->chroma_y_shift);
if (s->flipped_image)
s->data_offset[i] = 0;
else
s->data_offset[i] = (height-1) * s->current_frame.linesize[i];
}
s->last_slice_end = 0;
for (i = 0; i < s->c_superblock_height; i++)
render_slice(s, i);
for (i = 0; i < 3; i++) {
int row = (s->height >> (3+(i && s->chroma_y_shift))) - 1;
apply_loop_filter(s, i, row, row+1);
}
vp3_draw_horiz_band(s, s->avctx->height);
*data_size=sizeof(AVFrame);
*(AVFrame*)data= s->current_frame;
if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME))
update_frames(avctx);
return buf_size;
error:
ff_thread_report_progress(&s->current_frame, INT_MAX, 0);
if (!HAVE_THREADS || !(s->avctx->active_thread_type&FF_THREAD_FRAME))
avctx->release_buffer(avctx, &s->current_frame);
return -1;
}
libavcodec/vp3.c:1861: error: Null Dereference
pointer `&gb->buffer` last assigned on line 1853 could be null and is dereferenced by call to `get_bits1()` at line 1861, column 20.
libavcodec/vp3.c:1843:1: start of procedure vp3_decode_frame()
1841. }
1842.
1843. static int vp3_decode_frame(AVCodecContext *avctx,
^
1844. void *data, int *data_size,
1845. AVPacket *avpkt)
libavcodec/vp3.c:1847:5:
1845. AVPacket *avpkt)
1846. {
1847. const uint8_t *buf = avpkt->data;
^
1848. int buf_size = avpkt->size;
1849. Vp3DecodeContext *s = avctx->priv_data;
libavcodec/vp3.c:1848:5:
1846. {
1847. const uint8_t *buf = avpkt->data;
1848. int buf_size = avpkt->size;
^
1849. Vp3DecodeContext *s = avctx->priv_data;
1850. GetBitContext gb;
libavcodec/vp3.c:1849:5:
1847. const uint8_t *buf = avpkt->data;
1848. int buf_size = avpkt->size;
1849. Vp3DecodeContext *s = avctx->priv_data;
^
1850. GetBitContext gb;
1851. int i;
libavcodec/vp3.c:1853:5:
1851. int i;
1852.
1853. init_get_bits(&gb, buf, buf_size * 8);
^
1854.
1855. if (s->theora && get_bits1(&gb))
libavcodec/get_bits.h:383:1: start of procedure init_get_bits()
381. * responsible for checking for the buffer end yourself (take advantage of the padding)!
382. */
383. static inline void init_get_bits(GetBitContext *s,
^
384. const uint8_t *buffer, int bit_size)
385. {
libavcodec/get_bits.h:386:5:
384. const uint8_t *buffer, int bit_size)
385. {
386. int buffer_size = (bit_size+7)>>3;
^
387. if (buffer_size < 0 || bit_size < 0) {
388. buffer_size = bit_size = 0;
libavcodec/get_bits.h:387:9: Taking true branch
385. {
386. int buffer_size = (bit_size+7)>>3;
387. if (buffer_size < 0 || bit_size < 0) {
^
388. buffer_size = bit_size = 0;
389. buffer = NULL;
libavcodec/get_bits.h:388:9:
386. int buffer_size = (bit_size+7)>>3;
387. if (buffer_size < 0 || bit_size < 0) {
388. buffer_size = bit_size = 0;
^
389. buffer = NULL;
390. }
libavcodec/get_bits.h:389:9:
387. if (buffer_size < 0 || bit_size < 0) {
388. buffer_size = bit_size = 0;
389. buffer = NULL;
^
390. }
391.
libavcodec/get_bits.h:392:5:
390. }
391.
392. s->buffer = buffer;
^
393. s->size_in_bits = bit_size;
394. s->buffer_end = buffer + buffer_size;
libavcodec/get_bits.h:393:5:
391.
392. s->buffer = buffer;
393. s->size_in_bits = bit_size;
^
394. s->buffer_end = buffer + buffer_size;
395. #ifdef ALT_BITSTREAM_READER
libavcodec/get_bits.h:394:5:
392. s->buffer = buffer;
393. s->size_in_bits = bit_size;
394. s->buffer_end = buffer + buffer_size;
^
395. #ifdef ALT_BITSTREAM_READER
396. s->index = 0;
libavcodec/get_bits.h:396:5:
394. s->buffer_end = buffer + buffer_size;
395. #ifdef ALT_BITSTREAM_READER
396. s->index = 0;
^
397. #elif defined A32_BITSTREAM_READER
398. s->buffer_ptr = (uint32_t*)((intptr_t)buffer & ~3);
libavcodec/get_bits.h:402:1: return from a call to init_get_bits
400. skip_bits_long(s, 0);
401. #endif
402. }
^
403.
404. static inline void align_get_bits(GetBitContext *s)
libavcodec/vp3.c:1855:9: Taking false branch
1853. init_get_bits(&gb, buf, buf_size * 8);
1854.
1855. if (s->theora && get_bits1(&gb))
^
1856. {
1857. av_log(avctx, AV_LOG_ERROR, "Header packet passed to frame decoder, skipping\n");
libavcodec/vp3.c:1861:20:
1859. }
1860.
1861. s->keyframe = !get_bits1(&gb);
^
1862. if (!s->theora)
1863. skip_bits(&gb, 1);
libavcodec/get_bits.h:303:1: start of procedure get_bits1()
301. }
302.
303. static inline unsigned int get_bits1(GetBitContext *s){
^
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
libavcodec/get_bits.h:305:5:
303. static inline unsigned int get_bits1(GetBitContext *s){
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
^
306. uint8_t result = s->buffer[index>>3];
307. #ifdef ALT_BITSTREAM_READER_LE
libavcodec/get_bits.h:306:5:
304. #ifdef ALT_BITSTREAM_READER
305. unsigned int index = s->index;
306. uint8_t result = s->buffer[index>>3];
^
307. #ifdef ALT_BITSTREAM_READER_LE
308. result >>= index & 7;
|
https://github.com/libav/libav/blob/f3a29b750a5979ae6847879fba758faf1fae88d0/libavcodec/vp3.c/#L1861
|
d2a_code_trace_data_45706
|
int test_div_word(BIO *bp)
{
BIGNUM *a, *b;
BN_ULONG r, s;
int i;
a = BN_new();
b = BN_new();
for (i = 0; i < num0; i++) {
do {
BN_bntest_rand(a, 512, -1, 0);
BN_bntest_rand(b, BN_BITS2, -1, 0);
} while (BN_is_zero(b));
s = b->d[0];
BN_copy(b, a);
r = BN_div_word(b, s);
if (bp != NULL) {
if (!results) {
BN_print(bp, a);
BIO_puts(bp, " / ");
print_word(bp, s);
BIO_puts(bp, " - ");
}
BN_print(bp, b);
BIO_puts(bp, "\n");
if (!results) {
BN_print(bp, a);
BIO_puts(bp, " % ");
print_word(bp, s);
BIO_puts(bp, " - ");
}
print_word(bp, r);
BIO_puts(bp, "\n");
}
BN_mul_word(b, s);
BN_add_word(b, r);
BN_sub(b, a, b);
if (!BN_is_zero(b)) {
fprintf(stderr, "Division (word) test failed!\n");
return 0;
}
}
BN_free(a);
BN_free(b);
return (1);
}
test/bntest.c:577: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 537, column 9 is not reachable after line 577, column 5.
Showing all 73 steps of the trace
test/bntest.c:530:1: start of procedure test_div_word()
528. }
529.
530. > int test_div_word(BIO *bp)
531. {
532. BIGNUM *a, *b;
test/bntest.c:536:5:
534. int i;
535.
536. > a = BN_new();
537. b = BN_new();
538.
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:537:5:
535.
536. a = BN_new();
537. > b = BN_new();
538.
539. for (i = 0; i < num0; i++) {
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:539:10:
537. b = BN_new();
538.
539. > for (i = 0; i < num0; i++) {
540. do {
541. BN_bntest_rand(a, 512, -1, 0);
test/bntest.c:539:17: Loop condition is false. Leaving loop
537. b = BN_new();
538.
539. for (i = 0; i < num0; i++) {
^
540. do {
541. BN_bntest_rand(a, 512, -1, 0);
test/bntest.c:576:5:
574. }
575. }
576. > BN_free(a);
577. BN_free(b);
578. return (1);
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
test/bntest.c:577:5:
575. }
576. BN_free(a);
577. > BN_free(b);
578. return (1);
579. }
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L577
|
d2a_code_trace_data_45707
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/rsa/rsa_crpt.c:106: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`.
Showing all 10 steps of the trace
crypto/rsa/rsa_crpt.c:90:5: Call
88. return NULL;
89.
90. BN_CTX_start(ctx);
^
91. r0 = BN_CTX_get(ctx);
92. r1 = 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/rsa/rsa_crpt.c:106:5: Call
104. ret = BN_mod_inverse(NULL, d, r0, ctx);
105. err:
106. BN_CTX_end(ctx);
^
107. return ret;
108. }
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_45708
|
static int cinepak_decode (CinepakContext *s)
{
const uint8_t *eod = (s->data + s->size);
int i, result, strip_size, frame_flags, num_strips;
int y0 = 0;
int encoded_buf_size;
if (s->size < 10)
return -1;
frame_flags = s->data[0];
num_strips = AV_RB16 (&s->data[8]);
encoded_buf_size = ((s->data[1] << 16) | AV_RB16 (&s->data[2]));
if (s->sega_film_skip_bytes == -1) {
if (encoded_buf_size != s->size) {
if ((s->data[10] == 0xFE) &&
(s->data[11] == 0x00) &&
(s->data[12] == 0x00) &&
(s->data[13] == 0x06) &&
(s->data[14] == 0x00) &&
(s->data[15] == 0x00))
s->sega_film_skip_bytes = 6;
else
s->sega_film_skip_bytes = 2;
} else
s->sega_film_skip_bytes = 0;
}
s->data += 10 + s->sega_film_skip_bytes;
if (num_strips > MAX_STRIPS)
num_strips = MAX_STRIPS;
for (i=0; i < num_strips; i++) {
if ((s->data + 12) > eod)
return -1;
s->strips[i].id = AV_RB16 (s->data);
s->strips[i].y1 = y0;
s->strips[i].x1 = 0;
s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]);
s->strips[i].x2 = s->avctx->width;
strip_size = AV_RB16 (&s->data[2]) - 12;
s->data += 12;
strip_size = ((s->data + strip_size) > eod) ? (eod - s->data) : strip_size;
if ((i > 0) && !(frame_flags & 0x01)) {
memcpy (s->strips[i].v4_codebook, s->strips[i-1].v4_codebook,
sizeof(s->strips[i].v4_codebook));
memcpy (s->strips[i].v1_codebook, s->strips[i-1].v1_codebook,
sizeof(s->strips[i].v1_codebook));
}
result = cinepak_decode_strip (s, &s->strips[i], s->data, strip_size);
if (result != 0)
return result;
s->data += strip_size;
y0 = s->strips[i].y2;
}
return 0;
}
libavcodec/cinepak.c:371: error: Buffer Overrun L3
Offset added: 1536 Size: [0, +oo].
libavcodec/cinepak.c:316:1: <Length trace>
314. }
315.
316. static int cinepak_decode (CinepakContext *s)
^
317. {
318. const uint8_t *eod = (s->data + s->size);
libavcodec/cinepak.c:316:1: Parameter `s->strips[*].v4_codebook[*]`
314. }
315.
316. static int cinepak_decode (CinepakContext *s)
^
317. {
318. const uint8_t *eod = (s->data + s->size);
libavcodec/cinepak.c:371:13: Array access: Offset added: 1536 Size: [0, +oo]
369.
370. if ((i > 0) && !(frame_flags & 0x01)) {
371. memcpy (s->strips[i].v4_codebook, s->strips[i-1].v4_codebook,
^
372. sizeof(s->strips[i].v4_codebook));
373. memcpy (s->strips[i].v1_codebook, s->strips[i-1].v1_codebook,
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/cinepak.c/#L371
|
d2a_code_trace_data_45709
|
int test_gf2m_add(BIO *bp)
{
BIGNUM *a, *b, *c;
int i, ret = 0;
a = BN_new();
b = BN_new();
c = BN_new();
for (i = 0; i < num0; i++) {
BN_rand(a, 512, 0, 0);
BN_copy(b, BN_value_one());
a->neg = rand_neg();
b->neg = rand_neg();
BN_GF2m_add(c, a, b);
if ((BN_is_odd(a) && BN_is_odd(c))
|| (!BN_is_odd(a) && !BN_is_odd(c))) {
fprintf(stderr, "GF(2^m) addition test (a) failed!\n");
goto err;
}
BN_GF2m_add(c, c, c);
if (!BN_is_zero(c)) {
fprintf(stderr, "GF(2^m) addition test (b) failed!\n");
goto err;
}
}
ret = 1;
err:
BN_free(a);
BN_free(b);
BN_free(c);
return ret;
}
test/bntest.c:1264: error: MEMORY_LEAK
memory dynamically allocated by call to `BN_new()` at line 1239, column 9 is not reachable after line 1264, column 5.
Showing all 98 steps of the trace
test/bntest.c:1233:1: start of procedure test_gf2m_add()
1231.
1232. #ifndef OPENSSL_NO_EC2M
1233. > int test_gf2m_add(BIO *bp)
1234. {
1235. BIGNUM *a, *b, *c;
test/bntest.c:1236:5:
1234. {
1235. BIGNUM *a, *b, *c;
1236. > int i, ret = 0;
1237.
1238. a = BN_new();
test/bntest.c:1238:5:
1236. int i, ret = 0;
1237.
1238. > a = BN_new();
1239. b = BN_new();
1240. 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:1239:5:
1237.
1238. a = BN_new();
1239. > b = BN_new();
1240. c = BN_new();
1241.
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:1240:5:
1238. a = BN_new();
1239. b = BN_new();
1240. > c = BN_new();
1241.
1242. for (i = 0; i < num0; i++) {
crypto/bn/bn_lib.c:277:1: start of procedure BN_new()
275. }
276.
277. > BIGNUM *BN_new(void)
278. {
279. BIGNUM *ret;
crypto/bn/bn_lib.c:281:9:
279. BIGNUM *ret;
280.
281. > if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
155. }
156.
157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:159:5:
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
158. {
159. > void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
118. }
119.
120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. void *ret = NULL;
crypto/mem.c:122:5:
120. void *CRYPTO_malloc(size_t num, const char *file, int line)
121. {
122. > void *ret = NULL;
123.
124. if (num <= 0)
crypto/mem.c:124:9: Taking false branch
122. void *ret = NULL;
123.
124. if (num <= 0)
^
125. return NULL;
126.
crypto/mem.c:127:5:
125. return NULL;
126.
127. > allow_customize = 0;
128. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
129. if (call_malloc_debug) {
crypto/mem.c:137:5:
135. }
136. #else
137. > (void)file;
138. (void)line;
139. ret = malloc(num);
crypto/mem.c:138:5:
136. #else
137. (void)file;
138. > (void)line;
139. ret = malloc(num);
140. #endif
crypto/mem.c:139:5:
137. (void)file;
138. (void)line;
139. > ret = malloc(num);
140. #endif
141.
crypto/mem.c:154:5:
152. #endif
153.
154. > return ret;
155. }
156.
crypto/mem.c:155:1: return from a call to CRYPTO_malloc
153.
154. return ret;
155. > }
156.
157. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:161:9: Taking true branch
159. void *ret = CRYPTO_malloc(num, file, line);
160.
161. if (ret != NULL)
^
162. memset(ret, 0, num);
163. return ret;
crypto/mem.c:162:9:
160.
161. if (ret != NULL)
162. > memset(ret, 0, num);
163. return ret;
164. }
crypto/mem.c:163:5:
161. if (ret != NULL)
162. memset(ret, 0, num);
163. > return ret;
164. }
165.
crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
162. memset(ret, 0, num);
163. return ret;
164. > }
165.
166. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/bn/bn_lib.c:281:9: Taking false branch
279. BIGNUM *ret;
280.
281. if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
^
282. BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);
283. return (NULL);
crypto/bn/bn_lib.c:285:5:
283. return (NULL);
284. }
285. > ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. return (ret);
crypto/bn/bn_lib.c:287:5:
285. ret->flags = BN_FLG_MALLOCED;
286. bn_check_top(ret);
287. > return (ret);
288. }
289.
crypto/bn/bn_lib.c:288:1: return from a call to BN_new
286. bn_check_top(ret);
287. return (ret);
288. > }
289.
290. BIGNUM *BN_secure_new(void)
test/bntest.c:1242:10:
1240. c = BN_new();
1241.
1242. > for (i = 0; i < num0; i++) {
1243. BN_rand(a, 512, 0, 0);
1244. BN_copy(b, BN_value_one());
test/bntest.c:1242:17: Loop condition is false. Leaving loop
1240. c = BN_new();
1241.
1242. for (i = 0; i < num0; i++) {
^
1243. BN_rand(a, 512, 0, 0);
1244. BN_copy(b, BN_value_one());
test/bntest.c:1261:5:
1259. }
1260. }
1261. > ret = 1;
1262. err:
1263. BN_free(a);
test/bntest.c:1262:2:
1260. }
1261. ret = 1;
1262. > err:
1263. BN_free(a);
1264. BN_free(b);
test/bntest.c:1263:5:
1261. ret = 1;
1262. err:
1263. > BN_free(a);
1264. BN_free(b);
1265. BN_free(c);
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
test/bntest.c:1264:5:
1262. err:
1263. BN_free(a);
1264. > BN_free(b);
1265. BN_free(c);
1266. return ret;
crypto/bn/bn_lib.c:252:1: start of procedure BN_free()
250. }
251.
252. > void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
crypto/bn/bn_lib.c:254:9: Taking false branch
252. void BN_free(BIGNUM *a)
253. {
254. if (a == NULL)
^
255. return;
256. bn_check_top(a);
crypto/bn/bn_lib.c:257:10:
255. return;
256. bn_check_top(a);
257. > if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:965:1: start of procedure BN_get_flags()
963. }
964.
965. > int BN_get_flags(const BIGNUM *b, int n)
966. {
967. return b->flags & n;
crypto/bn/bn_lib.c:967:5:
965. int BN_get_flags(const BIGNUM *b, int n)
966. {
967. > return b->flags & n;
968. }
969.
crypto/bn/bn_lib.c:968:1: return from a call to BN_get_flags
966. {
967. return b->flags & n;
968. > }
969.
970. /* Populate a BN_GENCB structure with an "old"-style callback */
crypto/bn/bn_lib.c:257:10: Taking false branch
255. return;
256. bn_check_top(a);
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
^
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
crypto/bn/bn_lib.c:259:9: Taking false branch
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. if (a->flags & BN_FLG_MALLOCED)
^
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:263:9:
261. else {
262. #if OPENSSL_API_COMPAT < 0x00908000L
263. > a->flags |= BN_FLG_FREE;
264. #endif
265. a->d = NULL;
crypto/bn/bn_lib.c:265:9:
263. a->flags |= BN_FLG_FREE;
264. #endif
265. > a->d = NULL;
266. }
267. }
crypto/bn/bn_lib.c:259:5:
257. if (!BN_get_flags(a, BN_FLG_STATIC_DATA))
258. bn_free_d(a);
259. > if (a->flags & BN_FLG_MALLOCED)
260. OPENSSL_free(a);
261. else {
crypto/bn/bn_lib.c:267:1: return from a call to BN_free
265. a->d = NULL;
266. }
267. > }
268.
269. void bn_init(BIGNUM *a)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/bntest.c/#L1264
|
d2a_code_trace_data_45710
|
static int tree_add_unmatched(X509_POLICY_LEVEL *curr,
const X509_POLICY_CACHE *cache,
const ASN1_OBJECT *id,
X509_POLICY_NODE *node, X509_POLICY_TREE *tree)
{
X509_POLICY_DATA *data;
if (id == NULL)
id = node->data->valid_policy;
if ((data = policy_data_new(NULL, id, node_critical(node))) == NULL)
return 0;
data->qualifier_set = cache->anyPolicy->qualifier_set;
data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS;
if (level_add_node(curr, data, node, tree) == NULL) {
policy_data_free(data);
return 0;
}
return 1;
}
crypto/x509v3/pcy_tree.c:364: error: MEMORY_LEAK
memory dynamically allocated to `return` by call to `policy_data_new()` at line 354, column 17 is not reachable after line 364, column 5.
Showing all 85 steps of the trace
crypto/x509v3/pcy_tree.c:341:1: start of procedure tree_add_unmatched()
339. * Return value: 1 on success, 0 otherwise.
340. */
341. > static int tree_add_unmatched(X509_POLICY_LEVEL *curr,
342. const X509_POLICY_CACHE *cache,
343. const ASN1_OBJECT *id,
crypto/x509v3/pcy_tree.c:348:9: Taking true branch
346. X509_POLICY_DATA *data;
347.
348. if (id == NULL)
^
349. id = node->data->valid_policy;
350. /*
crypto/x509v3/pcy_tree.c:349:9:
347.
348. if (id == NULL)
349. > id = node->data->valid_policy;
350. /*
351. * Create a new node with qualifiers from anyPolicy and id from unmatched
crypto/x509v3/pcy_tree.c:354:9:
352. * node.
353. */
354. > if ((data = policy_data_new(NULL, id, node_critical(node))) == NULL)
355. return 0;
356.
crypto/x509v3/pcy_data.c:87:1: start of procedure policy_data_new()
85. */
86.
87. > X509_POLICY_DATA *policy_data_new(POLICYINFO *policy,
88. const ASN1_OBJECT *cid, int crit)
89. {
crypto/x509v3/pcy_data.c:92:10: Taking true branch
90. X509_POLICY_DATA *ret;
91. ASN1_OBJECT *id;
92. if (!policy && !cid)
^
93. return NULL;
94. if (cid) {
crypto/x509v3/pcy_data.c:92:21: Taking false branch
90. X509_POLICY_DATA *ret;
91. ASN1_OBJECT *id;
92. if (!policy && !cid)
^
93. return NULL;
94. if (cid) {
crypto/x509v3/pcy_data.c:94:9: Taking true branch
92. if (!policy && !cid)
93. return NULL;
94. if (cid) {
^
95. id = OBJ_dup(cid);
96. if (!id)
crypto/x509v3/pcy_data.c:95:9: Skipping OBJ_dup(): empty list of specs
93. return NULL;
94. if (cid) {
95. id = OBJ_dup(cid);
^
96. if (!id)
97. return NULL;
crypto/x509v3/pcy_data.c:96:14: Taking false branch
94. if (cid) {
95. id = OBJ_dup(cid);
96. if (!id)
^
97. return NULL;
98. } else
crypto/x509v3/pcy_data.c:100:5:
98. } else
99. id = NULL;
100. > ret = OPENSSL_zalloc(sizeof(*ret));
101. if (ret == NULL)
102. return NULL;
crypto/mem.c:156:1: start of procedure CRYPTO_zalloc()
154. }
155.
156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
157. {
158. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:158:5:
156. void *CRYPTO_zalloc(size_t num, const char *file, int line)
157. {
158. > void *ret = CRYPTO_malloc(num, file, line);
159.
160. if (ret != NULL)
crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
117. }
118.
119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
120. {
121. void *ret = NULL;
crypto/mem.c:121:5:
119. void *CRYPTO_malloc(size_t num, const char *file, int line)
120. {
121. > void *ret = NULL;
122.
123. if (num <= 0)
crypto/mem.c:123:9: Taking false branch
121. void *ret = NULL;
122.
123. if (num <= 0)
^
124. return NULL;
125.
crypto/mem.c:126:5:
124. return NULL;
125.
126. > allow_customize = 0;
127. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
128. if (call_malloc_debug) {
crypto/mem.c:136:5:
134. }
135. #else
136. > (void)file;
137. (void)line;
138. ret = malloc(num);
crypto/mem.c:137:5:
135. #else
136. (void)file;
137. > (void)line;
138. ret = malloc(num);
139. #endif
crypto/mem.c:138:5:
136. (void)file;
137. (void)line;
138. > ret = malloc(num);
139. #endif
140.
crypto/mem.c:153:5:
151. #endif
152.
153. > return ret;
154. }
155.
crypto/mem.c:154:1: return from a call to CRYPTO_malloc
152.
153. return ret;
154. > }
155.
156. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:160:9: Taking true branch
158. void *ret = CRYPTO_malloc(num, file, line);
159.
160. if (ret != NULL)
^
161. memset(ret, 0, num);
162. return ret;
crypto/mem.c:161:9:
159.
160. if (ret != NULL)
161. > memset(ret, 0, num);
162. return ret;
163. }
crypto/mem.c:162:5:
160. if (ret != NULL)
161. memset(ret, 0, num);
162. > return ret;
163. }
164.
crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
161. memset(ret, 0, num);
162. return ret;
163. > }
164.
165. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/x509v3/pcy_data.c:101:9: Taking false branch
99. id = NULL;
100. ret = OPENSSL_zalloc(sizeof(*ret));
101. if (ret == NULL)
^
102. return NULL;
103. ret->expected_policy_set = sk_ASN1_OBJECT_new_null();
crypto/x509v3/pcy_data.c:103:5:
101. if (ret == NULL)
102. return NULL;
103. > ret->expected_policy_set = sk_ASN1_OBJECT_new_null();
104. if (ret->expected_policy_set == NULL) {
105. OPENSSL_free(ret);
include/openssl/asn1.h:568:1: start of procedure sk_ASN1_OBJECT_new_null()
566. DECLARE_ASN1_ITEM(ASN1_OBJECT)
567.
568. > DEFINE_STACK_OF(ASN1_OBJECT)
569.
570. ASN1_STRING *ASN1_STRING_new(void);
crypto/stack/stack.c:144:1: start of procedure sk_new_null()
142. }
143.
144. > _STACK *sk_new_null(void)
145. {
146. return sk_new((int (*)(const void *, const void *))0);
crypto/stack/stack.c:146:5:
144. _STACK *sk_new_null(void)
145. {
146. > return sk_new((int (*)(const void *, const void *))0);
147. }
148.
crypto/stack/stack.c:149:1: start of procedure sk_new()
147. }
148.
149. > _STACK *sk_new(int (*c) (const void *, const void *))
150. {
151. _STACK *ret;
crypto/stack/stack.c:153:9:
151. _STACK *ret;
152.
153. > if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
154. goto err;
155. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
crypto/mem.c:156:1: start of procedure CRYPTO_zalloc()
154. }
155.
156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
157. {
158. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:158:5:
156. void *CRYPTO_zalloc(size_t num, const char *file, int line)
157. {
158. > void *ret = CRYPTO_malloc(num, file, line);
159.
160. if (ret != NULL)
crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
117. }
118.
119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
120. {
121. void *ret = NULL;
crypto/mem.c:121:5:
119. void *CRYPTO_malloc(size_t num, const char *file, int line)
120. {
121. > void *ret = NULL;
122.
123. if (num <= 0)
crypto/mem.c:123:9: Taking false branch
121. void *ret = NULL;
122.
123. if (num <= 0)
^
124. return NULL;
125.
crypto/mem.c:126:5:
124. return NULL;
125.
126. > allow_customize = 0;
127. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
128. if (call_malloc_debug) {
crypto/mem.c:136:5:
134. }
135. #else
136. > (void)file;
137. (void)line;
138. ret = malloc(num);
crypto/mem.c:137:5:
135. #else
136. (void)file;
137. > (void)line;
138. ret = malloc(num);
139. #endif
crypto/mem.c:138:5:
136. (void)file;
137. (void)line;
138. > ret = malloc(num);
139. #endif
140.
crypto/mem.c:153:5:
151. #endif
152.
153. > return ret;
154. }
155.
crypto/mem.c:154:1: return from a call to CRYPTO_malloc
152.
153. return ret;
154. > }
155.
156. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:160:9: Taking true branch
158. void *ret = CRYPTO_malloc(num, file, line);
159.
160. if (ret != NULL)
^
161. memset(ret, 0, num);
162. return ret;
crypto/mem.c:161:9:
159.
160. if (ret != NULL)
161. > memset(ret, 0, num);
162. return ret;
163. }
crypto/mem.c:162:5:
160. if (ret != NULL)
161. memset(ret, 0, num);
162. > return ret;
163. }
164.
crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
161. memset(ret, 0, num);
162. return ret;
163. > }
164.
165. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/stack/stack.c:153:9: Taking false branch
151. _STACK *ret;
152.
153. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
^
154. goto err;
155. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
crypto/stack/stack.c:155:9:
153. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
154. goto err;
155. > if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
156. goto err;
157. ret->comp = c;
crypto/mem.c:156:1: start of procedure CRYPTO_zalloc()
154. }
155.
156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
157. {
158. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:158:5:
156. void *CRYPTO_zalloc(size_t num, const char *file, int line)
157. {
158. > void *ret = CRYPTO_malloc(num, file, line);
159.
160. if (ret != NULL)
crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
117. }
118.
119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
120. {
121. void *ret = NULL;
crypto/mem.c:121:5:
119. void *CRYPTO_malloc(size_t num, const char *file, int line)
120. {
121. > void *ret = NULL;
122.
123. if (num <= 0)
crypto/mem.c:123:9: Taking false branch
121. void *ret = NULL;
122.
123. if (num <= 0)
^
124. return NULL;
125.
crypto/mem.c:126:5:
124. return NULL;
125.
126. > allow_customize = 0;
127. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
128. if (call_malloc_debug) {
crypto/mem.c:136:5:
134. }
135. #else
136. > (void)file;
137. (void)line;
138. ret = malloc(num);
crypto/mem.c:137:5:
135. #else
136. (void)file;
137. > (void)line;
138. ret = malloc(num);
139. #endif
crypto/mem.c:138:5:
136. (void)file;
137. (void)line;
138. > ret = malloc(num);
139. #endif
140.
crypto/mem.c:153:5:
151. #endif
152.
153. > return ret;
154. }
155.
crypto/mem.c:154:1: return from a call to CRYPTO_malloc
152.
153. return ret;
154. > }
155.
156. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:160:9: Taking true branch
158. void *ret = CRYPTO_malloc(num, file, line);
159.
160. if (ret != NULL)
^
161. memset(ret, 0, num);
162. return ret;
crypto/mem.c:161:9:
159.
160. if (ret != NULL)
161. > memset(ret, 0, num);
162. return ret;
163. }
crypto/mem.c:162:5:
160. if (ret != NULL)
161. memset(ret, 0, num);
162. > return ret;
163. }
164.
crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
161. memset(ret, 0, num);
162. return ret;
163. > }
164.
165. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
crypto/stack/stack.c:155:9: Taking false branch
153. if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
154. goto err;
155. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
^
156. goto err;
157. ret->comp = c;
crypto/stack/stack.c:157:5:
155. if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
156. goto err;
157. > ret->comp = c;
158. ret->num_alloc = MIN_NODES;
159. return (ret);
crypto/stack/stack.c:158:5:
156. goto err;
157. ret->comp = c;
158. > ret->num_alloc = MIN_NODES;
159. return (ret);
160.
crypto/stack/stack.c:159:5:
157. ret->comp = c;
158. ret->num_alloc = MIN_NODES;
159. > return (ret);
160.
161. err:
crypto/stack/stack.c:164:1: return from a call to sk_new
162. OPENSSL_free(ret);
163. return (NULL);
164. > }
165.
166. int sk_insert(_STACK *st, void *data, int loc)
crypto/stack/stack.c:147:1: return from a call to sk_new_null
145. {
146. return sk_new((int (*)(const void *, const void *))0);
147. > }
148.
149. _STACK *sk_new(int (*c) (const void *, const void *))
include/openssl/asn1.h:568:1: return from a call to sk_ASN1_OBJECT_new_null
566. DECLARE_ASN1_ITEM(ASN1_OBJECT)
567.
568. > DEFINE_STACK_OF(ASN1_OBJECT)
569.
570. ASN1_STRING *ASN1_STRING_new(void);
crypto/x509v3/pcy_data.c:104:9: Taking false branch
102. return NULL;
103. ret->expected_policy_set = sk_ASN1_OBJECT_new_null();
104. if (ret->expected_policy_set == NULL) {
^
105. OPENSSL_free(ret);
106. ASN1_OBJECT_free(id);
crypto/x509v3/pcy_data.c:110:9: Taking true branch
108. }
109.
110. if (crit)
^
111. ret->flags = POLICY_DATA_FLAG_CRITICAL;
112.
crypto/x509v3/pcy_data.c:111:9:
109.
110. if (crit)
111. > ret->flags = POLICY_DATA_FLAG_CRITICAL;
112.
113. if (id)
crypto/x509v3/pcy_data.c:113:9: Taking true branch
111. ret->flags = POLICY_DATA_FLAG_CRITICAL;
112.
113. if (id)
^
114. ret->valid_policy = id;
115. else {
crypto/x509v3/pcy_data.c:114:9:
112.
113. if (id)
114. > ret->valid_policy = id;
115. else {
116. ret->valid_policy = policy->policyid;
crypto/x509v3/pcy_data.c:120:9: Taking false branch
118. }
119.
120. if (policy) {
^
121. ret->qualifier_set = policy->qualifiers;
122. policy->qualifiers = NULL;
crypto/x509v3/pcy_data.c:125:5:
123. }
124.
125. > return ret;
126. }
crypto/x509v3/pcy_data.c:126:1: return from a call to policy_data_new
124.
125. return ret;
126. > }
crypto/x509v3/pcy_tree.c:354:9: Taking false branch
352. * node.
353. */
354. if ((data = policy_data_new(NULL, id, node_critical(node))) == NULL)
^
355. return 0;
356.
crypto/x509v3/pcy_tree.c:358:5:
356.
357. /* Curr may not have anyPolicy */
358. > data->qualifier_set = cache->anyPolicy->qualifier_set;
359. data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS;
360. if (level_add_node(curr, data, node, tree) == NULL) {
crypto/x509v3/pcy_tree.c:359:5:
357. /* Curr may not have anyPolicy */
358. data->qualifier_set = cache->anyPolicy->qualifier_set;
359. > data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS;
360. if (level_add_node(curr, data, node, tree) == NULL) {
361. policy_data_free(data);
crypto/x509v3/pcy_tree.c:360:9: Taking false branch
358. data->qualifier_set = cache->anyPolicy->qualifier_set;
359. data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS;
360. if (level_add_node(curr, data, node, tree) == NULL) {
^
361. policy_data_free(data);
362. return 0;
crypto/x509v3/pcy_tree.c:364:5:
362. return 0;
363. }
364. > return 1;
365. }
366.
|
https://github.com/openssl/openssl/blob/895c2f84a6a083fc8b9f69f962ed19da12ce3b40/crypto/x509v3/pcy_tree.c/#L364
|
d2a_code_trace_data_45711
|
static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
uint8_t **data, int *size)
{
static const int extradata_nal_types_hevc[] = {
HEVC_NAL_VPS, HEVC_NAL_SPS, HEVC_NAL_PPS,
};
static const int extradata_nal_types_h264[] = {
H264_NAL_SPS, H264_NAL_PPS,
};
ExtractExtradataContext *s = ctx->priv_data;
H2645Packet h2645_pkt = { 0 };
int extradata_size = 0;
const int *extradata_nal_types;
int nb_extradata_nal_types;
int i, has_sps = 0, has_vps = 0, ret = 0;
if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) {
extradata_nal_types = extradata_nal_types_hevc;
nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_hevc);
} else {
extradata_nal_types = extradata_nal_types_h264;
nb_extradata_nal_types = FF_ARRAY_ELEMS(extradata_nal_types_h264);
}
ret = ff_h2645_packet_split(&h2645_pkt, pkt->data, pkt->size,
ctx, 0, 0, ctx->par_in->codec_id);
if (ret < 0)
return ret;
for (i = 0; i < h2645_pkt.nb_nals; i++) {
H2645NAL *nal = &h2645_pkt.nals[i];
if (val_in_array(extradata_nal_types, nb_extradata_nal_types, nal->type)) {
extradata_size += nal->raw_size + 3;
if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) {
if (nal->type == HEVC_NAL_SPS) has_sps = 1;
if (nal->type == HEVC_NAL_VPS) has_vps = 1;
} else {
if (nal->type == H264_NAL_SPS) has_sps = 1;
}
}
}
if (extradata_size &&
((ctx->par_in->codec_id == AV_CODEC_ID_HEVC && has_sps && has_vps) ||
(ctx->par_in->codec_id == AV_CODEC_ID_H264 && has_sps))) {
AVBufferRef *filtered_buf;
uint8_t *extradata, *filtered_data;
if (s->remove) {
filtered_buf = av_buffer_alloc(pkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!filtered_buf)
goto fail;
filtered_data = filtered_buf->data;
}
extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!extradata) {
av_buffer_unref(&filtered_buf);
goto fail;
}
*data = extradata;
*size = extradata_size;
for (i = 0; i < h2645_pkt.nb_nals; i++) {
H2645NAL *nal = &h2645_pkt.nals[i];
if (val_in_array(extradata_nal_types, nb_extradata_nal_types,
nal->type)) {
AV_WB24(extradata, 1);
memcpy(extradata + 3, nal->raw_data, nal->raw_size);
extradata += 3 + nal->raw_size;
} else if (s->remove) {
AV_WB24(filtered_data, 1);
memcpy(filtered_data + 3, nal->raw_data, nal->raw_size);
filtered_data += 3 + nal->raw_size;
}
}
if (s->remove) {
av_buffer_unref(&pkt->buf);
pkt->buf = filtered_buf;
pkt->data = filtered_buf->data;
pkt->size = filtered_data - filtered_buf->data;
}
}
fail:
ff_h2645_packet_uninit(&h2645_pkt);
return ret;
}
libavcodec/extract_extradata_bsf.c:86: error: Integer Overflow L2
([8, 2147483648] + 3):signed32.
libavcodec/extract_extradata_bsf.c:78:11: <LHS trace>
76. }
77.
78. ret = ff_h2645_packet_split(&h2645_pkt, pkt->data, pkt->size,
^
79. ctx, 0, 0, ctx->par_in->codec_id);
80. if (ret < 0)
libavcodec/extract_extradata_bsf.c:78:11: Call
76. }
77.
78. ret = ff_h2645_packet_split(&h2645_pkt, pkt->data, pkt->size,
^
79. ctx, 0, 0, ctx->par_in->codec_id);
80. if (ret < 0)
libavcodec/h2645_parse.c:303:15: Call
301. nal->size_bits = get_bit_length(nal, skip_trailing_zeros);
302.
303. ret = init_get_bits(&nal->gb, nal->data, nal->size_bits);
^
304. if (ret < 0)
305. return ret;
libavcodec/get_bits.h:362:1: Parameter `bit_size`
360. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
361. */
362. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
^
363. int bit_size)
364. {
libavcodec/get_bits.h:379:5: Assignment
377. s->size_in_bits = bit_size;
378. #if !UNCHECKED_BITSTREAM_READER
379. s->size_in_bits_plus8 = bit_size + 8;
^
380. #endif
381. s->buffer_end = buffer + buffer_size;
libavcodec/extract_extradata_bsf.c:86:13: Binary operation: ([8, 2147483648] + 3):signed32
84. H2645NAL *nal = &h2645_pkt.nals[i];
85. if (val_in_array(extradata_nal_types, nb_extradata_nal_types, nal->type)) {
86. extradata_size += nal->raw_size + 3;
^
87. if (ctx->par_in->codec_id == AV_CODEC_ID_HEVC) {
88. if (nal->type == HEVC_NAL_SPS) has_sps = 1;
|
https://github.com/libav/libav/blob/8652a2c24836ce5546b398f12b7fed45000050e1/libavcodec/extract_extradata_bsf.c/#L86
|
d2a_code_trace_data_45712
|
int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
{
return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
}
crypto/bn/bn_gf2m.c:992: error: BUFFER_OVERRUN_L3
Offset: 0 Size: [0, 8388607] by call to `BN_GF2m_mod_exp_arr`.
Showing all 11 steps of the trace
crypto/bn/bn_gf2m.c:987:14: Call
985.
986. BN_CTX_start(ctx);
987. if ((u = BN_CTX_get(ctx)) == NULL)
^
988. goto err;
989.
crypto/bn/bn_ctx.c:229:5: Call
227. }
228. /* OK, make sure the returned bignum is "zero" */
229. BN_zero(ret);
^
230. ctx->used++;
231. CTXDBG_RET(ctx, ret);
crypto/bn/bn_lib.c:395:1: Parameter `*a->d`
393. }
394.
395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
396. {
397. bn_check_top(a);
crypto/bn/bn_lib.c:398:9: Call
396. {
397. bn_check_top(a);
398. if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
^
399. return (0);
400. a->neg = 0;
crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
658. const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
659.
660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
661. {
662. if (bits > (INT_MAX - BN_BITS2 + 1))
crypto/bn/bn_gf2m.c:992:11: Call
990. if (!BN_set_bit(u, p[0] - 1))
991. goto err;
992. ret = BN_GF2m_mod_exp_arr(r, a, u, p, ctx);
^
993. bn_check_top(r);
994.
crypto/bn/bn_gf2m.c:899:1: Parameter `*b->d`
897. * P1363.
898. */
899. > int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
900. const int p[], BN_CTX *ctx)
901. {
crypto/bn/bn_gf2m.c:911:9: Call
909. return (BN_one(r));
910.
911. if (BN_abs_is_word(b, 1))
^
912. return (BN_copy(r, a) != NULL);
913.
crypto/bn/bn_lib.c:847:1: <Length trace>
845. }
846.
847. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
848. {
849. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
crypto/bn/bn_lib.c:847:1: Parameter `*a->d`
845. }
846.
847. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
848. {
849. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
crypto/bn/bn_lib.c:849:31: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_GF2m_mod_exp_arr`
847. int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
848. {
849. return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));
^
850. }
851.
|
https://github.com/openssl/openssl/blob/05eec39505ba8af6f3c1558a26c565987707cd37/crypto/bn/bn_lib.c/#L849
|
d2a_code_trace_data_45713
|
int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, EVP_KEYEXCH *exchange)
{
int ret;
void *provkey = NULL;
ctx->operation = EVP_PKEY_OP_DERIVE;
if (ctx->engine != NULL)
goto legacy;
if (exchange != NULL) {
if (!EVP_KEYEXCH_up_ref(exchange))
goto err;
} else {
int nid = ctx->pkey != NULL ? ctx->pkey->type : ctx->pmeth->pkey_id;
if (ctx->pkey != NULL) {
switch (ctx->pkey->type) {
case EVP_PKEY_DH:
break;
default:
goto legacy;
}
exchange = EVP_KEYEXCH_fetch(NULL, OBJ_nid2sn(nid), NULL);
} else {
goto legacy;
}
if (exchange == NULL) {
EVPerr(EVP_F_EVP_PKEY_DERIVE_INIT_EX, EVP_R_INITIALIZATION_ERROR);
goto err;
}
}
if (ctx->exchprovctx != NULL && ctx->exchange != NULL)
ctx->exchange->freectx(ctx->exchprovctx);
EVP_KEYEXCH_free(ctx->exchange);
ctx->exchange = exchange;
if (ctx->pkey != NULL) {
provkey = evp_keymgmt_export_to_provider(ctx->pkey, exchange->keymgmt);
if (provkey == NULL) {
EVPerr(EVP_F_EVP_PKEY_DERIVE_INIT_EX, EVP_R_INITIALIZATION_ERROR);
goto err;
}
}
ctx->exchprovctx = exchange->newctx(ossl_provider_ctx(exchange->prov));
if (ctx->exchprovctx == NULL) {
EVPerr(EVP_F_EVP_PKEY_DERIVE_INIT_EX, EVP_R_INITIALIZATION_ERROR);
goto err;
}
ret = exchange->init(ctx->exchprovctx, provkey);
return ret ? 1 : 0;
err:
ctx->operation = EVP_PKEY_OP_UNDEFINED;
return 0;
legacy:
if (ctx == NULL || ctx->pmeth == NULL || ctx->pmeth->derive == NULL) {
EVPerr(EVP_F_EVP_PKEY_DERIVE_INIT_EX,
EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
return -2;
}
if (ctx->pmeth->derive_init == NULL)
return 1;
ret = ctx->pmeth->derive_init(ctx);
if (ret <= 0)
ctx->operation = EVP_PKEY_OP_UNDEFINED;
return ret;
}
crypto/evp/exchange.c:194: error: NULL_DEREFERENCE
pointer `null` is dereferenced by call to `EVP_KEYEXCH_fetch()` at line 194, column 24.
Showing all 18 steps of the trace
crypto/evp/exchange.c:167:1: start of procedure EVP_PKEY_derive_init_ex()
165. }
166.
167. > int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, EVP_KEYEXCH *exchange)
168. {
169. int ret;
crypto/evp/exchange.c:170:5:
168. {
169. int ret;
170. > void *provkey = NULL;
171.
172. ctx->operation = EVP_PKEY_OP_DERIVE;
crypto/evp/exchange.c:172:5:
170. void *provkey = NULL;
171.
172. > ctx->operation = EVP_PKEY_OP_DERIVE;
173.
174. if (ctx->engine != NULL)
crypto/evp/exchange.c:174:9: Taking false branch
172. ctx->operation = EVP_PKEY_OP_DERIVE;
173.
174. if (ctx->engine != NULL)
^
175. goto legacy;
176.
crypto/evp/exchange.c:177:9: Taking false branch
175. goto legacy;
176.
177. if (exchange != NULL) {
^
178. if (!EVP_KEYEXCH_up_ref(exchange))
179. goto err;
crypto/evp/exchange.c:181:19: Condition is true
179. goto err;
180. } else {
181. int nid = ctx->pkey != NULL ? ctx->pkey->type : ctx->pmeth->pkey_id;
^
182.
183. /*
crypto/evp/exchange.c:181:9:
179. goto err;
180. } else {
181. > int nid = ctx->pkey != NULL ? ctx->pkey->type : ctx->pmeth->pkey_id;
182.
183. /*
crypto/evp/exchange.c:187:13: Taking true branch
185. * algorithms are moved to providers.
186. */
187. if (ctx->pkey != NULL) {
^
188. switch (ctx->pkey->type) {
189. case EVP_PKEY_DH:
crypto/evp/exchange.c:188:13:
186. */
187. if (ctx->pkey != NULL) {
188. > switch (ctx->pkey->type) {
189. case EVP_PKEY_DH:
190. break;
crypto/evp/exchange.c:189:13: Switch condition is true. Entering switch case
187. if (ctx->pkey != NULL) {
188. switch (ctx->pkey->type) {
189. case EVP_PKEY_DH:
^
190. break;
191. default:
crypto/evp/exchange.c:194:13:
192. goto legacy;
193. }
194. > exchange = EVP_KEYEXCH_fetch(NULL, OBJ_nid2sn(nid), NULL);
195. } else {
196. goto legacy;
crypto/objects/obj_dat.c:247:1: start of procedure OBJ_nid2sn()
245. }
246.
247. > const char *OBJ_nid2sn(int n)
248. {
249. ADDED_OBJ ad, *adp;
crypto/objects/obj_dat.c:252:10: Taking true branch
250. ASN1_OBJECT ob;
251.
252. if ((n >= 0) && (n < NUM_NID)) {
^
253. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
254. OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
crypto/objects/obj_dat.c:252:22: Taking true branch
250. ASN1_OBJECT ob;
251.
252. if ((n >= 0) && (n < NUM_NID)) {
^
253. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
254. OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
crypto/objects/obj_dat.c:253:14: Taking true branch
251.
252. if ((n >= 0) && (n < NUM_NID)) {
253. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
^
254. OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
255. return NULL;
crypto/objects/obj_dat.c:253:34: Taking false branch
251.
252. if ((n >= 0) && (n < NUM_NID)) {
253. if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
^
254. OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
255. return NULL;
crypto/objects/obj_dat.c:257:9:
255. return NULL;
256. }
257. > return nid_objs[n].sn;
258. } else if (added == NULL)
259. return NULL;
crypto/objects/obj_dat.c:272:1: return from a call to OBJ_nid2sn
270. }
271. }
272. > }
273.
274. const char *OBJ_nid2ln(int n)
|
https://github.com/openssl/openssl/blob/c3612970465d0a13f2fc5b47bc28ca18516a699d/crypto/evp/exchange.c/#L194
|
d2a_code_trace_data_45714
|
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
{
int len = strlen(dst);
va_list vl;
va_start(vl, fmt);
len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
va_end(vl);
return len;
}
avconv.c:2962: error: Integer Overflow R2
([0, +oo] + [0, +oo]):signed32 by call to `print_sdp`.
avconv.c:2882:13: Unknown value from: strcmp
2880. }
2881. assert_avoptions(output_files[i]->opts);
2882. if (strcmp(oc->oformat->name, "rtp")) {
^
2883. want_sdp = 0;
2884. }
avconv.c:2962:9: Call
2960.
2961. if (want_sdp) {
2962. print_sdp();
^
2963. }
2964.
avconv.c:2416:1: Parameter `sdp.strlen`
2414. }
2415.
2416. static void print_sdp(void)
^
2417. {
2418. char sdp[2048];
avconv.c:2427:5: Call
2425. avc[i] = output_files[i]->ctx;
2426.
2427. av_sdp_create(avc, nb_output_files, sdp, sizeof(sdp));
^
2428. printf("SDP:\n%s\n", sdp);
2429. fflush(stdout);
libavformat/sdp.c:580:1: Parameter `buf->strlen`
578. }
579.
580. int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
^
581. {
582. AVDictionaryEntry *title = av_dict_get(ac[0]->metadata, "title", NULL, 0);
libavformat/sdp.c:611:5: Call
609. }
610. }
611. sdp_write_header(buf, size, &s);
^
612.
613. dst[0] = 0;
libavformat/sdp.c:73:1: Parameter `buff->strlen`
71. }
72.
73. static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)
^
74. {
75. av_strlcatf(buff, size, "v=%d\r\n"
libavformat/sdp.c:75:5: Call
73. static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)
74. {
75. av_strlcatf(buff, size, "v=%d\r\n"
^
76. "o=- %d %d IN %s %s\r\n"
77. "s=%s\r\n",
libavutil/avstring.c:82:1: <LHS trace>
80. }
81.
82. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
^
83. {
84. int len = strlen(dst);
libavutil/avstring.c:82:1: Parameter `size`
80. }
81.
82. size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...)
^
83. {
84. int len = strlen(dst);
libavutil/avstring.c:88:12: <RHS trace>
86.
87. va_start(vl, fmt);
88. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
^
89. va_end(vl);
90.
libavutil/avstring.c:88:12: Risky value from: vsnprintf
86.
87. va_start(vl, fmt);
88. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
^
89. va_end(vl);
90.
libavutil/avstring.c:88:5: Binary operation: ([0, +oo] + [0, +oo]):signed32 by call to `print_sdp`
86.
87. va_start(vl, fmt);
88. len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl);
^
89. va_end(vl);
90.
|
https://github.com/libav/libav/blob/89605e4aa018f75fef1de531449383b0e9d1bfe1/libavutil/avstring.c/#L88
|
d2a_code_trace_data_45715
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/rsa_sp800_56b_test.c:347: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `rsa_sp800_56b_derive_params_from_pq`.
Showing all 28 steps of the trace
test/rsa_sp800_56b_test.c:347:14: Call
345. && TEST_true(BN_set_word(e, E))
346. && TEST_true(RSA_set0_factors(key, p, q))
347. && TEST_true(rsa_sp800_56b_derive_params_from_pq(key, 8, e, ctx))
^
348. && TEST_BN_eq_word(key->n, N)
349. && TEST_BN_eq_word(key->dmp1, DP)
crypto/rsa/rsa_sp800_56b_gen.c:180:1: Parameter `ctx->stack.depth`
178. * 1 = success.
179. */
180. > int rsa_sp800_56b_derive_params_from_pq(RSA *rsa, int nbits,
181. const BIGNUM *e, BN_CTX *ctx)
182. {
crypto/rsa/rsa_sp800_56b_gen.c:186:5: Call
184. BIGNUM *p1, *q1, *lcm, *p1q1, *gcd;
185.
186. BN_CTX_start(ctx);
^
187. p1 = BN_CTX_get(ctx);
188. q1 = 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_gen.c:187:10: Call
185.
186. BN_CTX_start(ctx);
187. p1 = BN_CTX_get(ctx);
^
188. q1 = BN_CTX_get(ctx);
189. lcm = 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_gen.c:188:10: Call
186. BN_CTX_start(ctx);
187. p1 = BN_CTX_get(ctx);
188. q1 = BN_CTX_get(ctx);
^
189. lcm = BN_CTX_get(ctx);
190. p1q1 = 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_gen.c:189:11: Call
187. p1 = BN_CTX_get(ctx);
188. q1 = BN_CTX_get(ctx);
189. lcm = BN_CTX_get(ctx);
^
190. p1q1 = BN_CTX_get(ctx);
191. gcd = 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_gen.c:190:12: Call
188. q1 = BN_CTX_get(ctx);
189. lcm = BN_CTX_get(ctx);
190. p1q1 = BN_CTX_get(ctx);
^
191. gcd = BN_CTX_get(ctx);
192. if (gcd == 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_gen.c:191:11: Call
189. lcm = BN_CTX_get(ctx);
190. p1q1 = BN_CTX_get(ctx);
191. gcd = BN_CTX_get(ctx);
^
192. if (gcd == NULL)
193. 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_sp800_56b_gen.c:196:9: Call
194.
195. /* LCM((p-1, q-1)) */
196. if (rsa_get_lcm(ctx, rsa->p, rsa->q, lcm, gcd, p1, q1, p1q1) != 1)
^
197. goto err;
198.
crypto/rsa/rsa_sp800_56b_check.c:220:1: Parameter `ctx->stack.depth`
218.
219. /* return LCM(p-1, q-1) */
220. > int rsa_get_lcm(BN_CTX *ctx, const BIGNUM *p, const BIGNUM *q,
221. BIGNUM *lcm, BIGNUM *gcd, BIGNUM *p1, BIGNUM *q1,
222. BIGNUM *p1q1)
crypto/rsa/rsa_sp800_56b_check.c:226:15: Call
224. return BN_sub(p1, p, BN_value_one()) /* p-1 */
225. && BN_sub(q1, q, BN_value_one()) /* q-1 */
226. && BN_mul(p1q1, p1, q1, ctx) /* (p-1)(q-1) */
^
227. && BN_gcd(gcd, p1, q1, ctx)
228. && BN_div(lcm, NULL, p1q1, gcd, ctx); /* LCM((p-1, q-1)) */
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, +oo] - 1):unsigned32 by call to `rsa_sp800_56b_derive_params_from_pq`
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_45716
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ec2_smpl.c:549: 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_smpl.c:520:5: Call
518. }
519.
520. BN_CTX_start(ctx);
^
521. y2 = BN_CTX_get(ctx);
522. lh = 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_smpl.c:549:5: Call
547.
548. err:
549. BN_CTX_end(ctx);
^
550. BN_CTX_free(new_ctx);
551. 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_45717
|
static void update(Real288_internal *glob)
{
int x,y;
float buffer1[40],temp1[37];
float buffer2[8],temp2[11];
for (x=0,y=glob->phasep+5;x<40;buffer1[x++]=glob->output[(y++)%40]);
co(36,40,35,buffer1,temp1,glob->st1a,glob->st1b,table1);
if (pred(temp1,glob->st1,36))
colmult(glob->pr1,glob->st1,table1a,36);
for (x=0,y=glob->phase+1;x<8;buffer2[x++]=glob->history[(y++)%8]);
co(10,8,20,buffer2,temp2,glob->st2a,glob->st2b,table2);
if (pred(temp2,glob->st2,10))
colmult(glob->pr2,glob->st2,table2a,10);
}
libavcodec/ra288.c:79: error: Buffer Overrun L3
Offset: [-39, 39] Size: 40.
libavcodec/ra288.c:73:1: <Offset trace>
71. }
72.
73. static void update(Real288_internal *glob)
^
74. {
75. int x,y;
libavcodec/ra288.c:73:1: Parameter `glob->phasep`
71. }
72.
73. static void update(Real288_internal *glob)
^
74. {
75. int x,y;
libavcodec/ra288.c:79:12: Assignment
77. float buffer2[8],temp2[11];
78.
79. for (x=0,y=glob->phasep+5;x<40;buffer1[x++]=glob->output[(y++)%40]);
^
80. co(36,40,35,buffer1,temp1,glob->st1a,glob->st1b,table1);
81. if (pred(temp1,glob->st1,36))
libavcodec/ra288.c:73:1: <Length trace>
71. }
72.
73. static void update(Real288_internal *glob)
^
74. {
75. int x,y;
libavcodec/ra288.c:73:1: Parameter `glob->output[*]`
71. }
72.
73. static void update(Real288_internal *glob)
^
74. {
75. int x,y;
libavcodec/ra288.c:79:47: Array access: Offset: [-39, 39] Size: 40
77. float buffer2[8],temp2[11];
78.
79. for (x=0,y=glob->phasep+5;x<40;buffer1[x++]=glob->output[(y++)%40]);
^
80. co(36,40,35,buffer1,temp1,glob->st1a,glob->st1b,table1);
81. if (pred(temp1,glob->st1,36))
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/ra288.c/#L79
|
d2a_code_trace_data_45718
|
static int tls_construct_cke_rsa(SSL *s, unsigned char **p, int *len, int *al)
{
#ifndef OPENSSL_NO_RSA
unsigned char *q;
EVP_PKEY *pkey = NULL;
EVP_PKEY_CTX *pctx = NULL;
size_t enclen;
unsigned char *pms = NULL;
size_t pmslen = 0;
if (s->session->peer == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
return 0;
}
pkey = X509_get0_pubkey(s->session->peer);
if (EVP_PKEY_get0_RSA(pkey) == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
return 0;
}
pmslen = SSL_MAX_MASTER_KEY_LENGTH;
pms = OPENSSL_malloc(pmslen);
if (pms == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_MALLOC_FAILURE);
*al = SSL_AD_INTERNAL_ERROR;
return 0;
}
pms[0] = s->client_version >> 8;
pms[1] = s->client_version & 0xff;
if (RAND_bytes(pms + 2, pmslen - 2) <= 0) {
goto err;
}
q = *p;
if (s->version > SSL3_VERSION)
*p += 2;
pctx = EVP_PKEY_CTX_new(pkey, NULL);
if (pctx == NULL || EVP_PKEY_encrypt_init(pctx) <= 0
|| EVP_PKEY_encrypt(pctx, NULL, &enclen, pms, pmslen) <= 0) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_EVP_LIB);
goto err;
}
if (EVP_PKEY_encrypt(pctx, *p, &enclen, pms, pmslen) <= 0) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, SSL_R_BAD_RSA_ENCRYPT);
goto err;
}
*len = enclen;
EVP_PKEY_CTX_free(pctx);
pctx = NULL;
# ifdef PKCS1_CHECK
if (s->options & SSL_OP_PKCS1_CHECK_1)
(*p)[1]++;
if (s->options & SSL_OP_PKCS1_CHECK_2)
tmp_buf[0] = 0x70;
# endif
if (s->version > SSL3_VERSION) {
s2n(*len, q);
*len += 2;
}
s->s3->tmp.pms = pms;
s->s3->tmp.pmslen = pmslen;
return 1;
err:
OPENSSL_clear_free(pms, pmslen);
EVP_PKEY_CTX_free(pctx);
return 0;
#else
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
*al = SSL_AD_INTERNAL_ERROR;
return 0;
#endif
}
ssl/statem/statem_clnt.c:2176: error: NULL_DEREFERENCE
pointer `pkey` last assigned on line 2175 could be null and is dereferenced by call to `EVP_PKEY_get0_RSA()` at line 2176, column 9.
Showing all 29 steps of the trace
ssl/statem/statem_clnt.c:2157:1: start of procedure tls_construct_cke_rsa()
2155. }
2156.
2157. > static int tls_construct_cke_rsa(SSL *s, unsigned char **p, int *len, int *al)
2158. {
2159. #ifndef OPENSSL_NO_RSA
ssl/statem/statem_clnt.c:2161:5:
2159. #ifndef OPENSSL_NO_RSA
2160. unsigned char *q;
2161. > EVP_PKEY *pkey = NULL;
2162. EVP_PKEY_CTX *pctx = NULL;
2163. size_t enclen;
ssl/statem/statem_clnt.c:2162:5:
2160. unsigned char *q;
2161. EVP_PKEY *pkey = NULL;
2162. > EVP_PKEY_CTX *pctx = NULL;
2163. size_t enclen;
2164. unsigned char *pms = NULL;
ssl/statem/statem_clnt.c:2164:5:
2162. EVP_PKEY_CTX *pctx = NULL;
2163. size_t enclen;
2164. > unsigned char *pms = NULL;
2165. size_t pmslen = 0;
2166.
ssl/statem/statem_clnt.c:2165:5:
2163. size_t enclen;
2164. unsigned char *pms = NULL;
2165. > size_t pmslen = 0;
2166.
2167. if (s->session->peer == NULL) {
ssl/statem/statem_clnt.c:2167:9: Taking false branch
2165. size_t pmslen = 0;
2166.
2167. if (s->session->peer == NULL) {
^
2168. /*
2169. * We should always have a server certificate with SSL_kRSA.
ssl/statem/statem_clnt.c:2175:5:
2173. }
2174.
2175. > pkey = X509_get0_pubkey(s->session->peer);
2176. if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2177. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
crypto/x509/x509_cmp.c:265:1: start of procedure X509_get0_pubkey()
263. }
264.
265. > EVP_PKEY *X509_get0_pubkey(const X509 *x)
266. {
267. if (x == NULL)
crypto/x509/x509_cmp.c:267:9: Taking false branch
265. EVP_PKEY *X509_get0_pubkey(const X509 *x)
266. {
267. if (x == NULL)
^
268. return NULL;
269. return X509_PUBKEY_get0(x->cert_info.key);
crypto/x509/x509_cmp.c:269:5:
267. if (x == NULL)
268. return NULL;
269. > return X509_PUBKEY_get0(x->cert_info.key);
270. }
271.
crypto/x509/x_pubkey.c:140:1: start of procedure X509_PUBKEY_get0()
138. }
139.
140. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
141. {
142. EVP_PKEY *ret = NULL;
crypto/x509/x_pubkey.c:142:5:
140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
141. {
142. > EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
crypto/x509/x_pubkey.c:144:9: Taking false branch
142. EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
^
145. return NULL;
146.
crypto/x509/x_pubkey.c:144:24: Taking false branch
142. EVP_PKEY *ret = NULL;
143.
144. if (key == NULL || key->public_key == NULL)
^
145. return NULL;
146.
crypto/x509/x_pubkey.c:147:9: Taking false branch
145. return NULL;
146.
147. if (key->pkey != NULL)
^
148. return key->pkey;
149.
crypto/x509/x_pubkey.c:158:5:
156. * in the queue.
157. */
158. > x509_pubkey_decode(&ret, key);
159. /* If decode doesn't fail something bad happened */
160. if (ret != NULL) {
crypto/x509/x_pubkey.c:103:1: start of procedure x509_pubkey_decode()
101.
102.
103. > static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key)
104. {
105. EVP_PKEY *pkey = EVP_PKEY_new();
crypto/x509/x_pubkey.c:105:5: Skipping EVP_PKEY_new(): empty list of specs
103. static int x509_pubkey_decode(EVP_PKEY **ppkey, X509_PUBKEY *key)
104. {
105. EVP_PKEY *pkey = EVP_PKEY_new();
^
106.
107. if (pkey == NULL) {
crypto/x509/x_pubkey.c:107:9: Taking true branch
105. EVP_PKEY *pkey = EVP_PKEY_new();
106.
107. if (pkey == NULL) {
^
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
109. return -1;
crypto/x509/x_pubkey.c:108:9: Skipping ERR_put_error(): empty list of specs
106.
107. if (pkey == NULL) {
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
^
109. return -1;
110. }
crypto/x509/x_pubkey.c:109:9:
107. if (pkey == NULL) {
108. X509err(X509_F_X509_PUBKEY_DECODE, ERR_R_MALLOC_FAILURE);
109. > return -1;
110. }
111.
crypto/x509/x_pubkey.c:138:1: return from a call to x509_pubkey_decode
136. EVP_PKEY_free(pkey);
137. return 0;
138. > }
139.
140. EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
crypto/x509/x_pubkey.c:160:9: Taking false branch
158. x509_pubkey_decode(&ret, key);
159. /* If decode doesn't fail something bad happened */
160. if (ret != NULL) {
^
161. X509err(X509_F_X509_PUBKEY_GET0, ERR_R_INTERNAL_ERROR);
162. EVP_PKEY_free(ret);
crypto/x509/x_pubkey.c:165:5:
163. }
164.
165. > return NULL;
166. }
167.
crypto/x509/x_pubkey.c:166:1: return from a call to X509_PUBKEY_get0
164.
165. return NULL;
166. > }
167.
168. EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
crypto/x509/x509_cmp.c:270:1: return from a call to X509_get0_pubkey
268. return NULL;
269. return X509_PUBKEY_get0(x->cert_info.key);
270. > }
271.
272. EVP_PKEY *X509_get_pubkey(X509 *x)
ssl/statem/statem_clnt.c:2176:9:
2174.
2175. pkey = X509_get0_pubkey(s->session->peer);
2176. > if (EVP_PKEY_get0_RSA(pkey) == NULL) {
2177. SSLerr(SSL_F_TLS_CONSTRUCT_CKE_RSA, ERR_R_INTERNAL_ERROR);
2178. return 0;
crypto/evp/p_lib.c:261:1: start of procedure EVP_PKEY_get0_RSA()
259. }
260.
261. > RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
262. {
263. if (pkey->type != EVP_PKEY_RSA) {
crypto/evp/p_lib.c:263:9:
261. RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
262. {
263. > if (pkey->type != EVP_PKEY_RSA) {
264. EVPerr(EVP_F_EVP_PKEY_GET0_RSA, EVP_R_EXPECTING_AN_RSA_KEY);
265. return NULL;
|
https://github.com/openssl/openssl/blob/de451856f08364ad6c6659b6eacbe820edc2aab9/ssl/statem/statem_clnt.c/#L2176
|
d2a_code_trace_data_45719
|
void
TIFFSwabLong8(uint64* lp)
{
register unsigned char* cp = (unsigned char*) lp;
unsigned char t;
assert(sizeof(uint64)==8);
t = cp[7]; cp[7] = cp[0]; cp[0] = t;
t = cp[6]; cp[6] = cp[1]; cp[1] = t;
t = cp[5]; cp[5] = cp[2]; cp[2] = t;
t = cp[4]; cp[4] = cp[3]; cp[3] = t;
}
libtiff/tif_dirread.c:1315: error: Buffer Overrun L3
Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFSwabLong8`.
libtiff/tif_dirread.c:1200:6: Call
1198. return(TIFFReadDirEntryErrType);
1199. }
1200. err=TIFFReadDirEntryArray(tif,direntry,&count,2,&origdata);
^
1201. if ((err!=TIFFReadDirEntryErrOk)||(origdata==0))
1202. {
libtiff/tif_dirread.c:756:1: Parameter `**value`
754. }
755.
756. static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32* count, uint32 desttypesize, void** value)
^
757. {
758. int typesize;
libtiff/tif_dirread.c:1310:5: Assignment
1308. uint16* mb;
1309. uint32 n;
1310. ma=(uint64*)origdata;
^
1311. mb=data;
1312. for (n=0; n<count; n++)
libtiff/tif_dirread.c:1315:7: Call
1313. {
1314. if (tif->tif_flags&TIFF_SWAB)
1315. TIFFSwabLong8(ma);
^
1316. err=TIFFReadDirEntryCheckRangeShortLong8(*ma);
1317. if (err!=TIFFReadDirEntryErrOk)
libtiff/tif_swab.c:58:1: <Length trace>
56.
57. #ifndef TIFFSwabLong8
58. void
^
59. TIFFSwabLong8(uint64* lp)
60. {
libtiff/tif_swab.c:58:1: Parameter `*lp`
56.
57. #ifndef TIFFSwabLong8
58. void
^
59. TIFFSwabLong8(uint64* lp)
60. {
libtiff/tif_swab.c:61:2: Assignment
59. TIFFSwabLong8(uint64* lp)
60. {
61. register unsigned char* cp = (unsigned char*) lp;
^
62. unsigned char t;
63. assert(sizeof(uint64)==8);
libtiff/tif_swab.c:64:6: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFSwabLong8`
62. unsigned char t;
63. assert(sizeof(uint64)==8);
64. t = cp[7]; cp[7] = cp[0]; cp[0] = t;
^
65. t = cp[6]; cp[6] = cp[1]; cp[1] = t;
66. t = cp[5]; cp[5] = cp[2]; cp[2] = t;
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L64
|
d2a_code_trace_data_45720
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/ec/ec2_oct.c:333: 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:289:5: Call
287. }
288.
289. BN_CTX_start(ctx);
^
290. x = BN_CTX_get(ctx);
291. y = 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:333:5: Call
331.
332. err:
333. BN_CTX_end(ctx);
^
334. BN_CTX_free(new_ctx);
335. 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_45721
|
IMPLEMENT_new_ctx(ecb, ECB, 256)
providers/common/ciphers/aes.c:286: error: NULL_DEREFERENCE
pointer `ctx` last assigned on line 286 could be null and is dereferenced at line 286, column 1.
Showing all 18 steps of the trace
providers/common/ciphers/aes.c:286:1: start of procedure aes_256_ecb_newctx()
284. /* ECB */
285. IMPLEMENT_new_params(ecb, ECB)
286. > IMPLEMENT_new_ctx(ecb, ECB, 256)
287. IMPLEMENT_new_ctx(ecb, ECB, 192)
288. IMPLEMENT_new_ctx(ecb, ECB, 128)
crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:5:
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. > void *ret = CRYPTO_malloc(num, file, line);
231.
232. FAILTEST();
crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
190. #endif
191.
192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. void *ret = NULL;
crypto/mem.c:194:5:
192. void *CRYPTO_malloc(size_t num, const char *file, int line)
193. {
194. > void *ret = NULL;
195.
196. INCREMENT(malloc_count);
crypto/mem.c:197:9: Taking false branch
195.
196. INCREMENT(malloc_count);
197. if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
^
198. return malloc_impl(num, file, line);
199.
crypto/mem.c:200:9: Taking false branch
198. return malloc_impl(num, file, line);
199.
200. if (num == 0)
^
201. return NULL;
202.
crypto/mem.c:204:9: Taking true branch
202.
203. FAILTEST();
204. if (allow_customize) {
^
205. /*
206. * Disallow customization after the first allocation. We only set this
crypto/mem.c:210:9:
208. * allocation.
209. */
210. > allow_customize = 0;
211. }
212. #if !defined(OPENSSL_NO_CRYPTO_MDEBUG) && !defined(FIPS_MODE)
crypto/mem.c:221:5:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:221:19:
219. }
220. #else
221. > (void)(file); (void)(line);
222. ret = malloc(num);
223. #endif
crypto/mem.c:222:5:
220. #else
221. (void)(file); (void)(line);
222. > ret = malloc(num);
223. #endif
224.
crypto/mem.c:225:5:
223. #endif
224.
225. > return ret;
226. }
227.
crypto/mem.c:226:1: return from a call to CRYPTO_malloc
224.
225. return ret;
226. > }
227.
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
crypto/mem.c:233:9: Taking false branch
231.
232. FAILTEST();
233. if (ret != NULL)
^
234. memset(ret, 0, num);
235. return ret;
crypto/mem.c:235:5:
233. if (ret != NULL)
234. memset(ret, 0, num);
235. > return ret;
236. }
237.
crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
234. memset(ret, 0, num);
235. return ret;
236. > }
237.
238. void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
providers/common/ciphers/aes.c:286:1:
284. /* ECB */
285. IMPLEMENT_new_params(ecb, ECB)
286. > IMPLEMENT_new_ctx(ecb, ECB, 256)
287. IMPLEMENT_new_ctx(ecb, ECB, 192)
288. IMPLEMENT_new_ctx(ecb, ECB, 128)
|
https://github.com/openssl/openssl/blob/f79858ac4d90a450d0620d1ecb713bc35d7d9f8d/providers/common/ciphers/aes.c/#L286
|
d2a_code_trace_data_45722
|
static int expand(OPENSSL_LHASH *lh)
{
OPENSSL_LH_NODE **n, **n1, **n2, *np;
unsigned int p, pmax, nni, j;
unsigned long hash;
nni = lh->num_alloc_nodes;
p = lh->p;
pmax = lh->pmax;
if (p + 1 >= pmax) {
j = nni * 2;
n = OPENSSL_realloc(lh->b, sizeof(OPENSSL_LH_NODE *) * j);
if (n == NULL) {
lh->error++;
return 0;
}
lh->b = n;
memset(n + nni, 0, sizeof(*n) * (j - nni));
lh->pmax = nni;
lh->num_alloc_nodes = j;
lh->num_expand_reallocs++;
lh->p = 0;
} else {
lh->p++;
}
lh->num_nodes++;
lh->num_expands++;
n1 = &(lh->b[p]);
n2 = &(lh->b[p + pmax]);
*n2 = NULL;
for (np = *n1; np != NULL;) {
hash = np->hash;
if ((hash % nni) != p) {
*n1 = (*n1)->next;
np->next = *n2;
*n2 = np;
} else
n1 = &((*n1)->next);
np = *n1;
}
return 1;
}
ssl/ssl_cert.c:648: error: BUFFER_OVERRUN_L3
Offset added: [272, +oo] (⇐ [16, +oo] + [256, +oo]) Size: [1, +oo] by call to `lh_X509_NAME_insert`.
Showing all 15 steps of the trace
ssl/ssl_cert.c:617:38: Call
615. X509_NAME *xn = NULL;
616. STACK_OF(X509_NAME) *ret = NULL;
617. LHASH_OF(X509_NAME) *name_hash = lh_X509_NAME_new(xname_hash, xname_cmp);
^
618.
619. if ((name_hash == NULL) || (in == NULL)) {
ssl/ssl_locl.h:734:1: Call
732. DEFINE_LHASH_OF(SSL_SESSION);
733. /* Needed in ssl_cert.c */
734. > DEFINE_LHASH_OF(X509_NAME);
735.
736. # define TLSEXT_KEYNAME_LENGTH 16
crypto/lhash/lhash.c:55:5: Assignment
53. ret->hash = ((h == NULL) ? (OPENSSL_LH_HASHFUNC)OPENSSL_LH_strhash : h);
54. ret->num_nodes = MIN_NODES / 2;
55. ret->num_alloc_nodes = MIN_NODES;
^
56. ret->pmax = MIN_NODES / 2;
57. ret->up_load = UP_LOAD;
ssl/ssl_cert.c:648:13: Call
646. xn = NULL;
647. } else {
648. lh_X509_NAME_insert(name_hash, xn);
^
649. if (!sk_X509_NAME_push(ret, xn))
650. goto err;
ssl/ssl_locl.h:734:1: Parameter `lh->num_alloc_nodes`
732. DEFINE_LHASH_OF(SSL_SESSION);
733. /* Needed in ssl_cert.c */
734. > DEFINE_LHASH_OF(X509_NAME);
735.
736. # define TLSEXT_KEYNAME_LENGTH 16
ssl/ssl_locl.h:734:1: Call
732. DEFINE_LHASH_OF(SSL_SESSION);
733. /* Needed in ssl_cert.c */
734. > DEFINE_LHASH_OF(X509_NAME);
735.
736. # define TLSEXT_KEYNAME_LENGTH 16
crypto/lhash/lhash.c:87:1: Parameter `lh->num_alloc_nodes`
85. }
86.
87. > void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data)
88. {
89. unsigned long hash;
crypto/lhash/lhash.c:94:77: Call
92.
93. lh->error = 0;
94. if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))
^
95. return NULL; /* 'lh->error++' already done in 'expand' */
96.
crypto/lhash/lhash.c:203:1: <Offset trace>
201. }
202.
203. > static int expand(OPENSSL_LHASH *lh)
204. {
205. OPENSSL_LH_NODE **n, **n1, **n2, *np;
crypto/lhash/lhash.c:203:1: Parameter `lh->num_alloc_nodes`
201. }
202.
203. > static int expand(OPENSSL_LHASH *lh)
204. {
205. OPENSSL_LH_NODE **n, **n1, **n2, *np;
crypto/lhash/lhash.c:209:5: Assignment
207. unsigned long hash;
208.
209. nni = lh->num_alloc_nodes;
^
210. p = lh->p;
211. pmax = lh->pmax;
crypto/lhash/lhash.c:203:1: <Length trace>
201. }
202.
203. > static int expand(OPENSSL_LHASH *lh)
204. {
205. OPENSSL_LH_NODE **n, **n1, **n2, *np;
crypto/lhash/lhash.c:203:1: Parameter `lh->num_alloc_nodes`
201. }
202.
203. > static int expand(OPENSSL_LHASH *lh)
204. {
205. OPENSSL_LH_NODE **n, **n1, **n2, *np;
crypto/lhash/lhash.c:209:5: Assignment
207. unsigned long hash;
208.
209. nni = lh->num_alloc_nodes;
^
210. p = lh->p;
211. pmax = lh->pmax;
crypto/lhash/lhash.c:220:9: Array access: Offset added: [272, +oo] (⇐ [16, +oo] + [256, +oo]) Size: [1, +oo] by call to `lh_X509_NAME_insert`
218. }
219. lh->b = n;
220. memset(n + nni, 0, sizeof(*n) * (j - nni));
^
221. lh->pmax = nni;
222. lh->num_alloc_nodes = j;
|
https://github.com/openssl/openssl/blob/8f8be103fd7d8b5992724d618c99cbddd7dd00d7/crypto/lhash/lhash.c/#L220
|
d2a_code_trace_data_45723
|
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;
}
ssl/record/ssl3_record_tls13.c:120: error: INTEGER_OVERFLOW_L2
(0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`.
Showing all 9 steps of the trace
ssl/record/ssl3_record_tls13.c:120:16: Call
118. taglen,
119. rec->data + rec->length) <= 0)
120. || EVP_CipherUpdate(ctx, rec->data, &lenu, rec->input,
^
121. (unsigned int)rec->length) <= 0
122. || EVP_CipherFinal_ex(ctx, rec->data + lenu, &lenf) <= 0
crypto/evp/evp_enc.c:207:1: Parameter `ctx->cipher->block_size`
205. }
206.
207. > int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
208. const unsigned char *in, int inl)
209. {
crypto/evp/evp_enc.c:213:16: Call
211. return EVP_EncryptUpdate(ctx, out, outl, in, inl);
212. else
213. return EVP_DecryptUpdate(ctx, out, outl, in, inl);
^
214. }
215.
crypto/evp/evp_enc.c:418:1: Parameter `ctx->cipher->block_size`
416. }
417.
418. > int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
419. const unsigned char *in, int inl)
420. {
crypto/evp/evp_enc.c:424:5: Assignment
422. unsigned int b;
423.
424. b = ctx->cipher->block_size;
^
425.
426. if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
crypto/evp/evp_enc.c:454:16: Call
452. /* see comment about PTRDIFF_T comparison above */
453. if (((PTRDIFF_T)out == (PTRDIFF_T)in)
454. || is_partially_overlapping(out, in, b)) {
^
455. EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING);
456. return 0;
crypto/evp/evp_enc.c:281:1: <RHS trace>
279. #endif
280.
281. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
282. {
283. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:281:1: Parameter `len`
279. #endif
280.
281. > int is_partially_overlapping(const void *ptr1, const void *ptr2, int len)
282. {
283. PTRDIFF_T diff = (PTRDIFF_T)ptr1-(PTRDIFF_T)ptr2;
crypto/evp/evp_enc.c:290:50: Binary operation: (0 - [-oo, 32]):unsigned64 by call to `EVP_CipherUpdate`
288. */
289. int overlapped = (len > 0) & (diff != 0) & ((diff < (PTRDIFF_T)len) |
290. (diff > (0 - (PTRDIFF_T)len)));
^
291.
292. return overlapped;
|
https://github.com/openssl/openssl/blob/68a55f3b451060c747986aeffa322d32c770dd62/crypto/evp/evp_enc.c/#L290
|
d2a_code_trace_data_45724
|
static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
AVCodecContext *avctx)
{
int p, luma_width, luma_height, chroma_width, chroma_height;
int luma_pitch, chroma_pitch, luma_size, chroma_size;
luma_width = ctx->width;
luma_height = ctx->height;
if (luma_width < 16 || luma_width > 640 ||
luma_height < 16 || luma_height > 480 ||
luma_width & 3 || luma_height & 3) {
av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
luma_width, luma_height);
return AVERROR_INVALIDDATA;
}
chroma_width = FFALIGN(luma_width >> 2, 4);
chroma_height = FFALIGN(luma_height >> 2, 4);
luma_pitch = FFALIGN(luma_width, 16);
chroma_pitch = FFALIGN(chroma_width, 16);
luma_size = luma_pitch * (luma_height + 1);
chroma_size = chroma_pitch * (chroma_height + 1);
for (p = 0; p < 3; p++) {
ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
ctx->planes[p].width = !p ? luma_width : chroma_width;
ctx->planes[p].height = !p ? luma_height : chroma_height;
ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
memset(ctx->planes[p].buffers[0], 0x40, ctx->planes[p].pitch);
memset(ctx->planes[p].buffers[1], 0x40, ctx->planes[p].pitch);
ctx->planes[p].pixels[0] = ctx->planes[p].buffers[0] + ctx->planes[p].pitch;
ctx->planes[p].pixels[1] = ctx->planes[p].buffers[1] + ctx->planes[p].pitch;
}
return 0;
}
libavcodec/indeo3.c:192: error: Null Dereference
pointer `ctx->planes[p].buffers[1]` last assigned on line 188 could be null and is dereferenced by call to `memset()` at line 192, column 9.
libavcodec/indeo3.c:150:1: start of procedure allocate_frame_buffers()
148.
149.
150. static av_cold int allocate_frame_buffers(Indeo3DecodeContext *ctx,
^
151. AVCodecContext *avctx)
152. {
libavcodec/indeo3.c:156:5:
154. int luma_pitch, chroma_pitch, luma_size, chroma_size;
155.
156. luma_width = ctx->width;
^
157. luma_height = ctx->height;
158.
libavcodec/indeo3.c:157:5:
155.
156. luma_width = ctx->width;
157. luma_height = ctx->height;
^
158.
159. if (luma_width < 16 || luma_width > 640 ||
libavcodec/indeo3.c:159:9: Taking false branch
157. luma_height = ctx->height;
158.
159. if (luma_width < 16 || luma_width > 640 ||
^
160. luma_height < 16 || luma_height > 480 ||
161. luma_width & 3 || luma_height & 3) {
libavcodec/indeo3.c:159:29: Taking false branch
157. luma_height = ctx->height;
158.
159. if (luma_width < 16 || luma_width > 640 ||
^
160. luma_height < 16 || luma_height > 480 ||
161. luma_width & 3 || luma_height & 3) {
libavcodec/indeo3.c:160:9: Taking false branch
158.
159. if (luma_width < 16 || luma_width > 640 ||
160. luma_height < 16 || luma_height > 480 ||
^
161. luma_width & 3 || luma_height & 3) {
162. av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
libavcodec/indeo3.c:160:29: Taking false branch
158.
159. if (luma_width < 16 || luma_width > 640 ||
160. luma_height < 16 || luma_height > 480 ||
^
161. luma_width & 3 || luma_height & 3) {
162. av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
libavcodec/indeo3.c:161:9: Taking false branch
159. if (luma_width < 16 || luma_width > 640 ||
160. luma_height < 16 || luma_height > 480 ||
161. luma_width & 3 || luma_height & 3) {
^
162. av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
163. luma_width, luma_height);
libavcodec/indeo3.c:161:29: Taking false branch
159. if (luma_width < 16 || luma_width > 640 ||
160. luma_height < 16 || luma_height > 480 ||
161. luma_width & 3 || luma_height & 3) {
^
162. av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
163. luma_width, luma_height);
libavcodec/indeo3.c:167:5:
165. }
166.
167. chroma_width = FFALIGN(luma_width >> 2, 4);
^
168. chroma_height = FFALIGN(luma_height >> 2, 4);
169.
libavcodec/indeo3.c:168:5:
166.
167. chroma_width = FFALIGN(luma_width >> 2, 4);
168. chroma_height = FFALIGN(luma_height >> 2, 4);
^
169.
170. luma_pitch = FFALIGN(luma_width, 16);
libavcodec/indeo3.c:170:5:
168. chroma_height = FFALIGN(luma_height >> 2, 4);
169.
170. luma_pitch = FFALIGN(luma_width, 16);
^
171. chroma_pitch = FFALIGN(chroma_width, 16);
172.
libavcodec/indeo3.c:171:5:
169.
170. luma_pitch = FFALIGN(luma_width, 16);
171. chroma_pitch = FFALIGN(chroma_width, 16);
^
172.
173. /* Calculate size of the luminance plane. */
libavcodec/indeo3.c:175:5:
173. /* Calculate size of the luminance plane. */
174. /* Add one line more for INTRA prediction. */
175. luma_size = luma_pitch * (luma_height + 1);
^
176.
177. /* Calculate size of a chrominance planes. */
libavcodec/indeo3.c:179:5:
177. /* Calculate size of a chrominance planes. */
178. /* Add one line more for INTRA prediction. */
179. chroma_size = chroma_pitch * (chroma_height + 1);
^
180.
181. /* allocate frame buffers */
libavcodec/indeo3.c:182:10:
180.
181. /* allocate frame buffers */
182. for (p = 0; p < 3; p++) {
^
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
libavcodec/indeo3.c:182:17: Loop condition is true. Entering loop body
180.
181. /* allocate frame buffers */
182. for (p = 0; p < 3; p++) {
^
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
libavcodec/indeo3.c:183:34: Condition is true
181. /* allocate frame buffers */
182. for (p = 0; p < 3; p++) {
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
^
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
libavcodec/indeo3.c:183:33:
181. /* allocate frame buffers */
182. for (p = 0; p < 3; p++) {
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
^
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
libavcodec/indeo3.c:183:9:
181. /* allocate frame buffers */
182. for (p = 0; p < 3; p++) {
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
^
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
libavcodec/indeo3.c:184:34: Condition is true
182. for (p = 0; p < 3; p++) {
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
^
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
186.
libavcodec/indeo3.c:184:33:
182. for (p = 0; p < 3; p++) {
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
^
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
186.
libavcodec/indeo3.c:184:9:
182. for (p = 0; p < 3; p++) {
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
^
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
186.
libavcodec/indeo3.c:185:34: Condition is true
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
^
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
libavcodec/indeo3.c:185:33:
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
^
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
libavcodec/indeo3.c:185:9:
183. ctx->planes[p].pitch = !p ? luma_pitch : chroma_pitch;
184. ctx->planes[p].width = !p ? luma_width : chroma_width;
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
^
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
libavcodec/indeo3.c:187:48: Condition is true
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
^
188. ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
189.
libavcodec/indeo3.c:187:47:
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
^
188. ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
189.
libavcodec/indeo3.c:187:9:
185. ctx->planes[p].height = !p ? luma_height : chroma_height;
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
^
188. ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
189.
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/indeo3.c:188:48: Condition is true
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
188. ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
^
189.
190. /* fill the INTRA prediction lines with the middle pixel value = 64 */
libavcodec/indeo3.c:188:47:
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
188. ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
^
189.
190. /* fill the INTRA prediction lines with the middle pixel value = 64 */
libavcodec/indeo3.c:188:9:
186.
187. ctx->planes[p].buffers[0] = av_malloc(!p ? luma_size : chroma_size);
188. ctx->planes[p].buffers[1] = av_malloc(!p ? luma_size : chroma_size);
^
189.
190. /* fill the INTRA prediction lines with the middle pixel value = 64 */
libavutil/mem.c:64:1: start of procedure av_malloc()
62. linker will do it automatically. */
63.
64. void *av_malloc(size_t size)
^
65. {
66. void *ptr = NULL;
libavutil/mem.c:66:5:
64. void *av_malloc(size_t size)
65. {
66. void *ptr = NULL;
^
67. #if CONFIG_MEMALIGN_HACK
68. long diff;
libavutil/mem.c:72:8: Taking true branch
70.
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
^
73. return NULL;
74.
libavutil/mem.c:73:9:
71. /* let's disallow possible ambiguous cases */
72. if(size > (INT_MAX-32) )
73. return NULL;
^
74.
75. #if CONFIG_MEMALIGN_HACK
libavutil/mem.c:115:1: return from a call to av_malloc
113. #endif
114. return ptr;
115. }
^
116.
117. void *av_realloc(void *ptr, size_t size)
libavcodec/indeo3.c:191:9:
189.
190. /* fill the INTRA prediction lines with the middle pixel value = 64 */
191. memset(ctx->planes[p].buffers[0], 0x40, ctx->planes[p].pitch);
^
192. memset(ctx->planes[p].buffers[1], 0x40, ctx->planes[p].pitch);
193.
libavcodec/indeo3.c:192:9:
190. /* fill the INTRA prediction lines with the middle pixel value = 64 */
191. memset(ctx->planes[p].buffers[0], 0x40, ctx->planes[p].pitch);
192. memset(ctx->planes[p].buffers[1], 0x40, ctx->planes[p].pitch);
^
193.
194. /* set buffer pointers = buf_ptr + pitch and thus skip the INTRA prediction line */
|
https://github.com/libav/libav/blob/75146b8828b8393807835942091d2d4a4bf9e2b1/libavcodec/indeo3.c/#L192
|
d2a_code_trace_data_45725
|
int MAIN(int argc, char **argv)
{
ENGINE *e = NULL;
char *key=NULL,*passargin=NULL;
int free_key = 0;
int total=0;
int total_done=0;
int badops=0;
int ret=1;
int email_dn=1;
int req=0;
int verbose=0;
int gencrl=0;
int dorevoke=0;
int doupdatedb=0;
long crldays=0;
long crlhours=0;
long errorline= -1;
char *configfile=NULL;
char *md=NULL;
char *policy=NULL;
char *keyfile=NULL;
char *certfile=NULL;
int keyform=FORMAT_PEM;
char *infile=NULL;
char *spkac_file=NULL;
char *ss_cert_file=NULL;
char *ser_status=NULL;
EVP_PKEY *pkey=NULL;
int output_der = 0;
char *outfile=NULL;
char *outdir=NULL;
char *serialfile=NULL;
char *extensions=NULL;
char *extfile=NULL;
char *subj=NULL;
char *tmp_email_dn=NULL;
char *crl_ext=NULL;
int rev_type = REV_NONE;
char *rev_arg = NULL;
BIGNUM *serial=NULL;
char *startdate=NULL;
char *enddate=NULL;
long days=0;
int batch=0;
int notext=0;
unsigned long nameopt = 0, certopt = 0;
int default_op = 1;
int ext_copy = EXT_COPY_NONE;
X509 *x509=NULL;
X509 *x=NULL;
BIO *in=NULL,*out=NULL,*Sout=NULL,*Cout=NULL;
char *dbfile=NULL;
TXT_DB *db=NULL;
X509_CRL *crl=NULL;
X509_REVOKED *r=NULL;
ASN1_TIME *tmptm;
ASN1_INTEGER *tmpser;
char **pp,*p,*f;
int i,j;
long l;
const EVP_MD *dgst=NULL;
STACK_OF(CONF_VALUE) *attribs=NULL;
STACK_OF(X509) *cert_sk=NULL;
#undef BSIZE
#define BSIZE 256
MS_STATIC char buf[3][BSIZE];
char *randfile=NULL;
char *engine = NULL;
#ifdef EFENCE
EF_PROTECT_FREE=1;
EF_PROTECT_BELOW=1;
EF_ALIGNMENT=0;
#endif
apps_startup();
conf = NULL;
key = NULL;
section = NULL;
preserve=0;
msie_hack=0;
if (bio_err == NULL)
if ((bio_err=BIO_new(BIO_s_file())) != NULL)
BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);
argc--;
argv++;
while (argc >= 1)
{
if (strcmp(*argv,"-verbose") == 0)
verbose=1;
else if (strcmp(*argv,"-config") == 0)
{
if (--argc < 1) goto bad;
configfile= *(++argv);
}
else if (strcmp(*argv,"-name") == 0)
{
if (--argc < 1) goto bad;
section= *(++argv);
}
else if (strcmp(*argv,"-subj") == 0)
{
if (--argc < 1) goto bad;
subj= *(++argv);
}
else if (strcmp(*argv,"-startdate") == 0)
{
if (--argc < 1) goto bad;
startdate= *(++argv);
}
else if (strcmp(*argv,"-enddate") == 0)
{
if (--argc < 1) goto bad;
enddate= *(++argv);
}
else if (strcmp(*argv,"-days") == 0)
{
if (--argc < 1) goto bad;
days=atoi(*(++argv));
}
else if (strcmp(*argv,"-md") == 0)
{
if (--argc < 1) goto bad;
md= *(++argv);
}
else if (strcmp(*argv,"-policy") == 0)
{
if (--argc < 1) goto bad;
policy= *(++argv);
}
else if (strcmp(*argv,"-keyfile") == 0)
{
if (--argc < 1) goto bad;
keyfile= *(++argv);
}
else if (strcmp(*argv,"-keyform") == 0)
{
if (--argc < 1) goto bad;
keyform=str2fmt(*(++argv));
}
else if (strcmp(*argv,"-passin") == 0)
{
if (--argc < 1) goto bad;
passargin= *(++argv);
}
else if (strcmp(*argv,"-key") == 0)
{
if (--argc < 1) goto bad;
key= *(++argv);
}
else if (strcmp(*argv,"-cert") == 0)
{
if (--argc < 1) goto bad;
certfile= *(++argv);
}
else if (strcmp(*argv,"-in") == 0)
{
if (--argc < 1) goto bad;
infile= *(++argv);
req=1;
}
else if (strcmp(*argv,"-out") == 0)
{
if (--argc < 1) goto bad;
outfile= *(++argv);
}
else if (strcmp(*argv,"-outdir") == 0)
{
if (--argc < 1) goto bad;
outdir= *(++argv);
}
else if (strcmp(*argv,"-notext") == 0)
notext=1;
else if (strcmp(*argv,"-batch") == 0)
batch=1;
else if (strcmp(*argv,"-preserveDN") == 0)
preserve=1;
else if (strcmp(*argv,"-noemailDN") == 0)
email_dn=0;
else if (strcmp(*argv,"-gencrl") == 0)
gencrl=1;
else if (strcmp(*argv,"-msie_hack") == 0)
msie_hack=1;
else if (strcmp(*argv,"-crldays") == 0)
{
if (--argc < 1) goto bad;
crldays= atol(*(++argv));
}
else if (strcmp(*argv,"-crlhours") == 0)
{
if (--argc < 1) goto bad;
crlhours= atol(*(++argv));
}
else if (strcmp(*argv,"-infiles") == 0)
{
argc--;
argv++;
req=1;
break;
}
else if (strcmp(*argv, "-ss_cert") == 0)
{
if (--argc < 1) goto bad;
ss_cert_file = *(++argv);
req=1;
}
else if (strcmp(*argv, "-spkac") == 0)
{
if (--argc < 1) goto bad;
spkac_file = *(++argv);
req=1;
}
else if (strcmp(*argv,"-revoke") == 0)
{
if (--argc < 1) goto bad;
infile= *(++argv);
dorevoke=1;
}
else if (strcmp(*argv,"-extensions") == 0)
{
if (--argc < 1) goto bad;
extensions= *(++argv);
}
else if (strcmp(*argv,"-extfile") == 0)
{
if (--argc < 1) goto bad;
extfile= *(++argv);
}
else if (strcmp(*argv,"-status") == 0)
{
if (--argc < 1) goto bad;
ser_status= *(++argv);
}
else if (strcmp(*argv,"-updatedb") == 0)
{
doupdatedb=1;
}
else if (strcmp(*argv,"-crlexts") == 0)
{
if (--argc < 1) goto bad;
crl_ext= *(++argv);
}
else if (strcmp(*argv,"-crl_reason") == 0)
{
if (--argc < 1) goto bad;
rev_arg = *(++argv);
rev_type = REV_CRL_REASON;
}
else if (strcmp(*argv,"-crl_hold") == 0)
{
if (--argc < 1) goto bad;
rev_arg = *(++argv);
rev_type = REV_HOLD;
}
else if (strcmp(*argv,"-crl_compromise") == 0)
{
if (--argc < 1) goto bad;
rev_arg = *(++argv);
rev_type = REV_KEY_COMPROMISE;
}
else if (strcmp(*argv,"-crl_CA_compromise") == 0)
{
if (--argc < 1) goto bad;
rev_arg = *(++argv);
rev_type = REV_CA_COMPROMISE;
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else
{
bad:
BIO_printf(bio_err,"unknown option %s\n",*argv);
badops=1;
break;
}
argc--;
argv++;
}
if (badops)
{
for (pp=ca_usage; (*pp != NULL); pp++)
BIO_printf(bio_err,"%s",*pp);
goto err;
}
ERR_load_crypto_strings();
e = setup_engine(bio_err, engine, 0);
if (configfile == NULL) configfile = getenv("OPENSSL_CONF");
if (configfile == NULL) configfile = getenv("SSLEAY_CONF");
if (configfile == NULL)
{
#ifdef OPENSSL_SYS_VMS
strncpy(buf[0],X509_get_default_cert_area(),
sizeof(buf[0])-1-sizeof(CONFIG_FILE));
#else
strncpy(buf[0],X509_get_default_cert_area(),
sizeof(buf[0])-2-sizeof(CONFIG_FILE));
buf[0][sizeof(buf[0])-2-sizeof(CONFIG_FILE)]='\0';
strcat(buf[0],"/");
#endif
strcat(buf[0],CONFIG_FILE);
configfile=buf[0];
}
BIO_printf(bio_err,"Using configuration from %s\n",configfile);
conf = NCONF_new(NULL);
if (NCONF_load(conf,configfile,&errorline) <= 0)
{
if (errorline <= 0)
BIO_printf(bio_err,"error loading the config file '%s'\n",
configfile);
else
BIO_printf(bio_err,"error on line %ld of config file '%s'\n"
,errorline,configfile);
goto err;
}
if (!load_config(bio_err, conf))
goto err;
if (section == NULL)
{
section=NCONF_get_string(conf,BASE_SECTION,ENV_DEFAULT_CA);
if (section == NULL)
{
lookup_fail(BASE_SECTION,ENV_DEFAULT_CA);
goto err;
}
}
if (conf != NULL)
{
p=NCONF_get_string(conf,NULL,"oid_file");
if (p == NULL)
ERR_clear_error();
if (p != NULL)
{
BIO *oid_bio;
oid_bio=BIO_new_file(p,"r");
if (oid_bio == NULL)
{
ERR_clear_error();
}
else
{
OBJ_create_objects(oid_bio);
BIO_free(oid_bio);
}
}
if (!add_oid_section(bio_err,conf))
{
ERR_print_errors(bio_err);
goto err;
}
}
randfile = NCONF_get_string(conf, BASE_SECTION, "RANDFILE");
if (randfile == NULL)
ERR_clear_error();
app_RAND_load_file(randfile, bio_err, 0);
in=BIO_new(BIO_s_file());
out=BIO_new(BIO_s_file());
Sout=BIO_new(BIO_s_file());
Cout=BIO_new(BIO_s_file());
if ((in == NULL) || (out == NULL) || (Sout == NULL) || (Cout == NULL))
{
ERR_print_errors(bio_err);
goto err;
}
if (ser_status)
{
if ((dbfile=NCONF_get_string(conf,section,ENV_DATABASE)) == NULL)
{
lookup_fail(section,ENV_DATABASE);
goto err;
}
if (BIO_read_filename(in,dbfile) <= 0)
{
perror(dbfile);
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
goto err;
}
db=TXT_DB_read(in,DB_NUMBER);
if (db == NULL) goto err;
if (!make_serial_index(db))
goto err;
if (get_certificate_status(ser_status,db) != 1)
BIO_printf(bio_err,"Error verifying serial %s!\n",
ser_status);
goto err;
}
if ((keyfile == NULL) && ((keyfile=NCONF_get_string(conf,
section,ENV_PRIVATE_KEY)) == NULL))
{
lookup_fail(section,ENV_PRIVATE_KEY);
goto err;
}
if (!key)
{
free_key = 1;
if (!app_passwd(bio_err, passargin, NULL, &key, NULL))
{
BIO_printf(bio_err,"Error getting password\n");
goto err;
}
}
pkey = load_key(bio_err, keyfile, keyform, key, e,
"CA private key");
if (key) memset(key,0,strlen(key));
if (pkey == NULL)
{
goto err;
}
if ((certfile == NULL) && ((certfile=NCONF_get_string(conf,
section,ENV_CERTIFICATE)) == NULL))
{
lookup_fail(section,ENV_CERTIFICATE);
goto err;
}
x509=load_cert(bio_err, certfile, FORMAT_PEM, NULL, e,
"CA certificate");
if (x509 == NULL)
goto err;
if (!X509_check_private_key(x509,pkey))
{
BIO_printf(bio_err,"CA certificate and CA private key do not match\n");
goto err;
}
f=NCONF_get_string(conf,BASE_SECTION,ENV_PRESERVE);
if (f == NULL)
ERR_clear_error();
if ((f != NULL) && ((*f == 'y') || (*f == 'Y')))
preserve=1;
f=NCONF_get_string(conf,BASE_SECTION,ENV_MSIE_HACK);
if (f == NULL)
ERR_clear_error();
if ((f != NULL) && ((*f == 'y') || (*f == 'Y')))
msie_hack=1;
f=NCONF_get_string(conf,section,ENV_NAMEOPT);
if (f)
{
if (!set_name_ex(&nameopt, f))
{
BIO_printf(bio_err, "Invalid name options: \"%s\"\n", f);
goto err;
}
default_op = 0;
}
else
ERR_clear_error();
f=NCONF_get_string(conf,section,ENV_CERTOPT);
if (f)
{
if (!set_cert_ex(&certopt, f))
{
BIO_printf(bio_err, "Invalid certificate options: \"%s\"\n", f);
goto err;
}
default_op = 0;
}
else
ERR_clear_error();
f=NCONF_get_string(conf,section,ENV_EXTCOPY);
if (f)
{
if (!set_ext_copy(&ext_copy, f))
{
BIO_printf(bio_err, "Invalid extension copy option: \"%s\"\n", f);
goto err;
}
}
else
ERR_clear_error();
if ((outdir == NULL) && (req))
{
struct stat sb;
if ((outdir=NCONF_get_string(conf,section,ENV_NEW_CERTS_DIR))
== NULL)
{
BIO_printf(bio_err,"there needs to be defined a directory for new certificate to be placed in\n");
goto err;
}
#ifndef OPENSSL_SYS_VMS
if (access(outdir,R_OK|W_OK|X_OK) != 0)
{
BIO_printf(bio_err,"I am unable to access the %s directory\n",outdir);
perror(outdir);
goto err;
}
if (stat(outdir,&sb) != 0)
{
BIO_printf(bio_err,"unable to stat(%s)\n",outdir);
perror(outdir);
goto err;
}
#ifdef S_IFDIR
if (!(sb.st_mode & S_IFDIR))
{
BIO_printf(bio_err,"%s need to be a directory\n",outdir);
perror(outdir);
goto err;
}
#endif
#endif
}
if ((dbfile=NCONF_get_string(conf,section,ENV_DATABASE)) == NULL)
{
lookup_fail(section,ENV_DATABASE);
goto err;
}
if (BIO_read_filename(in,dbfile) <= 0)
{
perror(dbfile);
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
goto err;
}
db=TXT_DB_read(in,DB_NUMBER);
if (db == NULL) goto err;
for (i=0; i<sk_num(db->data); i++)
{
pp=(char **)sk_value(db->data,i);
if ((pp[DB_type][0] != DB_TYPE_REV) &&
(pp[DB_rev_date][0] != '\0'))
{
BIO_printf(bio_err,"entry %d: not revoked yet, but has a revocation date\n",i+1);
goto err;
}
if ((pp[DB_type][0] == DB_TYPE_REV) &&
!make_revoked(NULL, pp[DB_rev_date]))
{
BIO_printf(bio_err," in entry %d\n", i+1);
goto err;
}
if (!check_time_format(pp[DB_exp_date]))
{
BIO_printf(bio_err,"entry %d: invalid expiry date\n",i+1);
goto err;
}
p=pp[DB_serial];
j=strlen(p);
if (*p == '-')
{
p++;
j--;
}
if ((j&1) || (j < 2))
{
BIO_printf(bio_err,"entry %d: bad serial number length (%d)\n",i+1,j);
goto err;
}
while (*p)
{
if (!( ((*p >= '0') && (*p <= '9')) ||
((*p >= 'A') && (*p <= 'F')) ||
((*p >= 'a') && (*p <= 'f'))) )
{
BIO_printf(bio_err,"entry %d: bad serial number characters, char pos %ld, char is '%c'\n",i+1,(long)(p-pp[DB_serial]),*p);
goto err;
}
p++;
}
}
if (verbose)
{
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
out = BIO_push(tmpbio, out);
}
#endif
TXT_DB_write(out,db);
BIO_printf(bio_err,"%d entries loaded from the database\n",
db->data->num);
BIO_printf(bio_err,"generating index\n");
}
if (!make_serial_index(db))
goto err;
if (!TXT_DB_create_index(db, DB_name, index_name_qual,
LHASH_HASH_FN(index_name_hash),
LHASH_COMP_FN(index_name_cmp)))
{
BIO_printf(bio_err,"error creating name index:(%ld,%ld,%ld)\n",
db->error,db->arg1,db->arg2);
goto err;
}
if (doupdatedb)
{
if (verbose)
BIO_printf(bio_err, "Updating %s ...\n",
dbfile);
i = do_updatedb(db);
if (i == -1)
{
BIO_printf(bio_err,"Malloc failure\n");
goto err;
}
else if (i == 0)
{
if (verbose) BIO_printf(bio_err,
"No entries found to mark expired\n");
}
else
{
out = BIO_new(BIO_s_file());
if (out == NULL)
{
ERR_print_errors(bio_err);
goto err;
}
#ifndef OPENSSL_SYS_VMS
j = BIO_snprintf(buf[0], sizeof buf[0], "%s.new", dbfile);
#else
j = BIO_snprintf(buf[0], sizeof buf[0], "%s-new", dbfile);
#endif
if (j < 0 || j >= sizeof buf[0])
{
BIO_printf(bio_err, "file name too long\n");
goto err;
}
if (BIO_write_filename(out,buf[0]) <= 0)
{
perror(dbfile);
BIO_printf(bio_err,"unable to open '%s'\n",
dbfile);
goto err;
}
j=TXT_DB_write(out,db);
if (j <= 0) goto err;
BIO_free(out);
out = NULL;
#ifndef OPENSSL_SYS_VMS
j = BIO_snprintf(buf[1], sizeof buf[1], "%s.old", dbfile);
#else
j = BIO_snprintf(buf[1], sizeof buf[1], "%s-old", dbfile);
#endif
if (j < 0 || j >= sizeof buf[1])
{
BIO_printf(bio_err, "file name too long\n");
goto err;
}
if (rename(dbfile,buf[1]) < 0)
{
BIO_printf(bio_err,
"unable to rename %s to %s\n",
dbfile, buf[1]);
perror("reason");
goto err;
}
if (rename(buf[0],dbfile) < 0)
{
BIO_printf(bio_err,
"unable to rename %s to %s\n",
buf[0],dbfile);
perror("reason");
rename(buf[1],dbfile);
goto err;
}
if (verbose) BIO_printf(bio_err,
"Done. %d entries marked as expired\n",i);
}
goto err;
}
if (extfile)
{
extconf = NCONF_new(NULL);
if (NCONF_load(extconf,extfile,&errorline) <= 0)
{
if (errorline <= 0)
BIO_printf(bio_err, "ERROR: loading the config file '%s'\n",
extfile);
else
BIO_printf(bio_err, "ERROR: on line %ld of config file '%s'\n",
errorline,extfile);
ret = 1;
goto err;
}
if (verbose)
BIO_printf(bio_err, "Succesfully loaded extensions file %s\n", extfile);
if (!extensions && !(extensions = NCONF_get_string(extconf, "default", "extensions")))
extensions = "default";
}
if (req || gencrl)
{
if (outfile != NULL)
{
if (BIO_write_filename(Sout,outfile) <= 0)
{
perror(outfile);
goto err;
}
}
else
{
BIO_set_fp(Sout,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
#ifdef OPENSSL_SYS_VMS
{
BIO *tmpbio = BIO_new(BIO_f_linebuffer());
Sout = BIO_push(tmpbio, Sout);
}
#endif
}
}
if (req)
{
if ((md == NULL) && ((md=NCONF_get_string(conf,
section,ENV_DEFAULT_MD)) == NULL))
{
lookup_fail(section,ENV_DEFAULT_MD);
goto err;
}
if ((email_dn == 1) && ((tmp_email_dn=NCONF_get_string(conf,
section,ENV_DEFAULT_EMAIL_DN)) != NULL ))
{
if(strcmp(tmp_email_dn,"no") == 0)
email_dn=0;
}
if ((dgst=EVP_get_digestbyname(md)) == NULL)
{
BIO_printf(bio_err,"%s is an unsupported message digest type\n",md);
goto err;
}
if (verbose)
BIO_printf(bio_err,"message digest is %s\n",
OBJ_nid2ln(dgst->type));
if ((policy == NULL) && ((policy=NCONF_get_string(conf,
section,ENV_POLICY)) == NULL))
{
lookup_fail(section,ENV_POLICY);
goto err;
}
if (verbose)
BIO_printf(bio_err,"policy is %s\n",policy);
if ((serialfile=NCONF_get_string(conf,section,ENV_SERIAL))
== NULL)
{
lookup_fail(section,ENV_SERIAL);
goto err;
}
if (!extconf)
{
if (!extensions)
{
extensions=NCONF_get_string(conf,section,
ENV_EXTENSIONS);
if (!extensions)
ERR_clear_error();
}
if (extensions)
{
X509V3_CTX ctx;
X509V3_set_ctx_test(&ctx);
X509V3_set_nconf(&ctx, conf);
if (!X509V3_EXT_add_nconf(conf, &ctx, extensions,
NULL))
{
BIO_printf(bio_err,
"Error Loading extension section %s\n",
extensions);
ret = 1;
goto err;
}
}
}
if (startdate == NULL)
{
startdate=NCONF_get_string(conf,section,
ENV_DEFAULT_STARTDATE);
if (startdate == NULL)
ERR_clear_error();
}
if (startdate && !ASN1_UTCTIME_set_string(NULL,startdate))
{
BIO_printf(bio_err,"start date is invalid, it should be YYMMDDHHMMSSZ\n");
goto err;
}
if (startdate == NULL) startdate="today";
if (enddate == NULL)
{
enddate=NCONF_get_string(conf,section,
ENV_DEFAULT_ENDDATE);
if (enddate == NULL)
ERR_clear_error();
}
if (enddate && !ASN1_UTCTIME_set_string(NULL,enddate))
{
BIO_printf(bio_err,"end date is invalid, it should be YYMMDDHHMMSSZ\n");
goto err;
}
if (days == 0)
{
if(!NCONF_get_number(conf,section, ENV_DEFAULT_DAYS, &days))
days = 0;
}
if (!enddate && (days == 0))
{
BIO_printf(bio_err,"cannot lookup how many days to certify for\n");
goto err;
}
if ((serial=load_serial(serialfile)) == NULL)
{
BIO_printf(bio_err,"error while loading serial number\n");
goto err;
}
if (verbose)
{
if ((f=BN_bn2hex(serial)) == NULL) goto err;
BIO_printf(bio_err,"next serial number is %s\n",f);
OPENSSL_free(f);
}
if ((attribs=NCONF_get_section(conf,policy)) == NULL)
{
BIO_printf(bio_err,"unable to find 'section' for %s\n",policy);
goto err;
}
if ((cert_sk=sk_X509_new_null()) == NULL)
{
BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
if (spkac_file != NULL)
{
total++;
j=certify_spkac(&x,spkac_file,pkey,x509,dgst,attribs,db,
serial,subj,email_dn,startdate,enddate,days,extensions,
conf,verbose,certopt,nameopt,default_op,ext_copy);
if (j < 0) goto err;
if (j > 0)
{
total_done++;
BIO_printf(bio_err,"\n");
if (!BN_add_word(serial,1)) goto err;
if (!sk_X509_push(cert_sk,x))
{
BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
if (outfile)
{
output_der = 1;
batch = 1;
}
}
}
if (ss_cert_file != NULL)
{
total++;
j=certify_cert(&x,ss_cert_file,pkey,x509,dgst,attribs,
db,serial,subj,email_dn,startdate,enddate,days,batch,
extensions,conf,verbose, certopt, nameopt,
default_op, ext_copy, e);
if (j < 0) goto err;
if (j > 0)
{
total_done++;
BIO_printf(bio_err,"\n");
if (!BN_add_word(serial,1)) goto err;
if (!sk_X509_push(cert_sk,x))
{
BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
}
}
if (infile != NULL)
{
total++;
j=certify(&x,infile,pkey,x509,dgst,attribs,db,
serial,subj,email_dn,startdate,enddate,days,batch,
extensions,conf,verbose, certopt, nameopt,
default_op, ext_copy);
if (j < 0) goto err;
if (j > 0)
{
total_done++;
BIO_printf(bio_err,"\n");
if (!BN_add_word(serial,1)) goto err;
if (!sk_X509_push(cert_sk,x))
{
BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
}
}
for (i=0; i<argc; i++)
{
total++;
j=certify(&x,argv[i],pkey,x509,dgst,attribs,db,
serial,subj,email_dn,startdate,enddate,days,batch,
extensions,conf,verbose, certopt, nameopt,
default_op, ext_copy);
if (j < 0) goto err;
if (j > 0)
{
total_done++;
BIO_printf(bio_err,"\n");
if (!BN_add_word(serial,1)) goto err;
if (!sk_X509_push(cert_sk,x))
{
BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
}
}
if (sk_X509_num(cert_sk) > 0)
{
if (!batch)
{
BIO_printf(bio_err,"\n%d out of %d certificate requests certified, commit? [y/n]",total_done,total);
(void)BIO_flush(bio_err);
buf[0][0]='\0';
fgets(buf[0],10,stdin);
if ((buf[0][0] != 'y') && (buf[0][0] != 'Y'))
{
BIO_printf(bio_err,"CERTIFICATION CANCELED\n");
ret=0;
goto err;
}
}
BIO_printf(bio_err,"Write out database with %d new entries\n",sk_X509_num(cert_sk));
strncpy(buf[0],serialfile,BSIZE-4);
buf[0][BSIZE-4]='\0';
#ifdef OPENSSL_SYS_VMS
strcat(buf[0],"-new");
#else
strcat(buf[0],".new");
#endif
if (!save_serial(buf[0],serial)) goto err;
strncpy(buf[1],dbfile,BSIZE-4);
buf[1][BSIZE-4]='\0';
#ifdef OPENSSL_SYS_VMS
strcat(buf[1],"-new");
#else
strcat(buf[1],".new");
#endif
if (BIO_write_filename(out,buf[1]) <= 0)
{
perror(dbfile);
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
goto err;
}
l=TXT_DB_write(out,db);
if (l <= 0) goto err;
}
if (verbose)
BIO_printf(bio_err,"writing new certificates\n");
for (i=0; i<sk_X509_num(cert_sk); i++)
{
int k;
unsigned char *n;
x=sk_X509_value(cert_sk,i);
j=x->cert_info->serialNumber->length;
p=(char *)x->cert_info->serialNumber->data;
strncpy(buf[2],outdir,BSIZE-(j*2)-6);
buf[2][BSIZE-(j*2)-6]='\0';
#ifndef OPENSSL_SYS_VMS
strcat(buf[2],"/");
#endif
n=(unsigned char *)&(buf[2][strlen(buf[2])]);
if (j > 0)
{
for (k=0; k<j; k++)
{
sprintf((char *)n,"%02X",(unsigned char)*(p++));
n+=2;
}
}
else
{
*(n++)='0';
*(n++)='0';
}
*(n++)='.'; *(n++)='p'; *(n++)='e'; *(n++)='m';
*n='\0';
if (verbose)
BIO_printf(bio_err,"writing %s\n",buf[2]);
if (BIO_write_filename(Cout,buf[2]) <= 0)
{
perror(buf[2]);
goto err;
}
write_new_certificate(Cout,x, 0, notext);
write_new_certificate(Sout,x, output_der, notext);
}
if (sk_X509_num(cert_sk))
{
strncpy(buf[2],serialfile,BSIZE-4);
buf[2][BSIZE-4]='\0';
#ifdef OPENSSL_SYS_VMS
strcat(buf[2],"-old");
#else
strcat(buf[2],".old");
#endif
BIO_free(in);
BIO_free_all(out);
in=NULL;
out=NULL;
if (rename(serialfile,buf[2]) < 0)
{
BIO_printf(bio_err,"unable to rename %s to %s\n",
serialfile,buf[2]);
perror("reason");
goto err;
}
if (rename(buf[0],serialfile) < 0)
{
BIO_printf(bio_err,"unable to rename %s to %s\n",
buf[0],serialfile);
perror("reason");
rename(buf[2],serialfile);
goto err;
}
strncpy(buf[2],dbfile,BSIZE-4);
buf[2][BSIZE-4]='\0';
#ifdef OPENSSL_SYS_VMS
strcat(buf[2],"-old");
#else
strcat(buf[2],".old");
#endif
if (rename(dbfile,buf[2]) < 0)
{
BIO_printf(bio_err,"unable to rename %s to %s\n",
dbfile,buf[2]);
perror("reason");
goto err;
}
if (rename(buf[1],dbfile) < 0)
{
BIO_printf(bio_err,"unable to rename %s to %s\n",
buf[1],dbfile);
perror("reason");
rename(buf[2],dbfile);
goto err;
}
BIO_printf(bio_err,"Data Base Updated\n");
}
}
if (gencrl)
{
int crl_v2 = 0;
if (!crl_ext)
{
crl_ext=NCONF_get_string(conf,section,ENV_CRLEXT);
if (!crl_ext)
ERR_clear_error();
}
if (crl_ext)
{
X509V3_CTX ctx;
X509V3_set_ctx_test(&ctx);
X509V3_set_nconf(&ctx, conf);
if (!X509V3_EXT_add_nconf(conf, &ctx, crl_ext, NULL))
{
BIO_printf(bio_err,
"Error Loading CRL extension section %s\n",
crl_ext);
ret = 1;
goto err;
}
}
if (!crldays && !crlhours)
{
if (!NCONF_get_number(conf,section,
ENV_DEFAULT_CRL_DAYS, &crldays))
crldays = 0;
if (!NCONF_get_number(conf,section,
ENV_DEFAULT_CRL_HOURS, &crlhours))
crlhours = 0;
}
if ((crldays == 0) && (crlhours == 0))
{
BIO_printf(bio_err,"cannot lookup how long until the next CRL is issuer\n");
goto err;
}
if (verbose) BIO_printf(bio_err,"making CRL\n");
if ((crl=X509_CRL_new()) == NULL) goto err;
if (!X509_CRL_set_issuer_name(crl, X509_get_issuer_name(x509))) goto err;
tmptm = ASN1_TIME_new();
if (!tmptm) goto err;
X509_gmtime_adj(tmptm,0);
X509_CRL_set_lastUpdate(crl, tmptm);
X509_gmtime_adj(tmptm,(crldays*24+crlhours)*60*60);
X509_CRL_set_nextUpdate(crl, tmptm);
ASN1_TIME_free(tmptm);
for (i=0; i<sk_num(db->data); i++)
{
pp=(char **)sk_value(db->data,i);
if (pp[DB_type][0] == DB_TYPE_REV)
{
if ((r=X509_REVOKED_new()) == NULL) goto err;
j = make_revoked(r, pp[DB_rev_date]);
if (!j) goto err;
if (j == 2) crl_v2 = 1;
if (!BN_hex2bn(&serial, pp[DB_serial]))
goto err;
tmpser = BN_to_ASN1_INTEGER(serial, NULL);
BN_free(serial);
serial = NULL;
if (!tmpser)
goto err;
X509_REVOKED_set_serialNumber(r, tmpser);
ASN1_INTEGER_free(tmpser);
X509_CRL_add0_revoked(crl,r);
}
}
X509_CRL_sort(crl);
if (verbose) BIO_printf(bio_err,"signing CRL\n");
if (md != NULL)
{
if ((dgst=EVP_get_digestbyname(md)) == NULL)
{
BIO_printf(bio_err,"%s is an unsupported message digest type\n",md);
goto err;
}
}
else
{
#ifndef OPENSSL_NO_DSA
if (pkey->type == EVP_PKEY_DSA)
dgst=EVP_dss1();
else
#endif
#ifndef OPENSSL_NO_ECDSA
if (pkey->type == EVP_PKEY_ECDSA)
dgst=EVP_ecdsa();
else
#endif
dgst=EVP_md5();
}
if (crl_ext)
{
X509V3_CTX crlctx;
X509V3_set_ctx(&crlctx, x509, NULL, NULL, crl, 0);
X509V3_set_nconf(&crlctx, conf);
if (!X509V3_EXT_CRL_add_nconf(conf, &crlctx,
crl_ext, crl)) goto err;
}
if (crl_ext || crl_v2)
{
if (!X509_CRL_set_version(crl, 1))
goto err;
}
if (!X509_CRL_sign(crl,pkey,dgst)) goto err;
PEM_write_bio_X509_CRL(Sout,crl);
}
if (dorevoke)
{
if (infile == NULL)
{
BIO_printf(bio_err,"no input files\n");
goto err;
}
else
{
X509 *revcert;
revcert=load_cert(bio_err, infile, FORMAT_PEM,
NULL, e, infile);
if (revcert == NULL)
goto err;
j=do_revoke(revcert,db, rev_type, rev_arg);
if (j <= 0) goto err;
X509_free(revcert);
strncpy(buf[0],dbfile,BSIZE-4);
buf[0][BSIZE-4]='\0';
#ifndef OPENSSL_SYS_VMS
strcat(buf[0],".new");
#else
strcat(buf[0],"-new");
#endif
if (BIO_write_filename(out,buf[0]) <= 0)
{
perror(dbfile);
BIO_printf(bio_err,"unable to open '%s'\n",dbfile);
goto err;
}
j=TXT_DB_write(out,db);
if (j <= 0) goto err;
strncpy(buf[1],dbfile,BSIZE-4);
buf[1][BSIZE-4]='\0';
#ifndef OPENSSL_SYS_VMS
strcat(buf[1],".old");
#else
strcat(buf[1],"-old");
#endif
if (rename(dbfile,buf[1]) < 0)
{
BIO_printf(bio_err,"unable to rename %s to %s\n", dbfile, buf[1]);
perror("reason");
goto err;
}
if (rename(buf[0],dbfile) < 0)
{
BIO_printf(bio_err,"unable to rename %s to %s\n", buf[0],dbfile);
perror("reason");
rename(buf[1],dbfile);
goto err;
}
BIO_printf(bio_err,"Data Base Updated\n");
}
}
ret=0;
err:
BIO_free_all(Cout);
BIO_free_all(Sout);
BIO_free_all(out);
BIO_free_all(in);
sk_X509_pop_free(cert_sk,X509_free);
if (ret) ERR_print_errors(bio_err);
app_RAND_write_file(randfile, bio_err);
if (free_key)
OPENSSL_free(key);
BN_free(serial);
TXT_DB_free(db);
EVP_PKEY_free(pkey);
X509_free(x509);
X509_CRL_free(crl);
NCONF_free(conf);
OBJ_cleanup();
apps_shutdown();
EXIT(ret);
}
apps/ca.c:577: error: BUFFER_OVERRUN_L1
Offset: 26 Size: 3.
Showing all 6 steps of the trace
apps/ca.c:572:18: <Offset trace>
570. sizeof(buf[0])-1-sizeof(CONFIG_FILE));
571. #else
572. strncpy(buf[0],X509_get_default_cert_area(),
^
573. sizeof(buf[0])-2-sizeof(CONFIG_FILE));
574. buf[0][sizeof(buf[0])-2-sizeof(CONFIG_FILE)]='\0';
apps/ca.c:572:18: Call
570. sizeof(buf[0])-1-sizeof(CONFIG_FILE));
571. #else
572. strncpy(buf[0],X509_get_default_cert_area(),
^
573. sizeof(buf[0])-2-sizeof(CONFIG_FILE));
574. buf[0][sizeof(buf[0])-2-sizeof(CONFIG_FILE)]='\0';
crypto/x509/x509_def.c:68:4: Array declaration
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/ca.c:264:1: <Length trace>
262. int MAIN(int, char **);
263.
264. > int MAIN(int argc, char **argv)
265. {
266. ENGINE *e = NULL;
apps/ca.c:264:1: Array declaration
262. int MAIN(int, char **);
263.
264. > int MAIN(int argc, char **argv)
265. {
266. ENGINE *e = NULL;
apps/ca.c:577:3: Array access: Offset: 26 Size: 3
575. strcat(buf[0],"/");
576. #endif
577. strcat(buf[0],CONFIG_FILE);
^
578. configfile=buf[0];
579. }
|
https://github.com/openssl/openssl/blob/4bf4bc784f12bcdc3a3e772f85f6d33f5eccdab3/apps/ca.c/#L577
|
d2a_code_trace_data_45726
|
int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
{
int i, j, bits, ret = 0, wstart, wend, window, wvalue;
int start = 1;
BIGNUM *d, *r;
const BIGNUM *aa;
BIGNUM *val[TABLE_SIZE];
BN_MONT_CTX *mont = NULL;
if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0) {
return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
}
bn_check_top(a);
bn_check_top(p);
bn_check_top(m);
if (!BN_is_odd(m)) {
BNerr(BN_F_BN_MOD_EXP_MONT, BN_R_CALLED_WITH_EVEN_MODULUS);
return (0);
}
bits = BN_num_bits(p);
if (bits == 0) {
if (BN_is_one(m)) {
ret = 1;
BN_zero(rr);
} else {
ret = BN_one(rr);
}
return ret;
}
BN_CTX_start(ctx);
d = BN_CTX_get(ctx);
r = BN_CTX_get(ctx);
val[0] = BN_CTX_get(ctx);
if (!d || !r || !val[0])
goto err;
if (in_mont != NULL)
mont = in_mont;
else {
if ((mont = BN_MONT_CTX_new()) == NULL)
goto err;
if (!BN_MONT_CTX_set(mont, m, ctx))
goto err;
}
if (a->neg || BN_ucmp(a, m) >= 0) {
if (!BN_nnmod(val[0], a, m, ctx))
goto err;
aa = val[0];
} else
aa = a;
if (BN_is_zero(aa)) {
BN_zero(rr);
ret = 1;
goto err;
}
if (!BN_to_montgomery(val[0], aa, mont, ctx))
goto err;
window = BN_window_bits_for_exponent_size(bits);
if (window > 1) {
if (!BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx))
goto err;
j = 1 << (window - 1);
for (i = 1; i < j; i++) {
if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
!BN_mod_mul_montgomery(val[i], val[i - 1], d, mont, ctx))
goto err;
}
}
start = 1;
wvalue = 0;
wstart = bits - 1;
wend = 0;
#if 1
j = m->top;
if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
if (bn_wexpand(r, j) == NULL)
goto err;
r->d[0] = (0 - m->d[0]) & BN_MASK2;
for (i = 1; i < j; i++)
r->d[i] = (~m->d[i]) & BN_MASK2;
r->top = j;
bn_correct_top(r);
} else
#endif
if (!BN_to_montgomery(r, BN_value_one(), mont, ctx))
goto err;
for (;;) {
if (BN_is_bit_set(p, wstart) == 0) {
if (!start) {
if (!BN_mod_mul_montgomery(r, r, r, mont, ctx))
goto err;
}
if (wstart == 0)
break;
wstart--;
continue;
}
j = wstart;
wvalue = 1;
wend = 0;
for (i = 1; i < window; i++) {
if (wstart - i < 0)
break;
if (BN_is_bit_set(p, wstart - i)) {
wvalue <<= (i - wend);
wvalue |= 1;
wend = i;
}
}
j = wend + 1;
if (!start)
for (i = 0; i < j; i++) {
if (!BN_mod_mul_montgomery(r, r, r, mont, ctx))
goto err;
}
if (!BN_mod_mul_montgomery(r, r, val[wvalue >> 1], mont, ctx))
goto err;
wstart -= wend + 1;
wvalue = 0;
start = 0;
if (wstart < 0)
break;
}
#if defined(SPARC_T4_MONT)
if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
j = mont->N.top;
val[0]->d[0] = 1;
for (i = 1; i < j; i++)
val[0]->d[i] = 0;
val[0]->top = j;
if (!BN_mod_mul_montgomery(rr, r, val[0], mont, ctx))
goto err;
} else
#endif
if (!BN_from_montgomery(rr, r, mont, ctx))
goto err;
ret = 1;
err:
if (in_mont == NULL)
BN_MONT_CTX_free(mont);
BN_CTX_end(ctx);
bn_check_top(rr);
return (ret);
}
apps/s_client.c:241: error: BUFFER_OVERRUN_L3
Offset: [1, +oo] Size: [0, 8388607] by call to `BN_is_prime_ex`.
Showing all 21 steps of the trace
apps/s_client.c:238:9: Call
236. int ret =
237. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&
238. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 &&
^
239. p != NULL && BN_rshift1(p, N) &&
240. /* p = (N-1)/2 */
crypto/bn/bn_prime.c:150:12: Call
148. BN_GENCB *cb)
149. {
150. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
^
151. }
152.
crypto/bn/bn_prime.c:227:13: Call
225. /* now 1 <= check < a */
226.
227. j = witness(check, a, A1, A1_odd, k, ctx, mont);
^
228. if (j == -1)
229. goto err;
crypto/bn/bn_prime.c:253:10: Call
251. BN_MONT_CTX *mont)
252. {
253. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
^
254. return -1;
255. if (BN_is_one(w))
crypto/bn/bn_exp.c:350:14: Call
348.
349. if (a->neg || BN_ucmp(a, m) >= 0) {
350. if (!BN_nnmod(val[0], a, m, ctx))
^
351. goto err;
352. aa = val[0];
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 `*dv->d`
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. {
apps/s_client.c:239:22: Call
237. g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&
238. BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 &&
239. p != NULL && BN_rshift1(p, N) &&
^
240. /* p = (N-1)/2 */
241. BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 &&
crypto/bn/bn_shift.c:46:1: Parameter `*r->d`
44. }
45.
46. > int BN_rshift1(BIGNUM *r, const BIGNUM *a)
47. {
48. BN_ULONG *ap, *rp, t, c;
apps/s_client.c:241:9: Call
239. p != NULL && BN_rshift1(p, N) &&
240. /* p = (N-1)/2 */
241. BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) == 1 &&
^
242. r != NULL &&
243. /* verify g^((N-1)/2) == -1 (mod N) */
crypto/bn/bn_prime.c:147:1: Parameter `*a->d`
145. }
146.
147. > int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
148. BN_GENCB *cb)
149. {
crypto/bn/bn_prime.c:150:12: Call
148. BN_GENCB *cb)
149. {
150. return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
^
151. }
152.
crypto/bn/bn_prime.c:153:1: Parameter `*a->d`
151. }
152.
153. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
154. int do_trial_division, BN_GENCB *cb)
155. {
crypto/bn/bn_prime.c:227:13: Call
225. /* now 1 <= check < a */
226.
227. j = witness(check, a, A1, A1_odd, k, ctx, mont);
^
228. if (j == -1)
229. goto err;
crypto/bn/bn_prime.c:249:1: Parameter `*a->d`
247. }
248.
249. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,
250. const BIGNUM *a1_odd, int k, BN_CTX *ctx,
251. BN_MONT_CTX *mont)
crypto/bn/bn_prime.c:253:10: Call
251. BN_MONT_CTX *mont)
252. {
253. if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
^
254. return -1;
255. if (BN_is_one(w))
crypto/bn/bn_exp.c:389:14: <Offset trace>
387. /* 2^(top*BN_BITS2) - m */
388. r->d[0] = (0 - m->d[0]) & BN_MASK2;
389. for (i = 1; i < j; i++)
^
390. r->d[i] = (~m->d[i]) & BN_MASK2;
391. r->top = j;
crypto/bn/bn_exp.c:389:14: Assignment
387. /* 2^(top*BN_BITS2) - m */
388. r->d[0] = (0 - m->d[0]) & BN_MASK2;
389. for (i = 1; i < j; i++)
^
390. r->d[i] = (~m->d[i]) & BN_MASK2;
391. r->top = j;
crypto/bn/bn_exp.c:294:1: <Length trace>
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:294:1: Parameter `*m->d`
292. }
293.
294. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
295. const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
296. {
crypto/bn/bn_exp.c:390:25: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_is_prime_ex`
388. r->d[0] = (0 - m->d[0]) & BN_MASK2;
389. for (i = 1; i < j; i++)
390. r->d[i] = (~m->d[i]) & BN_MASK2;
^
391. r->top = j;
392. /*
|
https://github.com/openssl/openssl/blob/757264207ad8650a89ea903d48ad89f61d56ea9c/crypto/bn/bn_exp.c/#L390
|
d2a_code_trace_data_45727
|
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;
}
ffmpeg.c:3102: error: Null Dereference
pointer `ts_scale` last assigned on line 3101 could be null and is dereferenced at line 3102, column 5.
ffmpeg.c:3090:1: start of procedure opt_input_ts_scale()
3088. }
3089.
3090. static int opt_input_ts_scale(const char *opt, const char *arg)
^
3091. {
3092. unsigned int stream;
ffmpeg.c:3096:5:
3094. char *p;
3095.
3096. stream = strtol(arg, &p, 0);
^
3097. if (*p)
3098. p++;
ffmpeg.c:3097:9: Taking false branch
3095.
3096. stream = strtol(arg, &p, 0);
3097. if (*p)
^
3098. p++;
3099. scale= strtod(p, &p);
ffmpeg.c:3099:5:
3097. if (*p)
3098. p++;
3099. scale= strtod(p, &p);
^
3100.
3101. ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
ffmpeg.c:3101:5:
3099. scale= strtod(p, &p);
3100.
3101. ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
^
3102. ts_scale[stream] = scale;
3103. return 0;
ffmpeg.c:534:1: start of procedure grow_array()
532.
533. /* similar to ff_dynarray_add() and av_fast_realloc() */
534. static void *grow_array(void *array, int elem_size, int *size, int new_size)
^
535. {
536. if (new_size >= INT_MAX / elem_size) {
ffmpeg.c:536:9: Taking true branch
534. static void *grow_array(void *array, int elem_size, int *size, int new_size)
535. {
536. if (new_size >= INT_MAX / elem_size) {
^
537. fprintf(stderr, "Array too big.\n");
538. ffmpeg_exit(1);
ffmpeg.c:537:9:
535. {
536. if (new_size >= INT_MAX / elem_size) {
537. fprintf(stderr, "Array too big.\n");
^
538. ffmpeg_exit(1);
539. }
ffmpeg.c:538:9: Skipping ffmpeg_exit(): empty list of specs
536. if (new_size >= INT_MAX / elem_size) {
537. fprintf(stderr, "Array too big.\n");
538. ffmpeg_exit(1);
^
539. }
540. if (*size < new_size) {
ffmpeg.c:540:9: Taking true branch
538. ffmpeg_exit(1);
539. }
540. if (*size < new_size) {
^
541. uint8_t *tmp = av_realloc(array, new_size*elem_size);
542. if (!tmp) {
ffmpeg.c:541:9:
539. }
540. if (*size < new_size) {
541. uint8_t *tmp = av_realloc(array, new_size*elem_size);
^
542. if (!tmp) {
543. 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)
ffmpeg.c:542:14: Taking true branch
540. if (*size < new_size) {
541. uint8_t *tmp = av_realloc(array, new_size*elem_size);
542. if (!tmp) {
^
543. fprintf(stderr, "Could not alloc buffer.\n");
544. ffmpeg_exit(1);
ffmpeg.c:543:13:
541. uint8_t *tmp = av_realloc(array, new_size*elem_size);
542. if (!tmp) {
543. fprintf(stderr, "Could not alloc buffer.\n");
^
544. ffmpeg_exit(1);
545. }
ffmpeg.c:544:13: Skipping ffmpeg_exit(): empty list of specs
542. if (!tmp) {
543. fprintf(stderr, "Could not alloc buffer.\n");
544. ffmpeg_exit(1);
^
545. }
546. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
ffmpeg.c:546:9:
544. ffmpeg_exit(1);
545. }
546. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
^
547. *size = new_size;
548. return tmp;
ffmpeg.c:547:9:
545. }
546. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
547. *size = new_size;
^
548. return tmp;
549. }
ffmpeg.c:548:9:
546. memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size);
547. *size = new_size;
548. return tmp;
^
549. }
550. return array;
ffmpeg.c:551:1: return from a call to grow_array
549. }
550. return array;
551. }
^
552.
553. static void choose_sample_fmt(AVStream *st, AVCodec *codec)
ffmpeg.c:3102:5:
3100.
3101. ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, stream + 1);
3102. ts_scale[stream] = scale;
^
3103. return 0;
3104. }
|
https://github.com/libav/libav/blob/eb97dbb05a990266b04830ea8e179e0428656b98/ffmpeg.c/#L3102
|
d2a_code_trace_data_45728
|
static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
{
BN_ULONG *a = NULL;
if (words > (INT_MAX / (4 * BN_BITS2))) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_BIGNUM_TOO_LONG);
return NULL;
}
if (BN_get_flags(b, BN_FLG_STATIC_DATA)) {
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return NULL;
}
if (BN_get_flags(b, BN_FLG_SECURE))
a = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = OPENSSL_zalloc(words * sizeof(*a));
if (a == NULL) {
BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
return NULL;
}
assert(b->top <= words);
if (b->top > 0)
memcpy(a, b->d, sizeof(*a) * b->top);
return a;
}
crypto/bn/bn_prime.c:484: error: BUFFER_OVERRUN_L3
Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_add`.
Showing all 28 steps of the trace
crypto/bn/bn_prime.c:471:10: Call
469. goto err;
470.
471. if (!BN_rand(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD))
^
472. goto err;
473.
crypto/bn/bn_rand.c:108:12: Call
106. int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
107. {
108. return bnrand(NORMAL, rnd, bits, top, bottom, NULL);
^
109. }
110.
crypto/bn/bn_rand.c:23:1: Parameter `rnd->top`
21. } BNRAND_FLAG;
22.
23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
24. BN_CTX *ctx)
25. {
crypto/bn/bn_prime.c:476:10: Call
474. /* we need ((rnd-rem) % add) == 0 */
475.
476. if (!BN_mod(t1, rnd, add, ctx))
^
477. goto err;
478. if (!BN_sub(rnd, rnd, t1))
crypto/bn/bn_div.c:209:1: Parameter `num->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_prime.c:478:10: Call
476. if (!BN_mod(t1, rnd, add, ctx))
477. goto err;
478. if (!BN_sub(rnd, rnd, t1))
^
479. goto err;
480. if (rem == NULL) {
crypto/bn/bn_add.c:45:1: Parameter `a->top`
43.
44. /* signed sub of b from a. */
45. > int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
46. {
47. int ret, r_neg, cmp_res;
crypto/bn/bn_prime.c:484:14: Call
482. goto err;
483. } else {
484. if (!BN_add(rnd, rnd, rem))
^
485. goto err;
486. }
crypto/bn/bn_add.c:14:1: Parameter `r->top`
12.
13. /* signed add of b to a. */
14. > int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
15. {
16. int ret, r_neg, cmp_res;
crypto/bn/bn_add.c:28:19: Call
26. if (cmp_res > 0) {
27. r_neg = a->neg;
28. ret = BN_usub(r, a, b);
^
29. } else if (cmp_res < 0) {
30. r_neg = b->neg;
crypto/bn/bn_add.c:125:1: Parameter `r->top`
123.
124. /* unsigned subtraction of b from a, a must be larger than b. */
125. > int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
126. {
127. int max, min, dif;
crypto/bn/bn_add.c:143:9: Call
141. }
142.
143. if (bn_wexpand(r, max) == NULL)
^
144. return 0;
145.
crypto/bn/bn_lib.c:962:1: Parameter `a->top`
960. }
961.
962. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
963. {
964. return (words <= a->dmax) ? a : bn_expand2(a, words);
crypto/bn/bn_lib.c:964:37: Call
962. BIGNUM *bn_wexpand(BIGNUM *a, int words)
963. {
964. return (words <= a->dmax) ? a : bn_expand2(a, words);
^
965. }
966.
crypto/bn/bn_lib.c:245:1: Parameter `b->top`
243. */
244.
245. > BIGNUM *bn_expand2(BIGNUM *b, int words)
246. {
247. if (words > b->dmax) {
crypto/bn/bn_lib.c:248:23: Call
246. {
247. if (words > b->dmax) {
248. BN_ULONG *a = bn_expand_internal(b, words);
^
249. if (!a)
250. return NULL;
crypto/bn/bn_lib.c:209:1: <Offset trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `b->top`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: <Length trace>
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:209:1: Parameter `words`
207. /* This is used by bn_expand2() */
208. /* The caller MUST check that words > b->dmax before calling this */
209. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
210. {
211. BN_ULONG *a = NULL;
crypto/bn/bn_lib.c:224:13: Call
222. a = OPENSSL_secure_zalloc(words * sizeof(*a));
223. else
224. a = OPENSSL_zalloc(words * sizeof(*a));
^
225. if (a == NULL) {
226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/mem.c:228:1: Parameter `num`
226. }
227.
228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
crypto/mem.c:230:17: Call
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
^
231.
232. FAILTEST();
crypto/mem.c:201:9: Assignment
199.
200. if (num == 0)
201. return NULL;
^
202.
203. FAILTEST();
crypto/mem.c:230:5: Assignment
228. void *CRYPTO_zalloc(size_t num, const char *file, int line)
229. {
230. void *ret = CRYPTO_malloc(num, file, line);
^
231.
232. FAILTEST();
crypto/mem.c:235:5: Assignment
233. if (ret != NULL)
234. memset(ret, 0, num);
235. return ret;
^
236. }
237.
crypto/bn/bn_lib.c:224:9: Assignment
222. a = OPENSSL_secure_zalloc(words * sizeof(*a));
223. else
224. a = OPENSSL_zalloc(words * sizeof(*a));
^
225. if (a == NULL) {
226. BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);
crypto/bn/bn_lib.c:232:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_add`
230. assert(b->top <= words);
231. if (b->top > 0)
232. memcpy(a, b->d, sizeof(*a) * b->top);
^
233.
234. return a;
|
https://github.com/openssl/openssl/blob/bd01733fdd9a5a0acdc72cf5c6601d37e8ddd801/crypto/bn/bn_lib.c/#L232
|
d2a_code_trace_data_45729
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/bn/bntest.c:1460: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_div`.
Showing all 15 steps of the trace
crypto/bn/bntest.c:1436:1: Parameter `ctx->stack.depth`
1434. }
1435.
1436. > int test_gf2m_mod_div(BIO *bp,BN_CTX *ctx)
1437. {
1438. BIGNUM *a,*b[2],*c,*d,*e,*f;
crypto/bn/bntest.c:1460:4: Call
1458. for (j=0; j < 2; j++)
1459. {
1460. BN_GF2m_mod_div(d, a, c, b[j], ctx);
^
1461. BN_GF2m_mod_mul(e, d, c, b[j], ctx);
1462. BN_GF2m_mod_div(f, a, e, b[j], ctx);
crypto/bn/bn_gf2m.c:685:1: Parameter `ctx->stack.depth`
683. * or y, x could equal y.
684. */
685. > int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *y, const BIGNUM *x, const BIGNUM *p, BN_CTX *ctx)
686. {
687. BIGNUM *xinv = NULL;
crypto/bn/bn_gf2m.c:694:2: Call
692. bn_check_top(p);
693.
694. BN_CTX_start(ctx);
^
695. xinv = BN_CTX_get(ctx);
696. if (xinv == NULL) goto err;
crypto/bn/bn_ctx.c:257:1: Parameter `ctx->stack.depth`
255. }
256.
257. > void BN_CTX_start(BN_CTX *ctx)
258. {
259. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gf2m.c:698:7: Call
696. if (xinv == NULL) goto err;
697.
698. if (!BN_GF2m_mod_inv(xinv, x, p, ctx)) goto err;
^
699. if (!BN_GF2m_mod_mul(r, y, xinv, p, ctx)) goto err;
700. bn_check_top(r);
crypto/bn/bn_gf2m.c:526:1: Parameter `ctx->stack.depth`
524. * of Elliptic Curve Cryptography Over Binary Fields".
525. */
526. > int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
527. {
528. BIGNUM *b, *c = NULL, *u = NULL, *v = NULL, *tmp;
crypto/bn/bn_gf2m.c:534:2: Call
532. bn_check_top(p);
533.
534. BN_CTX_start(ctx);
^
535.
536. if ((b = BN_CTX_get(ctx))==NULL) goto err;
crypto/bn/bn_ctx.c:257:1: Parameter `ctx->stack.depth`
255. }
256.
257. > void BN_CTX_start(BN_CTX *ctx)
258. {
259. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gf2m.c:652:4: Call
650. bn_correct_top(v);
651. #endif
652. BN_CTX_end(ctx);
^
653. return ret;
654. }
crypto/bn/bn_ctx.c:272:1: Parameter `ctx->stack.depth`
270. }
271.
272. > void BN_CTX_end(BN_CTX *ctx)
273. {
274. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:279:21: Call
277. else
278. {
279. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
280. /* Does this stack frame have anything to release? */
281. if(fp < ctx->used)
crypto/bn/bn_ctx.c:353:1: <LHS trace>
351. }
352.
353. > static unsigned int BN_STACK_pop(BN_STACK *st)
354. {
355. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:353:1: Parameter `st->depth`
351. }
352.
353. > static unsigned int BN_STACK_pop(BN_STACK *st)
354. {
355. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:355:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_div`
353. static unsigned int BN_STACK_pop(BN_STACK *st)
354. {
355. return st->indexes[--(st->depth)];
^
356. }
357.
|
https://github.com/openssl/openssl/blob/27dfffd5b75ee1db114e32f6dc73e266513889c5/crypto/bn/bn_ctx.c/#L355
|
d2a_code_trace_data_45730
|
size_t BUF_strnlen(const char *str, size_t maxlen)
{
const char *p;
for (p = str; *p != '\0' && maxlen-- != 0; ++p)
;
return p - str;
}
crypto/buffer/buf_str.c:69: error: INTEGER_OVERFLOW_L2
([0, `maxlen`] - 1):unsigned64.
Showing all 3 steps of the trace
crypto/buffer/buf_str.c:65:1: <LHS trace>
63. #include <openssl/buffer.h>
64.
65. > size_t BUF_strnlen(const char *str, size_t maxlen)
66. {
67. const char *p;
crypto/buffer/buf_str.c:65:1: Parameter `maxlen`
63. #include <openssl/buffer.h>
64.
65. > size_t BUF_strnlen(const char *str, size_t maxlen)
66. {
67. const char *p;
crypto/buffer/buf_str.c:69:30: Binary operation: ([0, maxlen] - 1):unsigned64
67. const char *p;
68.
69. for (p = str; *p != '\0' && maxlen-- != 0; ++p)
^
70. ;
71.
|
https://github.com/openssl/openssl/blob/df24f29ae6d14a564c76fed10ac32701128c3f36/crypto/buffer/buf_str.c/#L69
|
d2a_code_trace_data_45731
|
static ngx_int_t
ngx_http_index_handler(ngx_http_request_t *r)
{
u_char *p, *name;
size_t len, root, reserve, allocated;
ngx_int_t rc;
ngx_str_t path, uri;
ngx_uint_t i, dir_tested;
ngx_http_index_t *index;
ngx_open_file_info_t of;
ngx_http_script_code_pt code;
ngx_http_script_engine_t e;
ngx_http_core_loc_conf_t *clcf;
ngx_http_index_loc_conf_t *ilcf;
ngx_http_script_len_code_pt lcode;
if (r->uri.data[r->uri.len - 1] != '/') {
return NGX_DECLINED;
}
if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
return NGX_DECLINED;
}
if (r->zero_in_uri) {
return NGX_DECLINED;
}
ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module);
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
allocated = 0;
root = 0;
dir_tested = 0;
name = NULL;
path.data = NULL;
index = ilcf->indices->elts;
for (i = 0; i < ilcf->indices->nelts; i++) {
if (index[i].lengths == NULL) {
if (index[i].name.data[0] == '/') {
return ngx_http_internal_redirect(r, &index[i].name, &r->args);
}
reserve = ilcf->max_index_len;
len = index[i].name.len;
} else {
ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
e.ip = index[i].lengths->elts;
e.request = r;
e.flushed = 1;
len = 1;
while (*(uintptr_t *) e.ip) {
lcode = *(ngx_http_script_len_code_pt *) e.ip;
len += lcode(&e);
}
reserve = len + 16;
}
if (reserve > allocated) {
name = ngx_http_map_uri_to_path(r, &path, &root, reserve);
if (name == NULL) {
return NGX_ERROR;
}
allocated = path.data + path.len - name;
}
if (index[i].values == NULL) {
ngx_memcpy(name, index[i].name.data, index[i].name.len);
path.len = (name + index[i].name.len - 1) - path.data;
} else {
e.ip = index[i].values->elts;
e.pos = name;
while (*(uintptr_t *) e.ip) {
code = *(ngx_http_script_code_pt *) e.ip;
code((ngx_http_script_engine_t *) &e);
}
if (*name == '/') {
uri.len = len - 1;
uri.data = name;
return ngx_http_internal_redirect(r, &uri, &r->args);
}
path.len = e.pos - path.data;
*e.pos = '\0';
}
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"open index \"%V\"", &path);
ngx_memzero(&of, sizeof(ngx_open_file_info_t));
of.directio = clcf->directio;
of.valid = clcf->open_file_cache_valid;
of.min_uses = clcf->open_file_cache_min_uses;
of.errors = clcf->open_file_cache_errors;
of.events = clcf->open_file_cache_events;
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
{
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err,
ngx_open_file_n " \"%s\" failed", path.data);
if (of.err == 0) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
if (of.err == NGX_ENOTDIR || of.err == NGX_EACCES) {
return ngx_http_index_error(r, clcf, path.data, of.err);
}
if (!dir_tested) {
rc = ngx_http_index_test_dir(r, clcf, path.data, name - 1);
if (rc != NGX_OK) {
return rc;
}
dir_tested = 1;
}
if (of.err == NGX_ENOENT) {
continue;
}
ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err,
ngx_open_file_n " \"%s\" failed", path.data);
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
uri.len = r->uri.len + len - 1;
if (!clcf->alias) {
uri.data = path.data + root;
} else {
uri.data = ngx_pnalloc(r->pool, uri.len);
if (uri.data == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
p = ngx_copy(uri.data, r->uri.data, r->uri.len);
ngx_memcpy(p, name, len - 1);
}
return ngx_http_internal_redirect(r, &uri, &r->args);
}
return NGX_DECLINED;
}
src/http/modules/ngx_http_index_module.c:193: error: Null Dereference
pointer `name` last assigned on line 130 could be null and is dereferenced at line 193, column 17.
src/http/modules/ngx_http_index_module.c:95:1: start of procedure ngx_http_index_handler()
93. */
94.
95. static ngx_int_t
^
96. ngx_http_index_handler(ngx_http_request_t *r)
97. {
src/http/modules/ngx_http_index_module.c:111:9: Taking false branch
109. ngx_http_script_len_code_pt lcode;
110.
111. if (r->uri.data[r->uri.len - 1] != '/') {
^
112. return NGX_DECLINED;
113. }
src/http/modules/ngx_http_index_module.c:115:11: Taking false branch
113. }
114.
115. if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
^
116. return NGX_DECLINED;
117. }
src/http/modules/ngx_http_index_module.c:120:9: Taking false branch
118.
119. /* TODO: Win32 */
120. if (r->zero_in_uri) {
^
121. return NGX_DECLINED;
122. }
src/http/modules/ngx_http_index_module.c:124:5:
122. }
123.
124. ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module);
^
125. clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
126.
src/http/modules/ngx_http_index_module.c:125:5:
123.
124. ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module);
125. clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
^
126.
127. allocated = 0;
src/http/modules/ngx_http_index_module.c:127:5:
125. clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
126.
127. allocated = 0;
^
128. root = 0;
129. dir_tested = 0;
src/http/modules/ngx_http_index_module.c:128:5:
126.
127. allocated = 0;
128. root = 0;
^
129. dir_tested = 0;
130. name = NULL;
src/http/modules/ngx_http_index_module.c:129:5:
127. allocated = 0;
128. root = 0;
129. dir_tested = 0;
^
130. name = NULL;
131. /* suppress MSVC warning */
src/http/modules/ngx_http_index_module.c:130:5:
128. root = 0;
129. dir_tested = 0;
130. name = NULL;
^
131. /* suppress MSVC warning */
132. path.data = NULL;
src/http/modules/ngx_http_index_module.c:132:5:
130. name = NULL;
131. /* suppress MSVC warning */
132. path.data = NULL;
^
133.
134. index = ilcf->indices->elts;
src/http/modules/ngx_http_index_module.c:134:5:
132. path.data = NULL;
133.
134. index = ilcf->indices->elts;
^
135. for (i = 0; i < ilcf->indices->nelts; i++) {
136.
src/http/modules/ngx_http_index_module.c:135:10:
133.
134. index = ilcf->indices->elts;
135. for (i = 0; i < ilcf->indices->nelts; i++) {
^
136.
137. if (index[i].lengths == NULL) {
src/http/modules/ngx_http_index_module.c:135:17: Loop condition is true. Entering loop body
133.
134. index = ilcf->indices->elts;
135. for (i = 0; i < ilcf->indices->nelts; i++) {
^
136.
137. if (index[i].lengths == NULL) {
src/http/modules/ngx_http_index_module.c:137:13: Taking true branch
135. for (i = 0; i < ilcf->indices->nelts; i++) {
136.
137. if (index[i].lengths == NULL) {
^
138.
139. if (index[i].name.data[0] == '/') {
src/http/modules/ngx_http_index_module.c:139:17: Taking false branch
137. if (index[i].lengths == NULL) {
138.
139. if (index[i].name.data[0] == '/') {
^
140. return ngx_http_internal_redirect(r, &index[i].name, &r->args);
141. }
src/http/modules/ngx_http_index_module.c:143:13:
141. }
142.
143. reserve = ilcf->max_index_len;
^
144. len = index[i].name.len;
145.
src/http/modules/ngx_http_index_module.c:144:13:
142.
143. reserve = ilcf->max_index_len;
144. len = index[i].name.len;
^
145.
146. } else {
src/http/modules/ngx_http_index_module.c:166:13: Taking false branch
164. }
165.
166. if (reserve > allocated) {
^
167.
168. name = ngx_http_map_uri_to_path(r, &path, &root, reserve);
src/http/modules/ngx_http_index_module.c:176:13: Taking false branch
174. }
175.
176. if (index[i].values == NULL) {
^
177.
178. /* index[i].name.len includes the terminating '\0' */
src/http/modules/ngx_http_index_module.c:185:13:
183.
184. } else {
185. e.ip = index[i].values->elts;
^
186. e.pos = name;
187.
src/http/modules/ngx_http_index_module.c:186:13:
184. } else {
185. e.ip = index[i].values->elts;
186. e.pos = name;
^
187.
188. while (*(uintptr_t *) e.ip) {
src/http/modules/ngx_http_index_module.c:188:20: Loop condition is true. Entering loop body
186. e.pos = name;
187.
188. while (*(uintptr_t *) e.ip) {
^
189. code = *(ngx_http_script_code_pt *) e.ip;
190. code((ngx_http_script_engine_t *) &e);
src/http/modules/ngx_http_index_module.c:189:17:
187.
188. while (*(uintptr_t *) e.ip) {
189. code = *(ngx_http_script_code_pt *) e.ip;
^
190. code((ngx_http_script_engine_t *) &e);
191. }
src/http/modules/ngx_http_index_module.c:190:17: Skipping __function_pointer__(): unresolved function pointer
188. while (*(uintptr_t *) e.ip) {
189. code = *(ngx_http_script_code_pt *) e.ip;
190. code((ngx_http_script_engine_t *) &e);
^
191. }
192.
src/http/modules/ngx_http_index_module.c:188:20: Loop condition is false. Leaving loop
186. e.pos = name;
187.
188. while (*(uintptr_t *) e.ip) {
^
189. code = *(ngx_http_script_code_pt *) e.ip;
190. code((ngx_http_script_engine_t *) &e);
src/http/modules/ngx_http_index_module.c:193:17:
191. }
192.
193. if (*name == '/') {
^
194. uri.len = len - 1;
195. uri.data = name;
|
https://github.com/nginx/nginx/blob/e4ecddfdb0d2ffc872658e36028971ad9a873726/src/http/modules/ngx_http_index_module.c/#L193
|
d2a_code_trace_data_45732
|
void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
MPA_INT *window, int *dither_state,
OUT_INT *samples, int incr,
int32_t sb_samples[SBLIMIT])
{
int32_t tmp[32];
register MPA_INT *synth_buf;
register const MPA_INT *w, *w2, *p;
int j, offset, v;
OUT_INT *samples2;
#if FRAC_BITS <= 15
int sum, sum2;
#else
int64_t sum, sum2;
#endif
dct32(tmp, sb_samples);
offset = *synth_buf_offset;
synth_buf = synth_buf_ptr + offset;
for(j=0;j<32;j++) {
v = tmp[j];
#if FRAC_BITS <= 15
v = av_clip_int16(v);
#endif
synth_buf[j] = v;
}
memcpy(synth_buf + 512, synth_buf, 32 * sizeof(MPA_INT));
samples2 = samples + 31 * incr;
w = window;
w2 = window + 31;
sum = *dither_state;
p = synth_buf + 16;
SUM8(sum, +=, w, p);
p = synth_buf + 48;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
samples += incr;
w++;
for(j=1;j<16;j++) {
sum2 = 0;
p = synth_buf + 16 + j;
SUM8P2(sum, +=, sum2, -=, w, w2, p);
p = synth_buf + 48 - j;
SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
*samples = round_sample(&sum);
samples += incr;
sum += sum2;
*samples2 = round_sample(&sum);
samples2 -= incr;
w++;
w2--;
}
p = synth_buf + 32;
SUM8(sum, -=, w + 32, p);
*samples = round_sample(&sum);
*dither_state= sum;
offset = (offset - 32) & 511;
*synth_buf_offset = offset;
}
libavcodec/mpc.c:60: error: Buffer Overrun L2
Offset: [401+min(0, `c->synth_buf_offset[*]`), 416+max(511, `c->synth_buf_offset[*]`)] (⇐ [17+min(0, `c->synth_buf_offset[*]`), 32+max(511, `c->synth_buf_offset[*]`)] + 384) Size: 2 by call to `ff_mpa_synth_filter`.
libavcodec/mpc.c:51:1: Parameter `c->synth_buf[*]`
49. * Process decoded Musepack data and produce PCM
50. */
51. static void mpc_synth(MPCContext *c, int16_t *out)
^
52. {
53. int dither_state = 0;
libavcodec/mpc.c:60:13: Call
58. samples_ptr = samples + ch;
59. for(i = 0; i < SAMPLES_PER_BAND; i++) {
60. ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
^
61. mpa_window, &dither_state,
62. samples_ptr, 2,
libavcodec/mpegaudiodec.c:906:9: <Length trace>
904. /* we calculate two samples at the same time to avoid one memory
905. access per two sample */
906. for(j=1;j<16;j++) {
^
907. sum2 = 0;
908. p = synth_buf + 16 + j;
libavcodec/mpegaudiodec.c:906:9: Assignment
904. /* we calculate two samples at the same time to avoid one memory
905. access per two sample */
906. for(j=1;j<16;j++) {
^
907. sum2 = 0;
908. p = synth_buf + 16 + j;
libavcodec/mpegaudiodec.c:908:9: Assignment
906. for(j=1;j<16;j++) {
907. sum2 = 0;
908. p = synth_buf + 16 + j;
^
909. SUM8P2(sum, +=, sum2, -=, w, w2, p);
910. p = synth_buf + 48 - j;
libavcodec/mpegaudiodec.c:909:9: Array access: Offset: [401+min(0, c->synth_buf_offset[*]), 416+max(511, c->synth_buf_offset[*])] (⇐ [17+min(0, c->synth_buf_offset[*]), 32+max(511, c->synth_buf_offset[*])] + 384) Size: 2 by call to `ff_mpa_synth_filter`
907. sum2 = 0;
908. p = synth_buf + 16 + j;
909. SUM8P2(sum, +=, sum2, -=, w, w2, p);
^
910. p = synth_buf + 48 - j;
911. SUM8P2(sum, -=, sum2, -=, w + 32, w2 + 32, p);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegaudiodec.c/#L909
|
d2a_code_trace_data_45733
|
static dav_error * dav_validate_resource_state(apr_pool_t *p,
const dav_resource *resource,
dav_lockdb *lockdb,
const dav_if_header *if_header,
int flags,
dav_buffer *pbuf,
request_rec *r)
{
dav_error *err;
const char *uri;
const char *etag;
const dav_hooks_locks *locks_hooks = (lockdb ? lockdb->hooks : NULL);
const dav_if_header *ifhdr_scan;
dav_if_state_list *state_list;
dav_lock *lock_list;
dav_lock *lock;
int num_matched;
int num_that_apply;
int seen_locktoken;
apr_size_t uri_len;
const char *reason = NULL;
if (lockdb == NULL) {
lock_list = NULL;
}
else {
if ((err = dav_lock_query(lockdb, resource, &lock_list)) != NULL) {
return dav_push_error(p,
HTTP_INTERNAL_SERVER_ERROR, 0,
"The locks could not be queried for "
"verification against a possible \"If:\" "
"header.",
err);
}
}
if (flags & DAV_LOCKSCOPE_EXCLUSIVE) {
if (lock_list != NULL) {
return dav_new_error(p, HTTP_LOCKED, 0, 0,
"Existing lock(s) on the requested resource "
"prevent an exclusive lock.");
}
seen_locktoken = 1;
}
else if (flags & DAV_LOCKSCOPE_SHARED) {
for (lock = lock_list; lock != NULL; lock = lock->next) {
if (lock->scope == DAV_LOCKSCOPE_EXCLUSIVE) {
return dav_new_error(p, HTTP_LOCKED, 0, 0,
"The requested resource is already "
"locked exclusively.");
}
}
seen_locktoken = 1;
}
else {
seen_locktoken = (lock_list == NULL);
}
if (if_header == NULL) {
if (seen_locktoken)
return NULL;
return dav_new_error(p, HTTP_LOCKED, 0, 0,
"This resource is locked and an \"If:\" header "
"was not supplied to allow access to the "
"resource.");
}
if (lock_list == NULL && if_header->dummy_header) {
if (flags & DAV_VALIDATE_IS_PARENT)
return NULL;
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
"The locktoken specified in the \"Lock-Token:\" "
"header is invalid because this resource has no "
"outstanding locks.");
}
uri = resource->uri;
uri_len = strlen(uri);
if (uri[uri_len - 1] == '/') {
dav_set_bufsize(p, pbuf, uri_len);
memcpy(pbuf->buf, uri, uri_len);
pbuf->buf[--uri_len] = '\0';
uri = pbuf->buf;
}
etag = (*resource->hooks->getetag)(resource);
num_that_apply = 0;
for (ifhdr_scan = if_header;
ifhdr_scan != NULL;
ifhdr_scan = ifhdr_scan->next) {
if (ifhdr_scan->uri != NULL
&& (uri_len != ifhdr_scan->uri_len
|| memcmp(uri, ifhdr_scan->uri, uri_len) != 0)) {
continue;
}
++num_that_apply;
for (state_list = ifhdr_scan->state;
state_list != NULL;
state_list = state_list->next) {
switch(state_list->type) {
case dav_if_etag:
{
const char *given_etag, *current_etag;
int mismatch;
if (state_list->etag[0] == 'W' &&
state_list->etag[1] == '/') {
given_etag = state_list->etag + 2;
}
else {
given_etag = state_list->etag;
}
if (etag[0] == 'W' &&
etag[1] == '/') {
current_etag = etag + 2;
}
else {
current_etag = etag;
}
mismatch = strcmp(given_etag, current_etag);
if (state_list->condition == DAV_IF_COND_NORMAL && mismatch) {
reason =
"an entity-tag was specified, but the resource's "
"actual ETag does not match.";
goto state_list_failed;
}
else if (state_list->condition == DAV_IF_COND_NOT
&& !mismatch) {
reason =
"an entity-tag was specified using the \"Not\" form, "
"but the resource's actual ETag matches the provided "
"entity-tag.";
goto state_list_failed;
}
break;
}
case dav_if_opaquelock:
if (lockdb == NULL) {
if (state_list->condition == DAV_IF_COND_NOT) {
continue;
}
reason =
"a State-token was supplied, but a lock database "
"is not available for to provide the required lock.";
goto state_list_failed;
}
num_matched = 0;
for (lock = lock_list; lock != NULL; lock = lock->next) {
if ((*locks_hooks->compare_locktoken)(state_list->locktoken, lock->locktoken)) {
continue;
}
seen_locktoken = 1;
if (state_list->condition == DAV_IF_COND_NOT) {
reason =
"a State-token was supplied, which used a "
"\"Not\" condition. The State-token was found "
"in the locks on this resource";
goto state_list_failed;
}
if (lock->auth_user &&
(!r->user ||
strcmp(lock->auth_user, r->user))) {
const char *errmsg;
errmsg = apr_pstrcat(p, "User \"",
r->user,
"\" submitted a locktoken created "
"by user \"",
lock->auth_user, "\".", NULL);
return dav_new_error(p, HTTP_FORBIDDEN, 0, 0, errmsg);
}
num_matched = 1;
break;
}
if (num_matched == 0
&& state_list->condition == DAV_IF_COND_NORMAL) {
reason =
"a State-token was supplied, but it was not found "
"in the locks on this resource.";
goto state_list_failed;
}
break;
case dav_if_unknown:
if (state_list->condition == DAV_IF_COND_NORMAL) {
reason =
"an unknown state token was supplied";
goto state_list_failed;
}
break;
}
}
if (seen_locktoken) {
return NULL;
}
break;
state_list_failed:
;
}
if (ifhdr_scan == NULL) {
if (num_that_apply == 0) {
if (seen_locktoken)
return NULL;
if (dav_find_submitted_locktoken(if_header, lock_list,
locks_hooks)) {
return NULL;
}
return dav_new_error(p, HTTP_LOCKED, 0 , 0,
"This resource is locked and the \"If:\" "
"header did not specify one of the "
"locktokens for this resource's lock(s).");
}
if (if_header->dummy_header) {
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
"The locktoken specified in the "
"\"Lock-Token:\" header did not specify one "
"of this resource's locktoken(s).");
}
if (reason == NULL) {
return dav_new_error(p, HTTP_PRECONDITION_FAILED, 0, 0,
"The preconditions specified by the \"If:\" "
"header did not match this resource.");
}
return dav_new_error(p, HTTP_PRECONDITION_FAILED, 0, 0,
apr_psprintf(p,
"The precondition(s) specified by "
"the \"If:\" header did not match "
"this resource. At least one "
"failure is because: %s", reason));
}
if (dav_find_submitted_locktoken(if_header, lock_list, locks_hooks)) {
return NULL;
}
if (if_header->dummy_header) {
return dav_new_error(p, HTTP_BAD_REQUEST, 0, 0,
"The locktoken specified in the "
"\"Lock-Token:\" header did not specify one "
"of this resource's locktoken(s).");
}
return dav_new_error(p, HTTP_LOCKED, 1 , 0,
"This resource is locked and the \"If:\" header "
"did not specify one of the "
"locktokens for this resource's lock(s).");
}
modules/dav/main/util.c:1601: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `dav_validate_resource_state`.
modules/dav/main/util.c:1594:15: Unknown value from: non-const function
1592. dav_resource *parent_resource;
1593.
1594. err = (*repos_hooks->get_parent_resource)(resource, &parent_resource);
^
1595.
1596. if (err == NULL && parent_resource == NULL) {
modules/dav/main/util.c:1601:19: Call
1599. }
1600. else if (err == NULL) {
1601. err = dav_validate_resource_state(r->pool, parent_resource, lockdb,
^
1602. if_header,
1603. flags | DAV_VALIDATE_IS_PARENT,
modules/dav/main/util.c:802:1: <LHS trace>
800. * Returns NULL if path/uri meets if-header and lock requirements
801. */
802. static dav_error * dav_validate_resource_state(apr_pool_t *p,
^
803. const dav_resource *resource,
804. dav_lockdb *lockdb,
modules/dav/main/util.c:802:1: Parameter `resource->uri->strlen`
800. * Returns NULL if path/uri meets if-header and lock requirements
801. */
802. static dav_error * dav_validate_resource_state(apr_pool_t *p,
^
803. const dav_resource *resource,
804. dav_lockdb *lockdb,
modules/dav/main/util.c:988:5: Assignment
986. */
987. uri = resource->uri;
988. uri_len = strlen(uri);
^
989. if (uri[uri_len - 1] == '/') {
990. dav_set_bufsize(p, pbuf, uri_len);
modules/dav/main/util.c:989:9: Binary operation: ([0, +oo] - 1):unsigned64 by call to `dav_validate_resource_state`
987. uri = resource->uri;
988. uri_len = strlen(uri);
989. if (uri[uri_len - 1] == '/') {
^
990. dav_set_bufsize(p, pbuf, uri_len);
991. memcpy(pbuf->buf, uri, uri_len);
|
https://github.com/apache/httpd/blob/8b2ec33ac5d314be345814db08e194ffeda6beb0/modules/dav/main/util.c/#L989
|
d2a_code_trace_data_45734
|
c448_error_t curve448_scalar_decode(
curve448_scalar_t s,
const unsigned char ser[C448_SCALAR_BYTES])
{
unsigned int i;
c448_dsword_t accum = 0;
scalar_decode_short(s, ser, C448_SCALAR_BYTES);
for (i = 0; i < C448_SCALAR_LIMBS; i++)
accum = (accum + s->limb[i] - sc_p->limb[i]) >> WBITS;
curve448_scalar_mul(s, s, curve448_scalar_one);
return c448_succeed_if(~word_is_zero((uint32_t)accum));
}
crypto/ec/curve448/scalar.c:166: error: INTEGER_OVERFLOW_L1
(0 - 1):unsigned64 by call to `word_is_zero`.
Showing all 5 steps of the trace
crypto/ec/curve448/scalar.c:157:5: Assignment
155. {
156. unsigned int i;
157. c448_dsword_t accum = 0;
^
158.
159. scalar_decode_short(s, ser, C448_SCALAR_BYTES);
crypto/ec/curve448/scalar.c:166:29: Call
164. curve448_scalar_mul(s, s, curve448_scalar_one); /* ham-handed reduce */
165.
166. return c448_succeed_if(~word_is_zero((uint32_t)accum));
^
167. }
168.
crypto/ec/curve448/arch_32/arch_intrinsics.h:18:1: <LHS trace>
16. # define ARCH_WORD_BITS 32
17.
18. > static ossl_inline uint32_t word_is_zero(uint32_t a)
19. {
20. /* let's hope the compiler isn't clever enough to optimize this. */
crypto/ec/curve448/arch_32/arch_intrinsics.h:18:1: Parameter `a`
16. # define ARCH_WORD_BITS 32
17.
18. > static ossl_inline uint32_t word_is_zero(uint32_t a)
19. {
20. /* let's hope the compiler isn't clever enough to optimize this. */
crypto/ec/curve448/arch_32/arch_intrinsics.h:21:5: Binary operation: (0 - 1):unsigned64 by call to `word_is_zero`
19. {
20. /* let's hope the compiler isn't clever enough to optimize this. */
21. return (((uint64_t)a) - 1) >> 32;
^
22. }
23.
|
https://github.com/openssl/openssl/blob/0cdcdacc337005e08a906b2e07d4e44e3ee48138/crypto/ec/curve448/scalar.c/#L166
|
d2a_code_trace_data_45735
|
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:946: error: Uninitialized Value
The value read from t7 was never initialized.
libavcodec/h264pred.c:946:32:
944. SRC(2,6)=SRC(3,4)=SRC(4,2)=SRC(5,0)= (t5 + t6 + 1) >> 1;
945. SRC(2,7)=SRC(3,5)=SRC(4,3)=SRC(5,1)= (t5 + 2*t6 + t7 + 2) >> 2;
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;
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/h264pred.c/#L946
|
d2a_code_trace_data_45736
|
static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
{
return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
}
ssl/record/ssl3_record.c:1433: error: INTEGER_OVERFLOW_L2
([1, +oo] - [0, 64]):unsigned64 by call to `ssl3_cbc_copy_mac`.
Showing all 10 steps of the trace
ssl/record/ssl3_record.c:1308:1: Parameter `s->rlayer.rrec.length`
1306. }
1307.
1308. > int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap)
1309. {
1310. int i, al;
ssl/record/ssl3_record.c:1348:5: Assignment
1346. /* decrypt in place in 'rr->input' */
1347. rr->data = rr->input;
1348. rr->orig_len = rr->length;
^
1349.
1350. if (SSL_USE_ETM(s) && s->read_hash) {
ssl/record/ssl3_record.c:1433:13: Call
1431. */
1432. mac = mac_tmp;
1433. ssl3_cbc_copy_mac(mac_tmp, rr, mac_size);
^
1434. rr->length -= mac_size;
1435. } else {
ssl/record/ssl3_record.c:1231:1: Parameter `md_size`
1229. #define CBC_MAC_ROTATE_IN_PLACE
1230.
1231. > void ssl3_cbc_copy_mac(unsigned char *out,
1232. const SSL3_RECORD *rec, size_t md_size)
1233. {
ssl/record/ssl3_record.c:1283:14: Call
1281. unsigned char b = rec->data[i];
1282. rotated_mac[j++] |= b & mac_started & ~mac_ended;
1283. j &= constant_time_lt_s(j, md_size);
^
1284. }
1285.
include/internal/constant_time_locl.h:117:1: <LHS trace>
115. }
116.
117. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
118. {
119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
include/internal/constant_time_locl.h:117:1: Parameter `a`
115. }
116.
117. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
118. {
119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
include/internal/constant_time_locl.h:117:1: <RHS trace>
115. }
116.
117. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
118. {
119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
include/internal/constant_time_locl.h:117:1: Parameter `b`
115. }
116.
117. > static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
118. {
119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
include/internal/constant_time_locl.h:119:12: Binary operation: ([1, +oo] - [0, 64]):unsigned64 by call to `ssl3_cbc_copy_mac`
117. static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
118. {
119. return constant_time_msb_s(a ^ ((a ^ b) | ((a - b) ^ b)));
^
120. }
121.
|
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/include/internal/constant_time_locl.h/#L119
|
d2a_code_trace_data_45737
|
int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
{
assert(pkt->subs != NULL && len != 0);
if (pkt->subs == NULL || len == 0)
return 0;
if (pkt->maxsize - pkt->written < len)
return 0;
if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) {
size_t newlen;
size_t reflen;
reflen = (len > pkt->buf->length) ? len : pkt->buf->length;
if (reflen > SIZE_MAX / 2) {
newlen = SIZE_MAX;
} else {
newlen = reflen * 2;
if (newlen < DEFAULT_BUF_SIZE)
newlen = DEFAULT_BUF_SIZE;
}
if (BUF_MEM_grow(pkt->buf, newlen) == 0)
return 0;
}
if (allocbytes != NULL)
*allocbytes = WPACKET_get_curr(pkt);
return 1;
}
ssl/statem/statem_srvr.c:2513: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 4]):unsigned64 by call to `tls_construct_extensions`.
Showing all 14 steps of the trace
ssl/statem/statem_srvr.c:2507:14: Call
2505. if (SSL_IS_TLS13(s)) {
2506. /* TODO(TLS1.3) for now send empty request context */
2507. if (!WPACKET_put_bytes_u8(pkt, 0)) {
^
2508. SSLerr(SSL_F_TLS_CONSTRUCT_CERTIFICATE_REQUEST,
2509. ERR_R_INTERNAL_ERROR);
ssl/packet.c:312:1: Parameter `pkt->buf->length`
310. }
311.
312. > int WPACKET_put_bytes__(WPACKET *pkt, unsigned int val, size_t size)
313. {
314. unsigned char *data;
ssl/statem/statem_srvr.c:2513:14: Call
2511. }
2512.
2513. if (!tls_construct_extensions(s, pkt,
^
2514. SSL_EXT_TLS1_3_CERTIFICATE_REQUEST, NULL,
2515. 0, &al)) {
ssl/statem/extensions.c:649:1: Parameter `pkt->written`
647. * failure construction stops at the first extension to fail to construct.
648. */
649. > int tls_construct_extensions(SSL *s, WPACKET *pkt, unsigned int context,
650. X509 *x, size_t chainidx, int *al)
651. {
ssl/statem/extensions.c:662:10: Call
660. tmpal = SSL_AD_INTERNAL_ERROR;
661.
662. if (!WPACKET_start_sub_packet_u16(pkt)
^
663. /*
664. * If extensions are of zero length then we don't even add the
ssl/packet.c:275:1: Parameter `pkt->written`
273. }
274.
275. > int WPACKET_start_sub_packet_len__(WPACKET *pkt, size_t lenbytes)
276. {
277. WPACKET_SUB *sub;
ssl/packet.c:299:10: Call
297. }
298.
299. if (!WPACKET_allocate_bytes(pkt, lenbytes, &lenchars))
^
300. return 0;
301. /* Convert to an offset in case the underlying BUF_MEM gets realloc'd */
ssl/packet.c:15:1: Parameter `pkt->written`
13. #define DEFAULT_BUF_SIZE 256
14.
15. > int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
ssl/packet.c:17:10: Call
15. int WPACKET_allocate_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
16. {
17. if (!WPACKET_reserve_bytes(pkt, len, allocbytes))
^
18. return 0;
19.
ssl/packet.c:39:1: <LHS trace>
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: Parameter `pkt->buf->length`
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: <RHS trace>
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:39:1: Parameter `len`
37. ? (p)->staticbuf : (unsigned char *)(p)->buf->data)
38.
39. > int WPACKET_reserve_bytes(WPACKET *pkt, size_t len, unsigned char **allocbytes)
40. {
41. /* Internal API, so should not fail */
ssl/packet.c:49:36: Binary operation: ([0, +oo] - [pkt->written, pkt->written + 4]):unsigned64 by call to `tls_construct_extensions`
47. return 0;
48.
49. if (pkt->staticbuf == NULL && (pkt->buf->length - pkt->written < len)) {
^
50. size_t newlen;
51. size_t reflen;
|
https://github.com/openssl/openssl/blob/e128f891de71bbdba8391355af8d6d47d20b1969/ssl/packet.c/#L49
|
d2a_code_trace_data_45738
|
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:290: error: Null Dereference
pointer `smk->mmap_tbl` last assigned on line 289 could be null and is dereferenced at line 290, column 9.
libavcodec/smacker.c:276:1: start of procedure decode_header_trees()
274. }
275.
276. static int decode_header_trees(SmackVContext *smk) {
^
277. GetBitContext gb;
278. int mmap_size, mclr_size, full_size, type_size;
libavcodec/smacker.c:280:5:
278. int mmap_size, mclr_size, full_size, type_size;
279.
280. mmap_size = AV_RL32(smk->avctx->extradata);
^
281. mclr_size = AV_RL32(smk->avctx->extradata + 4);
282. full_size = AV_RL32(smk->avctx->extradata + 8);
libavcodec/smacker.c:281:5:
279.
280. mmap_size = AV_RL32(smk->avctx->extradata);
281. mclr_size = AV_RL32(smk->avctx->extradata + 4);
^
282. full_size = AV_RL32(smk->avctx->extradata + 8);
283. type_size = AV_RL32(smk->avctx->extradata + 12);
libavcodec/smacker.c:282:5:
280. mmap_size = AV_RL32(smk->avctx->extradata);
281. mclr_size = AV_RL32(smk->avctx->extradata + 4);
282. full_size = AV_RL32(smk->avctx->extradata + 8);
^
283. type_size = AV_RL32(smk->avctx->extradata + 12);
284.
libavcodec/smacker.c:283:5:
281. mclr_size = AV_RL32(smk->avctx->extradata + 4);
282. full_size = AV_RL32(smk->avctx->extradata + 8);
283. type_size = AV_RL32(smk->avctx->extradata + 12);
^
284.
285. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
libavcodec/smacker.c:285:5:
283. type_size = AV_RL32(smk->avctx->extradata + 12);
284.
285. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
^
286.
287. 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 false 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:356:28: Taking false 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: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:287:9:
285. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
286.
287. if(!get_bits1(&gb)) {
^
288. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
289. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
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;
libavcodec/get_bits.h:273:5:
271. uint8_t result = s->buffer[index>>3];
272. #ifdef BITSTREAM_READER_LE
273. result >>= index & 7;
^
274. result &= 1;
275. #else
libavcodec/get_bits.h:274:5:
272. #ifdef BITSTREAM_READER_LE
273. result >>= index & 7;
274. result &= 1;
^
275. #else
276. result <<= index & 7;
libavcodec/get_bits.h:280:9: Taking false branch
278. #endif
279. #if !UNCHECKED_BITSTREAM_READER
280. if (s->index < s->size_in_bits_plus8)
^
281. #endif
282. index++;
libavcodec/get_bits.h:283:5:
281. #endif
282. index++;
283. s->index = index;
^
284.
285. return result;
libavcodec/get_bits.h:285:5:
283. s->index = index;
284.
285. return result;
^
286. }
287.
libavcodec/get_bits.h:286:1: return from a call to get_bits1
284.
285. return result;
286. }
^
287.
288. static inline unsigned int show_bits1(GetBitContext *s)
libavcodec/smacker.c:287:9: Taking true branch
285. init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
286.
287. if(!get_bits1(&gb)) {
^
288. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
289. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
libavcodec/smacker.c:288:9: Skipping av_log(): empty list of specs
286.
287. if(!get_bits1(&gb)) {
288. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
^
289. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
290. smk->mmap_tbl[0] = 0;
libavcodec/smacker.c:289:9:
287. if(!get_bits1(&gb)) {
288. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
289. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
^
290. smk->mmap_tbl[0] = 0;
291. 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:71:5:
69. #endif
70.
71. assert(size);
^
72.
73. /* let's disallow possible ambiguous cases */
libavutil/mem.c:74:9: Taking false branch
72.
73. /* let's disallow possible ambiguous cases */
74. if (size > (INT_MAX-32) || !size)
^
75. return NULL;
76.
libavutil/mem.c:74:33: Taking false branch
72.
73. /* let's disallow possible ambiguous cases */
74. if (size > (INT_MAX-32) || !size)
^
75. return NULL;
76.
libavutil/mem.c:85:9: Taking true branch
83. ((char*)ptr)[-1]= diff;
84. #elif HAVE_POSIX_MEMALIGN
85. if (posix_memalign(&ptr,32,size))
^
86. ptr = NULL;
87. #elif HAVE_ALIGNED_MALLOC
libavutil/mem.c:86:9:
84. #elif HAVE_POSIX_MEMALIGN
85. if (posix_memalign(&ptr,32,size))
86. ptr = NULL;
^
87. #elif HAVE_ALIGNED_MALLOC
88. ptr = _aligned_malloc(size, 32);
libavutil/mem.c:118:5:
116. ptr = malloc(size);
117. #endif
118. return ptr;
^
119. }
120.
libavutil/mem.c:119:1: return from a call to av_malloc
117. #endif
118. return ptr;
119. }
^
120.
121. void *av_realloc(void *ptr, size_t size)
libavcodec/smacker.c:290:9:
288. av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");
289. smk->mmap_tbl = av_malloc(sizeof(int) * 2);
290. smk->mmap_tbl[0] = 0;
^
291. smk->mmap_last[0] = smk->mmap_last[1] = smk->mmap_last[2] = 1;
292. } else {
|
https://github.com/libav/libav/blob/33bb63cb3e1de6d78c475cf14384089ef3f1867d/libavcodec/smacker.c/#L290
|
d2a_code_trace_data_45739
|
void CRYPTO_free(void *str)
{
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
if (call_malloc_debug) {
CRYPTO_mem_debug_free(str, 0);
free(str);
CRYPTO_mem_debug_free(str, 1);
} else {
free(str);
}
#else
free(str);
#endif
}
crypto/hmac/hmac.c:231: error: USE_AFTER_FREE
call to `EVP_MD_CTX_copy_ex()` eventually accesses memory that was invalidated by call to `free()` on line 229 indirectly during the call to `HMAC_CTX_reset()`.
Showing all 18 steps of the trace
crypto/hmac/hmac.c:227:1: invalidation part of the trace starts here
225. }
226.
227. > int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx)
228. {
229. if (!HMAC_CTX_reset(dctx))
crypto/hmac/hmac.c:227:1: parameter `dctx` of HMAC_CTX_copy
225. }
226.
227. > int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx)
228. {
229. if (!HMAC_CTX_reset(dctx))
crypto/hmac/hmac.c:229:10: when calling `HMAC_CTX_reset` here
227. int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx)
228. {
229. if (!HMAC_CTX_reset(dctx))
^
230. goto err;
231. if (!EVP_MD_CTX_copy_ex(dctx->i_ctx, sctx->i_ctx))
crypto/hmac/hmac.c:205:1: parameter `ctx` of HMAC_CTX_reset
203. }
204.
205. > int HMAC_CTX_reset(HMAC_CTX *ctx)
206. {
207. hmac_ctx_cleanup(ctx);
crypto/hmac/hmac.c:207:5: when calling `hmac_ctx_cleanup` here
205. int HMAC_CTX_reset(HMAC_CTX *ctx)
206. {
207. hmac_ctx_cleanup(ctx);
^
208. if (ctx->i_ctx == NULL)
209. ctx->i_ctx = EVP_MD_CTX_new();
crypto/hmac/hmac.c:184:1: parameter `ctx` of hmac_ctx_cleanup
182. }
183.
184. > static void hmac_ctx_cleanup(HMAC_CTX *ctx)
185. {
186. EVP_MD_CTX_reset(ctx->i_ctx);
crypto/hmac/hmac.c:186:5: when calling `EVP_MD_CTX_reset` here
184. static void hmac_ctx_cleanup(HMAC_CTX *ctx)
185. {
186. EVP_MD_CTX_reset(ctx->i_ctx);
^
187. EVP_MD_CTX_reset(ctx->o_ctx);
188. EVP_MD_CTX_reset(ctx->md_ctx);
crypto/evp/digest.c:123:1: parameter `ctx` of EVP_MD_CTX_reset
121.
122. /* This call frees resources associated with the context */
123. > int EVP_MD_CTX_reset(EVP_MD_CTX *ctx)
124. {
125. if (ctx == NULL)
crypto/evp/digest.c:137:9: when calling `CRYPTO_clear_free` here
135. if (ctx->digest && ctx->digest->ctx_size && ctx->md_data
136. && !EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_REUSE)) {
137. OPENSSL_clear_free(ctx->md_data, ctx->digest->ctx_size);
^
138. }
139. EVP_PKEY_CTX_free(ctx->pctx);
crypto/mem.c:249:1: parameter `str` of CRYPTO_clear_free
247. }
248.
249. > void CRYPTO_clear_free(void *str, size_t num)
250. {
251. if (str == NULL)
crypto/mem.c:255:5: when calling `CRYPTO_free` here
253. if (num)
254. OPENSSL_cleanse(str, num);
255. CRYPTO_free(str);
^
256. }
crypto/mem.c:234:1: parameter `str` of CRYPTO_free
232. }
233.
234. > void CRYPTO_free(void *str)
235. {
236. #ifndef OPENSSL_NO_CRYPTO_MDEBUG
crypto/mem.c:245:5: was invalidated by call to `free()`
243. }
244. #else
245. free(str);
^
246. #endif
247. }
crypto/hmac/hmac.c:227:1: use-after-lifetime part of the trace starts here
225. }
226.
227. > int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx)
228. {
229. if (!HMAC_CTX_reset(dctx))
crypto/hmac/hmac.c:227:1: parameter `dctx` of HMAC_CTX_copy
225. }
226.
227. > int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx)
228. {
229. if (!HMAC_CTX_reset(dctx))
crypto/hmac/hmac.c:231:10: when calling `EVP_MD_CTX_copy_ex` here
229. if (!HMAC_CTX_reset(dctx))
230. goto err;
231. if (!EVP_MD_CTX_copy_ex(dctx->i_ctx, sctx->i_ctx))
^
232. goto err;
233. if (!EVP_MD_CTX_copy_ex(dctx->o_ctx, sctx->o_ctx))
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_45740
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
crypto/rsa/rsa_eay.c:236: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked`.
Showing all 28 steps of the trace
crypto/rsa/rsa_eay.c:194:2: Call
192.
193. if ((ctx=BN_CTX_new()) == NULL) goto err;
194. BN_CTX_start(ctx);
^
195. f = BN_CTX_get(ctx);
196. ret = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/rsa/rsa_eay.c:236:2: Call
234. }
235.
236. MONT_HELPER(rsa->_method_mod_n, ctx, rsa->n, rsa->flags & RSA_FLAG_CACHE_PUBLIC, goto err);
^
237.
238. if (!rsa->meth->bn_mod_exp(ret,f,rsa->e,rsa->n,ctx,
crypto/bn/bn_mont.c:530:1: Parameter `ctx->stack.depth`
528. }
529.
530. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,
531. const BIGNUM *mod, BN_CTX *ctx)
532. {
crypto/bn/bn_mont.c:546:16: Call
544. {
545. ret = BN_MONT_CTX_new();
546. if (ret && !BN_MONT_CTX_set(ret, mod, ctx))
^
547. BN_MONT_CTX_free(ret);
548. else
crypto/bn/bn_mont.c:412:1: Parameter `ctx->stack.depth`
410. }
411.
412. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
413. {
414. int ret = 0;
crypto/bn/bn_mont.c:417:2: Call
415. BIGNUM *Ri,*R;
416.
417. BN_CTX_start(ctx);
^
418. if((Ri = BN_CTX_get(ctx)) == NULL) goto err;
419. R= &(mont->RR); /* grab RR as a temp */
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_mont.c:473:8: Call
471. tmod.top = buf[0] != 0 ? 1 : 0;
472. /* Ri = R^-1 mod N*/
473. if ((BN_mod_inverse(Ri,R,&tmod,ctx)) == NULL)
^
474. goto err;
475. if (!BN_lshift(Ri,Ri,BN_BITS2)) goto err; /* R*Ri */
crypto/bn/bn_gcd.c:208:1: Parameter `ctx->stack.depth`
206. static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
207. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
208. > BIGNUM *BN_mod_inverse(BIGNUM *in,
209. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
210. {
crypto/bn/bn_gcd.c:217:10: Call
215. if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0))
216. {
217. return BN_mod_inverse_no_branch(in, a, n, ctx);
^
218. }
219.
crypto/bn/bn_gcd.c:506:1: Parameter `ctx->stack.depth`
504. * It does not contain branches that may leak sensitive information.
505. */
506. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
507. const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
508. {
crypto/bn/bn_gcd.c:518:2: Call
516. bn_check_top(n);
517.
518. BN_CTX_start(ctx);
^
519. A = BN_CTX_get(ctx);
520. B = BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gcd.c:547:8: Call
545. pB = &local_B;
546. BN_with_flags(pB, B, BN_FLG_CONSTTIME);
547. if (!BN_nnmod(B, pB, A, ctx)) goto err;
^
548. }
549. sign = -1;
crypto/bn/bn_mod.c:127:1: Parameter `ctx->stack.depth`
125.
126.
127. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
128. {
129. /* like BN_mod, but returns non-negative remainder
crypto/bn/bn_mod.c:132:8: Call
130. * (i.e., 0 <= r < |d| always holds) */
131.
132. if (!(BN_mod(r,m,d,ctx)))
^
133. return 0;
134. if (!r->neg)
crypto/bn/bn_div.c:181:1: Parameter `ctx->stack.depth`
179. static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
180. const BIGNUM *divisor, BN_CTX *ctx);
181. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
182. BN_CTX *ctx)
183. {
crypto/bn/bn_div.c:192:10: Call
190. if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0))
191. {
192. return BN_div_no_branch(dv, rm, num, divisor, ctx);
^
193. }
194.
crypto/bn/bn_div.c:414:1: Parameter `ctx->stack.depth`
412. * branches that may leak sensitive information.
413. */
414. > static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
415. const BIGNUM *divisor, BN_CTX *ctx)
416. {
crypto/bn/bn_div.c:434:2: Call
432. }
433.
434. BN_CTX_start(ctx);
^
435. tmp=BN_CTX_get(ctx);
436. snum=BN_CTX_get(ctx);
crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
253. }
254.
255. > void BN_CTX_start(BN_CTX *ctx)
256. {
257. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_div.c:630:2: Call
628. }
629. bn_correct_top(res);
630. BN_CTX_end(ctx);
^
631. return(1);
632. err:
crypto/bn/bn_ctx.c:270:1: Parameter `ctx->stack.depth`
268. }
269.
270. > void BN_CTX_end(BN_CTX *ctx)
271. {
272. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:277:21: Call
275. else
276. {
277. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
278. /* Does this stack frame have anything to release? */
279. if(fp < ctx->used)
crypto/bn/bn_ctx.c:351:1: <LHS trace>
349. }
350.
351. > static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:351:1: Parameter `st->depth`
349. }
350.
351. > static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_MONT_CTX_set_locked`
351. static unsigned int BN_STACK_pop(BN_STACK *st)
352. {
353. return st->indexes[--(st->depth)];
^
354. }
355.
|
https://github.com/openssl/openssl/blob/56c7754cab3da9745e52e36b0bf998f8356fd6d5/crypto/bn/bn_ctx.c/#L353
|
d2a_code_trace_data_45741
|
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
test/bntest.c:1569: error: BUFFER_OVERRUN_L3
Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_sqr`.
Showing all 16 steps of the trace
test/bntest.c:1546:1: Parameter `ctx->stack.depth`
1544. }
1545.
1546. > int test_gf2m_mod_sqrt(BIO *bp, BN_CTX *ctx)
1547. {
1548. BIGNUM *a, *b[2], *c, *d, *e, *f;
test/bntest.c:1568:13: Call
1566. for (j = 0; j < 2; j++) {
1567. BN_GF2m_mod(c, a, b[j]);
1568. BN_GF2m_mod_sqrt(d, a, b[j], ctx);
^
1569. BN_GF2m_mod_sqr(e, d, b[j], ctx);
1570. BN_GF2m_add(f, c, e);
crypto/bn/bn_gf2m.c:1016:1: Parameter `ctx->stack.depth`
1014. * for best performance, use the BN_GF2m_mod_sqrt_arr function.
1015. */
1016. > int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
1017. {
1018. int ret = 0;
test/bntest.c:1569:13: Call
1567. BN_GF2m_mod(c, a, b[j]);
1568. BN_GF2m_mod_sqrt(d, a, b[j], ctx);
1569. BN_GF2m_mod_sqr(e, d, b[j], ctx);
^
1570. BN_GF2m_add(f, c, e);
1571. /* Test that d^2 = a, where d = sqrt(a). */
crypto/bn/bn_gf2m.c:532:1: Parameter `ctx->stack.depth`
530. * use the BN_GF2m_mod_sqr_arr function.
531. */
532. > int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
533. {
534. int ret = 0;
crypto/bn/bn_gf2m.c:547:11: Call
545. goto err;
546. }
547. ret = BN_GF2m_mod_sqr_arr(r, a, arr, ctx);
^
548. bn_check_top(r);
549. err:
crypto/bn/bn_gf2m.c:504:5: Call
502.
503. bn_check_top(a);
504. BN_CTX_start(ctx);
^
505. if ((s = BN_CTX_get(ctx)) == NULL)
506. goto err;
crypto/bn/bn_ctx.c:181:1: Parameter `*ctx->stack.indexes`
179. }
180.
181. > void BN_CTX_start(BN_CTX *ctx)
182. {
183. CTXDBG_ENTRY("BN_CTX_start", ctx);
crypto/bn/bn_gf2m.c:522:5: Call
520. ret = 1;
521. err:
522. BN_CTX_end(ctx);
^
523. return ret;
524. }
crypto/bn/bn_ctx.c:195:1: Parameter `*ctx->stack.indexes`
193. }
194.
195. > void BN_CTX_end(BN_CTX *ctx)
196. {
197. CTXDBG_ENTRY("BN_CTX_end", ctx);
crypto/bn/bn_ctx.c:201:27: Call
199. ctx->err_stack--;
200. else {
201. unsigned int fp = BN_STACK_pop(&ctx->stack);
^
202. /* Does this stack frame have anything to release? */
203. if (fp < ctx->used)
crypto/bn/bn_ctx.c:271:1: <Offset trace>
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: Parameter `st->depth`
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: <Length trace>
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:271:1: Parameter `*st->indexes`
269. }
270.
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
crypto/bn/bn_ctx.c:273:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_sqr`
271. static unsigned int BN_STACK_pop(BN_STACK *st)
272. {
273. return st->indexes[--(st->depth)];
^
274. }
275.
|
https://github.com/openssl/openssl/blob/b3618f44a7b8504bfb0a64e8a33e6b8e56d4d516/crypto/bn/bn_ctx.c/#L273
|
d2a_code_trace_data_45742
|
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:640: error: INTEGER_OVERFLOW_L2
([0, +oo] - 1):unsigned64 by call to `SSL_free`.
Showing all 16 steps of the trace
test/sslapitest.c:632:17: Call
630. /* First just do various checks getting and setting tlsext_status_type */
631.
632. clientssl = SSL_new(cctx);
^
633. if (!TEST_int_eq(SSL_get_tlsext_status_type(clientssl), -1)
634. || !TEST_true(SSL_set_tlsext_status_type(clientssl,
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:640:5: Call
638. goto end;
639.
640. SSL_free(clientssl);
^
641. clientssl = NULL;
642.
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_45743
|
static void opt_vstats (void)
{
char filename[40];
time_t today2 = time(NULL);
struct tm *today = localtime(&today2);
snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
today->tm_sec);
opt_vstats_file(filename);
}
ffmpeg.c:4092: error: Null Dereference
pointer `today` last assigned on line 4090 could be null and is dereferenced at line 4092, column 69.
ffmpeg.c:4086:1: start of procedure opt_vstats()
4084. }
4085.
4086. static void opt_vstats (void)
^
4087. {
4088. char filename[40];
ffmpeg.c:4089:5:
4087. {
4088. char filename[40];
4089. time_t today2 = time(NULL);
^
4090. struct tm *today = localtime(&today2);
4091.
ffmpeg.c:4090:5:
4088. char filename[40];
4089. time_t today2 = time(NULL);
4090. struct tm *today = localtime(&today2);
^
4091.
4092. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
ffmpeg.c:4092:5:
4090. struct tm *today = localtime(&today2);
4091.
4092. snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
^
4093. today->tm_sec);
4094. opt_vstats_file(filename);
|
https://github.com/libav/libav/blob/66b84e4ab2fc96222dab32173d84f4a403129deb/ffmpeg.c/#L4092
|
d2a_code_trace_data_45744
|
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:1590: error: INTEGER_OVERFLOW_L2
([0, +oo] - [`pkt->written`, `pkt->written` + 37]):unsigned64 by call to `WPACKET_sub_memcpy__`.
Showing all 18 steps of the trace
ssl/statem/statem_srvr.c:1538:1: Parameter `pkt->written`
1536. }
1537.
1538. > int tls_construct_server_hello(SSL *s, WPACKET *pkt)
1539. {
1540. int compm, al = SSL_AD_INTERNAL_ERROR;
ssl/statem/statem_srvr.c:1543:10: Call
1541. size_t sl, len;
1542.
1543. if (!WPACKET_put_bytes_u16(pkt, s->version)
^
1544. /*
1545. * Random stuff. Filling of the server_random takes place in
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:1548:17: Call
1546. * tls_process_client_hello()
1547. */
1548. || !WPACKET_memcpy(pkt, s->s3->server_random, SSL3_RANDOM_SIZE)) {
^
1549. SSLerr(SSL_F_TLS_CONSTRUCT_SERVER_HELLO, ERR_R_INTERNAL_ERROR);
1550. goto err;
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/statem/statem_srvr.c:1590:10: Call
1588. #endif
1589.
1590. if (!WPACKET_sub_memcpy_u8(pkt, s->session->session_id, sl)
^
1591. || !s->method->put_cipher_by_char(s->s3->tmp.new_cipher, pkt, &len)
1592. || !WPACKET_put_bytes_u8(pkt, compm)
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 + 37]):unsigned64 by call to `WPACKET_sub_memcpy__`
44. return 0;
45.
46. if (pkt->buf->length - pkt->written < len) {
^
47. size_t newlen;
48. size_t reflen;
|
https://github.com/openssl/openssl/blob/6438632420cee9821409221ef6717edc5ee408c1/ssl/packet.c/#L46
|
d2a_code_trace_data_45745
|
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
{
unsigned long hash;
OPENSSL_LH_NODE *nn, **rn;
void *ret;
lh->error = 0;
rn = getrn(lh, data, &hash);
if (*rn == NULL) {
lh->num_no_delete++;
return (NULL);
} else {
nn = *rn;
*rn = nn->next;
ret = nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
contract(lh);
return (ret);
}
ssl/record/rec_layer_d1.c:802: error: INTEGER_OVERFLOW_L2
([0, max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `SSL_CTX_remove_session`.
Showing all 11 steps of the trace
ssl/record/rec_layer_d1.c:338:1: Parameter `s->initial_ctx->sessions->num_items`
336. * none of our business
337. */
338. > int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf,
339. size_t len, int peek, size_t *readbytes)
340. {
ssl/record/rec_layer_d1.c:802:13: Call
800. ERR_add_error_data(2, "SSL alert number ", tmp);
801. s->shutdown |= SSL_RECEIVED_SHUTDOWN;
802. SSL_CTX_remove_session(s->session_ctx, s->session);
^
803. return 0;
804. } else {
ssl/ssl_sess.c:698:1: Parameter `ctx->sessions->num_items`
696. }
697.
698. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
699. {
700. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:700:12: Call
698. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
699. {
700. return remove_session_lock(ctx, c, 1);
^
701. }
702.
ssl/ssl_sess.c:703:1: Parameter `ctx->sessions->num_items`
701. }
702.
703. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
704. {
705. SSL_SESSION *r;
ssl/ssl_sess.c:713:17: Call
711. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
712. ret = 1;
713. r = lh_SSL_SESSION_delete(ctx->sessions, c);
^
714. SSL_SESSION_list_remove(ctx, c);
715. }
ssl/ssl_locl.h:598:1: Parameter `lh->num_items`
596. };
597.
598. > DEFINE_LHASH_OF(SSL_SESSION);
599. /* Needed in ssl_cert.c */
600. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:598:1: Call
596. };
597.
598. > DEFINE_LHASH_OF(SSL_SESSION);
599. /* Needed in ssl_cert.c */
600. DEFINE_LHASH_OF(X509_NAME);
crypto/lhash/lhash.c:103:1: <LHS trace>
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:103:1: Parameter `lh->num_items`
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:123:5: Binary operation: ([0, max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `SSL_CTX_remove_session`
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/6438632420cee9821409221ef6717edc5ee408c1/crypto/lhash/lhash.c/#L123
|
d2a_code_trace_data_45746
|
DH *ssl_get_auto_dh(SSL *s)
{
int dh_secbits = 80;
if (s->cert->dh_tmp_auto == 2)
return DH_get_1024_160();
if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
if (s->s3->tmp.new_cipher->strength_bits == 256)
dh_secbits = 128;
else
dh_secbits = 80;
} else {
CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
}
if (dh_secbits >= 128) {
DH *dhp = DH_new();
BIGNUM *p, *g;
if (dhp == NULL)
return NULL;
g = BN_new();
if (g != NULL)
BN_set_word(g, 2);
if (dh_secbits >= 192)
p = BN_get_rfc3526_prime_8192(NULL);
else
p = BN_get_rfc3526_prime_3072(NULL);
if (p == NULL || g == NULL || !DH_set0_pqg(dhp, p, NULL, g)) {
DH_free(dhp);
BN_free(p);
BN_free(g);
return NULL;
}
return dhp;
}
if (dh_secbits >= 112)
return DH_get_2048_224();
return DH_get_1024_160();
}
ssl/t1_lib.c:3973: error: NULL_DEREFERENCE
pointer `cpk` last assigned on line 3972 could be null and is dereferenced at line 3973, column 45.
Showing all 30 steps of the trace
ssl/t1_lib.c:3961:1: start of procedure ssl_get_auto_dh()
3959.
3960. #ifndef OPENSSL_NO_DH
3961. > DH *ssl_get_auto_dh(SSL *s)
3962. {
3963. int dh_secbits = 80;
ssl/t1_lib.c:3963:5:
3961. DH *ssl_get_auto_dh(SSL *s)
3962. {
3963. > int dh_secbits = 80;
3964. if (s->cert->dh_tmp_auto == 2)
3965. return DH_get_1024_160();
ssl/t1_lib.c:3964:9: Taking false branch
3962. {
3963. int dh_secbits = 80;
3964. if (s->cert->dh_tmp_auto == 2)
^
3965. return DH_get_1024_160();
3966. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
ssl/t1_lib.c:3966:9: Taking false branch
3964. if (s->cert->dh_tmp_auto == 2)
3965. return DH_get_1024_160();
3966. if (s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL | SSL_aPSK)) {
^
3967. if (s->s3->tmp.new_cipher->strength_bits == 256)
3968. dh_secbits = 128;
ssl/t1_lib.c:3972:9:
3970. dh_secbits = 80;
3971. } else {
3972. > CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
3973. dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
3974. }
ssl/ssl_lib.c:2772:1: start of procedure ssl_get_server_send_pkey()
2770. }
2771.
2772. > CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
2773. {
2774. CERT *c;
ssl/ssl_lib.c:2777:5:
2775. int i;
2776.
2777. > c = s->cert;
2778. if (!s->s3 || !s->s3->tmp.new_cipher)
2779. return NULL;
ssl/ssl_lib.c:2778:10: Taking false branch
2776.
2777. c = s->cert;
2778. if (!s->s3 || !s->s3->tmp.new_cipher)
^
2779. return NULL;
2780. ssl_set_masks(s);
ssl/ssl_lib.c:2778:20: Taking false branch
2776.
2777. c = s->cert;
2778. if (!s->s3 || !s->s3->tmp.new_cipher)
^
2779. return NULL;
2780. ssl_set_masks(s);
ssl/ssl_lib.c:2780:5: Skipping ssl_set_masks(): empty list of specs
2778. if (!s->s3 || !s->s3->tmp.new_cipher)
2779. return NULL;
2780. ssl_set_masks(s);
^
2781.
2782. i = ssl_get_server_cert_index(s);
ssl/ssl_lib.c:2782:5:
2780. ssl_set_masks(s);
2781.
2782. > i = ssl_get_server_cert_index(s);
2783.
2784. /* This may or may not be an error. */
ssl/ssl_lib.c:2751:1: start of procedure ssl_get_server_cert_index()
2749. #endif
2750.
2751. > static int ssl_get_server_cert_index(const SSL *s)
2752. {
2753. int idx;
ssl/ssl_lib.c:2754:5:
2752. {
2753. int idx;
2754. > idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2755. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
2756. idx = SSL_PKEY_RSA_SIGN;
ssl/ssl_ciph.c:1872:1: start of procedure ssl_cipher_get_cert_index()
1870.
1871. /* For a cipher return the index corresponding to the certificate type */
1872. > int ssl_cipher_get_cert_index(const SSL_CIPHER *c)
1873. {
1874. uint32_t alg_a;
ssl/ssl_ciph.c:1876:5:
1874. uint32_t alg_a;
1875.
1876. > alg_a = c->algorithm_auth;
1877.
1878. if (alg_a & SSL_aECDSA)
ssl/ssl_ciph.c:1878:9: Taking false branch
1876. alg_a = c->algorithm_auth;
1877.
1878. if (alg_a & SSL_aECDSA)
^
1879. return SSL_PKEY_ECC;
1880. else if (alg_a & SSL_aDSS)
ssl/ssl_ciph.c:1880:14: Taking false branch
1878. if (alg_a & SSL_aECDSA)
1879. return SSL_PKEY_ECC;
1880. else if (alg_a & SSL_aDSS)
^
1881. return SSL_PKEY_DSA_SIGN;
1882. else if (alg_a & SSL_aRSA)
ssl/ssl_ciph.c:1882:14: Taking true branch
1880. else if (alg_a & SSL_aDSS)
1881. return SSL_PKEY_DSA_SIGN;
1882. else if (alg_a & SSL_aRSA)
^
1883. return SSL_PKEY_RSA_ENC;
1884. else if (alg_a & SSL_aGOST12)
ssl/ssl_ciph.c:1883:9:
1881. return SSL_PKEY_DSA_SIGN;
1882. else if (alg_a & SSL_aRSA)
1883. > return SSL_PKEY_RSA_ENC;
1884. else if (alg_a & SSL_aGOST12)
1885. return SSL_PKEY_GOST_EC;
ssl/ssl_ciph.c:1890:1: return from a call to ssl_cipher_get_cert_index
1888.
1889. return -1;
1890. > }
1891.
1892. const SSL_CIPHER *ssl_get_cipher_by_char(SSL *ssl, const unsigned char *ptr)
ssl/ssl_lib.c:2755:9: Taking true branch
2753. int idx;
2754. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2755. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
^
2756. idx = SSL_PKEY_RSA_SIGN;
2757. if (idx == SSL_PKEY_GOST_EC) {
ssl/ssl_lib.c:2755:37: Taking false branch
2753. int idx;
2754. idx = ssl_cipher_get_cert_index(s->s3->tmp.new_cipher);
2755. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
^
2756. idx = SSL_PKEY_RSA_SIGN;
2757. if (idx == SSL_PKEY_GOST_EC) {
ssl/ssl_lib.c:2757:9: Taking false branch
2755. if (idx == SSL_PKEY_RSA_ENC && !s->cert->pkeys[SSL_PKEY_RSA_ENC].x509)
2756. idx = SSL_PKEY_RSA_SIGN;
2757. if (idx == SSL_PKEY_GOST_EC) {
^
2758. if (s->cert->pkeys[SSL_PKEY_GOST12_512].x509)
2759. idx = SSL_PKEY_GOST12_512;
ssl/ssl_lib.c:2767:9: Taking false branch
2765. idx = -1;
2766. }
2767. if (idx == -1)
^
2768. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2769. return idx;
ssl/ssl_lib.c:2769:5:
2767. if (idx == -1)
2768. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2769. > return idx;
2770. }
2771.
ssl/ssl_lib.c:2770:1: return from a call to ssl_get_server_cert_index
2768. SSLerr(SSL_F_SSL_GET_SERVER_CERT_INDEX, ERR_R_INTERNAL_ERROR);
2769. return idx;
2770. > }
2771.
2772. CERT_PKEY *ssl_get_server_send_pkey(SSL *s)
ssl/ssl_lib.c:2785:9: Taking true branch
2783.
2784. /* This may or may not be an error. */
2785. if (i < 0)
^
2786. return NULL;
2787.
ssl/ssl_lib.c:2786:9:
2784. /* This may or may not be an error. */
2785. if (i < 0)
2786. > return NULL;
2787.
2788. /* May be NULL. */
ssl/ssl_lib.c:2790:1: return from a call to ssl_get_server_send_pkey
2788. /* May be NULL. */
2789. return &c->pkeys[i];
2790. > }
2791.
2792. EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher,
ssl/t1_lib.c:3973:9:
3971. } else {
3972. CERT_PKEY *cpk = ssl_get_server_send_pkey(s);
3973. > dh_secbits = EVP_PKEY_security_bits(cpk->privatekey);
3974. }
3975.
|
https://github.com/openssl/openssl/blob/869d0a37cfa7cfdbd42026d2b75d14cdc64e81e0/ssl/t1_lib.c/#L3973
|
d2a_code_trace_data_45747
|
static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
{
VideoData *img = s->priv_data;
ByteIOContext *pb[3];
char filename[1024];
AVCodecContext *codec= s->streams[ pkt->stream_index ]->codec;
int i;
if (!img->is_pipe) {
if (av_get_frame_filename(filename, sizeof(filename),
img->path, img->img_number) < 0 && img->img_number>1)
return AVERROR(EIO);
for(i=0; i<3; i++){
if (url_fopen(&pb[i], filename, URL_WRONLY) < 0)
return AVERROR(EIO);
if(codec->codec_id != CODEC_ID_RAWVIDEO)
break;
filename[ strlen(filename) - 1 ]= 'U' + i;
}
} else {
pb[0] = s->pb;
}
if(codec->codec_id == CODEC_ID_RAWVIDEO){
int ysize = codec->width * codec->height;
put_buffer(pb[0], pkt->data , ysize);
put_buffer(pb[1], pkt->data + ysize, (pkt->size - ysize)/2);
put_buffer(pb[2], pkt->data + ysize +(pkt->size - ysize)/2, (pkt->size - ysize)/2);
put_flush_packet(pb[1]);
put_flush_packet(pb[2]);
url_fclose(pb[1]);
url_fclose(pb[2]);
}else{
put_buffer(pb[0], pkt->data, pkt->size);
}
put_flush_packet(pb[0]);
if (!img->is_pipe) {
url_fclose(pb[0]);
}
img->img_number++;
return 0;
}
libavformat/img2.c:349: error: Buffer Overrun L3
Offset: [-1, +oo] Size: 1024.
libavformat/img2.c:331:1: <Offset trace>
329. }
330.
331. static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
^
332. {
333. VideoData *img = s->priv_data;
libavformat/img2.c:331:1: Array declaration
329. }
330.
331. static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
^
332. {
333. VideoData *img = s->priv_data;
libavformat/img2.c:331:1: <Length trace>
329. }
330.
331. static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
^
332. {
333. VideoData *img = s->priv_data;
libavformat/img2.c:331:1: Array declaration
329. }
330.
331. static int img_write_packet(AVFormatContext *s, AVPacket *pkt)
^
332. {
333. VideoData *img = s->priv_data;
libavformat/img2.c:349:13: Array access: Offset: [-1, +oo] Size: 1024
347. if(codec->codec_id != CODEC_ID_RAWVIDEO)
348. break;
349. filename[ strlen(filename) - 1 ]= 'U' + i;
^
350. }
351. } else {
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavformat/img2.c/#L349
|
d2a_code_trace_data_45748
|
static int check_cert(X509_STORE_CTX *ctx)
{
X509_CRL *crl = NULL, *dcrl = NULL;
X509 *x = NULL;
int ok = 0, cnum = 0;
unsigned int last_reasons = 0;
cnum = ctx->error_depth;
x = sk_X509_value(ctx->chain, cnum);
ctx->current_cert = x;
ctx->current_issuer = NULL;
ctx->current_crl_score = 0;
ctx->current_reasons = 0;
while (ctx->current_reasons != CRLDP_ALL_REASONS) {
last_reasons = ctx->current_reasons;
if (ctx->get_crl)
ok = ctx->get_crl(ctx, &crl, x);
else
ok = get_crl_delta(ctx, &crl, &dcrl, x);
if (!ok) {
ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL;
ok = ctx->verify_cb(0, ctx);
goto err;
}
ctx->current_crl = crl;
ok = ctx->check_crl(ctx, crl);
if (!ok)
goto err;
if (dcrl) {
ok = ctx->check_crl(ctx, dcrl);
if (!ok)
goto err;
ok = ctx->cert_crl(ctx, dcrl, x);
if (!ok)
goto err;
} else
ok = 1;
if (ok != 2) {
ok = ctx->cert_crl(ctx, crl, x);
if (!ok)
goto err;
}
X509_CRL_free(crl);
X509_CRL_free(dcrl);
crl = NULL;
dcrl = NULL;
if (last_reasons == ctx->current_reasons) {
ctx->error = X509_V_ERR_UNABLE_TO_GET_CRL;
ok = ctx->verify_cb(0, ctx);
goto err;
}
}
err:
X509_CRL_free(crl);
X509_CRL_free(dcrl);
ctx->current_crl = NULL;
return ok;
}
crypto/x509/x509_vfy.c:735: error: NULL_DEREFERENCE
pointer `x` last assigned on line 724 could be null and is dereferenced by call to `get_crl_delta()` at line 735, column 18.
Showing all 22 steps of the trace
crypto/x509/x509_vfy.c:717:1: start of procedure check_cert()
715. }
716.
717. > static int check_cert(X509_STORE_CTX *ctx)
718. {
719. X509_CRL *crl = NULL, *dcrl = NULL;
crypto/x509/x509_vfy.c:719:5:
717. static int check_cert(X509_STORE_CTX *ctx)
718. {
719. > X509_CRL *crl = NULL, *dcrl = NULL;
720. X509 *x = NULL;
721. int ok = 0, cnum = 0;
crypto/x509/x509_vfy.c:720:5:
718. {
719. X509_CRL *crl = NULL, *dcrl = NULL;
720. > X509 *x = NULL;
721. int ok = 0, cnum = 0;
722. unsigned int last_reasons = 0;
crypto/x509/x509_vfy.c:721:5:
719. X509_CRL *crl = NULL, *dcrl = NULL;
720. X509 *x = NULL;
721. > int ok = 0, cnum = 0;
722. unsigned int last_reasons = 0;
723. cnum = ctx->error_depth;
crypto/x509/x509_vfy.c:722:5:
720. X509 *x = NULL;
721. int ok = 0, cnum = 0;
722. > unsigned int last_reasons = 0;
723. cnum = ctx->error_depth;
724. x = sk_X509_value(ctx->chain, cnum);
crypto/x509/x509_vfy.c:723:5:
721. int ok = 0, cnum = 0;
722. unsigned int last_reasons = 0;
723. > cnum = ctx->error_depth;
724. x = sk_X509_value(ctx->chain, cnum);
725. ctx->current_cert = x;
crypto/x509/x509_vfy.c:724:5:
722. unsigned int last_reasons = 0;
723. cnum = ctx->error_depth;
724. > x = sk_X509_value(ctx->chain, cnum);
725. ctx->current_cert = x;
726. ctx->current_issuer = NULL;
include/openssl/x509.h:170:1: start of procedure sk_X509_value()
168. typedef struct x509_cinf_st X509_CINF;
169.
170. > DEFINE_STACK_OF(X509)
171.
172. /* This is used for a table of trust checking functions */
crypto/stack/stack.c:324:1: start of procedure sk_value()
322. }
323.
324. > void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
crypto/stack/stack.c:326:10: Taking false branch
324. void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
^
327. return NULL;
328. return st->data[i];
crypto/stack/stack.c:326:17: Taking true branch
324. void *sk_value(const _STACK *st, int i)
325. {
326. if (!st || (i < 0) || (i >= st->num))
^
327. return NULL;
328. return st->data[i];
crypto/stack/stack.c:327:9:
325. {
326. if (!st || (i < 0) || (i >= st->num))
327. > return NULL;
328. return st->data[i];
329. }
crypto/stack/stack.c:329:1: return from a call to sk_value
327. return NULL;
328. return st->data[i];
329. > }
330.
331. void *sk_set(_STACK *st, int i, void *value)
include/openssl/x509.h:170:1: return from a call to sk_X509_value
168. typedef struct x509_cinf_st X509_CINF;
169.
170. > DEFINE_STACK_OF(X509)
171.
172. /* This is used for a table of trust checking functions */
crypto/x509/x509_vfy.c:725:5:
723. cnum = ctx->error_depth;
724. x = sk_X509_value(ctx->chain, cnum);
725. > ctx->current_cert = x;
726. ctx->current_issuer = NULL;
727. ctx->current_crl_score = 0;
crypto/x509/x509_vfy.c:726:5:
724. x = sk_X509_value(ctx->chain, cnum);
725. ctx->current_cert = x;
726. > ctx->current_issuer = NULL;
727. ctx->current_crl_score = 0;
728. ctx->current_reasons = 0;
crypto/x509/x509_vfy.c:727:5:
725. ctx->current_cert = x;
726. ctx->current_issuer = NULL;
727. > ctx->current_crl_score = 0;
728. ctx->current_reasons = 0;
729. while (ctx->current_reasons != CRLDP_ALL_REASONS) {
crypto/x509/x509_vfy.c:728:5:
726. ctx->current_issuer = NULL;
727. ctx->current_crl_score = 0;
728. > ctx->current_reasons = 0;
729. while (ctx->current_reasons != CRLDP_ALL_REASONS) {
730. last_reasons = ctx->current_reasons;
crypto/x509/x509_vfy.c:729:12: Loop condition is true. Entering loop body
727. ctx->current_crl_score = 0;
728. ctx->current_reasons = 0;
729. while (ctx->current_reasons != CRLDP_ALL_REASONS) {
^
730. last_reasons = ctx->current_reasons;
731. /* Try to retrieve relevant CRL */
crypto/x509/x509_vfy.c:730:9:
728. ctx->current_reasons = 0;
729. while (ctx->current_reasons != CRLDP_ALL_REASONS) {
730. > last_reasons = ctx->current_reasons;
731. /* Try to retrieve relevant CRL */
732. if (ctx->get_crl)
crypto/x509/x509_vfy.c:732:13: Taking false branch
730. last_reasons = ctx->current_reasons;
731. /* Try to retrieve relevant CRL */
732. if (ctx->get_crl)
^
733. ok = ctx->get_crl(ctx, &crl, x);
734. else
crypto/x509/x509_vfy.c:735:13:
733. ok = ctx->get_crl(ctx, &crl, x);
734. else
735. > ok = get_crl_delta(ctx, &crl, &dcrl, x);
736. /*
737. * If error looking up CRL, nothing we can do except notify callback
|
https://github.com/openssl/openssl/blob/25be7a0feacdbd3326774f0da8aaeb966c1f57f8/crypto/x509/x509_vfy.c/#L735
|
d2a_code_trace_data_45749
|
void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
{
unsigned long hash;
OPENSSL_LH_NODE *nn, **rn;
void *ret;
lh->error = 0;
rn = getrn(lh, data, &hash);
if (*rn == NULL) {
lh->num_no_delete++;
return (NULL);
} else {
nn = *rn;
*rn = nn->next;
ret = nn->data;
OPENSSL_free(nn);
lh->num_delete++;
}
lh->num_items--;
if ((lh->num_nodes > MIN_NODES) &&
(lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
contract(lh);
return (ret);
}
ssl/ssl_sess.c:588: error: INTEGER_OVERFLOW_L2
([0, 1+max(0, `s->initial_ctx->sessions->num_items`)] - 1):unsigned64 by call to `ssl3_send_alert`.
Showing all 13 steps of the trace
ssl/ssl_sess.c:438:1: Parameter `s->initial_ctx->sessions->num_items`
436. * if the server should issue a new session ticket (to 0 otherwise).
437. */
438. > int ssl_get_prev_session(SSL *s, const PACKET *ext, const PACKET *session_id)
439. {
440. /* This is used only by servers. */
ssl/ssl_sess.c:588:13: Call
586. if (!(s->s3->flags & TLS1_FLAGS_RECEIVED_EXTMS)) {
587. SSLerr(SSL_F_SSL_GET_PREV_SESSION, SSL_R_INCONSISTENT_EXTMS);
588. ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE);
^
589. fatal = 1;
590. goto err;
ssl/s3_msg.c:64:1: Parameter `s->initial_ctx->sessions->num_items`
62. }
63.
64. > int ssl3_send_alert(SSL *s, int level, int desc)
65. {
66. /* Map tls/ssl alert value to correct one */
ssl/s3_msg.c:75:9: Call
73. /* If a fatal one, remove from cache */
74. if ((level == SSL3_AL_FATAL) && (s->session != NULL))
75. SSL_CTX_remove_session(s->session_ctx, s->session);
^
76.
77. s->s3->alert_dispatch = 1;
ssl/ssl_sess.c:691:1: Parameter `ctx->sessions->num_items`
689. }
690.
691. > int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
692. {
693. return remove_session_lock(ctx, c, 1);
ssl/ssl_sess.c:693:12: Call
691. int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c)
692. {
693. return remove_session_lock(ctx, c, 1);
^
694. }
695.
ssl/ssl_sess.c:696:1: Parameter `ctx->sessions->num_items`
694. }
695.
696. > static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
697. {
698. SSL_SESSION *r;
ssl/ssl_sess.c:706:17: Call
704. if ((r = lh_SSL_SESSION_retrieve(ctx->sessions, c)) == c) {
705. ret = 1;
706. r = lh_SSL_SESSION_delete(ctx->sessions, c);
^
707. SSL_SESSION_list_remove(ctx, c);
708. }
ssl/ssl_locl.h:581:1: Parameter `lh->num_items`
579. };
580.
581. > DEFINE_LHASH_OF(SSL_SESSION);
582. /* Needed in ssl_cert.c */
583. DEFINE_LHASH_OF(X509_NAME);
ssl/ssl_locl.h:581:1: Call
579. };
580.
581. > DEFINE_LHASH_OF(SSL_SESSION);
582. /* Needed in ssl_cert.c */
583. DEFINE_LHASH_OF(X509_NAME);
crypto/lhash/lhash.c:103:1: <LHS trace>
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:103:1: Parameter `lh->num_items`
101. }
102.
103. > void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
104. {
105. unsigned long hash;
crypto/lhash/lhash.c:123:5: Binary operation: ([0, 1+max(0, s->initial_ctx->sessions->num_items)] - 1):unsigned64 by call to `ssl3_send_alert`
121. }
122.
123. lh->num_items--;
^
124. if ((lh->num_nodes > MIN_NODES) &&
125. (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
|
https://github.com/openssl/openssl/blob/2a7de0fd5d9baf946ef4d2c51096b04dd47a8143/crypto/lhash/lhash.c/#L123
|
d2a_code_trace_data_45750
|
void
TIFFReverseBits(uint8* cp, tmsize_t n)
{
for (; n > 8; n -= 8) {
cp[0] = TIFFBitRevTable[cp[0]];
cp[1] = TIFFBitRevTable[cp[1]];
cp[2] = TIFFBitRevTable[cp[2]];
cp[3] = TIFFBitRevTable[cp[3]];
cp[4] = TIFFBitRevTable[cp[4]];
cp[5] = TIFFBitRevTable[cp[5]];
cp[6] = TIFFBitRevTable[cp[6]];
cp[7] = TIFFBitRevTable[cp[7]];
cp += 8;
}
while (n-- > 0)
*cp = TIFFBitRevTable[*cp], cp++;
}
tools/tiffcp.c:1051: error: Buffer Overrun L3
Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFWriteScanline`.
tools/tiffcp.c:1025:1: Parameter `out->tif_rawdata`
1023. * Separate -> contig by row.
1024. */
1025. DECLAREcpFunc(cpSeparate2ContigByRow)
^
1026. {
1027. tdata_t inbuf = _TIFFmalloc(TIFFScanlineSize(in));
tools/tiffcp.c:1051:7: Call
1049. }
1050. }
1051. if (TIFFWriteScanline(out, outbuf, row, 0) < 0) {
^
1052. TIFFError(TIFFFileName(out),
1053. "Error, can't write scanline %lu",
libtiff/tif_write.c:48:1: Parameter `*tif->tif_rawdata`
46. static int TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc);
47.
48. int
^
49. TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
50. {
libtiff/tif_write.c:107:8: Call
105. * Changing strips -- flush any data present.
106. */
107. if (!TIFFFlushData(tif))
^
108. return (-1);
109. tif->tif_curstrip = strip;
libtiff/tif_flush.c:98:1: Parameter `*tif->tif_rawdata`
96. * problems for other people.
97. */
98. int
^
99. TIFFFlushData(TIFF* tif)
100. {
libtiff/tif_flush.c:108:10: Call
106. return (0);
107. }
108. return (TIFFFlushData1(tif));
^
109. }
110.
libtiff/tif_write.c:709:1: Parameter `*tif->tif_rawdata`
707. * for infinite recursion.
708. */
709. int
^
710. TIFFFlushData1(TIFF* tif)
711. {
libtiff/tif_write.c:715:4: Call
713. if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
714. (tif->tif_flags & TIFF_NOBITREV) == 0)
715. TIFFReverseBits((uint8*)tif->tif_rawdata,
^
716. tif->tif_rawcc);
717. if (!TIFFAppendToStrip(tif,
libtiff/tif_swab.c:285:1: <Length trace>
283. }
284.
285. void
^
286. TIFFReverseBits(uint8* cp, tmsize_t n)
287. {
libtiff/tif_swab.c:285:1: Parameter `*cp`
283. }
284.
285. void
^
286. TIFFReverseBits(uint8* cp, tmsize_t n)
287. {
libtiff/tif_swab.c:296:3: Array access: Offset: [7, +oo] (⇐ [0, +oo] + 7) Size: [0, +oo] by call to `TIFFWriteScanline`
294. cp[5] = TIFFBitRevTable[cp[5]];
295. cp[6] = TIFFBitRevTable[cp[6]];
296. cp[7] = TIFFBitRevTable[cp[7]];
^
297. cp += 8;
298. }
|
https://gitlab.com/libtiff/libtiff/blob/771a4ea0a98c7a218c9f3add9a05e08d29625758/libtiff/tif_swab.c/#L296
|
d2a_code_trace_data_45751
|
size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
{
unsigned int M = (ctx->nonce.c[0] >> 3) & 7;
M *= 2;
M += 2;
if (len < M)
return 0;
memcpy(tag, ctx->cmac.c, M);
return M;
}
crypto/evp/e_aes.c:2106: error: BUFFER_OVERRUN_L3
Offset added: [2, 16] Size: [0, +oo] by call to `CRYPTO_ccm128_tag`.
Showing all 6 steps of the trace
crypto/evp/e_aes.c:2106:14: Call
2104. CRYPTO_ccm128_encrypt(ccm, in, out, len))
2105. return -1;
2106. if (!CRYPTO_ccm128_tag(ccm, out + len, cctx->M))
^
2107. return -1;
2108. return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;
crypto/modes/ccm128.c:469:1: <Offset trace>
467. }
468.
469. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
470. {
471. unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */
crypto/modes/ccm128.c:469:1: Parameter `len`
467. }
468.
469. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
470. {
471. unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */
crypto/modes/ccm128.c:469:1: <Length trace>
467. }
468.
469. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
470. {
471. unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */
crypto/modes/ccm128.c:469:1: Parameter `ctx->cmac.c[*]`
467. }
468.
469. > size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
470. {
471. unsigned int M = (ctx->nonce.c[0] >> 3) & 7; /* the M parameter */
crypto/modes/ccm128.c:477:5: Array access: Offset added: [2, 16] Size: [0, +oo] by call to `CRYPTO_ccm128_tag`
475. if (len < M)
476. return 0;
477. memcpy(tag, ctx->cmac.c, M);
^
478. return M;
479. }
|
https://github.com/openssl/openssl/blob/ac33c5a477568127ad99b1260a8978477de50e36/crypto/modes/ccm128.c/#L477
|
d2a_code_trace_data_45752
|
static int encode_test_init(struct evp_test *t, const char *encoding)
{
struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
if (strcmp(encoding, "canonical") == 0) {
edata->encoding = BASE64_CANONICAL_ENCODING;
} else if (strcmp(encoding, "valid") == 0) {
edata->encoding = BASE64_VALID_ENCODING;
} else if (strcmp(encoding, "invalid") == 0) {
edata->encoding = BASE64_INVALID_ENCODING;
t->expected_err = OPENSSL_strdup("DECODE_ERROR");
if (t->expected_err == NULL)
return 0;
} else {
fprintf(stderr, "Bad encoding: %s. Should be one of "
"{canonical, valid, invalid}\n", encoding);
return 0;
}
t->data = edata;
return 1;
}
test/evp_test.c:1558: error: NULL_DEREFERENCE
pointer `edata` last assigned on line 1551 could be null and is dereferenced at line 1558, column 9.
Showing all 20 steps of the trace
test/evp_test.c:1549:1: start of procedure encode_test_init()
1547. };
1548.
1549. > static int encode_test_init(struct evp_test *t, const char *encoding)
1550. {
1551. struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
test/evp_test.c:1551:5:
1549. static int encode_test_init(struct evp_test *t, const char *encoding)
1550. {
1551. > struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1552.
1553. if (strcmp(encoding, "canonical") == 0) {
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 false 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: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)
test/evp_test.c:1553:9: Taking false branch
1551. struct encode_data *edata = OPENSSL_zalloc(sizeof(*edata));
1552.
1553. if (strcmp(encoding, "canonical") == 0) {
^
1554. edata->encoding = BASE64_CANONICAL_ENCODING;
1555. } else if (strcmp(encoding, "valid") == 0) {
test/evp_test.c:1555:16: Taking false branch
1553. if (strcmp(encoding, "canonical") == 0) {
1554. edata->encoding = BASE64_CANONICAL_ENCODING;
1555. } else if (strcmp(encoding, "valid") == 0) {
^
1556. edata->encoding = BASE64_VALID_ENCODING;
1557. } else if (strcmp(encoding, "invalid") == 0) {
test/evp_test.c:1557:16: Taking true branch
1555. } else if (strcmp(encoding, "valid") == 0) {
1556. edata->encoding = BASE64_VALID_ENCODING;
1557. } else if (strcmp(encoding, "invalid") == 0) {
^
1558. edata->encoding = BASE64_INVALID_ENCODING;
1559. t->expected_err = OPENSSL_strdup("DECODE_ERROR");
test/evp_test.c:1558:9:
1556. edata->encoding = BASE64_VALID_ENCODING;
1557. } else if (strcmp(encoding, "invalid") == 0) {
1558. > edata->encoding = BASE64_INVALID_ENCODING;
1559. t->expected_err = OPENSSL_strdup("DECODE_ERROR");
1560. if (t->expected_err == NULL)
|
https://github.com/openssl/openssl/blob/ec04e866343d40a1e3e8e5db79557e279a2dd0d8/test/evp_test.c/#L1558
|
d2a_code_trace_data_45753
|
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:1643: error: Uninitialized Value
The value read from skip_dct[_] was never initialized.
libavcodec/mpegvideo_enc.c:1643:13:
1641. if(!skip_dct[3]) get_visual_weight(weight[3], ptr_y + dct_offset + 8, wrap_y);
1642. if(!skip_dct[4]) get_visual_weight(weight[4], ptr_cb , wrap_c);
1643. if(!skip_dct[5]) get_visual_weight(weight[5], ptr_cr , wrap_c);
^
1644. if(!s->chroma_y_shift){ /* 422 */
1645. if(!skip_dct[6]) get_visual_weight(weight[6], ptr_cb + (dct_offset>>1), wrap_c);
|
https://github.com/libav/libav/blob/3ec394ea823c2a6e65a6abbdb2041ce1c66964f8/libavcodec/mpegvideo_enc.c/#L1643
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.